diff --git "a/languages/go/validation.jsonl" "b/languages/go/validation.jsonl" new file mode 100644--- /dev/null +++ "b/languages/go/validation.jsonl" @@ -0,0 +1,1000 @@ +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s664345229", "group_id": "codeNet:p00009", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nconst MAX int = 1000000\nvar primes [MAX]int\n\nfunc main() {\n Init()\n var n, cnt int\n for {\n _, err := fmt.Scanf(\"%d\", &n)\n if err != nil {\n break\n }\n cnt = 0\n for i := 2; i <= n; i++ {\n cnt += primes[i]\n }\n fmt.Printf(\"%d\\n\", cnt)\n }\n}\n\nfunc Init() {\n for i := 0; i < MAX; i++ {\n primes[i] = 1\n }\n primes[0] = 0\n primes[1] = 0\n Soe()\n}\n\nfunc Soe() {\n for i := 2; i < MAX; i++ {\n if primes[i] > 0 {\n for j := i*2; j < MAX; j+=i {\n primes[j] = 0\n }\n }\n }\n}\n\n", "language": "Go", "metadata": {"date": 1551701802, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p00009.html", "problem_id": "p00009", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00009/input.txt", "sample_output_relpath": "derived/input_output/data/p00009/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00009/Go/s664345229.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s664345229", "user_id": "u649545723"}, "prompt_components": {"gold_output": "4\n2\n5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nconst MAX int = 1000000\nvar primes [MAX]int\n\nfunc main() {\n Init()\n var n, cnt int\n for {\n _, err := fmt.Scanf(\"%d\", &n)\n if err != nil {\n break\n }\n cnt = 0\n for i := 2; i <= n; i++ {\n cnt += primes[i]\n }\n fmt.Printf(\"%d\\n\", cnt)\n }\n}\n\nfunc Init() {\n for i := 0; i < MAX; i++ {\n primes[i] = 1\n }\n primes[0] = 0\n primes[1] = 0\n Soe()\n}\n\nfunc Soe() {\n for i := 2; i < MAX; i++ {\n if primes[i] > 0 {\n for j := i*2; j < MAX; j+=i {\n primes[j] = 0\n }\n }\n }\n}\n\n", "problem_context": "Prime Number\n\nWrite a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nInput\n\nInput consists of several datasets. Each dataset has an integer n (1 ≤ n ≤ 999,999) in a line.\n\nThe number of datasets is less than or equal to 30.\n\nOutput\n\nFor each dataset, prints the number of prime numbers.\n\nSample Input\n\n10\n3\n11\n\nOutput for the Sample Input\n\n4\n2\n5", "sample_input": "10\n3\n11\n"}, "reference_outputs": ["4\n2\n5\n"], "source_document_id": "p00009", "source_text": "Prime Number\n\nWrite a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nInput\n\nInput consists of several datasets. Each dataset has an integer n (1 ≤ n ≤ 999,999) in a line.\n\nThe number of datasets is less than or equal to 30.\n\nOutput\n\nFor each dataset, prints the number of prime numbers.\n\nSample Input\n\n10\n3\n11\n\nOutput for the Sample Input\n\n4\n2\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 845, "cpu_time_ms": 30, "memory_kb": 8948}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s116468817", "group_id": "codeNet:p00212", "input_text": "package main\n\nimport (\n\t\"container/heap\"\n\t\"fmt\"\n)\n\ntype Node struct {\n\tNowPosition int\n\tDiscountTicketTCount int\n\tAmount int\n}\n\ntype PriorityQueueNode []*Node\n\nfunc (pq PriorityQueueNode) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PriorityQueueNode) Less(i, j int) bool {\n\treturn pq[i].Amount < pq[j].Amount\n}\n\nfunc (pq PriorityQueueNode) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueueNode) Push(node interface{}) {\n\t*pq = append(*pq, node.(*Node))\n}\n\nfunc (pq *PriorityQueueNode) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\ntype Point struct {\n\tNextPoint int\n\tFee int\n}\n\ntype Memo struct {\n\tNowPoint int\n\tDiscountTicketTCount int\n}\n\nfunc main() {\n\tvar c, n, m, s, d int\n\tvar a, b, f int\n\n\tfor {\n\t\tfmt.Scan(&c, &n, &m, &s, &d)\n\t\tif c == 0 && n == 0 && m == 0 && s == 0 && d == 0 {\n\t\t\tbreak\n\t\t}\n\t\ts--\n\t\td--\n\t\tpointMap := make([][]Point, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tpointMap[i] = make([]Point, 0, n)\n\t\t}\n\t\tfor i := 0; i < m; i++ {\n\t\t\tfmt.Scan(&a, &b, &f)\n\t\t\ta--\n\t\t\tb--\n\t\t\tpointMap[a] = append(pointMap[a], Point{NextPoint: b, Fee: f})\n\t\t\tpointMap[b] = append(pointMap[b], Point{NextPoint: a, Fee: f})\n\t\t}\n\t\tpq := make(PriorityQueueNode, 0, m)\n\t\tstart := Node{NowPosition: s, DiscountTicketTCount: c, Amount: 0}\n\t\theap.Push(&pq, &start)\n\t\tmemo := make(map[Memo]struct{})\n\t\tfor len(pq) != 0 {\n\t\t\tnow := heap.Pop(&pq).(*Node)\n\t\t\tif now.NowPosition == d {\n\t\t\t\tfmt.Println(now.Amount)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tmemo[Memo{NowPoint: now.NowPosition, DiscountTicketTCount: now.DiscountTicketTCount}] = struct{}{}\n\t\t\tfor _, v := range pointMap[now.NowPosition] {\n\t\t\t\tnext := &Node{v.NextPoint, now.DiscountTicketTCount, now.Amount + v.Fee}\n\t\t\t\tif _, ok := memo[Memo{NowPoint: v.NextPoint, DiscountTicketTCount: now.DiscountTicketTCount}]; !ok {\n\t\t\t\t\theap.Push(&pq, next)\n\t\t\t\t}\n\t\t\t\tif now.DiscountTicketTCount > 0 {\n\t\t\t\t\tnext = &Node{v.NextPoint, now.DiscountTicketTCount - 1, now.Amount + v.Fee/2}\n\t\t\t\t\tif _, ok := memo[Memo{NowPoint: v.NextPoint, DiscountTicketTCount: now.DiscountTicketTCount}]; !ok {\n\t\t\t\t\t\theap.Push(&pq, next)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1516193568, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p00212.html", "problem_id": "p00212", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00212/input.txt", "sample_output_relpath": "derived/input_output/data/p00212/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00212/Go/s116468817.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s116468817", "user_id": "u018134297"}, "prompt_components": {"gold_output": "1000\n1100\n3750\n", "input_to_evaluate": "package main\n\nimport (\n\t\"container/heap\"\n\t\"fmt\"\n)\n\ntype Node struct {\n\tNowPosition int\n\tDiscountTicketTCount int\n\tAmount int\n}\n\ntype PriorityQueueNode []*Node\n\nfunc (pq PriorityQueueNode) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PriorityQueueNode) Less(i, j int) bool {\n\treturn pq[i].Amount < pq[j].Amount\n}\n\nfunc (pq PriorityQueueNode) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueueNode) Push(node interface{}) {\n\t*pq = append(*pq, node.(*Node))\n}\n\nfunc (pq *PriorityQueueNode) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\ntype Point struct {\n\tNextPoint int\n\tFee int\n}\n\ntype Memo struct {\n\tNowPoint int\n\tDiscountTicketTCount int\n}\n\nfunc main() {\n\tvar c, n, m, s, d int\n\tvar a, b, f int\n\n\tfor {\n\t\tfmt.Scan(&c, &n, &m, &s, &d)\n\t\tif c == 0 && n == 0 && m == 0 && s == 0 && d == 0 {\n\t\t\tbreak\n\t\t}\n\t\ts--\n\t\td--\n\t\tpointMap := make([][]Point, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tpointMap[i] = make([]Point, 0, n)\n\t\t}\n\t\tfor i := 0; i < m; i++ {\n\t\t\tfmt.Scan(&a, &b, &f)\n\t\t\ta--\n\t\t\tb--\n\t\t\tpointMap[a] = append(pointMap[a], Point{NextPoint: b, Fee: f})\n\t\t\tpointMap[b] = append(pointMap[b], Point{NextPoint: a, Fee: f})\n\t\t}\n\t\tpq := make(PriorityQueueNode, 0, m)\n\t\tstart := Node{NowPosition: s, DiscountTicketTCount: c, Amount: 0}\n\t\theap.Push(&pq, &start)\n\t\tmemo := make(map[Memo]struct{})\n\t\tfor len(pq) != 0 {\n\t\t\tnow := heap.Pop(&pq).(*Node)\n\t\t\tif now.NowPosition == d {\n\t\t\t\tfmt.Println(now.Amount)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tmemo[Memo{NowPoint: now.NowPosition, DiscountTicketTCount: now.DiscountTicketTCount}] = struct{}{}\n\t\t\tfor _, v := range pointMap[now.NowPosition] {\n\t\t\t\tnext := &Node{v.NextPoint, now.DiscountTicketTCount, now.Amount + v.Fee}\n\t\t\t\tif _, ok := memo[Memo{NowPoint: v.NextPoint, DiscountTicketTCount: now.DiscountTicketTCount}]; !ok {\n\t\t\t\t\theap.Push(&pq, next)\n\t\t\t\t}\n\t\t\t\tif now.DiscountTicketTCount > 0 {\n\t\t\t\t\tnext = &Node{v.NextPoint, now.DiscountTicketTCount - 1, now.Amount + v.Fee/2}\n\t\t\t\t\tif _, ok := memo[Memo{NowPoint: v.NextPoint, DiscountTicketTCount: now.DiscountTicketTCount}]; !ok {\n\t\t\t\t\t\theap.Push(&pq, next)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "problem_context": "高速バス\n\nA 君は高校の休みを利用して、高速��ス(以下、「バス」 )で一人旅をする計画を立てています。まず、A 君は一番行ってみたい町を選んでそこを目的地にしました。次に出発地から目的地までバスを乗り継いでいくルートを決めなければなりません。乗り継ぎをするときは、バスを降りてから別のバスに乗り換えるので、それぞれのバスの乗車券が必要になります。\n\nA 君は親戚のおじさんからバスの割引券を何枚かもらいました。 この券を 1 枚使うと乗車券 1 枚を半額で購入できます。例えば、図 1 の出発地5から目的地1へ行く場合には、5→4→6→2→1と5→3→1の二つの経路が考えられます。割引券が 2 枚あるとすると、交通費を最も安くするには5→4→6→2→1の経路をたどった場合、4→6と6→2の路線に割引を利用し、合計料金は 4600円となります。一方、5→3→1の経路をたどった場合、5→3と3→1の路線に割引を利用し、合計料金は 3750 円となります。\n\nA 君は観光にお金を回したいので、交通費はできるだけ少なくしようと考えています。そこで A 君は、出発地から目的地までの最も安い交通費を求めるプログラムを作成することにしました。\n\n図1\n\n割引券の枚数、バスがつなぐ町の数、バスの路線数、各バスの路線情報を入力とし、出発地から目的地までの最も安い交通費を出力するプログラムを作成してください。各バスは双方向に同一料金で運行しています。また、町の数を n とすると、町にはそれぞれ異なる 1 から n までの番号が振られています。出発地から目的地までの経路は必ず存在するものとします。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。 入力の終わりはゼロが5つの行で示されます。\n各データセットは以下の形式で与えられます。\n\nc n m s d\na1 b1 f1\na2 b2 f2\n:\nam bm fm\n\n1 行目に割引券の枚数 c (1 ≤ c ≤ 10)、バスがつなぐ町の数 n (2 ≤ n ≤ 100)、バスの路線数 m (1 ≤ m ≤ 500)、出発地の町番号 s と目的地の町番号 d (s ≠ d) が与えられます。\n\n続く m 行に第 i のバスの路線情報 ai, bi, fi (1 ≤ ai, bi ≤ n, 1000 ≤ fi ≤ 10000) が与えられます。ai, bi はバスの路線の始点と終点の町番号、fi はこの路線の料金を表す100 刻みの整数です。\n\nデータセットの数は 100 を超えません。\n\nOutput\n\n入力データセットごとに、最も安い交通費を1行に出力します。\n\nSample Input\n\n1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1000\n2 3 3 1 3\n1 3 2300\n1 2 1000\n2 3 1200\n2 6 6 5 1\n1 2 1500\n1 3 4500\n2 6 2000\n5 4 1000\n6 4 2200\n3 5 3000\n0 0 0 0 0\n\nOutput for the Sample Input\n\n1000\n1100\n3750", "sample_input": "1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1000\n2 3 3 1 3\n1 3 2300\n1 2 1000\n2 3 1200\n2 6 6 5 1\n1 2 1500\n1 3 4500\n2 6 2000\n5 4 1000\n6 4 2200\n3 5 3000\n0 0 0 0 0\n"}, "reference_outputs": ["1000\n1100\n3750\n"], "source_document_id": "p00212", "source_text": "高速バス\n\nA 君は高校の休みを利用して、高速バス(以下、「バス」 )で一人旅をする計画を立てています。まず、A 君は一番行ってみたい町を選んでそこを目的地にしました。次に出発地から目的地までバスを乗り継いでいくルートを決めなければなりません。乗り継ぎをするときは、バスを降りてから別のバスに乗り換えるので、それぞれのバスの乗車券が必要になります。\n\nA 君は親戚のおじさんからバスの割引券を何枚かもらいました。 この券を 1 枚使うと乗車券 1 枚を半額で購入できます。例えば、図 1 の出発地5から目的地1へ行く場合には、5→4→6→2→1と5→3→1の二つの経路が考えられます。割引券が 2 枚あるとすると、交通費を最も安くするには5→4→6→2→1の経路をたどった場合、4→6と6→2の路線に割引を利用し、合計料金は 4600円となります。一方、5→3→1の経路をたどった場合、5→3と3→1の路線に割引を利用し、合計料金は 3750 円となります。\n\nA 君は観光にお金を回したいので、交通費はできるだけ少なくしようと考えています。そこで A 君は、出発地から目的地までの最も安い交通費を求めるプログラムを作成することにしました。\n\n図1\n\n割引券の枚数、バスがつなぐ町の数、バスの路線数、各バスの路線情報を入力とし、出発地から目的地までの最も安い交通費を出力するプログラムを作成してください。各バスは双方向に同一料金で運行しています。また、町の数を n とすると、町にはそれぞれ異なる 1 から n までの番号が振ら���ています。出発地から目的地までの経路は必ず存在するものとします。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。 入力の終わりはゼロが5つの行で示されます。\n各データセットは以下の形式で与えられます。\n\nc n m s d\na1 b1 f1\na2 b2 f2\n:\nam bm fm\n\n1 行目に割引券の枚数 c (1 ≤ c ≤ 10)、バスがつなぐ町の数 n (2 ≤ n ≤ 100)、バスの路線数 m (1 ≤ m ≤ 500)、出発地の町番号 s と目的地の町番号 d (s ≠ d) が与えられます。\n\n続く m 行に第 i のバスの路線情報 ai, bi, fi (1 ≤ ai, bi ≤ n, 1000 ≤ fi ≤ 10000) が与えられます。ai, bi はバスの路線の始点と終点の町番号、fi はこの路線の料金を表す100 刻みの整数です。\n\nデータセットの数は 100 を超えません。\n\nOutput\n\n入力データセットごとに、最も安い交通費を1行に出力します。\n\nSample Input\n\n1 3 3 1 3\n1 3 2000\n1 2 1000\n2 3 1000\n2 3 3 1 3\n1 3 2300\n1 2 1000\n2 3 1200\n2 6 6 5 1\n1 2 1500\n1 3 4500\n2 6 2000\n5 4 1000\n6 4 2200\n3 5 3000\n0 0 0 0 0\n\nOutput for the Sample Input\n\n1000\n1100\n3750", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2166, "cpu_time_ms": 2120, "memory_kb": 23132}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s209874658", "group_id": "codeNet:p02030", "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, M := sc.nextInt(), sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tB := sc.nextIntSlice(M)\n\tAnd := []int{}\n\tOr := []int{}\n\tsetOr := make(map[int]bool)\n\tfor _, a := range A {\n\t\tsetOr[a] = true\n\t}\n\tfor _, b := range B {\n\t\tif setOr[b] {\n\t\t\tAnd = append(And, b)\n\t\t}\n\t\tsetOr[b] = true\n\t}\n\tfor k, _ := range setOr {\n\t\tOr = append(Or, k)\n\t}\n\tsort.Ints(Or)\n\tsort.Ints(And)\n\n\tfmt.Fprintln(wtr, len(And), len(Or))\n\tfor _, v := range And {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\tfor _, v := range Or {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\twtr.Flush()\n}\n\n", "language": "Go", "metadata": {"date": 1577097475, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02030.html", "problem_id": "p02030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02030/input.txt", "sample_output_relpath": "derived/input_output/data/p02030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02030/Go/s209874658.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s209874658", "user_id": "u525205447"}, "prompt_components": {"gold_output": "2 6\n1\n4\n1\n2\n3\n4\n7\n9\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, M := sc.nextInt(), sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tB := sc.nextIntSlice(M)\n\tAnd := []int{}\n\tOr := []int{}\n\tsetOr := make(map[int]bool)\n\tfor _, a := range A {\n\t\tsetOr[a] = true\n\t}\n\tfor _, b := range B {\n\t\tif setOr[b] {\n\t\t\tAnd = append(And, b)\n\t\t}\n\t\tsetOr[b] = true\n\t}\n\tfor k, _ := range setOr {\n\t\tOr = append(Or, k)\n\t}\n\tsort.Ints(Or)\n\tsort.Ints(And)\n\n\tfmt.Fprintln(wtr, len(And), len(Or))\n\tfor _, v := range And {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\tfor _, v := range Or {\n\t\tfmt.Fprintln(wtr, v)\n\t}\n\twtr.Flush()\n}\n\n", "problem_context": "A: 情報検索 / Information Search\n\n問題\n\nポスティングリストとは、検索語と出現文書 ID の対応関係を持たせたリストである。例えば\n\n北海道: 1, 2, 4, 9\n\n観光: 1, 3, 4, 7\n\nなどである。\n\n上記のポスティングリストから、and 検索をすると、ID 1, 4 の文書がヒットし、or 検索をすると、ID 1, 2, 3, 4, 7, 9 がヒットする。\n\nここで and 検索とは「どちらのリストにも含まれる要素を列挙する」ことであり、 or 検索とは「少なくともどちらか一方のリストに含まれる要素を列挙する」ことである。\n\nポスティングリストが与えられるので、and 検索と or 検索の結果をそれぞれ出力せよ。\n\n入力形式\n\nn m\na_1 a_2 $\\ldots$ a_n\nb_1 b_2 $\\ldots$ b_m\n\n入力はすべて整数からなる。\n\n1 行目には検索すべき 2 つのポスティングリストの長さ n と m が空白区切りで与えられる。\n\n2 行目と 3 行目にはそれぞれのポスティングリストに含まれる ID が空白区切りで与えられる。\n\n制約\n\n1 \\leq n, m \\leq 2\\times10^5\n\na_i < a_j (i < j)\n\nb_i < b_j (i < j)\n\n1 \\leq a_i, b_i \\leq 10^9\n\n出力形式\n\nand 検索のヒット数を A、or 検索のヒット数を B とする。\n\n最初の一行に A B の順に空白区切りで出力せよ。\n\n続く A 行に and 検索でヒットした ID を昇順に出力せよ。\n\n続く B 行に or 検索でヒットした ID を昇順に出力せよ。\n\n入力例1\n\n4 4\n1 2 4 9\n1 3 4 7\n\n出力例1\n\n2 6\n1\n4\n1\n2\n3\n4\n7\n9\n\n入力例2\n\n4 4\n1 3 5 7\n2 4 6 8\n\n出力例2\n\n0 8\n1\n2\n3\n4\n5\n6\n7\n8\n\n入力例3\n\n3 5\n1 2 3\n1 2 3 4 5\n\n出力例3\n\n3 5\n1\n2\n3\n1\n2\n3\n4\n5", "sample_input": "4 4\n1 2 4 9\n1 3 4 7\n"}, "reference_outputs": ["2 6\n1\n4\n1\n2\n3\n4\n7\n9\n"], "source_document_id": "p02030", "source_text": "A: 情報検索 / Information Search\n\n問題\n\nポスティングリストとは、検索語と出現文書 ID の対応関係を持たせたリストである。例えば\n\n北海道: 1, 2, 4, 9\n\n観光: 1, 3, 4, 7\n\nなどである。\n\n上記のポスティングリストから、and 検索をすると、ID 1, 4 の文書がヒットし、or 検索をすると、ID 1, 2, 3, 4, 7, 9 がヒットする。\n\nここで and 検索とは「どちらのリストにも含まれる要素を列挙する」ことであり、 or 検索とは「少なくともどちらか一方のリストに含まれる要素を列挙する」ことである。\n\nポスティングリストが与えられるので、and 検索と or 検索の結果をそれぞれ出力せよ。\n\n入力形式\n\nn m\na_1 a_2 $\\ldots$ a_n\nb_1 b_2 $\\ldots$ b_m\n\n入力はすべて整数からなる。\n\n1 行目には検索すべき 2 つのポスティングリストの長さ n と m が空白区切りで与えられる。\n\n2 行目と 3 行目にはそれぞれのポスティングリストに含まれる ID が空白区切りで与えられる。\n\n制約\n\n1 \\leq n, m \\leq 2\\times10^5\n\na_i < a_j (i < j)\n\nb_i < b_j (i < j)\n\n1 \\leq a_i, b_i \\leq 10^9\n\n出力形式\n\nand 検索のヒット数を A、or 検索のヒット数を B とする。\n\n最初の一行に A B の順に空白区切りで出力せよ。\n\n続く A 行に and 検索でヒットした ID を昇順に出力せよ。\n\n続く B 行に or 検索でヒットした ID を昇順に出力せよ。\n\n入力例1\n\n4 4\n1 2 4 9\n1 3 4 7\n\n出力例1\n\n2 6\n1\n4\n1\n2\n3\n4\n7\n9\n\n入力例2\n\n4 4\n1 3 5 7\n2 4 6 8\n\n出力例2\n\n0 8\n1\n2\n3\n4\n5\n6\n7\n8\n\n入力例3\n\n3 5\n1 2 3\n1 2 3 4 5\n\n出力例3\n\n3 5\n1\n2\n3\n1\n2\n3\n4\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2156, "cpu_time_ms": 250, "memory_kb": 21920}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s316646733", "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 [][16]byte) bool {\n\n\tfor _, s := range parents {\n\t\tif s == state {\n\t\t\treturn false\n\t\t}\n\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 = append(parents, state)\n\n\tok, ur := up(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, ur, p) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, dr := down(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, dr, p) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, lr := left(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, lr, p) {\n\t\t\treturn true\n\t\t}\n\t}\n\tok, rr := right(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, rr, p) {\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, [][16]byte{}) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1526198464, "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/s316646733.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s316646733", "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 [][16]byte) bool {\n\n\tfor _, s := range parents {\n\t\tif s == state {\n\t\t\treturn false\n\t\t}\n\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 = append(parents, state)\n\n\tok, ur := up(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, ur, p) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, dr := down(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, dr, p) {\n\t\t\treturn true\n\n\t\t}\n\t}\n\tok, lr := left(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, lr, p) {\n\t\t\treturn true\n\t\t}\n\t}\n\tok, rr := right(state)\n\tif ok {\n\t\tvar p [][16]byte\n\t\tcopy(p, parents)\n\t\tif dls(limit, now+1, rr, p) {\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, [][16]byte{}) {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2338, "cpu_time_ms": 4200, "memory_kb": 7572}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s744274459", "group_id": "codeNet:p02250", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"index/suffixarray\"\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 string\n\tvar q int\n\n\tfmt.Fscan(r, &s)\n\tfmt.Fscan(r, &q)\n\n\tindex := suffixarray.New([]byte(s))\n\n\tfor i := 0; i < q; i++ {\n\t\tvar p string\n\t\tfmt.Fscan(r, &p)\n\n\t\tres := index.Lookup([]byte(p), 1)\n\t\tif len(res) > 0 {\n\t\t\tfmt.Fprintln(w, 1)\n\t\t} else {\n\t\t\tfmt.Fprintln(w, 0)\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1592872159, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02250.html", "problem_id": "p02250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02250/input.txt", "sample_output_relpath": "derived/input_output/data/p02250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02250/Go/s744274459.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s744274459", "user_id": "u836797982"}, "prompt_components": {"gold_output": "1\n1\n0\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"index/suffixarray\"\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 string\n\tvar q int\n\n\tfmt.Fscan(r, &s)\n\tfmt.Fscan(r, &q)\n\n\tindex := suffixarray.New([]byte(s))\n\n\tfor i := 0; i < q; i++ {\n\t\tvar p string\n\t\tfmt.Fscan(r, &p)\n\n\t\tres := index.Lookup([]byte(p), 1)\n\t\tif len(res) > 0 {\n\t\t\tfmt.Fprintln(w, 1)\n\t\t} else {\n\t\t\tfmt.Fprintln(w, 0)\n\t\t}\n\t}\n}\n\n", "problem_context": "String Search\n\nDetermine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.\n\nInput\n\nIn the first line, a text T is given. In the second line, an integer Q denoting the number of queries is given. In the following Q lines, the patterns P_i are given respectively.\n\nOutput\n\nFor each question, print 1 if the text includes P_i, or print 0 otherwise.\n\nConstraints\n\n1 ≤ length of T ≤ 1000000\n\n1 ≤ length of P_i ≤ 1000\n\n1 ≤ Q ≤ 10000\n\nThe input consists of alphabetical characters and digits\n\nSample Input 1\n\naabaaa\n4\naa\nba\nbb\nxyz\n\nSample Output 1\n\n1\n1\n0\n0", "sample_input": "aabaaa\n4\naa\nba\nbb\nxyz\n"}, "reference_outputs": ["1\n1\n0\n0\n"], "source_document_id": "p02250", "source_text": "String Search\n\nDetermine whether a text T includes a pattern P. Your program should answer for given queries consisting of P_i.\n\nInput\n\nIn the first line, a text T is given. In the second line, an integer Q denoting the number of queries is given. In the following Q lines, the patterns P_i are given respectively.\n\nOutput\n\nFor each question, print 1 if the text includes P_i, or print 0 otherwise.\n\nConstraints\n\n1 ≤ length of T ≤ 1000000\n\n1 ≤ length of P_i ≤ 1000\n\n1 ≤ Q ≤ 10000\n\nThe input consists of alphabetical characters and digits\n\nSample Input 1\n\naabaaa\n4\naa\nba\nbb\nxyz\n\nSample Output 1\n\n1\n1\n0\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 449, "cpu_time_ms": 850, "memory_kb": 40420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s928878225", "group_id": "codeNet:p02258", "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\tsc := bufio.NewScanner(os.Stdin)\n\tn := stdin(sc)\n\tary := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv := stdin(sc)\n\t\tary[i] = v\n\t}\n\tmaxv := -math.MaxInt32\n\tminv := ary[0]\n\tfor i := 1; i < n; i++ {\n\t\tmaxv = max(maxv, ary[i]-minv)\n\t\tminv = min(minv, ary[i])\n\t}\n\tfmt.Println(maxv)\n}\n\nfunc stdin(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tnum, _ := strconv.Atoi(sc.Text())\n\treturn num\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 b\n\t}\n\treturn a\n}\n\n", "language": "Go", "metadata": {"date": 1534923634, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/Go/s928878225.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s928878225", "user_id": "u827024925"}, "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\tsc := bufio.NewScanner(os.Stdin)\n\tn := stdin(sc)\n\tary := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv := stdin(sc)\n\t\tary[i] = v\n\t}\n\tmaxv := -math.MaxInt32\n\tminv := ary[0]\n\tfor i := 1; i < n; i++ {\n\t\tmaxv = max(maxv, ary[i]-minv)\n\t\tminv = min(minv, ary[i])\n\t}\n\tfmt.Println(maxv)\n}\n\nfunc stdin(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tnum, _ := strconv.Atoi(sc.Text())\n\treturn num\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 b\n\t}\n\treturn a\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 588, "cpu_time_ms": 10, "memory_kb": 5404}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s990793981", "group_id": "codeNet:p02258", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tnum, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn num\n}\n\nfunc max(a int, 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 int, 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 := scanInt()\n\tmaxv := -1000000000\n\tminv := scanInt()\n\tfor i := 0; i < N-1; i++ {\n\t\tr := scanInt()\n\t\tmaxv = max(maxv, r-minv)\n\t\tminv = min(minv, r)\n\t}\n\tfmt.Println(maxv)\n}\n\n", "language": "Go", "metadata": {"date": 1561564034, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/Go/s990793981.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s990793981", "user_id": "u876097541"}, "prompt_components": {"gold_output": "3\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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tnum, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn num\n}\n\nfunc max(a int, 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 int, 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 := scanInt()\n\tmaxv := -1000000000\n\tminv := scanInt()\n\tfor i := 0; i < N-1; i++ {\n\t\tr := scanInt()\n\t\tmaxv = max(maxv, r-minv)\n\t\tminv = min(minv, r)\n\t}\n\tfmt.Println(maxv)\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 565, "cpu_time_ms": 10, "memory_kb": 4136}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s469400599", "group_id": "codeNet:p02258", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = NewScanner()\n\nfunc main() {\n n := sc.NextInt()\n minr := sc.NextInt()\n\n var (\n r int\n max = int(-1*2e10 - 1)\n )\n for i := 1; i < n; i++ {\n r = sc.NextInt()\n diff := r - minr\n if max < diff {\n max = diff\n }\n if minr > r {\n minr = r\n }\n }\n fmt.Println(max)\n}\n\ntype Scanner struct {\n sc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n return &Scanner{sc}\n}\n\nfunc (sc *Scanner) NextInt() int {\n sc.sc.Scan()\n i, err := strconv.Atoi(sc.sc.Text())\n if err != nil {\n panic(err)\n }\n return i\n}\n", "language": "Go", "metadata": {"date": 1558806192, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/Go/s469400599.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469400599", "user_id": "u713745478"}, "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 = NewScanner()\n\nfunc main() {\n n := sc.NextInt()\n minr := sc.NextInt()\n\n var (\n r int\n max = int(-1*2e10 - 1)\n )\n for i := 1; i < n; i++ {\n r = sc.NextInt()\n diff := r - minr\n if max < diff {\n max = diff\n }\n if minr > r {\n minr = r\n }\n }\n fmt.Println(max)\n}\n\ntype Scanner struct {\n sc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n return &Scanner{sc}\n}\n\nfunc (sc *Scanner) NextInt() int {\n sc.sc.Scan()\n i, err := strconv.Atoi(sc.sc.Text())\n if err != nil {\n panic(err)\n }\n return i\n}\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 937, "cpu_time_ms": 20, "memory_kb": 4100}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s287113972", "group_id": "codeNet:p02267", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\t//n := stdin.Text()\n\tstdin.Scan()\n\ts := stdin.Text()\n\tstdin.Scan()\n\t//q := stdin.Text()\n\tstdin.Scan()\n\tt := stdin.Text()\n\n\tcnt := 0\n\tfor _, tv := range strings.Split(t, \" \") {\n\t\tfor _, sv := range strings.Split(s, \" \") {\n\t\t\tif tv == sv {\n\t\t\t\tcnt++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\n}\n\n", "language": "Go", "metadata": {"date": 1586442960, "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/s287113972.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287113972", "user_id": "u093419942"}, "prompt_components": {"gold_output": "3\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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\t//n := stdin.Text()\n\tstdin.Scan()\n\ts := stdin.Text()\n\tstdin.Scan()\n\t//q := stdin.Text()\n\tstdin.Scan()\n\tt := stdin.Text()\n\n\tcnt := 0\n\tfor _, tv := range strings.Split(t, \" \") {\n\t\tfor _, sv := range strings.Split(s, \" \") {\n\t\t\tif tv == sv {\n\t\t\t\tcnt++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 417, "cpu_time_ms": 10, "memory_kb": 5848}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s676158486", "group_id": "codeNet:p02271", "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\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tas, err := nextInts(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tq, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tms, err := nextInts(q, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range ms {\n\t\tif exhaustiveSearch(v, as) {\n\t\t\tfmt.Println(\"yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"no\")\n\t\t}\n\t}\n}\n\nfunc exhaustiveSearch(x int, elements []int) bool {\n\treturn solve(x, 0, elements)\n}\n\nfunc solve(target int, index int, elements []int) bool {\n\tif target == 0 {\n\t\treturn true\n\t} else if target < 0 || index >= len(elements) {\n\t\treturn false\n\t} else {\n\t\treturn solve(target-elements[index], index+1, elements) ||\n\t\t\tsolve(target, index+1, elements)\n\t}\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\nfunc nextInts(n int, sc *bufio.Scanner) ([]int, error) {\n\trs := make([]int, n)\n\tfor i, _ := range rs {\n\t\tx, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trs[i] = x\n\t}\n\treturn rs, nil\n}\n\n", "language": "Go", "metadata": {"date": 1528463561, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02271.html", "problem_id": "p02271", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02271/input.txt", "sample_output_relpath": "derived/input_output/data/p02271/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02271/Go/s676158486.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s676158486", "user_id": "u073049338"}, "prompt_components": {"gold_output": "no\nno\nyes\nyes\nyes\nyes\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\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tas, err := nextInts(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tq, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tms, err := nextInts(q, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range ms {\n\t\tif exhaustiveSearch(v, as) {\n\t\t\tfmt.Println(\"yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"no\")\n\t\t}\n\t}\n}\n\nfunc exhaustiveSearch(x int, elements []int) bool {\n\treturn solve(x, 0, elements)\n}\n\nfunc solve(target int, index int, elements []int) bool {\n\tif target == 0 {\n\t\treturn true\n\t} else if target < 0 || index >= len(elements) {\n\t\treturn false\n\t} else {\n\t\treturn solve(target-elements[index], index+1, elements) ||\n\t\t\tsolve(target, index+1, elements)\n\t}\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\nfunc nextInts(n int, sc *bufio.Scanner) ([]int, error) {\n\trs := make([]int, n)\n\tfor i, _ := range rs {\n\t\tx, err := nextInt(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trs[i] = x\n\t}\n\treturn rs, nil\n}\n\n", "problem_context": "Exhaustive Search\n\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make M by adding elements in A, otherwise \"no\". You can use an element only once.\n\nYou are given the sequence A and q questions where each question contains Mi.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers (Mi) are given.\n\nOutput\n\nFor each question Mi, print yes or no.\n\nConstraints\n\nn ≤ 20\n\nq ≤ 200\n\n1 ≤ elements in A ≤ 2000\n\n1 ≤ Mi ≤ 2000\n\nSample Input 1\n\n5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n\nSample Output 1\n\nno\nno\nyes\nyes\nyes\nyes\nno\nno\n\nNotes\n\nYou can solve this problem by a Burte Force approach. Suppose solve(p, t) is a function which checkes whether you can make t by selecting elements after p-th element (inclusive). Then you can recursively call the following functions:\n\nsolve(0, M)\n\nsolve(1, M-{sum created from elements before 1st element})\n\nsolve(2, M-{sum created from elements before 2nd element})\n\n...\n\nThe recursive function has two choices: you selected p-th element and not. So, you can check solve(p+1, t-A[p]) and solve(p+1, t) in solve(p, t) to check the all combinations.\n\nFor example, the following figure shows that 8 can be made by A[0] + A[2].", "sample_input": "5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n"}, "reference_outputs": ["no\nno\nyes\nyes\nyes\nyes\nno\nno\n"], "source_document_id": "p02271", "source_text": "Exhaustive Search\n\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make M by adding elements in A, otherwise \"no\". You can use an element only once.\n\nYou are given the sequence A and q questions where each question contains Mi.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers (Mi) are given.\n\nOutput\n\nFor each question Mi, print yes or no.\n\nConstraints\n\nn ≤ 20\n\nq ≤ 200\n\n1 ≤ elements in A ≤ 2000\n\n1 ≤ Mi ≤ 2000\n\nSample Input 1\n\n5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n\nSample Output 1\n\nno\nno\nyes\nyes\nyes\nyes\nno\nno\n\nNotes\n\nYou can solve this problem by a Burte Force approach. Suppose solve(p, t) is a function which checkes whether you can make t by selecting elements after p-th element (inclusive). Then you can recursively call the following functions:\n\nsolve(0, M)\n\nsolve(1, M-{sum created from elements before 1st element})\n\nsolve(2, M-{sum created from elements before 2nd element})\n\n...\n\nThe recursive function has two choices: you selected p-th element and not. So, you can check solve(p+1, t-A[p]) and solve(p+1, t) in solve(p, t) to check the all combinations.\n\nFor example, the following figure shows that 8 can be made by A[0] + A[2].", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1134, "cpu_time_ms": 900, "memory_kb": 1088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s778853084", "group_id": "codeNet:p02274", "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\tSENTINEL = 2000000000\n)\n\nfunc main() {\n\tfmt.Println(answer(os.Stdin))\n}\n\nfunc answer(r io.Reader) int {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\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}\n\treturn mergeSort(A, n, 0, n)\n}\n\nfunc merge(A []int, n, left, mid, right int) int {\n\tn1 := mid - left\n\tn2 := right - mid\n\tL, R := make([]int, n1+1), make([]int, n2+1)\n\tfor i := 0; i < n1; i++ {\n\t\tL[i] = A[left+i]\n\t}\n\tfor i := 0; i < n2; i++ {\n\t\tR[i] = A[mid+i]\n\t}\n\tL[n1], R[n2] = SENTINEL, SENTINEL\n\n\tcnt := 0\n\ti, j := 0, 0\n\tfor k := left; k < right; k++ {\n\t\tif L[i] <= R[j] {\n\t\t\tA[k] = L[i]\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tA[k] = R[j]\n\t\tj++\n\t\tcnt += n1 - i\n\t}\n\treturn cnt\n}\n\nfunc mergeSort(A []int, n, left, right int) int {\n\tif left+1 < right {\n\t\tmid := (left + right) / 2\n\t\tv1 := mergeSort(A, n, left, mid)\n\t\tv2 := mergeSort(A, n, mid, right)\n\t\tv3 := merge(A, n, left, mid, right)\n\t\treturn v1 + v2 + v3\n\t}\n\treturn 0\n}\n\n", "language": "Go", "metadata": {"date": 1527771780, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02274.html", "problem_id": "p02274", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02274/input.txt", "sample_output_relpath": "derived/input_output/data/p02274/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02274/Go/s778853084.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s778853084", "user_id": "u071509228"}, "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)\n\nconst (\n\tSENTINEL = 2000000000\n)\n\nfunc main() {\n\tfmt.Println(answer(os.Stdin))\n}\n\nfunc answer(r io.Reader) int {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\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}\n\treturn mergeSort(A, n, 0, n)\n}\n\nfunc merge(A []int, n, left, mid, right int) int {\n\tn1 := mid - left\n\tn2 := right - mid\n\tL, R := make([]int, n1+1), make([]int, n2+1)\n\tfor i := 0; i < n1; i++ {\n\t\tL[i] = A[left+i]\n\t}\n\tfor i := 0; i < n2; i++ {\n\t\tR[i] = A[mid+i]\n\t}\n\tL[n1], R[n2] = SENTINEL, SENTINEL\n\n\tcnt := 0\n\ti, j := 0, 0\n\tfor k := left; k < right; k++ {\n\t\tif L[i] <= R[j] {\n\t\t\tA[k] = L[i]\n\t\t\ti++\n\t\t\tcontinue\n\t\t}\n\t\tA[k] = R[j]\n\t\tj++\n\t\tcnt += n1 - i\n\t}\n\treturn cnt\n}\n\nfunc mergeSort(A []int, n, left, right int) int {\n\tif left+1 < right {\n\t\tmid := (left + right) / 2\n\t\tv1 := mergeSort(A, n, left, mid)\n\t\tv2 := mergeSort(A, n, mid, right)\n\t\tv3 := merge(A, n, left, mid, right)\n\t\treturn v1 + v2 + v3\n\t}\n\treturn 0\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nThe Number of Inversions\n\nFor a given sequence $A = \\{a_0, a_1, ... a_{n-1}\\}$, the number of pairs $(i, j)$ where $a_i > a_j$ and $i < j$, is called the number of inversions. The number of inversions is equal to the number of swaps of Bubble Sort defined in the following program:\n\nbubbleSort(A)\ncnt = 0 // the number of inversions\nfor i = 0 to A.length-1\nfor j = A.length-1 downto i+1\nif A[j] < A[j-1]\nswap(A[j], A[j-1])\ncnt++\n\nreturn cnt\n\nFor the given sequence $A$, print the number of inversions of $A$. Note that you should not use the above program, which brings Time Limit Exceeded.\n\nInput\n\nIn the first line, an integer $n$, the number of elements in $A$, is given. In the second line, the elements $a_i$ ($i = 0, 1, .. n-1$) are given separated by space characters.\n\noutput\n\nPrint the number of inversions in a line.\n\nConstraints\n\n$ 1 \\leq n \\leq 200,000$\n\n$ 0 \\leq a_i \\leq 10^9$\n\n$a_i$ are all different\n\nSample Input 1\n\n5\n3 5 2 1 4\n\nSample Output 1\n\n6\n\nSample Input 2\n\n3\n3 1 2\n\nSample Output 2\n\n2", "sample_input": "5\n3 5 2 1 4\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02274", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nThe Number of Inversions\n\nFor a given sequence $A = \\{a_0, a_1, ... a_{n-1}\\}$, the number of pairs $(i, j)$ where $a_i > a_j$ and $i < j$, is called the number of inversions. The number of inversions is equal to the number of swaps of Bubble Sort defined in the following program:\n\nbubbleSort(A)\ncnt = 0 // the number of inversions\nfor i = 0 to A.length-1\nfor j = A.length-1 downto i+1\nif A[j] < A[j-1]\nswap(A[j], A[j-1])\ncnt++\n\nreturn cnt\n\nFor the given sequence $A$, print the number of inversions of $A$. Note that you should not use the above program, which brings Time Limit Exceeded.\n\nInput\n\nIn the first line, an integer $n$, the number of elements in $A$, is given. In the second line, the elements $a_i$ ($i = 0, 1, .. n-1$) are given separated by space characters.\n\noutput\n\nPrint the number of inversions in a line.\n\nConstraints\n\n$ 1 \\leq n \\leq 200,000$\n\n$ 0 \\leq a_i \\leq 10^9$\n\n$a_i$ are all different\n\nSample Input 1\n\n5\n3 5 2 1 4\n\nSample Output 1\n\n6\n\nSample Input 2\n\n3\n3 1 2\n\nSample Output 2\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1089, "cpu_time_ms": 100, "memory_kb": 8528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s757454666", "group_id": "codeNet:p02277", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Card struct {\n\tmark string\n\tvalue int\n}\n\nfunc (self Card) Equal(other Card) bool {\n\treturn self.mark == other.mark && self.value == other.value\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcards, err := nextCards(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcopied := make([]Card, len(cards))\n\tcopy(copied, cards)\n\tquickSort(cards)\n\tsortedByMerge, _ := mergeSort(copied)\n\tif isEqualCards(cards, sortedByMerge) {\n\t\tfmt.Println(\"Stable\")\n\t} else {\n\t\tfmt.Println(\"Not stable\")\n\t}\n\tfor _, card := range cards {\n\t\tfmt.Printf(\"%s %d\\n\", card.mark, card.value)\n\t}\n}\n\nfunc quickSort(cards []Card) {\n\tif len(cards) > 1 {\n\t\tq := partition(cards, 0, len(cards)-1)\n\t\tquickSort(cards[:q])\n\t\tquickSort(cards[q+1:])\n\t}\n}\n\nfunc partition(cards []Card, p int, r int) int {\n\t// fmt.Printf(\"before: %v\\n\", cards)\n\tk := p - 1\n\tv := cards[r].value\n\tfor i := p; i < r; i++ {\n\t\tif cards[i].value <= v {\n\t\t\tk++\n\t\t\tcards[i], cards[k] = cards[k], cards[i]\n\t\t}\n\t}\n\tk++\n\tcards[r], cards[k] = cards[k], cards[r]\n\t// fmt.Printf(\"after: %v\\n\", cards)\n\treturn k\n}\n\nfunc mergeSort(elems []Card) ([]Card, int) {\n\tlength := len(elems)\n\tif length == 1 {\n\t\treturn elems, 0\n\t}\n\tmid := length / 2\n\tleft, countL := mergeSort(elems[:mid])\n\tright, countR := mergeSort(elems[mid:])\n\tsorted, countS := merge(left, right)\n\treturn sorted, (countL + countR + countS)\n}\n\nfunc merge(xs, ys []Card) ([]Card, int) {\n\tsorted := make([]Card, 0)\n\tcount := 0\n\tfor len(xs) > 0 && len(ys) > 0 {\n\t\tif xs[0].value <= ys[0].value {\n\t\t\tsorted = append(sorted, xs[0])\n\t\t\txs = xs[1:]\n\t\t} else {\n\t\t\tsorted = append(sorted, ys[0])\n\t\t\tys = ys[1:]\n\t\t}\n\t\tcount++\n\t}\n\tif len(xs) > 0 {\n\t\tsorted = append(sorted, xs...)\n\t\tcount += len(xs)\n\t} else if len(ys) > 0 {\n\t\tsorted = append(sorted, ys...)\n\t\tcount += len(ys)\n\t}\n\treturn sorted, count\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\nfunc nextText(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextCard(sc *bufio.Scanner) (Card, error) {\n\tmark := nextText(sc)\n\tvalue, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn Card{mark, value}, nil\n}\n\nfunc nextCards(n int, sc *bufio.Scanner) ([]Card, error) {\n\tns := make([]Card, n)\n\tfor i, _ := range ns {\n\t\tx, err := nextCard(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tns[i] = x\n\t}\n\treturn ns, nil\n}\n\nfunc isEqualCards(x []Card, y []Card) bool {\n\tif len(x) != len(y) {\n\t\treturn false\n\t}\n\tfor i := 0; i < len(x); i++ {\n\t\tif !x[i].Equal(y[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n", "language": "Go", "metadata": {"date": 1528730488, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02277.html", "problem_id": "p02277", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02277/input.txt", "sample_output_relpath": "derived/input_output/data/p02277/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02277/Go/s757454666.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s757454666", "user_id": "u073049338"}, "prompt_components": {"gold_output": "Not stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Card struct {\n\tmark string\n\tvalue int\n}\n\nfunc (self Card) Equal(other Card) bool {\n\treturn self.mark == other.mark && self.value == other.value\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcards, err := nextCards(n, sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tcopied := make([]Card, len(cards))\n\tcopy(copied, cards)\n\tquickSort(cards)\n\tsortedByMerge, _ := mergeSort(copied)\n\tif isEqualCards(cards, sortedByMerge) {\n\t\tfmt.Println(\"Stable\")\n\t} else {\n\t\tfmt.Println(\"Not stable\")\n\t}\n\tfor _, card := range cards {\n\t\tfmt.Printf(\"%s %d\\n\", card.mark, card.value)\n\t}\n}\n\nfunc quickSort(cards []Card) {\n\tif len(cards) > 1 {\n\t\tq := partition(cards, 0, len(cards)-1)\n\t\tquickSort(cards[:q])\n\t\tquickSort(cards[q+1:])\n\t}\n}\n\nfunc partition(cards []Card, p int, r int) int {\n\t// fmt.Printf(\"before: %v\\n\", cards)\n\tk := p - 1\n\tv := cards[r].value\n\tfor i := p; i < r; i++ {\n\t\tif cards[i].value <= v {\n\t\t\tk++\n\t\t\tcards[i], cards[k] = cards[k], cards[i]\n\t\t}\n\t}\n\tk++\n\tcards[r], cards[k] = cards[k], cards[r]\n\t// fmt.Printf(\"after: %v\\n\", cards)\n\treturn k\n}\n\nfunc mergeSort(elems []Card) ([]Card, int) {\n\tlength := len(elems)\n\tif length == 1 {\n\t\treturn elems, 0\n\t}\n\tmid := length / 2\n\tleft, countL := mergeSort(elems[:mid])\n\tright, countR := mergeSort(elems[mid:])\n\tsorted, countS := merge(left, right)\n\treturn sorted, (countL + countR + countS)\n}\n\nfunc merge(xs, ys []Card) ([]Card, int) {\n\tsorted := make([]Card, 0)\n\tcount := 0\n\tfor len(xs) > 0 && len(ys) > 0 {\n\t\tif xs[0].value <= ys[0].value {\n\t\t\tsorted = append(sorted, xs[0])\n\t\t\txs = xs[1:]\n\t\t} else {\n\t\t\tsorted = append(sorted, ys[0])\n\t\t\tys = ys[1:]\n\t\t}\n\t\tcount++\n\t}\n\tif len(xs) > 0 {\n\t\tsorted = append(sorted, xs...)\n\t\tcount += len(xs)\n\t} else if len(ys) > 0 {\n\t\tsorted = append(sorted, ys...)\n\t\tcount += len(ys)\n\t}\n\treturn sorted, count\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\treturn strconv.Atoi(sc.Text())\n}\n\nfunc nextText(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextCard(sc *bufio.Scanner) (Card, error) {\n\tmark := nextText(sc)\n\tvalue, err := nextInt(sc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn Card{mark, value}, nil\n}\n\nfunc nextCards(n int, sc *bufio.Scanner) ([]Card, error) {\n\tns := make([]Card, n)\n\tfor i, _ := range ns {\n\t\tx, err := nextCard(sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tns[i] = x\n\t}\n\treturn ns, nil\n}\n\nfunc isEqualCards(x []Card, y []Card) bool {\n\tif len(x) != len(y) {\n\t\treturn false\n\t}\n\tfor i := 0; i < len(x); i++ {\n\t\tif !x[i].Equal(y[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n", "problem_context": "Quick Sort\n\nLet's arrange a deck of cards. Your task is to sort totally n cards. A card consists of a part of a suit (S, H, C or D) and an number. Write a program which sorts such cards based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nQuicksort(A, p, r)\n1 if p < r\n2 then q = Partition(A, p, r)\n3 run Quicksort(A, p, q-1)\n4 run Quicksort(A, q+1, r)\n\nHere, A is an array which represents a deck of cards and comparison operations are performed based on the numbers.\n\nYour program should also report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer n, the number of cards.\n\nn cards are given in the following lines. Each card is given in a line and represented by a pair of a character and an integer separated by a single space.\n\nOutput\n\nIn the first line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the following lines, print the arranged cards in the same manner of that of the input.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n1 ≤ the number of a card ≤ 109\n\nThere are no identical card in the input\n\nSample Input 1\n\n6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n\nSample Output 1\n\nNot stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n\nSample Input 2\n\n2\nS 1\nH 1\n\nSample Output 2\n\nStable\nS 1\nH 1", "sample_input": "6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n"}, "reference_outputs": ["Not stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n"], "source_document_id": "p02277", "source_text": "Quick Sort\n\nLet's arrange a deck of cards. Your task is to sort totally n cards. A card consists of a part of a suit (S, H, C or D) and an number. Write a program which sorts such cards based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nQuicksort(A, p, r)\n1 if p < r\n2 then q = Partition(A, p, r)\n3 run Quicksort(A, p, q-1)\n4 run Quicksort(A, q+1, r)\n\nHere, A is an array which represents a deck of cards and comparison operations are performed based on the numbers.\n\nYour program should also report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer n, the number of cards.\n\nn cards are given in the following lines. Each card is given in a line and represented by a pair of a character and an integer separated by a single space.\n\nOutput\n\nIn the first line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the following lines, print the arranged cards in the same manner of that of the input.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n1 ≤ the number of a card ≤ 109\n\nThere are no identical card in the input\n\nSample Input 1\n\n6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n\nSample Output 1\n\nNot stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n\nSample Input 2\n\n2\nS 1\nH 1\n\nSample Output 2\n\nStable\nS 1\nH 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2643, "cpu_time_ms": 660, "memory_kb": 19460}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s305201095", "group_id": "codeNet:p02280", "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(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tnum, _ := strconv.Atoi(scanner.Text())\n\treturn num\n}\n\nfunc scanIntArray() []int {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tresult := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tresult = append(result, nextInt(sc))\n\t}\n\n\treturn result\n}\n\ntype Input struct {\n\tid int\n\tleft int\n\tright int\n}\n\ntype Element struct {\n\tid int\n\tparent int\n\tsibling int\n\tdegree int\n\tdepth int\n\theight int\n\tleft *Element\n\tright *Element\n}\n\nvar maxDepth int\nvar elements []Element\n\nfunc main() {\n\t// assemble input\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tinputs := []Input{}\n\n\tinputTable := NewHashTable()\n\tchildTable := NewHashTable()\n\n\tfor i := 0; i < n; i++ {\n\t\tid := nextInt(sc)\n\t\tleft := nextInt(sc)\n\t\tright := nextInt(sc)\n\t\tinput := Input{id, left, right}\n\t\tinputs = append(inputs, input)\n\t\tinputTable.Put(id, input)\n\t\tchildTable.Put(input.left, true)\n\t\tchildTable.Put(input.right, true)\n\t}\n\n\t// find root\n\tvar rootInput Input\n\tfor _, input := range inputs {\n\t\t_, exist := childTable.Find(input.id)\n\t\tif !exist {\n\t\t\trootInput = input\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// assemble tree\n\tleftElement := Element{id: rootInput.left}\n\trightElement := Element{id: rootInput.right}\n\trootElement := Element{id: rootInput.id, parent: -1, sibling: -1, depth: 0, left: &leftElement, right: &rightElement}\n\n\tassembleTree(&rootElement, inputTable)\n\n\t// print\n\tflat(rootElement)\n\tsort.Slice(elements, func(i, j int) bool {\n\t\treturn elements[i].id < elements[j].id\n\t})\n\n\tfor _, elem := range elements {\n\t\tprintElement(elem)\n\t}\n}\n\nfunc printElement(element Element) {\n\tif element.id == -1 {\n\t\treturn\n\t}\n\tdegree := 0\n\tif element.left.id != -1 {\n\t\tdegree++\n\t}\n\tif element.right.id != -1 {\n\t\tdegree++\n\t}\n\n\theight := getMaxDepthLeaf(element, element.depth) - element.depth\n\n\telementType := \"root\"\n\tif element.parent != -1 {\n\t\tif element.left.id != -1 || element.right.id != -1 {\n\t\t\telementType = \"internal node\"\n\t\t} else {\n\t\t\telementType = \"leaf\"\n\t\t}\n\t}\n\n\tfmt.Printf(\"node %v: parent = %v, sibling = %v, degree = %v, depth = %v, height = %v, %v\\n\",\n\t\telement.id, element.parent, element.sibling, degree, element.depth, height, elementType)\n\n}\n\nfunc getMaxDepthLeaf(element Element, maxDepth int) int {\n\tmax := maxDepth\n\tif element.left.depth > max {\n\t\tmax = element.left.depth\n\t}\n\n\tif element.right.depth > max {\n\t\tmax = element.right.depth\n\t}\n\n\tif element.left.id != -1 {\n\t\tleft := getMaxDepthLeaf(*element.left, max)\n\t\tif left > max {\n\t\t\tmax = left\n\t\t}\n\t}\n\n\tif element.right.id != -1 {\n\t\tright := getMaxDepthLeaf(*element.right, max)\n\t\tif right > max {\n\t\t\tmax = right\n\t\t}\n\t}\n\n\treturn max\n}\n\nfunc flat(element Element) {\n\telements = append(elements, element)\n\tif element.left != nil {\n\t\tflat(*element.left)\n\t}\n\tif element.right != nil {\n\t\tflat(*element.right)\n\t}\n}\n\nfunc assembleTree(element *Element, inputTable HashTable) {\n\tif element.depth > maxDepth {\n\t\tmaxDepth = element.depth\n\t}\n\n\t// assemble left and children of left\n\tif element.left.id != -1 {\n\t\tleftInputOrg, _ := inputTable.Find(element.left.id)\n\t\tleftInput := leftInputOrg.(Input)\n\t\tleftElement := Element{id: element.left.id,\n\t\t\tleft: &Element{id: leftInput.left, sibling: leftInput.right},\n\t\t\tright: &Element{id: leftInput.right, sibling: leftInput.left},\n\t\t\tdepth: element.depth + 1,\n\t\t\tparent: element.id,\n\t\t\tsibling: element.right.id}\n\t\telement.left = &leftElement\n\t\tassembleTree(&leftElement, inputTable)\n\t}\n\n\t// assemble right and children of right\n\tif element.right.id != -1 {\n\t\trightInputOrg, _ := inputTable.Find(element.right.id)\n\t\trightInput := rightInputOrg.(Input)\n\t\trightElement := Element{id: element.right.id,\n\t\t\tleft: &Element{id: rightInput.left, sibling: rightInput.right},\n\t\t\tright: &Element{id: rightInput.right, sibling: rightInput.left},\n\t\t\tdepth: element.depth + 1,\n\t\t\tparent: element.id,\n\t\t\tsibling: element.left.id}\n\n\t\telement.right = &rightElement\n\t\tassembleTree(&rightElement, inputTable)\n\t}\n}\n\n// ======= Hashtable =======\n\n// HashTable is HashTables\ntype HashTable struct {\n\thashtable []*element\n\tlength int\n}\n\ntype element struct {\n\tkey int\n\tval interface{}\n}\n\n// NewHashTable generate HashTable\nfunc NewHashTable() HashTable {\n\tlength := 1046527\n\treturn HashTable{make([]*element, length), length}\n}\n\n// Put new value\nfunc (h *HashTable) Put(key int, val interface{}) {\n\tnew := element{key, val}\n\thash := abs(key % h.length)\n\n\tindex := 0\n\tfor {\n\t\t// double hash\n\t\tif h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length] == nil {\n\t\t\th.hashtable[((1+hash%(h.length-1))*index+hash)%h.length] = &new\n\t\t\tbreak\n\t\t} else {\n\t\t\tindex++\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n// Find new value\nfunc (h *HashTable) Find(key int) (val interface{}, ok bool) {\n\thash := abs(key % h.length)\n\tindex := 0\n\tfor {\n\t\ttarget := h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length]\n\t\tif target == nil {\n\t\t\treturn Input{}, false\n\t\t}\n\n\t\tif target.key == key {\n\t\t\treturn h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length].val, true\n\t\t}\n\t\tindex++\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1573393344, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02280.html", "problem_id": "p02280", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02280/input.txt", "sample_output_relpath": "derived/input_output/data/p02280/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02280/Go/s305201095.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s305201095", "user_id": "u271583983"}, "prompt_components": {"gold_output": "node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc nextInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tnum, _ := strconv.Atoi(scanner.Text())\n\treturn num\n}\n\nfunc scanIntArray() []int {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tresult := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tresult = append(result, nextInt(sc))\n\t}\n\n\treturn result\n}\n\ntype Input struct {\n\tid int\n\tleft int\n\tright int\n}\n\ntype Element struct {\n\tid int\n\tparent int\n\tsibling int\n\tdegree int\n\tdepth int\n\theight int\n\tleft *Element\n\tright *Element\n}\n\nvar maxDepth int\nvar elements []Element\n\nfunc main() {\n\t// assemble input\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\tinputs := []Input{}\n\n\tinputTable := NewHashTable()\n\tchildTable := NewHashTable()\n\n\tfor i := 0; i < n; i++ {\n\t\tid := nextInt(sc)\n\t\tleft := nextInt(sc)\n\t\tright := nextInt(sc)\n\t\tinput := Input{id, left, right}\n\t\tinputs = append(inputs, input)\n\t\tinputTable.Put(id, input)\n\t\tchildTable.Put(input.left, true)\n\t\tchildTable.Put(input.right, true)\n\t}\n\n\t// find root\n\tvar rootInput Input\n\tfor _, input := range inputs {\n\t\t_, exist := childTable.Find(input.id)\n\t\tif !exist {\n\t\t\trootInput = input\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// assemble tree\n\tleftElement := Element{id: rootInput.left}\n\trightElement := Element{id: rootInput.right}\n\trootElement := Element{id: rootInput.id, parent: -1, sibling: -1, depth: 0, left: &leftElement, right: &rightElement}\n\n\tassembleTree(&rootElement, inputTable)\n\n\t// print\n\tflat(rootElement)\n\tsort.Slice(elements, func(i, j int) bool {\n\t\treturn elements[i].id < elements[j].id\n\t})\n\n\tfor _, elem := range elements {\n\t\tprintElement(elem)\n\t}\n}\n\nfunc printElement(element Element) {\n\tif element.id == -1 {\n\t\treturn\n\t}\n\tdegree := 0\n\tif element.left.id != -1 {\n\t\tdegree++\n\t}\n\tif element.right.id != -1 {\n\t\tdegree++\n\t}\n\n\theight := getMaxDepthLeaf(element, element.depth) - element.depth\n\n\telementType := \"root\"\n\tif element.parent != -1 {\n\t\tif element.left.id != -1 || element.right.id != -1 {\n\t\t\telementType = \"internal node\"\n\t\t} else {\n\t\t\telementType = \"leaf\"\n\t\t}\n\t}\n\n\tfmt.Printf(\"node %v: parent = %v, sibling = %v, degree = %v, depth = %v, height = %v, %v\\n\",\n\t\telement.id, element.parent, element.sibling, degree, element.depth, height, elementType)\n\n}\n\nfunc getMaxDepthLeaf(element Element, maxDepth int) int {\n\tmax := maxDepth\n\tif element.left.depth > max {\n\t\tmax = element.left.depth\n\t}\n\n\tif element.right.depth > max {\n\t\tmax = element.right.depth\n\t}\n\n\tif element.left.id != -1 {\n\t\tleft := getMaxDepthLeaf(*element.left, max)\n\t\tif left > max {\n\t\t\tmax = left\n\t\t}\n\t}\n\n\tif element.right.id != -1 {\n\t\tright := getMaxDepthLeaf(*element.right, max)\n\t\tif right > max {\n\t\t\tmax = right\n\t\t}\n\t}\n\n\treturn max\n}\n\nfunc flat(element Element) {\n\telements = append(elements, element)\n\tif element.left != nil {\n\t\tflat(*element.left)\n\t}\n\tif element.right != nil {\n\t\tflat(*element.right)\n\t}\n}\n\nfunc assembleTree(element *Element, inputTable HashTable) {\n\tif element.depth > maxDepth {\n\t\tmaxDepth = element.depth\n\t}\n\n\t// assemble left and children of left\n\tif element.left.id != -1 {\n\t\tleftInputOrg, _ := inputTable.Find(element.left.id)\n\t\tleftInput := leftInputOrg.(Input)\n\t\tleftElement := Element{id: element.left.id,\n\t\t\tleft: &Element{id: leftInput.left, sibling: leftInput.right},\n\t\t\tright: &Element{id: leftInput.right, sibling: leftInput.left},\n\t\t\tdepth: element.depth + 1,\n\t\t\tparent: element.id,\n\t\t\tsibling: element.right.id}\n\t\telement.left = &leftElement\n\t\tassembleTree(&leftElement, inputTable)\n\t}\n\n\t// assemble right and children of right\n\tif element.right.id != -1 {\n\t\trightInputOrg, _ := inputTable.Find(element.right.id)\n\t\trightInput := rightInputOrg.(Input)\n\t\trightElement := Element{id: element.right.id,\n\t\t\tleft: &Element{id: rightInput.left, sibling: rightInput.right},\n\t\t\tright: &Element{id: rightInput.right, sibling: rightInput.left},\n\t\t\tdepth: element.depth + 1,\n\t\t\tparent: element.id,\n\t\t\tsibling: element.left.id}\n\n\t\telement.right = &rightElement\n\t\tassembleTree(&rightElement, inputTable)\n\t}\n}\n\n// ======= Hashtable =======\n\n// HashTable is HashTables\ntype HashTable struct {\n\thashtable []*element\n\tlength int\n}\n\ntype element struct {\n\tkey int\n\tval interface{}\n}\n\n// NewHashTable generate HashTable\nfunc NewHashTable() HashTable {\n\tlength := 1046527\n\treturn HashTable{make([]*element, length), length}\n}\n\n// Put new value\nfunc (h *HashTable) Put(key int, val interface{}) {\n\tnew := element{key, val}\n\thash := abs(key % h.length)\n\n\tindex := 0\n\tfor {\n\t\t// double hash\n\t\tif h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length] == nil {\n\t\t\th.hashtable[((1+hash%(h.length-1))*index+hash)%h.length] = &new\n\t\t\tbreak\n\t\t} else {\n\t\t\tindex++\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n// Find new value\nfunc (h *HashTable) Find(key int) (val interface{}, ok bool) {\n\thash := abs(key % h.length)\n\tindex := 0\n\tfor {\n\t\ttarget := h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length]\n\t\tif target == nil {\n\t\t\treturn Input{}, false\n\t\t}\n\n\t\tif target.key == key {\n\t\t\treturn h.hashtable[((1+hash%(h.length-1))*index+hash)%h.length].val, true\n\t\t}\n\t\tindex++\n\t}\n}\n\n", "problem_context": "Binary Tree\n\nA rooted binary tree is a tree with a root node in which every node has at most two children.\n\nYour task is to write a program which reads a rooted binary tree T and prints the following information for each node u of T:\n\nnode ID of u\n\nparent of u\n\nsibling of u\n\nthe number of children of u\n\ndepth of u\n\nheight of u\n\nnode type (root, internal node or leaf)\n\nIf two nodes have the same parent, they are siblings. Here, if u and v have the same parent, we say u is a sibling of v (vice versa).\n\nThe height of a node in a tree is the number of edges on the longest simple downward path from the node to a leaf.\n\nHere, the given binary tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node is given in the following format:\n\nid left right\n\nid is the node ID, left is ID of the left child and right is ID of the right child. If the node does not have the left (right) child, the left(right) is indicated by -1.\n\nOutput\n\nPrint the information of each node in the following format:\n\nnode id: parent = p, sibling = s, degree = deg, depth = dep, height = h, type\n\np is ID of its parent. If the node does not have a parent, print -1.\n\ns is ID of its sibling. If the node does not have a sibling, print -1.\n\ndeg, dep and h are the number of children, depth and height of the node respectively.\n\ntype is a type of nodes represented by a string (root, internal node or leaf. If the root can be considered as a leaf or an internal node, print root.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 25\n\nSample Input 1\n\n9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n\nSample Output 1\n\nnode 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n"}, "reference_outputs": ["node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n"], "source_document_id": "p02280", "source_text": "Binary Tree\n\nA rooted binary tree is a tree with a root node in which every node has at most two children.\n\nYour task is to write a program which reads a rooted binary tree T and prints the following information for each node u of T:\n\nnode ID of u\n\nparent of u\n\nsibling of u\n\nthe number of children of u\n\ndepth of u\n\nheight of u\n\nnode type (root, internal node or leaf)\n\nIf two nodes have the same parent, they are siblings. Here, if u and v have the same parent, we say u is a sibling of v (vice versa).\n\nThe height of a node in a tree is the number of edges on the longest simple downward path from the node to a leaf.\n\nHere, the given binary tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node is given in the following format:\n\nid left right\n\nid is the node ID, left is ID of the left child and right is ID of the right child. If the node does not have the left (right) child, the left(right) is indicated by -1.\n\nOutput\n\nPrint the information of each node in the following format:\n\nnode id: parent = p, sibling = s, degree = deg, depth = dep, height = h, type\n\np is ID of its parent. If the node does not have a parent, print -1.\n\ns is ID of its sibling. If the node does not have a sibling, print -1.\n\ndeg, dep and h are the number of children, depth and height of the node respectively.\n\ntype is a type of nodes represented by a string (root, internal node or leaf. If the root can be considered as a leaf or an internal node, print root.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 25\n\nSample Input 1\n\n9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n\nSample Output 1\n\nnode 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5149, "cpu_time_ms": 10, "memory_kb": 2000}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s144816990", "group_id": "codeNet:p02284", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype Node struct {\n\tvalue int\n\tleft *Node\n\tright *Node\n}\n\n\n/****************************************************************\n*関数insert():\t\t\t\t\t\t\t\t\t\t\t\t\t*\n*\t 挿入される二分探索木のrootノードを表すポインタrootと\t\t\t\t*\n*\t 挿入したいノードのvalueを引数に、適切な葉に新たなノードを挿入して、\t*\n*\t 挿入された二分探索木のルートノードのポインタを返す関数\t\t\t\t*\n*****************************************************************/\nfunc insert(root *Node, val int) *Node {\n\n\t// 二分探索木がまだ構築されていないときはここが呼び出される\n\tif root == nil {\n\t\treturn &Node{val, nil,nil}\n\t}\n\n\t// すでにある二分探索木に対するノード(value: val)を挿入する\n\t// ここを抜けるとparentに挿入されるノードの親へのポインタが入っている\n\t// 変数nodeは、挿入すべき場所を探すための一時的なポインタ変数\n\tvar parent *Node\n\tnode := root\n\tfor node != nil {\n\t\tparent = node\n\t\tif node.value > val {\n\t\t\tnode = node.left\n\t\t} else {\n\t\t\tnode = node.right\n\t\t}\n\t}\n\n\t// 新たなノードの挿入を実行\n\tif parent.value > val {\n\t\tparent.left = &Node{val, nil,nil}\n\t} else {\n\t\tparent.right = &Node{val, nil, nil}\n\t}\n\n\t// 二分探索木の根は変わらないのでそのまま返す\n\treturn root\n}\n\nfunc printNodes(nodes []int) {\n\t// 木の走査によって得られたint型スライスを引数に、\n\t// 指定されたフォーマットに出力する関数\n\twriter := bufio.NewWriter(os.Stdout)\n\tfor _, v := range nodes{\n\t\twriter.Write([]byte(fmt.Sprintf(\" %d\", v)))\n\t}\n\twriter.Write([]byte(\"\\n\"))\n\twriter.Flush()\n}\n\nfunc preorder(root *Node, memo []int) []int {\n\t// 引数rootが根となっている二分探索木に対して先行巡回によって\n\t// 各ノードをを舐めて、引数memoで与えられる空のスライスに書き込み、\n\t// 書き込まれた後のスライスを返す関数\n\tif root != nil {\n\t\tmemo = append(memo, root.value)\n\t\tmemo = preorder(root.left, memo)\n\t\tmemo = preorder(root.right, memo)\n\t}\n\treturn memo\n}\n\nfunc inorder(root *Node, memo []int) []int {\n\t// 引数rootが根となっている二分探索木に対して中間巡回によって\n\t// 各ノードをを舐めて、引数memoで与えられる空のスライスに書き込み、\n\t// 書き込まれた後のスライスを返す関数\n\tif root != nil {\n\t\tmemo = inorder(root.left, memo)\n\t\tmemo = append(memo, root.value)\n\t\tmemo = inorder(root.right, memo)\n\t}\n\treturn memo\n}\n\n/****************************************************************\n*関数find():\t\t\t\t\t\t\t\t\t\t\t\t\t\t*\n*\t 探索対象の二分探索木のrootノードを表すポインタrootと\t\t\t\t*\n*\t 探したいノードのtargetを引数に、\t\t\t\t\t\t\t\t*\n*\t 存在すればtrueを、なければfalseを返す関数\t\t\t\t\t\t*\n*****************************************************************/\nfunc find(root *Node, target int) bool {\n\tswitch {\n\t// rootを根とする二分探索木が未構築\n\tcase root == nil:\n\t\treturn false\n\tcase root.value == target:\n\t\treturn true\n\tcase root.value > target:\n\t\treturn find(root.left, target)\n\tdefault:\n\t\treturn find(root.right, target)\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tvar root *Node\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ = strconv.Atoi(scanner.Text())\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\toperation := scanner.Text()\n\t\tswitch operation {\n\t\tcase \"insert\":\n\t\t\tscanner.Scan()\n\t\t\tvalue, _ := strconv.Atoi(scanner.Text())\n\t\t\troot = insert(root, value)\n\t\tcase \"print\":\n\t\t\tprintNodes(inorder(root, []int{}))\n\t\t\tprintNodes(preorder(root, []int{}))\n\t\tcase \"find\":\n\t\t\tscanner.Scan()\n\t\t\ttarget, _ := strconv.Atoi(scanner.Text())\n\t\t\tif find(root, target) {\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\tdefault:\n\t\t\tpanic(\"No such operation!\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1528272178, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02284.html", "problem_id": "p02284", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02284/input.txt", "sample_output_relpath": "derived/input_output/data/p02284/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02284/Go/s144816990.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s144816990", "user_id": "u495592458"}, "prompt_components": {"gold_output": "yes\nno\n 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype Node struct {\n\tvalue int\n\tleft *Node\n\tright *Node\n}\n\n\n/****************************************************************\n*関数insert():\t\t\t\t\t\t\t\t\t\t\t\t\t*\n*\t 挿入される二分探索木のrootノードを表すポインタrootと\t\t\t\t*\n*\t 挿入したいノードのvalueを引数に、適切な葉に新たなノードを挿入して、\t*\n*\t 挿入された二分探索木のルートノードのポインタを返す関数\t\t\t\t*\n*****************************************************************/\nfunc insert(root *Node, val int) *Node {\n\n\t// 二分探索木がまだ構築されていないときはここが呼び出される\n\tif root == nil {\n\t\treturn &Node{val, nil,nil}\n\t}\n\n\t// すでにある二分探索木に対するノード(value: val)を挿入する\n\t// ここを抜けるとparentに挿入されるノードの親へのポインタが入っている\n\t// 変数nodeは、挿入すべき場所を探すための一時的なポインタ変数\n\tvar parent *Node\n\tnode := root\n\tfor node != nil {\n\t\tparent = node\n\t\tif node.value > val {\n\t\t\tnode = node.left\n\t\t} else {\n\t\t\tnode = node.right\n\t\t}\n\t}\n\n\t// 新たなノードの挿入を実行\n\tif parent.value > val {\n\t\tparent.left = &Node{val, nil,nil}\n\t} else {\n\t\tparent.right = &Node{val, nil, nil}\n\t}\n\n\t// 二分探索木の根は変わらないのでそのまま返す\n\treturn root\n}\n\nfunc printNodes(nodes []int) {\n\t// 木の走査によって得られたint型スライスを引数に、\n\t// 指定されたフォーマットに出力する関数\n\twriter := bufio.NewWriter(os.Stdout)\n\tfor _, v := range nodes{\n\t\twriter.Write([]byte(fmt.Sprintf(\" %d\", v)))\n\t}\n\twriter.Write([]byte(\"\\n\"))\n\twriter.Flush()\n}\n\nfunc preorder(root *Node, memo []int) []int {\n\t// 引数rootが根となっている二分探索木に対して先行巡回によって\n\t// 各ノードをを舐めて、引数memoで与えられる空のスライスに書き込み、\n\t// 書き込まれた後のスライスを返す関数\n\tif root != nil {\n\t\tmemo = append(memo, root.value)\n\t\tmemo = preorder(root.left, memo)\n\t\tmemo = preorder(root.right, memo)\n\t}\n\treturn memo\n}\n\nfunc inorder(root *Node, memo []int) []int {\n\t// 引数rootが根となっている二分探索木に対して中間巡回によって\n\t// 各ノードをを舐めて、引数memoで与えられる空のスライスに書き込み、\n\t// 書き込まれた後のスライスを返す関数\n\tif root != nil {\n\t\tmemo = inorder(root.left, memo)\n\t\tmemo = append(memo, root.value)\n\t\tmemo = inorder(root.right, memo)\n\t}\n\treturn memo\n}\n\n/****************************************************************\n*関数find():\t\t\t\t\t\t\t\t\t\t\t\t\t\t*\n*\t 探索対象の二分探索木のrootノードを表すポインタrootと\t\t\t\t*\n*\t 探したいノードのtargetを引数に、\t\t\t\t\t\t\t\t*\n*\t 存在すればtrueを、なければfalseを返す関数\t\t\t\t\t\t*\n*****************************************************************/\nfunc find(root *Node, target int) bool {\n\tswitch {\n\t// rootを根とする二分探索木が未構築\n\tcase root == nil:\n\t\treturn false\n\tcase root.value == target:\n\t\treturn true\n\tcase root.value > target:\n\t\treturn find(root.left, target)\n\tdefault:\n\t\treturn find(root.right, target)\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tvar root *Node\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\tn, _ = strconv.Atoi(scanner.Text())\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\toperation := scanner.Text()\n\t\tswitch operation {\n\t\tcase \"insert\":\n\t\t\tscanner.Scan()\n\t\t\tvalue, _ := strconv.Atoi(scanner.Text())\n\t\t\troot = insert(root, value)\n\t\tcase \"print\":\n\t\t\tprintNodes(inorder(root, []int{}))\n\t\t\tprintNodes(preorder(root, []int{}))\n\t\tcase \"find\":\n\t\t\tscanner.Scan()\n\t\t\ttarget, _ := strconv.Atoi(scanner.Text())\n\t\t\tif find(root, target) {\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\tdefault:\n\t\t\tpanic(\"No such operation!\")\n\t\t}\n\t}\n}\n", "problem_context": "Binary Search Tree II\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding the find operation to A: Binary Search Tree I.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n10\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\nfind 12\ninsert 17\ninsert 25\nfind 16\nprint\n\nSample Output 1\n\nyes\nno\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\nfind 12\ninsert 17\ninsert 25\nfind 16\nprint\n"}, "reference_outputs": ["yes\nno\n 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n"], "source_document_id": "p02284", "source_text": "Binary Search Tree II\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding the find operation to A: Binary Search Tree I.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n10\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\nfind 12\ninsert 17\ninsert 25\nfind 16\nprint\n\nSample Output 1\n\nyes\nno\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3937, "cpu_time_ms": 960, "memory_kb": 37580}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250225157", "group_id": "codeNet:p02317", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n int\n\nfunc main() {\n\tfmt.Scan(&n)\n\n\tvar arr []int\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tarr = append(arr, a)\n\t}\n\n\tvar lis []int\n\tlis = append(lis, arr[0])\n\tfor i := 1; i < len(arr); i++ {\n\t\tif val, last := arr[i], lis[len(lis)-1]; val == last {\n\t\t} else if last < val {\n\t\t\tlis = append(lis, val)\n\t\t} else {\n\t\t\tf := func(j int) bool {\n\t\t\t\treturn val < lis[j]\n\t\t\t}\n\t\t\tindex := sort.Search(len(lis), f)\n\t\t\tif index == 0 || lis[index-1] != val {\n\t\t\t\tlis[index] = val\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(len(lis))\n}\n\n", "language": "Go", "metadata": {"date": 1520608171, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02317.html", "problem_id": "p02317", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02317/input.txt", "sample_output_relpath": "derived/input_output/data/p02317/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02317/Go/s250225157.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s250225157", "user_id": "u827214117"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n int\n\nfunc main() {\n\tfmt.Scan(&n)\n\n\tvar arr []int\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tarr = append(arr, a)\n\t}\n\n\tvar lis []int\n\tlis = append(lis, arr[0])\n\tfor i := 1; i < len(arr); i++ {\n\t\tif val, last := arr[i], lis[len(lis)-1]; val == last {\n\t\t} else if last < val {\n\t\t\tlis = append(lis, val)\n\t\t} else {\n\t\t\tf := func(j int) bool {\n\t\t\t\treturn val < lis[j]\n\t\t\t}\n\t\t\tindex := sort.Search(len(lis), f)\n\t\t\tif index == 0 || lis[index-1] != val {\n\t\t\t\tlis[index] = val\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(len(lis))\n}\n\n", "problem_context": "Longest Increasing Subsequence\n\nFor a given sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in A.\n\nAn increasing subsequence of A is defined by a subsequence {ai0, ai1, ... , aik} where 0 ≤ i0 < i1 < ... < ik < n and ai0 < ai1 < ... < aik.\n\nInput\n\nn\na0\na1\n:\nan-1\n\nIn the first line, an integer n is given. In the next n lines, elements of A are given.\n\nOutput\n\nThe length of the longest increasing subsequence of A.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n0 ≤ ai ≤ 109\n\nSample Input 1\n\n5\n5\n1\n3\n2\n4\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1\n1\n1\n\nSample Output 2\n\n1", "sample_input": "5\n5\n1\n3\n2\n4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02317", "source_text": "Longest Increasing Subsequence\n\nFor a given sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in A.\n\nAn increasing subsequence of A is defined by a subsequence {ai0, ai1, ... , aik} where 0 ≤ i0 < i1 < ... < ik < n and ai0 < ai1 < ... < aik.\n\nInput\n\nn\na0\na1\n:\nan-1\n\nIn the first line, an integer n is given. In the next n lines, elements of A are given.\n\nOutput\n\nThe length of the longest increasing subsequence of A.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n0 ≤ ai ≤ 109\n\nSample Input 1\n\n5\n5\n1\n3\n2\n4\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1\n1\n1\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 564, "cpu_time_ms": 700, "memory_kb": 7120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s891431626", "group_id": "codeNet:p02396", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\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 main() {\n for i := 1; ; i++ {\n data := nextInt()\n if data == 0 {\n break\n }\n fmt.Printf(\"Case %d: %d\\n\", i, data)\n }\n}\n", "language": "Go", "metadata": {"date": 1529815204, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/Go/s891431626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s891431626", "user_id": "u724424933"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\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 main() {\n for i := 1; ; i++ {\n data := nextInt()\n if data == 0 {\n break\n }\n fmt.Printf(\"Case %d: %d\\n\", i, data)\n }\n}\n", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 378, "cpu_time_ms": 20, "memory_kb": 1308}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187796594", "group_id": "codeNet:p02397", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 1; ; i++ {\n\t\tvar x, y int\n\t\tfmt.Scan(&x)\n\t\tfmt.Scan(&y)\n\t\tif x == 0 && y == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif x < y {\n\t\t\tfmt.Println(x, y)\n\t\t} else {\n\t\t\tfmt.Println(y, x)\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1524210134, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02397.html", "problem_id": "p02397", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02397/input.txt", "sample_output_relpath": "derived/input_output/data/p02397/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02397/Go/s187796594.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187796594", "user_id": "u119127920"}, "prompt_components": {"gold_output": "2 3\n2 2\n3 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor i := 1; ; i++ {\n\t\tvar x, y int\n\t\tfmt.Scan(&x)\n\t\tfmt.Scan(&y)\n\t\tif x == 0 && y == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif x < y {\n\t\t\tfmt.Println(x, y)\n\t\t} else {\n\t\t\tfmt.Println(y, x)\n\t\t}\n\t}\n}\n\n", "problem_context": "Swapping Two Numbers\n\nWrite a program which reads two integers x and y, and prints them in ascending order.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.\n\nThe input ends with two 0 (when both x and y are zero). Your program should not process for these terminal symbols.\n\nOutput\n\nFor each dataset, print x and y in ascending order in a line. Put a single space between x and y.\n\nConstraints\n\n0 ≤ x, y ≤ 10000\n\nthe number of datasets ≤ 3000\n\nSample Input\n\n3 2\n2 2\n5 3\n0 0\n\nSample Output\n\n2 3\n2 2\n3 5", "sample_input": "3 2\n2 2\n5 3\n0 0\n"}, "reference_outputs": ["2 3\n2 2\n3 5\n"], "source_document_id": "p02397", "source_text": "Swapping Two Numbers\n\nWrite a program which reads two integers x and y, and prints them in ascending order.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.\n\nThe input ends with two 0 (when both x and y are zero). Your program should not process for these terminal symbols.\n\nOutput\n\nFor each dataset, print x and y in ascending order in a line. Put a single space between x and y.\n\nConstraints\n\n0 ≤ x, y ≤ 10000\n\nthe number of datasets ≤ 3000\n\nSample Input\n\n3 2\n2 2\n5 3\n0 0\n\nSample Output\n\n2 3\n2 2\n3 5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 30, "memory_kb": 1368}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s774585867", "group_id": "codeNet:p02413", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar r, c int\n\n\tfmt.Scanf(\"%d%d\", &r, &c)\n\n\tvar rowcol [][]int\n\n\tfor i := 0; i < r; i++ {\n\n\t\tvar row []int\n\n\t\tfor j := 0; j < c; j++ {\n\t\t\tvar val int\n\t\t\tfmt.Scanf(\"%d\", &val)\n\n\t\t\trow = append(row, val)\n\t\t}\n\n\t\trowcol = append(rowcol, row)\n\t}\n\n\tfor i := 0; i < r; i++ {\n\n\t\tcolsum := 0\n\n\t\tfor j := 0; j < c; j++ {\n\t\t\tfmt.Printf(\"%d \", rowcol[i][j])\n\t\t\tcolsum += rowcol[i][j]\n\t\t}\n\n\t\tfmt.Println(colsum)\n\n\t}\n\n\tsum := 0\n\n\tfor j := 0; j < c; j++ {\n\t\trowsum := 0\n\t\tfor i := 0; i < r; i++ {\n\t\t\trowsum += rowcol[i][j]\n\t\t}\n\n\t\tsum += rowsum\n\n\t\tfmt.Printf(\"%d \", rowsum)\n\t}\n\n\tfmt.Println(sum)\n}\n\n", "language": "Go", "metadata": {"date": 1537103343, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02413.html", "problem_id": "p02413", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02413/input.txt", "sample_output_relpath": "derived/input_output/data/p02413/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02413/Go/s774585867.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s774585867", "user_id": "u591724377"}, "prompt_components": {"gold_output": "1 1 3 4 5 14\n2 2 2 4 5 15\n3 3 0 1 1 8\n2 3 4 4 6 19\n8 9 9 13 17 56\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar r, c int\n\n\tfmt.Scanf(\"%d%d\", &r, &c)\n\n\tvar rowcol [][]int\n\n\tfor i := 0; i < r; i++ {\n\n\t\tvar row []int\n\n\t\tfor j := 0; j < c; j++ {\n\t\t\tvar val int\n\t\t\tfmt.Scanf(\"%d\", &val)\n\n\t\t\trow = append(row, val)\n\t\t}\n\n\t\trowcol = append(rowcol, row)\n\t}\n\n\tfor i := 0; i < r; i++ {\n\n\t\tcolsum := 0\n\n\t\tfor j := 0; j < c; j++ {\n\t\t\tfmt.Printf(\"%d \", rowcol[i][j])\n\t\t\tcolsum += rowcol[i][j]\n\t\t}\n\n\t\tfmt.Println(colsum)\n\n\t}\n\n\tsum := 0\n\n\tfor j := 0; j < c; j++ {\n\t\trowsum := 0\n\t\tfor i := 0; i < r; i++ {\n\t\t\trowsum += rowcol[i][j]\n\t\t}\n\n\t\tsum += rowsum\n\n\t\tfmt.Printf(\"%d \", rowsum)\n\t}\n\n\tfmt.Println(sum)\n}\n\n", "problem_context": "Spreadsheet\n\nYour task is to perform a simple table calculation.\n\nWrite a program which reads the number of rows r, columns c and a table of r × c elements, and prints a new table, which includes the total sum for each row and column.\n\nInput\n\nIn the first line, two integers r and c are given. Next, the table is given by r lines, each of which consists of c integers separated by space characters.\n\nOutput\n\nPrint the new table of (r+1) × (c+1) elements. Put a single space character between adjacent elements. For each row, print the sum of it's elements in the last column. For each column, print the sum of it's elements in the last row. Print the total sum of the elements at the bottom right corner of the table.\n\nConstraints\n\n1 ≤ r, c ≤ 100\n\n0 ≤ an element of the table ≤ 100\n\nSample Input\n\n4 5\n1 1 3 4 5\n2 2 2 4 5\n3 3 0 1 1\n2 3 4 4 6\n\nSample Output\n\n1 1 3 4 5 14\n2 2 2 4 5 15\n3 3 0 1 1 8\n2 3 4 4 6 19\n8 9 9 13 17 56", "sample_input": "4 5\n1 1 3 4 5\n2 2 2 4 5\n3 3 0 1 1\n2 3 4 4 6\n"}, "reference_outputs": ["1 1 3 4 5 14\n2 2 2 4 5 15\n3 3 0 1 1 8\n2 3 4 4 6 19\n8 9 9 13 17 56\n"], "source_document_id": "p02413", "source_text": "Spreadsheet\n\nYour task is to perform a simple table calculation.\n\nWrite a program which reads the number of rows r, columns c and a table of r × c elements, and prints a new table, which includes the total sum for each row and column.\n\nInput\n\nIn the first line, two integers r and c are given. Next, the table is given by r lines, each of which consists of c integers separated by space characters.\n\nOutput\n\nPrint the new table of (r+1) × (c+1) elements. Put a single space character between adjacent elements. For each row, print the sum of it's elements in the last column. For each column, print the sum of it's elements in the last row. Print the total sum of the elements at the bottom right corner of the table.\n\nConstraints\n\n1 ≤ r, c ≤ 100\n\n0 ≤ an element of the table ≤ 100\n\nSample Input\n\n4 5\n1 1 3 4 5\n2 2 2 4 5\n3 3 0 1 1\n2 3 4 4 6\n\nSample Output\n\n1 1 3 4 5 14\n2 2 2 4 5 15\n3 3 0 1 1 8\n2 3 4 4 6 19\n8 9 9 13 17 56", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 631, "cpu_time_ms": 40, "memory_kb": 2040}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s799053976", "group_id": "codeNet:p02459", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\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 nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tq := nextInt(sc)\n\tans := make([]int, 0)\n\tm := make(map[string]int)\n\tfor i := 0; i < q; i++ {\n\t\tt := nextInt(sc)\n\t\tk := nextString(sc)\n\t\tif t == 0 {\n\t\t\tx := nextInt(sc)\n\t\t\tm[k] = x\n\t\t} else {\n\t\t\tans = append(ans, m[k])\n\t\t}\n\t}\n\twtr := bufio.NewWriter(os.Stdout)\n\tfor i := 0; i < len(ans); i++ {\n\t\tfmt.Fprintln(wtr, ans[i])\n\t}\n\twtr.Flush()\n}\n\n", "language": "Go", "metadata": {"date": 1584323806, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02459.html", "problem_id": "p02459", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02459/input.txt", "sample_output_relpath": "derived/input_output/data/p02459/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02459/Go/s799053976.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799053976", "user_id": "u225669905"}, "prompt_components": {"gold_output": "1\n4\n8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\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 nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tq := nextInt(sc)\n\tans := make([]int, 0)\n\tm := make(map[string]int)\n\tfor i := 0; i < q; i++ {\n\t\tt := nextInt(sc)\n\t\tk := nextString(sc)\n\t\tif t == 0 {\n\t\t\tx := nextInt(sc)\n\t\t\tm[k] = x\n\t\t} else {\n\t\t\tans = append(ans, m[k])\n\t\t}\n\t}\n\twtr := bufio.NewWriter(os.Stdout)\n\tfor i := 0; i < len(ans); i++ {\n\t\tfmt.Fprintln(wtr, ans[i])\n\t}\n\twtr.Flush()\n}\n\n", "problem_context": "Map: Search\n\nFor a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that each key in $M$ must be unique.\n\ninsert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. If there is an element with $key$, replace the corresponding value with $x$.\n\nget($key$): Print the value with the specified $key$.\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 $key$ $x$\n\nor\n\n1 $key$\n\nwhere the first digits 0, 1 and 2 represent insert and get operations respectively.\n\nOutput\n\nFor each get operation, print an integer in a line.\n\nConstraints\n\n$1 \\leq q \\leq 200,000$\n\n$1 \\leq x \\leq 1,000,000,000$\n\n$1 \\leq $ length of $key$ $ \\leq 20$\n\n$key$ consits of lower-case letter\n\nFor a get operation, the element with the specified key exists in $M$.\n\nSample Input 1\n\n7\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n0 black 8\n1 black\n\nSample Output 1\n\n1\n4\n8", "sample_input": "7\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n0 black 8\n1 black\n"}, "reference_outputs": ["1\n4\n8\n"], "source_document_id": "p02459", "source_text": "Map: Search\n\nFor a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that each key in $M$ must be unique.\n\ninsert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. If there is an element with $key$, replace the corresponding value with $x$.\n\nget($key$): Print the value with the specified $key$.\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 $key$ $x$\n\nor\n\n1 $key$\n\nwhere the first digits 0, 1 and 2 represent insert and get operations respectively.\n\nOutput\n\nFor each get operation, print an integer in a line.\n\nConstraints\n\n$1 \\leq q \\leq 200,000$\n\n$1 \\leq x \\leq 1,000,000,000$\n\n$1 \\leq $ length of $key$ $ \\leq 20$\n\n$key$ consits of lower-case letter\n\nFor a get operation, the element with the specified key exists in $M$.\n\nSample Input 1\n\n7\n0 blue 4\n0 red 1\n0 white 5\n1 red\n1 blue\n0 black 8\n1 black\n\nSample Output 1\n\n1\n4\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 644, "cpu_time_ms": 220, "memory_kb": 18740}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s984591647", "group_id": "codeNet:p02534", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tif a <= d && c <= b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1601174020, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02534.html", "problem_id": "p02534", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02534/input.txt", "sample_output_relpath": "derived/input_output/data/p02534/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02534/Go/s984591647.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s984591647", "user_id": "u902409225"}, "prompt_components": {"gold_output": "ACLACLACL\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tif a <= d && 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\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "sample_input": "3\n"}, "reference_outputs": ["ACLACLACL\n"], "source_document_id": "p02534", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 168, "cpu_time_ms": 4, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s115930397", "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 //can := make([][]bool, 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}\n", "language": "Go", "metadata": {"date": 1600670057, "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/s115930397.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s115930397", "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 //can := make([][]bool, 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}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1095, "cpu_time_ms": 2206, "memory_kb": 18844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s793787140", "group_id": "codeNet:p02546", "input_text": "package main\n\nimport \"fmt\"\n\nfunc process(in string) (ret string) {\n\tif tail := in[len(in)-1 : len(in)]; tail != \"s\" {\n\t\tret = in + \"s\"\n\t} else {\n\t\tret = in + \"es\"\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar in string\n\tfmt.Scanln(&in)\n\n\tret := process(in)\n\tfmt.Println(ret)\n}\n", "language": "Go", "metadata": {"date": 1600603869, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02546.html", "problem_id": "p02546", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02546/input.txt", "sample_output_relpath": "derived/input_output/data/p02546/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02546/Go/s793787140.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s793787140", "user_id": "u672494157"}, "prompt_components": {"gold_output": "apples\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc process(in string) (ret string) {\n\tif tail := in[len(in)-1 : len(in)]; tail != \"s\" {\n\t\tret = in + \"s\"\n\t} else {\n\t\tret = in + \"es\"\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar in string\n\tfmt.Scanln(&in)\n\n\tret := process(in)\n\tfmt.Println(ret)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters.\n\nIn Taknese, the plural form of a noun is spelled based on the following rules:\n\nIf a noun's singular form does not end with s, append s to the end of the singular form.\n\nIf a noun's singular form ends with s, append es to the end of the singular form.\n\nYou are given the singular form S of a Taknese noun. Output its plural form.\n\nConstraints\n\nS is a string of length 1 between 1000, inclusive.\n\nS contains only lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the plural form of the given Taknese word.\n\nSample Input 1\n\napple\n\nSample Output 1\n\napples\n\napple ends with e, so its plural form is apples.\n\nSample Input 2\n\nbus\n\nSample Output 2\n\nbuses\n\nbus ends with s, so its plural form is buses.\n\nSample Input 3\n\nbox\n\nSample Output 3\n\nboxs", "sample_input": "apple\n"}, "reference_outputs": ["apples\n"], "source_document_id": "p02546", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters.\n\nIn Taknese, the plural form of a noun is spelled based on the following rules:\n\nIf a noun's singular form does not end with s, append s to the end of the singular form.\n\nIf a noun's singular form ends with s, append es to the end of the singular form.\n\nYou are given the singular form S of a Taknese noun. Output its plural form.\n\nConstraints\n\nS is a string of length 1 between 1000, inclusive.\n\nS contains only lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the plural form of the given Taknese word.\n\nSample Input 1\n\napple\n\nSample Output 1\n\napples\n\napple ends with e, so its plural form is apples.\n\nSample Input 2\n\nbus\n\nSample Output 2\n\nbuses\n\nbus ends with s, so its plural form is buses.\n\nSample Input 3\n\nbox\n\nSample Output 3\n\nboxs", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 6, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s735847484", "group_id": "codeNet:p02548", "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, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 問題によって値は調整する\nconst (\n\tmod = int(1e9) + 7\n\tmaxsize = 51000\n)\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tsieve := MakeSieve(N)\n\tfor i := 1; i < N; i++ {\n\t\tpf := FastPrimeFactorize(N-i, sieve)\n\t\tsum := 1\n\t\tfor _, v := range pf {\n\t\t\tsum *= v + 1\n\t\t}\n\t\tans += sum\n\t}\n\tfmt.Println(ans)\n}\n\nfunc cntDivisors(N int) int {\n\tvar res int\n\tfor i := 1; i*i <= N; i++ {\n\t\tif N%i == 0 {\n\t\t\tres++\n\t\t\tif N/i != i {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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\n// Math Utilities\n// https://play.golang.org/p/bm7uZi0zCN\n\n// Abs Absolute Value\nfunc Abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\n// Pow Integer power: compute a**b using binary powering algorithm\n// See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3\nfunc Pow(a, b int) int {\n\tp := 1\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp *= a\n\t\t}\n\t\tb >>= 1\n\t\ta *= a\n\t}\n\treturn p\n}\n\n// PowMod Modular integer power: compute a**b mod m using binary powering algorithm\nfunc PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\n// MinOf 与えられたintのうち最小のものを返す\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\n// MaxOf 与えられたintのうち最大のものを返す\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// IH golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, Abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// COMで使うスライス\nvar fac = make([]int, maxsize)\nvar finv = make([]int, maxsize)\nvar inv = make([]int, maxsize)\n\n// COMinit で COMで使うためのテーブルを作る前処理\n// O(N)\n// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr\nfunc COMinit() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\tfor i := 2; i < maxsize; 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// COM nCkを求める。COMinitを先に実行する\n// COMinitの結果を使ってO(1)で行える\nfunc COM(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", "language": "Go", "metadata": {"date": 1600569086, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/Go/s735847484.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s735847484", "user_id": "u605443479"}, "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\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 問題によって値は調整する\nconst (\n\tmod = int(1e9) + 7\n\tmaxsize = 51000\n)\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tsieve := MakeSieve(N)\n\tfor i := 1; i < N; i++ {\n\t\tpf := FastPrimeFactorize(N-i, sieve)\n\t\tsum := 1\n\t\tfor _, v := range pf {\n\t\t\tsum *= v + 1\n\t\t}\n\t\tans += sum\n\t}\n\tfmt.Println(ans)\n}\n\nfunc cntDivisors(N int) int {\n\tvar res int\n\tfor i := 1; i*i <= N; i++ {\n\t\tif N%i == 0 {\n\t\t\tres++\n\t\t\tif N/i != i {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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\n// Math Utilities\n// https://play.golang.org/p/bm7uZi0zCN\n\n// Abs Absolute Value\nfunc Abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\n// Pow Integer power: compute a**b using binary powering algorithm\n// See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3\nfunc Pow(a, b int) int {\n\tp := 1\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp *= a\n\t\t}\n\t\tb >>= 1\n\t\ta *= a\n\t}\n\treturn p\n}\n\n// PowMod Modular integer power: compute a**b mod m using binary powering algorithm\nfunc PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\n// MinOf 与えられたintのうち最小のものを返す\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\n// MaxOf 与えられたintのうち最大のものを返す\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// IH golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, Abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// COMで使うスライス\nvar fac = make([]int, maxsize)\nvar finv = make([]int, maxsize)\nvar inv = make([]int, maxsize)\n\n// COMinit で COMで使うためのテーブルを作る前処理\n// O(N)\n// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr\nfunc COMinit() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\tfor i := 2; i < maxsize; 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// COM nCkを求める。COMinitを先に実行する\n// COMinitの結果を使ってO(1)で行える\nfunc COM(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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8353, "cpu_time_ms": 382, "memory_kb": 19536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s408197917", "group_id": "codeNet:p02548", "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\tcnt := 0\n\tfor c := float64(n - 1); c >= 1; c-- {\n\t\tmax := math.Floor(math.Sqrt(n - c))\n\t\tfor a := float64(1); a <= max; a++ {\n\t\t\tb := (n - c) / a\n\t\t\tif b == math.Floor(b) {\n\t\t\t\tif a != b {\n\t\t\t\t\tcnt += 2\n\t\t\t\t} else {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1600547902, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/Go/s408197917.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s408197917", "user_id": "u556291971"}, "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 n float64\n\tfmt.Scan(&n)\n\tcnt := 0\n\tfor c := float64(n - 1); c >= 1; c-- {\n\t\tmax := math.Floor(math.Sqrt(n - c))\n\t\tfor a := float64(1); a <= max; a++ {\n\t\t\tb := (n - c) / a\n\t\t\tif b == math.Floor(b) {\n\t\t\t\tif a != b {\n\t\t\t\t\tcnt += 2\n\t\t\t\t} else {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 350, "cpu_time_ms": 1758, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s812037077", "group_id": "codeNet:p02548", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scanf(\"%d\", &n)\n\n\ttotal := 0\n\tvar a, b, c, tmp int\n\tfor a = 1; a < n; a++ {\n\t\tfor b = 1; b < n; b++ {\n\t\t\ttmp = a * b\n\t\t\tfor c = n - tmp; c >= 1; c-- {\n\t\t\t\tif tmp+c == n {\n\t\t\t\t\ttotal++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n", "language": "Go", "metadata": {"date": 1600546201, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/Go/s812037077.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s812037077", "user_id": "u455489784"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scanf(\"%d\", &n)\n\n\ttotal := 0\n\tvar a, b, c, tmp int\n\tfor a = 1; a < n; a++ {\n\t\tfor b = 1; b < n; b++ {\n\t\t\ttmp = a * b\n\t\t\tfor c = n - tmp; c >= 1; c-- {\n\t\t\t\tif tmp+c == n {\n\t\t\t\t\ttotal++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 2205, "memory_kb": 1856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s903895692", "group_id": "codeNet:p02548", "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.Scan()\n\tnumT := scanner.Text()\n\tnum, _ := strconv.ParseInt(numT, 10, 64)\n\tn := int(num)\n\tc := 0\n\n\tfor i := 0; i < n; i++ {\n\t\ttarget := n - i\n\n\t\tfor j := 1; j < target; j++ {\n\t\t\tk := target / j\n\t\t\tif k*j == target {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(c)\n}\n", "language": "Go", "metadata": {"date": 1600543693, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/Go/s903895692.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s903895692", "user_id": "u046532996"}, "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\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tnumT := scanner.Text()\n\tnum, _ := strconv.ParseInt(numT, 10, 64)\n\tn := int(num)\n\tc := 0\n\n\tfor i := 0; i < n; i++ {\n\t\ttarget := n - i\n\n\t\tfor j := 1; j < target; j++ {\n\t\t\tk := target / j\n\t\t\tif k*j == target {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(c)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 375, "cpu_time_ms": 2205, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s788322872", "group_id": "codeNet:p02550", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, x, m int\n\tfmt.Scan(&n, &x, &m)\n\n\tans := 0\n\tss := make(map[int]int)\n\tdone := make(map[int]int)\n\ta := x\n\tss[1] = a\n\tdone[a] = 1\n\tans += a\n\tfor i := 2; i <= n; i++ {\n\t\ta = ((a % m) * a) % m\n\t\tss[i] = ss[i-1] + a\n\t\tif done[a] > 0 {\n\t\t\tl, r := done[a], i\n\t\t\ts := ss[r-1] - ss[l-1]\n\t\t\trem := n - r + 1\n\t\t\tsl := r - l\n\t\t\tans += s * (rem / sl)\n\n\t\t\tx := rem % sl\n\t\t\tans += ss[l+x-1] - ss[l-1]\n\t\t\tbreak\n\t\t}\n\t\tdone[a] = i\n\t\tans += a\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1600554538, "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/s788322872.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s788322872", "user_id": "u902409225"}, "prompt_components": {"gold_output": "1369\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, x, m int\n\tfmt.Scan(&n, &x, &m)\n\n\tans := 0\n\tss := make(map[int]int)\n\tdone := make(map[int]int)\n\ta := x\n\tss[1] = a\n\tdone[a] = 1\n\tans += a\n\tfor i := 2; i <= n; i++ {\n\t\ta = ((a % m) * a) % m\n\t\tss[i] = ss[i-1] + a\n\t\tif done[a] > 0 {\n\t\t\tl, r := done[a], i\n\t\t\ts := ss[r-1] - ss[l-1]\n\t\t\trem := n - r + 1\n\t\t\tsl := r - l\n\t\t\tans += s * (rem / sl)\n\n\t\t\tx := rem % sl\n\t\t\tans += ss[l+x-1] - ss[l-1]\n\t\t\tbreak\n\t\t}\n\t\tdone[a] = i\n\t\tans += a\n\t}\n\tfmt.Println(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 495, "cpu_time_ms": 35, "memory_kb": 7660}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s628289900", "group_id": "codeNet:p02552", "input_text": "package main\n \nimport (\n \"fmt\"\n)\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 0 {\n fmt.Println(\"1\")\n } else {\n fmt.Println(\"0\")\n }\n}", "language": "Go", "metadata": {"date": 1600023698, "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/s628289900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s628289900", "user_id": "u866560627"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n == 0 {\n fmt.Println(\"1\")\n } else {\n fmt.Println(\"0\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 10, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s545082600", "group_id": "codeNet:p02554", "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, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 問題によって値は調整する\nconst (\n\tmod = int(1e9) + 7\n\tmaxsize = 51000\n)\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tans = PowMod(10, N, mod) - PowMod(9, N, mod) - PowMod(9, N, mod) + PowMod(8, N, mod)\n\tfmt.Println(ans)\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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\n// Math Utilities\n// https://play.golang.org/p/bm7uZi0zCN\n\n// Abs Absolute Value\nfunc Abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\n// Pow Integer power: compute a**b using binary powering algorithm\n// See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3\nfunc Pow(a, b int) int {\n\tp := 1\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp *= a\n\t\t}\n\t\tb >>= 1\n\t\ta *= a\n\t}\n\treturn p\n}\n\n// PowMod Modular integer power: compute a**b mod m using binary powering algorithm\nfunc PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\n// MinOf 与えられたintのうち最小のものを返す\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\n// MaxOf 与えられたintのうち最大のものを返す\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// IH golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, Abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// COMで使うスライス\nvar fac = make([]int, maxsize)\nvar finv = make([]int, maxsize)\nvar inv = make([]int, maxsize)\n\n// COMinit で COMで使うためのテーブルを作る前処理\n// O(N)\n// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr\nfunc COMinit() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\tfor i := 2; i < maxsize; 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// COM nCkを求める。COMinitを先に実行する\n// COMinitの結果を使ってO(1)で行える\nfunc COM(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", "language": "Go", "metadata": {"date": 1600042308, "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/s545082600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s545082600", "user_id": "u605443479"}, "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\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 問題によって値は調整する\nconst (\n\tmod = int(1e9) + 7\n\tmaxsize = 51000\n)\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tans = PowMod(10, N, mod) - PowMod(9, N, mod) - PowMod(9, N, mod) + PowMod(8, N, mod)\n\tfmt.Println(ans)\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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\n// Math Utilities\n// https://play.golang.org/p/bm7uZi0zCN\n\n// Abs Absolute Value\nfunc Abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\n// Pow Integer power: compute a**b using binary powering algorithm\n// See Donald Knuth, The Art of Computer Programming, Volume 2, Section 4.6.3\nfunc Pow(a, b int) int {\n\tp := 1\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp *= a\n\t\t}\n\t\tb >>= 1\n\t\ta *= a\n\t}\n\treturn p\n}\n\n// PowMod Modular integer power: compute a**b mod m using binary powering algorithm\nfunc PowMod(a, b, m int) int {\n\ta = a % m\n\tp := 1 % m\n\tfor b > 0 {\n\t\tif b&1 != 0 {\n\t\t\tp = (p * a) % m\n\t\t}\n\t\tb >>= 1\n\t\ta = (a * a) % m\n\t}\n\treturn p\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\n// MinOf 与えられたintのうち最小のものを返す\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\n// MaxOf 与えられたintのうち最大のものを返す\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// IH golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, Abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\n// COMで使うスライス\nvar fac = make([]int, maxsize)\nvar finv = make([]int, maxsize)\nvar inv = make([]int, maxsize)\n\n// COMinit で COMで使うためのテーブルを作る前処理\n// O(N)\n// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#5-%E4%BA%8C%E9%A0%85%E4%BF%82%E6%95%B0-ncr\nfunc COMinit() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\tfor i := 2; i < maxsize; 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// COM nCkを求める。COMinitを先に実行する\n// COMinitの結果を使ってO(1)で行える\nfunc COM(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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8128, "cpu_time_ms": 7, "memory_kb": 1812}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s668722086", "group_id": "codeNet:p02554", "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 next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nconst DIV uint64 = 1e9 + 7\n\nfunc pow(a uint64, n int) uint64 {\n\tif n == 0 {\n\t\treturn 1\n\t} else if n%2 == 0 {\n\t\tp := pow(a, n/2)\n\t\treturn p * p % DIV\n\t} else {\n\t\tp := pow(a, n/2)\n\t\treturn a * p * p % DIV\n\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\tans := (2*DIV + pow(10, N) - 2*pow(9, N) + pow(8, N)) % DIV\n\tfmt.Fprintf(out, \"%d\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1600024516, "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/s668722086.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s668722086", "user_id": "u673612774"}, "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)\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\nconst DIV uint64 = 1e9 + 7\n\nfunc pow(a uint64, n int) uint64 {\n\tif n == 0 {\n\t\treturn 1\n\t} else if n%2 == 0 {\n\t\tp := pow(a, n/2)\n\t\treturn p * p % DIV\n\t} else {\n\t\tp := pow(a, n/2)\n\t\treturn a * p * p % DIV\n\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\tans := (2*DIV + pow(10, N) - 2*pow(9, N) + pow(8, N)) % DIV\n\tfmt.Fprintf(out, \"%d\\n\", 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s408140814", "group_id": "codeNet:p02558", "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 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 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 bOutput(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 x\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\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, q := iScan(), iScan()\n\tuf := newUF(n)\n\tfor i := 0; i < q; i++ {\n\t\tt, u, v := iScan(), iScan(), iScan()\n\t\tif t == 0 {\n\t\t\tuf.unite(u, v)\n\t\t} else {\n\t\t\tbOutput(uf.same(u, v), \"1\", \"0\")\n\t\t}\n\t}\n}\n\ntype UnionFind struct {\n\tpar []int\n}\n\nfunc newUF(n int) *UnionFind {\n\tuf := new(UnionFind)\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\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}\n", "language": "Go", "metadata": {"date": 1599664690, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02558.html", "problem_id": "p02558", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02558/input.txt", "sample_output_relpath": "derived/input_output/data/p02558/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02558/Go/s408140814.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s408140814", "user_id": "u843722521"}, "prompt_components": {"gold_output": "0\n1\n0\n1\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 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 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 bOutput(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 x\n}\nfunc iSSPrint(x []int) {\n\tfmt.Println(strings.Trim(fmt.Sprint(x), \"[]\"))\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, q := iScan(), iScan()\n\tuf := newUF(n)\n\tfor i := 0; i < q; i++ {\n\t\tt, u, v := iScan(), iScan(), iScan()\n\t\tif t == 0 {\n\t\t\tuf.unite(u, v)\n\t\t} else {\n\t\t\tbOutput(uf.same(u, v), \"1\", \"0\")\n\t\t}\n\t}\n}\n\ntype UnionFind struct {\n\tpar []int\n}\n\nfunc newUF(n int) *UnionFind {\n\tuf := new(UnionFind)\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\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}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph with N vertices and 0 edges. Process Q queries of the following types.\n\n0 u v: Add an edge (u, v).\n\n1 u v: Print 1 if u and v are in the same connected component, 0 otherwise.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq Q \\leq 200,000\n\n0 \\leq u_i, v_i \\lt N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nt_1 u_1 v_1\nt_2 u_2 v_2\n:\nt_Q u_Q v_Q\n\n出力\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n\nSample Output 1\n\n0\n1\n0\n1", "sample_input": "4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n"}, "reference_outputs": ["0\n1\n0\n1\n"], "source_document_id": "p02558", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an undirected graph with N vertices and 0 edges. Process Q queries of the following types.\n\n0 u v: Add an edge (u, v).\n\n1 u v: Print 1 if u and v are in the same connected component, 0 otherwise.\n\nConstraints\n\n1 \\leq N \\leq 200,000\n\n1 \\leq Q \\leq 200,000\n\n0 \\leq u_i, v_i \\lt N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nt_1 u_1 v_1\nt_2 u_2 v_2\n:\nt_Q u_Q v_Q\n\n出力\n\nFor each query of the latter type, print the answer.\n\nSample Input 1\n\n4 7\n1 0 1\n0 0 1\n0 2 3\n1 0 1\n1 1 2\n0 0 2\n1 1 3\n\nSample Output 1\n\n0\n1\n0\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2369, "cpu_time_ms": 225, "memory_kb": 5876}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s868975864", "group_id": "codeNet:p02563", "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\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 := 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 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, b := iSScan(n), iSScan(m)\n\tiSSPrint(convolution(a, b, lp2))\n}\nfunc ceilPow2(n int) int {\n\tx := 0\n\tfor (1 << uint(x)) < n {\n\t\tx++\n\t}\n\treturn x\n}\nfunc bsf(n uint) int {\n\treturn bits.TrailingZeros(n)\n}\nfunc primitiveRoot(m int) int {\n\tif m == 2 {\n\t\treturn 1\n\t} else if m == 167772161 {\n\t\treturn 3\n\t} else if m == 469762049 {\n\t\treturn 3\n\t} else if m == 754974721 {\n\t\treturn 11\n\t} else if m == 998244353 {\n\t\treturn 3\n\t}\n\tdivs := make([]int, 20)\n\tdivs[0] = 2\n\tcnt := 1\n\tx := (m - 1) / 2\n\tfor (x % 2) == 0 {\n\t\tx /= 2\n\t}\n\tfor i := 3; i*i <= x; i += 2 {\n\t\tif x%i == 0 {\n\t\t\tdivs[cnt] = i\n\t\t\tcnt++\n\t\t\tfor x%i == 0 {\n\t\t\t\tx /= i\n\t\t\t}\n\t\t}\n\t}\n\tif x > 1 {\n\t\tdivs[cnt] = x\n\t\tcnt++\n\t}\n\tfor g := 2; ; g++ {\n\t\tok := true\n\t\tfor i := 0; i < cnt; i++ {\n\t\t\tif powMod(g, (m-1)/divs[i], m) == 1 {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\treturn g\n\t\t}\n\t}\n}\nfunc powMod(x, n, m int) int {\n\tif m == 1 {\n\t\treturn 0\n\t}\n\tr := 1\n\ty := x % m\n\tif y < 0 {\n\t\ty += m\n\t}\n\tfor n != 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tr = (r * y) % m\n\t\t}\n\t\ty = (y * y) % m\n\t\tn >>= 1\n\t}\n\treturn r\n}\nfunc butterfly(a []int, prm int) {\n\tg := primitiveRoot(prm)\n\tn := len(a)\n\th := ceilPow2(n)\n\tfirst := true\n\tse := make([]int, 30)\n\tif first {\n\t\tfirst = false\n\t\tes, ies := make([]int, 30), make([]int, 30)\n\t\tcnt2 := bsf(uint(prm - 1))\n\t\te := powMod(g, (prm-1)>>uint(cnt2), prm)\n\t\tie := invGcd(e, prm)[1]\n\t\tfor i := cnt2; i >= 2; i-- {\n\t\t\tes[i-2] = e\n\t\t\ties[i-2] = ie\n\t\t\te *= e\n\t\t\te %= prm\n\t\t\tie *= ie\n\t\t\tie %= prm\n\t\t}\n\t\tnow := 1\n\t\tfor i := 0; i < cnt2-2; i++ {\n\t\t\tse[i] = es[i] * now\n\t\t\tse[i] %= prm\n\t\t\tnow *= ies[i]\n\t\t\tnow %= prm\n\t\t}\n\t}\n\tfor ph := 1; ph <= h; ph++ {\n\t\tw := 1 << uint(ph-1)\n\t\tp := 1 << uint(h-ph)\n\t\tnow := 1\n\t\tfor s := 0; s < w; s++ {\n\t\t\toffset := s << uint(h-ph+1)\n\t\t\tfor i := 0; i < p; i++ {\n\t\t\t\tl := a[i+offset]\n\t\t\t\tr := a[i+offset+p] * now % prm\n\t\t\t\ta[i+offset] = l + r\n\t\t\t\ta[i+offset+p] = l - r\n\t\t\t\ta[i+offset] %= prm\n\t\t\t\ta[i+offset+p] %= prm\n\t\t\t\tif a[i+offset+p] < 0 {\n\t\t\t\t\ta[i+offset+p] += prm\n\t\t\t\t}\n\t\t\t}\n\t\t\tnow *= se[bsf(^(uint(s)))]\n\t\t\tnow %= prm\n\t\t}\n\t}\n}\nfunc butterflyInv(a []int, prm int) {\n\tg := primitiveRoot(prm)\n\tn := len(a)\n\th := ceilPow2(n)\n\tfirst := true\n\tsie := make([]int, 30)\n\tif first {\n\t\tfirst = false\n\t\tes, ies := make([]int, 30), make([]int, 30)\n\t\tcnt2 := bsf(uint(prm - 1))\n\t\te := powMod(g, (prm-1)>>uint(cnt2), prm)\n\t\tie := invGcd(e, prm)[1]\n\t\tfor i := cnt2; i >= 2; i-- {\n\t\t\tes[i-2] = e\n\t\t\ties[i-2] = ie\n\t\t\te *= e\n\t\t\te %= prm\n\t\t\tie *= ie\n\t\t\tie %= prm\n\t\t}\n\t\tnow := 1\n\t\tfor i := 0; i < cnt2-2; i++ {\n\t\t\tsie[i] = ies[i] * now\n\t\t\tsie[i] %= prm\n\t\t\tnow *= es[i]\n\t\t\tnow %= prm\n\t\t}\n\t}\n\tfor ph := h; ph >= 1; ph-- {\n\t\tw := 1 << uint(ph-1)\n\t\tp := 1 << uint(h-ph)\n\t\tinow := 1\n\t\tfor s := 0; s < w; s++ {\n\t\t\toffset := s << uint(h-ph+1)\n\t\t\tfor i := 0; i < p; i++ {\n\t\t\t\tl := a[i+offset]\n\t\t\t\tr := a[i+offset+p]\n\t\t\t\ta[i+offset] = l + r\n\t\t\t\ta[i+offset+p] = (prm + l - r) * inow\n\t\t\t\ta[i+offset] %= prm\n\t\t\t\ta[i+offset+p] %= prm\n\t\t\t}\n\t\t\tinow *= sie[bsf(^uint(s))]\n\t\t\tinow %= prm\n\t\t}\n\t}\n}\nfunc convMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc convolution(p, q []int, prm int) []int {\n\tn, m := len(p), len(q)\n\tif n == 0 || m == 0 {\n\t\treturn []int{}\n\t}\n\tif convMin(n, m) <= 60 {\n\t\tvar a, b []int\n\t\tif n < m {\n\t\t\tn, m = m, n\n\t\t\ta = make([]int, n)\n\t\t\tb = make([]int, m)\n\t\t\tcopy(a, q)\n\t\t\tcopy(b, p)\n\t\t} else {\n\t\t\ta = make([]int, n)\n\t\t\tb = make([]int, m)\n\t\t\tcopy(a, p)\n\t\t\tcopy(b, q)\n\t\t}\n\t\tans := make([]int, n+m-1)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tans[i+j] += a[i] * b[j] % prm\n\t\t\t\tans[i+j] %= prm\n\t\t\t}\n\t\t}\n\t\treturn ans\n\t}\n\tz := 1 << uint(ceilPow2(n+m-1))\n\ta, b := make([]int, z), make([]int, z)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = p[i]\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = q[i]\n\t}\n\tbutterfly(a, prm)\n\tbutterfly(b, prm)\n\tfor i := 0; i < z; i++ {\n\t\ta[i] *= b[i]\n\t\ta[i] %= prm\n\t}\n\ta = a[:n+m-1]\n\tiz := invGcd(z, prm)[1]\n\tfor i := 0; i < n+m-1; i++ {\n\t\ta[i] *= iz\n\t\ta[i] %= prm\n\t}\n\treturn a\n}\nfunc convolutionLL(a, b []int, prm int) []int {\n\tn, m := len(a), len(b)\n\tfor n != 0 || m != 0 {\n\t\treturn []int{}\n\t}\n\tMOD1 := 754974721\n\tMOD2 := 167772161\n\tMOD3 := 469762049\n\tM2M3 := MOD2 * MOD3\n\tM1M3 := MOD1 * MOD3\n\tM1M2 := MOD1 * MOD2\n\tM1M2M3 := MOD1 * MOD2 * MOD3\n\ti1 := invGcd(MOD2*MOD3, MOD1)[1]\n\ti2 := invGcd(MOD1*MOD3, MOD2)[1]\n\ti3 := invGcd(MOD1*MOD2, MOD3)[1]\n\tc1 := convolution(a, b, MOD1)\n\tc2 := convolution(a, b, MOD2)\n\tc3 := convolution(a, b, MOD3)\n\tc := make([]int, n+m-1)\n\tfor i := 0; i < n+m-1; i++ {\n\t\tx := 0\n\t\tx += (c1[i] * i1) % MOD1 * M2M3\n\t\tx += (c2[i] * i2) % MOD2 * M1M3\n\t\tx += (c3[i] * i3) % MOD3 * M1M2\n\t\tt := x % MOD1\n\t\tif t < 0 {\n\t\t\tt += MOD1\n\t\t}\n\t\tdiff := c1[i] - t\n\t\tif diff < 0 {\n\t\t\tdiff += MOD1\n\t\t}\n\t\toffset := []int{0, 0, M1M2M3, 2 * M1M2M3, 3 * M1M2M3}\n\t\tx -= offset[diff%5]\n\t\tc[i] = x\n\t}\n\treturn c\n}\nfunc invGcd(a, b int) [2]int {\n\ta = a % b\n\tif a < 0 {\n\t\ta += b\n\t}\n\ts, t := b, a\n\tm0, m1 := 0, 1\n\tfor t != 0 {\n\t\tu := s / t\n\t\ts -= t * u\n\t\tm0 -= m1 * u\n\t\ttmp := s\n\t\ts = t\n\t\tt = tmp\n\t\ttmp = m0\n\t\tm0 = m1\n\t\tm1 = tmp\n\t}\n\tif m0 < 0 {\n\t\tm0 += b / s\n\t}\n\treturn [2]int{s, m0}\n}\n", "language": "Go", "metadata": {"date": 1599850343, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02563.html", "problem_id": "p02563", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02563/input.txt", "sample_output_relpath": "derived/input_output/data/p02563/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02563/Go/s868975864.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s868975864", "user_id": "u843722521"}, "prompt_components": {"gold_output": "5 16 34 60 70 70 59 36\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\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 := 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 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, b := iSScan(n), iSScan(m)\n\tiSSPrint(convolution(a, b, lp2))\n}\nfunc ceilPow2(n int) int {\n\tx := 0\n\tfor (1 << uint(x)) < n {\n\t\tx++\n\t}\n\treturn x\n}\nfunc bsf(n uint) int {\n\treturn bits.TrailingZeros(n)\n}\nfunc primitiveRoot(m int) int {\n\tif m == 2 {\n\t\treturn 1\n\t} else if m == 167772161 {\n\t\treturn 3\n\t} else if m == 469762049 {\n\t\treturn 3\n\t} else if m == 754974721 {\n\t\treturn 11\n\t} else if m == 998244353 {\n\t\treturn 3\n\t}\n\tdivs := make([]int, 20)\n\tdivs[0] = 2\n\tcnt := 1\n\tx := (m - 1) / 2\n\tfor (x % 2) == 0 {\n\t\tx /= 2\n\t}\n\tfor i := 3; i*i <= x; i += 2 {\n\t\tif x%i == 0 {\n\t\t\tdivs[cnt] = i\n\t\t\tcnt++\n\t\t\tfor x%i == 0 {\n\t\t\t\tx /= i\n\t\t\t}\n\t\t}\n\t}\n\tif x > 1 {\n\t\tdivs[cnt] = x\n\t\tcnt++\n\t}\n\tfor g := 2; ; g++ {\n\t\tok := true\n\t\tfor i := 0; i < cnt; i++ {\n\t\t\tif powMod(g, (m-1)/divs[i], m) == 1 {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\treturn g\n\t\t}\n\t}\n}\nfunc powMod(x, n, m int) int {\n\tif m == 1 {\n\t\treturn 0\n\t}\n\tr := 1\n\ty := x % m\n\tif y < 0 {\n\t\ty += m\n\t}\n\tfor n != 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tr = (r * y) % m\n\t\t}\n\t\ty = (y * y) % m\n\t\tn >>= 1\n\t}\n\treturn r\n}\nfunc butterfly(a []int, prm int) {\n\tg := primitiveRoot(prm)\n\tn := len(a)\n\th := ceilPow2(n)\n\tfirst := true\n\tse := make([]int, 30)\n\tif first {\n\t\tfirst = false\n\t\tes, ies := make([]int, 30), make([]int, 30)\n\t\tcnt2 := bsf(uint(prm - 1))\n\t\te := powMod(g, (prm-1)>>uint(cnt2), prm)\n\t\tie := invGcd(e, prm)[1]\n\t\tfor i := cnt2; i >= 2; i-- {\n\t\t\tes[i-2] = e\n\t\t\ties[i-2] = ie\n\t\t\te *= e\n\t\t\te %= prm\n\t\t\tie *= ie\n\t\t\tie %= prm\n\t\t}\n\t\tnow := 1\n\t\tfor i := 0; i < cnt2-2; i++ {\n\t\t\tse[i] = es[i] * now\n\t\t\tse[i] %= prm\n\t\t\tnow *= ies[i]\n\t\t\tnow %= prm\n\t\t}\n\t}\n\tfor ph := 1; ph <= h; ph++ {\n\t\tw := 1 << uint(ph-1)\n\t\tp := 1 << uint(h-ph)\n\t\tnow := 1\n\t\tfor s := 0; s < w; s++ {\n\t\t\toffset := s << uint(h-ph+1)\n\t\t\tfor i := 0; i < p; i++ {\n\t\t\t\tl := a[i+offset]\n\t\t\t\tr := a[i+offset+p] * now % prm\n\t\t\t\ta[i+offset] = l + r\n\t\t\t\ta[i+offset+p] = l - r\n\t\t\t\ta[i+offset] %= prm\n\t\t\t\ta[i+offset+p] %= prm\n\t\t\t\tif a[i+offset+p] < 0 {\n\t\t\t\t\ta[i+offset+p] += prm\n\t\t\t\t}\n\t\t\t}\n\t\t\tnow *= se[bsf(^(uint(s)))]\n\t\t\tnow %= prm\n\t\t}\n\t}\n}\nfunc butterflyInv(a []int, prm int) {\n\tg := primitiveRoot(prm)\n\tn := len(a)\n\th := ceilPow2(n)\n\tfirst := true\n\tsie := make([]int, 30)\n\tif first {\n\t\tfirst = false\n\t\tes, ies := make([]int, 30), make([]int, 30)\n\t\tcnt2 := bsf(uint(prm - 1))\n\t\te := powMod(g, (prm-1)>>uint(cnt2), prm)\n\t\tie := invGcd(e, prm)[1]\n\t\tfor i := cnt2; i >= 2; i-- {\n\t\t\tes[i-2] = e\n\t\t\ties[i-2] = ie\n\t\t\te *= e\n\t\t\te %= prm\n\t\t\tie *= ie\n\t\t\tie %= prm\n\t\t}\n\t\tnow := 1\n\t\tfor i := 0; i < cnt2-2; i++ {\n\t\t\tsie[i] = ies[i] * now\n\t\t\tsie[i] %= prm\n\t\t\tnow *= es[i]\n\t\t\tnow %= prm\n\t\t}\n\t}\n\tfor ph := h; ph >= 1; ph-- {\n\t\tw := 1 << uint(ph-1)\n\t\tp := 1 << uint(h-ph)\n\t\tinow := 1\n\t\tfor s := 0; s < w; s++ {\n\t\t\toffset := s << uint(h-ph+1)\n\t\t\tfor i := 0; i < p; i++ {\n\t\t\t\tl := a[i+offset]\n\t\t\t\tr := a[i+offset+p]\n\t\t\t\ta[i+offset] = l + r\n\t\t\t\ta[i+offset+p] = (prm + l - r) * inow\n\t\t\t\ta[i+offset] %= prm\n\t\t\t\ta[i+offset+p] %= prm\n\t\t\t}\n\t\t\tinow *= sie[bsf(^uint(s))]\n\t\t\tinow %= prm\n\t\t}\n\t}\n}\nfunc convMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc convolution(p, q []int, prm int) []int {\n\tn, m := len(p), len(q)\n\tif n == 0 || m == 0 {\n\t\treturn []int{}\n\t}\n\tif convMin(n, m) <= 60 {\n\t\tvar a, b []int\n\t\tif n < m {\n\t\t\tn, m = m, n\n\t\t\ta = make([]int, n)\n\t\t\tb = make([]int, m)\n\t\t\tcopy(a, q)\n\t\t\tcopy(b, p)\n\t\t} else {\n\t\t\ta = make([]int, n)\n\t\t\tb = make([]int, m)\n\t\t\tcopy(a, p)\n\t\t\tcopy(b, q)\n\t\t}\n\t\tans := make([]int, n+m-1)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := 0; j < m; j++ {\n\t\t\t\tans[i+j] += a[i] * b[j] % prm\n\t\t\t\tans[i+j] %= prm\n\t\t\t}\n\t\t}\n\t\treturn ans\n\t}\n\tz := 1 << uint(ceilPow2(n+m-1))\n\ta, b := make([]int, z), make([]int, z)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = p[i]\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = q[i]\n\t}\n\tbutterfly(a, prm)\n\tbutterfly(b, prm)\n\tfor i := 0; i < z; i++ {\n\t\ta[i] *= b[i]\n\t\ta[i] %= prm\n\t}\n\ta = a[:n+m-1]\n\tiz := invGcd(z, prm)[1]\n\tfor i := 0; i < n+m-1; i++ {\n\t\ta[i] *= iz\n\t\ta[i] %= prm\n\t}\n\treturn a\n}\nfunc convolutionLL(a, b []int, prm int) []int {\n\tn, m := len(a), len(b)\n\tfor n != 0 || m != 0 {\n\t\treturn []int{}\n\t}\n\tMOD1 := 754974721\n\tMOD2 := 167772161\n\tMOD3 := 469762049\n\tM2M3 := MOD2 * MOD3\n\tM1M3 := MOD1 * MOD3\n\tM1M2 := MOD1 * MOD2\n\tM1M2M3 := MOD1 * MOD2 * MOD3\n\ti1 := invGcd(MOD2*MOD3, MOD1)[1]\n\ti2 := invGcd(MOD1*MOD3, MOD2)[1]\n\ti3 := invGcd(MOD1*MOD2, MOD3)[1]\n\tc1 := convolution(a, b, MOD1)\n\tc2 := convolution(a, b, MOD2)\n\tc3 := convolution(a, b, MOD3)\n\tc := make([]int, n+m-1)\n\tfor i := 0; i < n+m-1; i++ {\n\t\tx := 0\n\t\tx += (c1[i] * i1) % MOD1 * M2M3\n\t\tx += (c2[i] * i2) % MOD2 * M1M3\n\t\tx += (c3[i] * i3) % MOD3 * M1M2\n\t\tt := x % MOD1\n\t\tif t < 0 {\n\t\t\tt += MOD1\n\t\t}\n\t\tdiff := c1[i] - t\n\t\tif diff < 0 {\n\t\t\tdiff += MOD1\n\t\t}\n\t\toffset := []int{0, 0, M1M2M3, 2 * M1M2M3, 3 * M1M2M3}\n\t\tx -= offset[diff%5]\n\t\tc[i] = x\n\t}\n\treturn c\n}\nfunc invGcd(a, b int) [2]int {\n\ta = a % b\n\tif a < 0 {\n\t\ta += b\n\t}\n\ts, t := b, a\n\tm0, m1 := 0, 1\n\tfor t != 0 {\n\t\tu := s / t\n\t\ts -= t * u\n\t\tm0 -= m1 * u\n\t\ttmp := s\n\t\ts = t\n\t\tt = tmp\n\t\ttmp = m0\n\t\tm0 = m1\n\t\tm1 = tmp\n\t}\n\tif m0 < 0 {\n\t\tm0 += b / s\n\t}\n\treturn [2]int{s, m0}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integer arrays a_0, a_1, ..., a_{N - 1} and b_0, b_1, ..., b_{M - 1}. Calculate the array c_0, c_1, ..., c_{(N - 1) + (M - 1)}, defined by c_i = \\sum_{j = 0}^i a_j b_{i - j} \\bmod 998244353.\n\nConstraints\n\n1 \\leq N, M \\leq 524288\n\n0 \\leq a_i, b_i < 998244353\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{M-1}\n\nOutput\n\nPrint the answer in the following format:\n\nc_0 c_1 ... c_{(N - 1) + (M - 1)}\n\nSample Input 1\n\n4 5\n1 2 3 4\n5 6 7 8 9\n\nSample Output 1\n\n5 16 34 60 70 70 59 36\n\nSample Input 2\n\n1 1\n10000000\n10000000\n\nSample Output 2\n\n871938225", "sample_input": "4 5\n1 2 3 4\n5 6 7 8 9\n"}, "reference_outputs": ["5 16 34 60 70 70 59 36\n"], "source_document_id": "p02563", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integer arrays a_0, a_1, ..., a_{N - 1} and b_0, b_1, ..., b_{M - 1}. Calculate the array c_0, c_1, ..., c_{(N - 1) + (M - 1)}, defined by c_i = \\sum_{j = 0}^i a_j b_{i - j} \\bmod 998244353.\n\nConstraints\n\n1 \\leq N, M \\leq 524288\n\n0 \\leq a_i, b_i < 998244353\n\nAll values in Input are integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 a_1 ... a_{N-1}\nb_0 b_1 ... b_{M-1}\n\nOutput\n\nPrint the answer in the following format:\n\nc_0 c_1 ... c_{(N - 1) + (M - 1)}\n\nSample Input 1\n\n4 5\n1 2 3 4\n5 6 7 8 9\n\nSample Output 1\n\n5 16 34 60 70 70 59 36\n\nSample Input 2\n\n1 1\n10000000\n10000000\n\nSample Output 2\n\n871938225", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6649, "cpu_time_ms": 1124, "memory_kb": 85060}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s715892842", "group_id": "codeNet:p02564", "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 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 := 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 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 := newSccGraph(n)\n\tfor i := 0; i < m; i++ {\n\t\ts.AddEdge(iScan(), iScan())\n\t}\n\tans := s.Scc()\n\tfmt.Println(len(ans))\n\tfor _, v := range ans {\n\t\tfmt.Print(len(v))\n\t\tfmt.Print(\" \")\n\t\tiSSPrint(v)\n\t}\n}\n\ntype SccGraph struct {\n\tn int\n\tedges [][2]int\n}\ntype Csr struct {\n\tstart []int\n\telist []int\n}\n\nfunc newSccGraph(n int) *SccGraph {\n\tscc := new(SccGraph)\n\tscc.n = n\n\treturn scc\n}\nfunc (scc *SccGraph) NumVertices() int {\n\treturn scc.n\n}\nfunc (scc *SccGraph) AddEdge(from int, to int) {\n\tscc.edges = append(scc.edges, [2]int{from, to})\n}\nfunc (c *Csr) csr(n int, edges [][2]int) {\n\tc.start = make([]int, n+1)\n\tc.elist = make([]int, len(edges))\n\tfor _, e := range edges {\n\t\tc.start[e[0]+1]++\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tc.start[i] += c.start[i-1]\n\t}\n\tcounter := make([]int, n+1)\n\tcopy(counter, c.start)\n\tfor _, e := range edges {\n\t\tc.elist[counter[e[0]]] = e[1]\n\t\tcounter[e[0]]++\n\t}\n}\nfunc (scc *SccGraph) SccIds() (int, []int) {\n\tg := new(Csr)\n\tg.csr(scc.n, scc.edges)\n\tnowOrd, groupNum := 0, 0\n\tvisited, low := make([]int, 0, scc.n), make([]int, scc.n)\n\tord, ids := make([]int, scc.n), make([]int, scc.n)\n\tfor i := 0; i < scc.n; i++ {\n\t\tord[i] = -1\n\t}\n\tvar dfs func(v int)\n\tdfs = func(v int) {\n\t\tlow[v], ord[v] = nowOrd, nowOrd\n\t\tnowOrd++\n\t\tvisited = append(visited, v)\n\t\tfor i := g.start[v]; i < g.start[v+1]; i++ {\n\t\t\tto := g.elist[i]\n\t\t\tif ord[to] == -1 {\n\t\t\t\tdfs(to)\n\t\t\t\tlow[v] = scc.min(low[v], low[to])\n\t\t\t} else {\n\t\t\t\tlow[v] = scc.min(low[v], ord[to])\n\t\t\t}\n\t\t}\n\t\tif low[v] == ord[v] {\n\t\t\tfor {\n\t\t\t\tu := visited[len(visited)-1]\n\t\t\t\tvisited = visited[:len(visited)-1]\n\t\t\t\tord[u] = scc.n\n\t\t\t\tids[u] = groupNum\n\t\t\t\tif u == v {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tgroupNum++\n\t\t}\n\t}\n\tfor i := 0; i < scc.n; i++ {\n\t\tif ord[i] == -1 {\n\t\t\tdfs(i)\n\t\t}\n\t}\n\tfor i := 0; i < len(ids); i++ {\n\t\tids[i] = groupNum - 1 - ids[i]\n\t}\n\treturn groupNum, ids\n}\nfunc (scc *SccGraph) min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\nfunc (scc *SccGraph) Scc() [][]int {\n\tgroupNum, ids := scc.SccIds()\n\tcounts := make([]int, groupNum)\n\tfor _, x := range ids {\n\t\tcounts[x]++\n\t}\n\tgroups := make([][]int, groupNum)\n\tfor i := 0; i < groupNum; i++ {\n\t\tgroups[i] = make([]int, 0, counts[i])\n\t}\n\tfor i := 0; i < scc.n; i++ {\n\t\tgroups[ids[i]] = append(groups[ids[i]], i)\n\t}\n\treturn groups\n}\n", "language": "Go", "metadata": {"date": 1599857357, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02564.html", "problem_id": "p02564", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02564/input.txt", "sample_output_relpath": "derived/input_output/data/p02564/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02564/Go/s715892842.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s715892842", "user_id": "u843722521"}, "prompt_components": {"gold_output": "4\n1 5\n2 4 1\n1 2\n2 3 0\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 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 := 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 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 := newSccGraph(n)\n\tfor i := 0; i < m; i++ {\n\t\ts.AddEdge(iScan(), iScan())\n\t}\n\tans := s.Scc()\n\tfmt.Println(len(ans))\n\tfor _, v := range ans {\n\t\tfmt.Print(len(v))\n\t\tfmt.Print(\" \")\n\t\tiSSPrint(v)\n\t}\n}\n\ntype SccGraph struct {\n\tn int\n\tedges [][2]int\n}\ntype Csr struct {\n\tstart []int\n\telist []int\n}\n\nfunc newSccGraph(n int) *SccGraph {\n\tscc := new(SccGraph)\n\tscc.n = n\n\treturn scc\n}\nfunc (scc *SccGraph) NumVertices() int {\n\treturn scc.n\n}\nfunc (scc *SccGraph) AddEdge(from int, to int) {\n\tscc.edges = append(scc.edges, [2]int{from, to})\n}\nfunc (c *Csr) csr(n int, edges [][2]int) {\n\tc.start = make([]int, n+1)\n\tc.elist = make([]int, len(edges))\n\tfor _, e := range edges {\n\t\tc.start[e[0]+1]++\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tc.start[i] += c.start[i-1]\n\t}\n\tcounter := make([]int, n+1)\n\tcopy(counter, c.start)\n\tfor _, e := range edges {\n\t\tc.elist[counter[e[0]]] = e[1]\n\t\tcounter[e[0]]++\n\t}\n}\nfunc (scc *SccGraph) SccIds() (int, []int) {\n\tg := new(Csr)\n\tg.csr(scc.n, scc.edges)\n\tnowOrd, groupNum := 0, 0\n\tvisited, low := make([]int, 0, scc.n), make([]int, scc.n)\n\tord, ids := make([]int, scc.n), make([]int, scc.n)\n\tfor i := 0; i < scc.n; i++ {\n\t\tord[i] = -1\n\t}\n\tvar dfs func(v int)\n\tdfs = func(v int) {\n\t\tlow[v], ord[v] = nowOrd, nowOrd\n\t\tnowOrd++\n\t\tvisited = append(visited, v)\n\t\tfor i := g.start[v]; i < g.start[v+1]; i++ {\n\t\t\tto := g.elist[i]\n\t\t\tif ord[to] == -1 {\n\t\t\t\tdfs(to)\n\t\t\t\tlow[v] = scc.min(low[v], low[to])\n\t\t\t} else {\n\t\t\t\tlow[v] = scc.min(low[v], ord[to])\n\t\t\t}\n\t\t}\n\t\tif low[v] == ord[v] {\n\t\t\tfor {\n\t\t\t\tu := visited[len(visited)-1]\n\t\t\t\tvisited = visited[:len(visited)-1]\n\t\t\t\tord[u] = scc.n\n\t\t\t\tids[u] = groupNum\n\t\t\t\tif u == v {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tgroupNum++\n\t\t}\n\t}\n\tfor i := 0; i < scc.n; i++ {\n\t\tif ord[i] == -1 {\n\t\t\tdfs(i)\n\t\t}\n\t}\n\tfor i := 0; i < len(ids); i++ {\n\t\tids[i] = groupNum - 1 - ids[i]\n\t}\n\treturn groupNum, ids\n}\nfunc (scc *SccGraph) min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\nfunc (scc *SccGraph) Scc() [][]int {\n\tgroupNum, ids := scc.SccIds()\n\tcounts := make([]int, groupNum)\n\tfor _, x := range ids {\n\t\tcounts[x]++\n\t}\n\tgroups := make([][]int, groupNum)\n\tfor i := 0; i < groupNum; i++ {\n\t\tgroups[i] = make([]int, 0, counts[i])\n\t}\n\tfor i := 0; i < scc.n; i++ {\n\t\tgroups[ids[i]] = append(groups[ids[i]], i)\n\t}\n\treturn groups\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "sample_input": "6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n"}, "reference_outputs": ["4\n1 5\n2 4 1\n1 2\n2 3 0\n"], "source_document_id": "p02564", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a directed graph with N vertices and M edges, not necessarily simple. The i-th edge is oriented from the vertex a_i to the vertex b_i.\nDivide this graph into strongly connected components and print them in their topological order.\n\nConstraints\n\n1 \\leq N \\leq 500,000\n\n1 \\leq M \\leq 500,000\n\n0 \\leq a_i, b_i < N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_0 b_0\na_1 b_1\n:\na_{M - 1} b_{M - 1}\n\nOutput\n\nPrint 1+K lines, where K is the number of strongly connected components.\nPrint K on the first line.\nPrint the information of each strongly connected component in next K lines in the following format, where l is the number of vertices in the strongly connected component and v_i is the index of the vertex in it.\n\nl v_0 v_1 ... v_{l-1}\n\nHere, for each edge (a_i, b_i), b_i should not appear in earlier line than a_i.\n\nIf there are multiple correct output, print any of them.\n\nSample Input 1\n\n6 7\n1 4\n5 2\n3 0\n5 5\n4 1\n0 3\n4 2\n\nSample Output 1\n\n4\n1 5\n2 4 1\n1 2\n2 3 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3922, "cpu_time_ms": 2710, "memory_kb": 68456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s571594301", "group_id": "codeNet:p02566", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc makeSuffixArray(s string) []int {\n\tn := len(s)\n\tsa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tsa[i] = i\n\t}\n\trnk := make([]int, n)\n\tfor i, b := range []byte(s) {\n\t\trnk[i] = int(b)\n\t}\n\ttmp := make([]int, n)\n\n\tfor k := 1; k < n; k *= 2 {\n\t\tcmp := func(x, y int) bool {\n\t\t\tif rnk[x] != rnk[y] {\n\t\t\t\treturn rnk[x] < rnk[y]\n\t\t\t}\n\t\t\trx, ry := -1, -1\n\t\t\tif x+k < n {\n\t\t\t\trx = rnk[x+k]\n\t\t\t}\n\t\t\tif y+k < n {\n\t\t\t\try = rnk[y+k]\n\t\t\t}\n\t\t\treturn rx < ry\n\t\t}\n\t\tsort.Slice(sa, cmp)\n\t\ttmp[sa[0]] = 0\n\t\tfor i := 1; i < n; i++ {\n\t\t\ttmp[sa[i]] = tmp[sa[i-1]]\n\t\t\tif cmp(sa[i-1], sa[i]) {\n\t\t\t\ttmp[sa[i]]++\n\t\t\t}\n\t\t}\n\t\ttmp, rnk = rnk, tmp\n\t}\n\treturn sa\n}\n\nfunc makeLcpArray(s string, sa []int) []int {\n\tb := []byte(s)\n\tn := len(s)\n\trnk := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\trnk[sa[i]] = i\n\t}\n\tlcp := make([]int, n-1)\n\th := 0\n\tfor i := 0; i < n; i++ {\n\t\tif h > 0 {\n\t\t\th--\n\t\t}\n\t\tif rnk[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tj := sa[rnk[i]-1]\n\t\tfor j+h < n && i+h < n {\n\t\t\tif b[j+h] != b[i+h] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\th++\n\t\t}\n\t\tlcp[rnk[i]-1] = h\n\t}\n\treturn lcp\n}\n\nfunc main() {\n\tdefer flush()\n\n\tS := readString()\n\tsa := makeSuffixArray(S)\n\n\tresult := len(S) * (len(S) + 1) / 2\n\tla := makeLcpArray(S, sa)\n\tfor _, x := range la {\n\t\tresult -= x\n\t}\n\tprintln(result)\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 println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "language": "Go", "metadata": {"date": 1600127237, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02566.html", "problem_id": "p02566", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02566/input.txt", "sample_output_relpath": "derived/input_output/data/p02566/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02566/Go/s571594301.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s571594301", "user_id": "u347640436"}, "prompt_components": {"gold_output": "21\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 makeSuffixArray(s string) []int {\n\tn := len(s)\n\tsa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tsa[i] = i\n\t}\n\trnk := make([]int, n)\n\tfor i, b := range []byte(s) {\n\t\trnk[i] = int(b)\n\t}\n\ttmp := make([]int, n)\n\n\tfor k := 1; k < n; k *= 2 {\n\t\tcmp := func(x, y int) bool {\n\t\t\tif rnk[x] != rnk[y] {\n\t\t\t\treturn rnk[x] < rnk[y]\n\t\t\t}\n\t\t\trx, ry := -1, -1\n\t\t\tif x+k < n {\n\t\t\t\trx = rnk[x+k]\n\t\t\t}\n\t\t\tif y+k < n {\n\t\t\t\try = rnk[y+k]\n\t\t\t}\n\t\t\treturn rx < ry\n\t\t}\n\t\tsort.Slice(sa, cmp)\n\t\ttmp[sa[0]] = 0\n\t\tfor i := 1; i < n; i++ {\n\t\t\ttmp[sa[i]] = tmp[sa[i-1]]\n\t\t\tif cmp(sa[i-1], sa[i]) {\n\t\t\t\ttmp[sa[i]]++\n\t\t\t}\n\t\t}\n\t\ttmp, rnk = rnk, tmp\n\t}\n\treturn sa\n}\n\nfunc makeLcpArray(s string, sa []int) []int {\n\tb := []byte(s)\n\tn := len(s)\n\trnk := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\trnk[sa[i]] = i\n\t}\n\tlcp := make([]int, n-1)\n\th := 0\n\tfor i := 0; i < n; i++ {\n\t\tif h > 0 {\n\t\t\th--\n\t\t}\n\t\tif rnk[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tj := sa[rnk[i]-1]\n\t\tfor j+h < n && i+h < n {\n\t\t\tif b[j+h] != b[i+h] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\th++\n\t\t}\n\t\tlcp[rnk[i]-1] = h\n\t}\n\treturn lcp\n}\n\nfunc main() {\n\tdefer flush()\n\n\tS := readString()\n\tsa := makeSuffixArray(S)\n\n\tresult := len(S) * (len(S) + 1) / 2\n\tla := makeLcpArray(S, sa)\n\tfor _, x := range la {\n\t\tresult -= x\n\t}\n\tprintln(result)\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 println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n1 \\leq N \\leq 500,000\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 answer.\n\nSample Input 1\n\nabcbcba\n\nSample Output 1\n\n21\n\nSample Input 2\n\nmississippi\n\nSample Output 2\n\n53\n\nSample Input 3\n\nababacaca\n\nSample Output 3\n\n33\n\nSample Input 4\n\naaaaa\n\nSample Output 4\n\n5", "sample_input": "abcbcba\n"}, "reference_outputs": ["21\n"], "source_document_id": "p02566", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string of length N. Calculate the number of distinct substrings of S.\n\nConstraints\n\n1 \\leq N \\leq 500,000\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 answer.\n\nSample Input 1\n\nabcbcba\n\nSample Output 1\n\n21\n\nSample Input 2\n\nmississippi\n\nSample Output 2\n\n53\n\nSample Input 3\n\nababacaca\n\nSample Output 3\n\n33\n\nSample Input 4\n\naaaaa\n\nSample Output 4\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1921, "cpu_time_ms": 1824, "memory_kb": 23572}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s058438879", "group_id": "codeNet:p02570", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n var a, b, c float64\n fmt.Scanf(\"%f %f %f\", &a, &b, &c)\n if (a/c<=b) {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}", "language": "Go", "metadata": {"date": 1598903411, "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/s058438879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058438879", "user_id": "u402861051"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n var a, b, c float64\n fmt.Scanf(\"%f %f %f\", &a, &b, &c)\n if (a/c<=b) {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s153238446", "group_id": "codeNet:p02570", "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\ntype st struct {\n\tind int\n\tmin int64\n}\n\nfunc main() {\n\tvar D int\n\tvar T int\n\tvar S int\n\tfmt.Scan(&D)\n\tfmt.Scan(&T)\n\tfmt.Scan(&S)\n\n\t// sc.Split(bufio.ScanWords)\n\tif T*S >= D {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\nfunc bc(s string, pos int) string {\n\tch := \"1\"\n\tif string(s[pos]) == \"1\" {\n\t\tch = \"0\"\n\t}\n\tpre := string(s[:pos])\n\tpost := \"\"\n\tif pos != len(s)-1 {\n\t\tpost = string(s[pos+1:])\n\t}\n\ttmp := pre + ch + post\n\treturn tmp\n}\nfunc popCount(n string) int {\n\tcount := 0\n\tfor _, s := range n {\n\t\tif string(s) == \"1\" {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\nfunc chc(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor i, l := range m {\n\t\ttmp := []bool{}\n\t\tfor _, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[i] = tmp\n\t}\n\treturn ret\n}\nfunc chl(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor j, l := range m {\n\t\ttmp := []bool{}\n\t\tfor i, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[j] = tmp\n\t}\n\treturn ret\n}\nfunc helper(ma [][]bool) int {\n\tcount := 0\n\tfor _, l := range ma {\n\t\tfor _, c := range l {\n\t\t\tif c == true {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\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 arrSum(arr []int) int {\n\tsum := 0\n\tfor _, a := range arr {\n\t\tsum += a\n\t}\n\treturn sum\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": 1598728006, "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/s153238446.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s153238446", "user_id": "u757474247"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\n\ntype st struct {\n\tind int\n\tmin int64\n}\n\nfunc main() {\n\tvar D int\n\tvar T int\n\tvar S int\n\tfmt.Scan(&D)\n\tfmt.Scan(&T)\n\tfmt.Scan(&S)\n\n\t// sc.Split(bufio.ScanWords)\n\tif T*S >= D {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\nfunc bc(s string, pos int) string {\n\tch := \"1\"\n\tif string(s[pos]) == \"1\" {\n\t\tch = \"0\"\n\t}\n\tpre := string(s[:pos])\n\tpost := \"\"\n\tif pos != len(s)-1 {\n\t\tpost = string(s[pos+1:])\n\t}\n\ttmp := pre + ch + post\n\treturn tmp\n}\nfunc popCount(n string) int {\n\tcount := 0\n\tfor _, s := range n {\n\t\tif string(s) == \"1\" {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\nfunc chc(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor i, l := range m {\n\t\ttmp := []bool{}\n\t\tfor _, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[i] = tmp\n\t}\n\treturn ret\n}\nfunc chl(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor j, l := range m {\n\t\ttmp := []bool{}\n\t\tfor i, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[j] = tmp\n\t}\n\treturn ret\n}\nfunc helper(ma [][]bool) int {\n\tcount := 0\n\tfor _, l := range ma {\n\t\tfor _, c := range l {\n\t\t\tif c == true {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\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 arrSum(arr []int) int {\n\tsum := 0\n\tfor _, a := range arr {\n\t\tsum += a\n\t}\n\treturn sum\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 : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "sample_input": "1000 15 80\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02570", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3004, "cpu_time_ms": 7, "memory_kb": 1840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s458699624", "group_id": "codeNet:p02570", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, t,s int\n\tfmt.Scan(&d, &t,&s)\n\n\n\tif d > t *s {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n\n", "language": "Go", "metadata": {"date": 1598727708, "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/s458699624.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s458699624", "user_id": "u769765274"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, t,s int\n\tfmt.Scan(&d, &t,&s)\n\n\n\tif d > t *s {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "sample_input": "1000 15 80\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02570", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 9, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s194457233", "group_id": "codeNet:p02573", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc generated_monkukui_swap(a int, b int) (int, int) {\n\treturn b, a\n}\nfunc (u generated_monkukui_UnionFind) Size(x int) int {\n\treturn -u.par[u.Find(x)]\n}\nfunc (u generated_monkukui_UnionFind) Union(x, y int) {\n\txr := u.Find(x)\n\tyr := u.Find(y)\n\tif xr == yr {\n\t\treturn\n\t}\n\tif u.Size(yr) < u.Size(xr) {\n\t\tyr, xr = generated_monkukui_swap(yr, xr)\n\t}\n\tu.par[yr] += u.par[xr]\n\tu.par[xr] = yr\n}\nfunc (u generated_monkukui_UnionFind) Find(x int) int {\n\tif u.par[x] < 0 {\n\t\treturn x\n\t}\n\tu.par[x] = u.Find(u.par[x])\n\treturn u.par[x]\n}\nfunc generated_monkukui_NewUnionFind(N int) *generated_monkukui_UnionFind {\n\tu := new(generated_monkukui_UnionFind)\n\tu.par = make([]int, N)\n\tfor i := range u.par {\n\t\tu.par[i] = -1\n\t}\n\treturn u\n}\n\ntype generated_monkukui_UnionFind struct{ par []int }\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar n, m int\n\tfmt.Fscan(r, &n, &m)\n\tuf := generated_monkukui_NewUnionFind(n)\n\tfor i := 0; i < m; i++ {\n\t\tvar a, b int\n\t\tfmt.Fscan(r, &a, &b)\n\t\ta--\n\t\tb--\n\t\tuf.Union(a, b)\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif ans < uf.Size(i) {\n\t\t\tans = uf.Size(i)\n\t\t}\n\t}\n\tfmt.Fprintln(w, ans)\n}\n", "language": "Go", "metadata": {"date": 1599232552, "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/s194457233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s194457233", "user_id": "u212904724"}, "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 generated_monkukui_swap(a int, b int) (int, int) {\n\treturn b, a\n}\nfunc (u generated_monkukui_UnionFind) Size(x int) int {\n\treturn -u.par[u.Find(x)]\n}\nfunc (u generated_monkukui_UnionFind) Union(x, y int) {\n\txr := u.Find(x)\n\tyr := u.Find(y)\n\tif xr == yr {\n\t\treturn\n\t}\n\tif u.Size(yr) < u.Size(xr) {\n\t\tyr, xr = generated_monkukui_swap(yr, xr)\n\t}\n\tu.par[yr] += u.par[xr]\n\tu.par[xr] = yr\n}\nfunc (u generated_monkukui_UnionFind) Find(x int) int {\n\tif u.par[x] < 0 {\n\t\treturn x\n\t}\n\tu.par[x] = u.Find(u.par[x])\n\treturn u.par[x]\n}\nfunc generated_monkukui_NewUnionFind(N int) *generated_monkukui_UnionFind {\n\tu := new(generated_monkukui_UnionFind)\n\tu.par = make([]int, N)\n\tfor i := range u.par {\n\t\tu.par[i] = -1\n\t}\n\treturn u\n}\n\ntype generated_monkukui_UnionFind struct{ par []int }\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar n, m int\n\tfmt.Fscan(r, &n, &m)\n\tuf := generated_monkukui_NewUnionFind(n)\n\tfor i := 0; i < m; i++ {\n\t\tvar a, b int\n\t\tfmt.Fscan(r, &a, &b)\n\t\ta--\n\t\tb--\n\t\tuf.Union(a, b)\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif ans < uf.Size(i) {\n\t\t\tans = uf.Size(i)\n\t\t}\n\t}\n\tfmt.Fprintln(w, ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "sample_input": "5 3\n1 2\n3 4\n5 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02573", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1207, "cpu_time_ms": 225, "memory_kb": 6320}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s312497918", "group_id": "codeNet:p02573", "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 nextFloat64() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc contain(i int, as []int) bool {\n\tfor _, a := range as {\n\t\tif a == i {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype UnionFind struct {\n\tPar map[int]int\n}\n\nfunc NewUnionFind(n int) *UnionFind {\n\tpar := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tpar[i] = -1\n\t}\n\treturn &UnionFind{\n\t\tPar: par,\n\t}\n}\n\nfunc (u *UnionFind) Root(x int) int {\n\tc := u.Par[x]\n\tif c < 0 {\n\t\treturn x\n\t}\n\tu.Par[x] = u.Root(u.Par[x])\n\treturn u.Par[x]\n}\n\nfunc (u *UnionFind) Unite(x, y int) bool {\n\tx = u.Root(x) //xの根をrx\n\ty = u.Root(y) //yの根をry\n\tif x == y {\n\t\treturn false\n\t} //xとyの根が同じ(=同じ木にある)時はそのまま\n\tif u.Par[x] > u.Par[y] {\n\t\ttmp := x\n\t\tx = y\n\t\ty = tmp\n\t}\n\tu.Par[x] += u.Par[y]\n\tu.Par[y] = x\n\treturn true\n}\n\nfunc (u *UnionFind) Same(x, y int) bool { // 2つのデータx, yが属する木が同じならtrueを返す\n\trx := u.Root(x)\n\try := u.Root(y)\n\treturn rx == ry\n}\n\nfunc (u *UnionFind) Size(x int) int {\n\tn := u.Root(x)\n\treturn -u.Par[n]\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\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(nil, 100000000)\n\n\tn, m := nextInt(), nextInt()\n\n\tuf := NewUnionFind(n)\n\n\tfor i := 0; i < m; i++ {\n\t\tk, v := nextInt()-1, nextInt()-1\n\t\tuf.Unite(k, v)\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tans = max(ans, uf.Size(i))\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598778628, "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/s312497918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s312497918", "user_id": "u998286277"}, "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 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\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc contain(i int, as []int) bool {\n\tfor _, a := range as {\n\t\tif a == i {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype UnionFind struct {\n\tPar map[int]int\n}\n\nfunc NewUnionFind(n int) *UnionFind {\n\tpar := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tpar[i] = -1\n\t}\n\treturn &UnionFind{\n\t\tPar: par,\n\t}\n}\n\nfunc (u *UnionFind) Root(x int) int {\n\tc := u.Par[x]\n\tif c < 0 {\n\t\treturn x\n\t}\n\tu.Par[x] = u.Root(u.Par[x])\n\treturn u.Par[x]\n}\n\nfunc (u *UnionFind) Unite(x, y int) bool {\n\tx = u.Root(x) //xの根をrx\n\ty = u.Root(y) //yの根をry\n\tif x == y {\n\t\treturn false\n\t} //xとyの根が同じ(=同じ木にある)時はそのまま\n\tif u.Par[x] > u.Par[y] {\n\t\ttmp := x\n\t\tx = y\n\t\ty = tmp\n\t}\n\tu.Par[x] += u.Par[y]\n\tu.Par[y] = x\n\treturn true\n}\n\nfunc (u *UnionFind) Same(x, y int) bool { // 2つのデータx, yが属する木が同じならtrueを返す\n\trx := u.Root(x)\n\try := u.Root(y)\n\treturn rx == ry\n}\n\nfunc (u *UnionFind) Size(x int) int {\n\tn := u.Root(x)\n\treturn -u.Par[n]\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\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(nil, 100000000)\n\n\tn, m := nextInt(), nextInt()\n\n\tuf := NewUnionFind(n)\n\n\tfor i := 0; i < m; i++ {\n\t\tk, v := nextInt()-1, nextInt()-1\n\t\tuf.Unite(k, v)\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tans = max(ans, uf.Size(i))\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "sample_input": "5 3\n1 2\n3 4\n5 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02573", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1720, "cpu_time_ms": 177, "memory_kb": 13428}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s655640225", "group_id": "codeNet:p02575", "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\ta, _ := strconv.Atoi(next())\n\treturn a\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\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\th := nextInt()\n\tw := nextInt()\n\ts0 := make(map[int]int)\n\tfor i := 1; i <= w; i++ {\n\t\ts0[i] = 0\n\t}\n\n\tfor k := 1; k <= h; k++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\n\t\ts1 := make(map[int]int)\n\n\t\tfor pos, c := range s0 {\n\t\t\tif pos < a || pos > b {\n\t\t\t\tp, ok := s1[pos]\n\t\t\t\tif ok {\n\t\t\t\t\ts1[pos] = min(p, c)\n\t\t\t\t} else {\n\t\t\t\t\ts1[pos] = c\n\t\t\t\t}\n\t\t\t} else if b < w {\n\t\t\t\tp, ok := s1[b+1]\n\t\t\t\tif ok {\n\t\t\t\t\ts1[b+1] = min(p, c+b+1-pos)\n\t\t\t\t} else {\n\t\t\t\t\ts1[b+1] = c + b + 1 - pos\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif len(s1) == 0 {\n\t\t\tfor j := k; j <= h; j++ {\n\t\t\t\tfmt.Println(-1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tm := math.MaxInt32\n\t\tfor _, x := range s1 {\n\t\t\tm = min(m, x)\n\t\t}\n\n\t\tfmt.Println(m + k)\n\t\ts0 = s1\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598735129, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02575.html", "problem_id": "p02575", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02575/input.txt", "sample_output_relpath": "derived/input_output/data/p02575/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02575/Go/s655640225.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s655640225", "user_id": "u090225501"}, "prompt_components": {"gold_output": "1\n3\n6\n-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\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 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\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\th := nextInt()\n\tw := nextInt()\n\ts0 := make(map[int]int)\n\tfor i := 1; i <= w; i++ {\n\t\ts0[i] = 0\n\t}\n\n\tfor k := 1; k <= h; k++ {\n\t\ta := nextInt()\n\t\tb := nextInt()\n\n\t\ts1 := make(map[int]int)\n\n\t\tfor pos, c := range s0 {\n\t\t\tif pos < a || pos > b {\n\t\t\t\tp, ok := s1[pos]\n\t\t\t\tif ok {\n\t\t\t\t\ts1[pos] = min(p, c)\n\t\t\t\t} else {\n\t\t\t\t\ts1[pos] = c\n\t\t\t\t}\n\t\t\t} else if b < w {\n\t\t\t\tp, ok := s1[b+1]\n\t\t\t\tif ok {\n\t\t\t\t\ts1[b+1] = min(p, c+b+1-pos)\n\t\t\t\t} else {\n\t\t\t\t\ts1[b+1] = c + b + 1 - pos\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif len(s1) == 0 {\n\t\t\tfor j := k; j <= h; j++ {\n\t\t\t\tfmt.Println(-1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tm := math.MaxInt32\n\t\tfor _, x := range s1 {\n\t\t\tm = min(m, x)\n\t\t}\n\n\t\tfmt.Println(m + k)\n\t\ts0 = s1\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a grid of squares with H+1 horizontal rows and W vertical columns.\n\nYou will start at one of the squares in the top row and repeat moving one square right or down. However, for each integer i from 1 through H, you cannot move down from the A_i-th, (A_i + 1)-th, \\ldots, B_i-th squares from the left in the i-th row from the top.\n\nFor each integer k from 1 through H, find the minimum number of moves needed to reach one of the squares in the (k+1)-th row from the top. (The starting square can be chosen individually for each case.) If, starting from any square in the top row, none of the squares in the (k+1)-th row can be reached, print -1 instead.\n\nConstraints\n\n1 \\leq H,W \\leq 2\\times 10^5\n\n1 \\leq A_i \\leq B_i \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_1 B_1\nA_2 B_2\n:\nA_H B_H\n\nOutput\n\nPrint H lines. The i-th line should contain the answer for the case k=i.\n\nSample Input 1\n\n4 4\n2 4\n1 1\n2 3\n2 4\n\nSample Output 1\n\n1\n3\n6\n-1\n\nLet (i,j) denote the square at the i-th row from the top and j-th column from the left.\n\nFor k=1, we need one move such as (1,1) → (2,1).\n\nFor k=2, we need three moves such as (1,1) → (2,1) → (2,2) → (3,2).\n\nFor k=3, we need six moves such as (1,1) → (2,1) → (2,2) → (3,2) → (3,3) → (3,4) → (4,4).\n\nFor k=4, it is impossible to reach any square in the fifth row from the top.", "sample_input": "4 4\n2 4\n1 1\n2 3\n2 4\n"}, "reference_outputs": ["1\n3\n6\n-1\n"], "source_document_id": "p02575", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a grid of squares with H+1 horizontal rows and W vertical columns.\n\nYou will start at one of the squares in the top row and repeat moving one square right or down. However, for each integer i from 1 through H, you cannot move down from the A_i-th, (A_i + 1)-th, \\ldots, B_i-th squares from the left in the i-th row from the top.\n\nFor each integer k from 1 through H, find the minimum number of moves needed to reach one of the squares in the (k+1)-th row from the top. (The starting square can be chosen individually for each case.) If, starting from any square in the top row, none of the squares in the (k+1)-th row can be reached, print -1 instead.\n\nConstraints\n\n1 \\leq H,W \\leq 2\\times 10^5\n\n1 \\leq A_i \\leq B_i \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_1 B_1\nA_2 B_2\n:\nA_H B_H\n\nOutput\n\nPrint H lines. The i-th line should contain the answer for the case k=i.\n\nSample Input 1\n\n4 4\n2 4\n1 1\n2 3\n2 4\n\nSample Output 1\n\n1\n3\n6\n-1\n\nLet (i,j) denote the square at the i-th row from the top and j-th column from the left.\n\nFor k=1, we need one move such as (1,1) → (2,1).\n\nFor k=2, we need three moves such as (1,1) → (2,1) → (2,2) → (3,2).\n\nFor k=3, we need six moves such as (1,1) → (2,1) → (2,2) → (3,2) → (3,3) → (3,4) → (4,4).\n\nFor k=4, it is impossible to reach any square in the fifth row from the top.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1086, "cpu_time_ms": 2207, "memory_kb": 37752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s813747393", "group_id": "codeNet:p02576", "input_text": "package main\n\nimport \"fmt\"\n\nvar N, X, T int\n\nfunc main() {\n fmt.Scanf(\"%d%d%d\", &N, &X, &T)\n if N <= X {\n fmt.Println(T)\n return\n }\n res := 0\n for N > 0 {\n \tN -= X\n res += T\n }\n fmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1598626538, "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/s813747393.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s813747393", "user_id": "u064438560"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar N, X, T int\n\nfunc main() {\n fmt.Scanf(\"%d%d%d\", &N, &X, &T)\n if N <= X {\n fmt.Println(T)\n return\n }\n res := 0\n for N > 0 {\n \tN -= X\n res += T\n }\n fmt.Println(res)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s003002497", "group_id": "codeNet:p02576", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for A - Takoyaki\n\tvar N, X, T int\n\tfmt.Scanf(\"%d %d %d\", &N, &X, &T)\n\n\tvar ans int\n\tif N%X == 0 {\n\t\tans = T * (N / X)\n\t} else {\n\t\tans = T * (N/X + 1)\n\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598122955, "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/s003002497.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003002497", "user_id": "u128015095"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for A - Takoyaki\n\tvar N, X, T int\n\tfmt.Scanf(\"%d %d %d\", &N, &X, &T)\n\n\tvar ans int\n\tif N%X == 0 {\n\t\tans = T * (N / X)\n\t} else {\n\t\tans = T * (N/X + 1)\n\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 225, "cpu_time_ms": 7, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s277827534", "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) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(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 solve(n int) bool {\n\tsum := 0\n\tfor 0 < n {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum%9 == 0\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn := scan.Int()\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": 1599660346, "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/s277827534.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s277827534", "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) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(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 solve(n int) bool {\n\tsum := 0\n\tfor 0 < n {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum%9 == 0\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn := scan.Int()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 2424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s026034322", "group_id": "codeNet:p02577", "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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\n\ttmp, _ := strconv.Atoi(stdin.Text())\n\n\tif tmp%9 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tN := strings.Split(stdin.Text(), \"\")\n\t\tsum := 0\n\t\tfor _, i := range N {\n\t\t\tj, _ := strconv.Atoi(i)\n\t\t\tsum += j\n\t\t}\n\n\t\tif sum%9 == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1598127755, "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/s026034322.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s026034322", "user_id": "u888275483"}, "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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\n\ttmp, _ := strconv.Atoi(stdin.Text())\n\n\tif tmp%9 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tN := strings.Split(stdin.Text(), \"\")\n\t\tsum := 0\n\t\tfor _, i := range N {\n\t\t\tj, _ := strconv.Atoi(i)\n\t\t\tsum += j\n\t\t}\n\n\t\tif sum%9 == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 422, "cpu_time_ms": 8, "memory_kb": 1912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s544450609", "group_id": "codeNet:p02577", "input_text": "package main\n\nimport (\n\t\"bufio\"\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.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\ts := next()\n\tsum := 0\n\tfor i := 0; i < len(s); i++ {\n\t\ta, _ := strconv.Atoi(string(s[i]))\n\t\tsum += a\n\t\tsum %= 9\n\t}\n\tif sum == 0 {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\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 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\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": 1598123685, "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/s544450609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s544450609", "user_id": "u532762536"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\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.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\ts := next()\n\tsum := 0\n\tfor i := 0; i < len(s); i++ {\n\t\ta, _ := strconv.Atoi(string(s[i]))\n\t\tsum += a\n\t\tsum %= 9\n\t}\n\tif sum == 0 {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\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 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\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 : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "sample_input": "123456789\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02577", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2252, "cpu_time_ms": 18, "memory_kb": 2120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s115476442", "group_id": "codeNet:p02577", "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 := nextStr()\n\tsum := 0\n\tfor i := 0; i < len(n); i++ {\n\t\tsum += int(n[i] - '0')\n\t}\n\n\tif sum%9 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n}\n\n// 各桁の和\nfunc sumKeta(n int) int {\n\tketa := 0\n\tfor n > 0 {\n\t\tketa += n % 10\n\t\tn /= 10\n\t}\n\treturn keta\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": 1598123355, "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/s115476442.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s115476442", "user_id": "u756000295"}, "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\tscanInit()\n\n\tn := nextStr()\n\tsum := 0\n\tfor i := 0; i < len(n); i++ {\n\t\tsum += int(n[i] - '0')\n\t}\n\n\tif sum%9 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n}\n\n// 各桁の和\nfunc sumKeta(n int) int {\n\tketa := 0\n\tfor n > 0 {\n\t\tketa += n % 10\n\t\tn /= 10\n\t}\n\treturn keta\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\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "sample_input": "123456789\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02577", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 710, "cpu_time_ms": 8, "memory_kb": 2180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s470711226", "group_id": "codeNet:p02578", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\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 main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n\n ans := 0\n for i := 1; i < n; i++ {\n if a[i-1] > a[i] {\n ans += a[i-1] - a[i]\n a[i] = a[i-1]\n }\n }\n\n fmt.Printf(\"%d\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1598474105, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02578.html", "problem_id": "p02578", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02578/input.txt", "sample_output_relpath": "derived/input_output/data/p02578/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02578/Go/s470711226.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s470711226", "user_id": "u552686582"}, "prompt_components": {"gold_output": "4\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\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 main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n\n ans := 0\n for i := 1; i < n; i++ {\n if a[i-1] > a[i] {\n ans += a[i-1] - a[i]\n a[i] = a[i-1]\n }\n }\n\n fmt.Printf(\"%d\\n\", ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN persons are standing in a row. The height of the i-th person from the front is A_i.\n\nWe want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:\n\nCondition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.\n\nFind the minimum total height of the stools needed to meet this goal.\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 \\ldots A_N\n\nOutput\n\nPrint the minimum total height of the stools needed to meet the goal.\n\nSample Input 1\n\n5\n2 1 5 4 3\n\nSample Output 1\n\n4\n\nIf the persons stand on stools of heights 0, 1, 0, 1, and 2, respectively, their heights will be 2, 2, 5, 5, and 5, satisfying the condition.\n\nWe cannot meet the goal with a smaller total height of the stools.\n\nSample Input 2\n\n5\n3 3 3 3 3\n\nSample Output 2\n\n0\n\nGiving a stool of height 0 to everyone will work.", "sample_input": "5\n2 1 5 4 3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02578", "source_text": "Score : 300 points\n\nProblem Statement\n\nN persons are standing in a row. The height of the i-th person from the front is A_i.\n\nWe want to have each person stand on a stool of some heights - at least zero - so that the following condition is satisfied for every person:\n\nCondition: Nobody in front of the person is taller than the person. Here, the height of a person includes the stool.\n\nFind the minimum total height of the stools needed to meet this goal.\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 \\ldots A_N\n\nOutput\n\nPrint the minimum total height of the stools needed to meet the goal.\n\nSample Input 1\n\n5\n2 1 5 4 3\n\nSample Output 1\n\n4\n\nIf the persons stand on stools of heights 0, 1, 0, 1, and 2, respectively, their heights will be 2, 2, 5, 5, and 5, satisfying the condition.\n\nWe cannot meet the goal with a smaller total height of the stools.\n\nSample Input 2\n\n5\n3 3 3 3 3\n\nSample Output 2\n\n0\n\nGiving a stool of height 0 to everyone will work.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 686, "cpu_time_ms": 47, "memory_kb": 9448}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s906206632", "group_id": "codeNet:p02579", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\n\tvar ch, cw int\n\tfmt.Scan(&ch, &cw)\n\tch--\n\tcw--\n\n\tvar dh, dw int\n\tfmt.Scan(&dh, &dw)\n\tdh--\n\tdw--\n\n\tfield := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tfield[i] = make([]int, w)\n\t\tvar line string\n\t\tfmt.Scan(&line)\n\t\tfor j, s := range strings.Split(line, \"\") {\n\t\t\tif s == \".\" {\n\t\t\t\tfield[i][j] = -1\n\t\t\t} else {\n\t\t\t\tfield[i][j] = -2\n\t\t\t}\n\t\t}\n\t}\n\n\tvec := [][]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\tque := [][]int{{ch, cw}}\n\tcur := 0\n\tfor len(que) > 0 {\n\t\tboarders := make([][]int, 0)\n\t\tfor len(que) > 0 {\n\t\t\tp := que[0]\n\t\t\tboarders = append(boarders, p)\n\t\t\tque = que[1:]\n\t\t\tfield[p[0]][p[1]] = cur\n\t\t\tfor _, v := range vec {\n\t\t\t\tnph := v[0] + p[0]\n\t\t\t\tnpw := v[1] + p[1]\n\t\t\t\tif nph >= h || nph < 0 || npw >= w || npw < 0 || field[nph][npw] != -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tque = append(que, []int{nph, npw})\n\t\t\t}\n\t\t}\n\t\tcur++\n\t\tfor _, b := range boarders {\n\t\t\tfor i := -2; i <= 2; i++ {\n\t\t\t\tfor j := -2; j <= 2; j++ {\n\t\t\t\t\tnph := b[0] + i\n\t\t\t\t\tnpw := b[1] + j\n\t\t\t\t\tif (i == 0 && j == 0) || nph >= h || nph < 0 || npw >= w || npw < 0 || field[nph][npw] != -1 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfield[nph][npw] = cur\n\t\t\t\t\tque = append(que, []int{nph, npw})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif field[dh][dw] < 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(field[dh][dw])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598310707, "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/s906206632.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s906206632", "user_id": "u857510905"}, "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 h, w int\n\tfmt.Scan(&h, &w)\n\n\tvar ch, cw int\n\tfmt.Scan(&ch, &cw)\n\tch--\n\tcw--\n\n\tvar dh, dw int\n\tfmt.Scan(&dh, &dw)\n\tdh--\n\tdw--\n\n\tfield := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tfield[i] = make([]int, w)\n\t\tvar line string\n\t\tfmt.Scan(&line)\n\t\tfor j, s := range strings.Split(line, \"\") {\n\t\t\tif s == \".\" {\n\t\t\t\tfield[i][j] = -1\n\t\t\t} else {\n\t\t\t\tfield[i][j] = -2\n\t\t\t}\n\t\t}\n\t}\n\n\tvec := [][]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\tque := [][]int{{ch, cw}}\n\tcur := 0\n\tfor len(que) > 0 {\n\t\tboarders := make([][]int, 0)\n\t\tfor len(que) > 0 {\n\t\t\tp := que[0]\n\t\t\tboarders = append(boarders, p)\n\t\t\tque = que[1:]\n\t\t\tfield[p[0]][p[1]] = cur\n\t\t\tfor _, v := range vec {\n\t\t\t\tnph := v[0] + p[0]\n\t\t\t\tnpw := v[1] + p[1]\n\t\t\t\tif nph >= h || nph < 0 || npw >= w || npw < 0 || field[nph][npw] != -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tque = append(que, []int{nph, npw})\n\t\t\t}\n\t\t}\n\t\tcur++\n\t\tfor _, b := range boarders {\n\t\t\tfor i := -2; i <= 2; i++ {\n\t\t\t\tfor j := -2; j <= 2; j++ {\n\t\t\t\t\tnph := b[0] + i\n\t\t\t\t\tnpw := b[1] + j\n\t\t\t\t\tif (i == 0 && j == 0) || nph >= h || nph < 0 || npw >= w || npw < 0 || field[nph][npw] != -1 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfield[nph][npw] = cur\n\t\t\t\t\tque = append(que, []int{nph, npw})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif field[dh][dw] < 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(field[dh][dw])\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1340, "cpu_time_ms": 2215, "memory_kb": 330248}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s303009372", "group_id": "codeNet:p02579", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar H int\nvar W int\nvar Ch int\nvar Cw int\nvar Dh int\nvar Dw int\nvar S [][]byte\nvar m [][]int\n\nfunc main() {\n\tH = nextInt()\n\tW = nextInt()\n\tCh = nextInt() - 1\n\tCw = nextInt() - 1\n\tDh = nextInt() - 1\n\tDw = nextInt() - 1\n\n\tS = make([][]byte, H)\n\tm = make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = nextBytes()\n\t\tm[i] = make([]int, W)\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tm[i][j] = H * W\n\t\t}\n\t}\n\tm[Ch][Cw] = 0\n\n\tqueue := pqNew()\n\tqueue.Push(P{Ch, Cw, 0})\n\n\tdir := []P{\n\t\tP{-1, -1, 0},\n\t\tP{-1, +1, 0},\n\t\tP{+1, +1, 0},\n\t\tP{+1, -1, 0},\n\t}\n\n\tfor !queue.Empty() {\n\t\tp := queue.Pop()\n\t\tif p.h == Dh && p.w == Dw {\n\t\t\tfmt.Println(p.c)\n\t\t\treturn\n\t\t}\n\t\tnexts := make([]P, 0)\n\t\t// A type\n\t\tfor i := 0; i < len(dir); i++ {\n\t\t\td := dir[i]\n\t\t\tnexts = append(nexts, P{p.h + d.h, p.w + d.w, p.c})\n\t\t}\n\n\t\t// B type\n\t\tfor h := -2; h <= +2; h++ {\n\t\t\tfor w := -2; w <= +2; w++ {\n\t\t\t\tnexts = append(nexts, P{p.h + h, p.w + w, p.c + 1})\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(nexts); i++ {\n\t\t\tn := nexts[i]\n\t\t\tif out(n.h, n.w) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif m[n.h][n.w] <= n.c {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tm[n.h][n.w] = n.c\n\t\t\tqueue.Push(n)\n\t\t}\n\t}\n\n\tfmt.Println(-1)\n}\n\nfunc out(h, w int) bool {\n\treturn h < 0 || w < 0 || h >= H || w >= W || S[h][w] == '#'\n}\n\n// PriorityQueue は優先度付きキューを表す\ntype PriorityQueue struct {\n\tqueue []P\n\tsize int\n}\n\nfunc pqNew() *PriorityQueue {\n\tpq := &PriorityQueue{queue: make([]P, 0), size: 0}\n\n\treturn pq\n}\nfunc (pq *PriorityQueue) less(i, j int) bool {\n\tpi := pq.queue[i]\n\tpj := pq.queue[j]\n\n\tif pi.c != pj.c {\n\t\treturn pi.c < pj.c\n\t}\n\tif pi.h != pj.h {\n\t\treturn pi.h < pj.h\n\t}\n\treturn pi.w < pj.w\n}\n\n// Push は優先度付きキューに要素を一つ追加します。\nfunc (pq *PriorityQueue) Push(value P) {\n\tif len(pq.queue) == 0 || len(pq.queue)-1 == pq.size {\n\t\tpq.queue = append(pq.queue, value)\n\t} else {\n\t\tpq.queue[pq.size] = value\n\t}\n\n\ti := pq.size\n\tparent := pq.parent(i)\n\n\tfor i > 0 && pq.less(parent, i) {\n\t\tpq.swap(parent, i)\n\t\ti := parent\n\t\tparent = pq.parent(i)\n\t}\n\n\tpq.size++\n}\n\n// Pop は優先度付きキューから要素を一つ取り出します。\nfunc (pq *PriorityQueue) Pop() P {\n\tif pq.size == 0 {\n\t\tpanic(\"Priority Queue is Empty\")\n\t}\n\tret := pq.queue[0]\n\tpq.size--\n\tpq.queue[0] = pq.queue[pq.size]\n\n\ti := 0\n\tleft := pq.left(i)\n\tright := pq.right(i)\n\n\tfor right <= pq.size {\n\t\tl := pq.less(i, left)\n\t\tr := pq.less(i, right)\n\t\tif l && (!r || pq.less(right, left)) {\n\t\t\tpq.swap(i, left)\n\t\t\ti = left\n\t\t} else if r {\n\t\t\tpq.swap(i, right)\n\t\t\ti = right\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tleft = pq.left(i)\n\t\tright = pq.right(i)\n\t}\n\n\treturn ret\n}\n\n// Empty は優先度付きキューが空かどうかを判断します。\nfunc (pq *PriorityQueue) Empty() bool {\n\treturn pq.size == 0\n}\n\nfunc (pq *PriorityQueue) swap(i, j int) {\n\tpq.queue[i], pq.queue[j] = pq.queue[j], pq.queue[i]\n}\nfunc (pq *PriorityQueue) parent(i int) int {\n\treturn (i - 1) / 2\n}\nfunc (pq *PriorityQueue) left(i int) int {\n\treturn i*2 + 1\n}\nfunc (pq *PriorityQueue) right(i int) int {\n\treturn i*2 + 2\n}\n\ntype P struct {\n\th int\n\tw int\n\tc int\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": 1598125479, "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/s303009372.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s303009372", "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\nvar H int\nvar W int\nvar Ch int\nvar Cw int\nvar Dh int\nvar Dw int\nvar S [][]byte\nvar m [][]int\n\nfunc main() {\n\tH = nextInt()\n\tW = nextInt()\n\tCh = nextInt() - 1\n\tCw = nextInt() - 1\n\tDh = nextInt() - 1\n\tDw = nextInt() - 1\n\n\tS = make([][]byte, H)\n\tm = make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = nextBytes()\n\t\tm[i] = make([]int, W)\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tm[i][j] = H * W\n\t\t}\n\t}\n\tm[Ch][Cw] = 0\n\n\tqueue := pqNew()\n\tqueue.Push(P{Ch, Cw, 0})\n\n\tdir := []P{\n\t\tP{-1, -1, 0},\n\t\tP{-1, +1, 0},\n\t\tP{+1, +1, 0},\n\t\tP{+1, -1, 0},\n\t}\n\n\tfor !queue.Empty() {\n\t\tp := queue.Pop()\n\t\tif p.h == Dh && p.w == Dw {\n\t\t\tfmt.Println(p.c)\n\t\t\treturn\n\t\t}\n\t\tnexts := make([]P, 0)\n\t\t// A type\n\t\tfor i := 0; i < len(dir); i++ {\n\t\t\td := dir[i]\n\t\t\tnexts = append(nexts, P{p.h + d.h, p.w + d.w, p.c})\n\t\t}\n\n\t\t// B type\n\t\tfor h := -2; h <= +2; h++ {\n\t\t\tfor w := -2; w <= +2; w++ {\n\t\t\t\tnexts = append(nexts, P{p.h + h, p.w + w, p.c + 1})\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < len(nexts); i++ {\n\t\t\tn := nexts[i]\n\t\t\tif out(n.h, n.w) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif m[n.h][n.w] <= n.c {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tm[n.h][n.w] = n.c\n\t\t\tqueue.Push(n)\n\t\t}\n\t}\n\n\tfmt.Println(-1)\n}\n\nfunc out(h, w int) bool {\n\treturn h < 0 || w < 0 || h >= H || w >= W || S[h][w] == '#'\n}\n\n// PriorityQueue は優先度付きキューを表す\ntype PriorityQueue struct {\n\tqueue []P\n\tsize int\n}\n\nfunc pqNew() *PriorityQueue {\n\tpq := &PriorityQueue{queue: make([]P, 0), size: 0}\n\n\treturn pq\n}\nfunc (pq *PriorityQueue) less(i, j int) bool {\n\tpi := pq.queue[i]\n\tpj := pq.queue[j]\n\n\tif pi.c != pj.c {\n\t\treturn pi.c < pj.c\n\t}\n\tif pi.h != pj.h {\n\t\treturn pi.h < pj.h\n\t}\n\treturn pi.w < pj.w\n}\n\n// Push は優先度付きキューに要素を一つ追加します。\nfunc (pq *PriorityQueue) Push(value P) {\n\tif len(pq.queue) == 0 || len(pq.queue)-1 == pq.size {\n\t\tpq.queue = append(pq.queue, value)\n\t} else {\n\t\tpq.queue[pq.size] = value\n\t}\n\n\ti := pq.size\n\tparent := pq.parent(i)\n\n\tfor i > 0 && pq.less(parent, i) {\n\t\tpq.swap(parent, i)\n\t\ti := parent\n\t\tparent = pq.parent(i)\n\t}\n\n\tpq.size++\n}\n\n// Pop は優先度付きキューから要素を一つ取り出します。\nfunc (pq *PriorityQueue) Pop() P {\n\tif pq.size == 0 {\n\t\tpanic(\"Priority Queue is Empty\")\n\t}\n\tret := pq.queue[0]\n\tpq.size--\n\tpq.queue[0] = pq.queue[pq.size]\n\n\ti := 0\n\tleft := pq.left(i)\n\tright := pq.right(i)\n\n\tfor right <= pq.size {\n\t\tl := pq.less(i, left)\n\t\tr := pq.less(i, right)\n\t\tif l && (!r || pq.less(right, left)) {\n\t\t\tpq.swap(i, left)\n\t\t\ti = left\n\t\t} else if r {\n\t\t\tpq.swap(i, right)\n\t\t\ti = right\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tleft = pq.left(i)\n\t\tright = pq.right(i)\n\t}\n\n\treturn ret\n}\n\n// Empty は優先度付きキューが空かどうかを判断します。\nfunc (pq *PriorityQueue) Empty() bool {\n\treturn pq.size == 0\n}\n\nfunc (pq *PriorityQueue) swap(i, j int) {\n\tpq.queue[i], pq.queue[j] = pq.queue[j], pq.queue[i]\n}\nfunc (pq *PriorityQueue) parent(i int) int {\n\treturn (i - 1) / 2\n}\nfunc (pq *PriorityQueue) left(i int) int {\n\treturn i*2 + 1\n}\nfunc (pq *PriorityQueue) right(i int) int {\n\treturn i*2 + 2\n}\n\ntype P struct {\n\th int\n\tw int\n\tc int\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 : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02579", "source_text": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3684, "cpu_time_ms": 1721, "memory_kb": 95036}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s277119323", "group_id": "codeNet:p02582", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar s string\n\tfmt.Scan(&s)\n\n\tcount:=0\n\tfor index,v := range(s){\n\t\tif string(v) ==\"R\"{\n\t\t\tcount ++\n\t\t}else if index!=0&&string(v)==\"S\"{\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1597520629, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02582/input.txt", "sample_output_relpath": "derived/input_output/data/p02582/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02582/Go/s277119323.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s277119323", "user_id": "u820637188"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar s string\n\tfmt.Scan(&s)\n\n\tcount:=0\n\tfor index,v := range(s){\n\t\tif string(v) ==\"R\"{\n\t\t\tcount ++\n\t\t}else if index!=0&&string(v)==\"S\"{\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "sample_input": "RRS\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02582", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 220, "cpu_time_ms": 9, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s161976796", "group_id": "codeNet:p02583", "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 scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := scanInt()\n\tls := scanInts(n)\n\tsort.Ints(ls)\n\tvar cnt 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 ls[j]-ls[i] < ls[k] && ls[k] < ls[i]+ls[j] &&\n\t\t\t\t\tls[i] != ls[j] && ls[j] != ls[k] && ls[k] != ls[i] {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1597518801, "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/s161976796.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s161976796", "user_id": "u367908963"}, "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 scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := scanInt()\n\tls := scanInts(n)\n\tsort.Ints(ls)\n\tvar cnt 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 ls[j]-ls[i] < ls[k] && ls[k] < ls[i]+ls[j] &&\n\t\t\t\t\tls[i] != ls[j] && ls[j] != ls[k] && ls[k] != ls[i] {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 716, "cpu_time_ms": 9, "memory_kb": 1780}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s573310573", "group_id": "codeNet:p02584", "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)\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()\n\n\tx, k, d := nextInt(), nextInt(), nextInt()\n\tvar checker float64 = float64(x)\n\n\tcheckK := x / d\n\tif checkK > k {\n\t\tchecker = math.Abs(float64(x) - float64(k)*float64(d))\n\t} else {\n\t\tfirst := math.Abs(float64(x) - float64(checkK)*float64(d))\n\t\tsecond := math.Abs(float64(x) - float64(checkK+1)*float64(d))\n\t\tif first == 0 {\n\t\t\tchecker = second\n\t\t} else if second == 0 {\n\t\t\tchecker = first\n\t\t} else if (k-checkK)%2 == 0 {\n\t\t\tchecker = first\n\t\t} else {\n\t\t\tchecker = second\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", int(checker))\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 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 quickSort(val []int) []int {\n\tif len(val) < 2 {\n\t\treturn val\n\t}\n\n\tpivot := val[0]\n\n\tleft := []int{}\n\tright := []int{}\n\n\tfor _, v := range val[1:] {\n\t\tif pivot > v {\n\t\t\tleft = append(left, v)\n\t\t} else {\n\t\t\tright = append(right, v)\n\t\t}\n\t}\n\n\tleft = quickSort(left)\n\tright = quickSort(right)\n\n\tret := append(left, pivot)\n\tret = append(ret, right...)\n\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1597523149, "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/s573310573.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s573310573", "user_id": "u518086606"}, "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\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()\n\n\tx, k, d := nextInt(), nextInt(), nextInt()\n\tvar checker float64 = float64(x)\n\n\tcheckK := x / d\n\tif checkK > k {\n\t\tchecker = math.Abs(float64(x) - float64(k)*float64(d))\n\t} else {\n\t\tfirst := math.Abs(float64(x) - float64(checkK)*float64(d))\n\t\tsecond := math.Abs(float64(x) - float64(checkK+1)*float64(d))\n\t\tif first == 0 {\n\t\t\tchecker = second\n\t\t} else if second == 0 {\n\t\t\tchecker = first\n\t\t} else if (k-checkK)%2 == 0 {\n\t\t\tchecker = first\n\t\t} else {\n\t\t\tchecker = second\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", int(checker))\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 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 quickSort(val []int) []int {\n\tif len(val) < 2 {\n\t\treturn val\n\t}\n\n\tpivot := val[0]\n\n\tleft := []int{}\n\tright := []int{}\n\n\tfor _, v := range val[1:] {\n\t\tif pivot > v {\n\t\t\tleft = append(left, v)\n\t\t} else {\n\t\t\tright = append(right, v)\n\t\t}\n\t}\n\n\tleft = quickSort(left)\n\tright = quickSort(right)\n\n\tret := append(left, pivot)\n\tret = append(ret, right...)\n\n\treturn ret\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1536, "cpu_time_ms": 6, "memory_kb": 1808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s857176765", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x, k, d int\n var ans int\n fmt.Scanf(\"%d %d %d\", &x, &k, &d)\n\n sign := 1\n if x < 0 {\n sign = -1\n x *= sign\n }\n \n if k * d <= x {\n ans = x - (k * d)\n }else{\n n := x / d\n even := x % d\n odd := d - even\n \n if (k - n) % 2 != 0{\n ans = odd\n }else{\n ans = even\n }\n }\n \n fmt.Printf(\"%d\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1597522037, "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/s857176765.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s857176765", "user_id": "u903153704"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x, k, d int\n var ans int\n fmt.Scanf(\"%d %d %d\", &x, &k, &d)\n\n sign := 1\n if x < 0 {\n sign = -1\n x *= sign\n }\n \n if k * d <= x {\n ans = x - (k * d)\n }else{\n n := x / d\n even := x % d\n odd := d - even\n \n if (k - n) % 2 != 0{\n ans = odd\n }else{\n ans = even\n }\n }\n \n fmt.Printf(\"%d\\n\", ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188006246", "group_id": "codeNet:p02584", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x, k, d int\n fmt.Scanf(\"%d %d %d\", &x, &k, &d)\n\n sign := 1\n if x < 0 {\n sign = -1\n x *= sign\n }\n \n ans := 0\n if k * d <= x {\n ans = x - (k * d)\n }else{\n n := x / d\n even := x % d\n odd := d - even\n \n if (k - n) % 2 == 0{\n ans = even\n }else{\n ans = odd\n }\n }\n fmt.Printf(\"%d\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1597521643, "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/s188006246.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s188006246", "user_id": "u903153704"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x, k, d int\n fmt.Scanf(\"%d %d %d\", &x, &k, &d)\n\n sign := 1\n if x < 0 {\n sign = -1\n x *= sign\n }\n \n ans := 0\n if k * d <= x {\n ans = x - (k * d)\n }else{\n n := x / d\n even := x % d\n odd := d - even\n \n if (k - n) % 2 == 0{\n ans = even\n }else{\n ans = odd\n }\n }\n fmt.Printf(\"%d\\n\", ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078572582", "group_id": "codeNet:p02584", "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\ntype st struct {\n\tind int\n\tmin int64\n}\n\nfunc main() {\n\tvar X int64\n\tvar K int64\n\tvar D int64\n\tfmt.Scan(&X)\n\tfmt.Scan(&K)\n\tfmt.Scan(&D)\n\tmax := X + K*D\n\tmin := X - K*D\n\tif X/D < -K {\n\t\tfmt.Println(-max)\n\t\treturn\n\t}\n\tif X/D > K {\n\t\tfmt.Println(min)\n\t\treturn\n\t}\n\tif X > 0 {\n\t\ty := X % (2 * D)\n\t\tif y >= D {\n\t\t\tfmt.Println(2*D - y)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(y)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\ty := -X % (2 * D)\n\t\tif y >= D {\n\t\t\tfmt.Println(2*D - y)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(y)\n\t\t\treturn\n\t\t}\n\t}\n\t// sc.Split(bufio.ScanWords)\n\n}\nfunc bc(s string, pos int) string {\n\tch := \"1\"\n\tif string(s[pos]) == \"1\" {\n\t\tch = \"0\"\n\t}\n\tpre := string(s[:pos])\n\tpost := \"\"\n\tif pos != len(s)-1 {\n\t\tpost = string(s[pos+1:])\n\t}\n\ttmp := pre + ch + post\n\treturn tmp\n}\nfunc popCount(n string) int {\n\tcount := 0\n\tfor _, s := range n {\n\t\tif string(s) == \"1\" {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\nfunc chc(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor i, l := range m {\n\t\ttmp := []bool{}\n\t\tfor _, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[i] = tmp\n\t}\n\treturn ret\n}\nfunc chl(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor j, l := range m {\n\t\ttmp := []bool{}\n\t\tfor i, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[j] = tmp\n\t}\n\treturn ret\n}\nfunc helper(ma [][]bool) int {\n\tcount := 0\n\tfor _, l := range ma {\n\t\tfor _, c := range l {\n\t\t\tif c == true {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\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 arrSum(arr []int) int {\n\tsum := 0\n\tfor _, a := range arr {\n\t\tsum += a\n\t}\n\treturn sum\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\n", "language": "Go", "metadata": {"date": 1597520999, "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/s078572582.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s078572582", "user_id": "u757474247"}, "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\ntype st struct {\n\tind int\n\tmin int64\n}\n\nfunc main() {\n\tvar X int64\n\tvar K int64\n\tvar D int64\n\tfmt.Scan(&X)\n\tfmt.Scan(&K)\n\tfmt.Scan(&D)\n\tmax := X + K*D\n\tmin := X - K*D\n\tif X/D < -K {\n\t\tfmt.Println(-max)\n\t\treturn\n\t}\n\tif X/D > K {\n\t\tfmt.Println(min)\n\t\treturn\n\t}\n\tif X > 0 {\n\t\ty := X % (2 * D)\n\t\tif y >= D {\n\t\t\tfmt.Println(2*D - y)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(y)\n\t\t\treturn\n\t\t}\n\t} else {\n\t\ty := -X % (2 * D)\n\t\tif y >= D {\n\t\t\tfmt.Println(2*D - y)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(y)\n\t\t\treturn\n\t\t}\n\t}\n\t// sc.Split(bufio.ScanWords)\n\n}\nfunc bc(s string, pos int) string {\n\tch := \"1\"\n\tif string(s[pos]) == \"1\" {\n\t\tch = \"0\"\n\t}\n\tpre := string(s[:pos])\n\tpost := \"\"\n\tif pos != len(s)-1 {\n\t\tpost = string(s[pos+1:])\n\t}\n\ttmp := pre + ch + post\n\treturn tmp\n}\nfunc popCount(n string) int {\n\tcount := 0\n\tfor _, s := range n {\n\t\tif string(s) == \"1\" {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\nfunc chc(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor i, l := range m {\n\t\ttmp := []bool{}\n\t\tfor _, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[i] = tmp\n\t}\n\treturn ret\n}\nfunc chl(m [][]bool, p int) [][]bool {\n\tret := make([][]bool, len(m))\n\tfor j, l := range m {\n\t\ttmp := []bool{}\n\t\tfor i, c := range l {\n\t\t\tif i == p {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t} else if c == true {\n\t\t\t\ttmp = append(tmp, true)\n\t\t\t} else {\n\t\t\t\ttmp = append(tmp, false)\n\t\t\t}\n\t\t}\n\t\tret[j] = tmp\n\t}\n\treturn ret\n}\nfunc helper(ma [][]bool) int {\n\tcount := 0\n\tfor _, l := range ma {\n\t\tfor _, c := range l {\n\t\t\tif c == true {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\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 arrSum(arr []int) int {\n\tsum := 0\n\tfor _, a := range arr {\n\t\tsum += a\n\t}\n\treturn sum\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3316, "cpu_time_ms": 8, "memory_kb": 1840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841900883", "group_id": "codeNet:p02590", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tconst P = 200003\n\tn := readI()\n\ta := readIs(n)\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif a[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tans += a[i] * a[j] % P\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-2.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "language": "Go", "metadata": {"date": 1597024624, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02590.html", "problem_id": "p02590", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02590/input.txt", "sample_output_relpath": "derived/input_output/data/p02590/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02590/Go/s841900883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s841900883", "user_id": "u533258444"}, "prompt_components": {"gold_output": "474287\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tconst P = 200003\n\tn := readI()\n\ta := readIs(n)\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif a[j] == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tans += a[i] * a[j] % P\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-2.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nLet’s take a prime P = 200\\,003.\nYou are given N integers A_1, A_2, \\ldots, A_N.\nFind the sum of ((A_i \\cdot A_j) \\bmod P) over all N \\cdot (N-1) / 2 unordered pairs of elements (i < j).\n\nPlease note that the sum isn't computed modulo P.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 \\leq A_i < P = 200\\,003\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 one integer — the sum over ((A_i \\cdot A_j) \\bmod P).\n\nSample Input 1\n\n4\n2019 0 2020 200002\n\nSample Output 1\n\n474287\n\nThe non-zero products are:\n\n2019 \\cdot 2020 \\bmod P = 78320\n\n2019 \\cdot 200002 \\bmod P = 197984\n\n2020 \\cdot 200002 \\bmod P = 197983\n\nSo the answer is 0 + 78320 + 197984 + 0 + 0 + 197983 = 474287.\n\nSample Input 2\n\n5\n1 1 2 2 100000\n\nSample Output 2\n\n600013", "sample_input": "4\n2019 0 2020 200002\n"}, "reference_outputs": ["474287\n"], "source_document_id": "p02590", "source_text": "Score : 800 points\n\nProblem Statement\n\nLet’s take a prime P = 200\\,003.\nYou are given N integers A_1, A_2, \\ldots, A_N.\nFind the sum of ((A_i \\cdot A_j) \\bmod P) over all N \\cdot (N-1) / 2 unordered pairs of elements (i < j).\n\nPlease note that the sum isn't computed modulo P.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 \\leq A_i < P = 200\\,003\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 one integer — the sum over ((A_i \\cdot A_j) \\bmod P).\n\nSample Input 1\n\n4\n2019 0 2020 200002\n\nSample Output 1\n\n474287\n\nThe non-zero products are:\n\n2019 \\cdot 2020 \\bmod P = 78320\n\n2019 \\cdot 200002 \\bmod P = 197984\n\n2020 \\cdot 200002 \\bmod P = 197983\n\nSo the answer is 0 + 78320 + 197984 + 0 + 0 + 197983 = 474287.\n\nSample Input 2\n\n5\n1 1 2 2 100000\n\nSample Output 2\n\n600013", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1930, "cpu_time_ms": 2205, "memory_kb": 5340}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s075011599", "group_id": "codeNet:p02590", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,d int\n\n\tP:=200003\n\n\tfmt.Scanf(\"%d\", &n)\n\tslice := make([]int,n,n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &d)\n\t\tslice[i] = d\n\t}\n\ttotal:=0\n\ttmp:=0\n\tfor i:=0;i= point{\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\n}\n\nfunc abs(n int) int {\n\ty := n >> 63\n\treturn (n ^ y) - y\n}\n", "language": "Go", "metadata": {"date": 1596420944, "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/s478157981.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s478157981", "user_id": "u769765274"}, "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)\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\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\td := float64(nextInt())\n\n\tcnt := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tvar x, y int\n\t\tfmt.Scan(&x, &y)\n\t\tpoint := math.Sqrt(float64(x * x + y *y))\n\t\tif d >= point{\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n\n}\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2110, "memory_kb": 6420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s214528944", "group_id": "codeNet:p02595", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar memo map[int]float64\n\nfunc init() {\n\tmemo = make(map[int]float64)\n}\n\nfunc distance(x, y int) float64 {\n\tif v := memo[x+y]; v > 0 {\n\t\treturn v\n\t}\n\tn := math.Sqrt(float64(x*x + y*y))\n\tmemo[x+y] = n\n\treturn n\n}\n\nfunc solve(xySlice [][]int, d int) int {\n\tanswer := 0\n\t\n\tfor _, xy := range xySlice {\n\t\tn := distance(xy[0], xy[1])\n\t\tif n <= float64(d) {\n\t\t\tanswer++\n\t\t}\n\t}\n\n\treturn answer\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 main() {\n\tnums := scanNums(2)\n\tn := nums[0]\n\td := nums[1]\n\t\n\txySlice := make([][]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnums := scanNums(2)\n\t\txySlice = append(xySlice, nums)\n\t}\n\n\tresult := solve(xySlice, d)\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1596418031, "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/s214528944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s214528944", "user_id": "u111833322"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar memo map[int]float64\n\nfunc init() {\n\tmemo = make(map[int]float64)\n}\n\nfunc distance(x, y int) float64 {\n\tif v := memo[x+y]; v > 0 {\n\t\treturn v\n\t}\n\tn := math.Sqrt(float64(x*x + y*y))\n\tmemo[x+y] = n\n\treturn n\n}\n\nfunc solve(xySlice [][]int, d int) int {\n\tanswer := 0\n\t\n\tfor _, xy := range xySlice {\n\t\tn := distance(xy[0], xy[1])\n\t\tif n <= float64(d) {\n\t\t\tanswer++\n\t\t}\n\t}\n\n\treturn answer\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 main() {\n\tnums := scanNums(2)\n\tn := nums[0]\n\td := nums[1]\n\t\n\txySlice := make([][]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnums := scanNums(2)\n\t\txySlice = append(xySlice, nums)\n\t}\n\n\tresult := solve(xySlice, d)\n\tfmt.Println(result)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2198, "memory_kb": 26980}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s092918022", "group_id": "codeNet:p02596", "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)\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 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 ANS int64\nfunc main() {\n\tN := int64(nextInt())\n\tN = int64Lcm(N, int64(7))\n\tfor i := int64(7); i < int64(7777777777777777777); i = i * 10 + 7 {\n\t\tif i % N == 0 {\n\t\t\tfmt.Println(getDight(i))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\nfunc getDight(a int64) int64{\n d := int64(0)\n div := int64(10)\n for a != int64(0) {\n\t a = a / div\n\t d++\n }\n return d\n}\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\ta, b = b, a\n\t}\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 return a * b / gcd(a, b);\n}\nfunc int64Lcm(a, b int64) int64 {\n return a * b / int64Gcd(a, b);\n}\n\nfunc int64Gcd(a, b int64) int64 {\n\tif b > a {\n\t\ta, b = b, a\n\t}\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 PrimeFactors(n int) (pfs []int) {\n // Get the number of 2s that divide n\n for n%2 == 0 {\n pfs = append(pfs, 2)\n n = n / 2\n }\n // n must be odd at this point. so we can skip one element\n // (note i = i + 2)\n for i := 3; i*i <= n; i = i + 2 {\n // while i divides n, append i and divide n\n for n%i == 0 {\n pfs = append(pfs, i)\n n = n / i\n }\n }\n // This condition is to handle the case when n is a prime number\n // greater than 2\n if n > 2 {\n pfs = append(pfs, n)\n }\n return\n}\n", "language": "Go", "metadata": {"date": 1596420859, "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/s092918022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s092918022", "user_id": "u467535434"}, "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)\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 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 ANS int64\nfunc main() {\n\tN := int64(nextInt())\n\tN = int64Lcm(N, int64(7))\n\tfor i := int64(7); i < int64(7777777777777777777); i = i * 10 + 7 {\n\t\tif i % N == 0 {\n\t\t\tfmt.Println(getDight(i))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\nfunc getDight(a int64) int64{\n d := int64(0)\n div := int64(10)\n for a != int64(0) {\n\t a = a / div\n\t d++\n }\n return d\n}\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\ta, b = b, a\n\t}\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 return a * b / gcd(a, b);\n}\nfunc int64Lcm(a, b int64) int64 {\n return a * b / int64Gcd(a, b);\n}\n\nfunc int64Gcd(a, b int64) int64 {\n\tif b > a {\n\t\ta, b = b, a\n\t}\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 PrimeFactors(n int) (pfs []int) {\n // Get the number of 2s that divide n\n for n%2 == 0 {\n pfs = append(pfs, 2)\n n = n / 2\n }\n // n must be odd at this point. so we can skip one element\n // (note i = i + 2)\n for i := 3; i*i <= n; i = i + 2 {\n // while i divides n, append i and divide n\n for n%i == 0 {\n pfs = append(pfs, i)\n n = n / i\n }\n }\n // This condition is to handle the case when n is a prime number\n // greater than 2\n if n > 2 {\n pfs = append(pfs, n)\n }\n return\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1670, "cpu_time_ms": 6, "memory_kb": 1804}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s670484932", "group_id": "codeNet:p02597", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for D - Alter Altar\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tvar flag1 int = 0\n\tvar flag2 int = 0\n\tvar count1, count2 int\n\tfor i := 0; i < N; i++ {\n\t\tif flag1 == 0 && S[i] == 'W' {\n\t\t\tcount1++\n\t\t} else if flag1 == 0 && S[i] == 'R' {\n\t\t\tflag1 = 1\n\t\t}\n\n\t\tif flag1 == 1 && S[i] == 'W' {\n\t\t\tflag2 = 1\n\t\t}\n\n\t\tif flag1 == 1 && flag2 == 1 && S[i] == 'R' {\n\t\t\tcount2++\n\t\t}\n\t}\n\tif count2 >= count1 {\n\t\tfmt.Println(count2)\n\t} else {\n\t\tfmt.Println(int(math.Abs(float64(count1 - count2))))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598954509, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02597.html", "problem_id": "p02597", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02597/input.txt", "sample_output_relpath": "derived/input_output/data/p02597/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02597/Go/s670484932.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s670484932", "user_id": "u128015095"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\t// Code for D - Alter Altar\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tvar flag1 int = 0\n\tvar flag2 int = 0\n\tvar count1, count2 int\n\tfor i := 0; i < N; i++ {\n\t\tif flag1 == 0 && S[i] == 'W' {\n\t\t\tcount1++\n\t\t} else if flag1 == 0 && S[i] == 'R' {\n\t\t\tflag1 = 1\n\t\t}\n\n\t\tif flag1 == 1 && S[i] == 'W' {\n\t\t\tflag2 = 1\n\t\t}\n\n\t\tif flag1 == 1 && flag2 == 1 && S[i] == 'R' {\n\t\t\tcount2++\n\t\t}\n\t}\n\tif count2 >= count1 {\n\t\tfmt.Println(count2)\n\t} else {\n\t\tfmt.Println(int(math.Abs(float64(count1 - count2))))\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "sample_input": "4\nWWRR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02597", "source_text": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 576, "cpu_time_ms": 175, "memory_kb": 3284}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s033817512", "group_id": "codeNet:p02597", "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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc main() {\n\tscanner := makeScanner(200002)\n\tn := eGetInt(scanner)\n\tcs := eGetLine(scanner)\n\thcnt, tcnt := 0, 0\n\tfor i := 0; i < n/2; i++ {\n\t\th, t := i, len(cs)-1-i\n\t\tif cs[h] == 'W' {\n\t\t\thcnt++\n\t\t}\n\t\tif cs[t] == 'R' {\n\t\t\ttcnt++\n\t\t}\n\t}\n\tif len(cs)%2 == 1 && tcnt < hcnt && cs[n/2] == 'R' {\n\t\tfmt.Println(min(hcnt, tcnt) + 1)\n\t} else {\n\t\tfmt.Println(min(hcnt, tcnt))\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}\nfunc reverseB(s []byte) {\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}\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}\nfunc rPool(p int, n []int, c []int, cc [][]int) [][]int {\n\tif len(n) == 0 || p <= 0 {\n\t\treturn cc\n\t}\n\tp--\n\tfor i := range n {\n\t\tr := make([]int, len(c)+1)\n\t\tcopy(r, c)\n\t\tr[len(r)-1] = n[i]\n\t\tif p == 0 {\n\t\t\tcc = append(cc, r)\n\t\t}\n\t\tcc = rPool(p, n[i+1:], r, cc)\n\t}\n\treturn cc\n}\n\nfunc Pool(p int, n []int) [][]int {\n\treturn rPool(p, n, nil, nil)\n}\n", "language": "Go", "metadata": {"date": 1596422348, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02597.html", "problem_id": "p02597", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02597/input.txt", "sample_output_relpath": "derived/input_output/data/p02597/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02597/Go/s033817512.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s033817512", "user_id": "u663116078"}, "prompt_components": {"gold_output": "2\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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc main() {\n\tscanner := makeScanner(200002)\n\tn := eGetInt(scanner)\n\tcs := eGetLine(scanner)\n\thcnt, tcnt := 0, 0\n\tfor i := 0; i < n/2; i++ {\n\t\th, t := i, len(cs)-1-i\n\t\tif cs[h] == 'W' {\n\t\t\thcnt++\n\t\t}\n\t\tif cs[t] == 'R' {\n\t\t\ttcnt++\n\t\t}\n\t}\n\tif len(cs)%2 == 1 && tcnt < hcnt && cs[n/2] == 'R' {\n\t\tfmt.Println(min(hcnt, tcnt) + 1)\n\t} else {\n\t\tfmt.Println(min(hcnt, tcnt))\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}\nfunc reverseB(s []byte) {\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}\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}\nfunc rPool(p int, n []int, c []int, cc [][]int) [][]int {\n\tif len(n) == 0 || p <= 0 {\n\t\treturn cc\n\t}\n\tp--\n\tfor i := range n {\n\t\tr := make([]int, len(c)+1)\n\t\tcopy(r, c)\n\t\tr[len(r)-1] = n[i]\n\t\tif p == 0 {\n\t\t\tcc = append(cc, r)\n\t\t}\n\t\tcc = rPool(p, n[i+1:], r, cc)\n\t}\n\treturn cc\n}\n\nfunc Pool(p int, n []int) [][]int {\n\treturn rPool(p, n, nil, nil)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "sample_input": "4\nWWRR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02597", "source_text": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4244, "cpu_time_ms": 8, "memory_kb": 2492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117894547", "group_id": "codeNet:p02597", "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\tc := []rune(Scan())\n\tr := 0\n\tfor _, v := range c {\n\t\tif string(v) == \"R\" {\n\t\t\tr++\n\t\t}\n\t}\n\tans := 0\n\tfor i := r; i < n; i++ {\n\t\tif string(c[i]) == \"R\" {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1596417772, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02597.html", "problem_id": "p02597", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02597/input.txt", "sample_output_relpath": "derived/input_output/data/p02597/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02597/Go/s117894547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s117894547", "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\tn := iScan()\n\tc := []rune(Scan())\n\tr := 0\n\tfor _, v := range c {\n\t\tif string(v) == \"R\" {\n\t\t\tr++\n\t\t}\n\t}\n\tans := 0\n\tfor i := r; i < n; i++ {\n\t\tif string(c[i]) == \"R\" {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "sample_input": "4\nWWRR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02597", "source_text": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1404, "cpu_time_ms": 19, "memory_kb": 3244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s591976835", "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\tcnt += int(float64(a[i]) / x)\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// 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\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", "language": "Go", "metadata": {"date": 1597854513, "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/s591976835.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s591976835", "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\tcnt += int(float64(a[i]) / x)\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// 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\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", "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 0; i -= i & -i {\n\t\tresult += bit[i-1]\n\t}\n\treturn result\n}\n\nfunc (bit BIT) query(start int, stop int) int {\n\treturn bit.sum(stop-1) - bit.sum(start-1)\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\tQ := readInt()\n\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tc[i] = readInt()\n\t}\n\n\tlr := make([][3]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tl := readInt() - 1\n\t\tr := readInt() - 1\n\t\tlr[i] = [3]int{i, l, r}\n\t}\n\tsort.Slice(lr, func(i, j int) bool { return lr[i][2] < lr[j][2] })\n\n\tresult := make([]int, Q)\n\tbit := newBIT(N)\n\tmr := map[int]int{}\n\tk := 0\n\tfor i := 0; i < N; i++ {\n\t\tif j, ok := mr[c[i]]; ok {\n\t\t\tbit.add(j, -1)\n\t\t}\n\t\tbit.add(i, 1)\n\t\tmr[c[i]] = i\n\t\tfor k < Q && lr[k][2] == i {\n\t\t\tresult[lr[k][0]] = bit.query(lr[k][1], lr[k][2]+1)\n\t\t\tk++\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tprintln(result[i])\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 println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "language": "Go", "metadata": {"date": 1599600101, "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/s044376897.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s044376897", "user_id": "u347640436"}, "prompt_components": {"gold_output": "2\n3\n1\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// BIT stands for binary indexed tree.\ntype BIT []int\n\nfunc newBIT(n int) BIT {\n\treturn make([]int, n)\n}\n\nfunc (bit BIT) add(i, v int) {\n\tfor i++; i <= len(bit); i += i & -i {\n\t\tbit[i-1] += v\n\t}\n}\n\nfunc (bit BIT) sum(i int) int {\n\tresult := 0\n\tfor i++; i > 0; i -= i & -i {\n\t\tresult += bit[i-1]\n\t}\n\treturn result\n}\n\nfunc (bit BIT) query(start int, stop int) int {\n\treturn bit.sum(stop-1) - bit.sum(start-1)\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\tQ := readInt()\n\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tc[i] = readInt()\n\t}\n\n\tlr := make([][3]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tl := readInt() - 1\n\t\tr := readInt() - 1\n\t\tlr[i] = [3]int{i, l, r}\n\t}\n\tsort.Slice(lr, func(i, j int) bool { return lr[i][2] < lr[j][2] })\n\n\tresult := make([]int, Q)\n\tbit := newBIT(N)\n\tmr := map[int]int{}\n\tk := 0\n\tfor i := 0; i < N; i++ {\n\t\tif j, ok := mr[c[i]]; ok {\n\t\t\tbit.add(j, -1)\n\t\t}\n\t\tbit.add(i, 1)\n\t\tmr[c[i]] = i\n\t\tfor k < Q && lr[k][2] == i {\n\t\t\tresult[lr[k][0]] = bit.query(lr[k][1], lr[k][2]+1)\n\t\t\tk++\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tprintln(result[i])\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 println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1751, "cpu_time_ms": 481, "memory_kb": 72684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s832951873", "group_id": "codeNet:p02601", "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\tscanner *bufio.Scanner\n\tbuffer *bufio.Writer\n\twriter io.Writer\n)\n\nfunc main() {\n\tdefer flush()\n\tinitWordScanner()\n\tinitBufWriter()\n\n\ta := readInt()\n\tb := readInt()\n\tc := readInt()\n\tk := readInt()\n\n\tf := false\n\tfor i := 0; i <= k; i++ {\n\t\tfor j := 0; j <= k-i; j++ {\n\t\t\ttb := b * 2 * i\n\t\t\ttc := c * 2 * j\n\t\t\tif a < tb && tb < tc {\n\t\t\t\tf = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif f {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\n}\n\nfunc initLineScanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, 1e4)\n\tscanner.Buffer(buf, bufio.MaxScanTokenSize)\n}\n\nfunc initWordScanner() {\n\tinitLineScanner()\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readLine() string {\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tn, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc readFloat() float64 {\n\tscanner.Scan()\n\tn, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc readRunes() []rune {\n\tscanner.Scan()\n\tvar ns []rune\n\tfor _, v := range scanner.Text() {\n\t\tns = append(ns, v)\n\t}\n\treturn ns\n}\n\nfunc readString() string {\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc readStrings() []string {\n\tscanner.Scan()\n\tvar ss []string\n\tfor _, v := range scanner.Text() {\n\t\tss = append(ss, string(v))\n\t}\n\treturn ss\n}\n\nfunc initWriter() {\n\tbuffer = nil\n\twriter = os.Stdout\n}\n\nfunc initBufWriter() {\n\tbuffer = bufio.NewWriter(os.Stdout)\n\twriter = buffer\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(writer, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(writer, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc flush() {\n\tif writer != nil {\n\t\tbuffer.Flush()\n\t}\n}\n\nfunc string2int(s string) int {\n\tn, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn n\n}\n\nfunc int2string(n int) string {\n\ts := strconv.Itoa(n)\n\treturn s\n}\n\nfunc string2float(s string) float64 {\n\tn, e := strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn n\n}\n\nfunc sum(ns []int) int {\n\ts := 0\n\tfor _, n := range ns {\n\t\ts += n\n\t}\n\treturn s\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 b\n\t}\n\treturn a\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn 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\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n", "language": "Go", "metadata": {"date": 1595725932, "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/s832951873.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s832951873", "user_id": "u264928123"}, "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\tscanner *bufio.Scanner\n\tbuffer *bufio.Writer\n\twriter io.Writer\n)\n\nfunc main() {\n\tdefer flush()\n\tinitWordScanner()\n\tinitBufWriter()\n\n\ta := readInt()\n\tb := readInt()\n\tc := readInt()\n\tk := readInt()\n\n\tf := false\n\tfor i := 0; i <= k; i++ {\n\t\tfor j := 0; j <= k-i; j++ {\n\t\t\ttb := b * 2 * i\n\t\t\ttc := c * 2 * j\n\t\t\tif a < tb && tb < tc {\n\t\t\t\tf = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif f {\n\t\tprintln(\"Yes\")\n\t} else {\n\t\tprintln(\"No\")\n\t}\n}\n\nfunc initLineScanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, 1e4)\n\tscanner.Buffer(buf, bufio.MaxScanTokenSize)\n}\n\nfunc initWordScanner() {\n\tinitLineScanner()\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readLine() string {\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tn, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc readFloat() float64 {\n\tscanner.Scan()\n\tn, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc readRunes() []rune {\n\tscanner.Scan()\n\tvar ns []rune\n\tfor _, v := range scanner.Text() {\n\t\tns = append(ns, v)\n\t}\n\treturn ns\n}\n\nfunc readString() string {\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc readStrings() []string {\n\tscanner.Scan()\n\tvar ss []string\n\tfor _, v := range scanner.Text() {\n\t\tss = append(ss, string(v))\n\t}\n\treturn ss\n}\n\nfunc initWriter() {\n\tbuffer = nil\n\twriter = os.Stdout\n}\n\nfunc initBufWriter() {\n\tbuffer = bufio.NewWriter(os.Stdout)\n\twriter = buffer\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(writer, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(writer, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc flush() {\n\tif writer != nil {\n\t\tbuffer.Flush()\n\t}\n}\n\nfunc string2int(s string) int {\n\tn, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn n\n}\n\nfunc int2string(n int) string {\n\ts := strconv.Itoa(n)\n\treturn s\n}\n\nfunc string2float(s string) float64 {\n\tn, e := strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn n\n}\n\nfunc sum(ns []int) int {\n\ts := 0\n\tfor _, n := range ns {\n\t\ts += n\n\t}\n\treturn s\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 b\n\t}\n\treturn a\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn 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\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2693, "cpu_time_ms": 6, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s412024372", "group_id": "codeNet:p02602", "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 []int\nvar n, k int\n\nfunc main() {\n\tn, k = 0, 0\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tins := strings.Split(sc.Text(), \" \")\n\tfor _, i := range ins {\n\t\ttmp, _ := strconv.Atoi(i)\n\t\tin = append(in, tmp)\n\t}\n\t//fmt.Println(in)\n\tfor i := k + 1; i <= n; i++ {\n\t\tif ev(i) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\nfunc ev(i int) bool {\n\treturn in[i-k-1] < in[i-1]\n}", "language": "Go", "metadata": {"date": 1595728729, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02602.html", "problem_id": "p02602", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02602/input.txt", "sample_output_relpath": "derived/input_output/data/p02602/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02602/Go/s412024372.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s412024372", "user_id": "u074996057"}, "prompt_components": {"gold_output": "Yes\nNo\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 []int\nvar n, k int\n\nfunc main() {\n\tn, k = 0, 0\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tins := strings.Split(sc.Text(), \" \")\n\tfor _, i := range ins {\n\t\ttmp, _ := strconv.Atoi(i)\n\t\tin = append(in, tmp)\n\t}\n\t//fmt.Println(in)\n\tfor i := k + 1; i <= n; i++ {\n\t\tif ev(i) {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\nfunc ev(i int) bool {\n\treturn in[i-k-1] < in[i-1]\n}", "problem_context": "Score: 300 points\n\nProblem Statement\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\n\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\nFor the first through (K-1)-th terms: not given.\n\nFor each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.\n\nM-kun scored A_i in the exam at the end of the i-th term.\n\nFor each i such that K+1 \\leq i \\leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq K \\leq N-1\n\n1 \\leq A_i \\leq 10^{9}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 A_3 \\ldots A_N\n\nOutput\n\nPrint the answer in N-K lines.\n\nThe i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.\n\nSample Input 1\n\n5 3\n96 98 95 100 20\n\nSample Output 1\n\nYes\nNo\n\nHis grade for each term is computed as follows:\n\n3-rd term: (96 \\times 98 \\times 95) = 893760\n\n4-th term: (98 \\times 95 \\times 100) = 931000\n\n5-th term: (95 \\times 100 \\times 20) = 190000\n\nSample Input 2\n\n3 2\n1001 869120 1001\n\nSample Output 2\n\nNo\n\nNote that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.\n\nSample Input 3\n\n15 7\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9\n\nSample Output 3\n\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nYes", "sample_input": "5 3\n96 98 95 100 20\n"}, "reference_outputs": ["Yes\nNo\n"], "source_document_id": "p02602", "source_text": "Score: 300 points\n\nProblem Statement\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\n\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\nFor the first through (K-1)-th terms: not given.\n\nFor each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.\n\nM-kun scored A_i in the exam at the end of the i-th term.\n\nFor each i such that K+1 \\leq i \\leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq K \\leq N-1\n\n1 \\leq A_i \\leq 10^{9}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 A_3 \\ldots A_N\n\nOutput\n\nPrint the answer in N-K lines.\n\nThe i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.\n\nSample Input 1\n\n5 3\n96 98 95 100 20\n\nSample Output 1\n\nYes\nNo\n\nHis grade for each term is computed as follows:\n\n3-rd term: (96 \\times 98 \\times 95) = 893760\n\n4-th term: (98 \\times 95 \\times 100) = 931000\n\n5-th term: (95 \\times 100 \\times 20) = 190000\n\nSample Input 2\n\n3 2\n1001 869120 1001\n\nSample Output 2\n\nNo\n\nNote that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.\n\nSample Input 3\n\n15 7\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9\n\nSample Output 3\n\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 491, "cpu_time_ms": 7, "memory_kb": 2016}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s558239863", "group_id": "codeNet:p02606", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar L, R, d, n int\n\tfmt.Scan(&L)\n\tfmt.Scan(&R)\n\tfmt.Scan(&d)\n\tif L%d == 0 {\n\t\tn = 1\n\t}\n\tfmt.Println(R/d - L/d + n)\n}\n", "language": "Go", "metadata": {"date": 1594516125, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02606.html", "problem_id": "p02606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02606/input.txt", "sample_output_relpath": "derived/input_output/data/p02606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02606/Go/s558239863.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s558239863", "user_id": "u999119932"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar L, R, d, n int\n\tfmt.Scan(&L)\n\tfmt.Scan(&R)\n\tfmt.Scan(&d)\n\tif L%d == 0 {\n\t\tn = 1\n\t}\n\tfmt.Println(R/d - L/d + n)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "sample_input": "5 10 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02606", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 160, "cpu_time_ms": 6, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s190733682", "group_id": "codeNet:p02609", "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\tx := scanString()\n\n\tmemo := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tc := 0\n\t\tfor b := i + 1; b != 0; b >>= 1 {\n\t\t\tif b&1 == 1 {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tmemo[i+1] = memo[(i+1)%c] + 1\n\t}\n\n\tcn := 0\n\tfor _, s := range x {\n\t\tif s == '1' {\n\t\t\tcn++\n\t\t}\n\t}\n\n\ta1, a2 := 0, 0\n\tp1, p2 := 1, 1\n\tfor i := 0; i < n; i++ {\n\t\tif x[n-1-i] == '1' {\n\t\t\tif cn != 1 {\n\t\t\t\ta1 = (a1 + p1) % (cn - 1)\n\t\t\t}\n\t\t\ta2 = (a2 + p2) % (cn + 1)\n\t\t}\n\t\tif cn != 1 {\n\t\t\tp1 = p1 * 2 % (cn - 1)\n\t\t}\n\t\tp2 = p2 * 2 % (cn + 1)\n\t}\n\n\tans := make([]int, n)\n\tp1, p2 = 1, 1\n\tfor i := 0; i < n; i++ {\n\t\tc := cn\n\t\ta := 0\n\t\tif x[n-1-i] == '1' {\n\t\t\tif cn != 1 {\n\t\t\t\tc--\n\t\t\t\ta = (a1 - p1%c + c) % c\n\t\t\t} else {\n\t\t\t\tans[n-1-i] = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tc++\n\t\t\ta = (a2 + p2%c) % c\n\t\t}\n\t\tans[n-1-i] = memo[a] + 1\n\t\tif cn != 1 {\n\t\t\tp1 = p1 * 2 % (cn - 1)\n\t\t}\n\t\tp2 = p2 * 2 % (cn + 1)\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594527191, "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/s190733682.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s190733682", "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\tx := scanString()\n\n\tmemo := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tc := 0\n\t\tfor b := i + 1; b != 0; b >>= 1 {\n\t\t\tif b&1 == 1 {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tmemo[i+1] = memo[(i+1)%c] + 1\n\t}\n\n\tcn := 0\n\tfor _, s := range x {\n\t\tif s == '1' {\n\t\t\tcn++\n\t\t}\n\t}\n\n\ta1, a2 := 0, 0\n\tp1, p2 := 1, 1\n\tfor i := 0; i < n; i++ {\n\t\tif x[n-1-i] == '1' {\n\t\t\tif cn != 1 {\n\t\t\t\ta1 = (a1 + p1) % (cn - 1)\n\t\t\t}\n\t\t\ta2 = (a2 + p2) % (cn + 1)\n\t\t}\n\t\tif cn != 1 {\n\t\t\tp1 = p1 * 2 % (cn - 1)\n\t\t}\n\t\tp2 = p2 * 2 % (cn + 1)\n\t}\n\n\tans := make([]int, n)\n\tp1, p2 = 1, 1\n\tfor i := 0; i < n; i++ {\n\t\tc := cn\n\t\ta := 0\n\t\tif x[n-1-i] == '1' {\n\t\t\tif cn != 1 {\n\t\t\t\tc--\n\t\t\t\ta = (a1 - p1%c + c) % c\n\t\t\t} else {\n\t\t\t\tans[n-1-i] = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t} else {\n\t\t\tc++\n\t\t\ta = (a2 + p2%c) % c\n\t\t}\n\t\tans[n-1-i] = memo[a] + 1\n\t\tif cn != 1 {\n\t\t\tp1 = p1 * 2 % (cn - 1)\n\t\t}\n\t\tp2 = p2 * 2 % (cn + 1)\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprintln(wr, ans[i])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1955, "cpu_time_ms": 64, "memory_kb": 7152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s158397430", "group_id": "codeNet:p02609", "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\tvar x string\n\tfmt.Scan(&x)\n\t\n\ta := makeArray(n, x)\n\tfor _, v := range a {\n\t\tfmt.Println(f(v))\n\t}\n}\n\nfunc makeArray(n int, x string) (a []int64) {\n\tfor i := 0; i < n; i++ {\n\t\ttempX := \"\"\n\t\tif x[i:i+1] == \"0\" {\n\t\t\tif i + 1 != n {\n\t\t\t\ttempX = x[:i] + \"1\" + x[i+1:]\n\t\t\t} else {\n\t\t\t\ttempX = x[:i] + \"1\"\n\t\t\t}\n\t\t} else {\n\t\t\tif i + 1 != n {\n\t\t\t\ttempX = x[:i] + \"0\" + x[i+1:]\n\t\t\t} else {\n\t\t\t\ttempX = x[:i] + \"0\"\n\t\t\t}\n\t\t}\n\n\t\ti, _ := strconv.ParseInt(tempX, 2, 64)\n\t\ta = append(a, i)\n\t}\n\treturn a\n}\n\nfunc popCount(n int64) (c int64) {\n\tfor n != 0 {\n\t\tif n % 2 == 1 {\n\t\t\tc++\n\t\t}\n\t\tn = n / 2\n\t}\n\treturn c\n}\n\nfunc f(n int64) (cc int64) {\n\tc := popCount(n)\n\tfor n != 0 {\n\t\tcc++\n\t\tn = n % c\n\t\tc = popCount(n % c)\n\t}\n\tif n != 0 {\n\t\tcc++\n\t}\n\treturn cc\n}", "language": "Go", "metadata": {"date": 1594521123, "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/s158397430.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s158397430", "user_id": "u507027929"}, "prompt_components": {"gold_output": "2\n1\n1\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\tvar x string\n\tfmt.Scan(&x)\n\t\n\ta := makeArray(n, x)\n\tfor _, v := range a {\n\t\tfmt.Println(f(v))\n\t}\n}\n\nfunc makeArray(n int, x string) (a []int64) {\n\tfor i := 0; i < n; i++ {\n\t\ttempX := \"\"\n\t\tif x[i:i+1] == \"0\" {\n\t\t\tif i + 1 != n {\n\t\t\t\ttempX = x[:i] + \"1\" + x[i+1:]\n\t\t\t} else {\n\t\t\t\ttempX = x[:i] + \"1\"\n\t\t\t}\n\t\t} else {\n\t\t\tif i + 1 != n {\n\t\t\t\ttempX = x[:i] + \"0\" + x[i+1:]\n\t\t\t} else {\n\t\t\t\ttempX = x[:i] + \"0\"\n\t\t\t}\n\t\t}\n\n\t\ti, _ := strconv.ParseInt(tempX, 2, 64)\n\t\ta = append(a, i)\n\t}\n\treturn a\n}\n\nfunc popCount(n int64) (c int64) {\n\tfor n != 0 {\n\t\tif n % 2 == 1 {\n\t\t\tc++\n\t\t}\n\t\tn = n / 2\n\t}\n\treturn c\n}\n\nfunc f(n int64) (cc int64) {\n\tc := popCount(n)\n\tfor n != 0 {\n\t\tcc++\n\t\tn = n % c\n\t\tc = popCount(n % c)\n\t}\n\tif n != 0 {\n\t\tcc++\n\t}\n\treturn cc\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2206, "memory_kb": 8828}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s081734308", "group_id": "codeNet:p02609", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar l = 200001\nvar f = make([]int, l)\n\nfunc main() {\n\tf[0] = 0\n\tf[1] = 1\n\n\t// n <= 200000 でf[n]を求める\n\tfor i := 2; i < l; i++ {\n\t\tpopcount := bits(uint(i))\n\t\tf[i] = f[i%popcount] + 1\n\t}\n\n\tN := nextInt()\n\tX := nextBytes()\n\tc := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif X[i] == '1' {\n\t\t\tc++\n\t\t}\n\t}\n\tif c == 0 {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfmt.Println(1) // % 1\n\t\t}\n\t\treturn\n\t}\n\tif c == 1 {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif X[i] == '1' {\n\t\t\t\tfmt.Println(0) // Xi == 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// X[i] == 0\n\t\t\tif X[N-1] == '1' {\n\t\t\t\tfmt.Println(f[1] + 1) // Xi mod 2 == 1\n\t\t\t} else {\n\t\t\t\tfmt.Println(1) // Xi mod 2 == 0\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\trem02 := make([]int, N) // rem0[i] = 2^i % (c-1)\n\trem12 := make([]int, N) // rem1[i] = 2^i % (c+1)\n\trem0 := 0\n\trem1 := 0\n\tc0 := c + 1\n\tc1 := c - 1\n\tfor i := 0; i < N; i++ {\n\t\tx := int(X[i] - '0')\n\t\trem1 = (rem1*2 + x) % c1\n\t\trem0 = (rem0*2 + x) % c0\n\n\t\tif i == 0 {\n\t\t\trem02[i] = 1\n\t\t\trem12[i] = 1\n\t\t} else {\n\t\t\trem02[i] = (rem02[i-1] * 2) % c0\n\t\t\trem12[i] = (rem12[i-1] * 2) % c1\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tj := N - 1 - i\n\t\tif X[i] == '0' {\n\t\t\trem := (rem0 + rem02[j] + c0) % c0\n\t\t\tfmt.Println(f[rem] + 1)\n\t\t} else {\n\t\t\trem := (rem1 - rem12[j] + c1) % c1\n\t\t\tfmt.Println(f[rem] + 1)\n\t\t}\n\t}\n}\nfunc bits(v uint) int {\n\tv = (v & 0x55555555) + (v >> 1 & 0x55555555)\n\tv = (v & 0x33333333) + (v >> 2 & 0x33333333)\n\tv = (v & 0x0f0f0f0f) + (v >> 4 & 0x0f0f0f0f)\n\tv = (v & 0x00ff00ff) + (v >> 8 & 0x00ff00ff)\n\tv = (v & 0x0000ffff) + (v >> 16 & 0x0000ffff)\n\treturn int(v)\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": 1594520489, "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/s081734308.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s081734308", "user_id": "u578274732"}, "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 l = 200001\nvar f = make([]int, l)\n\nfunc main() {\n\tf[0] = 0\n\tf[1] = 1\n\n\t// n <= 200000 でf[n]を求める\n\tfor i := 2; i < l; i++ {\n\t\tpopcount := bits(uint(i))\n\t\tf[i] = f[i%popcount] + 1\n\t}\n\n\tN := nextInt()\n\tX := nextBytes()\n\tc := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif X[i] == '1' {\n\t\t\tc++\n\t\t}\n\t}\n\tif c == 0 {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfmt.Println(1) // % 1\n\t\t}\n\t\treturn\n\t}\n\tif c == 1 {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif X[i] == '1' {\n\t\t\t\tfmt.Println(0) // Xi == 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// X[i] == 0\n\t\t\tif X[N-1] == '1' {\n\t\t\t\tfmt.Println(f[1] + 1) // Xi mod 2 == 1\n\t\t\t} else {\n\t\t\t\tfmt.Println(1) // Xi mod 2 == 0\n\t\t\t}\n\t\t}\n\t\treturn\n\t}\n\n\trem02 := make([]int, N) // rem0[i] = 2^i % (c-1)\n\trem12 := make([]int, N) // rem1[i] = 2^i % (c+1)\n\trem0 := 0\n\trem1 := 0\n\tc0 := c + 1\n\tc1 := c - 1\n\tfor i := 0; i < N; i++ {\n\t\tx := int(X[i] - '0')\n\t\trem1 = (rem1*2 + x) % c1\n\t\trem0 = (rem0*2 + x) % c0\n\n\t\tif i == 0 {\n\t\t\trem02[i] = 1\n\t\t\trem12[i] = 1\n\t\t} else {\n\t\t\trem02[i] = (rem02[i-1] * 2) % c0\n\t\t\trem12[i] = (rem12[i-1] * 2) % c1\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tj := N - 1 - i\n\t\tif X[i] == '0' {\n\t\t\trem := (rem0 + rem02[j] + c0) % c0\n\t\t\tfmt.Println(f[rem] + 1)\n\t\t} else {\n\t\t\trem := (rem1 - rem12[j] + c1) % c1\n\t\t\tfmt.Println(f[rem] + 1)\n\t\t}\n\t}\n}\nfunc bits(v uint) int {\n\tv = (v & 0x55555555) + (v >> 1 & 0x55555555)\n\tv = (v & 0x33333333) + (v >> 2 & 0x33333333)\n\tv = (v & 0x0f0f0f0f) + (v >> 4 & 0x0f0f0f0f)\n\tv = (v & 0x00ff00ff) + (v >> 8 & 0x00ff00ff)\n\tv = (v & 0x0000ffff) + (v >> 16 & 0x0000ffff)\n\treturn int(v)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2151, "cpu_time_ms": 335, "memory_kb": 8556}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187906707", "group_id": "codeNet:p02613", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n \n count_ac := 0\n count_wa := 0\n count_tle := 0 \n count_re := 0\n \n a := make([]string, n)\n \n for i := 0; i < len(a); i++ {\n fmt.Scan(&a[i])\n }\n \n for j := 0; j < len(a); j++ {\n if a[j] == \"AC\" {\n count_ac += 1\n } else if a[j] == \"WA\" {\n count_wa += 1\n } else if a[j] == \"TLE\" {\n count_tle += 1\n } else if a[j] == \"RE\" {\n count_re += 1\n }\n }\n \n \tfmt.Println(\"AC x\",count_ac)\n \tfmt.Println(\"WA x\", count_wa)\n\tfmt.Println(\"TLE x\", count_tle)\n\tfmt.Println(\"RE x\", count_re)\n}", "language": "Go", "metadata": {"date": 1595962829, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02613.html", "problem_id": "p02613", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02613/input.txt", "sample_output_relpath": "derived/input_output/data/p02613/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02613/Go/s187906707.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187906707", "user_id": "u888376810"}, "prompt_components": {"gold_output": "AC x 3\nWA x 1\nTLE x 2\nRE x 0\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n \n count_ac := 0\n count_wa := 0\n count_tle := 0 \n count_re := 0\n \n a := make([]string, n)\n \n for i := 0; i < len(a); i++ {\n fmt.Scan(&a[i])\n }\n \n for j := 0; j < len(a); j++ {\n if a[j] == \"AC\" {\n count_ac += 1\n } else if a[j] == \"WA\" {\n count_wa += 1\n } else if a[j] == \"TLE\" {\n count_tle += 1\n } else if a[j] == \"RE\" {\n count_re += 1\n }\n }\n \n \tfmt.Println(\"AC x\",count_ac)\n \tfmt.Println(\"WA x\", count_wa)\n\tfmt.Println(\"TLE x\", count_tle)\n\tfmt.Println(\"RE x\", count_re)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "sample_input": "6\nAC\nTLE\nAC\nAC\nWA\nTLE\n"}, "reference_outputs": ["AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"], "source_document_id": "p02613", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 602, "cpu_time_ms": 357, "memory_kb": 6828}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s234033947", "group_id": "codeNet:p02613", "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\n\tlist := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tcount := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tswitch list[i] {\n\t\tcase \"AC\":\n\t\t\tcount[0] += 1\n\t\tcase \"WA\":\n\t\t\tcount[1] += 1\n\t\tcase \"TLE\":\n\t\t\tcount[2] += 1\n\t\tcase \"RE\":\n\t\t\tcount[3] += 1\n\t\t}\n\t}\n\tfmt.Println(\"AC x \" + strconv.Itoa(count[0]))\n\tfmt.Println(\"WA x \" + strconv.Itoa(count[1]))\n\tfmt.Println(\"TLE x \" + strconv.Itoa(count[2]))\n\tfmt.Println(\"RE x \" + strconv.Itoa(count[3]))\n}", "language": "Go", "metadata": {"date": 1593999349, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02613.html", "problem_id": "p02613", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02613/input.txt", "sample_output_relpath": "derived/input_output/data/p02613/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02613/Go/s234033947.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s234033947", "user_id": "u455482621"}, "prompt_components": {"gold_output": "AC x 3\nWA x 1\nTLE x 2\nRE x 0\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\n\tlist := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tcount := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tswitch list[i] {\n\t\tcase \"AC\":\n\t\t\tcount[0] += 1\n\t\tcase \"WA\":\n\t\t\tcount[1] += 1\n\t\tcase \"TLE\":\n\t\t\tcount[2] += 1\n\t\tcase \"RE\":\n\t\t\tcount[3] += 1\n\t\t}\n\t}\n\tfmt.Println(\"AC x \" + strconv.Itoa(count[0]))\n\tfmt.Println(\"WA x \" + strconv.Itoa(count[1]))\n\tfmt.Println(\"TLE x \" + strconv.Itoa(count[2]))\n\tfmt.Println(\"RE x \" + strconv.Itoa(count[3]))\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "sample_input": "6\nAC\nTLE\nAC\nAC\nWA\nTLE\n"}, "reference_outputs": ["AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"], "source_document_id": "p02613", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 550, "cpu_time_ms": 321, "memory_kb": 7632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448964409", "group_id": "codeNet:p02614", "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 pow(a int, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 1 {\n\t\treturn a * pow(a, p-1)\n\t} else {\n\t\tb := pow(a, p/2)\n\t\treturn b * b\n\t}\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 main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tH, W, K := nextInt(), nextInt(), nextInt()\n\tblack := make([][]bool, H)\n\tfor i := 0; i < H; i++ {\n\t\tblack[i] = make([]bool, W)\n\t\ts := next()\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif s[j] == '#' {\n\t\t\t\tblack[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tH_KOUHO := pow(2, H)\n\tW_KOUHO := pow(2, W)\n\tcol_sum_each := make([][]int, H_KOUHO)\n\n\tfor n := 0; n < H_KOUHO; n++ {\n\t\tr := n\n\t\tcol_sum_each[n] = make([]int, W)\n\t\tfor i := 0; i < H; i++ {\n\t\t\tif r%2 == 0 {\n\t\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\t\tif black[i][j] {\n\t\t\t\t\t\tcol_sum_each[n][j]++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tr = r / 2\n\t\t}\n\t}\n\n\tcount := 0\n\tfor n := 0; n < H_KOUHO; n++ {\n\t\tfor m := 0; m < W_KOUHO; m++ {\n\t\t\tr := m\n\t\t\tsum := 0\n\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\tif r%2 == 0 {\n\t\t\t\t\tsum += col_sum_each[n][j]\n\t\t\t\t}\n\t\t\t\tr = r / 2\n\t\t\t}\n\t\t\tif sum == K {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintf(out, \"%d\\n\", count)\n}\n", "language": "Go", "metadata": {"date": 1593998879, "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/s448964409.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448964409", "user_id": "u673612774"}, "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)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc pow(a int, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 1 {\n\t\treturn a * pow(a, p-1)\n\t} else {\n\t\tb := pow(a, p/2)\n\t\treturn b * b\n\t}\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 main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tH, W, K := nextInt(), nextInt(), nextInt()\n\tblack := make([][]bool, H)\n\tfor i := 0; i < H; i++ {\n\t\tblack[i] = make([]bool, W)\n\t\ts := next()\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif s[j] == '#' {\n\t\t\t\tblack[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tH_KOUHO := pow(2, H)\n\tW_KOUHO := pow(2, W)\n\tcol_sum_each := make([][]int, H_KOUHO)\n\n\tfor n := 0; n < H_KOUHO; n++ {\n\t\tr := n\n\t\tcol_sum_each[n] = make([]int, W)\n\t\tfor i := 0; i < H; i++ {\n\t\t\tif r%2 == 0 {\n\t\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\t\tif black[i][j] {\n\t\t\t\t\t\tcol_sum_each[n][j]++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tr = r / 2\n\t\t}\n\t}\n\n\tcount := 0\n\tfor n := 0; n < H_KOUHO; n++ {\n\t\tfor m := 0; m < W_KOUHO; m++ {\n\t\t\tr := m\n\t\t\tsum := 0\n\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\tif r%2 == 0 {\n\t\t\t\t\tsum += col_sum_each[n][j]\n\t\t\t\t}\n\t\t\t\tr = r / 2\n\t\t\t}\n\t\t\tif sum == K {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintf(out, \"%d\\n\", count)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1357, "cpu_time_ms": 3, "memory_kb": 1824}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s879637160", "group_id": "codeNet:p02614", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tH, W, K := getInt(), getInt(), getInt()\n\tD := [10][10]string{}\n\tsum := 0\n\tfor i := 0; i < H; i++ {\n\t\tRS := []rune(getStr())\n\t\tfor j := 0; j < W; j++ {\n\t\t\tD[i][j] = string(RS[j])\n\t\t\tif string(RS[j]) == \"#\" {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Println(sum)\n\tans := 0\n\tfor bit := 0; bit < (1 << uint(H)); bit++ {\n\t\tR := sum\n\t\tfilled := map[string]bool{}\n\t\t//fmt.Println(\"RUN\", bit)\n\t\tfor i := 0; i < H; i++ {\n\t\t\tif bit&(1< 0 {\n\t\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\t\tif D[i][j] == \"#\" {\n\t\t\t\t\t\t//fmt.Println(\"1\", bit, i, j)\n\t\t\t\t\t\tfilled[fmt.Sprintf(\"%d/%d\", i, j)] = true\n\t\t\t\t\t\tR--\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(\"FIR\", bit, R)\n\t\tfor bit2 := 0; bit2 < (1 << uint(W)); bit2++ {\n\t\t\tR := R\n\t\t\tfor i := 0; i < W; i++ {\n\t\t\t\tif bit2&(1< 0 {\n\t\t\t\t\tfor j := 0; j < H; j++ {\n\t\t\t\t\t\tif D[j][i] == \"#\" {\n\t\t\t\t\t\t\t//fmt.Println(\"!!!\", bit2, j, i)\n\t\t\t\t\t\t\tif !filled[fmt.Sprintf(\"%d/%d\", j, i)] {\n\t\t\t\t\t\t\t\tR--\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}\n\t\t\tif R == K {\n\t\t\t\tans++\n\t\t\t}\n\t\t\t//fmt.Println(\"SEC\", bit2, R)\n\t\t}\n\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "language": "Go", "metadata": {"date": 1593998864, "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/s879637160.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s879637160", "user_id": "u534481484"}, "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 (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tH, W, K := getInt(), getInt(), getInt()\n\tD := [10][10]string{}\n\tsum := 0\n\tfor i := 0; i < H; i++ {\n\t\tRS := []rune(getStr())\n\t\tfor j := 0; j < W; j++ {\n\t\t\tD[i][j] = string(RS[j])\n\t\t\tif string(RS[j]) == \"#\" {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Println(sum)\n\tans := 0\n\tfor bit := 0; bit < (1 << uint(H)); bit++ {\n\t\tR := sum\n\t\tfilled := map[string]bool{}\n\t\t//fmt.Println(\"RUN\", bit)\n\t\tfor i := 0; i < H; i++ {\n\t\t\tif bit&(1< 0 {\n\t\t\t\tfor j := 0; j < W; j++ {\n\t\t\t\t\tif D[i][j] == \"#\" {\n\t\t\t\t\t\t//fmt.Println(\"1\", bit, i, j)\n\t\t\t\t\t\tfilled[fmt.Sprintf(\"%d/%d\", i, j)] = true\n\t\t\t\t\t\tR--\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(\"FIR\", bit, R)\n\t\tfor bit2 := 0; bit2 < (1 << uint(W)); bit2++ {\n\t\t\tR := R\n\t\t\tfor i := 0; i < W; i++ {\n\t\t\t\tif bit2&(1< 0 {\n\t\t\t\t\tfor j := 0; j < H; j++ {\n\t\t\t\t\t\tif D[j][i] == \"#\" {\n\t\t\t\t\t\t\t//fmt.Println(\"!!!\", bit2, j, i)\n\t\t\t\t\t\t\tif !filled[fmt.Sprintf(\"%d/%d\", j, i)] {\n\t\t\t\t\t\t\t\tR--\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}\n\t\t\tif R == K {\n\t\t\t\tans++\n\t\t\t}\n\t\t\t//fmt.Println(\"SEC\", bit2, R)\n\t\t}\n\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4708, "cpu_time_ms": 51, "memory_kb": 15416}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s774058316", "group_id": "codeNet:p02616", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tN, K := getInt(), getInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t}\n\tsort.Ints(A)\n\tif K == 1 {\n\t\tfmt.Println(A[N-1])\n\t\treturn\n\t}\n\tans := int64(1)\n\tcnt := 0\n\tif K%2 != 0 {\n\t\tans = ModMul(ans, int64(A[N-1]))\n\t\tA = A[:N-1]\n\t\tN--\n\t\tcnt++\n\t}\n\t/*\n\t\tB := make([]int, N-1)\n\t\tfor i := 1; i < N; i++ {\n\t\t\tB[i-1] = int(ModMul(int64(A[i]), int64(A[i-1])))\n\t\t}\n\t\tif ans > 0 {\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(B)))\n\t\t} else {\n\t\t\tsort.Ints(B)\n\t\t}\n\n\t*/\n\t//fmt.Println(ans, A)\n\tfor cnt < K {\n\t\ta := int(ModMul(int64(A[N-1]), int64(A[N-2])))\n\t\tb := int(ModMul(int64(A[0]), int64(A[1])))\n\t\tif ans < 0 {\n\t\t\tif a > b {\n\t\t\t\tans = ModMul(ans, int64(b))\n\t\t\t\tA = A[2:]\n\t\t\t\tN -= 2\n\t\t\t} else {\n\t\t\t\tans = ModMul(ans, int64(a))\n\t\t\t\tA = A[:N-2]\n\t\t\t\tN -= 2\n\t\t\t}\n\t\t} else {\n\t\t\tif a <= b {\n\t\t\t\tans = ModMul(ans, int64(b))\n\t\t\t\tA = A[2:]\n\t\t\t\tN -= 2\n\t\t\t} else {\n\t\t\t\tans = ModMul(ans, int64(a))\n\t\t\t\tA = A[:N-2]\n\t\t\t\tN -= 2\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(a, b, ans)\n\t\tcnt += 2\n\t}\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "language": "Go", "metadata": {"date": 1593980962, "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/s774058316.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s774058316", "user_id": "u534481484"}, "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 (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tN, K := getInt(), getInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t}\n\tsort.Ints(A)\n\tif K == 1 {\n\t\tfmt.Println(A[N-1])\n\t\treturn\n\t}\n\tans := int64(1)\n\tcnt := 0\n\tif K%2 != 0 {\n\t\tans = ModMul(ans, int64(A[N-1]))\n\t\tA = A[:N-1]\n\t\tN--\n\t\tcnt++\n\t}\n\t/*\n\t\tB := make([]int, N-1)\n\t\tfor i := 1; i < N; i++ {\n\t\t\tB[i-1] = int(ModMul(int64(A[i]), int64(A[i-1])))\n\t\t}\n\t\tif ans > 0 {\n\t\t\tsort.Sort(sort.Reverse(sort.IntSlice(B)))\n\t\t} else {\n\t\t\tsort.Ints(B)\n\t\t}\n\n\t*/\n\t//fmt.Println(ans, A)\n\tfor cnt < K {\n\t\ta := int(ModMul(int64(A[N-1]), int64(A[N-2])))\n\t\tb := int(ModMul(int64(A[0]), int64(A[1])))\n\t\tif ans < 0 {\n\t\t\tif a > b {\n\t\t\t\tans = ModMul(ans, int64(b))\n\t\t\t\tA = A[2:]\n\t\t\t\tN -= 2\n\t\t\t} else {\n\t\t\t\tans = ModMul(ans, int64(a))\n\t\t\t\tA = A[:N-2]\n\t\t\t\tN -= 2\n\t\t\t}\n\t\t} else {\n\t\t\tif a <= b {\n\t\t\t\tans = ModMul(ans, int64(b))\n\t\t\t\tA = A[2:]\n\t\t\t\tN -= 2\n\t\t\t} else {\n\t\t\t\tans = ModMul(ans, int64(a))\n\t\t\t\tA = A[:N-2]\n\t\t\t\tN -= 2\n\t\t\t}\n\t\t}\n\t\t//fmt.Println(a, b, ans)\n\t\tcnt += 2\n\t}\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4705, "cpu_time_ms": 105, "memory_kb": 17884}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s231574933", "group_id": "codeNet:p02616", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tN, K := getInt(), getInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t}\n\tsort.Ints(A)\n\tif K == 1 {\n\t\tfmt.Println(A[N-1])\n\t\treturn\n\t}\n\tans := int64(1)\n\tcnt := 0\n\tif K%2 != 0 {\n\t\tans = ModMul(ans, int64(A[N-1]))\n\t\tA = A[:N-1]\n\t\tN--\n\t\tcnt++\n\t}\n\tB := make([]int, N-1)\n\tfor i := 1; i < N; i++ {\n\t\tB[i-1] = int(ModMul(int64(A[i]), int64(A[i-1])))\n\t}\n\tif ans > 0 {\n\t\tsort.Sort(sort.Reverse(sort.IntSlice(B)))\n\t} else {\n\t\tsort.Ints(B)\n\t}\n\tpos := 0\n\t//fmt.Println(ans, A, B)\n\tfor cnt < K {\n\t\tans = ModMul(ans, int64(B[pos]))\n\t\t//fmt.Println(ans)\n\t\tcnt += 2\n\t}\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "language": "Go", "metadata": {"date": 1593980403, "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/s231574933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s231574933", "user_id": "u534481484"}, "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 (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(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 init() {\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tN, K := getInt(), getInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t}\n\tsort.Ints(A)\n\tif K == 1 {\n\t\tfmt.Println(A[N-1])\n\t\treturn\n\t}\n\tans := int64(1)\n\tcnt := 0\n\tif K%2 != 0 {\n\t\tans = ModMul(ans, int64(A[N-1]))\n\t\tA = A[:N-1]\n\t\tN--\n\t\tcnt++\n\t}\n\tB := make([]int, N-1)\n\tfor i := 1; i < N; i++ {\n\t\tB[i-1] = int(ModMul(int64(A[i]), int64(A[i-1])))\n\t}\n\tif ans > 0 {\n\t\tsort.Sort(sort.Reverse(sort.IntSlice(B)))\n\t} else {\n\t\tsort.Ints(B)\n\t}\n\tpos := 0\n\t//fmt.Println(ans, A, B)\n\tfor cnt < K {\n\t\tans = ModMul(ans, int64(B[pos]))\n\t\t//fmt.Println(ans)\n\t\tcnt += 2\n\t}\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\tfmt.Println(ans)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4310, "cpu_time_ms": 159, "memory_kb": 19492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s474984305", "group_id": "codeNet:p02619", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tD := nextInt()\n\tc := nextInts(26)\n\ts := make([][]int, D)\n\tfor i := range s {\n\t\ts[i] = nextInts(26)\n\t}\n\n\tlast := [26]int{}\n\tv := 0\n\tfor d := 0; d < D; d++ {\n\t\tt := nextInt() - 1\n\t\tlast[t] = d + 1\n\n\t\tv += s[d][t]\n\t\tdec := 0\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tdec += c[i] * (d + 1 - last[i])\n\t\t}\n\t\tv -= dec\n\n\t\tputs(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593393669, "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/s474984305.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s474984305", "user_id": "u502813058"}, "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\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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tD := nextInt()\n\tc := nextInts(26)\n\ts := make([][]int, D)\n\tfor i := range s {\n\t\ts[i] = nextInts(26)\n\t}\n\n\tlast := [26]int{}\n\tv := 0\n\tfor d := 0; d < D; d++ {\n\t\tt := nextInt() - 1\n\t\tlast[t] = d + 1\n\n\t\tv += s[d][t]\n\t\tdec := 0\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tdec += c[i] * (d + 1 - last[i])\n\t\t}\n\t\tv -= dec\n\n\t\tputs(v)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 924, "cpu_time_ms": 9, "memory_kb": 2004}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s807767193", "group_id": "codeNet:p02621", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst maxBuf = 200100\n\nvar buf []byte = make([]byte, maxBuf)\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 readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\n/* #### main #### */\nfunc main() {\n\ta := readInt()\n\tfmt.Println(a + a*a + a*a*a)\n}\n", "language": "Go", "metadata": {"date": 1596376604, "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/s807767193.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s807767193", "user_id": "u533258444"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst maxBuf = 200100\n\nvar buf []byte = make([]byte, maxBuf)\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 readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\n/* #### main #### */\nfunc main() {\n\ta := readInt()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 541, "cpu_time_ms": 4, "memory_kb": 1780}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256230465", "group_id": "codeNet:p02622", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s, t string\n fmt.Scan(&s, &t)\n cnt := 0\n for 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\tdefer io.Flush()\n\tN := io.NextInt()\n\trems := []int{}\n\tfor {\n\t\tN--\n\t\tif N < 26 {\n\t\t\trems = append(rems, N)\n\t\t\tbreak\n\t\t}\n\t\tv := N % 26\n\t\tN = (N - v) / 26\n\t\trems = append(rems, v)\n\t}\n\ttable := map[int]string{\n\t\t0: \"a\",\n\t\t1: \"b\",\n\t\t2: \"c\",\n\t\t3: \"d\",\n\t\t4: \"e\",\n\t\t5: \"f\",\n\t\t6: \"g\",\n\t\t7: \"h\",\n\t\t8: \"i\",\n\t\t9: \"j\",\n\t\t10: \"k\",\n\t\t11: \"l\",\n\t\t12: \"m\",\n\t\t13: \"n\",\n\t\t14: \"o\",\n\t\t15: \"p\",\n\t\t16: \"q\",\n\t\t17: \"r\",\n\t\t18: \"s\",\n\t\t19: \"t\",\n\t\t20: \"u\",\n\t\t21: \"v\",\n\t\t22: \"w\",\n\t\t23: \"x\",\n\t\t24: \"y\",\n\t\t25: \"z\",\n\t}\n\tfmt.Println(rems)\n\tout := \"\"\n\tfor i := 0; i < len(rems); i++ {\n\t\tout += table[rems[len(rems)-i-1]]\n\t}\n\tio.PrintLn(out)\n}\n", "language": "Go", "metadata": {"date": 1593655733, "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/s299872857.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s299872857", "user_id": "u164734529"}, "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\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\tif err := io.writer.Flush(); 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\tdefer io.Flush()\n\tN := io.NextInt()\n\trems := []int{}\n\tfor {\n\t\tN--\n\t\tif N < 26 {\n\t\t\trems = append(rems, N)\n\t\t\tbreak\n\t\t}\n\t\tv := N % 26\n\t\tN = (N - v) / 26\n\t\trems = append(rems, v)\n\t}\n\ttable := map[int]string{\n\t\t0: \"a\",\n\t\t1: \"b\",\n\t\t2: \"c\",\n\t\t3: \"d\",\n\t\t4: \"e\",\n\t\t5: \"f\",\n\t\t6: \"g\",\n\t\t7: \"h\",\n\t\t8: \"i\",\n\t\t9: \"j\",\n\t\t10: \"k\",\n\t\t11: \"l\",\n\t\t12: \"m\",\n\t\t13: \"n\",\n\t\t14: \"o\",\n\t\t15: \"p\",\n\t\t16: \"q\",\n\t\t17: \"r\",\n\t\t18: \"s\",\n\t\t19: \"t\",\n\t\t20: \"u\",\n\t\t21: \"v\",\n\t\t22: \"w\",\n\t\t23: \"x\",\n\t\t24: \"y\",\n\t\t25: \"z\",\n\t}\n\tfmt.Println(rems)\n\tout := \"\"\n\tfor i := 0; i < len(rems); i++ {\n\t\tout += table[rems[len(rems)-i-1]]\n\t}\n\tio.PrintLn(out)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2359, "cpu_time_ms": 8, "memory_kb": 1784}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s459913719", "group_id": "codeNet:p02629", "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\tn := nextInt()\n\n\tr := \"\"\n\tfor n > 0 {\n\t\tw := n / 26\n\t\ta := n % 26\n\t\tif a == 0 {\n\t\t\tr = \"z\" + r\n\t\t\tw--\n\t\t} else {\n\t\t\tr = itos(a) + r\n\t\t}\n\n\t\tn = w\n\t}\n\tfmt.Println(r)\n}\n\nconst abc = \"abcdefghijklmnopqrstuvwxyz\"\n\nfunc itos(i int) string {\n\treturn abc[i-1 : i]\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": 1592790841, "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/s459913719.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s459913719", "user_id": "u137939942"}, "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\tr := \"\"\n\tfor n > 0 {\n\t\tw := n / 26\n\t\ta := n % 26\n\t\tif a == 0 {\n\t\t\tr = \"z\" + r\n\t\t\tw--\n\t\t} else {\n\t\t\tr = itos(a) + r\n\t\t}\n\n\t\tn = w\n\t}\n\tfmt.Println(r)\n}\n\nconst abc = \"abcdefghijklmnopqrstuvwxyz\"\n\nfunc itos(i int) string {\n\treturn abc[i-1 : i]\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 : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 502, "cpu_time_ms": 6, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s639513915", "group_id": "codeNet:p02630", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif i != n-1 {\n\t\t\tfmt.Scanf(\"%d\", &slice[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\", &slice[i])\n\t\t}\n\t}\n\n\tvar q, b, c int\n\tfmt.Scanf(\"%d\\n\", &q)\n\tout := make([]int, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scanf(\"%d %d\\n\", &b, &c)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif slice[j] == b {\n\t\t\t\tslice[j] = c\n\t\t\t}\n\t\t}\n\n\t\tfor _, j := range slice {\n\t\t\tout[i] += j\n\t\t}\n\n\t}\n\n\tfor _, j := range out {\n\t\tfmt.Println(j)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1598641494, "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/s639513915.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s639513915", "user_id": "u154777379"}, "prompt_components": {"gold_output": "11\n12\n16\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif i != n-1 {\n\t\t\tfmt.Scanf(\"%d\", &slice[i])\n\t\t} else {\n\t\t\tfmt.Scanf(\"%d\\n\", &slice[i])\n\t\t}\n\t}\n\n\tvar q, b, c int\n\tfmt.Scanf(\"%d\\n\", &q)\n\tout := make([]int, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scanf(\"%d %d\\n\", &b, &c)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif slice[j] == b {\n\t\t\t\tslice[j] = c\n\t\t\t}\n\t\t}\n\n\t\tfor _, j := range slice {\n\t\t\tout[i] += j\n\t\t}\n\n\t}\n\n\tfor _, j := range out {\n\t\tfmt.Println(j)\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2205, "memory_kb": 6396}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s247468314", "group_id": "codeNet:p02631", "input_text": "// 理屈はしらんけど全部のxorからA[i]のxorをとるとなんか答えがでた\n\npackage 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\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\tN := nextInt()\n\tA := nextInts64(N)\n\txor := A[0]\n\tfor i := 1; i < N; i++ {\n\t\txor = xor ^ A[i]\n\t}\n\tfor _, a := range A {\n\t\tfmt.Fprintf(out, \"%d \", xor^a)\n\t}\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 nextInts64(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = int64(nextInt())\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1592833592, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02631.html", "problem_id": "p02631", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02631/input.txt", "sample_output_relpath": "derived/input_output/data/p02631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02631/Go/s247468314.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s247468314", "user_id": "u445624660"}, "prompt_components": {"gold_output": "26 5 7 22\n", "input_to_evaluate": "// 理屈はしらんけど全部のxorからA[i]のxorをとるとなんか答えがでた\n\npackage 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\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\tN := nextInt()\n\tA := nextInts64(N)\n\txor := A[0]\n\tfor i := 1; i < N; i++ {\n\t\txor = xor ^ A[i]\n\t}\n\tfor _, a := range A {\n\t\tfmt.Fprintf(out, \"%d \", xor^a)\n\t}\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 nextInts64(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = int64(nextInt())\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N Snuke Cats numbered 1, 2, \\ldots, N, where N is even.\n\nEach Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.\n\nRecently, they learned the operation called xor (exclusive OR).\n\nWhat is xor?\n\nFor n non-negative integers x_1, x_2, \\ldots, x_n, their xor, x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is defined as follows:\n\nWhen x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~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~\\textrm{xor}~5 = 6.\n\nThey wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.\n\nWe know that the xor calculated by Snuke Cat i, that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i.\nUsing this information, restore the integer written on the scarf of each Snuke Cat.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n0 \\leq a_i \\leq 10^9\n\nThere exists a combination of integers on the scarfs that is consistent with the given information.\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 line containing N integers separated with space.\n\nThe i-th of the integers from the left should represent the integer written on the scarf of Snuke Cat i.\n\nIf there are multiple possible solutions, you may print any of them.\n\nSample Input 1\n\n4\n20 11 9 24\n\nSample Output 1\n\n26 5 7 22\n\n5~\\textrm{xor}~7~\\textrm{xor}~22 = 20\n\n26~\\textrm{xor}~7~\\textrm{xor}~22 = 11\n\n26~\\textrm{xor}~5~\\textrm{xor}~22 = 9\n\n26~\\textrm{xor}~5~\\textrm{xor}~7 = 24\n\nThus, this output is consistent with the given information.", "sample_input": "4\n20 11 9 24\n"}, "reference_outputs": ["26 5 7 22\n"], "source_document_id": "p02631", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N Snuke Cats numbered 1, 2, \\ldots, N, where N is even.\n\nEach Snuke Cat wears a red scarf, on which his favorite non-negative integer is written.\n\nRecently, they learned the operation called xor (exclusive OR).\n\nWhat is xor?\n\nFor n non-negative integers x_1, x_2, \\ldots, x_n, their xor, x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~x_n is defined as follows:\n\nWhen x_1~\\textrm{xor}~x_2~\\textrm{xor}~\\ldots~\\textrm{xor}~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~\\textrm{xor}~5 = 6.\n\nThey wanted to use this operation quickly, so each of them calculated the xor of the integers written on their scarfs except his scarf.\n\nWe know that the xor calculated by Snuke Cat i, that is, the xor of the integers written on the scarfs except the scarf of Snuke Cat i is a_i.\nUsing this information, restore the integer written on the scarf of each Snuke Cat.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 200000\n\nN is even.\n\n0 \\leq a_i \\leq 10^9\n\nThere exists a combination of integers on the scarfs that is consistent with the given information.\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 line containing N integers separated with space.\n\nThe i-th of the integers from the left should represent the integer written on the scarf of Snuke Cat i.\n\nIf there are multiple possible solutions, you may print any of them.\n\nSample Input 1\n\n4\n20 11 9 24\n\nSample Output 1\n\n26 5 7 22\n\n5~\\textrm{xor}~7~\\textrm{xor}~22 = 20\n\n26~\\textrm{xor}~7~\\textrm{xor}~22 = 11\n\n26~\\textrm{xor}~5~\\textrm{xor}~22 = 9\n\n26~\\textrm{xor}~5~\\textrm{xor}~7 = 24\n\nThus, this output is consistent with the given information.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 763, "cpu_time_ms": 65, "memory_kb": 8216}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s297515868", "group_id": "codeNet:p02640", "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\ta, b := nextInt(), nextInt()\n\tc := 4*a -b\n\tif c != 0 && c%2 == 0 && c/2 > a {\n\t\tfmt.Fprintln(out, \"No\")\n\t}else{\n\t\tfmt.Fprintln(out, \"Yes\")\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\n// PrintOut with util device\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": 1594253743, "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/s297515868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s297515868", "user_id": "u311326816"}, "prompt_components": {"gold_output": "Yes\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\ta, b := nextInt(), nextInt()\n\tc := 4*a -b\n\tif c != 0 && c%2 == 0 && c/2 > a {\n\t\tfmt.Fprintln(out, \"No\")\n\t}else{\n\t\tfmt.Fprintln(out, \"Yes\")\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\n// PrintOut with util device\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 : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1662, "cpu_time_ms": 9, "memory_kb": 1808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s607692572", "group_id": "codeNet:p02640", "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\n// 1行読み込み\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 読み込みをint型へキャスト\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif(err != nil) {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\n// 読み込みをfloat型へキャスト\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tnum, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc main() {\n\t// scannerの挙動を改行区切り → 空白区切りに変更\n\tsc.Split(bufio.ScanWords)\n\tx := nextInt()\n\ty := nextInt()\n\n\t// 余り\n\tmod_4 := y % 4\n\t// 2本の動物の数\n\tnum_2 := mod_4 / 2\n\tnum_4 := y / 4\n\tif num_2 + num_4 == x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfor n := num_4 * 4 - 4; n > 0; n = n - 4 {\n\t\t\tnum_4 = num_4 - 1\n\t\t\tnum_2 = num_2 + 2\n\t\t\tif num_2 + num_4 == x {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t} else if num_4 < 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1592185087, "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/s607692572.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s607692572", "user_id": "u966880389"}, "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\n// 1行読み込み\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 読み込みをint型へキャスト\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif(err != nil) {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\n// 読み込みをfloat型へキャスト\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tnum, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc main() {\n\t// scannerの挙動を改行区切り → 空白区切りに変更\n\tsc.Split(bufio.ScanWords)\n\tx := nextInt()\n\ty := nextInt()\n\n\t// 余り\n\tmod_4 := y % 4\n\t// 2本の動物の数\n\tnum_2 := mod_4 / 2\n\tnum_4 := y / 4\n\tif num_2 + num_4 == x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfor n := num_4 * 4 - 4; n > 0; n = n - 4 {\n\t\t\tnum_4 = num_4 - 1\n\t\t\tnum_2 = num_2 + 2\n\t\t\tif num_2 + num_4 == x {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t} else if num_4 < 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1030, "cpu_time_ms": 7, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444351782", "group_id": "codeNet:p02641", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tx, n := readI(), readI()\n\tp := readIs(n)\n\tdis := 100\n\tans := 0\n\tfor i := 0; i <= 101; i++ {\n\t\tif isThere(p, i) {\n\t\t\tcontinue\n\t\t}\n\t\tif abs(i-x) < dis {\n\t\t\tdis = abs(i - x)\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc isThere(a []int, b int) bool {\n\tfor _, v := range a {\n\t\tif v == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "language": "Go", "metadata": {"date": 1596916858, "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/s444351782.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444351782", "user_id": "u533258444"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tx, n := readI(), readI()\n\tp := readIs(n)\n\tdis := 100\n\tans := 0\n\tfor i := 0; i <= 101; i++ {\n\t\tif isThere(p, i) {\n\t\t\tcontinue\n\t\t}\n\t\tif abs(i-x) < dis {\n\t\t\tdis = abs(i - x)\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc isThere(a []int, b int) bool {\n\tfor _, v := range a {\n\t\tif v == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s732060310", "group_id": "codeNet:p02641", "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\tX, N := readInt(), readInt()\n\tp := make([]int64, 102)\n\tfor i := int64(0); i < N; i++ {\n\t\tp[readInt()]++\n\t}\n\tvar ans int64 = INF\n\tvar mins int64 = INF\n\tfor i := int64(0); i <= 101; i++ {\n\t\tif p[i] == 0 {\n\t\t\tif abs(i-X) < ans {\n\t\t\t\tmins = i\n\t\t\t\tans = abs(i - X)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(mins)\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": 1595527997, "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/s732060310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s732060310", "user_id": "u967669872"}, "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\"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\tX, N := readInt(), readInt()\n\tp := make([]int64, 102)\n\tfor i := int64(0); i < N; i++ {\n\t\tp[readInt()]++\n\t}\n\tvar ans int64 = INF\n\tvar mins int64 = INF\n\tfor i := int64(0); i <= 101; i++ {\n\t\tif p[i] == 0 {\n\t\t\tif abs(i-X) < ans {\n\t\t\t\tmins = i\n\t\t\t\tans = abs(i - X)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(mins)\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\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5855, "cpu_time_ms": 8, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s650721272", "group_id": "codeNet:p02641", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn x * (-1)\n\t}\n\treturn x\n}\nfunc main() {\n\tvar x, n, t int\n\tfmt.Scan(&x, &n)\n\tif n == 0 {\n\t\tfmt.Println(x)\n\t\tos.Exit(0)\n\t}\n\tmp := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&t)\n\t\tmp[t] = 1\n\t}\n\tres := 101\n\tan := 0\n\tfor i := 1; i < 102; i++ {\n\t\tif abs(int(x-i)) < res && mp[i] == 0 {\n\t\t\tan = i\n\t\t\tres = x - i\n\t\t}\n\t}\n\tfmt.Println(an)\n}\n", "language": "Go", "metadata": {"date": 1593668731, "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/s650721272.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s650721272", "user_id": "u515638999"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn x * (-1)\n\t}\n\treturn x\n}\nfunc main() {\n\tvar x, n, t int\n\tfmt.Scan(&x, &n)\n\tif n == 0 {\n\t\tfmt.Println(x)\n\t\tos.Exit(0)\n\t}\n\tmp := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&t)\n\t\tmp[t] = 1\n\t}\n\tres := 101\n\tan := 0\n\tfor i := 1; i < 102; i++ {\n\t\tif abs(int(x-i)) < res && mp[i] == 0 {\n\t\t\tan = i\n\t\t\tres = x - i\n\t\t}\n\t}\n\tfmt.Println(an)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1860}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s680826063", "group_id": "codeNet:p02641", "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\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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tx, _ := strconv.Atoi(input())\n\tn, _ := strconv.Atoi(input())\n\tp := map[int]bool{}\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.Atoi(input())\n\t\tp[v] = true\n\t}\n\tans := 0\n\tdiff := x\n\tfor i := 1; i <= 101; i++ {\n\t\tif !p[i] {\n\t\t\ttmp := abs(x - i)\n\t\t\tif tmp < diff {\n\t\t\t\tans = i\n\t\t\t\tdiff = tmp\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592780458, "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/s680826063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s680826063", "user_id": "u029315034"}, "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 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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tx, _ := strconv.Atoi(input())\n\tn, _ := strconv.Atoi(input())\n\tp := map[int]bool{}\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.Atoi(input())\n\t\tp[v] = true\n\t}\n\tans := 0\n\tdiff := x\n\tfor i := 1; i <= 101; i++ {\n\t\tif !p[i] {\n\t\t\ttmp := abs(x - i)\n\t\t\tif tmp < diff {\n\t\t\t\tans = i\n\t\t\t\tdiff = tmp\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269567808", "group_id": "codeNet:p02641", "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.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist1 := getStdinIntArr()\n\tp := getStdinIntArr()\n\tX := list1[0]\n\tN := list1[1]\n\n\tsort.Ints(p)\n\n\tfind := true\n\tindex := 0\n\tfor idx, val := range p {\n\t\tif val == X {\n\t\t\tfind = false\n\t\t\tindex = idx\n\t\t\tbreak\n\t\t}\n\t}\n\tif find {\n\t\tfmt.Printf(\"%d\\n\", X)\n\t\treturn\n\t}\n\n\tprev := 0\n\tmin1 := -math.MaxInt16\n\tmin2 := math.MaxInt16\n\n\tprev = p[index]\n\tfind = false\n\tfor i := index - 1; i >= 0; i-- {\n\t\tif prev-1 != p[i] {\n\t\t\tmin1 = prev - 1\n\t\t\tfind = true\n\t\t\tbreak\n\t\t}\n\t\tprev = p[i]\n\t}\n\tif !find {\n\t\tmin1 = p[0] - 1\n\t}\n\n\tprev = p[index]\n\tfind = false\n\tfor i := index + 1; i < N; i++ {\n\t\tif prev+1 != p[i] {\n\t\t\tmin2 = prev + 1\n\t\t\tfind = true\n\t\t\tbreak\n\t\t}\n\t\tprev = p[i]\n\t}\n\tif !find {\n\t\tmin2 = p[N-1] + 1\n\t}\n\n\tif min1 == -math.MinInt16 {\n\t\tfmt.Printf(\"%d\\n\", min2)\n\t\treturn\n\t}\n\tif min2 == math.MinInt16 {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t\treturn\n\t}\n\n\tmin1abs := X - min1\n\tmin2abs := min2 - X\n\tif min1 < 0 {\n\t\tmin1abs = -min1\n\t}\n\tif min2 < 0 {\n\t\tmin2abs = -min2\n\t}\n\n\tif min1abs == min2abs {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t} else if min1abs < min2abs {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", min2)\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 getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\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": 1592185871, "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/s269567808.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s269567808", "user_id": "u149861487"}, "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\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist1 := getStdinIntArr()\n\tp := getStdinIntArr()\n\tX := list1[0]\n\tN := list1[1]\n\n\tsort.Ints(p)\n\n\tfind := true\n\tindex := 0\n\tfor idx, val := range p {\n\t\tif val == X {\n\t\t\tfind = false\n\t\t\tindex = idx\n\t\t\tbreak\n\t\t}\n\t}\n\tif find {\n\t\tfmt.Printf(\"%d\\n\", X)\n\t\treturn\n\t}\n\n\tprev := 0\n\tmin1 := -math.MaxInt16\n\tmin2 := math.MaxInt16\n\n\tprev = p[index]\n\tfind = false\n\tfor i := index - 1; i >= 0; i-- {\n\t\tif prev-1 != p[i] {\n\t\t\tmin1 = prev - 1\n\t\t\tfind = true\n\t\t\tbreak\n\t\t}\n\t\tprev = p[i]\n\t}\n\tif !find {\n\t\tmin1 = p[0] - 1\n\t}\n\n\tprev = p[index]\n\tfind = false\n\tfor i := index + 1; i < N; i++ {\n\t\tif prev+1 != p[i] {\n\t\t\tmin2 = prev + 1\n\t\t\tfind = true\n\t\t\tbreak\n\t\t}\n\t\tprev = p[i]\n\t}\n\tif !find {\n\t\tmin2 = p[N-1] + 1\n\t}\n\n\tif min1 == -math.MinInt16 {\n\t\tfmt.Printf(\"%d\\n\", min2)\n\t\treturn\n\t}\n\tif min2 == math.MinInt16 {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t\treturn\n\t}\n\n\tmin1abs := X - min1\n\tmin2abs := min2 - X\n\tif min1 < 0 {\n\t\tmin1abs = -min1\n\t}\n\tif min2 < 0 {\n\t\tmin2abs = -min2\n\t}\n\n\tif min1abs == min2abs {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t} else if min1abs < min2abs {\n\t\tfmt.Printf(\"%d\\n\", min1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", min2)\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 getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\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 : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2081, "cpu_time_ms": 3, "memory_kb": 2168}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s537045878", "group_id": "codeNet:p02641", "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 X, N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tX, N = nextInt(), nextInt()\n\tif N == 0 {\n\t\tfmt.Println(X)\n\t\treturn\n\t}\n\n\tP := make([]int, 101)\n\tfor i := 0; i < N; i++ {\n\t\tp := nextInt()\n\t\tP[p] = 1\n\t}\n\n\tif P[X] != 1 {\n\t\tfmt.Println(X)\n\t\treturn\n\t}\n\n\tvar ans int\n\tfor i := 1; i <= 100; i++ {\n\t\tl := X - i\n\t\tr := X + i\n\t\tif P[l] != 1 && l <= 100 && l >= 1 {\n\t\t\tans = l\n\t\t\tbreak\n\t\t} else if P[r] != 1 && r <= 100 && r >= 1 {\n\t\t\tans = r\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1592184281, "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/s537045878.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s537045878", "user_id": "u432333240"}, "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\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 X, N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tX, N = nextInt(), nextInt()\n\tif N == 0 {\n\t\tfmt.Println(X)\n\t\treturn\n\t}\n\n\tP := make([]int, 101)\n\tfor i := 0; i < N; i++ {\n\t\tp := nextInt()\n\t\tP[p] = 1\n\t}\n\n\tif P[X] != 1 {\n\t\tfmt.Println(X)\n\t\treturn\n\t}\n\n\tvar ans int\n\tfor i := 1; i <= 100; i++ {\n\t\tl := X - i\n\t\tr := X + i\n\t\tif P[l] != 1 && l <= 100 && l >= 1 {\n\t\t\tans = l\n\t\t\tbreak\n\t\t} else if P[r] != 1 && r <= 100 && r >= 1 {\n\t\t\tans = r\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2656, "cpu_time_ms": 5, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s150057468", "group_id": "codeNet:p02645", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := scan()\n\tfmt.Println(S[0:3])\n}\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scan () string{\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1592096529, "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/s150057468.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s150057468", "user_id": "u184577857"}, "prompt_components": {"gold_output": "tak\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := scan()\n\tfmt.Println(S[0:3])\n}\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scan () string{\n\tsc.Scan()\n\treturn sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s247405035", "group_id": "codeNet:p02646", "input_text": "package main\nimport \"fmt\"\n\nfunc main(){\n var az, ah, bz, bh, t, k, h int64\n \n fmt.Scanf(\"%d %d\", &az, &ah)\n fmt.Scanf(\"%d %d\", &bz, &bh)\n fmt.Scanf(\"%d\", &t)\n if ah <= bh{\n fmt.Println(\"NO\")\n return\n }\n \n if az > bz{\n k = az - bz\n } else {\n k = bz - az\n }\n \n h = ah - bh \n \n if float64(t) >= float64(k)/float64(h){\n fmt.Println(\"YES\")\n return\n }else{\n fmt.Println(\"NO\")\n return\n }\n}", "language": "Go", "metadata": {"date": 1592103103, "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/s247405035.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s247405035", "user_id": "u074996057"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main(){\n var az, ah, bz, bh, t, k, h int64\n \n fmt.Scanf(\"%d %d\", &az, &ah)\n fmt.Scanf(\"%d %d\", &bz, &bh)\n fmt.Scanf(\"%d\", &t)\n if ah <= bh{\n fmt.Println(\"NO\")\n return\n }\n \n if az > bz{\n k = az - bz\n } else {\n k = bz - az\n }\n \n h = ah - bh \n \n if float64(t) >= float64(k)/float64(h){\n fmt.Println(\"YES\")\n return\n }else{\n fmt.Println(\"NO\")\n return\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1820}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s401256553", "group_id": "codeNet:p02646", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a,v,b,w,t int64\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&v)\n\tfmt.Scan(&b)\n\tfmt.Scan(&w)\n\tfmt.Scan(&t)\n\tdist := a - b\n\tif dist < 0 {\n\t\tdist *= -1\n\t}\n\t// 最初から追いついていたら速度関係なし\n\tif (dist == 0) {\n\t\tfmt.Print(\"YES\")\n\t}\n\tvec := v - w\n\t// 逃げる速さの方が早いなら追いつけない\n\tif vec <= 0 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\tif vec * t >= dist {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1592101867, "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/s401256553.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s401256553", "user_id": "u344655022"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a,v,b,w,t int64\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&v)\n\tfmt.Scan(&b)\n\tfmt.Scan(&w)\n\tfmt.Scan(&t)\n\tdist := a - b\n\tif dist < 0 {\n\t\tdist *= -1\n\t}\n\t// 最初から追いついていたら速度関係なし\n\tif (dist == 0) {\n\t\tfmt.Print(\"YES\")\n\t}\n\tvec := v - w\n\t// 逃げる速さの方が早いなら追いつけない\n\tif vec <= 0 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\tif vec * t >= dist {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 470, "cpu_time_ms": 2, "memory_kb": 1816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178265258", "group_id": "codeNet:p02646", "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 = 1e10\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 nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\ta, v := nextInt(), nextInt()\n\tb, w := nextInt(), nextInt()\n\tt := nextInt()\n\n\tdba := abs(b-a)\n\tdvw := abs(v - w)\n\tif dvw <= 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tresT := dba / dvw\n\tif resT > t && resT < 0{\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif a + v*resT == b + w*resT {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc intSlicePrint(el ...int) {\n\tfirst := true\n\tfor _, v := range el {\n\t\tif v < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif !first {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t\tfirst = false\n\t}\n\tfmt.Println(\"\")\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\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1592100196, "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/s178265258.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s178265258", "user_id": "u186893542"}, "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 = 1e4\n\tmaxBufSize = 1e10\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 nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\ta, v := nextInt(), nextInt()\n\tb, w := nextInt(), nextInt()\n\tt := nextInt()\n\n\tdba := abs(b-a)\n\tdvw := abs(v - w)\n\tif dvw <= 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tresT := dba / dvw\n\tif resT > t && resT < 0{\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif a + v*resT == b + w*resT {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc intSlicePrint(el ...int) {\n\tfirst := true\n\tfor _, v := range el {\n\t\tif v < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif !first {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t\tfirst = false\n\t}\n\tfmt.Println(\"\")\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\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1256, "cpu_time_ms": 8, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s207281720", "group_id": "codeNet:p02647", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst BUFSIZE = 10000000\n\nvar rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\nvar ANext [200001]int\nvar NFlag [200001]bool\nvar NCount int\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := NextLineInt()\n\n\tfor k := 0; k < K; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tANext[i] = 0\n\t\t}\n\n\t\tfor x, a := range A {\n\t\t\tANext[Max(0, x-a)] += 1\n\t\t\tANext[Min(N, x+a+1)] -= 1\n\t\t}\n\n\t\tfor i := 0; i < N; i++ {\n\t\t\tANext[i+1] += ANext[i]\n\t\t\tA[i] = ANext[i]\n\t\t\tif A[i] == N && !NFlag[i] {\n\t\t\t\tNFlag[i] = true\n\t\t\t\tNCount += 1\n\t\t\t}\n\t\t}\n\n\t\tif NCount == N {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor _, a := range A {\n\t\tfmt.Printf(\"%d \", a)\n\t}\n}\n\nfunc NextLineInt() []int {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\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([]int, l)\n\n\tfor i := range str {\n\t\t// ret[i], ok = strconv.Atoi(str[i])\n\t\tv, ok := strconv.Atoi(str[i])\n\n\t\tif ok == nil {\n\t\t\tret[i] = int(v)\n\t\t}\n\t}\n\n\treturn ret\n}\n\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": 1592118325, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Go/s207281720.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s207281720", "user_id": "u811202694"}, "prompt_components": {"gold_output": "1 2 2 1 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\nconst BUFSIZE = 10000000\n\nvar rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\nvar ANext [200001]int\nvar NFlag [200001]bool\nvar NCount int\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := NextLineInt()\n\n\tfor k := 0; k < K; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tANext[i] = 0\n\t\t}\n\n\t\tfor x, a := range A {\n\t\t\tANext[Max(0, x-a)] += 1\n\t\t\tANext[Min(N, x+a+1)] -= 1\n\t\t}\n\n\t\tfor i := 0; i < N; i++ {\n\t\t\tANext[i+1] += ANext[i]\n\t\t\tA[i] = ANext[i]\n\t\t\tif A[i] == N && !NFlag[i] {\n\t\t\t\tNFlag[i] = true\n\t\t\t\tNCount += 1\n\t\t\t}\n\t\t}\n\n\t\tif NCount == N {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor _, a := range A {\n\t\tfmt.Printf(\"%d \", a)\n\t}\n}\n\nfunc NextLineInt() []int {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\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([]int, l)\n\n\tfor i := range str {\n\t\t// ret[i], ok = strconv.Atoi(str[i])\n\t\tv, ok := strconv.Atoi(str[i])\n\n\t\tif ok == nil {\n\t\t\tret[i] = int(v)\n\t\t}\n\t}\n\n\treturn ret\n}\n\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 : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1431, "cpu_time_ms": 369, "memory_kb": 15172}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s156138132", "group_id": "codeNet:p02647", "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 N int\n\nfunc phasecheck(a []int) int {\n\tphase := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif phase == 0 {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\tphase = 1\n\t\t\t}\n\t\t} else if phase == 1 {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\tphase = 2\n\t\t\t\treturn phase\n\t\t\t}\n\t\t}\n\t}\n\treturn phase\n}\n\nfunc phasecheck2(a []int) int {\n\tphase := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif phase == 0 {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\tphase = 1\n\t\t\t}\n\t\t} else if phase == 1 {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\tphase = 2\n\t\t\t\treturn phase\n\t\t\t}\n\t\t}\n\t}\n\treturn phase\n}\n\n// func operation(a int[]) {\nfunc operation(a []int) int {\n\tvar B [200000]int\n\tall := 0\n\t// allflag := 0\n\t// allstart := 0\n\t// allend := 0\n\tfor i := 0; i < N; i++ {\n\t\t// if i == allstart {\n\t\t// \tall += allend - allstart + 1\n\t\t// \ti = all\n\t\t// }\n\n\t\tif (a[i] == N) || ((i + a[i] >= N-1) && (i - a[i] <= 0)) {\n\t\t\tall++\n\t\t\t// if allflag == 0 {\n\t\t\t// \tallflag = 1\n\t\t\t// \tallstart = i\n\t\t\t// }\n\t\t} else {\n\t\t\t// if allflag == 1 {\n\t\t\t// \tallflag = 2\n\t\t\t// \tallend = i-1\n\t\t\t// }\n\n\t\t\tstart := intMax(i - a[i], 0)\n\t\t\tend := intMin(i + a[i], N-1)\n\t\t\tfor j := start; j <= end ; j++ {\n\t\t\t\tB[j]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = B[i] + all\n\t}\n\tif all == N {\n\t\treturn 3\n\t}\n\treturn phasecheck(a)\n}\n\nfunc operation2(a []int) int {\n\tvar B [200000]int\n\t\n\tall := 0\n\tfor i := 0; i < N; i++ {\n\t\tstart := intMax(i - a[i], 0)\n\t\tend := intMin(i + a[i], N-1)\n\t\t// for j := start; j <= end ; j++ {\n\t\t// \tB[j]++\n\t\t// }\n\t\tB[start]++\n\t\tif (end + 1 < N) {\n\t\t\tB[end + 1]--\n\t\t}\n\t}\n\tfor i := 1; i < N; i++ {\n\t\tB[i] += B[i-1]\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = B[i]\n\t}\n\tif all == N {\n\t\treturn 3\n\t}\n\treturn phasecheck(a)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN = io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\n\n\t// poor solution 1\n\tfor i := 0 ; i < K; i++ {\n\t\t// ret := operation(A[0:N])\n\t\tret := operation2(A[0:N])\n\t\tif N > 100 {\n\t\t\tLogf(\"%d %v ...\", ret, A[0:10])\n\t\t\tLogf(\"%v ...\", A[N/2-5:N/2+5])\n\t\t\tLogf(\"%v\\n\", A[N-10:N])\n\t\t} else {\n\t\t\tLogf(\"A %v %03v\\n\", ret, A[0:N])\n\t\t}\n\n\t\tif ret == 3 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0 ; i < N; i++ {\n\t\tio.Printf(\"%v \", A[i])\n\t}\n\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\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 flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\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 parse next word as string.\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 parse next word as Int.\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// NextFloat parses next word as float64.\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\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\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\n// PrintStringLn prints string array in a single line.\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// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\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\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "language": "Go", "metadata": {"date": 1592104562, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Go/s156138132.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s156138132", "user_id": "u678848631"}, "prompt_components": {"gold_output": "1 2 2 1 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)\n\nvar N int\n\nfunc phasecheck(a []int) int {\n\tphase := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif phase == 0 {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\tphase = 1\n\t\t\t}\n\t\t} else if phase == 1 {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\tphase = 2\n\t\t\t\treturn phase\n\t\t\t}\n\t\t}\n\t}\n\treturn phase\n}\n\nfunc phasecheck2(a []int) int {\n\tphase := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif phase == 0 {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\tphase = 1\n\t\t\t}\n\t\t} else if phase == 1 {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\tphase = 2\n\t\t\t\treturn phase\n\t\t\t}\n\t\t}\n\t}\n\treturn phase\n}\n\n// func operation(a int[]) {\nfunc operation(a []int) int {\n\tvar B [200000]int\n\tall := 0\n\t// allflag := 0\n\t// allstart := 0\n\t// allend := 0\n\tfor i := 0; i < N; i++ {\n\t\t// if i == allstart {\n\t\t// \tall += allend - allstart + 1\n\t\t// \ti = all\n\t\t// }\n\n\t\tif (a[i] == N) || ((i + a[i] >= N-1) && (i - a[i] <= 0)) {\n\t\t\tall++\n\t\t\t// if allflag == 0 {\n\t\t\t// \tallflag = 1\n\t\t\t// \tallstart = i\n\t\t\t// }\n\t\t} else {\n\t\t\t// if allflag == 1 {\n\t\t\t// \tallflag = 2\n\t\t\t// \tallend = i-1\n\t\t\t// }\n\n\t\t\tstart := intMax(i - a[i], 0)\n\t\t\tend := intMin(i + a[i], N-1)\n\t\t\tfor j := start; j <= end ; j++ {\n\t\t\t\tB[j]++\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = B[i] + all\n\t}\n\tif all == N {\n\t\treturn 3\n\t}\n\treturn phasecheck(a)\n}\n\nfunc operation2(a []int) int {\n\tvar B [200000]int\n\t\n\tall := 0\n\tfor i := 0; i < N; i++ {\n\t\tstart := intMax(i - a[i], 0)\n\t\tend := intMin(i + a[i], N-1)\n\t\t// for j := start; j <= end ; j++ {\n\t\t// \tB[j]++\n\t\t// }\n\t\tB[start]++\n\t\tif (end + 1 < N) {\n\t\t\tB[end + 1]--\n\t\t}\n\t}\n\tfor i := 1; i < N; i++ {\n\t\tB[i] += B[i-1]\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = B[i]\n\t}\n\tif all == N {\n\t\treturn 3\n\t}\n\treturn phasecheck(a)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN = io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\n\n\t// poor solution 1\n\tfor i := 0 ; i < K; i++ {\n\t\t// ret := operation(A[0:N])\n\t\tret := operation2(A[0:N])\n\t\tif N > 100 {\n\t\t\tLogf(\"%d %v ...\", ret, A[0:10])\n\t\t\tLogf(\"%v ...\", A[N/2-5:N/2+5])\n\t\t\tLogf(\"%v\\n\", A[N-10:N])\n\t\t} else {\n\t\t\tLogf(\"A %v %03v\\n\", ret, A[0:N])\n\t\t}\n\n\t\tif ret == 3 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0 ; i < N; i++ {\n\t\tio.Printf(\"%v \", A[i])\n\t}\n\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\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 flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\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 parse next word as string.\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 parse next word as Int.\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// NextFloat parses next word as float64.\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\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\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\n// PrintStringLn prints string array in a single line.\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// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\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\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9658, "cpu_time_ms": 2206, "memory_kb": 14368}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s586619354", "group_id": "codeNet:p02647", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &k)\n\n\tpows := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &pows[i])\n\t}\n\n\tfor l := 0; l < k; l++ {\n\t\tcovered := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := -pows[i]; j <= pows[i]; j++ {\n\t\t\t\tif i+j < 0 || i+j > n-1 {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tcovered[i+j]++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tpows[i] = covered[i]\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%d \", pows[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592100920, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Go/s586619354.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s586619354", "user_id": "u118800604"}, "prompt_components": {"gold_output": "1 2 2 1 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &k)\n\n\tpows := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &pows[i])\n\t}\n\n\tfor l := 0; l < k; l++ {\n\t\tcovered := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := -pows[i]; j <= pows[i]; j++ {\n\t\t\t\tif i+j < 0 || i+j > n-1 {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tcovered[i+j]++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tpows[i] = covered[i]\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%d \", pows[i])\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 516, "cpu_time_ms": 2206, "memory_kb": 11172}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s869526547", "group_id": "codeNet:p02647", "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.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tn, k := nextInt(), nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tfor t := 0; t < k; t++ {\n\t\tb := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := max(0, i-a[i]); j < min(n, i+a[i]+1); j++ {\n\t\t\t\tb[j]++\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < n; i++ {\n\t\t\ta[i] = b[i]\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print(a[i])\n\t\tfmt.Print(\" \")\n\t}\n\tfmt.Println(\"\")\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 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\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": 1592097913, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/Go/s869526547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s869526547", "user_id": "u532762536"}, "prompt_components": {"gold_output": "1 2 2 1 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)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tn, k := nextInt(), nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tfor t := 0; t < k; t++ {\n\t\tb := make([]int, n)\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := max(0, i-a[i]); j < min(n, i+a[i]+1); j++ {\n\t\t\t\tb[j]++\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < n; i++ {\n\t\t\ta[i] = b[i]\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print(a[i])\n\t\tfmt.Print(\" \")\n\t}\n\tfmt.Println(\"\")\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 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\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 : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2463, "cpu_time_ms": 2206, "memory_kb": 8476}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927070931", "group_id": "codeNet:p02648", "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\t\"flag\"\n\t\"runtime/pprof\"\n)\n\nvar cpuprofile = flag.String(\"cpuprofile\", \"\", \"write cpu profile to file\")\n\nvar dp [][]int\nvar V [1<<18]int\nvar W [1<<18]int\nvar v [100000]int\nvar L [100000]int\n\nfunc depth(n int) int {\n\theight := 0\n\tfor i := n; i > 0; i = i/2 {\n\t\theight++\n\t\tif i == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn height\n}\n\n// n is the index of array, so it's real index - 1.\nfunc parent(n int) int {\n\treturn (n+1) / 2 - 1\n}\n\nvar DPN int\n\nfunc zentansaku(n, l int) int {\n\ttmp := []int{}\n\tkpoint := 0\n\n\ti := n\n\tfor {\n\t\tif i < DPN {\n\t\t\tkpoint = i\n\t\t\tbreak\n\t\t}\n\t\ttmp = append(tmp, i)\n\t\ti = parent(i)\n\t}\n\n\t// Logf(\"%v, kp %v\\n\", 1 << len(tmp), kpoint)\n\tsize := len(tmp)\n\tset := 1 << size\n\tmaxvalue := 0\n\tfor i := 0; i < set; i++ {\n\t\tvalue := 0\n\t\tweight := 0\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif (i >> j) % 2 > 0 { // take\n\t\t\t\tvalue += V[tmp[j]]\n\t\t\t\tweight += W[tmp[j]]\n\t\t\t\tif weight > l {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif weight <= l {\n\t\t\tmaxvalue = intMax(maxvalue, value + dp[kpoint][l-weight])\n\t\t}\n\t}\n\n\treturn maxvalue\n}\n\nfunc main() {\n\tflag.Parse()\n\tif *cpuprofile != \"\" {\n\t\tf, err := os.Create(*cpuprofile)\n\t\tif err != nil {\n\t\t\tLogf(\"%v\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tpprof.StartCPUProfile(f)\n\t\tdefer pprof.StopCPUProfile()\n\t}\n\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tDPN = 1024\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tfor i := 0 ; i < N; i++ {\n\t\tV[i] = io.NextInt()\n\t\tW[i] = io.NextInt()\n\t}\n\tQ := io.NextInt()\n\tmaxL := 0\n\tfor i := 0 ; i < Q; i++ {\n\t\tv[i] = io.NextInt()\n\t\tL[i] = io.NextInt()\n\t\tmaxL = intMax(maxL, L[i])\n\t}\n\n\tdpmax := intMin(DPN, N)\n\tdp = make([][]int, dpmax)\n\tfor i := 0; i < dpmax; i++ {\n\t\tdp[i] = make([]int, maxL + 1)\n\t}\n\n\t// Logf(\"%v\\n\", N)\n\t// Logf(\"%v\\n\", Q)\n\t// Logf(\"V %v\\n\", V[0:20])\n\t// Logf(\"W %v\\n\", W[0:20])\n\t// Logf(\"v %v\\n\", v[0:20])\n\t// Logf(\"L %v\\n\", L[0:20])\n\t// Logf(\"maxL %v\\n\", maxL)\n\t// Logf(\"%v %v\\n\", depth(7), depth(8))\n\t// Logf(\"%v %v\\n\", parent(7), parent(8))\n\n\tfor j := 0; j < maxL+1; j++ {\n\t\tif W[0] <= j {\n\t\t\tdp[0][j] = V[0]\n\t\t}\n\t}\n\t// Logf(\"%v\\n\", dp[0][0:maxL])\n\n\tfor i := 1; i < dpmax; i++ {\n\t\tfor j := 0; j < maxL+1; j++ {\n\t\t\tif j >= W[i] {\n\t\t\t\tdp[i][j] = intMax(dp[parent(i)][j], dp[parent(i)][j-W[i]] + V[i])\n\t\t\t} else {\n\t\t\t\tdp[i][j] = dp[parent(i)][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tif v[i] <= DPN {\n\t\t\tfmt.Printf(\"%v\\n\", dp[v[i]-1][L[i]])\n\t\t} else {\n\t\t\t// 全探索\n\t\t\tfmt.Printf(\"%v\\n\", zentansaku(v[i]-1, L[i]))\n\t\t}\n\t}\n\n\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\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 flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\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 parse next word as string.\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 parse next word as Int.\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// NextFloat parses next word as float64.\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\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\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\n// PrintStringLn prints string array in a single line.\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// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\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\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "language": "Go", "metadata": {"date": 1592153377, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02648.html", "problem_id": "p02648", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02648/input.txt", "sample_output_relpath": "derived/input_output/data/p02648/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02648/Go/s927070931.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s927070931", "user_id": "u678848631"}, "prompt_components": {"gold_output": "0\n3\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\t\"strings\"\n\n\t\"flag\"\n\t\"runtime/pprof\"\n)\n\nvar cpuprofile = flag.String(\"cpuprofile\", \"\", \"write cpu profile to file\")\n\nvar dp [][]int\nvar V [1<<18]int\nvar W [1<<18]int\nvar v [100000]int\nvar L [100000]int\n\nfunc depth(n int) int {\n\theight := 0\n\tfor i := n; i > 0; i = i/2 {\n\t\theight++\n\t\tif i == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn height\n}\n\n// n is the index of array, so it's real index - 1.\nfunc parent(n int) int {\n\treturn (n+1) / 2 - 1\n}\n\nvar DPN int\n\nfunc zentansaku(n, l int) int {\n\ttmp := []int{}\n\tkpoint := 0\n\n\ti := n\n\tfor {\n\t\tif i < DPN {\n\t\t\tkpoint = i\n\t\t\tbreak\n\t\t}\n\t\ttmp = append(tmp, i)\n\t\ti = parent(i)\n\t}\n\n\t// Logf(\"%v, kp %v\\n\", 1 << len(tmp), kpoint)\n\tsize := len(tmp)\n\tset := 1 << size\n\tmaxvalue := 0\n\tfor i := 0; i < set; i++ {\n\t\tvalue := 0\n\t\tweight := 0\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif (i >> j) % 2 > 0 { // take\n\t\t\t\tvalue += V[tmp[j]]\n\t\t\t\tweight += W[tmp[j]]\n\t\t\t\tif weight > l {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif weight <= l {\n\t\t\tmaxvalue = intMax(maxvalue, value + dp[kpoint][l-weight])\n\t\t}\n\t}\n\n\treturn maxvalue\n}\n\nfunc main() {\n\tflag.Parse()\n\tif *cpuprofile != \"\" {\n\t\tf, err := os.Create(*cpuprofile)\n\t\tif err != nil {\n\t\t\tLogf(\"%v\\n\", err)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tpprof.StartCPUProfile(f)\n\t\tdefer pprof.StopCPUProfile()\n\t}\n\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tDPN = 1024\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tfor i := 0 ; i < N; i++ {\n\t\tV[i] = io.NextInt()\n\t\tW[i] = io.NextInt()\n\t}\n\tQ := io.NextInt()\n\tmaxL := 0\n\tfor i := 0 ; i < Q; i++ {\n\t\tv[i] = io.NextInt()\n\t\tL[i] = io.NextInt()\n\t\tmaxL = intMax(maxL, L[i])\n\t}\n\n\tdpmax := intMin(DPN, N)\n\tdp = make([][]int, dpmax)\n\tfor i := 0; i < dpmax; i++ {\n\t\tdp[i] = make([]int, maxL + 1)\n\t}\n\n\t// Logf(\"%v\\n\", N)\n\t// Logf(\"%v\\n\", Q)\n\t// Logf(\"V %v\\n\", V[0:20])\n\t// Logf(\"W %v\\n\", W[0:20])\n\t// Logf(\"v %v\\n\", v[0:20])\n\t// Logf(\"L %v\\n\", L[0:20])\n\t// Logf(\"maxL %v\\n\", maxL)\n\t// Logf(\"%v %v\\n\", depth(7), depth(8))\n\t// Logf(\"%v %v\\n\", parent(7), parent(8))\n\n\tfor j := 0; j < maxL+1; j++ {\n\t\tif W[0] <= j {\n\t\t\tdp[0][j] = V[0]\n\t\t}\n\t}\n\t// Logf(\"%v\\n\", dp[0][0:maxL])\n\n\tfor i := 1; i < dpmax; i++ {\n\t\tfor j := 0; j < maxL+1; j++ {\n\t\t\tif j >= W[i] {\n\t\t\t\tdp[i][j] = intMax(dp[parent(i)][j], dp[parent(i)][j-W[i]] + V[i])\n\t\t\t} else {\n\t\t\t\tdp[i][j] = dp[parent(i)][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tif v[i] <= DPN {\n\t\t\tfmt.Printf(\"%v\\n\", dp[v[i]-1][L[i]])\n\t\t} else {\n\t\t\t// 全探索\n\t\t\tfmt.Printf(\"%v\\n\", zentansaku(v[i]-1, L[i]))\n\t\t}\n\t}\n\n\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\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 flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\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 parse next word as string.\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 parse next word as Int.\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// NextFloat parses next word as float64.\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\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\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\n// PrintStringLn prints string array in a single line.\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// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\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\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a rooted binary tree with N vertices, where the vertices are numbered 1 to N.\nVertex 1 is the root, and the parent of Vertex i (i \\geq 2) is Vertex \\left[ \\frac{i}{2} \\right].\n\nEach vertex has one item in it. The item in Vertex i has a value of V_i and a weight of W_i.\nNow, process the following query Q times:\n\nGiven are a vertex v of the tree and a positive integer L.\nLet us choose some (possibly none) of the items in v and the ancestors of v so that their total weight is at most L.\nFind the maximum possible total value of the chosen items.\n\nHere, Vertex u is said to be an ancestor of Vertex v when u is an indirect parent of v, that is, there exists a sequence of vertices w_1,w_2,\\ldots,w_k (k\\geq 2) where w_1=v, w_k=u, and w_{i+1} is the parent of w_i for each i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N < 2^{18}\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq V_i \\leq 10^5\n\n1 \\leq W_i \\leq 10^5\n\nFor the values v and L given in each query, 1 \\leq v \\leq N and 1 \\leq L \\leq 10^5.\n\nInput\n\nLet v_i and L_i be the values v and L given in the i-th query.\nThen, Input is given from Standard Input in the following format:\n\nN\nV_1 W_1\n:\nV_N W_N\nQ\nv_1 L_1\n:\nv_Q L_Q\n\nOutput\n\nFor each integer i from 1 through Q,\nthe i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n3\n1 2\n2 3\n3 4\n3\n1 1\n2 5\n3 5\n\nSample Output 1\n\n0\n3\n3\n\nIn the first query, we are given only one choice: the item with (V, W)=(1,2). Since L = 1, we cannot actually choose it, so our response should be 0.\n\nIn the second query, we are given two choices: the items with (V, W)=(1,2) and (V, W)=(2,3). Since L = 5, we can choose both of them, so our response should be 3.\n\nSample Input 2\n\n15\n123 119\n129 120\n132 112\n126 109\n118 103\n115 109\n102 100\n130 120\n105 105\n132 115\n104 102\n107 107\n127 116\n121 104\n121 115\n8\n8 234\n9 244\n10 226\n11 227\n12 240\n13 237\n14 206\n15 227\n\nSample Output 2\n\n256\n255\n250\n247\n255\n259\n223\n253", "sample_input": "3\n1 2\n2 3\n3 4\n3\n1 1\n2 5\n3 5\n"}, "reference_outputs": ["0\n3\n3\n"], "source_document_id": "p02648", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a rooted binary tree with N vertices, where the vertices are numbered 1 to N.\nVertex 1 is the root, and the parent of Vertex i (i \\geq 2) is Vertex \\left[ \\frac{i}{2} \\right].\n\nEach vertex has one item in it. The item in Vertex i has a value of V_i and a weight of W_i.\nNow, process the following query Q times:\n\nGiven are a vertex v of the tree and a positive integer L.\nLet us choose some (possibly none) of the items in v and the ancestors of v so that their total weight is at most L.\nFind the maximum possible total value of the chosen items.\n\nHere, Vertex u is said to be an ancestor of Vertex v when u is an indirect parent of v, that is, there exists a sequence of vertices w_1,w_2,\\ldots,w_k (k\\geq 2) where w_1=v, w_k=u, and w_{i+1} is the parent of w_i for each i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N < 2^{18}\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq V_i \\leq 10^5\n\n1 \\leq W_i \\leq 10^5\n\nFor the values v and L given in each query, 1 \\leq v \\leq N and 1 \\leq L \\leq 10^5.\n\nInput\n\nLet v_i and L_i be the values v and L given in the i-th query.\nThen, Input is given from Standard Input in the following format:\n\nN\nV_1 W_1\n:\nV_N W_N\nQ\nv_1 L_1\n:\nv_Q L_Q\n\nOutput\n\nFor each integer i from 1 through Q,\nthe i-th line should contain the response to the i-th query.\n\nSample Input 1\n\n3\n1 2\n2 3\n3 4\n3\n1 1\n2 5\n3 5\n\nSample Output 1\n\n0\n3\n3\n\nIn the first query, we are given only one choice: the item with (V, W)=(1,2). Since L = 1, we cannot actually choose it, so our response should be 0.\n\nIn the second query, we are given two choices: the items with (V, W)=(1,2) and (V, W)=(2,3). Since L = 5, we can choose both of them, so our response should be 3.\n\nSample Input 2\n\n15\n123 119\n129 120\n132 112\n126 109\n118 103\n115 109\n102 100\n130 120\n105 105\n132 115\n104 102\n107 107\n127 116\n121 104\n121 115\n8\n8 234\n9 244\n10 226\n11 227\n12 240\n13 237\n14 206\n15 227\n\nSample Output 2\n\n256\n255\n250\n247\n255\n259\n223\n253", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9845, "cpu_time_ms": 3329, "memory_kb": 851080}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s731797846", "group_id": "codeNet:p02657", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tstdin.Split(bufio.ScanWords)\n\tvar A, B int\n\tA = nextInt()\n\tB = nextInt()\n\tfmt.Println(A * B)\n}\n\nfunc nextInt() int {\n\tstdin.Scan()\n\ti, err := strconv.Atoi(stdin.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tstdin.Scan()\n\ti := stdin.Text()\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1591684366, "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/s731797846.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s731797846", "user_id": "u481009932"}, "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 stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tstdin.Split(bufio.ScanWords)\n\tvar A, B int\n\tA = nextInt()\n\tB = nextInt()\n\tfmt.Println(A * B)\n}\n\nfunc nextInt() int {\n\tstdin.Scan()\n\ti, err := strconv.Atoi(stdin.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tstdin.Scan()\n\ti := stdin.Text()\n\treturn i\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 398, "cpu_time_ms": 8, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s255899247", "group_id": "codeNet:p02657", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tnextReader = newScanner()\n\ta, b := nextInt(), nextInt()\n\tfmt.Println(a * b)\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "language": "Go", "metadata": {"date": 1591322012, "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/s255899247.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s255899247", "user_id": "u150922405"}, "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\tnextReader = newScanner()\n\ta, b := nextInt(), nextInt()\n\tfmt.Println(a * b)\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 763, "cpu_time_ms": 3, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069081583", "group_id": "codeNet:p02657", "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\tIn := readlineint()\n\tfmt.Println(In[0] * In[1])\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar bufreader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readline() string {\n\ta, _, _ := bufreader.ReadLine()\n\treturn string(a)\n}\n\nfunc readlineint() (result []int) {\n\tin := strings.Split(readline(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1590980215, "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/s069081583.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069081583", "user_id": "u121595121"}, "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\nfunc main() {\n\tIn := readlineint()\n\tfmt.Println(In[0] * In[1])\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar bufreader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readline() string {\n\ta, _, _ := bufreader.ReadLine()\n\treturn string(a)\n}\n\nfunc readlineint() (result []int) {\n\tin := strings.Split(readline(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 595, "cpu_time_ms": 4, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s706259987", "group_id": "codeNet:p02657", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(resolve(parseProblem(os.Stdin)))\n}\n\nfunc parseProblem(r io.Reader) int {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\ta, b := scanInt(sc), scanInt(sc)\n\treturn a * b\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1590973303, "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/s706259987.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s706259987", "user_id": "u623007471"}, "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\nfunc main() {\n\tfmt.Println(resolve(parseProblem(os.Stdin)))\n}\n\nfunc parseProblem(r io.Reader) int {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\ta, b := scanInt(sc), scanInt(sc)\n\treturn a * b\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 652, "cpu_time_ms": 6, "memory_kb": 1764}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s504779392", "group_id": "codeNet:p02660", "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\tn := readInt64()\n\n\tanswer := map[int64]int64{}\n\tmax := n\n\tfor i := int64(2); i*i <= max; i++ {\n\t\tif n%i == 0 {\n\t\t\tif _, ok := answer[i]; ok {\n\t\t\t\tanswer[i]++\n\n\t\t\t} else {\n\t\t\t\tanswer[i] = 1\n\t\t\t}\n\t\t\tn = n / i\n\t\t\t// if you want to answer prime number only, you should take off the comment out below.\n\t\t\t// i--\n\n\t\t\tif n == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif n != 1 {\n\t\tanswer[n] = 1\n\t}\n\n\tcount := int64(0)\n\tfor _, v := range answer {\n\t\tcount += v\n\t}\n\tfmt.Println(count)\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1591587431, "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/s504779392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s504779392", "user_id": "u340848688"}, "prompt_components": {"gold_output": "3\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\tn := readInt64()\n\n\tanswer := map[int64]int64{}\n\tmax := n\n\tfor i := int64(2); i*i <= max; i++ {\n\t\tif n%i == 0 {\n\t\t\tif _, ok := answer[i]; ok {\n\t\t\t\tanswer[i]++\n\n\t\t\t} else {\n\t\t\t\tanswer[i] = 1\n\t\t\t}\n\t\t\tn = n / i\n\t\t\t// if you want to answer prime number only, you should take off the comment out below.\n\t\t\t// i--\n\n\t\t\tif n == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif n != 1 {\n\t\tanswer[n] = 1\n\t}\n\n\tcount := int64(0)\n\tfor _, v := range answer {\n\t\tcount += v\n\t}\n\tfmt.Println(count)\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 843, "cpu_time_ms": 22, "memory_kb": 1840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s134720363", "group_id": "codeNet:p02661", "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\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := NextInt()\n\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = NextInt()\n\t\tb[i] = NextInt()\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\n\tvar ans int\n\tvar min, max int\n\n\tif n%2 == 1 {\n\t\tmin = a[n/2]\n\t\tmax = b[n/2]\n\t\tans = max - (min - 1)\n\t} else {\n\t\tmin = (a[(n-1)/2] + a[n/2]) / 2.0\n\t\tmax = (b[(n-1)/2] + b[n/2]) / 2.0\n\t\tans = (max-min)*2 + 1\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592454870, "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/s134720363.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s134720363", "user_id": "u713492631"}, "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 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\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = NextInt()\n\t\tb[i] = NextInt()\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\n\tvar ans int\n\tvar min, max int\n\n\tif n%2 == 1 {\n\t\tmin = a[n/2]\n\t\tmax = b[n/2]\n\t\tans = max - (min - 1)\n\t} else {\n\t\tmin = (a[(n-1)/2] + a[n/2]) / 2.0\n\t\tmax = (b[(n-1)/2] + b[n/2]) / 2.0\n\t\tans = (max-min)*2 + 1\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 637, "cpu_time_ms": 130, "memory_kb": 8364}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s886705415", "group_id": "codeNet:p02661", "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 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}\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\tn := intScanner()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t\tb[i] = intScanner()\n\t}\n\tam, bm := 0, 0\n\tif n%2 == 0 {\n\t\tam = a[n/2] + a[n/2-1]\n\t\tbm = b[n/2] + b[n/2-1]\n\t} else {\n\t\tam = a[n/2]\n\t\tbm = b[n/2]\n\t}\n\tfmt.Println(bm - am + 1)\n}\n", "language": "Go", "metadata": {"date": 1590975067, "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/s886705415.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s886705415", "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 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}\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\tn := intScanner()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t\tb[i] = intScanner()\n\t}\n\tam, bm := 0, 0\n\tif n%2 == 0 {\n\t\tam = a[n/2] + a[n/2-1]\n\t\tbm = b[n/2] + b[n/2-1]\n\t} else {\n\t\tam = a[n/2]\n\t\tbm = b[n/2]\n\t}\n\tfmt.Println(bm - am + 1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 59, "memory_kb": 8276}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s882011048", "group_id": "codeNet:p02663", "input_text": "package main\n\nimport (\n \"fmt\"\n \"time\"\n)\n\nfunc main () {\n var h1, m1, h2, m2, k, dist int\n fmt.Scanf(\"%d %d %d %d %d\", &h1, &m1, &h2, &m2, &k)\n \n wakeupTime := time.Date(2020, time.May, 30, h1, m1, 0, 0, time.UTC)\n sleepTime := time.Date(2020, time.May, 30, h2, m2, 0, 0, time.UTC)\n \n //sleepTime := time.Now()\n //sleepTime.hour = h2\n //sleepTime.min = m2\n \n wakeTime := sleepTime.Sub(wakeupTime)\n \n dist = int(wakeTime.Minutes()) - k\n \n fmt.Printf(\"%d\\n\", dist)\n}", "language": "Go", "metadata": {"date": 1590890725, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02663.html", "problem_id": "p02663", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02663/input.txt", "sample_output_relpath": "derived/input_output/data/p02663/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02663/Go/s882011048.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s882011048", "user_id": "u039324940"}, "prompt_components": {"gold_output": "270\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"time\"\n)\n\nfunc main () {\n var h1, m1, h2, m2, k, dist int\n fmt.Scanf(\"%d %d %d %d %d\", &h1, &m1, &h2, &m2, &k)\n \n wakeupTime := time.Date(2020, time.May, 30, h1, m1, 0, 0, time.UTC)\n sleepTime := time.Date(2020, time.May, 30, h2, m2, 0, 0, time.UTC)\n \n //sleepTime := time.Now()\n //sleepTime.hour = h2\n //sleepTime.min = m2\n \n wakeTime := sleepTime.Sub(wakeupTime)\n \n dist = int(wakeTime.Minutes()) - k\n \n fmt.Printf(\"%d\\n\", dist)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn this problem, we use the 24-hour clock.\n\nTakahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)\nHe has decided to study for K consecutive minutes while he is up.\nWhat is the length of the period in which he can start studying?\n\nConstraints\n\n0 \\le H_1, H_2 \\le 23\n\n0 \\le M_1, M_2 \\le 59\n\nThe time H_1 : M_1 comes before the time H_2 : M_2.\n\nK \\ge 1\n\nTakahashi is up for at least K minutes.\n\nAll values in input are integers (without leading zeros).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH_1 M_1 H_2 M_2 K\n\nOutput\n\nPrint the length of the period in which he can start studying, as an integer.\n\nSample Input 1\n\n10 0 15 0 30\n\nSample Output 1\n\n270\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.\nIt takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.\n\nSample Input 2\n\n10 0 12 0 120\n\nSample Output 2\n\n0\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.", "sample_input": "10 0 15 0 30\n"}, "reference_outputs": ["270\n"], "source_document_id": "p02663", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn this problem, we use the 24-hour clock.\n\nTakahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2. (See Sample Inputs below for clarity.)\nHe has decided to study for K consecutive minutes while he is up.\nWhat is the length of the period in which he can start studying?\n\nConstraints\n\n0 \\le H_1, H_2 \\le 23\n\n0 \\le M_1, M_2 \\le 59\n\nThe time H_1 : M_1 comes before the time H_2 : M_2.\n\nK \\ge 1\n\nTakahashi is up for at least K minutes.\n\nAll values in input are integers (without leading zeros).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH_1 M_1 H_2 M_2 K\n\nOutput\n\nPrint the length of the period in which he can start studying, as an integer.\n\nSample Input 1\n\n10 0 15 0 30\n\nSample Output 1\n\n270\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly three in the afternoon.\nIt takes 30 minutes to do the study, so he can start it in the period between ten o'clock and half-past two. The length of this period is 270 minutes, so we should print 270.\n\nSample Input 2\n\n10 0 12 0 120\n\nSample Output 2\n\n0\n\nTakahashi gets up at exactly ten in the morning and goes to bed at exactly noon. It takes 120 minutes to do the study, so he has to start it at exactly ten o'clock. Thus, we should print 0.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 480, "cpu_time_ms": 2, "memory_kb": 1820}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s651752308", "group_id": "codeNet:p02664", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\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 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\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar T string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tT = nextStr()\n\tans := \"\"\n\tfor i := len(T) - 1; i >= 0; i-- {\n\t\tif string(T[i]) == \"?\" {\n\t\t\tif i == len(T)-1 {\n\t\t\t\tans = \"D\" + ans\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif string(ans[0]) == \"D\" {\n\t\t\t\t\tans = \"P\" + ans\n\t\t\t\t} else {\n\t\t\t\t\tans = \"D\" + ans\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tans = string(T[i]) + ans\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590893546, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02664.html", "problem_id": "p02664", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02664/input.txt", "sample_output_relpath": "derived/input_output/data/p02664/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02664/Go/s651752308.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s651752308", "user_id": "u432333240"}, "prompt_components": {"gold_output": "PDPDPDP\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\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 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\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar T string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tT = nextStr()\n\tans := \"\"\n\tfor i := len(T) - 1; i >= 0; i-- {\n\t\tif string(T[i]) == \"?\" {\n\t\t\tif i == len(T)-1 {\n\t\t\t\tans = \"D\" + ans\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif string(ans[0]) == \"D\" {\n\t\t\t\t\tans = \"P\" + ans\n\t\t\t\t} else {\n\t\t\t\t\tans = \"D\" + ans\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tans = string(T[i]) + ans\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFor a string S consisting of the uppercase English letters P and D, let the doctoral and postdoctoral quotient of S be the total number of occurrences of D and PD in S as contiguous substrings. For example, if S = PPDDP, it contains two occurrences of D and one occurrence of PD as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.\n\nWe have a string T consisting of P, D, and ?.\n\nAmong the strings that can be obtained by replacing each ? in T with P or D, find one with the maximum possible doctoral and postdoctoral quotient.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of P, D, and ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint one string with the maximum possible doctoral and postdoctoral quotient among the strings that can be obtained by replacing each ? in T with P or D.\nIf there are multiple such strings, you may print any of them.\n\nSample Input 1\n\nPD?D??P\n\nSample Output 1\n\nPDPDPDP\n\nThis string contains three occurrences of D and three occurrences of PD as contiguous substrings, so its doctoral and postdoctoral quotient is 6, which is the maximum doctoral and postdoctoral quotient of a string obtained by replacing each ? in T with P or D.\n\nSample Input 2\n\nP?P?\n\nSample Output 2\n\nPDPD", "sample_input": "PD?D??P\n"}, "reference_outputs": ["PDPDPDP\n"], "source_document_id": "p02664", "source_text": "Score : 200 points\n\nProblem Statement\n\nFor a string S consisting of the uppercase English letters P and D, let the doctoral and postdoctoral quotient of S be the total number of occurrences of D and PD in S as contiguous substrings. For example, if S = PPDDP, it contains two occurrences of D and one occurrence of PD as contiguous substrings, so the doctoral and postdoctoral quotient of S is 3.\n\nWe have a string T consisting of P, D, and ?.\n\nAmong the strings that can be obtained by replacing each ? in T with P or D, find one with the maximum possible doctoral and postdoctoral quotient.\n\nConstraints\n\n1 \\leq |T| \\leq 2 \\times 10^5\n\nT consists of P, D, and ?.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nT\n\nOutput\n\nPrint one string with the maximum possible doctoral and postdoctoral quotient among the strings that can be obtained by replacing each ? in T with P or D.\nIf there are multiple such strings, you may print any of them.\n\nSample Input 1\n\nPD?D??P\n\nSample Output 1\n\nPDPDPDP\n\nThis string contains three occurrences of D and three occurrences of PD as contiguous substrings, so its doctoral and postdoctoral quotient is 6, which is the maximum doctoral and postdoctoral quotient of a string obtained by replacing each ? in T with P or D.\n\nSample Input 2\n\nP?P?\n\nSample Output 2\n\nPDPD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s021288931", "group_id": "codeNet:p02675", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, n int\n\tfmt.Scan(&a)\n\tn = a % 10\n\n\tif n == 3{\n\t\tfmt.Println(\"bon\")\n\t} else if n == 0 || n == 1 || n ==6 || n == 8{\n\t\tfmt.Println(\"pon\")\n\t}else{\n\t\tfmt.Println(\"hon\")\n\t}\n}", "language": "Go", "metadata": {"date": 1590157249, "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/s021288931.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s021288931", "user_id": "u542774596"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, n int\n\tfmt.Scan(&a)\n\tn = a % 10\n\n\tif n == 3{\n\t\tfmt.Println(\"bon\")\n\t} else if n == 0 || n == 1 || n ==6 || n == 8{\n\t\tfmt.Println(\"pon\")\n\t}else{\n\t\tfmt.Println(\"hon\")\n\t}\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 2, "memory_kb": 1752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s985473967", "group_id": "codeNet:p02675", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tN := nextInt()\n\ta := N % 10\n\n\tif a == 3 {\n\t\tfmt.Println(\"bon\")\n\t} else if a == 0 || a == 1 || a == 6 || a == 8 {\n\t\tfmt.Println(\"pon\")\n\t} else {\n\t\tfmt.Println(\"hon\")\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": 1589763682, "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/s985473967.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s985473967", "user_id": "u578274732"}, "prompt_components": {"gold_output": "pon\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\n\tN := nextInt()\n\ta := N % 10\n\n\tif a == 3 {\n\t\tfmt.Println(\"bon\")\n\t} else if a == 0 || a == 1 || a == 6 || a == 8 {\n\t\tfmt.Println(\"pon\")\n\t} else {\n\t\tfmt.Println(\"hon\")\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: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 759, "cpu_time_ms": 9, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s159229827", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar K int\n\tfmt.Scanf(\"%d\", &K)\n\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tfmt.Println(len(S))\n\tif len(S) <= K {\n\n\t\tfmt.Println(S)\n\t} else {\n\t\tfmt.Println(S[0:K] + \"...\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595033820, "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/s159229827.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s159229827", "user_id": "u128015095"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar K int\n\tfmt.Scanf(\"%d\", &K)\n\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tfmt.Println(len(S))\n\tif len(S) <= K {\n\n\t\tfmt.Println(S)\n\t} else {\n\t\tfmt.Println(S[0: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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s126323606", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&k)\n\tfmt.Scan(&s)\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": 1589764538, "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/s126323606.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s126323606", "user_id": "u953665568"}, "prompt_components": {"gold_output": "nikoand...\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&k)\n\tfmt.Scan(&s)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s255200641", "group_id": "codeNet:p02676", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(parseProblem(os.Stdin))\n}\n\nfunc parseProblem(r io.Reader) string {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\tk := scanInt(sc)\n\tstr := scanString(sc)\n\tif len(str) > k {\n\t\treturn str[0:k] + \"...\"\n\t}\n\treturn str\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1589763972, "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/s255200641.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s255200641", "user_id": "u623007471"}, "prompt_components": {"gold_output": "nikoand...\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\nfunc main() {\n\tfmt.Println(parseProblem(os.Stdin))\n}\n\nfunc parseProblem(r io.Reader) string {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\tk := scanInt(sc)\n\tstr := scanString(sc)\n\tif len(str) > k {\n\t\treturn str[0:k] + \"...\"\n\t}\n\treturn str\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s784452891", "group_id": "codeNet:p02678", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tM := sc.i()\n\troom := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troom[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tA := sc.i() - 1\n\t\tB := sc.i() - 1\n\t\troom[A] = append(room[A], B)\n\t\troom[B] = append(room[B], A)\n\t}\n\n\tqueue := make([]int, 0)\n\tqueue = append(queue, 0)\n\tprev := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tprev[i] = math.MaxInt64\n\t}\n\n\tfor len(queue) != 0 {\n\t\tv := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, r := range room[v] {\n\t\t\tif prev[r] != math.MaxInt64 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprev[r] = v\n\t\t\tqueue = append(queue, r)\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n\tfor _, v := range prev[1:] {\n\t\tfmt.Println(v + 1)\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": 1589942804, "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/s784452891.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s784452891", "user_id": "u737368452"}, "prompt_components": {"gold_output": "Yes\n1\n2\n2\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tM := sc.i()\n\troom := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\troom[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tA := sc.i() - 1\n\t\tB := sc.i() - 1\n\t\troom[A] = append(room[A], B)\n\t\troom[B] = append(room[B], A)\n\t}\n\n\tqueue := make([]int, 0)\n\tqueue = append(queue, 0)\n\tprev := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tprev[i] = math.MaxInt64\n\t}\n\n\tfor len(queue) != 0 {\n\t\tv := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, r := range room[v] {\n\t\t\tif prev[r] != math.MaxInt64 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprev[r] = v\n\t\t\tqueue = append(queue, r)\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n\tfor _, v := range prev[1:] {\n\t\tfmt.Println(v + 1)\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: 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1713, "cpu_time_ms": 245, "memory_kb": 19264}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s918759207", "group_id": "codeNet:p02679", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\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 powMod(a, n int) int {\n\tif n < 0 {\n\t\tlog.Fatal(\"pow error\")\n\t}\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n%2 == 0 {\n\t\td := powMod(a, n/2) % mod\n\t\treturn d * d % mod\n\t}\n\treturn a * powMod(a, n-1) % mod\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\ntype key struct {\n\tPositive bool\n\tFirst int\n\tSecond int\n}\n\nfunc toPositive(a, b int) (int, int, bool) {\n\tif a == 0 && b == 0 {\n\t\treturn a, b, true\n\t}\n\tif a == 0 {\n\t\tif b > 0 {\n\t\t\treturn a, b, true\n\t\t}\n\t\treturn a, -b, false\n\t}\n\n\tif b == 0 {\n\t\tif a > 0 {\n\t\t\treturn a, b, true\n\t\t}\n\t\treturn -a, b, false\n\t}\n\n\tif a > 0 && b > 0 {\n\t\treturn a, b, true\n\t}\n\tif a > 0 && b < 0 {\n\t\treturn a, -b, false\n\t}\n\tif a < 0 && b > 0 {\n\t\treturn -a, b, false\n\t}\n\tif a < 0 && b < 0 {\n\t\treturn -a, -b, true\n\t}\n\tlog.Fatal(\"positive error\")\n\treturn 0, 0, true\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tb[i] = nextInt()\n\t}\n\tcount := make(map[key]int)\n\ttwoZeroes := 0\n\tfor i := 0; i < n; i++ {\n\t\tpa, pb, pos := toPositive(a[i], b[i])\n\t\tg := gcd(pa, pb)\n\t\tvar val key\n\t\tif pa == 0 && pb == 0 {\n\t\t\ttwoZeroes++\n\t\t\tcontinue\n\t\t} else if pa == 0 {\n\t\t\tval = key{true, 0, 1}\n\t\t} else if pb == 0 {\n\t\t\tval = key{false, 1, 0}\n\t\t} else {\n\t\t\tval = key{pos, pa / g, pb / g}\n\t\t}\n\t\tcount[val]++\n\t}\n\n\tans := 1\n\tused := make(map[key]bool)\n\tfor k, cnt := range count {\n\t\tif used[k] {\n\t\t\tcontinue\n\t\t}\n\n\t\tpair := key{!k.Positive, k.Second, k.First}\n\t\tif pcnt, ok := count[pair]; ok {\n\t\t\tans *= (powMod(2, cnt) + powMod(2, pcnt) - 1) % mod\n\t\t\tans %= mod\n\t\t\tused[pair] = true\n\t\t} else {\n\t\t\tans *= powMod(2, cnt)\n\t\t}\n\t}\n\tans += twoZeroes\n\tans--\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1589818564, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02679/input.txt", "sample_output_relpath": "derived/input_output/data/p02679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02679/Go/s918759207.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s918759207", "user_id": "u275316733"}, "prompt_components": {"gold_output": "5\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\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 powMod(a, n int) int {\n\tif n < 0 {\n\t\tlog.Fatal(\"pow error\")\n\t}\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n%2 == 0 {\n\t\td := powMod(a, n/2) % mod\n\t\treturn d * d % mod\n\t}\n\treturn a * powMod(a, n-1) % mod\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\ntype key struct {\n\tPositive bool\n\tFirst int\n\tSecond int\n}\n\nfunc toPositive(a, b int) (int, int, bool) {\n\tif a == 0 && b == 0 {\n\t\treturn a, b, true\n\t}\n\tif a == 0 {\n\t\tif b > 0 {\n\t\t\treturn a, b, true\n\t\t}\n\t\treturn a, -b, false\n\t}\n\n\tif b == 0 {\n\t\tif a > 0 {\n\t\t\treturn a, b, true\n\t\t}\n\t\treturn -a, b, false\n\t}\n\n\tif a > 0 && b > 0 {\n\t\treturn a, b, true\n\t}\n\tif a > 0 && b < 0 {\n\t\treturn a, -b, false\n\t}\n\tif a < 0 && b > 0 {\n\t\treturn -a, b, false\n\t}\n\tif a < 0 && b < 0 {\n\t\treturn -a, -b, true\n\t}\n\tlog.Fatal(\"positive error\")\n\treturn 0, 0, true\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\tb[i] = nextInt()\n\t}\n\tcount := make(map[key]int)\n\ttwoZeroes := 0\n\tfor i := 0; i < n; i++ {\n\t\tpa, pb, pos := toPositive(a[i], b[i])\n\t\tg := gcd(pa, pb)\n\t\tvar val key\n\t\tif pa == 0 && pb == 0 {\n\t\t\ttwoZeroes++\n\t\t\tcontinue\n\t\t} else if pa == 0 {\n\t\t\tval = key{true, 0, 1}\n\t\t} else if pb == 0 {\n\t\t\tval = key{false, 1, 0}\n\t\t} else {\n\t\t\tval = key{pos, pa / g, pb / g}\n\t\t}\n\t\tcount[val]++\n\t}\n\n\tans := 1\n\tused := make(map[key]bool)\n\tfor k, cnt := range count {\n\t\tif used[k] {\n\t\t\tcontinue\n\t\t}\n\n\t\tpair := key{!k.Positive, k.Second, k.First}\n\t\tif pcnt, ok := count[pair]; ok {\n\t\t\tans *= (powMod(2, cnt) + powMod(2, pcnt) - 1) % mod\n\t\t\tans %= mod\n\t\t\tused[pair] = true\n\t\t} else {\n\t\t\tans *= powMod(2, cnt)\n\t\t}\n\t}\n\tans += twoZeroes\n\tans--\n\tfmt.Println(ans)\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "sample_input": "3\n1 2\n-1 1\n2 -1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02679", "source_text": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2298, "cpu_time_ms": 270, "memory_kb": 25892}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s602022761", "group_id": "codeNet:p02679", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\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, 1000005), 1000005)\n\treturn scanner\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\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 getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(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\tcnt := 0\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 2\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\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}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tm := map[string]int{}\n\tr := map[string]int{}\n\trr := map[string]string{}\n\tvar a0, b0, no int\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt64(scanner)\n\t\tb := getNextInt64(scanner)\n\t\tif a == 0 && b == 0 {\n\t\t\tno++\n\t\t\tcontinue\n\t\t}\n\t\tif a == 0 {\n\t\t\ta0++\n\t\t\tcontinue\n\t\t}\n\t\tif b == 0 {\n\t\t\tb0++\n\t\t\tcontinue\n\t\t}\n\t\tk := big.NewRat(a, b).RatString()\n\t\tm[k] = m[k] + 1\n\t\tkk := big.NewRat(-b, a).RatString()\n\t\tr[kk] = r[kk] + 1\n\t\trr[k] = kk\n\t}\n\tpp := make([][2]int, 0)\n\tpp = append(pp, [2]int{\n\t\ta0,\n\t\tb0,\n\t})\n\tbeki := 0\n\tused := map[string]bool{}\n\tfor k, c := range m {\n\t\tif r[k] == 0 {\n\t\t\tbeki += c\n\t\t\tcontinue\n\t\t}\n\t\tif used[k] {\n\t\t\tcontinue\n\t\t}\n\t\tpp = append(pp, [2]int{\n\t\t\tc,\n\t\t\tr[k],\n\t\t})\n\t\tused[rr[k]] = true\n\t}\n\tvar ans mint\n\tans = 1\n\tfor i := 0; i < beki; i++ {\n\t\tans.mulAs(2)\n\t}\n\tfor _, p := range pp {\n\t\tans.mulAs(only(p[0], p[1]))\n\t}\n\tfmt.Fprintln(writer, ans.sub(1).add(mint(no)))\n\n}\n\nfunc only(a, b int) mint {\n\tvar aa, bb mint\n\taa = 1\n\tbb = 1\n\tfor i := 0; i < a; i++ {\n\t\taa.mulAs(2)\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tbb.mulAs(2)\n\t}\n\treturn aa.sub(1).add(bb.sub(1)).add(1)\n\n}\n\ntype mint int64\n\nfunc (mt mint) mod() mint {\n\tm := mint(1e9 + 7)\n\tmt %= m\n\tif mt < 0 {\n\t\treturn mt + m\n\t}\n\treturn mt\n}\nfunc (mt mint) inv() mint {\n\tvar m, y mint\n\tm.subAs(2)\n\tdbl := mt\n\ty = 1\n\tfor i := 0; i < 31; i++ {\n\t\tif m%2 == 1 {\n\t\t\ty.mulAs(dbl)\n\t\t}\n\t\tm >>= 1\n\t\tdbl.mulAs(dbl)\n\t}\n\treturn y\n}\nfunc (mt mint) add(x mint) mint {\n\treturn (mt + x).mod()\n}\nfunc (mt mint) sub(x mint) mint {\n\treturn (mt - x).mod()\n}\nfunc (mt mint) mul(x mint) mint {\n\treturn (mt * x).mod()\n}\nfunc (mt mint) div(x mint) mint {\n\treturn mt.mul(x.inv())\n}\nfunc (mt *mint) addAs(x mint) *mint {\n\t*mt = mt.add(x)\n\treturn mt\n}\nfunc (mt *mint) subAs(x mint) *mint {\n\t*mt = mt.sub(x)\n\treturn mt\n}\nfunc (mt *mint) mulAs(x mint) *mint {\n\t*mt = mt.mul(x)\n\treturn mt\n}\nfunc (mt *mint) divAs(x mint) *mint {\n\t*mt = mt.div(x)\n\treturn mt\n}\n", "language": "Go", "metadata": {"date": 1589774391, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02679/input.txt", "sample_output_relpath": "derived/input_output/data/p02679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02679/Go/s602022761.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s602022761", "user_id": "u150542210"}, "prompt_components": {"gold_output": "5\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)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n\treturn scanner\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\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 getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(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\tcnt := 0\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 2\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\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}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tm := map[string]int{}\n\tr := map[string]int{}\n\trr := map[string]string{}\n\tvar a0, b0, no int\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt64(scanner)\n\t\tb := getNextInt64(scanner)\n\t\tif a == 0 && b == 0 {\n\t\t\tno++\n\t\t\tcontinue\n\t\t}\n\t\tif a == 0 {\n\t\t\ta0++\n\t\t\tcontinue\n\t\t}\n\t\tif b == 0 {\n\t\t\tb0++\n\t\t\tcontinue\n\t\t}\n\t\tk := big.NewRat(a, b).RatString()\n\t\tm[k] = m[k] + 1\n\t\tkk := big.NewRat(-b, a).RatString()\n\t\tr[kk] = r[kk] + 1\n\t\trr[k] = kk\n\t}\n\tpp := make([][2]int, 0)\n\tpp = append(pp, [2]int{\n\t\ta0,\n\t\tb0,\n\t})\n\tbeki := 0\n\tused := map[string]bool{}\n\tfor k, c := range m {\n\t\tif r[k] == 0 {\n\t\t\tbeki += c\n\t\t\tcontinue\n\t\t}\n\t\tif used[k] {\n\t\t\tcontinue\n\t\t}\n\t\tpp = append(pp, [2]int{\n\t\t\tc,\n\t\t\tr[k],\n\t\t})\n\t\tused[rr[k]] = true\n\t}\n\tvar ans mint\n\tans = 1\n\tfor i := 0; i < beki; i++ {\n\t\tans.mulAs(2)\n\t}\n\tfor _, p := range pp {\n\t\tans.mulAs(only(p[0], p[1]))\n\t}\n\tfmt.Fprintln(writer, ans.sub(1).add(mint(no)))\n\n}\n\nfunc only(a, b int) mint {\n\tvar aa, bb mint\n\taa = 1\n\tbb = 1\n\tfor i := 0; i < a; i++ {\n\t\taa.mulAs(2)\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tbb.mulAs(2)\n\t}\n\treturn aa.sub(1).add(bb.sub(1)).add(1)\n\n}\n\ntype mint int64\n\nfunc (mt mint) mod() mint {\n\tm := mint(1e9 + 7)\n\tmt %= m\n\tif mt < 0 {\n\t\treturn mt + m\n\t}\n\treturn mt\n}\nfunc (mt mint) inv() mint {\n\tvar m, y mint\n\tm.subAs(2)\n\tdbl := mt\n\ty = 1\n\tfor i := 0; i < 31; i++ {\n\t\tif m%2 == 1 {\n\t\t\ty.mulAs(dbl)\n\t\t}\n\t\tm >>= 1\n\t\tdbl.mulAs(dbl)\n\t}\n\treturn y\n}\nfunc (mt mint) add(x mint) mint {\n\treturn (mt + x).mod()\n}\nfunc (mt mint) sub(x mint) mint {\n\treturn (mt - x).mod()\n}\nfunc (mt mint) mul(x mint) mint {\n\treturn (mt * x).mod()\n}\nfunc (mt mint) div(x mint) mint {\n\treturn mt.mul(x.inv())\n}\nfunc (mt *mint) addAs(x mint) *mint {\n\t*mt = mt.add(x)\n\treturn mt\n}\nfunc (mt *mint) subAs(x mint) *mint {\n\t*mt = mt.sub(x)\n\treturn mt\n}\nfunc (mt *mint) mulAs(x mint) *mint {\n\t*mt = mt.mul(x)\n\treturn mt\n}\nfunc (mt *mint) divAs(x mint) *mint {\n\t*mt = mt.div(x)\n\treturn mt\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "sample_input": "3\n1 2\n-1 1\n2 -1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02679", "source_text": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3269, "cpu_time_ms": 901, "memory_kb": 80796}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s180001104", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n \nfunc main() {\n old := nextLine()\n new := nextLine()\n //newの最後の文字を取得\n last_new := string(new[len(new)-1])\n if (old + last_new) == new {\n fmt.Printf(\"Yes\\n\")\n } else {\n fmt.Printf(\"No\\n\")\n }\n}\n\n/*----------標準入力用の関数----------*/\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, _ := reader.ReadLine()\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}", "language": "Go", "metadata": {"date": 1592093235, "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/s180001104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s180001104", "user_id": "u104195322"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n \nfunc main() {\n old := nextLine()\n new := nextLine()\n //newの最後の文字を取得\n last_new := string(new[len(new)-1])\n if (old + last_new) == new {\n fmt.Printf(\"Yes\\n\")\n } else {\n fmt.Printf(\"No\\n\")\n }\n}\n\n/*----------標準入力用の関数----------*/\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, _ := reader.ReadLine()\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 605, "cpu_time_ms": 4, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272693269", "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\n\tif t[0:len(s)] == s {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1589856729, "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/s272693269.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272693269", "user_id": "u298936763"}, "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\n\tif t[0:len(s)] == s {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 10, "memory_kb": 1752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s767873820", "group_id": "codeNet:p02681", "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\tresolve(os.Stdin)\n}\n\nfunc resolve(r io.Reader) {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\ts := scanString(sc)\n\tt := scanString(sc)\n\tif strings.HasPrefix(t, s) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}", "language": "Go", "metadata": {"date": 1589159064, "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/s767873820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s767873820", "user_id": "u623007471"}, "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\t\"strings\"\n)\n\nfunc main() {\n\tresolve(os.Stdin)\n}\n\nfunc resolve(r io.Reader) {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\ts := scanString(sc)\n\tt := scanString(sc)\n\tif strings.HasPrefix(t, s) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s874934059", "group_id": "codeNet:p02681", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tif s == t[0:len(t)-1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589158933, "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/s874934059.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s874934059", "user_id": "u367908963"}, "prompt_components": {"gold_output": "Yes\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\tif s == t[0: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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 1752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s973795963", "group_id": "codeNet:p02682", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\trequest := make([]int, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scanf(\"%d\", &request[i])\n\t}\n\tsize := request[3]\n\n\tresult := linear(request[0], request[1], size)\n\tfmt.Printf(\"%d\", result)\n}\n\nfunc linear(numA int, numB int, size int) int {\n\tsum := 0\n\tfor i := 0; i < numA; i++ {\n\t\tsum += 1\n\t}\n\tremain := size - numA - numB\n\tif remain < 0 {\n\t\treturn sum\n\t}\n\tfor i := 0; i < remain; i++ {\n\t\tif sum <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tsum -= 1\n\t}\n\treturn sum\n}", "language": "Go", "metadata": {"date": 1589160630, "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/s973795963.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s973795963", "user_id": "u408141680"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\trequest := make([]int, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scanf(\"%d\", &request[i])\n\t}\n\tsize := request[3]\n\n\tresult := linear(request[0], request[1], size)\n\tfmt.Printf(\"%d\", result)\n}\n\nfunc linear(numA int, numB int, size int) int {\n\tsum := 0\n\tfor i := 0; i < numA; i++ {\n\t\tsum += 1\n\t}\n\tremain := size - numA - numB\n\tif remain < 0 {\n\t\treturn sum\n\t}\n\tfor i := 0; i < remain; i++ {\n\t\tif sum <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tsum -= 1\n\t}\n\treturn sum\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 483, "cpu_time_ms": 1190, "memory_kb": 1852}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s429708093", "group_id": "codeNet:p02683", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M, X int\n\tfmt.Scan(&N, &M, &X)\n\n\tC := make([]int, N)\n\tA := make([][]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&C[i])\n\t\tA[i] = make([]int, M)\n\t\tfor j := 0; j < M; j++ {\n\t\t\tfmt.Scan(&A[i][j])\n\t\t}\n\t}\n\tams := int(1e9)\n\tfor k := 0; k < 1<>uint(l))&1 == 1 {\n\t\t\t\tcost += C[l]\n\t\t\t\tfor p := 0; p < M; p++ {\n\t\t\t\t\ttmpl[p] += A[l][p]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tflag := true\n\t\tfor q := 0; q < M; q++ {\n\t\t\tif tmpl[q] < X {\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tif cost < ams {\n\t\t\t\tams = cost\n\t\t\t}\n\t\t}\n\t}\n\tif ams == int(1e9) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ams)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589734928, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02683.html", "problem_id": "p02683", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02683/input.txt", "sample_output_relpath": "derived/input_output/data/p02683/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02683/Go/s429708093.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s429708093", "user_id": "u828471505"}, "prompt_components": {"gold_output": "120\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M, X int\n\tfmt.Scan(&N, &M, &X)\n\n\tC := make([]int, N)\n\tA := make([][]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&C[i])\n\t\tA[i] = make([]int, M)\n\t\tfor j := 0; j < M; j++ {\n\t\t\tfmt.Scan(&A[i][j])\n\t\t}\n\t}\n\tams := int(1e9)\n\tfor k := 0; k < 1<>uint(l))&1 == 1 {\n\t\t\t\tcost += C[l]\n\t\t\t\tfor p := 0; p < M; p++ {\n\t\t\t\t\ttmpl[p] += A[l][p]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tflag := true\n\t\tfor q := 0; q < M; q++ {\n\t\t\tif tmpl[q] < X {\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tif cost < ams {\n\t\t\t\tams = cost\n\t\t\t}\n\t\t}\n\t}\n\tif ams == int(1e9) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ams)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "sample_input": "3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n"}, "reference_outputs": ["120\n"], "source_document_id": "p02683", "source_text": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 705, "cpu_time_ms": 9, "memory_kb": 2220}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s076976709", "group_id": "codeNet:p02683", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\n\n\n\tl := nextLine()\n\n\tnc, _ := strconv.Atoi(l[0])\n\tmc, _ := strconv.Atoi(l[1])\n\tdx, _ := strconv.Atoi(l[2])\n\t\n\tbooks := make([][]int, nc)\n\tfor n := 0; n < nc; n++ {\n\t\tbooks[n] = make([]int, mc + 1)\n\n\t\tbl := nextLine()\n\t\tc, _ := strconv.Atoi(bl[0])\n\t\tbooks[n][0] = c\n\t\tfor m := 1; m <= mc; m++ {\n\t\t\tx, _ := strconv.Atoi(bl[m])\n\t\t\tbooks[n][m] = x\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", exec(books, nc, mc, dx))\n}\n\nfunc exec(books [][]int, nc int, mc int, dx int) int {\n\tvar patterns [][]int\n\tpatterns = append(patterns, make([]int, nc))\n\tpatterns = append(patterns, make([]int, nc))\n\tpatterns[len(patterns) - 1][0] = 1\n\n\tfor n := 1; n < len(books); n++ {\n\t\ttmp := patterns\n\t\tfor _, p := range(tmp) {\n\t\t\ttp := append([]int{}, p...)\n\t\t\ttp[n] = 1\n\t\t\tpatterns = append(patterns, tp)\n\t\t}\n\t}\n\n\tminCost := -1\n\tfor _, pattern := range(patterns) {\n\t\tret := checkBooks(pattern, books, mc, dx)\n\t\tif ret == -1 {\n\t\t\tcontinue\n\t\t}\n\t\tif minCost == -1 || ret < minCost {\n\t\t\tminCost = ret\n\t\t}\n\t}\n\treturn minCost\n}\n\n\nfunc checkBooks(pattern []int, books [][]int, mc int, dx int) int {\n\ttotals := make([]int, mc + 1)\n\tfor key, book := range(books) {\n\t\tif pattern[key] == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor k, v := range(book) {\n\t\t\ttotals[k] += v\n\t\t}\n\t}\n\n\tfor m := 1; m <= mc; m++ {\n\t\tif totals[m] < dx {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\treturn totals[0]\n}\n\nfunc remove(books [][]int, search int) [][]int {\n result := [][]int{}\n for k, v := range books {\n if k != search {\n result = append(result, v)\n }\n }\n return result\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\n// Reader\nvar limit int = 100000\nvar rdr = bufio.NewReaderSize(os.Stdin, limit)\n\nfunc nextLine() []string {\n\treturn parseLine(readLine())\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, limit)\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 parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "language": "Go", "metadata": {"date": 1589396435, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02683.html", "problem_id": "p02683", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02683/input.txt", "sample_output_relpath": "derived/input_output/data/p02683/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02683/Go/s076976709.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s076976709", "user_id": "u137939942"}, "prompt_components": {"gold_output": "120\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\n\n\n\tl := nextLine()\n\n\tnc, _ := strconv.Atoi(l[0])\n\tmc, _ := strconv.Atoi(l[1])\n\tdx, _ := strconv.Atoi(l[2])\n\t\n\tbooks := make([][]int, nc)\n\tfor n := 0; n < nc; n++ {\n\t\tbooks[n] = make([]int, mc + 1)\n\n\t\tbl := nextLine()\n\t\tc, _ := strconv.Atoi(bl[0])\n\t\tbooks[n][0] = c\n\t\tfor m := 1; m <= mc; m++ {\n\t\t\tx, _ := strconv.Atoi(bl[m])\n\t\t\tbooks[n][m] = x\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", exec(books, nc, mc, dx))\n}\n\nfunc exec(books [][]int, nc int, mc int, dx int) int {\n\tvar patterns [][]int\n\tpatterns = append(patterns, make([]int, nc))\n\tpatterns = append(patterns, make([]int, nc))\n\tpatterns[len(patterns) - 1][0] = 1\n\n\tfor n := 1; n < len(books); n++ {\n\t\ttmp := patterns\n\t\tfor _, p := range(tmp) {\n\t\t\ttp := append([]int{}, p...)\n\t\t\ttp[n] = 1\n\t\t\tpatterns = append(patterns, tp)\n\t\t}\n\t}\n\n\tminCost := -1\n\tfor _, pattern := range(patterns) {\n\t\tret := checkBooks(pattern, books, mc, dx)\n\t\tif ret == -1 {\n\t\t\tcontinue\n\t\t}\n\t\tif minCost == -1 || ret < minCost {\n\t\t\tminCost = ret\n\t\t}\n\t}\n\treturn minCost\n}\n\n\nfunc checkBooks(pattern []int, books [][]int, mc int, dx int) int {\n\ttotals := make([]int, mc + 1)\n\tfor key, book := range(books) {\n\t\tif pattern[key] == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tfor k, v := range(book) {\n\t\t\ttotals[k] += v\n\t\t}\n\t}\n\n\tfor m := 1; m <= mc; m++ {\n\t\tif totals[m] < dx {\n\t\t\treturn -1\n\t\t}\n\t}\n\n\treturn totals[0]\n}\n\nfunc remove(books [][]int, search int) [][]int {\n result := [][]int{}\n for k, v := range books {\n if k != search {\n result = append(result, v)\n }\n }\n return result\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\n// Reader\nvar limit int = 100000\nvar rdr = bufio.NewReaderSize(os.Stdin, limit)\n\nfunc nextLine() []string {\n\treturn parseLine(readLine())\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, limit)\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 parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "problem_context": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "sample_input": "3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n"}, "reference_outputs": ["120\n"], "source_document_id": "p02683", "source_text": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2142, "cpu_time_ms": 10, "memory_kb": 3128}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s631058721", "group_id": "codeNet:p02685", "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\tconst mod = 998244353\n\n\tpow := func(x, n int) int {\n\t\tx %= mod\n\t\tres := 1\n\t\tfor ; n > 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % mod\n\t\t\t}\n\t\t\tx = x * x % mod\n\t\t}\n\t\treturn res\n\t}\n\tinv := func(a int) int { return pow(a, mod-2) }\n\tconst mx int = 3e5\n\tF := [mx + 1]int{1}\n\tinvF := [mx + 1]int{inv(1)}\n\tfor i := 1; i <= mx; i++ {\n\t\tF[i] = F[i-1] * i % mod\n\t\tinvF[i] = inv(F[i])\n\t}\n\tcomb := func(n, k int) int { return F[n] * invF[k] % mod * invF[n-k] % mod }\n\n\tvar n, m, k, ans int\n\tFscan(in, &n, &m, &k)\n\tfor i := 0; i <= k; i++ {\n\t\tv := m\n\t\tv = v * comb(n-1, i) % mod\n\t\tv = v * pow(m-1, n-1-i) % mod\n\t\tans = (ans +v) % mod\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1589162360, "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/s631058721.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631058721", "user_id": "u235132324"}, "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)\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\tconst mod = 998244353\n\n\tpow := func(x, n int) int {\n\t\tx %= mod\n\t\tres := 1\n\t\tfor ; n > 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % mod\n\t\t\t}\n\t\t\tx = x * x % mod\n\t\t}\n\t\treturn res\n\t}\n\tinv := func(a int) int { return pow(a, mod-2) }\n\tconst mx int = 3e5\n\tF := [mx + 1]int{1}\n\tinvF := [mx + 1]int{inv(1)}\n\tfor i := 1; i <= mx; i++ {\n\t\tF[i] = F[i-1] * i % mod\n\t\tinvF[i] = inv(F[i])\n\t}\n\tcomb := func(n, k int) int { return F[n] * invF[k] % mod * invF[n-k] % mod }\n\n\tvar n, m, k, ans int\n\tFscan(in, &n, &m, &k)\n\tfor i := 0; i <= k; i++ {\n\t\tv := m\n\t\tv = v * comb(n-1, i) % mod\n\t\tv = v * pow(m-1, n-1-i) % mod\n\t\tans = (ans +v) % mod\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 71, "memory_kb": 6632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s465360905", "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\ntype Route struct {\n\ta int64\n\tb int64\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\tA := make([]int64, M)\n\tB := make([]int64, M)\n\tm := make(map[int64]int64, N)\n\troutes := make([]Route, M)\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[i], B[i] = readInt(), readInt()\n\t\troutes[i] = Route{a: A[i], b: B[i]}\n\t}\n\tans := int64(0)\n\tfor i := int64(0); i < M; i++ {\n\t\tm[routes[i].a]++\n\t\tm[routes[i].b]++\n\t}\n\tans = int64(len(m))/2 + 1\n\tans += N - int64(len(m))\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": 1588559808, "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/s465360905.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s465360905", "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\ntype Route struct {\n\ta int64\n\tb int64\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\tA := make([]int64, M)\n\tB := make([]int64, M)\n\tm := make(map[int64]int64, N)\n\troutes := make([]Route, M)\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[i], B[i] = readInt(), readInt()\n\t\troutes[i] = Route{a: A[i], b: B[i]}\n\t}\n\tans := int64(0)\n\tfor i := int64(0); i < M; i++ {\n\t\tm[routes[i].a]++\n\t\tm[routes[i].b]++\n\t}\n\tans = int64(len(m))/2 + 1\n\tans += N - int64(len(m))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6089, "cpu_time_ms": 56, "memory_kb": 9816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s580257048", "group_id": "codeNet:p02691", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, h, count int\n\tfmt.Scan(&n)\n\ths := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h)\n\t\ths = append(hs, h)\n\t}\n\tfor idx, val := range hs {\n\t\tif idx == n-1 {\n\t\t\tfmt.Println(count)\n\t\t\treturn\n\t\t}\n\t\tfor j := idx + 1; j < n; j++ {\n\t\t\tif j-idx == val+hs[j] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588562650, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02691.html", "problem_id": "p02691", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02691/input.txt", "sample_output_relpath": "derived/input_output/data/p02691/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02691/Go/s580257048.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s580257048", "user_id": "u167292194"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, h, count int\n\tfmt.Scan(&n)\n\ths := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h)\n\t\ths = append(hs, h)\n\t}\n\tfor idx, val := range hs {\n\t\tif idx == n-1 {\n\t\t\tfmt.Println(count)\n\t\t\treturn\n\t\t}\n\t\tfor j := idx + 1; j < n; j++ {\n\t\t\tif j-idx == val+hs[j] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\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\\ (1 \\leq i \\leq N)\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 number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "sample_input": "6\n2 3 3 1 3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02691", "source_text": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\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\\ (1 \\leq i \\leq N)\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 number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2206, "memory_kb": 10624}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s835143809", "group_id": "codeNet:p02691", "input_text": "package main\n\nimport \"fmt\"\n\nvar N int\nvar a []int\nvar maxs []int\n\nfunc main() {\n\tfmt.Scan(&N)\n\ta = make([]int, N)\n\tmaxs = make([]int, N)\n\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tmaxs[N-1] = a[N-1]\n\tfor i := len(a) - 2; i >= 0; i-- {\n\t\tmaxs[i] = max(maxs[i+1], a[i])\n\t}\n\n\tcnt := 0\n\tfor i := range a {\n\t\tAi := a[i]\n\t\tif i+Ai >= N {\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + Ai; j <= i+Ai+maxs[i+Ai] && j < N; j++ {\n\t\t\tif a[i]+a[j] == j-i {\n\t\t\t\tcnt++\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\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": 1588559400, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02691.html", "problem_id": "p02691", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02691/input.txt", "sample_output_relpath": "derived/input_output/data/p02691/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02691/Go/s835143809.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s835143809", "user_id": "u883678669"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar N int\nvar a []int\nvar maxs []int\n\nfunc main() {\n\tfmt.Scan(&N)\n\ta = make([]int, N)\n\tmaxs = make([]int, N)\n\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tmaxs[N-1] = a[N-1]\n\tfor i := len(a) - 2; i >= 0; i-- {\n\t\tmaxs[i] = max(maxs[i+1], a[i])\n\t}\n\n\tcnt := 0\n\tfor i := range a {\n\t\tAi := a[i]\n\t\tif i+Ai >= N {\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + Ai; j <= i+Ai+maxs[i+Ai] && j < N; j++ {\n\t\t\tif a[i]+a[j] == j-i {\n\t\t\t\tcnt++\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\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: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\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\\ (1 \\leq i \\leq N)\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 number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "sample_input": "6\n2 3 3 1 3 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02691", "source_text": "Score: 500 points\n\nProblem Statement\n\nYou are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens.\n\nThere are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i.\n\nAccording to an examination beforehand, you know that a pair of attendees satisfying the condition below will make the transaction.\n\nThe absolute difference of their attendee numbers is equal to the sum of their heights.\n\nThere are \\frac{N(N-1)}{2} ways to choose two from the N attendees and make a pair. Among them, how many satisfy the condition above?\n\nP.S.: We cannot let you know the secret.\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\\ (1 \\leq i \\leq N)\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 number of pairs satisfying the condition.\n\nSample Input 1\n\n6\n2 3 3 1 3 1\n\nSample Output 1\n\n3\n\nA_1 + A_4 = 3, so the pair of Attendee 1 and 4 satisfy the condition.\n\nA_2 + A_6 = 4, so the pair of Attendee 2 and 6 satisfy the condition.\n\nA_4 + A_6 = 2, so the pair of Attendee 4 and 6 satisfy the condition.\n\nNo other pair satisfies the condition, so you should print 3.\n\nSample Input 2\n\n6\n5 2 4 2 8 8\n\nSample Output 2\n\n0\n\nNo pair satisfies the condition, so you should print 0.\n\nSample Input 3\n\n32\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5\n\nSample Output 3\n\n22", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 534, "cpu_time_ms": 2207, "memory_kb": 8552}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s586992285", "group_id": "codeNet:p02692", "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 := getInt()\n\tA, B, C := getInt(), getInt(), getInt()\n\ts := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\ts[i] = getString()\n\t}\n\n\tif A+B+C == 0 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\n\tans := make([]byte, 0)\n\tfor i := 0; i < N; i++ {\n\t\tswitch s[i] {\n\t\tcase \"AB\":\n\t\t\tif A == 0 && B == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif A == 0 {\n\t\t\t\tans = append(ans, 'A')\n\t\t\t\tA++\n\t\t\t\tB--\n\t\t\t} else if B == 0 {\n\t\t\t\tans = append(ans, 'B')\n\t\t\t\tB++\n\t\t\t\tA--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"BC\" {\n\t\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\t\tB++\n\t\t\t\t\t\tA--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\t\tA++\n\t\t\t\t\t\tB--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\tA++\n\t\t\t\t\tB--\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"BC\":\n\t\t\tif B == 0 && C == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif B == 0 {\n\t\t\t\tans = append(ans, 'B')\n\t\t\t\tB++\n\t\t\t\tA--\n\t\t\t} else if C == 0 {\n\t\t\t\tans = append(ans, 'C')\n\t\t\t\tC++\n\t\t\t\tB--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"AB\" {\n\t\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\t\tB++\n\t\t\t\t\t\tC--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\t\tC++\n\t\t\t\t\t\tB--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\tB++\n\t\t\t\t\tC--\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"AC\":\n\t\t\tif A == 0 && C == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif A == 0 {\n\t\t\t\tans = append(ans, 'A')\n\t\t\t\tA++\n\t\t\t\tC--\n\t\t\t} else if C == 0 {\n\t\t\t\tans = append(ans, 'C')\n\t\t\t\tC++\n\t\t\t\tA--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"AB\" {\n\t\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\t\tA++\n\t\t\t\t\t\tC--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\t\tC++\n\t\t\t\t\t\tA--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\tC++\n\t\t\t\t\tA--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tout(\"Yes\")\n\tfor _, v := range ans {\n\t\tout(string(v))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588539613, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02692.html", "problem_id": "p02692", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02692/input.txt", "sample_output_relpath": "derived/input_output/data/p02692/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02692/Go/s586992285.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s586992285", "user_id": "u814575783"}, "prompt_components": {"gold_output": "Yes\nA\nC\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 := getInt()\n\tA, B, C := getInt(), getInt(), getInt()\n\ts := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\ts[i] = getString()\n\t}\n\n\tif A+B+C == 0 {\n\t\tout(\"No\")\n\t\treturn\n\t}\n\n\tans := make([]byte, 0)\n\tfor i := 0; i < N; i++ {\n\t\tswitch s[i] {\n\t\tcase \"AB\":\n\t\t\tif A == 0 && B == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif A == 0 {\n\t\t\t\tans = append(ans, 'A')\n\t\t\t\tA++\n\t\t\t\tB--\n\t\t\t} else if B == 0 {\n\t\t\t\tans = append(ans, 'B')\n\t\t\t\tB++\n\t\t\t\tA--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"BC\" {\n\t\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\t\tB++\n\t\t\t\t\t\tA--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\t\tA++\n\t\t\t\t\t\tB--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\tA++\n\t\t\t\t\tB--\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"BC\":\n\t\t\tif B == 0 && C == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif B == 0 {\n\t\t\t\tans = append(ans, 'B')\n\t\t\t\tB++\n\t\t\t\tA--\n\t\t\t} else if C == 0 {\n\t\t\t\tans = append(ans, 'C')\n\t\t\t\tC++\n\t\t\t\tB--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"AB\" {\n\t\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\t\tB++\n\t\t\t\t\t\tC--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\t\tC++\n\t\t\t\t\t\tB--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'B')\n\t\t\t\t\tB++\n\t\t\t\t\tC--\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"AC\":\n\t\t\tif A == 0 && C == 0 {\n\t\t\t\tout(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif A == 0 {\n\t\t\t\tans = append(ans, 'A')\n\t\t\t\tA++\n\t\t\t\tC--\n\t\t\t} else if C == 0 {\n\t\t\t\tans = append(ans, 'C')\n\t\t\t\tC++\n\t\t\t\tA--\n\t\t\t} else {\n\t\t\t\tif i+1 != N {\n\t\t\t\t\tif s[i+1] == \"AB\" {\n\t\t\t\t\t\tans = append(ans, 'A')\n\t\t\t\t\t\tA++\n\t\t\t\t\t\tC--\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\t\tC++\n\t\t\t\t\t\tA--\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tans = append(ans, 'C')\n\t\t\t\t\tC++\n\t\t\t\t\tA--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tout(\"Yes\")\n\tfor _, v := range ans {\n\t\tout(string(v))\n\t}\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a game that involves three variables, denoted A, B, and C.\n\nAs the game progresses, there will be N events where you are asked to make a choice.\nEach of these choices is represented by a string s_i. If s_i is AB, you must add 1 to A or B then subtract 1 from the other; if s_i is AC, you must add 1 to A or C then subtract 1 from the other; if s_i is BC, you must add 1 to B or C then subtract 1 from the other.\n\nAfter each choice, none of A, B, and C should be negative.\n\nDetermine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A,B,C \\leq 10^9\n\nN, A, B, C are integers.\n\ns_i is AB, AC, or BC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf it is possible to make N choices under the condition, print Yes; otherwise, print No.\n\nAlso, in the former case, show one such way to make the choices in the subsequent N lines. The (i+1)-th line should contain the name of the variable (A, B, or C) to which you add 1 in the i-th choice.\n\nSample Input 1\n\n2 1 3 0\nAB\nAC\n\nSample Output 1\n\nYes\nA\nC\n\nYou can successfully make two choices, as follows:\n\nIn the first choice, add 1 to A and subtract 1 from B. A becomes 2, and B becomes 2.\n\nIn the second choice, add 1 to C and subtract 1 from A. C becomes 1, and A becomes 1.\n\nSample Input 2\n\n3 1 0 0\nAB\nBC\nAB\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1 0 9 0\nAC\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n8 6 9 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB\n\nSample Output 4\n\nYes\nC\nB\nB\nC\nC\nB\nA\nA", "sample_input": "2 1 3 0\nAB\nAC\n"}, "reference_outputs": ["Yes\nA\nC\n"], "source_document_id": "p02692", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a game that involves three variables, denoted A, B, and C.\n\nAs the game progresses, there will be N events where you are asked to make a choice.\nEach of these choices is represented by a string s_i. If s_i is AB, you must add 1 to A or B then subtract 1 from the other; if s_i is AC, you must add 1 to A or C then subtract 1 from the other; if s_i is BC, you must add 1 to B or C then subtract 1 from the other.\n\nAfter each choice, none of A, B, and C should be negative.\n\nDetermine whether it is possible to make N choices under this condition. If it is possible, also give one such way to make the choices.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq A,B,C \\leq 10^9\n\nN, A, B, C are integers.\n\ns_i is AB, AC, or BC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\ns_1\ns_2\n:\ns_N\n\nOutput\n\nIf it is possible to make N choices under the condition, print Yes; otherwise, print No.\n\nAlso, in the former case, show one such way to make the choices in the subsequent N lines. The (i+1)-th line should contain the name of the variable (A, B, or C) to which you add 1 in the i-th choice.\n\nSample Input 1\n\n2 1 3 0\nAB\nAC\n\nSample Output 1\n\nYes\nA\nC\n\nYou can successfully make two choices, as follows:\n\nIn the first choice, add 1 to A and subtract 1 from B. A becomes 2, and B becomes 2.\n\nIn the second choice, add 1 to C and subtract 1 from A. C becomes 1, and A becomes 1.\n\nSample Input 2\n\n3 1 0 0\nAB\nBC\nAB\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1 0 9 0\nAC\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n8 6 9 1\nAC\nBC\nAB\nBC\nAC\nBC\nAB\nAB\n\nSample Output 4\n\nYes\nC\nB\nB\nC\nC\nB\nA\nA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2268, "cpu_time_ms": 177, "memory_kb": 5880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s041662433", "group_id": "codeNet:p02693", "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\tk := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tif k == 1 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif a%k == 0 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif b%k == 0 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif (b - a) >= k {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"NG\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1590206638, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/Go/s041662433.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s041662433", "user_id": "u756000295"}, "prompt_components": {"gold_output": "OK\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\tk := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tif k == 1 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif a%k == 0 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif b%k == 0 {\n\t\tfmt.Println(\"OK\")\n\t\treturn\n\t}\n\tif (b - a) >= k {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"NG\")\n\t}\n\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 507, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s704280483", "group_id": "codeNet:p02693", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, A, B int\n\n\tfmt.Scan(&K)\n\tfmt.Scan(&A, &B)\n\n\ti := 1\n\tfor {\n\t\tans := K * i\n\n\t\tif ans > A && ans < B {\n\t\t\tfmt.Println(\"OK\")\n\t\t\tbreak\n\t\t}\n\n\t\tif ans > A && ans > B {\n\t\t\tfmt.Println(\"NG\")\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588989721, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/Go/s704280483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s704280483", "user_id": "u979699056"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, A, B int\n\n\tfmt.Scan(&K)\n\tfmt.Scan(&A, &B)\n\n\ti := 1\n\tfor {\n\t\tans := K * i\n\n\t\tif ans > A && ans < B {\n\t\t\tfmt.Println(\"OK\")\n\t\t\tbreak\n\t\t}\n\n\t\tif ans > A && ans > B {\n\t\t\tfmt.Println(\"NG\")\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 2, "memory_kb": 1752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s906773900", "group_id": "codeNet:p02694", "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 nextFloat64() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer(nil, 100000000)\n\n\tx := nextInt()\n\n\tcredit := 100\n\tans := 0\n\tfor i := 0; credit < x; i++ {\n\t\tif i > 0 {\n\t\t\tcredit = int(float64(credit) * 1.01)\n\t\t\tans += 1\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598703856, "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/s906773900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s906773900", "user_id": "u998286277"}, "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 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\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer(nil, 100000000)\n\n\tx := nextInt()\n\n\tcredit := 100\n\tans := 0\n\tfor i := 0; credit < x; i++ {\n\t\tif i > 0 {\n\t\t\tcredit = int(float64(credit) * 1.01)\n\t\t\tans += 1\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 623, "cpu_time_ms": 8, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s625836523", "group_id": "codeNet:p02694", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar X int64\n _, err := fmt.Scanf(\"%d\", &X)\n var hund int64\n hund = 100\n counter :=0\n for (hund < X ){\n \n hund += int64(float64(hund)*.01)\n counter++\n }\n \n\n\tif err !=nil{\n\t\tlog.Fatal(err)\n }\n fmt.Print(counter)\n}\n", "language": "Go", "metadata": {"date": 1589394155, "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/s625836523.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625836523", "user_id": "u800776214"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar X int64\n _, err := fmt.Scanf(\"%d\", &X)\n var hund int64\n hund = 100\n counter :=0\n for (hund < X ){\n \n hund += int64(float64(hund)*.01)\n counter++\n }\n \n\n\tif err !=nil{\n\t\tlog.Fatal(err)\n }\n fmt.Print(counter)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 285, "cpu_time_ms": 4, "memory_kb": 1824}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s594718741", "group_id": "codeNet:p02694", "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 x int\n\tfmt.Fscan(r, &x)\n\n\tif 100 >= x {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 0\n\tnum := 100\n\tfor {\n\t\tans++\n\n\t\tnum = int(1.01 * float64(num))\n\t\tif num >= x {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\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 combination\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 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// Utility\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 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": 1588470595, "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/s594718741.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s594718741", "user_id": "u433254839"}, "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\tr := bufio.NewReader(os.Stdin)\n\tvar x int\n\tfmt.Fscan(r, &x)\n\n\tif 100 >= x {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 0\n\tnum := 100\n\tfor {\n\t\tans++\n\n\t\tnum = int(1.01 * float64(num))\n\t\tif num >= x {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\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 combination\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 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// Utility\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 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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3035, "cpu_time_ms": 5, "memory_kb": 1828}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s857512767", "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 := nextInt()\n\tvar c int\n\tfor i := 100; i < x; i += int(float64(i) * 0.01) {\n\t\tc++\n\t}\n\n\tfmt.Println(c)\n}\n\n// =================================\n// I/O util\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, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n// =================================\n", "language": "Go", "metadata": {"date": 1588469168, "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/s857512767.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s857512767", "user_id": "u390529125"}, "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 := nextInt()\n\tvar c int\n\tfor i := 100; i < x; i += int(float64(i) * 0.01) {\n\t\tc++\n\t}\n\n\tfmt.Println(c)\n}\n\n// =================================\n// I/O util\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, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s157634286", "group_id": "codeNet:p02694", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar x int\n\tfmt.Scan(&x)\n\tyokin := 100\n\tfor i:=1; i<3762 ; i++ {\n\t\tyokin += int(float64(yokin/100))\n\t\tif yokin >= x {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588468652, "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/s157634286.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s157634286", "user_id": "u145635628"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar x int\n\tfmt.Scan(&x)\n\tyokin := 100\n\tfor i:=1; i<3762 ; i++ {\n\t\tyokin += int(float64(yokin/100))\n\t\tif yokin >= x {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s143466442", "group_id": "codeNet:p02695", "input_text": "package main\n\nimport \"fmt\"\n\nvar n, m, q, ans int\nvar a, b, c, d []int\n\nfunc calc(nums []int) int {\n\tret := 0\n\tfor i := 0; i < q; i++ {\n\t\tif nums[b[i]]-nums[a[i]] == c[i] {\n\t\t\tret += d[i]\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc dfs(a []int, step int) {\n\tif step == n {\n\t\t// fmt.Println(\"a\", a, \"score\", calc(a))\n\t\tans = max(ans, calc(a))\n\t\treturn\n\t}\n\tvar s int\n\tif step == 0 {\n\t\ts = 1\n\t} else {\n\t\ts = a[len(a)-1]\n\t}\n\tfor i := s; i <= m; i++ {\n\t\tdfs(append(a, i), step+1)\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&n, &m, &q)\n\ta = make([]int, q)\n\tb = make([]int, q)\n\tc = make([]int, q)\n\td = make([]int, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scan(&a[i], &b[i], &c[i], &d[i])\n\t\ta[i]--\n\t\tb[i]--\n\t}\n\tdfs([]int{}, 0)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592361144, "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/s143466442.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s143466442", "user_id": "u196030116"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar n, m, q, ans int\nvar a, b, c, d []int\n\nfunc calc(nums []int) int {\n\tret := 0\n\tfor i := 0; i < q; i++ {\n\t\tif nums[b[i]]-nums[a[i]] == c[i] {\n\t\t\tret += d[i]\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc dfs(a []int, step int) {\n\tif step == n {\n\t\t// fmt.Println(\"a\", a, \"score\", calc(a))\n\t\tans = max(ans, calc(a))\n\t\treturn\n\t}\n\tvar s int\n\tif step == 0 {\n\t\ts = 1\n\t} else {\n\t\ts = a[len(a)-1]\n\t}\n\tfor i := s; i <= m; i++ {\n\t\tdfs(append(a, i), step+1)\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&n, &m, &q)\n\ta = make([]int, q)\n\tb = make([]int, q)\n\tc = make([]int, q)\n\td = make([]int, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scan(&a[i], &b[i], &c[i], &d[i])\n\t\ta[i]--\n\t\tb[i]--\n\t}\n\tdfs([]int{}, 0)\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 40, "memory_kb": 5976}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s807394375", "group_id": "codeNet:p02696", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b, n := scanInt(), scanInt(), scanInt()\n\n\tans := 0\n\tif n < b-1 {\n\t\tans = n\n\t} else {\n\t\tans = b - 1\n\t}\n\tfmt.Println(ans*a/b - ans/b*a)\n}\n", "language": "Go", "metadata": {"date": 1591838760, "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/s807394375.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s807394375", "user_id": "u475329018"}, "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 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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b, n := scanInt(), scanInt(), scanInt()\n\n\tans := 0\n\tif n < b-1 {\n\t\tans = n\n\t} else {\n\t\tans = b - 1\n\t}\n\tfmt.Println(ans*a/b - ans/b*a)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187240482", "group_id": "codeNet:p02696", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\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\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\nvar a, b, n int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b, n = nextInt(), nextInt(), nextInt()\n\tx := minInt(b-1, n)\n\t//fmt.Println(x)\n\tfmt.Println(int(a*x/b) - a*int(x/b))\n}\n", "language": "Go", "metadata": {"date": 1589520348, "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/s187240482.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187240482", "user_id": "u432333240"}, "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\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\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\nvar a, b, n int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b, n = nextInt(), nextInt(), nextInt()\n\tx := minInt(b-1, n)\n\t//fmt.Println(x)\n\tfmt.Println(int(a*x/b) - a*int(x/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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s139634449", "group_id": "codeNet:p02696", "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\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 ansa(a, b float64, n, c int, ch chan int) {\n\tans := 0\n\tfor x := c; x <= n; x++ {\n\t\tif int(math.Floor(a*float64(x)/b)-a*math.Floor(float64(x)/b)) >= ans {\n\t\t\tans = int(math.Floor(a*float64(x)/b) - a*math.Floor(float64(x)/b))\n\t\t}\n\t}\n\tch <- ans\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := float64(getInt())\n\tb := float64(getInt())\n\tn := getInt()\n\tans := 0\n\tchans := 0\n\tch := make(chan int)\n\tgo ansa(a, b, n, 0, ch)\n\tif n >= 1000000 {\n\t\tgo ansa(a, b, n/2, 0, ch)\n\t\tgo ansa(a, b, n, n/2, ch)\n\t\tchans = <-ch\n\t\tif chans > ans {\n\t\t\tans = chans\n\t\t}\n\t\tchans = <-ch\n\t\tif chans > ans {\n\t\t\tans = chans\n\t\t}\n\t\tclose(ch)\n\t\tout(ans)\n\t\tos.Exit(0)\n\t}\n\tans = <-ch\n\tclose(ch)\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1588487831, "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/s139634449.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s139634449", "user_id": "u663830728"}, "prompt_components": {"gold_output": "2\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\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 ansa(a, b float64, n, c int, ch chan int) {\n\tans := 0\n\tfor x := c; x <= n; x++ {\n\t\tif int(math.Floor(a*float64(x)/b)-a*math.Floor(float64(x)/b)) >= ans {\n\t\t\tans = int(math.Floor(a*float64(x)/b) - a*math.Floor(float64(x)/b))\n\t\t}\n\t}\n\tch <- ans\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := float64(getInt())\n\tb := float64(getInt())\n\tn := getInt()\n\tans := 0\n\tchans := 0\n\tch := make(chan int)\n\tgo ansa(a, b, n, 0, ch)\n\tif n >= 1000000 {\n\t\tgo ansa(a, b, n/2, 0, ch)\n\t\tgo ansa(a, b, n, n/2, ch)\n\t\tchans = <-ch\n\t\tif chans > ans {\n\t\t\tans = chans\n\t\t}\n\t\tchans = <-ch\n\t\tif chans > ans {\n\t\t\tans = chans\n\t\t}\n\t\tclose(ch)\n\t\tout(ans)\n\t\tos.Exit(0)\n\t}\n\tans = <-ch\n\tclose(ch)\n\tout(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1081, "cpu_time_ms": 2205, "memory_kb": 1844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s293160997", "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 s <= w {\n\t\tfmt.Println(\"unsafe\")\n\t} else {\n\t\tfmt.Println(\"safe\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587949294, "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/s293160997.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293160997", "user_id": "u461993794"}, "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 s <= w {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 149, "cpu_time_ms": 6, "memory_kb": 1752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614407537", "group_id": "codeNet:p02701", "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\tmp := map[string]bool{}\n\n\tfor i := 0; i < N; i++ {\n\t\tmp[sc.Next()] = true\n\t}\n\tfmt.Println(len(mp))\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": 1587949588, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02701.html", "problem_id": "p02701", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02701/input.txt", "sample_output_relpath": "derived/input_output/data/p02701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02701/Go/s614407537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614407537", "user_id": "u504669764"}, "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 := NewScanner()\n\tN := sc.NextInt()\n\tmp := map[string]bool{}\n\n\tfor i := 0; i < N; i++ {\n\t\tmp[sc.Next()] = true\n\t}\n\tfmt.Println(len(mp))\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 : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "sample_input": "3\napple\norange\napple\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2137, "cpu_time_ms": 93, "memory_kb": 16380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s853546472", "group_id": "codeNet:p02706", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n var answer int\n \tsum := 0\n fmt.Scan(&n, &m)\n var a[11111] int\n for i := 0 ; i < m ; i++{\n fmt.Scan(&a[i])\n sum += a[i]\n }\n answer = n - sum\n if answer < 0 {\n answer = -1\n }\n fmt.Println(answer)\n}", "language": "Go", "metadata": {"date": 1587613025, "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/s853546472.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s853546472", "user_id": "u522945946"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n var answer int\n \tsum := 0\n fmt.Scan(&n, &m)\n var a[11111] int\n for i := 0 ; i < m ; i++{\n fmt.Scan(&a[i])\n sum += a[i]\n }\n answer = n - sum\n if answer < 0 {\n answer = -1\n }\n fmt.Println(answer)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "sample_input": "41 2\n5 6\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02706", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 311, "cpu_time_ms": 58, "memory_kb": 2508}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614160951", "group_id": "codeNet:p02707", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readI()\n\ta := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta[readI()-1]++\n\t}\n\tfor _, v := range a {\n\t\tfmt.Println(v)\n\t}\n}\n\n/*-----------Utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1597627977, "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/s614160951.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614160951", "user_id": "u533258444"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\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 := readI()\n\ta := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta[readI()-1]++\n\t}\n\tfor _, v := range a {\n\t\tfmt.Println(v)\n\t}\n}\n\n/*-----------Utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 364, "memory_kb": 6200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272267962", "group_id": "codeNet:p02707", "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 scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tvar N int\n\tif scanner.Scan() {\n\t\tN, _ = strconv.Atoi(scanner.Text())\n\t}\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \" \")\n\tm := map[int]int{}\n\tfor _, v := range slice {\n\t\ta, _ := strconv.Atoi(v)\n\t\tm[a]++\n\t}\n\n\tfor i := 1; i < N+1; i++ {\n\t\tv, is := m[i]\n\t\tif is {\n\t\t\tfmt.Println(v)\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1588470060, "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/s272267962.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s272267962", "user_id": "u002831011"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\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 scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tvar N int\n\tif scanner.Scan() {\n\t\tN, _ = strconv.Atoi(scanner.Text())\n\t}\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \" \")\n\tm := map[int]int{}\n\tfor _, v := range slice {\n\t\ta, _ := strconv.Atoi(v)\n\t\tm[a]++\n\t}\n\n\tfor i := 1; i < N+1; i++ {\n\t\tv, is := m[i]\n\t\tif is {\n\t\t\tfmt.Println(v)\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t}\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 311, "memory_kb": 1972}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s929229781", "group_id": "codeNet:p02707", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tmaxBufsize = 1000000\n)\n\nfunc inputs(lines int) []string {\n\tvar strSlice []string\n\n\trdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\n\tfor i := 0; i < lines; i++ {\n\n\t\tline := ReadLine(rdr)\n\t\tstrSlice = append(strSlice, line)\n\n\t}\n\n\treturn strSlice\n}\n\n// ReadLine is to read long line\nfunc ReadLine(rdr *bufio.Reader) string {\n\tbuf := make([]byte, 0, maxBufsize)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\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\n\treturn string(buf)\n}\n\nfunc main() {\n\tlines := inputs(2)\n\n\tN, _ := strconv.Atoi(lines[0])\n\n\tA := make([]int, N+1)\n\n\ttmpArray := strings.Split(lines[1], \" \")\n\tfor i := 2; i <= N; i++ {\n\t\tA[i], _ = strconv.Atoi(tmpArray[i-2])\n\t}\n\n\tcnt := make([]int, N+1)\n\n\tfor i := 2; i <= N; i++ {\n\t\tcnt[A[i]]++\n\t}\n\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Println(cnt[i])\n\t}\n\n}", "language": "Go", "metadata": {"date": 1587433589, "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/s929229781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s929229781", "user_id": "u549085051"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\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\nconst (\n\tmaxBufsize = 1000000\n)\n\nfunc inputs(lines int) []string {\n\tvar strSlice []string\n\n\trdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\n\tfor i := 0; i < lines; i++ {\n\n\t\tline := ReadLine(rdr)\n\t\tstrSlice = append(strSlice, line)\n\n\t}\n\n\treturn strSlice\n}\n\n// ReadLine is to read long line\nfunc ReadLine(rdr *bufio.Reader) string {\n\tbuf := make([]byte, 0, maxBufsize)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\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\n\treturn string(buf)\n}\n\nfunc main() {\n\tlines := inputs(2)\n\n\tN, _ := strconv.Atoi(lines[0])\n\n\tA := make([]int, N+1)\n\n\ttmpArray := strings.Split(lines[1], \" \")\n\tfor i := 2; i <= N; i++ {\n\t\tA[i], _ = strconv.Atoi(tmpArray[i-2])\n\t}\n\n\tcnt := make([]int, N+1)\n\n\tfor i := 2; i <= N; i++ {\n\t\tcnt[A[i]]++\n\t}\n\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Println(cnt[i])\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 348, "memory_kb": 11584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s576899083", "group_id": "codeNet:p02708", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INFINITY = math.MaxInt64/2 - 1\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tn := stdin.ReadInt()\n\tk := stdin.ReadInt()\n\n\tmin := 0\n\tmax := 0\n\tfor i := 0; i < k; i++ {\n\t\tmin += i\n\t\tmax += n - i\n\t}\n\n\tleft := k\n\tright := n - k\n\n\tans := 0\n\tfor i := k; i <= n+1; i++ {\n\t\tans += max - min + 1\n\t\tans %= 1000000000 + 7\n\t\tmin += left\n\t\tmax += right\n\t\tleft += 1\n\t\tright -= 1\n\t}\n\n\tstdout.Println(ans)\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), INFINITY)\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\nfunc (s *Stdin) ReadIntSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.ReadInt()\n\t}\n\treturn a\n}\n\nfunc (s *Stdin) ReadStringSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.Read()\n\t}\n\treturn a\n}\n\nfunc (s *Stdin) ReadFloat64Slice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.ReadFloat64()\n\t}\n\treturn a\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 Min(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif v < a {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Max(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif a < v {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t} else {\n\t\treturn x * -1\n\t}\n}\n\nfunc Pow(x, y int) int {\n\tz := 1\n\tfor y > 0 {\n\t\tif y%2 == 0 {\n\t\t\tx *= x\n\t\t\ty /= 2\n\t\t} else {\n\t\t\tz *= x\n\t\t\ty -= 1\n\t\t}\n\t}\n\treturn z\n}\n\nfunc CreateMatrix(x, y int) [][]int {\n\tmatrix := make([][]int, x)\n\tfor i := 0; i < x; i++ {\n\t\tmatrix[i] = make([]int, y)\n\t}\n\treturn matrix\n}\n", "language": "Go", "metadata": {"date": 1587345754, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02708/input.txt", "sample_output_relpath": "derived/input_output/data/p02708/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02708/Go/s576899083.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576899083", "user_id": "u794250528"}, "prompt_components": {"gold_output": "10\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 INFINITY = math.MaxInt64/2 - 1\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tn := stdin.ReadInt()\n\tk := stdin.ReadInt()\n\n\tmin := 0\n\tmax := 0\n\tfor i := 0; i < k; i++ {\n\t\tmin += i\n\t\tmax += n - i\n\t}\n\n\tleft := k\n\tright := n - k\n\n\tans := 0\n\tfor i := k; i <= n+1; i++ {\n\t\tans += max - min + 1\n\t\tans %= 1000000000 + 7\n\t\tmin += left\n\t\tmax += right\n\t\tleft += 1\n\t\tright -= 1\n\t}\n\n\tstdout.Println(ans)\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), INFINITY)\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\nfunc (s *Stdin) ReadIntSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.ReadInt()\n\t}\n\treturn a\n}\n\nfunc (s *Stdin) ReadStringSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.Read()\n\t}\n\treturn a\n}\n\nfunc (s *Stdin) ReadFloat64Slice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = s.ReadFloat64()\n\t}\n\treturn a\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 Min(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif v < a {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Max(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif a < v {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t} else {\n\t\treturn x * -1\n\t}\n}\n\nfunc Pow(x, y int) int {\n\tz := 1\n\tfor y > 0 {\n\t\tif y%2 == 0 {\n\t\t\tx *= x\n\t\t\ty /= 2\n\t\t} else {\n\t\t\tz *= x\n\t\t\ty -= 1\n\t\t}\n\t}\n\treturn z\n}\n\nfunc CreateMatrix(x, y int) [][]int {\n\tmatrix := make([][]int, x)\n\tfor i := 0; i < x; i++ {\n\t\tmatrix[i] = make([]int, y)\n\t}\n\treturn matrix\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "sample_input": "3 2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02708", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2241, "cpu_time_ms": 5, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s333285500", "group_id": "codeNet:p02709", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype As [][]int\n\nfunc (a As) Len() int {\n\treturn len(a)\n}\n\nfunc (a As) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc (a As) Less(i, j int) bool {\n\treturn a[i][0] > a[j][0]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tas := make(As, n)\n\tos := make([]int, n)\n\tfor i := range as {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tas[i] = []int{a, i}\n\t\tos[i] = a\n\t}\n\tsort.Sort(as)\n\tvar sum int\n\tl := 0\n\tr := n - 1\n\tm := make(map[int]bool)\n\tfor i := range as {\n\t\ta, p := as[i][0], as[i][1]\n\t\tm[p] = true\n\t\tls := a * abs(p-l)\n\t\tfor j := l; j < p; j++ {\n\t\t\tif _, ok := m[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tls += os[j]\n\t\t}\n\t\trs := a * abs(r-p)\n\t\tfor j := p + 1; j <= r; j++ {\n\t\t\tif _, ok := m[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trs += os[j]\n\t\t}\n\n\t\tif ls > rs {\n\t\t\tsum += a * abs(p-l)\n\t\t\t//fmt.Println(\"[l] ls,rs: \", ls, rs)\n\t\t\tl += 1\n\t\t} else {\n\t\t\tsum += a * abs(r-p)\n\t\t\t//fmt.Println(\"[r] ls,rs: \", ls, rs)\n\t\t\tr -= 1\n\t\t}\n\t}\n\tfmt.Println(sum)\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": 1587349945, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02709.html", "problem_id": "p02709", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02709/input.txt", "sample_output_relpath": "derived/input_output/data/p02709/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02709/Go/s333285500.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s333285500", "user_id": "u282164747"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype As [][]int\n\nfunc (a As) Len() int {\n\treturn len(a)\n}\n\nfunc (a As) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc (a As) Less(i, j int) bool {\n\treturn a[i][0] > a[j][0]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tas := make(As, n)\n\tos := make([]int, n)\n\tfor i := range as {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tas[i] = []int{a, i}\n\t\tos[i] = a\n\t}\n\tsort.Sort(as)\n\tvar sum int\n\tl := 0\n\tr := n - 1\n\tm := make(map[int]bool)\n\tfor i := range as {\n\t\ta, p := as[i][0], as[i][1]\n\t\tm[p] = true\n\t\tls := a * abs(p-l)\n\t\tfor j := l; j < p; j++ {\n\t\t\tif _, ok := m[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tls += os[j]\n\t\t}\n\t\trs := a * abs(r-p)\n\t\tfor j := p + 1; j <= r; j++ {\n\t\t\tif _, ok := m[j]; ok {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trs += os[j]\n\t\t}\n\n\t\tif ls > rs {\n\t\t\tsum += a * abs(p-l)\n\t\t\t//fmt.Println(\"[l] ls,rs: \", ls, rs)\n\t\t\tl += 1\n\t\t} else {\n\t\t\tsum += a * abs(r-p)\n\t\t\t//fmt.Println(\"[r] ls,rs: \", ls, rs)\n\t\t\tr -= 1\n\t\t}\n\t}\n\tfmt.Println(sum)\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 : 500 points\n\nProblem Statement\n\nThere are N children standing in a line from left to right. The activeness of the i-th child from the left is A_i.\n\nYou can rearrange these children just one time in any order you like.\n\nWhen a child who originally occupies the x-th position from the left in the line moves to the y-th position from the left, that child earns A_x \\times |x-y| happiness points.\n\nFind the maximum total happiness points the children can earn.\n\nConstraints\n\n2 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum total happiness points the children can earn.\n\nSample Input 1\n\n4\n1 3 4 2\n\nSample Output 1\n\n20\n\nIf we move the 1-st child from the left to the 3-rd position from the left, the 2-nd child to the 4-th position, the 3-rd child to the 1-st position, and the 4-th child to the 2-nd position, the children earns 1 \\times |1-3|+3 \\times |2-4|+4 \\times |3-1|+2 \\times |4-2|=20 happiness points in total.\n\nSample Input 2\n\n6\n5 5 6 1 1 1\n\nSample Output 2\n\n58\n\nSample Input 3\n\n6\n8 6 9 1 2 1\n\nSample Output 3\n\n85", "sample_input": "4\n1 3 4 2\n"}, "reference_outputs": ["20\n"], "source_document_id": "p02709", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N children standing in a line from left to right. The activeness of the i-th child from the left is A_i.\n\nYou can rearrange these children just one time in any order you like.\n\nWhen a child who originally occupies the x-th position from the left in the line moves to the y-th position from the left, that child earns A_x \\times |x-y| happiness points.\n\nFind the maximum total happiness points the children can earn.\n\nConstraints\n\n2 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum total happiness points the children can earn.\n\nSample Input 1\n\n4\n1 3 4 2\n\nSample Output 1\n\n20\n\nIf we move the 1-st child from the left to the 3-rd position from the left, the 2-nd child to the 4-th position, the 3-rd child to the 1-st position, and the 4-th child to the 2-nd position, the children earns 1 \\times |1-3|+3 \\times |2-4|+4 \\times |3-1|+2 \\times |4-2|=20 happiness points in total.\n\nSample Input 2\n\n6\n5 5 6 1 1 1\n\nSample Output 2\n\n58\n\nSample Input 3\n\n6\n8 6 9 1 2 1\n\nSample Output 3\n\n85", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1011, "cpu_time_ms": 69, "memory_kb": 2256}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s705605815", "group_id": "codeNet:p02712", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tsum := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif i%3 != 0 && i%5 != 0 {\n\t\t\tsum += i\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1590728564, "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/s705605815.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s705605815", "user_id": "u162326103"}, "prompt_components": {"gold_output": "60\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\tsum := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif i%3 != 0 && i%5 != 0 {\n\t\t\tsum += i\n\t\t}\n\t}\n\tfmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 184, "cpu_time_ms": 12, "memory_kb": 1816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717261361", "group_id": "codeNet:p02719", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K int64\n\tfmt.Scan(&N, &K)\n\tvar tmp int64\n\tN = N % K\n\tfor {\n\t\ttmp = N - K\n\n\t\tif tmp < 0 {\n\t\t\ttmp = -1 * tmp\n\t\t}\n\t\tif tmp < N {\n\t\t\tN = tmp\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tif N == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(N)\n\n}\n", "language": "Go", "metadata": {"date": 1586051762, "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/s717261361.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s717261361", "user_id": "u950580836"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K int64\n\tfmt.Scan(&N, &K)\n\tvar tmp int64\n\tN = N % K\n\tfor {\n\t\ttmp = N - K\n\n\t\tif tmp < 0 {\n\t\t\ttmp = -1 * tmp\n\t\t}\n\t\tif tmp < N {\n\t\t\tN = tmp\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tif N == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(N)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s539736102", "group_id": "codeNet:p02719", "input_text": "package main\n\nimport \"fmt\"\n\nfunc abs(num int) int {\n\tif num >= 0 {\n\t\treturn num\n\t} else {\n\t\treturn -num\n\t}\n}\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\n\tvar ans1, ans2 int\n\tans1 = N - K*(N/K)\n\tans2 = abs(N - K*((N/K)+1))\n\tif ans1 < ans2 {\n\t\tfmt.Println(ans1)\n\t} else {\n\t\tfmt.Println(ans2)\n\t}\n}", "language": "Go", "metadata": {"date": 1586051380, "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/s539736102.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s539736102", "user_id": "u163829702"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc abs(num int) int {\n\tif num >= 0 {\n\t\treturn num\n\t} else {\n\t\treturn -num\n\t}\n}\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\n\tvar ans1, ans2 int\n\tans1 = N - K*(N/K)\n\tans2 = abs(N - K*((N/K)+1))\n\tif ans1 < ans2 {\n\t\tfmt.Println(ans1)\n\t} else {\n\t\tfmt.Println(ans2)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s426203968", "group_id": "codeNet:p02719", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\tif k != 1 {\n\t\tfmt.Println(gcd(n, k))\n\t} else {\n\t\tfmt.Println(0)\n\t}\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", "language": "Go", "metadata": {"date": 1586050881, "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/s426203968.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s426203968", "user_id": "u917346607"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\tif k != 1 {\n\t\tfmt.Println(gcd(n, k))\n\t} else {\n\t\tfmt.Println(0)\n\t}\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s597923520", "group_id": "codeNet:p02720", "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\n\tk := sc.ReadInt()\n\tif k < 10 {\n\t\tfmt.Println(k)\n\t\treturn\n\t}\n\n\tdpTable := make([][]int, 1)\n\t// dynamic planning table[row index][column index]\n\t//\n\t// row index: the length of lunlun numbers - 1\n\t// e.g. dpTable[2] means the length is 3. 123, 234, etc.\n\t//\n\t// column index:\n\t// * 0 is dummy\n\t// * 1 to 10 is the [row index - 1]th number\n\t// e.g. dpTable[2][5] means the 3rd number is 4. 432, 443, etc.\n\t// dpTable[2][1] means the 3rd number is 0. 001, 012, etc.\n\t// * 11 is dummy\n\t//\n\t// cell: the count of lunlun numbers\n\t// e.g. dpTable[2][5] == 100 (really it is wrong) means\n\t// the count of lunlun numbers like \"4**\" is 100.\n\t// dbTable[*][0 or 11] is always 0.\n\n\t// fill zeroth row\n\t// Let 0 be a lunlun number though in fact it is not.\n\tdpRow0 := make([]int, 12)\n\tdpTable[0] = dpRow0\n\tfor i := 1; i <= 10; i++ {\n\t\tdpRow0[i] = 1\n\t}\n\n\t// fill first row and more\n\tlunlunCount := 9 // do not include 0 here\n\trowI := 0 // row index\n\tcolI := 1 // column index\n\tfor lunlunCount < k {\n\t\trowI++\n\t\tdpPrevRow := dpTable[rowI-1]\n\t\tdpRow := make([]int, 12)\n\t\tdpTable = append(dpTable, dpRow)\n\t\tfor colI = 1; colI <= 10; colI++ {\n\t\t\tdpRowI := dpPrevRow[colI-1] + dpPrevRow[colI] + dpPrevRow[colI+1]\n\t\t\tdpRow[colI] = dpRowI\n\n\t\t\t// If colI == 1, the number has leading zero,\n\t\t\t// so lunlunCount does not include it.\n\t\t\tif colI > 1 {\n\t\t\t\tlunlunCount += dpRowI\n\t\t\t\tif lunlunCount >= k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trestLunlunCount := k - (lunlunCount - dpTable[rowI][colI])\n\t// The [k]th lunlun number belongs to dpTable[rowI][colI] and\n\t// it is [restLunlunCount]th number there.\n\n\t// compute the answer with determining where the [k]th lunlun number\n\t// belongs to in every row\n\tanswer := int64(colI - 1)\n\tfor rowI > 0 {\n\t\trowI--\n\t\tcolI--\n\t\tcheckedLunlunCount := 0\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tnext := dpTable[rowI][colI]\n\t\t\tif checkedLunlunCount+next >= restLunlunCount {\n\t\t\t\tanswer = answer*10 + int64(colI-1)\n\t\t\t\trestLunlunCount -= checkedLunlunCount\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcheckedLunlunCount += next\n\t\t\tcolI++\n\t\t}\n\t}\n\n\tfmt.Println(answer)\n}\n\n// util\n// * math(int)\n\nfunc AbsInt(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc MinInt(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxInt(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc PowInt(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\n// * math(int)\n\nfunc AbsInt64(x int64) int64 {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc MinInt64(values ...int64) int64 {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxInt64(values ...int64) int64 {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc PowInt64(base int64, exponent uint) int64 {\n\tanswer := int64(1)\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1586138206, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Go/s597923520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s597923520", "user_id": "u344542101"}, "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\nfunc main() {\n\tsc := NewScanner()\n\n\tk := sc.ReadInt()\n\tif k < 10 {\n\t\tfmt.Println(k)\n\t\treturn\n\t}\n\n\tdpTable := make([][]int, 1)\n\t// dynamic planning table[row index][column index]\n\t//\n\t// row index: the length of lunlun numbers - 1\n\t// e.g. dpTable[2] means the length is 3. 123, 234, etc.\n\t//\n\t// column index:\n\t// * 0 is dummy\n\t// * 1 to 10 is the [row index - 1]th number\n\t// e.g. dpTable[2][5] means the 3rd number is 4. 432, 443, etc.\n\t// dpTable[2][1] means the 3rd number is 0. 001, 012, etc.\n\t// * 11 is dummy\n\t//\n\t// cell: the count of lunlun numbers\n\t// e.g. dpTable[2][5] == 100 (really it is wrong) means\n\t// the count of lunlun numbers like \"4**\" is 100.\n\t// dbTable[*][0 or 11] is always 0.\n\n\t// fill zeroth row\n\t// Let 0 be a lunlun number though in fact it is not.\n\tdpRow0 := make([]int, 12)\n\tdpTable[0] = dpRow0\n\tfor i := 1; i <= 10; i++ {\n\t\tdpRow0[i] = 1\n\t}\n\n\t// fill first row and more\n\tlunlunCount := 9 // do not include 0 here\n\trowI := 0 // row index\n\tcolI := 1 // column index\n\tfor lunlunCount < k {\n\t\trowI++\n\t\tdpPrevRow := dpTable[rowI-1]\n\t\tdpRow := make([]int, 12)\n\t\tdpTable = append(dpTable, dpRow)\n\t\tfor colI = 1; colI <= 10; colI++ {\n\t\t\tdpRowI := dpPrevRow[colI-1] + dpPrevRow[colI] + dpPrevRow[colI+1]\n\t\t\tdpRow[colI] = dpRowI\n\n\t\t\t// If colI == 1, the number has leading zero,\n\t\t\t// so lunlunCount does not include it.\n\t\t\tif colI > 1 {\n\t\t\t\tlunlunCount += dpRowI\n\t\t\t\tif lunlunCount >= k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\trestLunlunCount := k - (lunlunCount - dpTable[rowI][colI])\n\t// The [k]th lunlun number belongs to dpTable[rowI][colI] and\n\t// it is [restLunlunCount]th number there.\n\n\t// compute the answer with determining where the [k]th lunlun number\n\t// belongs to in every row\n\tanswer := int64(colI - 1)\n\tfor rowI > 0 {\n\t\trowI--\n\t\tcolI--\n\t\tcheckedLunlunCount := 0\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tnext := dpTable[rowI][colI]\n\t\t\tif checkedLunlunCount+next >= restLunlunCount {\n\t\t\t\tanswer = answer*10 + int64(colI-1)\n\t\t\t\trestLunlunCount -= checkedLunlunCount\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcheckedLunlunCount += next\n\t\t\tcolI++\n\t\t}\n\t}\n\n\tfmt.Println(answer)\n}\n\n// util\n// * math(int)\n\nfunc AbsInt(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc MinInt(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxInt(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc PowInt(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\n// * math(int)\n\nfunc AbsInt64(x int64) int64 {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc MinInt64(values ...int64) int64 {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxInt64(values ...int64) int64 {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc PowInt64(base int64, exponent uint) int64 {\n\tanswer := int64(1)\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3814, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s050396070", "group_id": "codeNet:p02720", "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\n\tk := ScanInt()\n\tn := int64(0)\n\tfor i := 1; i <= k; i++ {\n\t\tn++\n\t\tl := n % 10\n\t\tla := (n / 10) % 10\n\t\tif (n / 10) > 0 && abs(la-l) > 1 {\n\t\t\tn = n / 10\n\t\t\tif n % 10 == 9 {\n\t\t\t\tn = n *10 + 8\n\t\t\t} else {\n\t\t\t\tn++\n\t\t\t\tl = (n % 10) - 1\n\t\t\t\tif l == -1 {\n\t\t\t\t\tl = n % 10\n\t\t\t\t}\n\t\t\t\tn = 10*n + l\n\t\t\t}\n\t\t}\n\t\t//P(\">>\", n)\n\t}\n\tP(n)\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n}\n\nfunc ScanWord() string { in.Scan(); return in.Text() }\nfunc ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }\nfunc ScanStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\nfunc ScanIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ScanInt()\n\t}\n\treturn arr\n}\n\n/*********************** Utils ***********************/\n\nfunc S(v interface{}) string { return fmt.Sprintf(\"%v\", v) }\nfunc MnMx(args ...int) (int, int) {\n\tminVal, maxVal := int(math.MaxInt32), int(math.MinInt32)\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc Mn(args ...int) int { mn, _ := MnMx(args...); return mn }\nfunc Mx(args ...int) int { _, mx := MnMx(args...); return mx }\nfunc LCM(a, b int) int { return a / GCD(a, b) * b }\nfunc GCD(a, b int) int {\n\tif a == 0 {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1586054395, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Go/s050396070.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s050396070", "user_id": "u308571599"}, "prompt_components": {"gold_output": "23\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\n\tk := ScanInt()\n\tn := int64(0)\n\tfor i := 1; i <= k; i++ {\n\t\tn++\n\t\tl := n % 10\n\t\tla := (n / 10) % 10\n\t\tif (n / 10) > 0 && abs(la-l) > 1 {\n\t\t\tn = n / 10\n\t\t\tif n % 10 == 9 {\n\t\t\t\tn = n *10 + 8\n\t\t\t} else {\n\t\t\t\tn++\n\t\t\t\tl = (n % 10) - 1\n\t\t\t\tif l == -1 {\n\t\t\t\t\tl = n % 10\n\t\t\t\t}\n\t\t\t\tn = 10*n + l\n\t\t\t}\n\t\t}\n\t\t//P(\">>\", n)\n\t}\n\tP(n)\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n}\n\nfunc ScanWord() string { in.Scan(); return in.Text() }\nfunc ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }\nfunc ScanStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\nfunc ScanIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ScanInt()\n\t}\n\treturn arr\n}\n\n/*********************** Utils ***********************/\n\nfunc S(v interface{}) string { return fmt.Sprintf(\"%v\", v) }\nfunc MnMx(args ...int) (int, int) {\n\tminVal, maxVal := int(math.MaxInt32), int(math.MinInt32)\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc Mn(args ...int) int { mn, _ := MnMx(args...); return mn }\nfunc Mx(args ...int) int { _, mx := MnMx(args...); return mx }\nfunc LCM(a, b int) int { return a / GCD(a, b) * b }\nfunc GCD(a, b int) int {\n\tif a == 0 {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1694, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s021841481", "group_id": "codeNet:p02720", "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\t//n := int64(12)\n\t//n++\n\t//l := n % 10\n\t//la := (n / 10) % 10\n\t//if la > 0 && abs(la-l) > 1 {\n\t//\tn = n / 10\n\t//\tn++\n\t//\tl = (n % 10) - 1\n\t//\tn = 10*n + l\n\t//}\n\t//P(\">>\", n)\n\n\tk := ScanInt()\n\tn := int64(0)\n\tfor i := 1; i <= k; i++ {\n\t\tn++\n\t\tl := n % 10\n\t\tla := (n / 10) % 10\n\t\tif la > 0 && abs(la-l) > 1 {\n\t\t\tn = n / 10\n\t\t\tif n % 10 == 9 {\n\t\t\t\tn = n *10 + 8\n\t\t\t} else {\n\t\t\t\tn++\n\t\t\t\tl = (n % 10) - 1\n\t\t\t\tif l == -1 {\n\t\t\t\t\tl = n % 10\n\t\t\t\t}\n\t\t\t\tn = 10*n + l\n\t\t\t}\n\t\t}\n\t\t//P(\">>\", n)\n\t}\n\tP(n)\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n}\n\nfunc ScanWord() string { in.Scan(); return in.Text() }\nfunc ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }\nfunc ScanStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\nfunc ScanIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ScanInt()\n\t}\n\treturn arr\n}\n\n/*********************** Utils ***********************/\n\nfunc S(v interface{}) string { return fmt.Sprintf(\"%v\", v) }\nfunc MnMx(args ...int) (int, int) {\n\tminVal, maxVal := int(math.MaxInt32), int(math.MinInt32)\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc Mn(args ...int) int { mn, _ := MnMx(args...); return mn }\nfunc Mx(args ...int) int { _, mx := MnMx(args...); return mx }\nfunc LCM(a, b int) int { return a / GCD(a, b) * b }\nfunc GCD(a, b int) int {\n\tif a == 0 {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1586054310, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Go/s021841481.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s021841481", "user_id": "u308571599"}, "prompt_components": {"gold_output": "23\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\t//n := int64(12)\n\t//n++\n\t//l := n % 10\n\t//la := (n / 10) % 10\n\t//if la > 0 && abs(la-l) > 1 {\n\t//\tn = n / 10\n\t//\tn++\n\t//\tl = (n % 10) - 1\n\t//\tn = 10*n + l\n\t//}\n\t//P(\">>\", n)\n\n\tk := ScanInt()\n\tn := int64(0)\n\tfor i := 1; i <= k; i++ {\n\t\tn++\n\t\tl := n % 10\n\t\tla := (n / 10) % 10\n\t\tif la > 0 && abs(la-l) > 1 {\n\t\t\tn = n / 10\n\t\t\tif n % 10 == 9 {\n\t\t\t\tn = n *10 + 8\n\t\t\t} else {\n\t\t\t\tn++\n\t\t\t\tl = (n % 10) - 1\n\t\t\t\tif l == -1 {\n\t\t\t\t\tl = n % 10\n\t\t\t\t}\n\t\t\t\tn = 10*n + l\n\t\t\t}\n\t\t}\n\t\t//P(\">>\", n)\n\t}\n\tP(n)\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n}\n\nfunc ScanWord() string { in.Scan(); return in.Text() }\nfunc ScanInt() int { i, _ := strconv.Atoi(ScanWord()); return i }\nfunc ScanStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ScanWord()\n\t}\n\treturn s\n}\nfunc ScanIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ScanInt()\n\t}\n\treturn arr\n}\n\n/*********************** Utils ***********************/\n\nfunc S(v interface{}) string { return fmt.Sprintf(\"%v\", v) }\nfunc MnMx(args ...int) (int, int) {\n\tminVal, maxVal := int(math.MaxInt32), int(math.MinInt32)\n\tfor _, v := range args {\n\t\tif v < minVal {\n\t\t\tminVal = v\n\t\t}\n\t\tif v > maxVal {\n\t\t\tmaxVal = v\n\t\t}\n\t}\n\treturn minVal, maxVal\n}\nfunc Mn(args ...int) int { mn, _ := MnMx(args...); return mn }\nfunc Mx(args ...int) int { _, mx := MnMx(args...); return mx }\nfunc LCM(a, b int) int { return a / GCD(a, b) * b }\nfunc GCD(a, b int) int {\n\tif a == 0 {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1863, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448611543", "group_id": "codeNet:p02720", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"unsafe\"\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\n\n// tbl[n] が、n + 1 桁のるんるん数の昇順の配列\nvar tbl [][]int64\n// n + 1 桁のるんるん数配列を生成する\nfunc makeTbl(n int) {\n\tm := map[int64]int {}\n\tprev := tbl[n - 1]\n\tfor _, p := range prev {\n\t\tpp := p\n\t\tfor i := 1; i < n; i ++ {\n\t\t\tpp = pp / 10\n\t\t}\n\t\tppp := pp\n\t\tfor i := 0; i < n; i ++ {\n\t\t\tppp = ppp * 10\n\t\t}\n\t\tppp += p\n\t\tm[ppp] = 1\n\t\tif pp > 0 {\n\t\t\tppp := pp -1\n\t\t\tfor i := 0; i < n; i ++ {\n\t\t\t\tppp = ppp * 10\n\t\t\t}\n\t\t\tppp += p\n\t\t\tm[ppp] = 1\n\t\t}\n\t\tif pp < 9 {\n\t\t\tppp := pp + 1\n\t\t\tfor i := 0; i < n; i ++ {\n\t\t\t\tppp = ppp * 10\n\t\t\t}\n\t\t\tppp += p\n\t\t\tm[ppp] = 1\n\t\t}\n\t}\n\tret := make([]int64, 0, len(m))\n\tfor k, _ := range m {\n\t\tret = append(ret, k)\n\t}\n\tSort(ret, func(i, j int) bool { return ret[i] < ret[j] })\n\ttbl[n] = ret\n}\n\nvar flatTbl []int64\n\nfunc abs(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc isHappy(v int64) bool {\n\tif v <= 12 {\n\t\treturn true\n\t}\n\tif abs(v % 10 - v % 100 / 10) > 1 {\n\t\treturn false\n\t}\n\treturn isHappy(v / 10)\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\ttbl = make([][]int64, 11)\n\ttbl[0] = []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}\n\tfor i := 1; i < 11; i++ {\n\t\tmakeTbl(i)\n\t}\n\tflatTbl = make([]int64, 0, 100000)\n\tminimum := int64(1)\n\tfor i := 0; i < 11; i++ {\n\t\tfor _, v := range tbl[i] {\n\t\t\tif v < minimum {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tflatTbl = append(flatTbl, v)\n\t\t\tif len(flatTbl) >= 100000 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif len(flatTbl) > 100000 {\n\t\t\tbreak\n\t\t}\n\t\tminimum *= 10\n\t}\n\tk := nextInt()\n\tfmt.Fprintln(out, flatTbl[k-1])\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\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// =============================================================================", "language": "Go", "metadata": {"date": 1586052897, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/Go/s448611543.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448611543", "user_id": "u478530879"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"unsafe\"\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\n\n// tbl[n] が、n + 1 桁のるんるん数の昇順の配列\nvar tbl [][]int64\n// n + 1 桁のるんるん数配列を生成する\nfunc makeTbl(n int) {\n\tm := map[int64]int {}\n\tprev := tbl[n - 1]\n\tfor _, p := range prev {\n\t\tpp := p\n\t\tfor i := 1; i < n; i ++ {\n\t\t\tpp = pp / 10\n\t\t}\n\t\tppp := pp\n\t\tfor i := 0; i < n; i ++ {\n\t\t\tppp = ppp * 10\n\t\t}\n\t\tppp += p\n\t\tm[ppp] = 1\n\t\tif pp > 0 {\n\t\t\tppp := pp -1\n\t\t\tfor i := 0; i < n; i ++ {\n\t\t\t\tppp = ppp * 10\n\t\t\t}\n\t\t\tppp += p\n\t\t\tm[ppp] = 1\n\t\t}\n\t\tif pp < 9 {\n\t\t\tppp := pp + 1\n\t\t\tfor i := 0; i < n; i ++ {\n\t\t\t\tppp = ppp * 10\n\t\t\t}\n\t\t\tppp += p\n\t\t\tm[ppp] = 1\n\t\t}\n\t}\n\tret := make([]int64, 0, len(m))\n\tfor k, _ := range m {\n\t\tret = append(ret, k)\n\t}\n\tSort(ret, func(i, j int) bool { return ret[i] < ret[j] })\n\ttbl[n] = ret\n}\n\nvar flatTbl []int64\n\nfunc abs(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc isHappy(v int64) bool {\n\tif v <= 12 {\n\t\treturn true\n\t}\n\tif abs(v % 10 - v % 100 / 10) > 1 {\n\t\treturn false\n\t}\n\treturn isHappy(v / 10)\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\ttbl = make([][]int64, 11)\n\ttbl[0] = []int64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}\n\tfor i := 1; i < 11; i++ {\n\t\tmakeTbl(i)\n\t}\n\tflatTbl = make([]int64, 0, 100000)\n\tminimum := int64(1)\n\tfor i := 0; i < 11; i++ {\n\t\tfor _, v := range tbl[i] {\n\t\t\tif v < minimum {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tflatTbl = append(flatTbl, v)\n\t\t\tif len(flatTbl) >= 100000 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif len(flatTbl) > 100000 {\n\t\t\tbreak\n\t\t}\n\t\tminimum *= 10\n\t}\n\tk := nextInt()\n\tfmt.Fprintln(out, flatTbl[k-1])\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\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// =============================================================================", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9935, "cpu_time_ms": 266, "memory_kb": 26752}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s722064055", "group_id": "codeNet:p02722", "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 Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000007)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(Scanner())\n\tans := 0\n\tfor i := 1; i*i <= n; i++ {\n\t\tif (n-1)%i == 0 {\n\t\t\tans += 2\n\t\t} else if n%i == 0 && i != 1 {\n\t\t\tx := n\n\t\t\tfor x%i == 0 {\n\t\t\t\tx /= i\n\t\t\t}\n\t\t\tif x%i == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t\tx = n\n\t\t\tj := n / i\n\t\t\tfor x%j == 0 {\n\t\t\t\tx /= j\n\t\t\t}\n\t\t\tif x%j == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1586106504, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02722.html", "problem_id": "p02722", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02722/input.txt", "sample_output_relpath": "derived/input_output/data/p02722/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02722/Go/s722064055.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s722064055", "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 Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000007)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(Scanner())\n\tans := 0\n\tfor i := 1; i*i <= n; i++ {\n\t\tif (n-1)%i == 0 {\n\t\t\tans += 2\n\t\t} else if n%i == 0 && i != 1 {\n\t\t\tx := n\n\t\t\tfor x%i == 0 {\n\t\t\t\tx /= i\n\t\t\t}\n\t\t\tif x%i == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t\tx = n\n\t\t\tj := n / i\n\t\t\tfor x%j == 0 {\n\t\t\t\tx /= j\n\t\t\t}\n\t\t\tif x%j == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nWe will choose an integer K between 2 and N (inclusive), then we will repeat the operation below until N becomes less than K.\n\nOperation: if K divides N, replace N with N/K; otherwise, replace N with N-K.\n\nIn how many choices of K will N become 1 in the end?\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 number of choices of K in which N becomes 1 in the end.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThere are three choices of K in which N becomes 1 in the end: 2, 5, and 6.\n\nIn each of these choices, N will change as follows:\n\nWhen K=2: 6 \\to 3 \\to 1\n\nWhen K=5: 6 \\to 1\n\nWhen K=6: 6 \\to 1\n\nSample Input 2\n\n3141\n\nSample Output 2\n\n13\n\nSample Input 3\n\n314159265358\n\nSample Output 3\n\n9", "sample_input": "6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02722", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nWe will choose an integer K between 2 and N (inclusive), then we will repeat the operation below until N becomes less than K.\n\nOperation: if K divides N, replace N with N/K; otherwise, replace N with N-K.\n\nIn how many choices of K will N become 1 in the end?\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 number of choices of K in which N becomes 1 in the end.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\nThere are three choices of K in which N becomes 1 in the end: 2, 5, and 6.\n\nIn each of these choices, N will change as follows:\n\nWhen K=2: 6 \\to 3 \\to 1\n\nWhen K=5: 6 \\to 1\n\nWhen K=6: 6 \\to 1\n\nSample Input 2\n\n3141\n\nSample Output 2\n\n13\n\nSample Input 3\n\n314159265358\n\nSample Output 3\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 574, "cpu_time_ms": 22, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s491682265", "group_id": "codeNet:p02723", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n ans := \"No\"\n if s[2] == s[3] && s[4] == s[5] {\n ans = \"Yes\"\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587757783, "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/s491682265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s491682265", "user_id": "u254871849"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n ans := \"No\"\n if s[2] == s[3] && s[4] == s[5] {\n ans = \"Yes\"\n }\n fmt.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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 170, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s718787303", "group_id": "codeNet:p02723", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif s[2] == s[3] && s[4] == s[5] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585443753, "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/s718787303.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s718787303", "user_id": "u448258717"}, "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\tif s[2] == s[3] && s[4] == s[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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s220698253", "group_id": "codeNet:p02724", "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/B github.com/mpppk/atcoder/abc160/B\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\nfunc solve(X int64) int64 {\n\tu1 := (X / 500) * 1000\n\tamari := X % 500\n\treturn u1 + (amari/5)*5\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 X int64\n\tscanner.Scan()\n\tX, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tfmt.Println(solve(X))\n}\n", "language": "Go", "metadata": {"date": 1586041866, "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/s220698253.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s220698253", "user_id": "u562039972"}, "prompt_components": {"gold_output": "2020\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/B github.com/mpppk/atcoder/abc160/B\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\nfunc solve(X int64) int64 {\n\tu1 := (X / 500) * 1000\n\tamari := X % 500\n\treturn u1 + (amari/5)*5\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 X int64\n\tscanner.Scan()\n\tX, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tfmt.Println(solve(X))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345697, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s458960438", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\n\tvar k, n, aa int\n\ta := []int{}\n\tbef := []int{}\n\taft := []int{}\n\n\tfmt.Scan(&k, &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&aa)\n\t\ta = append(a, aa)\n\t}\n\tsub := k / 2\n\tfor i, key := range a {\n\t\tif sub <= key {\n\t\t\tbef = a[0:i]\n\t\t\taft = a[i:n]\n\t\t\tbreak\n\t\t}\n\n\t}\n\tif len(bef) != 0 {\n\t\tsort.Sort(sort.IntSlice(bef))\n\t\tbeflen := len(bef)\n\t\tbbb := beflen - 1\n\t\thuga := bef[bbb:beflen]\n\t\tfmt.Println(huga[0] - bef[0])\n\t} else if len(aft) != 0 {\n\t\tsort.Sort(sort.IntSlice(aft))\n\t\tbeflen := len(aft)\n\t\tbbb := beflen - 1\n\t\thuga := aft[bbb:beflen]\n\t\tfmt.Println(huga[0] - aft[0])\n\t} else {\n\t\tsort.Sort(sort.IntSlice(bef))\n\t\tsort.Sort(sort.IntSlice(aft))\n\t\tbeflen := len(bef)\n\t\taftlen := len(aft)\n\t\taaa := aftlen - 1\n\t\tbbb := beflen - 1\n\t\thoge := aft[aaa:aftlen]\n\t\thuga := bef[bbb:beflen]\n\t\tpiyo := bef[0:1]\n\n\t\tif hoge[0]-piyo[0] < hoge[0]-huga[0] {\n\t\t\tfmt.Println(hoge[0] - piyo[0])\n\t\t} else {\n\t\t\tfmt.Println(hoge[0] - huga[0])\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585447593, "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/s458960438.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s458960438", "user_id": "u545203108"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\n\tvar k, n, aa int\n\ta := []int{}\n\tbef := []int{}\n\taft := []int{}\n\n\tfmt.Scan(&k, &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&aa)\n\t\ta = append(a, aa)\n\t}\n\tsub := k / 2\n\tfor i, key := range a {\n\t\tif sub <= key {\n\t\t\tbef = a[0:i]\n\t\t\taft = a[i:n]\n\t\t\tbreak\n\t\t}\n\n\t}\n\tif len(bef) != 0 {\n\t\tsort.Sort(sort.IntSlice(bef))\n\t\tbeflen := len(bef)\n\t\tbbb := beflen - 1\n\t\thuga := bef[bbb:beflen]\n\t\tfmt.Println(huga[0] - bef[0])\n\t} else if len(aft) != 0 {\n\t\tsort.Sort(sort.IntSlice(aft))\n\t\tbeflen := len(aft)\n\t\tbbb := beflen - 1\n\t\thuga := aft[bbb:beflen]\n\t\tfmt.Println(huga[0] - aft[0])\n\t} else {\n\t\tsort.Sort(sort.IntSlice(bef))\n\t\tsort.Sort(sort.IntSlice(aft))\n\t\tbeflen := len(bef)\n\t\taftlen := len(aft)\n\t\taaa := aftlen - 1\n\t\tbbb := beflen - 1\n\t\thoge := aft[aaa:aftlen]\n\t\thuga := bef[bbb:beflen]\n\t\tpiyo := bef[0:1]\n\n\t\tif hoge[0]-piyo[0] < hoge[0]-huga[0] {\n\t\t\tfmt.Println(hoge[0] - piyo[0])\n\t\t} else {\n\t\t\tfmt.Println(hoge[0] - huga[0])\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 998, "memory_kb": 10240}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478523678", "group_id": "codeNet:p02725", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var n, m int\n fmt.Scan(&n, &m)\n \n t := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&t[i])\n }\n\n var tmp int\n for i := 0; i (t[m-1] - t[i] + n - t[m-1] + t[i-1]){\n tmp = t[m-1] - t[i] + n - t[m-1] + t[i-1]\n }\n }\n }\n fmt.Println(tmp)\n}\n", "language": "Go", "metadata": {"date": 1585445678, "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/s478523678.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s478523678", "user_id": "u167020125"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var n, m int\n fmt.Scan(&n, &m)\n \n t := make([]int, m)\n for i := 0; i < m; i++ {\n fmt.Scan(&t[i])\n }\n\n var tmp int\n for i := 0; i (t[m-1] - t[i] + n - t[m-1] + t[i-1]){\n tmp = t[m-1] - t[i] + n - t[m-1] + t[i-1]\n }\n }\n }\n fmt.Println(tmp)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 469, "cpu_time_ms": 990, "memory_kb": 6016}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s939649153", "group_id": "codeNet:p02725", "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\tk, n := nextInt(), nextInt()\n\ta := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\ta[n] = k\n\n\tmax := -1\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tdist := a[i] - a[i-1]\n\t\tsum += dist\n\t\tif dist > max {\n\t\t\tmax = dist\n\t\t}\n\t}\n\tfmt.Println(sum - max)\n}\n", "language": "Go", "metadata": {"date": 1585444510, "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/s939649153.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s939649153", "user_id": "u275316733"}, "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\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\tk, n := nextInt(), nextInt()\n\ta := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\ta[n] = k\n\n\tmax := -1\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tdist := a[i] - a[i-1]\n\t\tsum += dist\n\t\tif dist > max {\n\t\t\tmax = dist\n\t\t}\n\t}\n\tfmt.Println(sum - 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 40, "memory_kb": 3840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s766274575", "group_id": "codeNet:p02725", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\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\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tk := nextInt()\n\tn := nextInt()\n\ta := nextInts(n)\n\tsort.Ints(a)\n\tvar max int\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tif i == n-1 {\n\t\t\td = (k - a[i]) + a[0]\n\t\t} else {\n\t\t\td = a[i+1] - a[i]\n\t\t}\n\t\tif d > max {\n\t\t\tmax = d\n\t\t}\n\t}\n\tfmt.Println(k - max)\n}\n", "language": "Go", "metadata": {"date": 1585444418, "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/s766274575.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s766274575", "user_id": "u452900140"}, "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\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\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tk := nextInt()\n\tn := nextInt()\n\ta := nextInts(n)\n\tsort.Ints(a)\n\tvar max int\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tif i == n-1 {\n\t\t\td = (k - a[i]) + a[0]\n\t\t} else {\n\t\t\td = a[i+1] - a[i]\n\t\t}\n\t\tif d > max {\n\t\t\tmax = d\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 60, "memory_kb": 3968}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254758601", "group_id": "codeNet:p02726", "input_text": "/**\n * 最短経路の練習:「Warshall-Floyd法」\n * ABC160 D\n * https://atcoder.jp/contests/abc160/tasks/abc160_d\n * \n * 期待する入力\n * N X Y\n * 3 <= N <= 2000\n * 1 <= X, Y <= N\n * X+1 < Y\n */\n\n package main\n\n import (\n\t \"fmt\"\n\t \"bufio\"\n\t \"os\"\n\t \"strconv\"\n )\n \n func main() {\n\t sc := bufio.NewScanner(os.Stdin)\n\t sc.Split(bufio.ScanWords)\n \n\t N, X, Y := nextInt(sc), nextInt(sc), nextInt(sc)\n\t \n\t // 距離計算「Warshall-Floyd法」\n\t // 今回、エッジの距離は全て1だが、可変でも行けるはず...\n\t // 参考:https://qiita.com/ta-ka/items/a023a11efe17ab097433#warshall-floyd%E6%B3%95\n\t distance := make([][]int, N)\n\t counter := make([]int, N-1)\n\t ks := []int{0, X-1, Y-1}\n\t for _, k := range ks {\n\t\t for i := 0; i < N; i++ {\n\t\t\t if k == 0 {\n\t\t\t\t distance[i] = make([]int, N)\n\t\t\t\t if i == (X-1) {\n\t\t\t\t\t distance[i][Y-1] = 1\n\t\t\t\t } else if i == (Y-1) {\n\t\t\t\t\t distance[i][X-1] = 1\n\t\t\t\t }\n\t\t\t }\n\t\t\t //NOTE: 有向グラフの場合は、 j < i の部分を j < N に変更する\n\t\t\t for j := 0; j < i; j++ {\n\t\t\t\t if k == 0 {\n\t\t\t\t\t isSetedDistance := false\n\t\t\t\t\t isSetedDistance = isSetedDistance || i == j\n\t\t\t\t\t isSetedDistance = isSetedDistance || i == (X - 1) && j == (Y - 1)\n\t\t\t\t\t isSetedDistance = isSetedDistance || j == (X - 1) && i == (Y - 1)\n\t\t\t\t\t if !isSetedDistance {\n\t\t\t\t\t\t distance[i][j] = i - j\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t distance[i][j] = min(distance[i][j], distance[i][k] + distance[k][j])\n\t\t\t\t distance[j][i] = distance[i][j] // 無向グラフのため、対称行列\n\t\t\t\t if k == Y-1 {\n\t\t\t\t\t counter[distance[i][j]-1] += 1\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n \n\t // 表示\n\t for _, num := range counter {\n\t\t fmt.Println(num)\n\t }\n \n }\n \n func min(a, b int) int {\n\t if a < b {\n\t\t return a\n\t }\n\t return b\n }\n \n func nextInt(sc *bufio.Scanner) int {\n\t sc.Scan()\n\t t, _ := strconv.Atoi(sc.Text())\n\t return t\n }", "language": "Go", "metadata": {"date": 1589575156, "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/s254758601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254758601", "user_id": "u614627871"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "/**\n * 最短経路の練習:「Warshall-Floyd法」\n * ABC160 D\n * https://atcoder.jp/contests/abc160/tasks/abc160_d\n * \n * 期待する入力\n * N X Y\n * 3 <= N <= 2000\n * 1 <= X, Y <= N\n * X+1 < Y\n */\n\n package main\n\n import (\n\t \"fmt\"\n\t \"bufio\"\n\t \"os\"\n\t \"strconv\"\n )\n \n func main() {\n\t sc := bufio.NewScanner(os.Stdin)\n\t sc.Split(bufio.ScanWords)\n \n\t N, X, Y := nextInt(sc), nextInt(sc), nextInt(sc)\n\t \n\t // 距離計算「Warshall-Floyd法」\n\t // 今回、エッジの距離は全て1だが、可変でも行けるはず...\n\t // 参考:https://qiita.com/ta-ka/items/a023a11efe17ab097433#warshall-floyd%E6%B3%95\n\t distance := make([][]int, N)\n\t counter := make([]int, N-1)\n\t ks := []int{0, X-1, Y-1}\n\t for _, k := range ks {\n\t\t for i := 0; i < N; i++ {\n\t\t\t if k == 0 {\n\t\t\t\t distance[i] = make([]int, N)\n\t\t\t\t if i == (X-1) {\n\t\t\t\t\t distance[i][Y-1] = 1\n\t\t\t\t } else if i == (Y-1) {\n\t\t\t\t\t distance[i][X-1] = 1\n\t\t\t\t }\n\t\t\t }\n\t\t\t //NOTE: 有向グラフの場合は、 j < i の部分を j < N に変更する\n\t\t\t for j := 0; j < i; j++ {\n\t\t\t\t if k == 0 {\n\t\t\t\t\t isSetedDistance := false\n\t\t\t\t\t isSetedDistance = isSetedDistance || i == j\n\t\t\t\t\t isSetedDistance = isSetedDistance || i == (X - 1) && j == (Y - 1)\n\t\t\t\t\t isSetedDistance = isSetedDistance || j == (X - 1) && i == (Y - 1)\n\t\t\t\t\t if !isSetedDistance {\n\t\t\t\t\t\t distance[i][j] = i - j\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t distance[i][j] = min(distance[i][j], distance[i][k] + distance[k][j])\n\t\t\t\t distance[j][i] = distance[i][j] // 無向グラフのため、対称行列\n\t\t\t\t if k == Y-1 {\n\t\t\t\t\t counter[distance[i][j]-1] += 1\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t }\n \n\t // 表示\n\t for _, num := range counter {\n\t\t fmt.Println(num)\n\t }\n \n }\n \n func min(a, b int) int {\n\t if a < b {\n\t\t return a\n\t }\n\t return b\n }\n \n func nextInt(sc *bufio.Scanner) int {\n\t sc.Scan()\n\t t, _ := strconv.Atoi(sc.Text())\n\t return t\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1837, "cpu_time_ms": 192, "memory_kb": 59904}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s123472515", "group_id": "codeNet:p02726", "input_text": "package main\n\nimport \"fmt\"\n\nvar N, X, Y int\nvar arr = make([]bool, 2001)\nvar ans = map[int]int{}\n\nfunc main() {\n\tfmt.Scan(&N, &X, &Y)\n\tfor i := 1; i<=N; i++ {\n\t\tqueue := []int{i}\n\t\tvisited := map[int]bool{ i: true }\n\t\tfor k := 1; k<=N-1; k++ {\n\t\t\tnextQueue := []int{}\n\t\t\tfor _, v := range queue {\n\t\t\t\tif v != 1 && !visited[v-1] {\n\t\t\t\t\tvisited[v-1] = true\n\t\t\t\t\tnextQueue = append(nextQueue, v-1)\n\t\t\t\t}\n\t\t\t\tif v != N && !visited[v+1] {\n\t\t\t\t\tvisited[v+1] = true\n\t\t\t\t\tnextQueue = append(nextQueue, v+1)\n\t\t\t\t}\n\t\t\t\tif v == X && !visited[Y] {\n\t\t\t\t\tvisited[Y] = true\n\t\t\t\t\tnextQueue = append(nextQueue, Y)\n\t\t\t\t}\n\t\t\t\tif v == Y && !visited[X] {\n\t\t\t\t\tvisited[X] = true\n\t\t\t\t\tnextQueue = append(nextQueue, X)\n\t\t\t\t}\n\t\t\t}\n\t\t\tans[k] += len(nextQueue)\n\t\t\tqueue = nextQueue \n\t\t}\n\t}\n\tfor i := 1; i <= N-1; i++ {\n\t\tfmt.Println(ans[i]/2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589338764, "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/s123472515.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s123472515", "user_id": "u686302771"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar N, X, Y int\nvar arr = make([]bool, 2001)\nvar ans = map[int]int{}\n\nfunc main() {\n\tfmt.Scan(&N, &X, &Y)\n\tfor i := 1; i<=N; i++ {\n\t\tqueue := []int{i}\n\t\tvisited := map[int]bool{ i: true }\n\t\tfor k := 1; k<=N-1; k++ {\n\t\t\tnextQueue := []int{}\n\t\t\tfor _, v := range queue {\n\t\t\t\tif v != 1 && !visited[v-1] {\n\t\t\t\t\tvisited[v-1] = true\n\t\t\t\t\tnextQueue = append(nextQueue, v-1)\n\t\t\t\t}\n\t\t\t\tif v != N && !visited[v+1] {\n\t\t\t\t\tvisited[v+1] = true\n\t\t\t\t\tnextQueue = append(nextQueue, v+1)\n\t\t\t\t}\n\t\t\t\tif v == X && !visited[Y] {\n\t\t\t\t\tvisited[Y] = true\n\t\t\t\t\tnextQueue = append(nextQueue, Y)\n\t\t\t\t}\n\t\t\t\tif v == Y && !visited[X] {\n\t\t\t\t\tvisited[X] = true\n\t\t\t\t\tnextQueue = append(nextQueue, X)\n\t\t\t\t}\n\t\t\t}\n\t\t\tans[k] += len(nextQueue)\n\t\t\tqueue = nextQueue \n\t\t}\n\t}\n\tfor i := 1; i <= N-1; i++ {\n\t\tfmt.Println(ans[i]/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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 821, "cpu_time_ms": 1486, "memory_kb": 7684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s851546826", "group_id": "codeNet:p02726", "input_text": "package main\n\nimport \"fmt\"\n\nvar (\n\tN int\n\tX int\n\tY int\n)\n\nfunc main() {\n\tfmt.Scan(&N, &X, &Y)\n\n\tm := make(map[int]int)\n\tfor i := 1; i <= N-1; i++ {\n\t\tfor j := i + 1; j <= N; j++ {\n\t\t\tm[d(i, j)]++\n\t\t}\n\t}\n\tfor k := 1; k < N; k++ {\n\t\tfmt.Println(m[k])\n\t}\n}\n\nfunc min(x1, x2, x3, x4 int) int {\n\tvar x12, x34 int\n\tif x1 < x2 {\n\t\tx12 = x1\n\t} else {\n\t\tx12 = x2\n\t}\n\tif x3 < x4 {\n\t\tx34 = x3\n\t} else {\n\t\tx34 = x4\n\t}\n\tif x12 < x34 {\n\t\treturn x12\n\t}\n\treturn x34\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc d(i, j int) int {\n\n\t// 1. i -> j\n\t// 2. i -> X -> j\n\t// 3. i -> Y -> j\n\t// 4. i -> X -> Y -> j\n\n\td1 := abs(j - i)\n\td2 := abs(j-X) + abs(X-i)\n\td3 := abs(j-Y) + abs(Y-i)\n\td4 := abs(X-i) + 1 + abs(Y-j)\n\n\treturn min(d1, d2, d3, d4)\n}\n", "language": "Go", "metadata": {"date": 1586201908, "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/s851546826.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s851546826", "user_id": "u017421706"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar (\n\tN int\n\tX int\n\tY int\n)\n\nfunc main() {\n\tfmt.Scan(&N, &X, &Y)\n\n\tm := make(map[int]int)\n\tfor i := 1; i <= N-1; i++ {\n\t\tfor j := i + 1; j <= N; j++ {\n\t\t\tm[d(i, j)]++\n\t\t}\n\t}\n\tfor k := 1; k < N; k++ {\n\t\tfmt.Println(m[k])\n\t}\n}\n\nfunc min(x1, x2, x3, x4 int) int {\n\tvar x12, x34 int\n\tif x1 < x2 {\n\t\tx12 = x1\n\t} else {\n\t\tx12 = x2\n\t}\n\tif x3 < x4 {\n\t\tx34 = x3\n\t} else {\n\t\tx34 = x4\n\t}\n\tif x12 < x34 {\n\t\treturn x12\n\t}\n\treturn x34\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc d(i, j int) int {\n\n\t// 1. i -> j\n\t// 2. i -> X -> j\n\t// 3. i -> Y -> j\n\t// 4. i -> X -> Y -> j\n\n\td1 := abs(j - i)\n\td2 := abs(j-X) + abs(X-i)\n\td3 := abs(j-Y) + abs(Y-i)\n\td4 := abs(X-i) + 1 + abs(Y-j)\n\n\treturn min(d1, d2, d3, d4)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 750, "cpu_time_ms": 137, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s141996705", "group_id": "codeNet:p02726", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// Queue is for bfs\ntype Queue struct {\n\tdata []interface{}\n}\n\n// Push adds a value to queue\nfunc (q *Queue) Push(v interface{}) {\n\tq.data = append(q.data, v)\n}\n\n// Pop removes the last element and return it\nfunc (q *Queue) Pop() (interface{}, error) {\n\tif q.Empty() {\n\t\treturn nil, fmt.Errorf(\"queue is empty\")\n\t}\n\tv := q.data[0]\n\tq.data = q.data[1:]\n\treturn v, nil\n}\n\n// Empty returns true if queue is empty\nfunc (q *Queue) Empty() bool {\n\treturn len(q.data) == 0\n}\n\n// NewQueue generates a new queue\nfunc NewQueue() *Queue {\n\treturn &Queue{make([]interface{}, 0)}\n}\n\n// Graph is a set of nodes\ntype Graph struct {\n\tNodes []*Node\n}\n\n// Node has its value and neighbors\ntype Node struct {\n\tVal interface{}\n\tNeighs []*Node\n}\n\ntype item struct {\n\tN *Node\n\tDepth int\n}\n\ntype path struct {\n\tA *Node\n\tB *Node\n}\n\n// Show shows a graph\nfunc (g *Graph) Show() {\n\tnodes := g.Nodes\n\tfor _, node := range nodes {\n\t\tfmt.Printf(\"%v: \", node.Val)\n\t\tfor _, neigh := range node.Neighs {\n\t\t\tfmt.Printf(\"%v \", neigh.Val)\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\nfunc searchDist(dist map[path]int, start *Node) {\n\tvisited := make(map[*Node]bool)\n\tq := NewQueue()\n\tq.Push(&item{start, 0})\n\tvisited[start] = true\n\tfor !q.Empty() {\n\t\tsrc, _ := q.Pop()\n\t\tif v, ok := src.(*item); ok {\n\t\t\tfor _, neigh := range v.N.Neighs {\n\t\t\t\tif !visited[neigh] {\n\t\t\t\t\tq.Push(&item{neigh, v.Depth + 1})\n\t\t\t\t\tvisited[neigh] = true\n\t\t\t\t\tp := path{start, neigh}\n\t\t\t\t\tif da, ok := dist[p]; ok {\n\t\t\t\t\t\tif v.Depth+1 < da {\n\t\t\t\t\t\t\tdist[path{start, neigh}] = v.Depth + 1\n\t\t\t\t\t\t\tdist[path{neigh, start}] = v.Depth + 1\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdist[path{start, neigh}] = v.Depth + 1\n\t\t\t\t\t\tdist[path{neigh, start}] = v.Depth + 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// NewGraph generates a new directed graph\nfunc NewGraph(n, x, y int) *Graph {\n\tnodes := make([]*Node, n)\n\tfor i := 0; i < n; i++ {\n\t\tname := \"n\" + strconv.Itoa(i)\n\t\tnodes[i] = &Node{name, make([]*Node, 0)}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tnodes[i].Neighs = append(nodes[i].Neighs, nodes[i+1])\n\t\tnodes[i+1].Neighs = append(nodes[i+1].Neighs, nodes[i])\n\t}\n\tnodes[x-1].Neighs = append(nodes[x-1].Neighs, nodes[y-1])\n\tnodes[y-1].Neighs = append(nodes[y-1].Neighs, nodes[x-1])\n\treturn &Graph{nodes}\n}\n\nfunc main() {\n\tvar n, x, y int\n\tfmt.Scan(&n, &x, &y)\n\n\tg := NewGraph(n, x, y)\n\t// g.Show()\n\n\tdist := make(map[path]int)\n\tfor _, node := range g.Nodes {\n\t\tsearchDist(dist, node)\n\t}\n\tcount := make(map[int]int)\n\tfor p, d := range dist {\n\t\tif p.A.Val.(string) < p.B.Val.(string) {\n\t\t\tcount[d]++\n\t\t}\n\t}\n\tfor k := 1; k < n; k++ {\n\t\tfmt.Println(count[k])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585450327, "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/s141996705.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s141996705", "user_id": "u275316733"}, "prompt_components": {"gold_output": "5\n4\n1\n0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\n// Queue is for bfs\ntype Queue struct {\n\tdata []interface{}\n}\n\n// Push adds a value to queue\nfunc (q *Queue) Push(v interface{}) {\n\tq.data = append(q.data, v)\n}\n\n// Pop removes the last element and return it\nfunc (q *Queue) Pop() (interface{}, error) {\n\tif q.Empty() {\n\t\treturn nil, fmt.Errorf(\"queue is empty\")\n\t}\n\tv := q.data[0]\n\tq.data = q.data[1:]\n\treturn v, nil\n}\n\n// Empty returns true if queue is empty\nfunc (q *Queue) Empty() bool {\n\treturn len(q.data) == 0\n}\n\n// NewQueue generates a new queue\nfunc NewQueue() *Queue {\n\treturn &Queue{make([]interface{}, 0)}\n}\n\n// Graph is a set of nodes\ntype Graph struct {\n\tNodes []*Node\n}\n\n// Node has its value and neighbors\ntype Node struct {\n\tVal interface{}\n\tNeighs []*Node\n}\n\ntype item struct {\n\tN *Node\n\tDepth int\n}\n\ntype path struct {\n\tA *Node\n\tB *Node\n}\n\n// Show shows a graph\nfunc (g *Graph) Show() {\n\tnodes := g.Nodes\n\tfor _, node := range nodes {\n\t\tfmt.Printf(\"%v: \", node.Val)\n\t\tfor _, neigh := range node.Neighs {\n\t\t\tfmt.Printf(\"%v \", neigh.Val)\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n\nfunc searchDist(dist map[path]int, start *Node) {\n\tvisited := make(map[*Node]bool)\n\tq := NewQueue()\n\tq.Push(&item{start, 0})\n\tvisited[start] = true\n\tfor !q.Empty() {\n\t\tsrc, _ := q.Pop()\n\t\tif v, ok := src.(*item); ok {\n\t\t\tfor _, neigh := range v.N.Neighs {\n\t\t\t\tif !visited[neigh] {\n\t\t\t\t\tq.Push(&item{neigh, v.Depth + 1})\n\t\t\t\t\tvisited[neigh] = true\n\t\t\t\t\tp := path{start, neigh}\n\t\t\t\t\tif da, ok := dist[p]; ok {\n\t\t\t\t\t\tif v.Depth+1 < da {\n\t\t\t\t\t\t\tdist[path{start, neigh}] = v.Depth + 1\n\t\t\t\t\t\t\tdist[path{neigh, start}] = v.Depth + 1\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdist[path{start, neigh}] = v.Depth + 1\n\t\t\t\t\t\tdist[path{neigh, start}] = v.Depth + 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// NewGraph generates a new directed graph\nfunc NewGraph(n, x, y int) *Graph {\n\tnodes := make([]*Node, n)\n\tfor i := 0; i < n; i++ {\n\t\tname := \"n\" + strconv.Itoa(i)\n\t\tnodes[i] = &Node{name, make([]*Node, 0)}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tnodes[i].Neighs = append(nodes[i].Neighs, nodes[i+1])\n\t\tnodes[i+1].Neighs = append(nodes[i+1].Neighs, nodes[i])\n\t}\n\tnodes[x-1].Neighs = append(nodes[x-1].Neighs, nodes[y-1])\n\tnodes[y-1].Neighs = append(nodes[y-1].Neighs, nodes[x-1])\n\treturn &Graph{nodes}\n}\n\nfunc main() {\n\tvar n, x, y int\n\tfmt.Scan(&n, &x, &y)\n\n\tg := NewGraph(n, x, y)\n\t// g.Show()\n\n\tdist := make(map[path]int)\n\tfor _, node := range g.Nodes {\n\t\tsearchDist(dist, node)\n\t}\n\tcount := make(map[int]int)\n\tfor p, d := range dist {\n\t\tif p.A.Val.(string) < p.B.Val.(string) {\n\t\t\tcount[d]++\n\t\t}\n\t}\n\tfor k := 1; k < n; k++ {\n\t\tfmt.Println(count[k])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2599, "cpu_time_ms": 2111, "memory_kb": 242432}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s905499981", "group_id": "codeNet:p02729", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tcm := m * (m - 1) / 2\n\tcn := n * (n - 1) / 2\n\n\tvar cnt int\n\tif n <= 1 {\n\t\tcnt = cm\n\t} else if m <= 1 {\n\t\tcnt = cn\n\t} else {\n\t\tcnt = cn + cm\n\t}\n\n\tfmt.Print(cnt)\n}\n", "language": "Go", "metadata": {"date": 1584925648, "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/s905499981.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s905499981", "user_id": "u323338590"}, "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\n\tcm := m * (m - 1) / 2\n\tcn := n * (n - 1) / 2\n\n\tvar cnt int\n\tif n <= 1 {\n\t\tcnt = cm\n\t} else if m <= 1 {\n\t\tcnt = cn\n\t} else {\n\t\tcnt = cn + cm\n\t}\n\n\tfmt.Print(cnt)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001923407", "group_id": "codeNet:p02729", "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\tans := (n*(n-1))/2 + (m*(m-1))/2\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1584925391, "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/s001923407.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s001923407", "user_id": "u481836184"}, "prompt_components": {"gold_output": "1\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\tans := (n*(n-1))/2 + (m*(m-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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s957980247", "group_id": "codeNet:p02730", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := readS()\n\tl := len(s)\n\n\tif s == reverseS(s) && s[:(l-1)/2] == reverseS(s[:(l-1)/2]) && s[(l+3)/2-1:] == reverseS(s[(l+3)/2-1:]) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc reverseS(s string) string {\n\trs := []rune(s)\n\tfor i := 0; i < len(s)/2; i++ {\n\t\trs[i], rs[len(s)-1-i] = rs[len(s)-1-i], rs[i]\n\t}\n\treturn string(rs)\n}\n\n/*-----------Input utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst buf = 200100\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, buf), buf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readR() []rune {\n\treturn []rune(readS())\n}\n\nfunc readI() int {\n\ti, _ := strconv.Atoi(readS())\n\treturn i\n}\n\nfunc readF() float64 {\n\tf, _ := strconv.ParseFloat(readS(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1599341457, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/Go/s957980247.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s957980247", "user_id": "u533258444"}, "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\ts := readS()\n\tl := len(s)\n\n\tif s == reverseS(s) && s[:(l-1)/2] == reverseS(s[:(l-1)/2]) && s[(l+3)/2-1:] == reverseS(s[(l+3)/2-1:]) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc reverseS(s string) string {\n\trs := []rune(s)\n\tfor i := 0; i < len(s)/2; i++ {\n\t\trs[i], rs[len(s)-1-i] = rs[len(s)-1-i], rs[i]\n\t}\n\treturn string(rs)\n}\n\n/*-----------Input utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst buf = 200100\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, buf), buf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readR() []rune {\n\treturn []rune(readS())\n}\n\nfunc readI() int {\n\ti, _ := strconv.Atoi(readS())\n\treturn i\n}\n\nfunc readF() float64 {\n\tf, _ := strconv.ParseFloat(readS(), 64)\n\treturn f\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1092, "cpu_time_ms": 6, "memory_kb": 1808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s778151036", "group_id": "codeNet:p02730", "input_text": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc159/B github.com/mpppk/atcoder/abc159/B\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 int) int {\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 int) (f int) {\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 int) (f int) {\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 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\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 int) (f int, err error) {\n\tf = 1\n\tfor i := 0; i < num; i++ {\n\t\tf *= n - i\n\t}\n\treturn\n}\n\nfunc lib_Factorial(n int) (f int, 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 := 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 != lib_ReverseStr(S) {\n\t\treturn NO\n\t}\n\n\trunes := []rune(S)\n\ts1 := string(runes[:(len(runes)-1)/2])\n\ts2 := string(runes[(len(runes)+3)/2-1:])\n\n\tif s1 != lib_ReverseStr(s1) || s2 != lib_ReverseStr(s2) {\n\t\treturn NO\n\t}\n\n\treturn YES\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": 1585522769, "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/s778151036.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s778151036", "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/abc159/B github.com/mpppk/atcoder/abc159/B\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 int) int {\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 int) (f int) {\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 int) (f int) {\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 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\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 int) (f int, err error) {\n\tf = 1\n\tfor i := 0; i < num; i++ {\n\t\tf *= n - i\n\t}\n\treturn\n}\n\nfunc lib_Factorial(n int) (f int, 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 := 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 != lib_ReverseStr(S) {\n\t\treturn NO\n\t}\n\n\trunes := []rune(S)\n\ts1 := string(runes[:(len(runes)-1)/2])\n\ts2 := string(runes[(len(runes)+3)/2-1:])\n\n\tif s1 != lib_ReverseStr(s1) || s2 != lib_ReverseStr(s2) {\n\t\treturn NO\n\t}\n\n\treturn YES\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 : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345837, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s304118582", "group_id": "codeNet:p02731", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar L int\n\tfmt.Scan(&L)\n\tfmt.Println(float64(float64(L*L*L) / 27.0))\n}\n", "language": "Go", "metadata": {"date": 1586466171, "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/s304118582.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304118582", "user_id": "u017421706"}, "prompt_components": {"gold_output": "1.000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar L int\n\tfmt.Scan(&L)\n\tfmt.Println(float64(float64(L*L*L) / 27.0))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s776242728", "group_id": "codeNet:p02731", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar l int\n\tfmt.Scan(&l)\n\n\ta := l\n\tb := l\n\tmax := 0\n\tfor i := 0; i < a; i++ {\n\t\tfor j := 0; j < b; j++ {\n\t\t\tc := l - (i + j)\n\t\t\tif i+j+c == l && max < i*j*c {\n\t\t\t\tmax = i * j * c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n\n}\n", "language": "Go", "metadata": {"date": 1584927196, "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/s776242728.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s776242728", "user_id": "u346986631"}, "prompt_components": {"gold_output": "1.000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar l int\n\tfmt.Scan(&l)\n\n\ta := l\n\tb := l\n\tmax := 0\n\tfor i := 0; i < a; i++ {\n\t\tfor j := 0; j < b; j++ {\n\t\t\tc := l - (i + j)\n\t\t\tif i+j+c == l && max < i*j*c {\n\t\t\t\tmax = i * j * c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s010489455", "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\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\tm := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\t_, ok := m[A[i]]\n\t\tif ok {\n\t\t\tm[A[i]]++\n\t\t} else {\n\t\t\tm[A[i]] = 1\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tresult := 0\n\t\tfor k, v := range m {\n\t\t\tif k == A[i] {\n\t\t\t\tresult += nc2(v - 1)\n\t\t\t} else {\n\t\t\t\tresult += nc2(v)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc nc2(n int) int {\n\treturn n * (n - 1) / 2\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\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// * 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\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", "language": "Go", "metadata": {"date": 1588989365, "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/s010489455.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s010489455", "user_id": "u532762536"}, "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\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\tm := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\t_, ok := m[A[i]]\n\t\tif ok {\n\t\t\tm[A[i]]++\n\t\t} else {\n\t\t\tm[A[i]] = 1\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tresult := 0\n\t\tfor k, v := range m {\n\t\t\tif k == A[i] {\n\t\t\t\tresult += nc2(v - 1)\n\t\t\t} else {\n\t\t\t\tresult += nc2(v)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc nc2(n int) int {\n\treturn n * (n - 1) / 2\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\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// * 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\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", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3211, "cpu_time_ms": 2108, "memory_kb": 13184}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614512298", "group_id": "codeNet:p02732", "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := make([]int, n)\n\n\t//key:ボールに書かれた数 value:ボールの個数\n\tball := make(map[int]int, n+1)\n\tvar comb uint\n\tfor i := range a {\n\t\ta[i] = nextInt()\n\t\tball[a[i]]++\n\t}\n\t//ボールを除かない選び方\n\tfor i := 0; i < n; i++ {\n\t\tcomb += uint(ball[i]) * uint((ball[i] - 1)) / 2\n\t}\n\t//ボールを除いた選び方\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(comb - (uint(ball[a[i]]) * (uint(ball[a[i]]) - 1) / 2) + (uint(ball[a[i]])-1)*uint((ball[a[i]])-2)/2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588177075, "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/s614512298.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s614512298", "user_id": "u150749188"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\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\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := make([]int, n)\n\n\t//key:ボールに書かれた数 value:ボールの個数\n\tball := make(map[int]int, n+1)\n\tvar comb uint\n\tfor i := range a {\n\t\ta[i] = nextInt()\n\t\tball[a[i]]++\n\t}\n\t//ボールを除かない選び方\n\tfor i := 0; i < n; i++ {\n\t\tcomb += uint(ball[i]) * uint((ball[i] - 1)) / 2\n\t}\n\t//ボールを除いた選び方\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(comb - (uint(ball[a[i]]) * (uint(ball[a[i]]) - 1) / 2) + (uint(ball[a[i]])-1)*uint((ball[a[i]])-2)/2)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 799, "cpu_time_ms": 514, "memory_kb": 11648}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s684083837", "group_id": "codeNet:p02732", "input_text": "// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.\n// $ bundle -pkg main -prefix -dst github.com/mpppk/atcoder/abc159/D github.com/mpppk/atcoder/abc159/D\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\nfunc solve(N int64, A []int64) {\n\t// 数字ごとにグルーピング\n\tm := countGroup(A)\n\n\t// ボールが取り除かれていない場合の数\n\tm2 := map[int64]int64{}\n\n\t// ボールが取り除かれた場合の数\n\tm3 := map[int64]int64{}\n\n\tfor v, count := range m {\n\t\tif count < 3 {\n\t\t\tif count == 2 {\n\t\t\t\tm2[v] = 1\n\t\t\t} else {\n\t\t\t\tm2[v] = 0\n\t\t\t}\n\t\t\tm3[v] = 0\n\t\t} else {\n\t\t\tm2[v] = lib_MustCombination(count, 2)\n\t\t\tm3[v] = lib_MustCombination(count-1, 2)\n\t\t}\n\t}\n\n\tfor _, ai := range A {\n\t\tr := int64(0)\n\t\tfor curA, m2v := range m2 {\n\t\t\tif ai == curA {\n\t\t\t\tr += m3[ai]\n\t\t\t} else {\n\t\t\t\tr += m2v\n\t\t\t}\n\t\t}\n\t\tfmt.Println(r)\n\t}\n}\n\nfunc countGroup(values []int64) map[int64]int64 {\n\tm := map[int64]int64{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\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 N int64\n\tscanner.Scan()\n\tN, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tscanner.Scan()\n\t\tA[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\tsolve(N, A)\n}\n", "language": "Go", "metadata": {"date": 1585525340, "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/s684083837.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s684083837", "user_id": "u562039972"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\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/abc159/D github.com/mpppk/atcoder/abc159/D\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\nfunc solve(N int64, A []int64) {\n\t// 数字ごとにグルーピング\n\tm := countGroup(A)\n\n\t// ボールが取り除かれていない場合の数\n\tm2 := map[int64]int64{}\n\n\t// ボールが取り除かれた場合の数\n\tm3 := map[int64]int64{}\n\n\tfor v, count := range m {\n\t\tif count < 3 {\n\t\t\tif count == 2 {\n\t\t\t\tm2[v] = 1\n\t\t\t} else {\n\t\t\t\tm2[v] = 0\n\t\t\t}\n\t\t\tm3[v] = 0\n\t\t} else {\n\t\t\tm2[v] = lib_MustCombination(count, 2)\n\t\t\tm3[v] = lib_MustCombination(count-1, 2)\n\t\t}\n\t}\n\n\tfor _, ai := range A {\n\t\tr := int64(0)\n\t\tfor curA, m2v := range m2 {\n\t\t\tif ai == curA {\n\t\t\t\tr += m3[ai]\n\t\t\t} else {\n\t\t\t\tr += m2v\n\t\t\t}\n\t\t}\n\t\tfmt.Println(r)\n\t}\n}\n\nfunc countGroup(values []int64) map[int64]int64 {\n\tm := map[int64]int64{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\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 N int64\n\tscanner.Scan()\n\tN, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tscanner.Scan()\n\t\tA[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\tsolve(N, 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 346486, "cpu_time_ms": 2109, "memory_kb": 29716}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s808818555", "group_id": "codeNet:p02732", "input_text": "// https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1385775538\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x int\n var a,b []int\n var ans []int\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x)\n a = append(a,x)\n\t}\n\n for j:=0; j0 {\n b, x = remove(b, b[0])\n ans = append(ans, x)\n }\n }\n for _, r := range ans {\n fmt.Println(combination(r, 2))\n }\n}\n\nfunc delete(s []int, index int) []int {\n ret := make([]int, 0)\n ret = append(ret, s[:index]...)\n return append(ret, s[index+1:]...)\n}\n\nfunc remove(ints []int, search int) ([]int, int) {\n result := []int{}\n res := 0\n for _, v := range ints {\n if v != search {\n result = append(result, v)\n } else {\n res++\n }\n }\n return result, res\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}\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 combination(n int, k int) int {\n\treturn permutation(n, k) / factorial(k)\n}\n", "language": "Go", "metadata": {"date": 1584931194, "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/s808818555.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s808818555", "user_id": "u917346607"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "// https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1385775538\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x int\n var a,b []int\n var ans []int\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x)\n a = append(a,x)\n\t}\n\n for j:=0; j0 {\n b, x = remove(b, b[0])\n ans = append(ans, x)\n }\n }\n for _, r := range ans {\n fmt.Println(combination(r, 2))\n }\n}\n\nfunc delete(s []int, index int) []int {\n ret := make([]int, 0)\n ret = append(ret, s[:index]...)\n return append(ret, s[index+1:]...)\n}\n\nfunc remove(ints []int, search int) ([]int, int) {\n result := []int{}\n res := 0\n for _, v := range ints {\n if v != search {\n result = append(result, v)\n } else {\n res++\n }\n }\n return result, res\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}\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 combination(n int, k int) int {\n\treturn permutation(n, k) / factorial(k)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1135, "cpu_time_ms": 2109, "memory_kb": 28800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s457498800", "group_id": "codeNet:p02732", "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\tN := getInt()\n\ta := make([]int, N)\n\tm := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tm[a[i]]++\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tall := 0\n\tfor _, v := range m {\n\t\tif v >= 2 {\n\t\t\tall += v * (v - 1) / 2\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tx := m[a[i]]\n\t\ty := all\n\t\tif x >= 2 {\n\t\t\ty = all - x*(x-1)/2 + (x-1)*(x-2)/2\n\t\t}\n\t\tfmt.Fprintln(w, y)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584928084, "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/s457498800.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s457498800", "user_id": "u814575783"}, "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\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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\tN := getInt()\n\ta := make([]int, N)\n\tm := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tm[a[i]]++\n\t}\n\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tall := 0\n\tfor _, v := range m {\n\t\tif v >= 2 {\n\t\t\tall += v * (v - 1) / 2\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tx := m[a[i]]\n\t\ty := all\n\t\tif x >= 2 {\n\t\t\ty = all - x*(x-1)/2 + (x-1)*(x-2)/2\n\t\t}\n\t\tfmt.Fprintln(w, y)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 131, "memory_kb": 14720}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s315715847", "group_id": "codeNet:p02733", "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\th := stdin.ReadInt()\n\tw := stdin.ReadInt()\n\tk := stdin.ReadInt()\n\ts := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tline := stdin.Read()\n\t\ts[i] = make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif line[j] == '0' {\n\t\t\t\ts[i][j] = 0\n\t\t\t} else {\n\t\t\t\ts[i][j] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\tans := h * w\n\tfor _, crack := range Combinations(h-1, -1) {\n\t\tcrack = append(crack, -1)\n\n\t\tx := 0\n\t\tcur := make([]int, len(crack)+1)\n\t\tfor i := 0; i < h; i++ {\n\t\t\tcur[x] += s[i][0]\n\t\t\tif crack[x] == i {\n\t\t\t\tx++\n\t\t\t}\n\t\t}\n\n\t\tng := false\n\t\tcount := 0\n\t\tfor j := 1; j < w; j++ {\n\t\t\tnxt := make([]int, len(crack)+1)\n\t\t\tfor i := 0; i < len(cur); i++ {\n\t\t\t\tif k < cur[i] {\n\t\t\t\t\tng = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tnxt[i] = cur[i]\n\t\t\t}\n\n\t\t\tif ng {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tx = 0\n\t\t\tcracking := false\n\t\t\tfor i := 0; i < h; i++ {\n\t\t\t\tnxt[x] += s[i][j]\n\t\t\t\tif k < nxt[x] {\n\t\t\t\t\tcracking = true\n\t\t\t\t}\n\t\t\t\tif crack[x] == i {\n\t\t\t\t\tx++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif cracking {\n\t\t\t\tcount++\n\t\t\t\tfor i := 0; i < len(cur); i++ {\n\t\t\t\t\tnxt[i] -= cur[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tcur = nxt\n\t\t}\n\n\t\tif !ng {\n\t\t\tans = Min(ans, count+len(crack)-1)\n\t\t}\n\t}\n\n\tstdout.Println(ans)\n}\n\nfunc Combinations(n int, r int) [][]int {\n\tans := [][]int{}\n\tfor x := uint(0); x < (uint(1) << uint(n)); x++ {\n\t\tidxs := []int{}\n\t\tfor i := uint(0); i < uint(n); i++ {\n\t\t\tif x&(uint(1)< 0 {\n\t\t\t\tdp[i][j] = min(dp[i][j], dp[i-1][j]+x)\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tdp[i][j] = min(dp[i][j], dp[i][j-1]+x)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[h-1][w-1])\n}\n", "language": "Go", "metadata": {"date": 1590936580, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02735.html", "problem_id": "p02735", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02735/input.txt", "sample_output_relpath": "derived/input_output/data/p02735/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02735/Go/s995514089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s995514089", "user_id": "u461993794"}, "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 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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\th, w := scanInt(), scanInt()\n\tdp := make([][]int, h)\n\ts := make([]string, h)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, w)\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = 100000\n\t\t}\n\t\ts[i] = scanString()\n\t}\n\tif s[0][0] == '#' {\n\t\tdp[0][0] = 1\n\t} else {\n\t\tdp[0][0] = 0\n\t}\n\n\tfor i := 0; i < h; i++ {\n\t\tfor j := range s {\n\t\t\tx := 0\n\t\t\tif s[i][j] == '#' {\n\t\t\t\tx++\n\t\t\t}\n\t\t\tif i > 0 {\n\t\t\t\tdp[i][j] = min(dp[i][j], dp[i-1][j]+x)\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tdp[i][j] = min(dp[i][j], dp[i][j-1]+x)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[h-1][w-1])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "sample_input": "3 3\n.##\n.#.\n##.\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02735", "source_text": "Score : 400 points\n\nProblem Statement\n\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 911, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837979200", "group_id": "codeNet:p02735", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\n\tss := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&ss[i])\n\t}\n\n\tconst inf int = 1e9\n\tm := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tm[i] = make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tm[i][j] = inf\n\t\t}\n\t}\n\n\tdx := []int{0, 0, -1, 1}\n\tdy := []int{-1, 1, 0, 0}\n\n\tans := h * w\n\tvar dfs func(i, j, c, p int)\n\tdfs = func(i, j, c, p int) {\n\t\tif ss[i][j] == '#' {\n\t\t\tc++\n\t\t\tif p == 1 {\n\t\t\t\tc--\n\t\t\t}\n\t\t\tp = 1\n\t\t} else {\n\t\t\tp = 0\n\t\t}\n\n\t\tif m[i][j] <= c {\n\t\t\treturn\n\t\t}\n\t\tm[i][j] = c\n\n\t\tif i == h-1 && j == w-1 {\n\t\t\tans = min(ans, c)\n\t\t\treturn\n\t\t}\n\n\t\tfor d := 0; d < 4; d++ {\n\t\t\tnx, ny := j+dx[d], i+dy[d]\n\t\t\tif 0 <= nx && nx < w && 0 <= ny && ny < h {\n\t\t\t\tdfs(ny, nx, c, p)\n\t\t\t}\n\t\t}\n\t}\n\tdfs(0, 0, 0, 0)\n\n\tfmt.Println(ans)\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": 1584843112, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02735.html", "problem_id": "p02735", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02735/input.txt", "sample_output_relpath": "derived/input_output/data/p02735/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02735/Go/s837979200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s837979200", "user_id": "u902409225"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\n\tss := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&ss[i])\n\t}\n\n\tconst inf int = 1e9\n\tm := make([][]int, h)\n\tfor i := 0; i < h; i++ {\n\t\tm[i] = make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tm[i][j] = inf\n\t\t}\n\t}\n\n\tdx := []int{0, 0, -1, 1}\n\tdy := []int{-1, 1, 0, 0}\n\n\tans := h * w\n\tvar dfs func(i, j, c, p int)\n\tdfs = func(i, j, c, p int) {\n\t\tif ss[i][j] == '#' {\n\t\t\tc++\n\t\t\tif p == 1 {\n\t\t\t\tc--\n\t\t\t}\n\t\t\tp = 1\n\t\t} else {\n\t\t\tp = 0\n\t\t}\n\n\t\tif m[i][j] <= c {\n\t\t\treturn\n\t\t}\n\t\tm[i][j] = c\n\n\t\tif i == h-1 && j == w-1 {\n\t\t\tans = min(ans, c)\n\t\t\treturn\n\t\t}\n\n\t\tfor d := 0; d < 4; d++ {\n\t\t\tnx, ny := j+dx[d], i+dy[d]\n\t\t\tif 0 <= nx && nx < w && 0 <= ny && ny < h {\n\t\t\t\tdfs(ny, nx, c, p)\n\t\t\t}\n\t\t}\n\t}\n\tdfs(0, 0, 0, 0)\n\n\tfmt.Println(ans)\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\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "sample_input": "3 3\n.##\n.#.\n##.\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02735", "source_text": "Score : 400 points\n\nProblem Statement\n\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 867, "cpu_time_ms": 1255, "memory_kb": 4352}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s533137209", "group_id": "codeNet:p02735", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tm := make([][]bool, h)\n\tdp := make([][]int, h)\n\n\tfor i := 0; i < h; i++ {\n\t\tdp[i] = make([]int, w)\n\t\tm[i] = make([]bool, w)\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif s[j] == '#' {\n\t\t\t\tm[i][j] = true\n\t\t\t\tdp[i][j] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 1; i < w; i++ {\n\t\tdp[0][i] += dp[0][i-1]\n\t\tif m[0][i] && m[0][i-1] {\n\t\t\tdp[0][i]--\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\tdp[i][0] += dp[i-1][0]\n\t\tif m[i][0] && m[i-1][0] {\n\t\t\tdp[i][0]--\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\tfor j := 1; j < w; j++ {\n\t\t\tx := dp[i][j] + dp[i-1][j]\n\t\t\tif m[i][j] && m[i-1][j] {\n\t\t\t\tx--\n\t\t\t}\n\t\t\ty := dp[i][j] + dp[i][j-1]\n\t\t\tif m[i][j] && m[i][j-1] {\n\t\t\t\ty--\n\t\t\t}\n\t\t\tif x > y {\n\t\t\t\tdp[i][j] = y\n\t\t\t} else {\n\t\t\t\tdp[i][j] = x\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[h-1][w-1])\n}\n", "language": "Go", "metadata": {"date": 1584842430, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02735.html", "problem_id": "p02735", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02735/input.txt", "sample_output_relpath": "derived/input_output/data/p02735/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02735/Go/s533137209.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s533137209", "user_id": "u448258717"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tm := make([][]bool, h)\n\tdp := make([][]int, h)\n\n\tfor i := 0; i < h; i++ {\n\t\tdp[i] = make([]int, w)\n\t\tm[i] = make([]bool, w)\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif s[j] == '#' {\n\t\t\t\tm[i][j] = true\n\t\t\t\tdp[i][j] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 1; i < w; i++ {\n\t\tdp[0][i] += dp[0][i-1]\n\t\tif m[0][i] && m[0][i-1] {\n\t\t\tdp[0][i]--\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\tdp[i][0] += dp[i-1][0]\n\t\tif m[i][0] && m[i-1][0] {\n\t\t\tdp[i][0]--\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\tfor j := 1; j < w; j++ {\n\t\t\tx := dp[i][j] + dp[i-1][j]\n\t\t\tif m[i][j] && m[i-1][j] {\n\t\t\t\tx--\n\t\t\t}\n\t\t\ty := dp[i][j] + dp[i][j-1]\n\t\t\tif m[i][j] && m[i][j-1] {\n\t\t\t\ty--\n\t\t\t}\n\t\t\tif x > y {\n\t\t\t\tdp[i][j] = y\n\t\t\t} else {\n\t\t\t\tdp[i][j] = x\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[h-1][w-1])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "sample_input": "3 3\n.##\n.#.\n##.\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02735", "source_text": "Score : 400 points\n\nProblem Statement\n\nConsider a grid with H rows and W columns of squares. Let (r, c) denote the square at the r-th row from the top and the c-th column from the left.\nEach square is painted black or white.\n\nThe grid is said to be good if and only if the following condition is satisfied:\n\nFrom (1, 1), we can reach (H, W) by moving one square right or down repeatedly, while always being on a white square.\n\nNote that (1, 1) and (H, W) must be white if the grid is good.\n\nYour task is to make the grid good by repeating the operation below. Find the minimum number of operations needed to complete the task. It can be proved that you can always complete the task in a finite number of operations.\n\nChoose four integers r_0, c_0, r_1, c_1(1 \\leq r_0 \\leq r_1 \\leq H, 1 \\leq c_0 \\leq c_1 \\leq W). For each pair r, c (r_0 \\leq r \\leq r_1, c_0 \\leq c \\leq c_1), invert the color of (r, c) - that is, from white to black and vice versa.\n\nConstraints\n\n2 \\leq H, W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\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_{rc} represents the color of (r, c) - # stands for black, and . stands for white.\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3 3\n.##\n.#.\n##.\n\nSample Output 1\n\n1\n\nDo the operation with (r_0, c_0, r_1, c_1) = (2, 2, 2, 2) to change just the color of (2, 2), and we are done.\n\nSample Input 2\n\n2 2\n#.\n.#\n\nSample Output 2\n\n2\n\nSample Input 3\n\n4 4\n..##\n#...\n###.\n###.\n\nSample Output 3\n\n0\n\nNo operation may be needed.\n\nSample Input 4\n\n5 5\n.#.#.\n#.#.#\n.#.#.\n#.#.#\n.#.#.\n\nSample Output 4\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 824, "cpu_time_ms": 9, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s199330481", "group_id": "codeNet:p02741", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := [32]int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}\n var k int\n fmt.Scanf(\"%d\", &k)\n \n fmt.Printf(\"%d\\n\", a[k-1])\n}", "language": "Go", "metadata": {"date": 1597373691, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s199330481.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s199330481", "user_id": "u903153704"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := [32]int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}\n var k int\n fmt.Scanf(\"%d\", &k)\n \n fmt.Printf(\"%d\\n\", a[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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s755311833", "group_id": "codeNet:p02741", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n str := \"1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\"\n slice := strings.Split(str, \", \")\n var d int\n fmt.Scan(&d)\n fmt.Println(slice[d-1])\n}\n", "language": "Go", "metadata": {"date": 1584234230, "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/s755311833.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s755311833", "user_id": "u917346607"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n str := \"1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\"\n slice := strings.Split(str, \", \")\n var d int\n fmt.Scan(&d)\n fmt.Println(slice[d-1])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 260, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s615162520", "group_id": "codeNet:p02742", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i, h, w, ans int64\n\tfmt.Scan(&h)\n\tfmt.Scan(&w)\n\n\tif h == 1 || w == 1 {\n\t\tans = 1\n\t} else {\n\t\tif h%2 == 0 && w%2 == 0 {\n\t\t\tfor i = 1; i < h+1; i++ {\n\t\t\t\tans += w / 2\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 1; i < h+1; i++ {\n\t\t\t\tif i%2 == 0 {\n\t\t\t\t\tans += w / 2\n\t\t\t\t} else {\n\t\t\t\t\tans += (w / 2) + 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1584240375, "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/s615162520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s615162520", "user_id": "u917346607"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i, h, w, ans int64\n\tfmt.Scan(&h)\n\tfmt.Scan(&w)\n\n\tif h == 1 || w == 1 {\n\t\tans = 1\n\t} else {\n\t\tif h%2 == 0 && w%2 == 0 {\n\t\t\tfor i = 1; i < h+1; i++ {\n\t\t\t\tans += w / 2\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 1; i < h+1; i++ {\n\t\t\t\tif i%2 == 0 {\n\t\t\t\t\tans += w / 2\n\t\t\t\t} else {\n\t\t\t\t\tans += (w / 2) + 1\n\t\t\t\t}\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\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 374, "cpu_time_ms": 975, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s219896109", "group_id": "codeNet:p02742", "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\tH, W := sc.nextInt(), sc.nextInt()\n\n\tfmt.Fprintln(wtr, ceil(H*W, 2))\n}\n", "language": "Go", "metadata": {"date": 1584234299, "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/s219896109.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s219896109", "user_id": "u924691798"}, "prompt_components": {"gold_output": "10\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\tH, W := sc.nextInt(), sc.nextInt()\n\n\tfmt.Fprintln(wtr, ceil(H*W, 2))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2002, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s035215627", "group_id": "codeNet:p02745", "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\tabc := make([]string,3)\n\tfor i := 0; i < 3; i++ {\n\t\tabc[i] = scanString()\n\t}\n\n\tans := len(abc[0])+len(abc[1])+len(abc[2])\n\tpermutationSearch(3, func(a []int) {\n\t\ts1 := abc[a[0]]\n\t\ts2 := abc[a[1]]\n\t\ts3 := abc[a[2]]\n\t\t// debug(s3, s1,s2)\n\n\t\tma := -1\n\t\tL: for i := 0; i < len(s2); i++ {\n\t\t\tfor j := 0; j < min(i+1,len(s1)); j++ {\n\t\t\t\tif s2[i-j] != s1[len(s1)-1-j] && s2[i-j] != '?' && s1[len(s1)-1-j] != '?' {\n\t\t\t\t\tcontinue L\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tma = max(ma, i)\n\t\t}\n\n\t\tvar s string\n\t\tif ma == -1 {\n\t\t\ts = s1+s2\n\t\t} else {\n\t\t\tif len(s1)>ma {\n\t\t\t\ts = s1+s2[ma+1:]\n\t\t\t}\n\t\t}\n\n\t\tma = -1\n\t\tL1: for i := 0; i < len(s); i++ {\n\t\t\tfor j := 0; j < min(i+1, len(s3)); j++ {\n\t\t\t\tif len(s3)-1-j < 0 {\n\t\t\t\t}\n\t\t\t\tif s[i-j] != s3[len(s3)-1-j] && s[i-j] != '?' && s3[len(s3)-1-j] != '?' {\n\t\t\t\t\tcontinue L1\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tma = max(ma, i)\n\t\t}\n\n\t\tif ma == -1 {\n\t\t\ts = s3+s\n\t\t} else {\n\t\t\tif len(s3)>ma {\n\t\t\t\ts = s3+s[ma+1:]\n\t\t\t}\n\t\t}\n\n\t\t// debug(s, ma)\n\t\tans = min(ans, len(s))\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": 1584239915, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02745.html", "problem_id": "p02745", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02745/input.txt", "sample_output_relpath": "derived/input_output/data/p02745/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02745/Go/s035215627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s035215627", "user_id": "u548992197"}, "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\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\tabc := make([]string,3)\n\tfor i := 0; i < 3; i++ {\n\t\tabc[i] = scanString()\n\t}\n\n\tans := len(abc[0])+len(abc[1])+len(abc[2])\n\tpermutationSearch(3, func(a []int) {\n\t\ts1 := abc[a[0]]\n\t\ts2 := abc[a[1]]\n\t\ts3 := abc[a[2]]\n\t\t// debug(s3, s1,s2)\n\n\t\tma := -1\n\t\tL: for i := 0; i < len(s2); i++ {\n\t\t\tfor j := 0; j < min(i+1,len(s1)); j++ {\n\t\t\t\tif s2[i-j] != s1[len(s1)-1-j] && s2[i-j] != '?' && s1[len(s1)-1-j] != '?' {\n\t\t\t\t\tcontinue L\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tma = max(ma, i)\n\t\t}\n\n\t\tvar s string\n\t\tif ma == -1 {\n\t\t\ts = s1+s2\n\t\t} else {\n\t\t\tif len(s1)>ma {\n\t\t\t\ts = s1+s2[ma+1:]\n\t\t\t}\n\t\t}\n\n\t\tma = -1\n\t\tL1: for i := 0; i < len(s); i++ {\n\t\t\tfor j := 0; j < min(i+1, len(s3)); j++ {\n\t\t\t\tif len(s3)-1-j < 0 {\n\t\t\t\t}\n\t\t\t\tif s[i-j] != s3[len(s3)-1-j] && s[i-j] != '?' && s3[len(s3)-1-j] != '?' {\n\t\t\t\t\tcontinue L1\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tma = max(ma, i)\n\t\t}\n\n\t\tif ma == -1 {\n\t\t\ts = s3+s\n\t\t} else {\n\t\t\tif len(s3)>ma {\n\t\t\t\ts = s3+s[ma+1:]\n\t\t\t}\n\t\t}\n\n\t\t// debug(s, ma)\n\t\tans = min(ans, len(s))\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 : 500 points\n\nProblem Statement\n\nSnuke has a string s.\nFrom this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows:\n\nChoose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it with ?s.\n\nFor example, if s is mississippi, we can choose the substring ssissip and replace its 1-st and 3-rd characters with ? to obtain ?s?ssip.\n\nYou are given the strings a, b, and c.\nFind the minimum possible length of s.\n\nConstraints\n\n1 \\leq |a|, |b|, |c| \\leq 2000\n\na, b, and c consists of lowercase English letters and ?s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\n\nOutput\n\nPrint the minimum possible length of s.\n\nSample Input 1\n\na?c\nder\ncod\n\nSample Output 1\n\n7\n\nFor example, s could be atcoder.\n\nSample Input 2\n\natcoder\natcoder\n???????\n\nSample Output 2\n\n7\n\na, b, and c may not be distinct.", "sample_input": "a?c\nder\ncod\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02745", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke has a string s.\nFrom this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows:\n\nChoose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it with ?s.\n\nFor example, if s is mississippi, we can choose the substring ssissip and replace its 1-st and 3-rd characters with ? to obtain ?s?ssip.\n\nYou are given the strings a, b, and c.\nFind the minimum possible length of s.\n\nConstraints\n\n1 \\leq |a|, |b|, |c| \\leq 2000\n\na, b, and c consists of lowercase English letters and ?s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\n\nOutput\n\nPrint the minimum possible length of s.\n\nSample Input 1\n\na?c\nder\ncod\n\nSample Output 1\n\n7\n\nFor example, s could be atcoder.\n\nSample Input 2\n\natcoder\natcoder\n???????\n\nSample Output 2\n\n7\n\na, b, and c may not be distinct.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2367, "cpu_time_ms": 54, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927630524", "group_id": "codeNet:p02745", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tss [3]string\n\tconf [3][3][10000]bool //true if conflicts\n)\n\nfunc main() {\n\treadVariables()\n\tpreCalc()\n\tanswer := 10000\n\tanswer = MinInt(calc(0, 1, 2), answer)\n\tanswer = MinInt(calc(0, 2, 1), answer)\n\tanswer = MinInt(calc(1, 0, 2), answer)\n\tanswer = MinInt(calc(1, 2, 0), answer)\n\tanswer = MinInt(calc(2, 0, 1), answer)\n\tanswer = MinInt(calc(2, 1, 0), answer)\n\tfmt.Println(answer)\n}\n\nfunc calc(k, l, m int) int {\n\tresult := 10000\n\tfor i := 0; i < len(ss[k])+2; i++ {\n\t\tfor j := i; j <= len(ss[k])+len(ss[l]); j++ {\n\t\t\terr := conflict(k, l, i) || conflict(k, m, j) || conflict(l, m, j-i)\n\t\t\tif !err {\n\t\t\t\tresult = MinInt(length(k, l, m, i, j), result)\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc length(k, l, m, i, j int) int {\n\tx := len(ss[k])\n\ty := i + len(ss[l])\n\tz := j + len(ss[m])\n\treturn MaxInt(x, MaxInt(y, z))\n}\n\nfunc conflict(k, l, i int) bool {\n\tif i < 10000 {\n\t\treturn conf[k][l][i]\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc preCalc() {\n\tfor k := 0; k < 3; k++ {\n\t\tfor l := 0; l < 3; l++ {\n\t\t\t//k to l\n\t\t\tfor i := 0; i < len(ss[k]); i++ {\n\t\t\tOUTER:\n\t\t\t\tfor j := 0; i+j < len(ss[k]) && j < len(ss[l]); j++ {\n\t\t\t\t\tc1, c2 := ss[k][i+j], ss[l][j]\n\t\t\t\t\tif c1 != '?' && c2 != '?' && c1 != c2 {\n\t\t\t\t\t\tconf[k][l][i] = true\n\t\t\t\t\t\tbreak OUTER\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc readVariables() {\n\tss[0], ss[1], ss[2] = nextStr(), nextStr(), nextStr()\n}\n\n/* Template */\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 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//ModPow calculates integer power with modulo operation\n//if modulo <= 1, it powers w/o module operation\n//if base < 0, return value might be negative too.\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", "language": "Go", "metadata": {"date": 1584238804, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02745.html", "problem_id": "p02745", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02745/input.txt", "sample_output_relpath": "derived/input_output/data/p02745/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02745/Go/s927630524.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s927630524", "user_id": "u390694622"}, "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\nvar (\n\tss [3]string\n\tconf [3][3][10000]bool //true if conflicts\n)\n\nfunc main() {\n\treadVariables()\n\tpreCalc()\n\tanswer := 10000\n\tanswer = MinInt(calc(0, 1, 2), answer)\n\tanswer = MinInt(calc(0, 2, 1), answer)\n\tanswer = MinInt(calc(1, 0, 2), answer)\n\tanswer = MinInt(calc(1, 2, 0), answer)\n\tanswer = MinInt(calc(2, 0, 1), answer)\n\tanswer = MinInt(calc(2, 1, 0), answer)\n\tfmt.Println(answer)\n}\n\nfunc calc(k, l, m int) int {\n\tresult := 10000\n\tfor i := 0; i < len(ss[k])+2; i++ {\n\t\tfor j := i; j <= len(ss[k])+len(ss[l]); j++ {\n\t\t\terr := conflict(k, l, i) || conflict(k, m, j) || conflict(l, m, j-i)\n\t\t\tif !err {\n\t\t\t\tresult = MinInt(length(k, l, m, i, j), result)\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc length(k, l, m, i, j int) int {\n\tx := len(ss[k])\n\ty := i + len(ss[l])\n\tz := j + len(ss[m])\n\treturn MaxInt(x, MaxInt(y, z))\n}\n\nfunc conflict(k, l, i int) bool {\n\tif i < 10000 {\n\t\treturn conf[k][l][i]\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc preCalc() {\n\tfor k := 0; k < 3; k++ {\n\t\tfor l := 0; l < 3; l++ {\n\t\t\t//k to l\n\t\t\tfor i := 0; i < len(ss[k]); i++ {\n\t\t\tOUTER:\n\t\t\t\tfor j := 0; i+j < len(ss[k]) && j < len(ss[l]); j++ {\n\t\t\t\t\tc1, c2 := ss[k][i+j], ss[l][j]\n\t\t\t\t\tif c1 != '?' && c2 != '?' && c1 != c2 {\n\t\t\t\t\t\tconf[k][l][i] = true\n\t\t\t\t\t\tbreak OUTER\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc readVariables() {\n\tss[0], ss[1], ss[2] = nextStr(), nextStr(), nextStr()\n}\n\n/* Template */\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 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//ModPow calculates integer power with modulo operation\n//if modulo <= 1, it powers w/o module operation\n//if base < 0, return value might be negative too.\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", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSnuke has a string s.\nFrom this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows:\n\nChoose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it with ?s.\n\nFor example, if s is mississippi, we can choose the substring ssissip and replace its 1-st and 3-rd characters with ? to obtain ?s?ssip.\n\nYou are given the strings a, b, and c.\nFind the minimum possible length of s.\n\nConstraints\n\n1 \\leq |a|, |b|, |c| \\leq 2000\n\na, b, and c consists of lowercase English letters and ?s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\n\nOutput\n\nPrint the minimum possible length of s.\n\nSample Input 1\n\na?c\nder\ncod\n\nSample Output 1\n\n7\n\nFor example, s could be atcoder.\n\nSample Input 2\n\natcoder\natcoder\n???????\n\nSample Output 2\n\n7\n\na, b, and c may not be distinct.", "sample_input": "a?c\nder\ncod\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02745", "source_text": "Score : 500 points\n\nProblem Statement\n\nSnuke has a string s.\nFrom this string, Anuke, Bnuke, and Cnuke obtained strings a, b, and c, respectively, as follows:\n\nChoose a non-empty (contiguous) substring of s (possibly s itself). Then, replace some characters (possibly all or none) in it with ?s.\n\nFor example, if s is mississippi, we can choose the substring ssissip and replace its 1-st and 3-rd characters with ? to obtain ?s?ssip.\n\nYou are given the strings a, b, and c.\nFind the minimum possible length of s.\n\nConstraints\n\n1 \\leq |a|, |b|, |c| \\leq 2000\n\na, b, and c consists of lowercase English letters and ?s.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\n\nOutput\n\nPrint the minimum possible length of s.\n\nSample Input 1\n\na?c\nder\ncod\n\nSample Output 1\n\n7\n\nFor example, s could be atcoder.\n\nSample Input 2\n\natcoder\natcoder\n???????\n\nSample Output 2\n\n7\n\na, b, and c may not be distinct.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3267, "cpu_time_ms": 246, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s558325075", "group_id": "codeNet:p02747", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for A - Hitachi String\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tif len(S)%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tvar ans string\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif i%2 == 0 {\n\t\t\t\tans += \"h\"\n\t\t\t} else {\n\t\t\t\tans += \"i\"\n\t\t\t}\n\t\t}\n\n\t\tif S == ans {\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": 1599477096, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02747.html", "problem_id": "p02747", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02747/input.txt", "sample_output_relpath": "derived/input_output/data/p02747/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02747/Go/s558325075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s558325075", "user_id": "u128015095"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for A - Hitachi String\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tif len(S)%2 != 0 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tvar ans string\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif i%2 == 0 {\n\t\t\t\tans += \"h\"\n\t\t\t} else {\n\t\t\t\tans += \"i\"\n\t\t\t}\n\t\t}\n\n\t\tif S == ans {\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\nA Hitachi string is a concatenation of one or more copies of the string hi.\n\nFor example, hi and hihi are Hitachi strings, while ha and hii are not.\n\nGiven a string S, determine whether S is a Hitachi string.\n\nConstraints\n\nThe length of S is between 1 and 10 (inclusive).\n\nS is a string 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 a Hitachi string, print Yes; otherwise, print No.\n\nSample Input 1\n\nhihi\n\nSample Output 1\n\nYes\n\nhihi is the concatenation of two copies of hi, so it is a Hitachi string.\n\nSample Input 2\n\nhi\n\nSample Output 2\n\nYes\n\nSample Input 3\n\nha\n\nSample Output 3\n\nNo", "sample_input": "hihi\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02747", "source_text": "Score : 100 points\n\nProblem Statement\n\nA Hitachi string is a concatenation of one or more copies of the string hi.\n\nFor example, hi and hihi are Hitachi strings, while ha and hii are not.\n\nGiven a string S, determine whether S is a Hitachi string.\n\nConstraints\n\nThe length of S is between 1 and 10 (inclusive).\n\nS is a string 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 a Hitachi string, print Yes; otherwise, print No.\n\nSample Input 1\n\nhihi\n\nSample Output 1\n\nYes\n\nhihi is the concatenation of two copies of hi, so it is a Hitachi string.\n\nSample Input 2\n\nhi\n\nSample Output 2\n\nYes\n\nSample Input 3\n\nha\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 357, "cpu_time_ms": 6, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s255572474", "group_id": "codeNet:p02748", "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\tA, B, m := nextInt(), nextInt(), nextInt()\n\ta, b := nextInts(A), nextInts(B)\n\n\tans := min(a...) + min(b...)\n\tfor i := 0; i < m; i++ {\n\t\tx, y, c := nextInt()-1, nextInt()-1, nextInt()\n\t\tans = min(ans, a[x]+b[y]-c)\n\t}\n\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": 1583865616, "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/s255572474.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s255572474", "user_id": "u502813058"}, "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 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\tA, B, m := nextInt(), nextInt(), nextInt()\n\ta, b := nextInts(A), nextInts(B)\n\n\tans := min(a...) + min(b...)\n\tfor i := 0; i < m; i++ {\n\t\tx, y, c := nextInt()-1, nextInt()-1, nextInt()\n\t\tans = min(ans, a[x]+b[y]-c)\n\t}\n\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 : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "sample_input": "2 3 1\n3 3\n3 3 3\n1 2 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02748", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1349, "cpu_time_ms": 87, "memory_kb": 3712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s054123025", "group_id": "codeNet:p02749", "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 Mod(I []int, P int) int {\n N := 0\n for _, i := range I {\n N = N * 10 + i\n N %= P\n }\n return N\n}\n\nfunc Solve() {\n var N int\n NextInt(&N)\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 D := make([]int, N)\n D[0] = 1\n pos := 1\n Q := make([]int, N)\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 < D[adj] { continue }\n D[adj] = D[q] + 1\n Q[pos] = adj\n pos++\n }\n }\n for i := range D {\n D[i] = -1\n }\n Q[0] = Q[N - 1]\n D[Q[0]] = 1\n pos = 1\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 < D[adj] { continue }\n D[adj] = D[q] + 1\n Q[pos] = adj\n pos++\n }\n }\n k1, k2, k3 := 0, 0, 0\n A := make([]int, N)\n if D[Q[N - 1]] < 4 {\n for i := range A { A[i] = i + 1 }\n WriteIntVec(A)\n return\n }\n for i := N - 1; 0 <= i; i-- {\n q := Q[i]\n d := D[q]\n if d % 2 == 0 {\n if 3 * k1 + 1 <= N {\n A[q] = 3 * k1 + 1\n k1++\n } else if 3 * k3 + 3 <= N {\n A[q] = 3 * k3 + 3\n k3++\n }\n } else {\n if 3 * k2 + 2 <= N {\n A[q] = 3 * k2 + 2\n k2++\n } else if 3 * k3 + 3 <= N {\n A[q] = 3 * k3 + 3\n k3++\n }\n }\n }\n if MinInt(A...) == 0 {\n Write(-1)\n return\n }\n WriteIntVec(A)\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1583722005, "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/s054123025.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s054123025", "user_id": "u415905784"}, "prompt_components": {"gold_output": "1 2 5 4 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 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 Mod(I []int, P int) int {\n N := 0\n for _, i := range I {\n N = N * 10 + i\n N %= P\n }\n return N\n}\n\nfunc Solve() {\n var N int\n NextInt(&N)\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 D := make([]int, N)\n D[0] = 1\n pos := 1\n Q := make([]int, N)\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 < D[adj] { continue }\n D[adj] = D[q] + 1\n Q[pos] = adj\n pos++\n }\n }\n for i := range D {\n D[i] = -1\n }\n Q[0] = Q[N - 1]\n D[Q[0]] = 1\n pos = 1\n for _, q := range Q {\n for _, adj := range T[q] {\n if 0 < D[adj] { continue }\n D[adj] = D[q] + 1\n Q[pos] = adj\n pos++\n }\n }\n k1, k2, k3 := 0, 0, 0\n A := make([]int, N)\n if D[Q[N - 1]] < 4 {\n for i := range A { A[i] = i + 1 }\n WriteIntVec(A)\n return\n }\n for i := N - 1; 0 <= i; i-- {\n q := Q[i]\n d := D[q]\n if d % 2 == 0 {\n if 3 * k1 + 1 <= N {\n A[q] = 3 * k1 + 1\n k1++\n } else if 3 * k3 + 3 <= N {\n A[q] = 3 * k3 + 3\n k3++\n }\n } else {\n if 3 * k2 + 2 <= N {\n A[q] = 3 * k2 + 2\n k2++\n } else if 3 * k3 + 3 <= N {\n A[q] = 3 * k3 + 3\n k3++\n }\n }\n }\n if MinInt(A...) == 0 {\n Write(-1)\n return\n }\n WriteIntVec(A)\n}\n\nfunc main() {\n Solve()\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3101, "cpu_time_ms": 219, "memory_kb": 26368}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s893536248", "group_id": "codeNet:p02753", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\ts := io.Next()\n\tfirst := s[0]\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] != first {\n\t\t\tio.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tio.Println(\"No\")\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// 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": 1596141503, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s893536248.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s893536248", "user_id": "u914096063"}, "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\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\ts := io.Next()\n\tfirst := s[0]\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] != first {\n\t\t\tio.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tio.Println(\"No\")\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// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1293, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s838830236", "group_id": "codeNet:p02753", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := ScanWord()\n//P(s)\n\taCount := 0\n\tbCount := 0\n\tif s[0] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\n\tif s[1] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\tif s[2] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\n\tif aCount > 0 && bCount > 0 {\n\t\tP(\"YES\")\n\t} else {\n\t\tP(\"NO\")\n\t}\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n\n}\n\nfunc ScanWord() string {in.Scan(); return in.Text() }\nfunc ScanInt() int {i, _ := strconv.Atoi(ScanWord()); return i}\nfunc ScanInt64() int64 {i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i}\nfunc ScanStringSlice(n int) []string {s := make([]string, n); for i := 0; i < n; i++ {s[i] = ScanWord()}; return s}\nfunc ScanIntSlice(n int) []int {arr := make([]int, n); for i := 0; i < n; i++ {arr[i] = ScanInt()}; return arr}\nfunc ScanInt64Slice(n int) []int64 {arr := make([]int64, n); for i := 0; i < n; i++ {arr[i] = ScanInt64()}; return arr}\n", "language": "Go", "metadata": {"date": 1583633390, "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/s838830236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s838830236", "user_id": "u308571599"}, "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\ts := ScanWord()\n//P(s)\n\taCount := 0\n\tbCount := 0\n\tif s[0] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\n\tif s[1] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\tif s[2] == 'A' {\n\t\taCount++\n\t} else {\n\t\tbCount++\n\t}\n\n\tif aCount > 0 && bCount > 0 {\n\t\tP(\"YES\")\n\t} else {\n\t\tP(\"NO\")\n\t}\n}\n\n/*********************** I/O ***********************/\n\nvar in *bufio.Scanner\nvar P func(a ...interface{}) (n int, err error)\n\nfunc init() {\n\tP = fmt.Println\n\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(1e+9))\n\tin.Split(bufio.ScanWords)\n\n}\n\nfunc ScanWord() string {in.Scan(); return in.Text() }\nfunc ScanInt() int {i, _ := strconv.Atoi(ScanWord()); return i}\nfunc ScanInt64() int64 {i, _ := strconv.ParseInt(ScanWord(), 10, 64); return i}\nfunc ScanStringSlice(n int) []string {s := make([]string, n); for i := 0; i < n; i++ {s[i] = ScanWord()}; return s}\nfunc ScanIntSlice(n int) []int {arr := make([]int, n); for i := 0; i < n; i++ {arr[i] = ScanInt()}; return arr}\nfunc ScanInt64Slice(n int) []int64 {arr := make([]int64, n); for i := 0; i < n; i++ {arr[i] = ScanInt64()}; return arr}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1162, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s604035766", "group_id": "codeNet:p02754", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n,a,b,ans int\n\tfmt.Scan(&n,&a,&b)\n\ttemp := n/(a+b)\n\tans = temp*a\n\ttemp = n%(a+b)\n\tif temp < a {\n\t\tans += temp\n\t} else {\n\t\tans += a\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1585200472, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/Go/s604035766.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s604035766", "user_id": "u145635628"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n,a,b,ans int\n\tfmt.Scan(&n,&a,&b)\n\ttemp := n/(a+b)\n\tans = temp*a\n\ttemp = n%(a+b)\n\tif temp < a {\n\t\tans += temp\n\t} else {\n\t\tans += a\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 200, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s523824895", "group_id": "codeNet:p02754", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\tC := N / (A + B)\n\tfmt.Println(C*A + N - (A+B)*C)\n}\n", "language": "Go", "metadata": {"date": 1583633347, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/Go/s523824895.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s523824895", "user_id": "u196030116"}, "prompt_components": {"gold_output": "4\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\tC := N / (A + B)\n\tfmt.Println(C*A + N - (A+B)*C)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 133, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s281922506", "group_id": "codeNet:p02754", "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\tN := getInt()\n\tA := getInt()\n\tB := getInt()\n\n\tx := N / (A + B)\n\ty := N % (A + B)\n\n\tsum := A * x\n\tif A <= y {\n\t\tsum += A\n\t} else {\n\t\tsum += y\n\t}\n\tfmt.Println(sum)\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 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", "language": "Go", "metadata": {"date": 1583633147, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/Go/s281922506.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s281922506", "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\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 := getInt()\n\tB := getInt()\n\n\tx := N / (A + B)\n\ty := N % (A + B)\n\n\tsum := A * x\n\tif A <= y {\n\t\tsum += A\n\t} else {\n\t\tsum += y\n\t}\n\tfmt.Println(sum)\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 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", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2204, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s943722581", "group_id": "codeNet:p02755", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tmax := 12*a + a/2\n\tmin := 10 * b\n\tfor i := min; i <= max; i++ {\n\t\tif 8*i/100 == a && i/10 == b {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"-1\")\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1583635096, "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/s943722581.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s943722581", "user_id": "u422903328"}, "prompt_components": {"gold_output": "25\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tmax := 12*a + a/2\n\tmin := 10 * b\n\tfor i := min; i <= max; i++ {\n\t\tif 8*i/100 == a && i/10 == b {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"-1\")\n\treturn\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 246, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s442211176", "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\nconst (\n\tinitialBufSize = 64 * 1024\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tscanner.Buffer(make([]byte, maxBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\ts := scanText()\n\tq := scanInt()\n\n\tisReverse := false\n\thead, tail := \"\", \"\"\n\tfor i := 0; i < q; i++ {\n\n\t\tif scanInt() == 1 {\n\t\t\tisReverse = !isReverse\n\t\t\tcontinue\n\t\t}\n\n\t\tif f := scanInt(); (f == 1 && !isReverse) || (f == 2 && isReverse) {\n\t\t\thead += scanText()\n\t\t} else {\n\t\t\ttail += scanText()\n\t\t}\n\t}\n\n\tans := reverse(head) + s + tail\n\n\tif isReverse {\n\t\tfmt.Print(reverse(ans))\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n}\n\nfunc reverse(s string) string {\n\tt := []byte(s)\n\tfor i, j := 0, (len(s) - 1); i < j; i, j = i+1, j-1 {\n\t\tt[i], t[j] = t[j], t[i]\n\t}\n\treturn string(t)\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 scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc abs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n", "language": "Go", "metadata": {"date": 1585799355, "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/s442211176.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s442211176", "user_id": "u550884590"}, "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\nconst (\n\tinitialBufSize = 64 * 1024\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tscanner.Buffer(make([]byte, maxBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\ts := scanText()\n\tq := scanInt()\n\n\tisReverse := false\n\thead, tail := \"\", \"\"\n\tfor i := 0; i < q; i++ {\n\n\t\tif scanInt() == 1 {\n\t\t\tisReverse = !isReverse\n\t\t\tcontinue\n\t\t}\n\n\t\tif f := scanInt(); (f == 1 && !isReverse) || (f == 2 && isReverse) {\n\t\t\thead += scanText()\n\t\t} else {\n\t\t\ttail += scanText()\n\t\t}\n\t}\n\n\tans := reverse(head) + s + tail\n\n\tif isReverse {\n\t\tfmt.Print(reverse(ans))\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n}\n\nfunc reverse(s string) string {\n\tt := []byte(s)\n\tfor i, j := 0, (len(s) - 1); i < j; i, j = i+1, j-1 {\n\t\tt[i], t[j] = t[j], t[i]\n\t}\n\treturn string(t)\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 scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc abs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1991, "memory_kb": 22400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s400506821", "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 main() {\n\tscanner.Split(bufio.ScanWords)\n\ts := scanText()\n\tq := scanInt()\n\n\tisReverse := false\n\thead, tail := \"\", \"\"\n\tfor i := 0; i < q; i++ {\n\n\t\tif scanInt() == 1 {\n\t\t\tisReverse = !isReverse\n\t\t\tcontinue\n\t\t}\n\n\t\tif f := scanInt(); (f == 1 && !isReverse) || (f == 2 && isReverse) {\n\t\t\thead += scanText()\n\t\t} else {\n\t\t\ttail += scanText()\n\t\t}\n\t}\n\n\tans := reverse(head) + s + tail\n\n\tif isReverse {\n\t\tfmt.Print(reverse(ans))\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n}\n\nfunc reverse(s string) string {\n\tt := []byte(s)\n\tfor i, j := 0, (len(s) - 1); i < j; i, j = i+1, j-1 {\n\t\tt[i], t[j] = t[j], t[i]\n\t}\n\treturn string(t)\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 scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc abs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n", "language": "Go", "metadata": {"date": 1585797299, "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/s400506821.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s400506821", "user_id": "u550884590"}, "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 main() {\n\tscanner.Split(bufio.ScanWords)\n\ts := scanText()\n\tq := scanInt()\n\n\tisReverse := false\n\thead, tail := \"\", \"\"\n\tfor i := 0; i < q; i++ {\n\n\t\tif scanInt() == 1 {\n\t\t\tisReverse = !isReverse\n\t\t\tcontinue\n\t\t}\n\n\t\tif f := scanInt(); (f == 1 && !isReverse) || (f == 2 && isReverse) {\n\t\t\thead += scanText()\n\t\t} else {\n\t\t\ttail += scanText()\n\t\t}\n\t}\n\n\tans := reverse(head) + s + tail\n\n\tif isReverse {\n\t\tfmt.Print(reverse(ans))\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n}\n\nfunc reverse(s string) string {\n\tt := []byte(s)\n\tfor i, j := 0, (len(s) - 1); i < j; i, j = i+1, j-1 {\n\t\tt[i], t[j] = t[j], t[i]\n\t}\n\treturn string(t)\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 scanText() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc abs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1115, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s838912995", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S, fw, lw string\n\tfmt.Scan(&S)\n\tvar Q, c1 int\n\tfmt.Scan(&Q)\n\tw := S\n\tfor i := 0; i < Q; i++ {\n\t\tvar t, f int\n\t\tvar c string\n\t\tfmt.Scan(&t)\n\t\tif t == 2 {\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tif f == 1 {\n\t\t\t\tif c1%2 == 0 {\n\t\t\t\t\tfw += c\n\t\t\t\t} else {\n\t\t\t\t\tlw += c\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif c1%2 == 0 {\n\t\t\t\t\tlw += c\n\t\t\t\t} else {\n\t\t\t\t\tfw += c\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tc1++\n\t\t}\n\t}\n\tvar r string\n\tif len(fw) > 0 {\n\t\tr = Reverse(fw) + w \n\t}\n\tif len(lw) > 0 {\n\t\tr += lw\t\n\t}\n\tif c1%2 == 1 {\n\t\tr = Reverse(r)\n\t}\n\tfmt.Println(r)\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": 1585626591, "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/s838912995.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s838912995", "user_id": "u298152049"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S, fw, lw string\n\tfmt.Scan(&S)\n\tvar Q, c1 int\n\tfmt.Scan(&Q)\n\tw := S\n\tfor i := 0; i < Q; i++ {\n\t\tvar t, f int\n\t\tvar c string\n\t\tfmt.Scan(&t)\n\t\tif t == 2 {\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tif f == 1 {\n\t\t\t\tif c1%2 == 0 {\n\t\t\t\t\tfw += c\n\t\t\t\t} else {\n\t\t\t\t\tlw += c\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif c1%2 == 0 {\n\t\t\t\t\tlw += c\n\t\t\t\t} else {\n\t\t\t\t\tfw += c\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tc1++\n\t\t}\n\t}\n\tvar r string\n\tif len(fw) > 0 {\n\t\tr = Reverse(fw) + w \n\t}\n\tif len(lw) > 0 {\n\t\tr += lw\t\n\t}\n\tif c1%2 == 1 {\n\t\tr = Reverse(r)\n\t}\n\tfmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 732, "cpu_time_ms": 2112, "memory_kb": 9088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s420514716", "group_id": "codeNet:p02756", "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)\nvar bufferSize = 1024 * 1024\n\ntype t struct {\n\tt int64\n\tf int64\n\tc byte\n}\n\nfunc solve(s []byte, q int64, qs []t) []byte {\n\tedges := make([][]byte, 2)\n\tedges[0] = make([]byte, 0, q)\n\tedges[1] = make([]byte, 0, q)\n\tfrontIdx := 0\n\n\treversed := false\n\tfor _, tt := range qs {\n\t\tif tt.t == 1 {\n\t\t\treversed = !reversed\n\t\t\tfrontIdx = 1 - frontIdx\n\t\t\tcontinue\n\t\t}\n\t\tif tt.f == 1 {\n\t\t\tedges[frontIdx] = append(edges[frontIdx], tt.c)\n\t\t} else {\n\t\t\tedges[1 - frontIdx] = append(edges[1 - frontIdx], tt.c)\n\t\t}\n\t}\n\n\tret := make([]byte, 0, len(s) + len(edges[0]) + len(edges[1]))\n\tfor i := len(edges[frontIdx]) - 1; i >= 0; i-- {\n\t\tret = append(ret, edges[frontIdx][i])\n\t}\n\tif reversed {\n\t\tfor i := len(s) - 1; i >= 0; i-- {\n\t\t\tret = append(ret, s[i])\n\t\t}\n\t} else {\n\t\tfor _, b := range s {\n\t\t\tret = append(ret, b)\n\t\t}\n\t}\n\tfor _, b := range edges[1 - frontIdx] {\n\t\tret = append(ret, b)\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tscanBuffer := make([]byte, bufferSize)\n\tsc.Buffer(scanBuffer, bufferSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\ts := nextStringAsBytes()\n\tq := nextInt()\n\n\tqs := make([]t, q)\n\tfor i := int64(0); i < q; i++ {\n\t\tqs[i].t = nextInt()\n\t\tif qs[i].t == 2 {\n\t\t\tqs[i].f = nextInt()\n\t\t\tqs[i].c = nextStringAsBytes()[0]\n\t\t}\n\t}\n\n\tbytes := solve(s, q, qs)\n\tfmt.Fprintln(out, string(bytes))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn sc.Bytes()\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": 1583694767, "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/s420514716.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s420514716", "user_id": "u478530879"}, "prompt_components": {"gold_output": "cpa\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)\nvar bufferSize = 1024 * 1024\n\ntype t struct {\n\tt int64\n\tf int64\n\tc byte\n}\n\nfunc solve(s []byte, q int64, qs []t) []byte {\n\tedges := make([][]byte, 2)\n\tedges[0] = make([]byte, 0, q)\n\tedges[1] = make([]byte, 0, q)\n\tfrontIdx := 0\n\n\treversed := false\n\tfor _, tt := range qs {\n\t\tif tt.t == 1 {\n\t\t\treversed = !reversed\n\t\t\tfrontIdx = 1 - frontIdx\n\t\t\tcontinue\n\t\t}\n\t\tif tt.f == 1 {\n\t\t\tedges[frontIdx] = append(edges[frontIdx], tt.c)\n\t\t} else {\n\t\t\tedges[1 - frontIdx] = append(edges[1 - frontIdx], tt.c)\n\t\t}\n\t}\n\n\tret := make([]byte, 0, len(s) + len(edges[0]) + len(edges[1]))\n\tfor i := len(edges[frontIdx]) - 1; i >= 0; i-- {\n\t\tret = append(ret, edges[frontIdx][i])\n\t}\n\tif reversed {\n\t\tfor i := len(s) - 1; i >= 0; i-- {\n\t\t\tret = append(ret, s[i])\n\t\t}\n\t} else {\n\t\tfor _, b := range s {\n\t\t\tret = append(ret, b)\n\t\t}\n\t}\n\tfor _, b := range edges[1 - frontIdx] {\n\t\tret = append(ret, b)\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tscanBuffer := make([]byte, bufferSize)\n\tsc.Buffer(scanBuffer, bufferSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\ts := nextStringAsBytes()\n\tq := nextInt()\n\n\tqs := make([]t, q)\n\tfor i := int64(0); i < q; i++ {\n\t\tqs[i].t = nextInt()\n\t\tif qs[i].t == 2 {\n\t\t\tqs[i].f = nextInt()\n\t\t\tqs[i].c = nextStringAsBytes()[0]\n\t\t}\n\t}\n\n\tbytes := solve(s, q, qs)\n\tfmt.Fprintln(out, string(bytes))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn sc.Bytes()\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 : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2963, "cpu_time_ms": 69, "memory_kb": 8320}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s361119417", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tresolve(parseProblem(os.Stdin))\n}\n\nfunc parseProblem(r io.Reader) (string, chan query) {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 100000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tsc.Scan()\n\ts := sc.Text()\n\tn := scanint(sc)\n\n\tch := make(chan query)\n\tgo func() {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tch <- parseQuery(sc)\n\t\t}\n\t\tclose(ch)\n\t}()\n\treturn s, ch\n}\n\nconst (\n\tSwitch = 1 + iota\n\tAppend\n)\n\ntype query struct {\n\tcmd int\n\tsub int\n\tc string\n}\n\nfunc parseQuery(sc *bufio.Scanner) query {\n\tcmd := scanint(sc)\n\tif cmd == Switch {\n\t\treturn query{cmd, 0, \"\"}\n\t}\n\tsub := scanint(sc)\n\tsc.Scan()\n\tt := sc.Text()\n\treturn query{Append, sub, t}\n}\n\nfunc scanint(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\n\nfunc resolve(base string, queries chan query) {\n\tstate := 0\n\tfixies := [2][]string{}\n\tfor q := range queries {\n\t\tif q.cmd == Switch {\n\t\t\tstate += 1\n\t\t} else {\n\t\t\t// state 0; 1 -> 1(prefix), 2 -> 0 (suffix)\n\t\t\tfixies[(state+q.sub)%2] = append(fixies[(state+q.sub)%2], q.c)\n\t\t}\n\t}\n\n\tnormal := state%2 == 0\n\tprefix := fixies[(state+1)%2]\n\tsuffix := fixies[(state+2)%2]\n\n\tfor i := len(prefix); i > 0; i-- {\n\t\tfmt.Printf(\"%s\", prefix[i-1])\n\t}\n\tif normal {\n\t\tfmt.Printf(\"%s\", base)\n\t} else {\n\t\trunes := []rune(base)\n\t\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\t\trunes[i], runes[j] = runes[j], runes[i]\n\t\t}\n\t\tfmt.Printf(\"%s\", string(runes))\n\t}\n\n\tfor i := 0; i < len(suffix); i++ {\n\t\tfmt.Printf(\"%s\", suffix[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583637898, "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/s361119417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s361119417", "user_id": "u623007471"}, "prompt_components": {"gold_output": "cpa\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\nfunc main() {\n\tresolve(parseProblem(os.Stdin))\n}\n\nfunc parseProblem(r io.Reader) (string, chan query) {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 100000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tsc.Scan()\n\ts := sc.Text()\n\tn := scanint(sc)\n\n\tch := make(chan query)\n\tgo func() {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tch <- parseQuery(sc)\n\t\t}\n\t\tclose(ch)\n\t}()\n\treturn s, ch\n}\n\nconst (\n\tSwitch = 1 + iota\n\tAppend\n)\n\ntype query struct {\n\tcmd int\n\tsub int\n\tc string\n}\n\nfunc parseQuery(sc *bufio.Scanner) query {\n\tcmd := scanint(sc)\n\tif cmd == Switch {\n\t\treturn query{cmd, 0, \"\"}\n\t}\n\tsub := scanint(sc)\n\tsc.Scan()\n\tt := sc.Text()\n\treturn query{Append, sub, t}\n}\n\nfunc scanint(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\n\nfunc resolve(base string, queries chan query) {\n\tstate := 0\n\tfixies := [2][]string{}\n\tfor q := range queries {\n\t\tif q.cmd == Switch {\n\t\t\tstate += 1\n\t\t} else {\n\t\t\t// state 0; 1 -> 1(prefix), 2 -> 0 (suffix)\n\t\t\tfixies[(state+q.sub)%2] = append(fixies[(state+q.sub)%2], q.c)\n\t\t}\n\t}\n\n\tnormal := state%2 == 0\n\tprefix := fixies[(state+1)%2]\n\tsuffix := fixies[(state+2)%2]\n\n\tfor i := len(prefix); i > 0; i-- {\n\t\tfmt.Printf(\"%s\", prefix[i-1])\n\t}\n\tif normal {\n\t\tfmt.Printf(\"%s\", base)\n\t} else {\n\t\trunes := []rune(base)\n\t\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\t\trunes[i], runes[j] = runes[j], runes[i]\n\t\t}\n\t\tfmt.Printf(\"%s\", string(runes))\n\t}\n\n\tfor i := 0; i < len(suffix); i++ {\n\t\tfmt.Printf(\"%s\", suffix[i])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1650, "cpu_time_ms": 646, "memory_kb": 15008}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s301505853", "group_id": "codeNet:p02756", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc swap(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\treturn s[len(s)-1:] + s[1:len(s)-1] + s[:1]\n}\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\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\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar s string\n\tvar n int\n\tfmt.Scan(&s, &n)\n\n\tvar q, f int\n\tvar c string\n\tvar reverse bool\n\tfront := make([]string, 0)\n\tback := make([]string, 0)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&q)\n\t\tif q == 1 {\n\t\t\tif reverse {\n\t\t\t\treverse = false\n\t\t\t} else {\n\t\t\t\treverse = true\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tif f == 1 {\n\t\t\t\tif reverse {\n\t\t\t\t\tback = append(back, c)\n\t\t\t\t} else {\n\t\t\t\t\tfront = append([]string{c}, front...)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif reverse {\n\t\t\t\t\tfront = append([]string{c}, front...)\n\t\t\t\t} else {\n\t\t\t\t\tback = append(back, c)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ts = strings.Join(front, \"\") + s + strings.Join(back, \"\")\n\tif reverse {\n\t\ts = Reverse(s)\n\t}\n\tfmt.Println(s)\n}\n", "language": "Go", "metadata": {"date": 1583637590, "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/s301505853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s301505853", "user_id": "u315984289"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc swap(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\treturn s[len(s)-1:] + s[1:len(s)-1] + s[:1]\n}\n\nfunc Reverse(s string) string {\n\trunes := []rune(s)\n\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\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar s string\n\tvar n int\n\tfmt.Scan(&s, &n)\n\n\tvar q, f int\n\tvar c string\n\tvar reverse bool\n\tfront := make([]string, 0)\n\tback := make([]string, 0)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&q)\n\t\tif q == 1 {\n\t\t\tif reverse {\n\t\t\t\treverse = false\n\t\t\t} else {\n\t\t\t\treverse = true\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Scan(&f, &c)\n\t\t\tif f == 1 {\n\t\t\t\tif reverse {\n\t\t\t\t\tback = append(back, c)\n\t\t\t\t} else {\n\t\t\t\t\tfront = append([]string{c}, front...)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif reverse {\n\t\t\t\t\tfront = append([]string{c}, front...)\n\t\t\t\t} else {\n\t\t\t\t\tback = append(back, c)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\ts = strings.Join(front, \"\") + s + strings.Join(back, \"\")\n\tif reverse {\n\t\ts = Reverse(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2108, "memory_kb": 8836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s085930524", "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)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts, q := next(), nextInt()\n\n\tfor i := 0; i < q; i++ {\n\t\tqa := nextInt()\n\t\tif qa == 1 {\n\t\t\tsl := len(s)\n\t\t\tif sl > 1 {\n\t\t\t\trs := []rune(s)\n\t\t\t\trs[0], rs[sl-1] = rs[sl-1], rs[0]\n\t\t\t\ts = string(rs)\n\t\t\t}\n\t\t}\n\t\tif qa == 2 {\n\t\t\tf, c := nextInt(), next()\n\t\t\tif f == 1 {\n\t\t\t\ts = c + s\n\t\t\t}\n\t\t\tif f == 2 {\n\t\t\t\ts = s + c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(s)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1583637146, "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/s085930524.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s085930524", "user_id": "u991577448"}, "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)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts, q := next(), nextInt()\n\n\tfor i := 0; i < q; i++ {\n\t\tqa := nextInt()\n\t\tif qa == 1 {\n\t\t\tsl := len(s)\n\t\t\tif sl > 1 {\n\t\t\t\trs := []rune(s)\n\t\t\t\trs[0], rs[sl-1] = rs[sl-1], rs[0]\n\t\t\t\ts = string(rs)\n\t\t\t}\n\t\t}\n\t\tif qa == 2 {\n\t\t\tf, c := nextInt(), next()\n\t\t\tif f == 1 {\n\t\t\t\ts = c + s\n\t\t\t}\n\t\t\tif f == 2 {\n\t\t\t\ts = s + c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(s)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s450152088", "group_id": "codeNet:p02757", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// N: [1, 2e5]\n// len(S) = N\n// P: [2, 10000], prime\nfunc main() {\n\tsc := newInputScanner(true, 256)\n\tN, P, S := sc.nextInt(), sc.nextInt(), sc.nextStr()\n\t// N := 20000\n\t// P := 127\n\t// S := \"\"\n\t// for i := 0; i < N; i++ {\n\t// \tS += string(strconv.Itoa(rand.Intn(10)))\n\t// }\n\t// fmt.Println(S)\n\tanswer := checkSubNumbers(N, P, S)\n\tfmt.Println(answer)\n}\n\nfunc checkSubNumbers(N int, P int, S string) int {\n\tswitch P {\n\tcase 2, 5:\n\t\treturn checkTwoOrFive(N, P, S)\n\tdefault:\n\t\treturn checkNotTwoNorFive(N, P, S)\n\t}\n}\n\nfunc checkTwoOrFive(N int, P int, S string) int {\n\tanswer := 0\n\tvar n int\n\tfor i := N - 1; i >= 0; i-- {\n\t\tn, _ = strconv.Atoi(S[i : i+1])\n\t\tif n%P == 0 {\n\t\t\tanswer += i + 1\n\t\t}\n\t}\n\treturn answer\n}\n\nfunc checkNotTwoNorFive(N int, P int, S string) int {\n\tbigP := big.NewInt(int64(P))\n\tten := big.NewInt(10)\n\tmultiplier := big.NewInt(1)\n\tanswer := 0\n\tremainderLookup := make([]int, P)\n\tcurrentBigInt := big.NewInt(0)\n\tprevRemaider := -1\n\tvar digit, remainder, count int\n\tvar n *big.Int\n\tfor i := N - 1; i >= 0; i-- {\n\t\tdigit, _ = strconv.Atoi(S[i : i+1])\n\t\tif digit == 0 {\n\t\t\tif prevRemaider == -1 {\n\t\t\t\tremainder = 0\n\t\t\t} else {\n\t\t\t\tremainder = prevRemaider\n\t\t\t}\n\t\t} else {\n\t\t\tn = big.NewInt(int64(digit))\n\t\t\tn = n.Mul(n, multiplier)\n\t\t\tn = n.Add(currentBigInt, n)\n\t\t\tcurrentBigInt.Set(n)\n\t\t\tremainder = int(n.Mod(n, bigP).Int64())\n\t\t}\n\t\tif remainder == 0 {\n\t\t\tanswer++\n\t\t}\n\t\tcount = remainderLookup[remainder]\n\t\tanswer += count\n\t\tcount++\n\t\tremainderLookup[remainder] = count\n\t\tprevRemaider = remainder\n\t\tmultiplier = multiplier.Mul(multiplier, ten)\n\t}\n\treturn answer\n}\n\ntype inputScanner struct {\n\t*bufio.Scanner\n}\n\nfunc newInputScanner(enabledScanWords bool, sizeInKB int) *inputScanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tif enabledScanWords {\n\t\tscanner.Split(bufio.ScanWords)\n\t}\n\tcapacity := sizeInKB * 1024\n\tbuf := make([]byte, capacity)\n\tscanner.Buffer(buf, capacity)\n\treturn &inputScanner{\n\t\tScanner: scanner,\n\t}\n}\n\nfunc (inputSc *inputScanner) nextInt() int {\n\ti, e := strconv.Atoi(inputSc.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (inputSc *inputScanner) nextUInt64() uint64 {\n\ti, e := strconv.ParseUint(inputSc.nextStr(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (inputSc *inputScanner) nextStr() string {\n\tinputSc.Scan()\n\treturn inputSc.Text()\n}\n", "language": "Go", "metadata": {"date": 1584203297, "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/s450152088.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s450152088", "user_id": "u004373628"}, "prompt_components": {"gold_output": "6\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)\n\n// N: [1, 2e5]\n// len(S) = N\n// P: [2, 10000], prime\nfunc main() {\n\tsc := newInputScanner(true, 256)\n\tN, P, S := sc.nextInt(), sc.nextInt(), sc.nextStr()\n\t// N := 20000\n\t// P := 127\n\t// S := \"\"\n\t// for i := 0; i < N; i++ {\n\t// \tS += string(strconv.Itoa(rand.Intn(10)))\n\t// }\n\t// fmt.Println(S)\n\tanswer := checkSubNumbers(N, P, S)\n\tfmt.Println(answer)\n}\n\nfunc checkSubNumbers(N int, P int, S string) int {\n\tswitch P {\n\tcase 2, 5:\n\t\treturn checkTwoOrFive(N, P, S)\n\tdefault:\n\t\treturn checkNotTwoNorFive(N, P, S)\n\t}\n}\n\nfunc checkTwoOrFive(N int, P int, S string) int {\n\tanswer := 0\n\tvar n int\n\tfor i := N - 1; i >= 0; i-- {\n\t\tn, _ = strconv.Atoi(S[i : i+1])\n\t\tif n%P == 0 {\n\t\t\tanswer += i + 1\n\t\t}\n\t}\n\treturn answer\n}\n\nfunc checkNotTwoNorFive(N int, P int, S string) int {\n\tbigP := big.NewInt(int64(P))\n\tten := big.NewInt(10)\n\tmultiplier := big.NewInt(1)\n\tanswer := 0\n\tremainderLookup := make([]int, P)\n\tcurrentBigInt := big.NewInt(0)\n\tprevRemaider := -1\n\tvar digit, remainder, count int\n\tvar n *big.Int\n\tfor i := N - 1; i >= 0; i-- {\n\t\tdigit, _ = strconv.Atoi(S[i : i+1])\n\t\tif digit == 0 {\n\t\t\tif prevRemaider == -1 {\n\t\t\t\tremainder = 0\n\t\t\t} else {\n\t\t\t\tremainder = prevRemaider\n\t\t\t}\n\t\t} else {\n\t\t\tn = big.NewInt(int64(digit))\n\t\t\tn = n.Mul(n, multiplier)\n\t\t\tn = n.Add(currentBigInt, n)\n\t\t\tcurrentBigInt.Set(n)\n\t\t\tremainder = int(n.Mod(n, bigP).Int64())\n\t\t}\n\t\tif remainder == 0 {\n\t\t\tanswer++\n\t\t}\n\t\tcount = remainderLookup[remainder]\n\t\tanswer += count\n\t\tcount++\n\t\tremainderLookup[remainder] = count\n\t\tprevRemaider = remainder\n\t\tmultiplier = multiplier.Mul(multiplier, ten)\n\t}\n\treturn answer\n}\n\ntype inputScanner struct {\n\t*bufio.Scanner\n}\n\nfunc newInputScanner(enabledScanWords bool, sizeInKB int) *inputScanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tif enabledScanWords {\n\t\tscanner.Split(bufio.ScanWords)\n\t}\n\tcapacity := sizeInKB * 1024\n\tbuf := make([]byte, capacity)\n\tscanner.Buffer(buf, capacity)\n\treturn &inputScanner{\n\t\tScanner: scanner,\n\t}\n}\n\nfunc (inputSc *inputScanner) nextInt() int {\n\ti, e := strconv.Atoi(inputSc.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (inputSc *inputScanner) nextUInt64() uint64 {\n\ti, e := strconv.ParseUint(inputSc.nextStr(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (inputSc *inputScanner) nextStr() string {\n\tinputSc.Scan()\n\treturn inputSc.Text()\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2378, "cpu_time_ms": 2108, "memory_kb": 11008}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s215625874", "group_id": "codeNet:p02757", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar n, p int64\n\tvar s string\n\tfmt.Scanf(\"%d %d\", &n, &p)\n\tfmt.Scanf(\"%s\", &s)\n\tanswer := countDivisible(n, p, s)\n\tfmt.Println(answer)\n}\n\nfunc countDivisible(n, p int64, s string) int64 {\n\tmodMatrix := make([][]int64, len(s))\n\n\tfor i := 0; i < len(s); i++ {\n\t\tmodMatrix[i] = make([]int64, len(s))\n\t\tfor j := 0; j < len(s)-i; j++ {\n\t\t\t// i: index in s, j: 10 ** j\n\t\t\tif j < 14 { // rough estimation for avoiding int overflow\n\t\t\t\tmodMatrix[i][j] = (int64(s[i]) - 48) * int64(math.Pow10(j)) % p\n\t\t\t} else {\n\t\t\t\tbigP := big.NewInt(p)\n\t\t\t\tbigSi := big.NewInt(int64(s[i]) - 48)\n\t\t\t\tten := big.NewInt(10)\n\t\t\t\tten.Exp(ten, big.NewInt(int64(j)), nil)\n\t\t\t\tbigSi.Mul(bigSi, ten)\n\t\t\t\tbigSi.Mod(bigSi, bigP)\n\t\t\t\tmodMatrix[i][j] = bigSi.Int64()\n\t\t\t}\n\t\t}\n\t}\n\n\tvar cnt int64\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i; j < len(s); j++ {\n\t\t\tvar sumOfMod int64\n\t\t\tfor k := i; k <= j; k++ {\n\t\t\t\tsumOfMod += modMatrix[k][j-k]\n\t\t\t}\n\t\t\tif sumOfMod%p == 0 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\treturn cnt\n}\n", "language": "Go", "metadata": {"date": 1583846754, "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/s215625874.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s215625874", "user_id": "u238461782"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar n, p int64\n\tvar s string\n\tfmt.Scanf(\"%d %d\", &n, &p)\n\tfmt.Scanf(\"%s\", &s)\n\tanswer := countDivisible(n, p, s)\n\tfmt.Println(answer)\n}\n\nfunc countDivisible(n, p int64, s string) int64 {\n\tmodMatrix := make([][]int64, len(s))\n\n\tfor i := 0; i < len(s); i++ {\n\t\tmodMatrix[i] = make([]int64, len(s))\n\t\tfor j := 0; j < len(s)-i; j++ {\n\t\t\t// i: index in s, j: 10 ** j\n\t\t\tif j < 14 { // rough estimation for avoiding int overflow\n\t\t\t\tmodMatrix[i][j] = (int64(s[i]) - 48) * int64(math.Pow10(j)) % p\n\t\t\t} else {\n\t\t\t\tbigP := big.NewInt(p)\n\t\t\t\tbigSi := big.NewInt(int64(s[i]) - 48)\n\t\t\t\tten := big.NewInt(10)\n\t\t\t\tten.Exp(ten, big.NewInt(int64(j)), nil)\n\t\t\t\tbigSi.Mul(bigSi, ten)\n\t\t\t\tbigSi.Mod(bigSi, bigP)\n\t\t\t\tmodMatrix[i][j] = bigSi.Int64()\n\t\t\t}\n\t\t}\n\t}\n\n\tvar cnt int64\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i; j < len(s); j++ {\n\t\t\tvar sumOfMod int64\n\t\t\tfor k := i; k <= j; k++ {\n\t\t\t\tsumOfMod += modMatrix[k][j-k]\n\t\t\t}\n\t\t\tif sumOfMod%p == 0 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\treturn cnt\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1039, "cpu_time_ms": 2108, "memory_kb": 17152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s335745061", "group_id": "codeNet:p02757", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, p int\n\tfmt.Scan(&n, &p)\n\tvar s []byte\n\tfmt.Scan(&s)\n\n\tvar sum int\n\tms := make([]map[int]int, n)\n\tfor i := range s {\n\t\tms[i] = make(map[int]int)\n\t\tt, _ := strconv.Atoi(string([]byte{s[i]}))\n\t\tms[i][t%p]++\n\t\tif i > 0 {\n\t\t\tfor k, v := range ms[i-1] {\n\t\t\t\tu := (k*10 + t) % p\n\t\t\t\tms[i][u] += v\n\t\t\t}\n\t\t}\n\t\tif cnt, ok := ms[i][0]; ok {\n\t\t\tsum += cnt\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1583636016, "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/s335745061.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s335745061", "user_id": "u282164747"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, p int\n\tfmt.Scan(&n, &p)\n\tvar s []byte\n\tfmt.Scan(&s)\n\n\tvar sum int\n\tms := make([]map[int]int, n)\n\tfor i := range s {\n\t\tms[i] = make(map[int]int)\n\t\tt, _ := strconv.Atoi(string([]byte{s[i]}))\n\t\tms[i][t%p]++\n\t\tif i > 0 {\n\t\t\tfor k, v := range ms[i-1] {\n\t\t\t\tu := (k*10 + t) % p\n\t\t\t\tms[i][u] += v\n\t\t\t}\n\t\t}\n\t\tif cnt, ok := ms[i][0]; ok {\n\t\t\tsum += cnt\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2135, "memory_kb": 455276}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787418887", "group_id": "codeNet:p02759", "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\tvar result int\n\tresult = result + N/2 + N%2\n\n\tfmt.Println(result)\n\n}\n", "language": "Go", "metadata": {"date": 1595312608, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/Go/s787418887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s787418887", "user_id": "u128015095"}, "prompt_components": {"gold_output": "3\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\tvar result int\n\tresult = result + N/2 + N%2\n\n\tfmt.Println(result)\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 151, "cpu_time_ms": 8, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750017213", "group_id": "codeNet:p02759", "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 huge = int(math.Pow(10, 18))\n\nconst maxS = 50*50 + 5\n\nfunc main() {\n\tvar n int\n\tInputInt(\" \", &n)\n\tWrite(n/2 + n%2)\n\tFlush()\n}\n\n/*----------文字列関連----------*/\n\n// ReverseByte byte列の反転\nfunc ReverseByte(list []byte) []byte {\n\tl := len(list)\n\tres := make([]byte, l)\n\tfor i := 0; i < l; i++ {\n\t\tres[i] = list[l-i-1]\n\t}\n\treturn res\n}\n\n/*----------Intでの基本計算関数----------*/\n\n// MinInt 最大値導出関数\nfunc MinInt(nums ...int) int {\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] < res:\n\t\t\tres = nums[i]\n\t\t}\n\t}\n\treturn res\n}\n\n// MaxInt 最大値導出関数\nfunc MaxInt(nums ...int) int {\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] > res:\n\t\t\tres = nums[i]\n\t\t}\n\t}\n\treturn res\n}\n\n// PowInt Int型での冪乗計算\nfunc PowInt(n int, x int) int {\n\tres := 1\n\tfor i := 0; i < x; i++ {\n\t\tres *= n\n\t}\n\treturn res\n}\n\n// SumInt Int型での合計計算\nfunc SumInt(A ...int) int {\n\tsum := 0\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\treturn sum\n}\n\n// AbsInt Int型での絶対値計算\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\n/*----------Int型スライスの基本計算関数----------*/\n\n// MinIntVec 最大値導出関数 インデックスも返す\nfunc MinIntVec(nums []int) (int, []int) {\n\tres := nums[0]\n\tvar index []int\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] < res:\n\t\t\tres = nums[i]\n\t\t\tindex = []int{i}\n\t\tcase nums[i] == res:\n\t\t\tindex = append(index, i)\n\t\t}\n\t}\n\treturn res, index\n}\n\n// MaxIntVec 最大値導出関数 インデックスも返す\nfunc MaxIntVec(nums []int) (int, []int) {\n\tres := nums[0]\n\tvar index []int\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] > res:\n\t\t\tres = nums[i]\n\t\t\tindex = []int{i}\n\t\tcase nums[i] == res:\n\t\t\tindex = append(index, i)\n\t\t}\n\t}\n\treturn res, index\n}\n\n// SumIntVec Int型での合計計算\nfunc SumIntVec(A []int) int {\n\tsum := 0\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\treturn sum\n}\n\n/*----------標準入力・出力用の関数----------*/\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n// InputLine 次の標準入力をstring型として取得\nfunc InputLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, _ := reader.ReadLine()\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// InputString いくつかの文字列をstring型で取得\nfunc InputString(delim string, A ...*string) {\n\tL := strings.Split(InputLine(), delim)\n\tfor i, a := range A {\n\t\t*a = L[i]\n\t}\n}\n\n// InputStringVec delim区切りの文字列をstring型のスライスとして取得\nfunc InputStringVec(delim string,A *[]string) {\n\tL := strings.Split(InputLine(), delim)\n *A = make([]string,len(L))\n for i := range L {\n\t\t(*A)[i] = L[i]\n\t}\n}\n\n// InputInt いくつかの数値をint型で取得\nfunc InputInt(delim string, A ...*int) {\n\tL := strings.Split(InputLine(), delim)\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\n\n// InputIntVec delim区切りの数値をint型のスライスとして取得\nfunc InputIntVec(delim string, A *[]int) {\n\tL := strings.Split(InputLine(), delim)\n\t*A = make([]int, len(L))\n\tfor i := range L {\n\t\t(*A)[i], _ = strconv.Atoi(L[i])\n\t}\n}\n\n// Write バッファに対応した出力関数\nfunc Write(s interface{}) {\n\tfmt.Fprintln(writer, s)\n}\n\n// WriteIntVec バッファに対応したInt型スライスの出力関数\nfunc WriteIntVec(A []int) {\n\tS := make([]string, len(A))\n\tfor i, a := range A {\n\t\tS[i] = strconv.Itoa(a)\n\t}\n\tWrite(strings.Join(S, \" \"))\n}\n\n// Flush バッファした出力をフラッシュ\nfunc Flush() {\n\t_ = writer.Flush()\n}\n", "language": "Go", "metadata": {"date": 1592270263, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/Go/s750017213.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750017213", "user_id": "u474106371"}, "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 huge = int(math.Pow(10, 18))\n\nconst maxS = 50*50 + 5\n\nfunc main() {\n\tvar n int\n\tInputInt(\" \", &n)\n\tWrite(n/2 + n%2)\n\tFlush()\n}\n\n/*----------文字列関連----------*/\n\n// ReverseByte byte列の反転\nfunc ReverseByte(list []byte) []byte {\n\tl := len(list)\n\tres := make([]byte, l)\n\tfor i := 0; i < l; i++ {\n\t\tres[i] = list[l-i-1]\n\t}\n\treturn res\n}\n\n/*----------Intでの基本計算関数----------*/\n\n// MinInt 最大値導出関数\nfunc MinInt(nums ...int) int {\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] < res:\n\t\t\tres = nums[i]\n\t\t}\n\t}\n\treturn res\n}\n\n// MaxInt 最大値導出関数\nfunc MaxInt(nums ...int) int {\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] > res:\n\t\t\tres = nums[i]\n\t\t}\n\t}\n\treturn res\n}\n\n// PowInt Int型での冪乗計算\nfunc PowInt(n int, x int) int {\n\tres := 1\n\tfor i := 0; i < x; i++ {\n\t\tres *= n\n\t}\n\treturn res\n}\n\n// SumInt Int型での合計計算\nfunc SumInt(A ...int) int {\n\tsum := 0\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\treturn sum\n}\n\n// AbsInt Int型での絶対値計算\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\n/*----------Int型スライスの基本計算関数----------*/\n\n// MinIntVec 最大値導出関数 インデックスも返す\nfunc MinIntVec(nums []int) (int, []int) {\n\tres := nums[0]\n\tvar index []int\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] < res:\n\t\t\tres = nums[i]\n\t\t\tindex = []int{i}\n\t\tcase nums[i] == res:\n\t\t\tindex = append(index, i)\n\t\t}\n\t}\n\treturn res, index\n}\n\n// MaxIntVec 最大値導出関数 インデックスも返す\nfunc MaxIntVec(nums []int) (int, []int) {\n\tres := nums[0]\n\tvar index []int\n\tfor i := 0; i < len(nums); i++ {\n\t\tswitch {\n\t\tcase nums[i] > res:\n\t\t\tres = nums[i]\n\t\t\tindex = []int{i}\n\t\tcase nums[i] == res:\n\t\t\tindex = append(index, i)\n\t\t}\n\t}\n\treturn res, index\n}\n\n// SumIntVec Int型での合計計算\nfunc SumIntVec(A []int) int {\n\tsum := 0\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\treturn sum\n}\n\n/*----------標準入力・出力用の関数----------*/\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n// InputLine 次の標準入力をstring型として取得\nfunc InputLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, _ := reader.ReadLine()\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// InputString いくつかの文字列をstring型で取得\nfunc InputString(delim string, A ...*string) {\n\tL := strings.Split(InputLine(), delim)\n\tfor i, a := range A {\n\t\t*a = L[i]\n\t}\n}\n\n// InputStringVec delim区切りの文字列をstring型のスライスとして取得\nfunc InputStringVec(delim string,A *[]string) {\n\tL := strings.Split(InputLine(), delim)\n *A = make([]string,len(L))\n for i := range L {\n\t\t(*A)[i] = L[i]\n\t}\n}\n\n// InputInt いくつかの数値をint型で取得\nfunc InputInt(delim string, A ...*int) {\n\tL := strings.Split(InputLine(), delim)\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\n\n// InputIntVec delim区切りの数値をint型のスライスとして取得\nfunc InputIntVec(delim string, A *[]int) {\n\tL := strings.Split(InputLine(), delim)\n\t*A = make([]int, len(L))\n\tfor i := range L {\n\t\t(*A)[i], _ = strconv.Atoi(L[i])\n\t}\n}\n\n// Write バッファに対応��た出力関数\nfunc Write(s interface{}) {\n\tfmt.Fprintln(writer, s)\n}\n\n// WriteIntVec バッファに対応したInt型スライスの出力関数\nfunc WriteIntVec(A []int) {\n\tS := make([]string, len(A))\n\tfor i, a := range A {\n\t\tS[i] = strconv.Itoa(a)\n\t}\n\tWrite(strings.Join(S, \" \"))\n}\n\n// Flush バッファした出力をフラッシュ\nfunc Flush() {\n\t_ = writer.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3730, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s529690318", "group_id": "codeNet:p02759", "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\n\tfmt.Println(n/2 + (n % 2))\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": 1591672368, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/Go/s529690318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s529690318", "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\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\tfmt.Println(n/2 + (n % 2))\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 : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 364, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s116817698", "group_id": "codeNet:p02759", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n \tpanic(e)\n }\n return i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n ans := n / 2 + n % 2\n \n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1584393380, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/Go/s116817698.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s116817698", "user_id": "u066549434"}, "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\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n \tpanic(e)\n }\n return i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n ans := n / 2 + n % 2\n \n fmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 371, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s388889600", "group_id": "codeNet:p02760", "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 = 1000000009\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\tA := make([][]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tA[i] = make([]int, 3)\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tA[i][j] = nextInt()\n\t\t}\n\t}\n\tvar N int\n\tN = nextInt()\n\tmatrix := [][]int{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}\n\tfor i := 0; i < N; i++ {\n\t\tb := nextInt()\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfor k := 0; k < 3; k++ {\n\t\t\t\tif A[j][k] == b {\n\t\t\t\t\tmatrix[j][k] = 1\n\t\t\t\t}\n\t\t\t\tif matrix[j][0]+matrix[j][1]+matrix[j][2] == 3 {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif matrix[0][0]+matrix[1][0]+matrix[2][0] == 3 || matrix[0][1]+matrix[1][1]+matrix[1][1] == 3 || matrix[0][2]+matrix[1][2]+matrix[2][2] == 3 || matrix[0][0]+matrix[1][1]+matrix[2][2] == 3 || matrix[2][0]+matrix[1][1]+matrix[0][2] == 3 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\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": 1583116369, "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/s388889600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s388889600", "user_id": "u605443479"}, "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 = 10000\n\tmaxBufSize = 1000000009\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\tA := make([][]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tA[i] = make([]int, 3)\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tA[i][j] = nextInt()\n\t\t}\n\t}\n\tvar N int\n\tN = nextInt()\n\tmatrix := [][]int{{0, 0, 0}, {0, 0, 0}, {0, 0, 0}}\n\tfor i := 0; i < N; i++ {\n\t\tb := nextInt()\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfor k := 0; k < 3; k++ {\n\t\t\t\tif A[j][k] == b {\n\t\t\t\t\tmatrix[j][k] = 1\n\t\t\t\t}\n\t\t\t\tif matrix[j][0]+matrix[j][1]+matrix[j][2] == 3 {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif matrix[0][0]+matrix[1][0]+matrix[2][0] == 3 || matrix[0][1]+matrix[1][1]+matrix[1][1] == 3 || matrix[0][2]+matrix[1][2]+matrix[2][2] == 3 || matrix[0][0]+matrix[1][1]+matrix[2][2] == 3 || matrix[2][0]+matrix[1][1]+matrix[0][2] == 3 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\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\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1183, "cpu_time_ms": 20, "memory_kb": 32128}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s931580613", "group_id": "codeNet:p02763", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc insert(a []int, x int) []int {\n\ti := sort.SearchInts(a, x)\n\treturn append(append(a[:i], x), a[i:]...)\n}\n\nfunc remove(a []int, x int) []int {\n\ti := sort.SearchInts(a, x)\n\tif i < len(a)-1 {\n\t\treturn append(a[:i], a[i+1:]...)\n\t}\n\treturn a[:i]\n}\n\nfunc main() {\n\tvar n, q int\n\tvar str string\n\tfmt.Scan(&n, &str, &q)\n\n\ts := []byte(str)\n\tabc := [26][]int{}\n\tfor i := 0; i < n; i++ {\n\t\tc := s[i] - 'a'\n\t\tabc[c] = append(abc[c], i)\n\t}\n\n\tfor k := 0; k < q; k++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\n\t\tif t == 1 {\n\t\t\tvar i int\n\t\t\tvar a string\n\t\t\tfmt.Scan(&i, &a)\n\t\t\ti--\n\n\t\t\tc := s[i] - 'a'\n\t\t\tabc[c] = remove(abc[c], i)\n\t\t\ts[i] = a[0]\n\t\t\tc = s[i] - 'a'\n\t\t\tabc[c] = insert(abc[c], i)\n\t\t} else {\n\t\t\tvar l, r int\n\t\t\tfmt.Scan(&l, &r)\n\t\t\tl--\n\n\t\t\tcnt := 0\n\t\t\tfor c := 0; c < 26; c++ {\n\t\t\t\ti := sort.SearchInts(abc[c], l)\n\t\t\t\tif i < len(abc[c]) && abc[c][i] < r {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583561378, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02763.html", "problem_id": "p02763", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02763/input.txt", "sample_output_relpath": "derived/input_output/data/p02763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02763/Go/s931580613.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s931580613", "user_id": "u448258717"}, "prompt_components": {"gold_output": "3\n1\n5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc insert(a []int, x int) []int {\n\ti := sort.SearchInts(a, x)\n\treturn append(append(a[:i], x), a[i:]...)\n}\n\nfunc remove(a []int, x int) []int {\n\ti := sort.SearchInts(a, x)\n\tif i < len(a)-1 {\n\t\treturn append(a[:i], a[i+1:]...)\n\t}\n\treturn a[:i]\n}\n\nfunc main() {\n\tvar n, q int\n\tvar str string\n\tfmt.Scan(&n, &str, &q)\n\n\ts := []byte(str)\n\tabc := [26][]int{}\n\tfor i := 0; i < n; i++ {\n\t\tc := s[i] - 'a'\n\t\tabc[c] = append(abc[c], i)\n\t}\n\n\tfor k := 0; k < q; k++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\n\t\tif t == 1 {\n\t\t\tvar i int\n\t\t\tvar a string\n\t\t\tfmt.Scan(&i, &a)\n\t\t\ti--\n\n\t\t\tc := s[i] - 'a'\n\t\t\tabc[c] = remove(abc[c], i)\n\t\t\ts[i] = a[0]\n\t\t\tc = s[i] - 'a'\n\t\t\tabc[c] = insert(abc[c], i)\n\t\t} else {\n\t\t\tvar l, r int\n\t\t\tfmt.Scan(&l, &r)\n\t\t\tl--\n\n\t\t\tcnt := 0\n\t\t\tfor c := 0; c < 26; c++ {\n\t\t\t\ti := sort.SearchInts(abc[c], l)\n\t\t\t\tif i < len(abc[c]) && abc[c][i] < r {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\n\t}\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\n\nProcess Q queries of the following two types:\n\nType 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.)\n\nType 2: answer the number of different characters occurring in the substring of S between the l_q-th and r_q-th characters (inclusive).\n\nConstraints\n\nN, Q, i_q, l_q, and r_q are integers.\n\nS is a string consisting of lowercase English letters.\n\nc_q is a lowercase English letter.\n\n1 \\leq N \\leq 500000\n\n1 \\leq Q \\leq 20000\n\n|S| = N\n\n1 \\leq i_q \\leq N\n\n1 \\leq l_q \\leq r_q \\leq N\n\nThere is at least one query of type 2 in each testcase.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nQ\nQuery_1\n\\vdots\nQuery_Q\n\nHere, Query_i in the 4-th through (Q+3)-th lines is one of the following:\n\n1 i_q c_q\n\n2 l_q r_q\n\nOutput\n\nFor each query of type 2, print a line containing the answer.\n\nSample Input 1\n\n7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n\nSample Output 1\n\n3\n1\n5\n\nIn the first query, cdbb contains three kinds of letters: b , c , and d, so we print 3.\n\nIn the second query, S is modified to abcdzbd.\n\nIn the third query, a contains one kind of letter: a, so we print 1.\n\nIn the fourth query, S is modified to abcazbd.\n\nIn the fifth query, S does not change and is still abcazbd.\n\nIn the sixth query, abcazbd contains five kinds of letters: a, b, c, d, and z, so we print 5.", "sample_input": "7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n"}, "reference_outputs": ["3\n1\n5\n"], "source_document_id": "p02763", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\n\nProcess Q queries of the following two types:\n\nType 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.)\n\nType 2: answer the number of different characters occurring in the substring of S between the l_q-th and r_q-th characters (inclusive).\n\nConstraints\n\nN, Q, i_q, l_q, and r_q are integers.\n\nS is a string consisting of lowercase English letters.\n\nc_q is a lowercase English letter.\n\n1 \\leq N \\leq 500000\n\n1 \\leq Q \\leq 20000\n\n|S| = N\n\n1 \\leq i_q \\leq N\n\n1 \\leq l_q \\leq r_q \\leq N\n\nThere is at least one query of type 2 in each testcase.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nQ\nQuery_1\n\\vdots\nQuery_Q\n\nHere, Query_i in the 4-th through (Q+3)-th lines is one of the following:\n\n1 i_q c_q\n\n2 l_q r_q\n\nOutput\n\nFor each query of type 2, print a line containing the answer.\n\nSample Input 1\n\n7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n\nSample Output 1\n\n3\n1\n5\n\nIn the first query, cdbb contains three kinds of letters: b , c , and d, so we print 3.\n\nIn the second query, S is modified to abcdzbd.\n\nIn the third query, a contains one kind of letter: a, so we print 1.\n\nIn the fourth query, S is modified to abcazbd.\n\nIn the fifth query, S does not change and is still abcazbd.\n\nIn the sixth query, abcazbd contains five kinds of letters: a, b, c, d, and z, so we print 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 936, "cpu_time_ms": 2104, "memory_kb": 19332}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s990927603", "group_id": "codeNet:p02763", "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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar (\n\tn int\n\tS []rune\n\tq int\n)\n\n// [1, n]\nvar bit [ALPHABET_NUM][100000 + 5]int\nvar lenS int\n\nfunc sum(i, alpha int) int {\n\ts := 0\n\n\tfor i > 0 {\n\t\ts += bit[alpha][i]\n\t\ti -= i & (-i)\n\t}\n\n\treturn s\n}\n\nfunc add(i, alpha, x int) {\n\tfor i <= lenS {\n\t\tbit[alpha][i] += x\n\t\ti += i & (-i)\n\t}\n}\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\tq = ReadInt()\n\tlenS = len(S)\n\n\tfor i := 0; i < len(S); i++ {\n\t\tr := S[i]\n\t\tc := int(r - 'a')\n\t\tadd(i+1, c, 1)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tquery := ReadInt()\n\t\tif query == 1 {\n\t\t\tidx := ReadInt()\n\t\t\tR := ReadRuneSlice()\n\t\t\tnewc := R[0]\n\t\t\tnewcint := int(newc - 'a')\n\t\t\toldc := S[idx-1]\n\t\t\toldcint := int(oldc - 'a')\n\n\t\t\tadd(idx, newcint, 1)\n\t\t\tadd(idx, oldcint, -1)\n\t\t\tS[idx-1] = newc\n\t\t} else {\n\t\t\tl, r := ReadInt2()\n\t\t\tres := 0\n\t\t\tfor alpha := 0; alpha < ALPHABET_NUM; alpha++ {\n\t\t\t\tss := sum(r, alpha) - sum(l-1, alpha)\n\t\t\t\tif ss > 0 {\n\t\t\t\t\tres++\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(res)\n\t\t}\n\t}\n}\n\n/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1583117012, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02763.html", "problem_id": "p02763", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02763/input.txt", "sample_output_relpath": "derived/input_output/data/p02763/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02763/Go/s990927603.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s990927603", "user_id": "u103600314"}, "prompt_components": {"gold_output": "3\n1\n5\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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar (\n\tn int\n\tS []rune\n\tq int\n)\n\n// [1, n]\nvar bit [ALPHABET_NUM][100000 + 5]int\nvar lenS int\n\nfunc sum(i, alpha int) int {\n\ts := 0\n\n\tfor i > 0 {\n\t\ts += bit[alpha][i]\n\t\ti -= i & (-i)\n\t}\n\n\treturn s\n}\n\nfunc add(i, alpha, x int) {\n\tfor i <= lenS {\n\t\tbit[alpha][i] += x\n\t\ti += i & (-i)\n\t}\n}\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\tq = ReadInt()\n\tlenS = len(S)\n\n\tfor i := 0; i < len(S); i++ {\n\t\tr := S[i]\n\t\tc := int(r - 'a')\n\t\tadd(i+1, c, 1)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tquery := ReadInt()\n\t\tif query == 1 {\n\t\t\tidx := ReadInt()\n\t\t\tR := ReadRuneSlice()\n\t\t\tnewc := R[0]\n\t\t\tnewcint := int(newc - 'a')\n\t\t\toldc := S[idx-1]\n\t\t\toldcint := int(oldc - 'a')\n\n\t\t\tadd(idx, newcint, 1)\n\t\t\tadd(idx, oldcint, -1)\n\t\t\tS[idx-1] = newc\n\t\t} else {\n\t\t\tl, r := ReadInt2()\n\t\t\tres := 0\n\t\t\tfor alpha := 0; alpha < ALPHABET_NUM; alpha++ {\n\t\t\t\tss := sum(r, alpha) - sum(l-1, alpha)\n\t\t\t\tif ss > 0 {\n\t\t\t\t\tres++\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(res)\n\t\t}\n\t}\n}\n\n/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\n\nProcess Q queries of the following two types:\n\nType 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.)\n\nType 2: answer the number of different characters occurring in the substring of S between the l_q-th and r_q-th characters (inclusive).\n\nConstraints\n\nN, Q, i_q, l_q, and r_q are integers.\n\nS is a string consisting of lowercase English letters.\n\nc_q is a lowercase English letter.\n\n1 \\leq N \\leq 500000\n\n1 \\leq Q \\leq 20000\n\n|S| = N\n\n1 \\leq i_q \\leq N\n\n1 \\leq l_q \\leq r_q \\leq N\n\nThere is at least one query of type 2 in each testcase.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nQ\nQuery_1\n\\vdots\nQuery_Q\n\nHere, Query_i in the 4-th through (Q+3)-th lines is one of the following:\n\n1 i_q c_q\n\n2 l_q r_q\n\nOutput\n\nFor each query of type 2, print a line containing the answer.\n\nSample Input 1\n\n7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n\nSample Output 1\n\n3\n1\n5\n\nIn the first query, cdbb contains three kinds of letters: b , c , and d, so we print 3.\n\nIn the second query, S is modified to abcdzbd.\n\nIn the third query, a contains one kind of letter: a, so we print 1.\n\nIn the fourth query, S is modified to abcazbd.\n\nIn the fifth query, S does not change and is still abcazbd.\n\nIn the sixth query, abcazbd contains five kinds of letters: a, b, c, d, and z, so we print 5.", "sample_input": "7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n"}, "reference_outputs": ["3\n1\n5\n"], "source_document_id": "p02763", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\n\nProcess Q queries of the following two types:\n\nType 1: change the i_q-th character of S to c_q. (Do nothing if the i_q-th character is already c_q.)\n\nType 2: answer the number of different characters occurring in the substring of S between the l_q-th and r_q-th characters (inclusive).\n\nConstraints\n\nN, Q, i_q, l_q, and r_q are integers.\n\nS is a string consisting of lowercase English letters.\n\nc_q is a lowercase English letter.\n\n1 \\leq N \\leq 500000\n\n1 \\leq Q \\leq 20000\n\n|S| = N\n\n1 \\leq i_q \\leq N\n\n1 \\leq l_q \\leq r_q \\leq N\n\nThere is at least one query of type 2 in each testcase.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nQ\nQuery_1\n\\vdots\nQuery_Q\n\nHere, Query_i in the 4-th through (Q+3)-th lines is one of the following:\n\n1 i_q c_q\n\n2 l_q r_q\n\nOutput\n\nFor each query of type 2, print a line containing the answer.\n\nSample Input 1\n\n7\nabcdbbd\n6\n2 3 6\n1 5 z\n2 1 1\n1 4 a\n1 7 d\n2 1 7\n\nSample Output 1\n\n3\n1\n5\n\nIn the first query, cdbb contains three kinds of letters: b , c , and d, so we print 3.\n\nIn the second query, S is modified to abcdzbd.\n\nIn the third query, a contains one kind of letter: a, so we print 1.\n\nIn the fourth query, S is modified to abcazbd.\n\nIn the fifth query, S does not change and is still abcazbd.\n\nIn the sixth query, abcazbd contains five kinds of letters: a, b, c, d, and z, so we print 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7667, "cpu_time_ms": 41, "memory_kb": 19456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s644421424", "group_id": "codeNet:p02765", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tN, R := read(), read()\n\n\tif N >= 10 {\n\t\tfmt.Println(R)\n\t\treturn\n\t} else {\n\t\tfmt.Println(R + 1000 - 100*N)\n\t}\n}\n\nfunc read() int {\n\tvar v int\n\tfmt.Scan(&v)\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1583490751, "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/s644421424.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s644421424", "user_id": "u121595121"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tN, R := read(), read()\n\n\tif N >= 10 {\n\t\tfmt.Println(R)\n\t\treturn\n\t} else {\n\t\tfmt.Println(R + 1000 - 100*N)\n\t}\n}\n\nfunc read() int {\n\tvar v int\n\tfmt.Scan(&v)\n\treturn v\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 210, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s569686183", "group_id": "codeNet:p02765", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, R int\n\tfmt.Scan(&N, &R)\n\n\tif N >= 10 {\n\t\tfmt.Println(R)\n\t} else {\n\t\tfmt.Println(R + 100*(10-N))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1582423387, "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/s569686183.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s569686183", "user_id": "u923112423"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, R int\n\tfmt.Scan(&N, &R)\n\n\tif N >= 10 {\n\t\tfmt.Println(R)\n\t} else {\n\t\tfmt.Println(R + 100*(10-N))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s270219248", "group_id": "codeNet:p02767", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tstdin.Split(bufio.ScanWords)\n\tN := nextInt()\n\tx := make([]int, N)\n\ttotal := 0\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = nextInt()\n\t\ttotal += x[i]\n\t}\n\tif N == 1 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\tsort.Ints(x)\n\n\tavg := total / N\n\tmin := 10000000\n\tfor j := (avg - x[0]) / 2; j < (avg+x[N-1])/2; j++ {\n\t\ttmp := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\ttmp += (x[i] - j) * (x[i] - j)\n\t\t}\n\t\tif tmp < min {\n\t\t\tmin = tmp\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n\nfunc nextInt() int {\n\tstdin.Scan()\n\ti, err := strconv.Atoi(stdin.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1591937525, "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/s270219248.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s270219248", "user_id": "u481009932"}, "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 stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tstdin.Split(bufio.ScanWords)\n\tN := nextInt()\n\tx := make([]int, N)\n\ttotal := 0\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = nextInt()\n\t\ttotal += x[i]\n\t}\n\tif N == 1 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\tsort.Ints(x)\n\n\tavg := total / N\n\tmin := 10000000\n\tfor j := (avg - x[0]) / 2; j < (avg+x[N-1])/2; j++ {\n\t\ttmp := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\ttmp += (x[i] - j) * (x[i] - j)\n\t\t}\n\t\tif tmp < min {\n\t\t\tmin = tmp\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n\nfunc nextInt() int {\n\tstdin.Scan()\n\ti, err := strconv.Atoi(stdin.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s416653623", "group_id": "codeNet:p02767", "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\tx := make([]int, n)\n\tfor i := range x {\n\t\tx[i] = readInt()\n\t}\n\n\tans := math.MaxInt64\n\tfor p := 1; p < 101; p++ {\n\t\tc := 0\n\t\tfor i := range x {\n\t\t\tc += (x[i] - p) * (x[i] - p)\n\t\t}\n\t\tans = min(ans, c)\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": 1586885621, "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/s416653623.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s416653623", "user_id": "u295946532"}, "prompt_components": {"gold_output": "5\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\tx := make([]int, n)\n\tfor i := range x {\n\t\tx[i] = readInt()\n\t}\n\n\tans := math.MaxInt64\n\tfor p := 1; p < 101; p++ {\n\t\tc := 0\n\t\tfor i := range x {\n\t\t\tc += (x[i] - p) * (x[i] - p)\n\t\t}\n\t\tans = min(ans, c)\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 : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2056, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s996818502", "group_id": "codeNet:p02768", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\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, a, b := readInt3()\n\n\tbase := big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil)\n\tnca := comb(n, a)\n\tncb := comb(n, b)\n\n\tresult := big.NewInt(0).Sub(\n\t\tbig.NewInt(0).Sub(\n\t\t\tbig.NewInt(0).Sub(\n\t\t\t\tbase, nca,\n\t\t\t), ncb,\n\t\t), big.NewInt(1),\n\t)\n\n\tfmt.Printf(big.NewInt(0).Mod(result, big.NewInt(1000000007)).String())\n\n\t//fmt.Printf(\"2**n-1: %s\\n\", big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil).String())\n\t//fmt.Printf(\"nCa: %s\\n\", comb(n, a).String())\n\t//fmt.Printf(\"nCb: %s\\n\", comb(n, b).String())\n}\n\n//func total(n int) int {\n//\tvar total int\n//\tfor i := 1; i <= n; i++ {\n//\t\tc := comb(n, i)\n//\t\t//fmt.Println(c)\n//\t\ttotal += c\n//\t}\n//\treturn total\n//}\n\nfunc comb(n, c int) *big.Int {\n\tupper := big.NewInt(0).MulRange(1, int64(n))\n\n\tll := big.NewInt(0).MulRange(1, int64(c))\n\n\tlr := big.NewInt(0).MulRange(1, int64(n-c))\n\n\tlower := big.NewInt(0).Mul(ll, lr)\n\tresult := big.NewInt(0).Div(upper, lower)\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1582406524, "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/s996818502.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s996818502", "user_id": "u502098699"}, "prompt_components": {"gold_output": "7\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)\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, a, b := readInt3()\n\n\tbase := big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil)\n\tnca := comb(n, a)\n\tncb := comb(n, b)\n\n\tresult := big.NewInt(0).Sub(\n\t\tbig.NewInt(0).Sub(\n\t\t\tbig.NewInt(0).Sub(\n\t\t\t\tbase, nca,\n\t\t\t), ncb,\n\t\t), big.NewInt(1),\n\t)\n\n\tfmt.Printf(big.NewInt(0).Mod(result, big.NewInt(1000000007)).String())\n\n\t//fmt.Printf(\"2**n-1: %s\\n\", big.NewInt(0).Exp(big.NewInt(2), big.NewInt(int64(n)), nil).String())\n\t//fmt.Printf(\"nCa: %s\\n\", comb(n, a).String())\n\t//fmt.Printf(\"nCb: %s\\n\", comb(n, b).String())\n}\n\n//func total(n int) int {\n//\tvar total int\n//\tfor i := 1; i <= n; i++ {\n//\t\tc := comb(n, i)\n//\t\t//fmt.Println(c)\n//\t\ttotal += c\n//\t}\n//\treturn total\n//}\n\nfunc comb(n, c int) *big.Int {\n\tupper := big.NewInt(0).MulRange(1, int64(n))\n\n\tll := big.NewInt(0).MulRange(1, int64(c))\n\n\tlr := big.NewInt(0).MulRange(1, int64(n-c))\n\n\tlower := big.NewInt(0).Mul(ll, lr)\n\tresult := big.NewInt(0).Div(upper, lower)\n\treturn result\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2163, "cpu_time_ms": 2113, "memory_kb": 83668}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s877082579", "group_id": "codeNet:p02772", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tresult := \"APPROVED\"\n\tfor i:=0; ib { 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\ta := scanInts(n)\n\n\tf := true\n\tfor i := 0; i < n; i++ {\n\t\tif a[i]%2 == 0 {\n\t\t\tif !(a[i]%3 == 0 || a[i]%5 == 0) {\n\t\t\t\tf = false\n\t\t\t}\n\t\t}\n\t}\n\n\tif f {\n\t\tfmt.Println(\"APPROVED\")\n\t} else {\n\t\tfmt.Println(\"DENIED\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581883593, "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/s845313062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s845313062", "user_id": "u548992197"}, "prompt_components": {"gold_output": "APPROVED\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 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\ta := scanInts(n)\n\n\tf := true\n\tfor i := 0; i < n; i++ {\n\t\tif a[i]%2 == 0 {\n\t\t\tif !(a[i]%3 == 0 || a[i]%5 == 0) {\n\t\t\t\tf = false\n\t\t\t}\n\t\t}\n\t}\n\n\tif f {\n\t\tfmt.Println(\"APPROVED\")\n\t} else {\n\t\tfmt.Println(\"DENIED\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s561909890", "group_id": "codeNet:p02773", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tvar N, input = mrLine(1)\n\tvar check = make(map[string]int)\n\tvar checkb = make([][]string, N[0])\n\n\tfor i := 0; i < N[0]; i++ {\n\t\tcheck[input[i][0]]++\n\t}\n\n\tvar max int\n\n\tfor name, i := range check {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t\tcheckb[max-1] = []string{name}\n\t\t} else if i == max {\n\t\t\tcheckb[max-1] = append(checkb[max-1], name)\n\t\t}\n\t}\n\n\tqsSort(checkb[max-1])\n\n\tfor _, name := range checkb[max-1] {\n\t\tfmt.Printf(\"%s\\n\", name)\n\t}\n\n\treturn\n}\n\n//round returns rounded integer number\nfunc round(x float64) int {\n\tif x < float64(int(x))+0.5 {\n\t\treturn int(x)\n\t}\n\treturn int(x) + 1\n}\n\n//minf returns min{a, b}(a, b: float64)\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//mini returns min{a, b} (a, b: int)\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//minf returns max{a, b}(a, b: float64)\nfunc maxf(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//maxi returns max{a, b} (a, b: int)\nfunc maxi(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//pawf paw returns f^num(f:float64)\nfunc pawf(f float64, num int) float64 {\n\tvar result float64 = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//pawi paw returns f^num(f:int)\nfunc pawi(f int, num int) int {\n\tvar result int = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//rLine Read all 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(conByte(buf)), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\n//irLine Read Standard input data and convert into integer\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//mtrLine Read multi-line standard input data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mrLine(line int) (first []int, other [][]string) {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar Input []string\n\tvar stringInput [][]string\n\n\t{\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\tInput = strings.Split(strings.TrimSpace((conByte(buf))), \" \")\n\t\t\tbuf = []byte{}\n\t\t}\n\t}\n\n\tfirst = itoas(Input)\n\n\tfor i := 0; i < first[line-1]; {\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((conByte(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn first, stringInput\n}\n\n//mirLine Read multi-line standard input data and convert into integer data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mirLine(line int) (first []int, other [][]int) {\n\tvar f, o = mrLine(line)\n\treturn f, alitoas(o)\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\n//itoas converts string slice to integer slice\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\n//alitoas converts string 2 dimention slice to intger one\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\n//medi3 return median of 3 intger values\nfunc medi3(x, y, z int) int {\n\tswitch {\n\tcase x < y:\n\t\tswitch {\n\t\tcase x > z:\n\t\t\treturn x\n\t\tcase z > y:\n\t\t\treturn y\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\tdefault:\n\t\tswitch {\n\t\tcase z < y:\n\t\t\treturn y\n\t\tcase x < z:\n\t\t\treturn x\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\t}\n}\n\n//meds3 return median of 3 stringer values\nfunc meds3(x, y, z string) string {\n\tswitch {\n\tcase x < y:\n\t\tswitch {\n\t\tcase x > z:\n\t\t\treturn x\n\t\tcase z > y:\n\t\t\treturn y\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\tdefault:\n\t\tswitch {\n\t\tcase z < y:\n\t\t\treturn y\n\t\tcase x < z:\n\t\t\treturn x\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\t}\n}\n\n//iQuicksort sort integer slice by quick sort\nfunc iQuicksort(a []int, left, right int) {\n\tif left < right {\n\t\tvar i, j, tmp int = left, right, 0\n\t\tvar pivot int = medi3(a[i], a[i+(j-i)/2], a[j])\n\n\t\tfor {\n\t\t\tfor ; a[i] < pivot; i++ {\n\t\t\t}\n\t\t\tfor ; pivot < a[j]; j-- {\n\t\t\t}\n\t\t\tif i >= j {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp = a[i]\n\t\t\ta[i] = a[j]\n\t\t\ta[j] = tmp /* a[i], a[j] を交換 */\n\t\t\ti++\n\t\t\tj--\n\t\t}\n\t\tiQuicksort(a, left, i-1) /* 分割した左を再帰的にソート */\n\t\tiQuicksort(a, j+1, right) /* 分割した右を再帰的にソート */\n\t}\n}\n\n//qiSort sort integer slie by quick sort\nfunc qiSort(a []int) {\n\tiQuicksort(a, 0, len(a)-1)\n}\n\n//qiSort sort stringer slie by quick sort\nfunc qsSort(a []string) {\n\tsQuicksort(a, 0, len(a)-1)\n}\n\n//iQuicksort sort integer slice by quick sort\nfunc sQuicksort(a []string, left, right int) {\n\tif left < right {\n\t\tvar i, j int = left, right\n\t\tvar tmp string\n\t\tvar pivot string = meds3(a[i], a[i+(j-i)/2], a[j])\n\n\t\tfor {\n\t\t\tfor ; a[i] < pivot; i++ {\n\t\t\t}\n\t\t\tfor ; pivot < a[j]; j-- {\n\t\t\t}\n\t\t\tif i >= j {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp = a[i]\n\t\t\ta[i] = a[j]\n\t\t\ta[j] = tmp /* a[i], a[j] を交換 */\n\t\t\ti++\n\t\t\tj--\n\t\t}\n\t\tsQuicksort(a, left, i-1) /* 分割した左を再帰的にソート */\n\t\tsQuicksort(a, j+1, right) /* 分割した右を再帰的にソート */\n\t}\n}\n\nfunc conStr(s *string) []byte {\n\treturn *(*[]byte)(unsafe.Pointer(s))\n}\n\nfunc conByte(b []byte) string {\n\treturn *(*string)(unsafe.Pointer(&b))\n}\n", "language": "Go", "metadata": {"date": 1586973297, "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/s561909890.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s561909890", "user_id": "u051492823"}, "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\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\tvar N, input = mrLine(1)\n\tvar check = make(map[string]int)\n\tvar checkb = make([][]string, N[0])\n\n\tfor i := 0; i < N[0]; i++ {\n\t\tcheck[input[i][0]]++\n\t}\n\n\tvar max int\n\n\tfor name, i := range check {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t\tcheckb[max-1] = []string{name}\n\t\t} else if i == max {\n\t\t\tcheckb[max-1] = append(checkb[max-1], name)\n\t\t}\n\t}\n\n\tqsSort(checkb[max-1])\n\n\tfor _, name := range checkb[max-1] {\n\t\tfmt.Printf(\"%s\\n\", name)\n\t}\n\n\treturn\n}\n\n//round returns rounded integer number\nfunc round(x float64) int {\n\tif x < float64(int(x))+0.5 {\n\t\treturn int(x)\n\t}\n\treturn int(x) + 1\n}\n\n//minf returns min{a, b}(a, b: float64)\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//mini returns min{a, b} (a, b: int)\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//minf returns max{a, b}(a, b: float64)\nfunc maxf(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//maxi returns max{a, b} (a, b: int)\nfunc maxi(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//pawf paw returns f^num(f:float64)\nfunc pawf(f float64, num int) float64 {\n\tvar result float64 = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//pawi paw returns f^num(f:int)\nfunc pawi(f int, num int) int {\n\tvar result int = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//rLine Read all 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(conByte(buf)), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\n//irLine Read Standard input data and convert into integer\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//mtrLine Read multi-line standard input data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mrLine(line int) (first []int, other [][]string) {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar Input []string\n\tvar stringInput [][]string\n\n\t{\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\tInput = strings.Split(strings.TrimSpace((conByte(buf))), \" \")\n\t\t\tbuf = []byte{}\n\t\t}\n\t}\n\n\tfirst = itoas(Input)\n\n\tfor i := 0; i < first[line-1]; {\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((conByte(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn first, stringInput\n}\n\n//mirLine Read multi-line standard input data and convert into integer data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mirLine(line int) (first []int, other [][]int) {\n\tvar f, o = mrLine(line)\n\treturn f, alitoas(o)\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\n//itoas converts string slice to integer slice\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\n//alitoas converts string 2 dimention slice to intger one\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\n//medi3 return median of 3 intger values\nfunc medi3(x, y, z int) int {\n\tswitch {\n\tcase x < y:\n\t\tswitch {\n\t\tcase x > z:\n\t\t\treturn x\n\t\tcase z > y:\n\t\t\treturn y\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\tdefault:\n\t\tswitch {\n\t\tcase z < y:\n\t\t\treturn y\n\t\tcase x < z:\n\t\t\treturn x\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\t}\n}\n\n//meds3 return median of 3 stringer values\nfunc meds3(x, y, z string) string {\n\tswitch {\n\tcase x < y:\n\t\tswitch {\n\t\tcase x > z:\n\t\t\treturn x\n\t\tcase z > y:\n\t\t\treturn y\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\tdefault:\n\t\tswitch {\n\t\tcase z < y:\n\t\t\treturn y\n\t\tcase x < z:\n\t\t\treturn x\n\t\tdefault:\n\t\t\treturn z\n\t\t}\n\t}\n}\n\n//iQuicksort sort integer slice by quick sort\nfunc iQuicksort(a []int, left, right int) {\n\tif left < right {\n\t\tvar i, j, tmp int = left, right, 0\n\t\tvar pivot int = medi3(a[i], a[i+(j-i)/2], a[j])\n\n\t\tfor {\n\t\t\tfor ; a[i] < pivot; i++ {\n\t\t\t}\n\t\t\tfor ; pivot < a[j]; j-- {\n\t\t\t}\n\t\t\tif i >= j {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp = a[i]\n\t\t\ta[i] = a[j]\n\t\t\ta[j] = tmp /* a[i], a[j] を交換 */\n\t\t\ti++\n\t\t\tj--\n\t\t}\n\t\tiQuicksort(a, left, i-1) /* 分割した左を再帰的にソート */\n\t\tiQuicksort(a, j+1, right) /* 分割した右を再帰的にソート */\n\t}\n}\n\n//qiSort sort integer slie by quick sort\nfunc qiSort(a []int) {\n\tiQuicksort(a, 0, len(a)-1)\n}\n\n//qiSort sort stringer slie by quick sort\nfunc qsSort(a []string) {\n\tsQuicksort(a, 0, len(a)-1)\n}\n\n//iQuicksort sort integer slice by quick sort\nfunc sQuicksort(a []string, left, right int) {\n\tif left < right {\n\t\tvar i, j int = left, right\n\t\tvar tmp string\n\t\tvar pivot string = meds3(a[i], a[i+(j-i)/2], a[j])\n\n\t\tfor {\n\t\t\tfor ; a[i] < pivot; i++ {\n\t\t\t}\n\t\t\tfor ; pivot < a[j]; j-- {\n\t\t\t}\n\t\t\tif i >= j {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttmp = a[i]\n\t\t\ta[i] = a[j]\n\t\t\ta[j] = tmp /* a[i], a[j] を交換 */\n\t\t\ti++\n\t\t\tj--\n\t\t}\n\t\tsQuicksort(a, left, i-1) /* 分割した左を再帰的にソート */\n\t\tsQuicksort(a, j+1, right) /* 分割した右を再帰的にソート */\n\t}\n}\n\nfunc conStr(s *string) []byte {\n\treturn *(*[]byte)(unsafe.Pointer(s))\n}\n\nfunc conByte(b []byte) string {\n\treturn *(*string)(unsafe.Pointer(&b))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5867, "cpu_time_ms": 937, "memory_kb": 46336}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s435042423", "group_id": "codeNet:p02773", "input_text": "package main\n\nimport \"fmt\"\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\tvar n int\n\tfmt.Scan(&n)\n\n\ttexts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&texts[i])\n\t}\n\n\tvar num int\n\tans := make([]string, 0)\n\tmaps := make(map[string]int, n)\n\t// mapで同じものをカウント\n\tfor i := 0; i < n; i++ {\n\t\tmaps[texts[i]]++\n\t\tnum = max(maps[texts[i]], num)\n\t}\n\n\t// value(数値)とmaxのカウント数が同じなのであれば、ansに追加\n\tfor key, value := range maps {\n\t\tif value == num {\n\t\t\tans = append(ans, key)\n\t\t}\n\t}\n\n\tfor _, text := range ans {\n\t\tfmt.Println(text)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1582012607, "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/s435042423.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s435042423", "user_id": "u572998669"}, "prompt_components": {"gold_output": "beet\nvet\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\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\tvar n int\n\tfmt.Scan(&n)\n\n\ttexts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&texts[i])\n\t}\n\n\tvar num int\n\tans := make([]string, 0)\n\tmaps := make(map[string]int, n)\n\t// mapで同じものをカウント\n\tfor i := 0; i < n; i++ {\n\t\tmaps[texts[i]]++\n\t\tnum = max(maps[texts[i]], num)\n\t}\n\n\t// value(数値)とmaxのカウント数が同じなのであれば、ansに追加\n\tfor key, value := range maps {\n\t\tif value == num {\n\t\t\tans = append(ans, key)\n\t\t}\n\t}\n\n\tfor _, text := range ans {\n\t\tfmt.Println(text)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 627, "cpu_time_ms": 1607, "memory_kb": 30336}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s050066593", "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)\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\ts := make([]string, N)\n\tm := make(map[string]int)\n\tmax := 0\n\tfor i := 0; i < N; i++ {\n\t\ts[i] = getString()\n\t\tm[s[i]]++\n\t\tif max < m[s[i]] {\n\t\t\tmax = m[s[i]]\n\t\t}\n\t}\n\tsel := make([]string, 0)\n\tfor i, v := range m {\n\t\tif v == max {\n\t\t\tsel = append(sel, i)\n\t\t}\n\t}\n\n\tsort.Strings(sel)\n\tfor _, v := range sel {\n\t\tfmt.Println(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581884117, "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/s050066593.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s050066593", "user_id": "u814575783"}, "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)\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\ts := make([]string, N)\n\tm := make(map[string]int)\n\tmax := 0\n\tfor i := 0; i < N; i++ {\n\t\ts[i] = getString()\n\t\tm[s[i]]++\n\t\tif max < m[s[i]] {\n\t\t\tmax = m[s[i]]\n\t\t}\n\t}\n\tsel := make([]string, 0)\n\tfor i, v := range m {\n\t\tif v == max {\n\t\t\tsel = append(sel, i)\n\t\t}\n\t}\n\n\tsort.Strings(sel)\n\tfor _, v := range sel {\n\t\tfmt.Println(v)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 704, "cpu_time_ms": 718, "memory_kb": 33040}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s773376177", "group_id": "codeNet:p02775", "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}\n\nfunc Solve() {\n N := NextLine()\n n := len(N)\n ans := 0\n c, d := 0, 0\n for i := n - 1; 0 <= i; i-- {\n C := int(N[i]) - int('0') + c\n if C < 5 {\n ans += C - d\n c = 0\n d = 0\n } else if C == 5 {\n ans += C\n c = 1\n d++\n } else {\n ans += 10 - C\n c = 1\n d = 0\n }\n }\n Write(ans + c - d)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581916144, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02775.html", "problem_id": "p02775", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02775/input.txt", "sample_output_relpath": "derived/input_output/data/p02775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02775/Go/s773376177.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s773376177", "user_id": "u415905784"}, "prompt_components": {"gold_output": "8\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}\n\nfunc Solve() {\n N := NextLine()\n n := len(N)\n ans := 0\n c, d := 0, 0\n for i := n - 1; 0 <= i; i-- {\n C := int(N[i]) - int('0') + c\n if C < 5 {\n ans += C - d\n c = 0\n d = 0\n } else if C == 5 {\n ans += C\n c = 1\n d++\n } else {\n ans += 10 - C\n c = 1\n d = 0\n }\n }\n Write(ans + c - d)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "sample_input": "36\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02775", "source_text": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1866, "cpu_time_ms": 9, "memory_kb": 3712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s760932943", "group_id": "codeNet:p02775", "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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進��\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar (\n\tN []rune\n)\n\nfunc main() {\n\tN = ReadRuneSlice()\n\n\tans := 0\n\tfor _, d := range N {\n\t\tif d-'0' <= 5 {\n\t\t\tans += int(d - '0')\n\t\t} else {\n\t\t\tans += (10 - int(d-'0'))\n\t\t}\n\t}\n\n\tNN := []rune{'1'}\n\tNN = append(NN, N...)\n\tansans := 0\n\tfor _, d := range NN {\n\t\tif d-'0' <= 5 {\n\t\t\tansans += int(d - '0')\n\t\t} else {\n\t\t\tansans += (10 - int(d-'0'))\n\t\t}\n\t}\n\n\tfmt.Println(Max(ans, ansans))\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// 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/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1581889201, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02775.html", "problem_id": "p02775", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02775/input.txt", "sample_output_relpath": "derived/input_output/data/p02775/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02775/Go/s760932943.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s760932943", "user_id": "u103600314"}, "prompt_components": {"gold_output": "8\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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar (\n\tN []rune\n)\n\nfunc main() {\n\tN = ReadRuneSlice()\n\n\tans := 0\n\tfor _, d := range N {\n\t\tif d-'0' <= 5 {\n\t\t\tans += int(d - '0')\n\t\t} else {\n\t\t\tans += (10 - int(d-'0'))\n\t\t}\n\t}\n\n\tNN := []rune{'1'}\n\tNN = append(NN, N...)\n\tansans := 0\n\tfor _, d := range NN {\n\t\tif d-'0' <= 5 {\n\t\t\tansans += int(d - '0')\n\t\t} else {\n\t\t\tansans += (10 - int(d-'0'))\n\t\t}\n\t}\n\n\tfmt.Println(Max(ans, ansans))\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// 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/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "sample_input": "36\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02775", "source_text": "Score: 500 points\n\nProblem Statement\n\nIn the Kingdom of AtCoder, only banknotes are used as currency. There are 10^{100}+1 kinds of banknotes, with the values of 1, 10, 10^2, 10^3, \\dots, 10^{(10^{100})}. You have come shopping at a mall and are now buying a takoyaki machine with a value of N. (Takoyaki is the name of a Japanese snack.)\n\nTo make the payment, you will choose some amount of money which is at least N and give it to the clerk. Then, the clerk gives you back the change, which is the amount of money you give minus N.\n\nWhat will be the minimum possible number of total banknotes used by you and the clerk, when both choose the combination of banknotes to minimize this count?\n\nAssume that you have sufficient numbers of banknotes, and so does the clerk.\n\nConstraints\n\nN is an integer between 1 and 10^{1,000,000} (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum possible number of total banknotes used by you and the clerk.\n\nSample Input 1\n\n36\n\nSample Output 1\n\n8\n\nIf you give four banknotes of value 10 each, and the clerk gives you back four banknotes of value 1 each, a total of eight banknotes are used.\n\nThe payment cannot be made with less than eight banknotes in total, so the answer is 8.\n\nSample Input 2\n\n91\n\nSample Output 2\n\n3\n\nIf you give two banknotes of value 100, 1, and the clerk gives you back one banknote of value 10, a total of three banknotes are used.\n\nSample Input 3\n\n314159265358979323846264338327950288419716939937551058209749445923078164062862089986280348253421170\n\nSample Output 3\n\n243", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8012, "cpu_time_ms": 61, "memory_kb": 11776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178592868", "group_id": "codeNet:p02777", "input_text": "// ProblemURL: https://atcoder.jp/contests/abc154/tasks/abc154_a\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) int {\n\tvar x int\n\tif a > b {\n\t\tx = a\n\t} else {\n\t\tx = b\n\t}\n\tif c > x {\n\t\tx = c\n\t}\n\treturn x\n}\nfunc smallest(a, b, c int) int {\n\tvar x int\n\tif a < b {\n\t\tx = a\n\t} else {\n\t\tx = b\n\t}\n\tif c < x {\n\t\tx = c\n\t}\n\treturn x\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 intsMul(a []int) int {\n\tres := 1\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 { s := intsCopy(a); sort.Ints(s); return s }\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(first, size int) []int {\n\tas := make([]int, size)\n\tfor i := range as {\n\t\tas[i] = first + 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 floatDiv(x, y int) float64 { return float64(x) / float64(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 bytesAdd(bytes *[]byte, x byte) { *bytes = append(*bytes, x) }\nfunc bytesJoin(a, b []byte) []byte { return append(a, b...) }\nfunc bytesCopy(a []byte) []byte { return append([]byte(nil), a...) }\n\ntype sortBytes []byte\n\nfunc (s sortBytes) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s sortBytes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortBytes) Len() int { return len(s) }\nfunc bytesSortAsc(s []byte) { sort.Sort(sortBytes(s)) }\nfunc bytesSortDesc(s []byte) { sort.Sort(sort.Reverse(sortBytes(s))) }\nfunc bytesCopySortAsc(s []byte) []byte { t := bytesCopy(s); bytesSortAsc(t); return t }\nfunc bytesCopySortDesc(s []byte) []byte { t := bytesCopy(s); bytesSortDesc(t); return t }\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 strRepeat(str string, count int) string {\n\treturn strings.Repeat(str, count)\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 runesAdd(runes *[]rune, x rune) { *runes = append(*runes, x) }\nfunc runesJoin(a, b []rune) []rune { return append(a, b...) }\nfunc runesCopy(a []rune) []rune { return append([]rune(nil), a...) }\n\ntype sortRunes []rune\n\nfunc (s sortRunes) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s sortRunes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortRunes) Len() int { return len(s) }\nfunc runesSortAsc(s []rune) { sort.Sort(sortRunes(s)) }\nfunc runesSortDesc(s []rune) { sort.Sort(sort.Reverse(sortRunes(s))) }\nfunc runesCopySortAsc(s []rune) []rune { t := runesCopy(s); runesSortAsc(t); return t }\nfunc runesCopySortDesc(s []rune) []rune { t := runesCopy(s); runesSortDesc(t); return t }\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\nconst (\n\tscbufsz = 3e6 + 10\n\tbwbufsz = 1e6\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwbufsz)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, scbufsz), scbufsz)\n}\n\nfunc ri() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tg := false\n\tx := 0\n\tif b[0] == 45 {\n\t\tg = true\n\t\tx++\n\t}\n\tn := 0\n\tfor i := x; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - 48)\n\t}\n\tif g {\n\t\tn = -n\n\t}\n\treturn n\n}\n\nfunc ri64() int64 {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tg := false\n\tx := 0\n\tif b[0] == 45 {\n\t\tg = true\n\t\tx++\n\t}\n\tn := int64(0)\n\tfor i := x; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int64(b[i] - 48)\n\t}\n\tif g {\n\t\tn = -n\n\t}\n\treturn n\n}\n\nfunc ru() uint {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tn := uint(0)\n\tfor i := 0; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint(b[i] - 48)\n\t}\n\treturn n\n}\n\nfunc ru64() uint64 {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tn := uint64(0)\n\tfor i := 0; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint64(b[i] - 48)\n\t}\n\treturn n\n}\n\nfunc rf() 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}\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}\n\nfunc rbs() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\n\nfunc rrs() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\n\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\n\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\n\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\n\nfunc riis(n int) ([]int, []int) {\n\ts := make([]int, n)\n\tt := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri()\n\t\tt[i] = ri()\n\t}\n\treturn s, t\n}\n\nfunc ru64s(n int) []uint64 {\n\ts := make([]uint64, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ru64()\n\t}\n\treturn s\n}\n\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\n\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc pF64(x float64) { pf(\"%.10f\\n\", x) }\n\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\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}\n\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc dbgMatrix(a []interface{}) {\n\tfor i := 0; i < len(a); i++ {\n\t\tdbg(a[i])\n\t}\n}\n\nfunc flush() {\n\tif err := bw.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\n\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\n\nfunc main() {\n\tsolve()\n\tflush()\n}\n\nconst (\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tzero = 0\n\ti32Inf = 1 << 30\n\ti64Inf = 1 << 60\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\ntype IntPair struct{ Fi, Se int }\ntype SortIntPairByFiSe []IntPair\n\nfunc (p SortIntPairByFiSe) Len() int { return len(p) }\nfunc (p SortIntPairByFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p SortIntPairByFiSe) 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\nfunc solve() {\n\ts := rs()\n\tt := rs()\n\ta := ri()\n\tb := ri()\n\tu := rs()\n\t_ = t\n\tif u == s {\n\t\ta--\n\t} else {\n\t\tb--\n\t}\n\tpln(a, b)\n}\n", "language": "Go", "metadata": {"date": 1583192902, "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/s178592868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s178592868", "user_id": "u554269352"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "// ProblemURL: https://atcoder.jp/contests/abc154/tasks/abc154_a\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) int {\n\tvar x int\n\tif a > b {\n\t\tx = a\n\t} else {\n\t\tx = b\n\t}\n\tif c > x {\n\t\tx = c\n\t}\n\treturn x\n}\nfunc smallest(a, b, c int) int {\n\tvar x int\n\tif a < b {\n\t\tx = a\n\t} else {\n\t\tx = b\n\t}\n\tif c < x {\n\t\tx = c\n\t}\n\treturn x\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 intsMul(a []int) int {\n\tres := 1\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 { s := intsCopy(a); sort.Ints(s); return s }\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(first, size int) []int {\n\tas := make([]int, size)\n\tfor i := range as {\n\t\tas[i] = first + 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 floatDiv(x, y int) float64 { return float64(x) / float64(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 bytesAdd(bytes *[]byte, x byte) { *bytes = append(*bytes, x) }\nfunc bytesJoin(a, b []byte) []byte { return append(a, b...) }\nfunc bytesCopy(a []byte) []byte { return append([]byte(nil), a...) }\n\ntype sortBytes []byte\n\nfunc (s sortBytes) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s sortBytes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortBytes) Len() int { return len(s) }\nfunc bytesSortAsc(s []byte) { sort.Sort(sortBytes(s)) }\nfunc bytesSortDesc(s []byte) { sort.Sort(sort.Reverse(sortBytes(s))) }\nfunc bytesCopySortAsc(s []byte) []byte { t := bytesCopy(s); bytesSortAsc(t); return t }\nfunc bytesCopySortDesc(s []byte) []byte { t := bytesCopy(s); bytesSortDesc(t); return t }\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 strRepeat(str string, count int) string {\n\treturn strings.Repeat(str, count)\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 runesAdd(runes *[]rune, x rune) { *runes = append(*runes, x) }\nfunc runesJoin(a, b []rune) []rune { return append(a, b...) }\nfunc runesCopy(a []rune) []rune { return append([]rune(nil), a...) }\n\ntype sortRunes []rune\n\nfunc (s sortRunes) Less(i, j int) bool { return s[i] < s[j] }\nfunc (s sortRunes) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortRunes) Len() int { return len(s) }\nfunc runesSortAsc(s []rune) { sort.Sort(sortRunes(s)) }\nfunc runesSortDesc(s []rune) { sort.Sort(sort.Reverse(sortRunes(s))) }\nfunc runesCopySortAsc(s []rune) []rune { t := runesCopy(s); runesSortAsc(t); return t }\nfunc runesCopySortDesc(s []rune) []rune { t := runesCopy(s); runesSortDesc(t); return t }\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\nconst (\n\tscbufsz = 3e6 + 10\n\tbwbufsz = 1e6\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwbufsz)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, scbufsz), scbufsz)\n}\n\nfunc ri() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tg := false\n\tx := 0\n\tif b[0] == 45 {\n\t\tg = true\n\t\tx++\n\t}\n\tn := 0\n\tfor i := x; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - 48)\n\t}\n\tif g {\n\t\tn = -n\n\t}\n\treturn n\n}\n\nfunc ri64() int64 {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tg := false\n\tx := 0\n\tif b[0] == 45 {\n\t\tg = true\n\t\tx++\n\t}\n\tn := int64(0)\n\tfor i := x; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int64(b[i] - 48)\n\t}\n\tif g {\n\t\tn = -n\n\t}\n\treturn n\n}\n\nfunc ru() uint {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tn := uint(0)\n\tfor i := 0; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint(b[i] - 48)\n\t}\n\treturn n\n}\n\nfunc ru64() uint64 {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan\")\n\t}\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tn := uint64(0)\n\tfor i := 0; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint64(b[i] - 48)\n\t}\n\treturn n\n}\n\nfunc rf() 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}\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}\n\nfunc rbs() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\n\nfunc rrs() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\n\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\n\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\n\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\n\nfunc riis(n int) ([]int, []int) {\n\ts := make([]int, n)\n\tt := make([]int, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ri()\n\t\tt[i] = ri()\n\t}\n\treturn s, t\n}\n\nfunc ru64s(n int) []uint64 {\n\ts := make([]uint64, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = ru64()\n\t}\n\treturn s\n}\n\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\n\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc pF64(x float64) { pf(\"%.10f\\n\", x) }\n\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\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}\n\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc dbgMatrix(a []interface{}) {\n\tfor i := 0; i < len(a); i++ {\n\t\tdbg(a[i])\n\t}\n}\n\nfunc flush() {\n\tif err := bw.Flush(); err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\n\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\n\nfunc main() {\n\tsolve()\n\tflush()\n}\n\nconst (\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tzero = 0\n\ti32Inf = 1 << 30\n\ti64Inf = 1 << 60\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\ntype IntPair struct{ Fi, Se int }\ntype SortIntPairByFiSe []IntPair\n\nfunc (p SortIntPairByFiSe) Len() int { return len(p) }\nfunc (p SortIntPairByFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p SortIntPairByFiSe) 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\nfunc solve() {\n\ts := rs()\n\tt := rs()\n\ta := ri()\n\tb := ri()\n\tu := rs()\n\t_ = t\n\tif u == s {\n\t\ta--\n\t} else {\n\t\tb--\n\t}\n\tpln(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 14221, "cpu_time_ms": 11, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s030530895", "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 a == 0 && b == 0 {\n\t\tfmt.Println(a, b)\n\t\treturn\n\t}\n\n\tif u == \"red\" {\n\t\ta = a - 1\n\t} else {\n\t\tb = b - 1\n\t}\n\n\tfmt.Println(a, b)\n}\n", "language": "Go", "metadata": {"date": 1581278999, "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/s030530895.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s030530895", "user_id": "u572998669"}, "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 a == 0 && b == 0 {\n\t\tfmt.Println(a, b)\n\t\treturn\n\t}\n\n\tif u == \"red\" {\n\t\ta = a - 1\n\t} else {\n\t\tb = b - 1\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s212370865", "group_id": "codeNet:p02777", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts, t, u string\n\t\ta, b int\n\t)\n\tfmt.Scan(&s, &t, &a, &b, &u)\n\n\tm := make(map[string]int)\n\tm[s] = a\n\tm[t] = b\n\tif u == s {\n\t\tm[s]--\n\t} else {\n\t\tm[t]--\n\t}\n\tfmt.Println(m[s], m[t])\n}\n", "language": "Go", "metadata": {"date": 1581278581, "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/s212370865.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s212370865", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts, t, u string\n\t\ta, b int\n\t)\n\tfmt.Scan(&s, &t, &a, &b, &u)\n\n\tm := make(map[string]int)\n\tm[s] = a\n\tm[t] = b\n\tif u == s {\n\t\tm[s]--\n\t} else {\n\t\tm[t]--\n\t}\n\tfmt.Println(m[s], m[t])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s468029905", "group_id": "codeNet:p02778", "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\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\ts := next()\n\tx := \"\"\n\n\tfor i := 0; i < len(s); i++ {\n\t\tx += \"x\"\n\t}\n\tfmt.Println(x)\n}", "language": "Go", "metadata": {"date": 1581890085, "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/s468029905.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s468029905", "user_id": "u703739962"}, "prompt_components": {"gold_output": "xxxxxxx\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\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\ts := next()\n\tx := \"\"\n\n\tfor i := 0; i < len(s); i++ {\n\t\tx += \"x\"\n\t}\n\tfmt.Println(x)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 549, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s296999515", "group_id": "codeNet:p02778", "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 = 2\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\ts := getNextString(scanner)\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprint(writer, \"x\")\n\t}\n\tfmt.Fprintln(writer, \"\")\n}\n", "language": "Go", "metadata": {"date": 1581278639, "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/s296999515.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s296999515", "user_id": "u150542210"}, "prompt_components": {"gold_output": "xxxxxxx\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 = 2\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\ts := getNextString(scanner)\n\tn := len(s)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fprint(writer, \"x\")\n\t}\n\tfmt.Fprintln(writer, \"\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s856076294", "group_id": "codeNet:p02779", "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\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tn := scanInt()\n\tm := make(map[int]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := scanInt()\n\t\t_, ok := m[a]\n\t\tif ok {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\tm[a] = true\n\t}\n\n\tfmt.Println(\"YES\")\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\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\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", "language": "Go", "metadata": {"date": 1586289960, "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/s856076294.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s856076294", "user_id": "u550884590"}, "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\"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\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tn := scanInt()\n\tm := make(map[int]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := scanInt()\n\t\t_, ok := m[a]\n\t\tif ok {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\tm[a] = true\n\t}\n\n\tfmt.Println(\"YES\")\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\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1488, "cpu_time_ms": 77, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s099294828", "group_id": "codeNet:p02779", "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\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tcount := 0\n\tprev := -1\n\tfor _, v := range A {\n\t\tif prev != v {\n\t\t\tcount++\n\t\t}\n\t\tprev = v\n\t}\n\tif N == count {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581279114, "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/s099294828.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s099294828", "user_id": "u529632089"}, "prompt_components": {"gold_output": "YES\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\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tcount := 0\n\tprev := -1\n\tfor _, v := range A {\n\t\tif prev != v {\n\t\t\tcount++\n\t\t}\n\t\tprev = v\n\t}\n\tif N == count {\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\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 322, "cpu_time_ms": 1389, "memory_kb": 5632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s351991307", "group_id": "codeNet:p02780", "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 init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc psum(nums ...int) int {\n\tvar sum int = 0\n\tfor _, num := range nums {\n\t\tsum += num\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = readInt()\n\t}\n\tvar sum, max int = -1, -1\n\tvar exp float64\n\tfor i := 0; i <= n-k; i++ {\n\t\tsum = psum(p[i : i+k]...)\n\t\tif sum > max {\n\t\t\tmax = sum\n\t\t\texp = float64(sum+k) / 2\n\t\t}\n\t}\n\tfmt.Println(exp)\n}\n", "language": "Go", "metadata": {"date": 1581284173, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/Go/s351991307.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s351991307", "user_id": "u363118893"}, "prompt_components": {"gold_output": "7.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)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc psum(nums ...int) int {\n\tvar sum int = 0\n\tfor _, num := range nums {\n\t\tsum += num\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tn, k := readInt(), readInt()\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = readInt()\n\t}\n\tvar sum, max int = -1, -1\n\tvar exp float64\n\tfor i := 0; i <= n-k; i++ {\n\t\tsum = psum(p[i : i+k]...)\n\t\tif sum > max {\n\t\t\tmax = sum\n\t\t\texp = float64(sum+k) / 2\n\t\t}\n\t}\n\tfmt.Println(exp)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 762, "cpu_time_ms": 2107, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s806505658", "group_id": "codeNet:p02780", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc foo(p []int, n, k int) float64 {\n i := 0\n past := 0\n for j := 0; j < k; j++ {\n past += p[j]\n }\n maxsum := past\n for l := 1; l < n-k+1; l++ {\n le := p[l+k-1] - p[l-1]\n if le <= 0 {\n continue\n }\n past = past + le\n if past > maxsum {\n maxsum = past\n i = l\n }\n }\n\n result := 0.0\n for j := 0; j < k; j++ {\n newe := float64((p[i+j]*(p[i+j]+1)))/float64((2*p[i+j]))\n result += newe\n }\n return result\n}\n\n\nvar sc = bufio.NewScanner(os.Stdin)\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 nextText() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc main() {\n // input\n sc.Split(bufio.ScanWords)\n n := nextInt()\n k := nextInt()\n\n // store to slice\n var p []int\n for i := 0; i < n; i++ {\n p = append(p, nextInt())\n }\n\n // output\n fmt.Printf(\"%f\\n\", foo(p, n, k))\n\n}\n", "language": "Go", "metadata": {"date": 1581283559, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/Go/s806505658.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s806505658", "user_id": "u835488697"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc foo(p []int, n, k int) float64 {\n i := 0\n past := 0\n for j := 0; j < k; j++ {\n past += p[j]\n }\n maxsum := past\n for l := 1; l < n-k+1; l++ {\n le := p[l+k-1] - p[l-1]\n if le <= 0 {\n continue\n }\n past = past + le\n if past > maxsum {\n maxsum = past\n i = l\n }\n }\n\n result := 0.0\n for j := 0; j < k; j++ {\n newe := float64((p[i+j]*(p[i+j]+1)))/float64((2*p[i+j]))\n result += newe\n }\n return result\n}\n\n\nvar sc = bufio.NewScanner(os.Stdin)\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 nextText() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc main() {\n // input\n sc.Split(bufio.ScanWords)\n n := nextInt()\n k := nextInt()\n\n // store to slice\n var p []int\n for i := 0; i < n; i++ {\n p = append(p, nextInt())\n }\n\n // output\n fmt.Printf(\"%f\\n\", foo(p, n, k))\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 978, "cpu_time_ms": 40, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s663587131", "group_id": "codeNet:p02783", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar h, a int\n\tfmt.Scan(&h, &a)\n\tfmt.Println((h + a - 1) / a)\n}\n", "language": "Go", "metadata": {"date": 1599859378, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s663587131.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s663587131", "user_id": "u367908963"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar h, a int\n\tfmt.Scan(&h, &a)\n\tfmt.Println((h + a - 1) / a)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 111, "cpu_time_ms": 3, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s636277251", "group_id": "codeNet:p02783", "input_text": "package main\n\nimport (\n \"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tscanner *bufio.Scanner\n\tbyWord bool //flag for tokenization\n\teof bool //flag of end-of-file\n\tsplitter string //delimiter for Ints(), etc.\n)\n\nfunc main(){\n h,a:=Ints2()\n fmt.Println((h+a-1)/a)\n}\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(scanWordsOrLines)\n\teof = false\n\tsplitter = \" \"\n}\n\nfunc scanWordsOrLines(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif byWord {\n\t\treturn bufio.ScanWords(data, atEOF)\n\t} else {\n\t\treturn bufio.ScanLines(data, atEOF)\n\t}\n}\n\nfunc text(byword bool) string {\n\tbyWord = byword\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\teof = true\n\treturn \"\"\n}\n\n//basics\nfunc EOF() bool {\n\treturn eof\n}\n\nfunc Word() string {\n\treturn text(true)\n}\n\nfunc Words() []string {\n\treturn strings.Split(Line(), splitter)\n}\n\nfunc Line() string {\n\treturn text(false)\n}\n\nfunc Lines() []string {\n\tvar ret []string\n\tfor {\n\t\tl := Line()\n\t\tif EOF() {\n\t\t\tbreak\n\t\t}\n\t\tret = append(ret, l)\n\t}\n\treturn ret\n}\n\nfunc Byte()byte{\n\treturn byte(Uint8())\n}\n\n//auto-generated code\nfunc Int() int {\n\tret, _ := strconv.ParseInt(Word(),10,0)\n\treturn int(ret)\n}\n\nfunc Ints() []int {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,0)\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc Ints2() (int, int) {\n\treturn Int(), Int()\n}\n\nfunc Ints3() (int, int, int) {\n\treturn Int(), Int(), Int()\n}\n\nfunc Ints4() (int, int, int, int) {\n\treturn Int(), Int(), Int(), Int()\n}\n\nfunc Ints5() (int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints6() (int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints7() (int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints8() (int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints9() (int, int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc IntsN(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int()\n\t}\n\treturn ret\n}\n\nfunc Int8() int8 {\n\tret, _ := strconv.ParseInt(Word(),10,8)\n\treturn int8(ret)\n}\n\nfunc Int8s() []int8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,8)\n\t\tret[i] = int8(v)\n\t}\n\treturn ret\n}\n\nfunc Int8s2() (int8, int8) {\n\treturn Int8(), Int8()\n}\n\nfunc Int8s3() (int8, int8, int8) {\n\treturn Int8(), Int8(), Int8()\n}\n\nfunc Int8s4() (int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s5() (int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s6() (int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s7() (int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s8() (int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s9() (int8, int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8sN(n int) []int8 {\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int8()\n\t}\n\treturn ret\n}\n\nfunc Int16() int16 {\n\tret, _ := strconv.ParseInt(Word(),10,16)\n\treturn int16(ret)\n}\n\nfunc Int16s() []int16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,16)\n\t\tret[i] = int16(v)\n\t}\n\treturn ret\n}\n\nfunc Int16s2() (int16, int16) {\n\treturn Int16(), Int16()\n}\n\nfunc Int16s3() (int16, int16, int16) {\n\treturn Int16(), Int16(), Int16()\n}\n\nfunc Int16s4() (int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s5() (int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s6() (int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s7() (int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s8() (int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s9() (int16, int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16sN(n int) []int16 {\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int16()\n\t}\n\treturn ret\n}\n\nfunc Int32() int32 {\n\tret, _ := strconv.ParseInt(Word(),10,32)\n\treturn int32(ret)\n}\n\nfunc Int32s() []int32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,32)\n\t\tret[i] = int32(v)\n\t}\n\treturn ret\n}\n\nfunc Int32s2() (int32, int32) {\n\treturn Int32(), Int32()\n}\n\nfunc Int32s3() (int32, int32, int32) {\n\treturn Int32(), Int32(), Int32()\n}\n\nfunc Int32s4() (int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s5() (int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s6() (int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s7() (int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s8() (int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s9() (int32, int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32sN(n int) []int32 {\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int32()\n\t}\n\treturn ret\n}\n\nfunc Int64() int64 {\n\tret, _ := strconv.ParseInt(Word(),10,64)\n\treturn int64(ret)\n}\n\nfunc Int64s() []int64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,64)\n\t\tret[i] = int64(v)\n\t}\n\treturn ret\n}\n\nfunc Int64s2() (int64, int64) {\n\treturn Int64(), Int64()\n}\n\nfunc Int64s3() (int64, int64, int64) {\n\treturn Int64(), Int64(), Int64()\n}\n\nfunc Int64s4() (int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s5() (int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s6() (int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s7() (int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s8() (int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s9() (int64, int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64sN(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int64()\n\t}\n\treturn ret\n}\n\nfunc Uint() uint {\n\tret, _ := strconv.ParseUint(Word(),10,0)\n\treturn uint(ret)\n}\n\nfunc Uints() []uint {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,0)\n\t\tret[i] = uint(v)\n\t}\n\treturn ret\n}\n\nfunc Uints2() (uint, uint) {\n\treturn Uint(), Uint()\n}\n\nfunc Uints3() (uint, uint, uint) {\n\treturn Uint(), Uint(), Uint()\n}\n\nfunc Uints4() (uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints5() (uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints6() (uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints7() (uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints8() (uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints9() (uint, uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc UintsN(n int) []uint {\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint()\n\t}\n\treturn ret\n}\n\nfunc Uint8() uint8 {\n\tret, _ := strconv.ParseUint(Word(),10,8)\n\treturn uint8(ret)\n}\n\nfunc Uint8s() []uint8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,8)\n\t\tret[i] = uint8(v)\n\t}\n\treturn ret\n}\n\nfunc Uint8s2() (uint8, uint8) {\n\treturn Uint8(), Uint8()\n}\n\nfunc Uint8s3() (uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s4() (uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s5() (uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s6() (uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s7() (uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s8() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s9() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8sN(n int) []uint8 {\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint8()\n\t}\n\treturn ret\n}\n\nfunc Uint16() uint16 {\n\tret, _ := strconv.ParseUint(Word(),10,16)\n\treturn uint16(ret)\n}\n\nfunc Uint16s() []uint16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,16)\n\t\tret[i] = uint16(v)\n\t}\n\treturn ret\n}\n\nfunc Uint16s2() (uint16, uint16) {\n\treturn Uint16(), Uint16()\n}\n\nfunc Uint16s3() (uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s4() (uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s5() (uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s6() (uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s7() (uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s8() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s9() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16sN(n int) []uint16 {\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint16()\n\t}\n\treturn ret\n}\n\nfunc Uint32() uint32 {\n\tret, _ := strconv.ParseUint(Word(),10,32)\n\treturn uint32(ret)\n}\n\nfunc Uint32s() []uint32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,32)\n\t\tret[i] = uint32(v)\n\t}\n\treturn ret\n}\n\nfunc Uint32s2() (uint32, uint32) {\n\treturn Uint32(), Uint32()\n}\n\nfunc Uint32s3() (uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s4() (uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s5() (uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s6() (uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s7() (uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s8() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s9() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32sN(n int) []uint32 {\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint32()\n\t}\n\treturn ret\n}\n\nfunc Uint64() uint64 {\n\tret, _ := strconv.ParseUint(Word(),10,64)\n\treturn uint64(ret)\n}\n\nfunc Uint64s() []uint64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,64)\n\t\tret[i] = uint64(v)\n\t}\n\treturn ret\n}\n\nfunc Uint64s2() (uint64, uint64) {\n\treturn Uint64(), Uint64()\n}\n\nfunc Uint64s3() (uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s4() (uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s5() (uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s6() (uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s7() (uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s8() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s9() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64sN(n int) []uint64 {\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint64()\n\t}\n\treturn ret\n}\n\nfunc Float32() float32 {\n\tret, _ := strconv.ParseFloat(Word(), 32)\n\treturn float32(ret)\n}\n\nfunc Float32s() []float32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 32)\n\t\tret[i] = float32(v)\n\t}\n\treturn ret\n}\n\nfunc Float32s2() (float32, float32) {\n\treturn Float32(), Float32()\n}\n\nfunc Float32s3() (float32, float32, float32) {\n\treturn Float32(), Float32(), Float32()\n}\n\nfunc Float32s4() (float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s5() (float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s6() (float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s7() (float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s8() (float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s9() (float32, float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32sN(n int) []float32 {\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float32()\n\t}\n\treturn ret\n}\n\nfunc Float64() float64 {\n\tret, _ := strconv.ParseFloat(Word(), 64)\n\treturn float64(ret)\n}\n\nfunc Float64s() []float64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 64)\n\t\tret[i] = float64(v)\n\t}\n\treturn ret\n}\n\nfunc Float64s2() (float64, float64) {\n\treturn Float64(), Float64()\n}\n\nfunc Float64s3() (float64, float64, float64) {\n\treturn Float64(), Float64(), Float64()\n}\n\nfunc Float64s4() (float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s5() (float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s6() (float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s7() (float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s8() (float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s9() (float64, float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64sN(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float64()\n\t}\n\treturn ret\n}\n\nfunc Words2() (string, string) {\n\treturn Word(), Word()\n}\n\nfunc Words3() (string, string, string) {\n\treturn Word(), Word(), Word()\n}\n\nfunc Words4() (string, string, string, string) {\n\treturn Word(), Word(), Word(), Word()\n}\n\nfunc Words5() (string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words6() (string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words7() (string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words8() (string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words9() (string, string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc WordsN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Word()\n\t}\n\treturn ret\n}\n\nfunc Lines2() (string, string) {\n\treturn Line(), Line()\n}\n\nfunc Lines3() (string, string, string) {\n\treturn Line(), Line(), Line()\n}\n\nfunc Lines4() (string, string, string, string) {\n\treturn Line(), Line(), Line(), Line()\n}\n\nfunc Lines5() (string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines6() (string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines7() (string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines8() (string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines9() (string, string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc LinesN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Line()\n\t}\n\treturn ret\n}\n\nfunc Bytes2() (byte, byte) {\n\treturn Byte(), Byte()\n}\n\nfunc Bytes3() (byte, byte, byte) {\n\treturn Byte(), Byte(), Byte()\n}\n\nfunc Bytes4() (byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes5() (byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes6() (byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes7() (byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes8() (byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes9() (byte, byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc BytesN(n int) []byte {\n\tret := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Byte()\n\t}\n\treturn ret\n}", "language": "Go", "metadata": {"date": 1580564939, "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/s636277251.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s636277251", "user_id": "u726630158"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tscanner *bufio.Scanner\n\tbyWord bool //flag for tokenization\n\teof bool //flag of end-of-file\n\tsplitter string //delimiter for Ints(), etc.\n)\n\nfunc main(){\n h,a:=Ints2()\n fmt.Println((h+a-1)/a)\n}\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(scanWordsOrLines)\n\teof = false\n\tsplitter = \" \"\n}\n\nfunc scanWordsOrLines(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif byWord {\n\t\treturn bufio.ScanWords(data, atEOF)\n\t} else {\n\t\treturn bufio.ScanLines(data, atEOF)\n\t}\n}\n\nfunc text(byword bool) string {\n\tbyWord = byword\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\teof = true\n\treturn \"\"\n}\n\n//basics\nfunc EOF() bool {\n\treturn eof\n}\n\nfunc Word() string {\n\treturn text(true)\n}\n\nfunc Words() []string {\n\treturn strings.Split(Line(), splitter)\n}\n\nfunc Line() string {\n\treturn text(false)\n}\n\nfunc Lines() []string {\n\tvar ret []string\n\tfor {\n\t\tl := Line()\n\t\tif EOF() {\n\t\t\tbreak\n\t\t}\n\t\tret = append(ret, l)\n\t}\n\treturn ret\n}\n\nfunc Byte()byte{\n\treturn byte(Uint8())\n}\n\n//auto-generated code\nfunc Int() int {\n\tret, _ := strconv.ParseInt(Word(),10,0)\n\treturn int(ret)\n}\n\nfunc Ints() []int {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,0)\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc Ints2() (int, int) {\n\treturn Int(), Int()\n}\n\nfunc Ints3() (int, int, int) {\n\treturn Int(), Int(), Int()\n}\n\nfunc Ints4() (int, int, int, int) {\n\treturn Int(), Int(), Int(), Int()\n}\n\nfunc Ints5() (int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints6() (int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints7() (int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints8() (int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints9() (int, int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc IntsN(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int()\n\t}\n\treturn ret\n}\n\nfunc Int8() int8 {\n\tret, _ := strconv.ParseInt(Word(),10,8)\n\treturn int8(ret)\n}\n\nfunc Int8s() []int8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,8)\n\t\tret[i] = int8(v)\n\t}\n\treturn ret\n}\n\nfunc Int8s2() (int8, int8) {\n\treturn Int8(), Int8()\n}\n\nfunc Int8s3() (int8, int8, int8) {\n\treturn Int8(), Int8(), Int8()\n}\n\nfunc Int8s4() (int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s5() (int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s6() (int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s7() (int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s8() (int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s9() (int8, int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8sN(n int) []int8 {\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int8()\n\t}\n\treturn ret\n}\n\nfunc Int16() int16 {\n\tret, _ := strconv.ParseInt(Word(),10,16)\n\treturn int16(ret)\n}\n\nfunc Int16s() []int16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,16)\n\t\tret[i] = int16(v)\n\t}\n\treturn ret\n}\n\nfunc Int16s2() (int16, int16) {\n\treturn Int16(), Int16()\n}\n\nfunc Int16s3() (int16, int16, int16) {\n\treturn Int16(), Int16(), Int16()\n}\n\nfunc Int16s4() (int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s5() (int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s6() (int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s7() (int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s8() (int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s9() (int16, int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16sN(n int) []int16 {\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int16()\n\t}\n\treturn ret\n}\n\nfunc Int32() int32 {\n\tret, _ := strconv.ParseInt(Word(),10,32)\n\treturn int32(ret)\n}\n\nfunc Int32s() []int32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,32)\n\t\tret[i] = int32(v)\n\t}\n\treturn ret\n}\n\nfunc Int32s2() (int32, int32) {\n\treturn Int32(), Int32()\n}\n\nfunc Int32s3() (int32, int32, int32) {\n\treturn Int32(), Int32(), Int32()\n}\n\nfunc Int32s4() (int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s5() (int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s6() (int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s7() (int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s8() (int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s9() (int32, int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32sN(n int) []int32 {\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int32()\n\t}\n\treturn ret\n}\n\nfunc Int64() int64 {\n\tret, _ := strconv.ParseInt(Word(),10,64)\n\treturn int64(ret)\n}\n\nfunc Int64s() []int64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i],10,64)\n\t\tret[i] = int64(v)\n\t}\n\treturn ret\n}\n\nfunc Int64s2() (int64, int64) {\n\treturn Int64(), Int64()\n}\n\nfunc Int64s3() (int64, int64, int64) {\n\treturn Int64(), Int64(), Int64()\n}\n\nfunc Int64s4() (int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s5() (int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s6() (int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s7() (int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s8() (int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s9() (int64, int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64sN(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int64()\n\t}\n\treturn ret\n}\n\nfunc Uint() uint {\n\tret, _ := strconv.ParseUint(Word(),10,0)\n\treturn uint(ret)\n}\n\nfunc Uints() []uint {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,0)\n\t\tret[i] = uint(v)\n\t}\n\treturn ret\n}\n\nfunc Uints2() (uint, uint) {\n\treturn Uint(), Uint()\n}\n\nfunc Uints3() (uint, uint, uint) {\n\treturn Uint(), Uint(), Uint()\n}\n\nfunc Uints4() (uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints5() (uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints6() (uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints7() (uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints8() (uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints9() (uint, uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc UintsN(n int) []uint {\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint()\n\t}\n\treturn ret\n}\n\nfunc Uint8() uint8 {\n\tret, _ := strconv.ParseUint(Word(),10,8)\n\treturn uint8(ret)\n}\n\nfunc Uint8s() []uint8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,8)\n\t\tret[i] = uint8(v)\n\t}\n\treturn ret\n}\n\nfunc Uint8s2() (uint8, uint8) {\n\treturn Uint8(), Uint8()\n}\n\nfunc Uint8s3() (uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s4() (uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s5() (uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s6() (uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s7() (uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s8() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s9() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8sN(n int) []uint8 {\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint8()\n\t}\n\treturn ret\n}\n\nfunc Uint16() uint16 {\n\tret, _ := strconv.ParseUint(Word(),10,16)\n\treturn uint16(ret)\n}\n\nfunc Uint16s() []uint16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,16)\n\t\tret[i] = uint16(v)\n\t}\n\treturn ret\n}\n\nfunc Uint16s2() (uint16, uint16) {\n\treturn Uint16(), Uint16()\n}\n\nfunc Uint16s3() (uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s4() (uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s5() (uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s6() (uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s7() (uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s8() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s9() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16sN(n int) []uint16 {\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint16()\n\t}\n\treturn ret\n}\n\nfunc Uint32() uint32 {\n\tret, _ := strconv.ParseUint(Word(),10,32)\n\treturn uint32(ret)\n}\n\nfunc Uint32s() []uint32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,32)\n\t\tret[i] = uint32(v)\n\t}\n\treturn ret\n}\n\nfunc Uint32s2() (uint32, uint32) {\n\treturn Uint32(), Uint32()\n}\n\nfunc Uint32s3() (uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s4() (uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s5() (uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s6() (uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s7() (uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s8() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s9() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32sN(n int) []uint32 {\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint32()\n\t}\n\treturn ret\n}\n\nfunc Uint64() uint64 {\n\tret, _ := strconv.ParseUint(Word(),10,64)\n\treturn uint64(ret)\n}\n\nfunc Uint64s() []uint64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i],10,64)\n\t\tret[i] = uint64(v)\n\t}\n\treturn ret\n}\n\nfunc Uint64s2() (uint64, uint64) {\n\treturn Uint64(), Uint64()\n}\n\nfunc Uint64s3() (uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s4() (uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s5() (uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s6() (uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s7() (uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s8() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s9() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64sN(n int) []uint64 {\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint64()\n\t}\n\treturn ret\n}\n\nfunc Float32() float32 {\n\tret, _ := strconv.ParseFloat(Word(), 32)\n\treturn float32(ret)\n}\n\nfunc Float32s() []float32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 32)\n\t\tret[i] = float32(v)\n\t}\n\treturn ret\n}\n\nfunc Float32s2() (float32, float32) {\n\treturn Float32(), Float32()\n}\n\nfunc Float32s3() (float32, float32, float32) {\n\treturn Float32(), Float32(), Float32()\n}\n\nfunc Float32s4() (float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s5() (float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s6() (float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s7() (float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s8() (float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s9() (float32, float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32sN(n int) []float32 {\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float32()\n\t}\n\treturn ret\n}\n\nfunc Float64() float64 {\n\tret, _ := strconv.ParseFloat(Word(), 64)\n\treturn float64(ret)\n}\n\nfunc Float64s() []float64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 64)\n\t\tret[i] = float64(v)\n\t}\n\treturn ret\n}\n\nfunc Float64s2() (float64, float64) {\n\treturn Float64(), Float64()\n}\n\nfunc Float64s3() (float64, float64, float64) {\n\treturn Float64(), Float64(), Float64()\n}\n\nfunc Float64s4() (float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s5() (float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s6() (float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s7() (float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s8() (float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s9() (float64, float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64sN(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float64()\n\t}\n\treturn ret\n}\n\nfunc Words2() (string, string) {\n\treturn Word(), Word()\n}\n\nfunc Words3() (string, string, string) {\n\treturn Word(), Word(), Word()\n}\n\nfunc Words4() (string, string, string, string) {\n\treturn Word(), Word(), Word(), Word()\n}\n\nfunc Words5() (string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words6() (string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words7() (string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words8() (string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words9() (string, string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc WordsN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Word()\n\t}\n\treturn ret\n}\n\nfunc Lines2() (string, string) {\n\treturn Line(), Line()\n}\n\nfunc Lines3() (string, string, string) {\n\treturn Line(), Line(), Line()\n}\n\nfunc Lines4() (string, string, string, string) {\n\treturn Line(), Line(), Line(), Line()\n}\n\nfunc Lines5() (string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines6() (string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines7() (string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines8() (string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines9() (string, string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc LinesN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Line()\n\t}\n\treturn ret\n}\n\nfunc Bytes2() (byte, byte) {\n\treturn Byte(), Byte()\n}\n\nfunc Bytes3() (byte, byte, byte) {\n\treturn Byte(), Byte(), Byte()\n}\n\nfunc Bytes4() (byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes5() (byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes6() (byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes7() (byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes8() (byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes9() (byte, byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc BytesN(n int) []byte {\n\tret := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Byte()\n\t}\n\treturn ret\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20319, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s686100382", "group_id": "codeNet:p02784", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\th, n := readInt(), readInt()\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += readInt()\n\t}\n\tif sum >= h {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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": 1580800578, "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/s686100382.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s686100382", "user_id": "u295946532"}, "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\nfunc main() {\n\th, n := readInt(), readInt()\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += readInt()\n\t}\n\tif sum >= h {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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 : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1930, "cpu_time_ms": 19, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s314176668", "group_id": "codeNet:p02784", "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\tH, _ := sc.NextInt(), sc.NextInt()\n\tA := sc.NextIntArray()\n\tsum := 0\n\tfor _, v := range A {\n\t\tsum += v\n\t}\n\tif sum >= H {\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) 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": 1580068954, "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/s314176668.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s314176668", "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\tH, _ := sc.NextInt(), sc.NextInt()\n\tA := sc.NextIntArray()\n\tsum := 0\n\tfor _, v := range A {\n\t\tsum += v\n\t}\n\tif sum >= H {\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) 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 : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2194, "cpu_time_ms": 17, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s281819486", "group_id": "codeNet:p02785", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\th := make([]int, n)\n\tfor i := range h {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tsort.Ints(h)\n\n\td := n - k\n\tif d < 1 {\n\t\td = 0\n\t}\n\tans := 0\n\tfor _, i := range h[:d] {\n\t\tans += i\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590793910, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/Go/s281819486.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s281819486", "user_id": "u475329018"}, "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, k int\n\tfmt.Scan(&n, &k)\n\th := make([]int, n)\n\tfor i := range h {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tsort.Ints(h)\n\n\td := n - k\n\tif d < 1 {\n\t\td = 0\n\t}\n\tans := 0\n\tfor _, i := range h[:d] {\n\t\tans += i\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 271, "cpu_time_ms": 1393, "memory_kb": 6912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s582088885", "group_id": "codeNet:p02785", "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 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 main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tk := scanInt()\n\n\tif n < k {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = scanInt()\n\t}\n\n\tsort.Ints(h)\n\n\ts := 0\n\tfor i := 0; i < n-k; i++ {\n\t\ts += h[i]\n\t}\n\n\tfmt.Println(s)\n}\n", "language": "Go", "metadata": {"date": 1582439963, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/Go/s582088885.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s582088885", "user_id": "u605983940"}, "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 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 main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tk := scanInt()\n\n\tif n < k {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = scanInt()\n\t}\n\n\tsort.Ints(h)\n\n\ts := 0\n\tfor i := 0; i < n-k; i++ {\n\t\ts += h[i]\n\t}\n\n\tfmt.Println(s)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 515, "cpu_time_ms": 97, "memory_kb": 5120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s764581951", "group_id": "codeNet:p02785", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\tvar h []int\n\th = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\th[i] = x\n\t}\n\n\tsort.Ints(h)\n\tfor i := n - 1; i > n-1-k && i >= 0; i-- {\n\t\th[i] = 0\n\t}\n\n\tvar sum int64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += int64(h[i])\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1580069774, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/Go/s764581951.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764581951", "user_id": "u545672909"}, "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, k int\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\tvar h []int\n\th = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\th[i] = x\n\t}\n\n\tsort.Ints(h)\n\tfor i := n - 1; i > n-1-k && i >= 0; i-- {\n\t\th[i] = 0\n\t}\n\n\tvar sum int64 = 0\n\tfor i := 0; i < n; i++ {\n\t\tsum += int64(h[i])\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 360, "cpu_time_ms": 1404, "memory_kb": 5632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s712066059", "group_id": "codeNet:p02786", "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\tscanner *bufio.Scanner\n\tbyWord bool //flag for tokenization\n\teof bool //flag of end-of-file\n\tsplitter string //delimiter for Ints(), etc.\n)\n\nfunc rec(n int) int {\n\tif n == 1 {\n\t\treturn 1\n\t}\n\treturn 1 + 2*rec(n/2)\n}\n\nfunc main() {\n\th := Int()\n\tfmt.Println(rec(h))\n}\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(scanWordsOrLines)\n\teof = false\n\tsplitter = \" \"\n}\n\nfunc scanWordsOrLines(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif byWord {\n\t\treturn bufio.ScanWords(data, atEOF)\n\t} else {\n\t\treturn bufio.ScanLines(data, atEOF)\n\t}\n}\n\nfunc text(byword bool) string {\n\tbyWord = byword\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\teof = true\n\treturn \"\"\n}\n\n//basics\nfunc EOF() bool {\n\treturn eof\n}\n\nfunc Word() string {\n\treturn text(true)\n}\n\nfunc Words() []string {\n\treturn strings.Split(Line(), splitter)\n}\n\nfunc Line() string {\n\treturn text(false)\n}\n\nfunc Lines() []string {\n\tvar ret []string\n\tfor {\n\t\tl := Line()\n\t\tif EOF() {\n\t\t\tbreak\n\t\t}\n\t\tret = append(ret, l)\n\t}\n\treturn ret\n}\n\nfunc Byte() byte {\n\treturn byte(Uint8())\n}\n\n//auto-generated code\nfunc Int() int {\n\tret, _ := strconv.ParseInt(Word(), 10, 0)\n\treturn int(ret)\n}\n\nfunc Ints() []int {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 0)\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc Ints2() (int, int) {\n\treturn Int(), Int()\n}\n\nfunc Ints3() (int, int, int) {\n\treturn Int(), Int(), Int()\n}\n\nfunc Ints4() (int, int, int, int) {\n\treturn Int(), Int(), Int(), Int()\n}\n\nfunc Ints5() (int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints6() (int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints7() (int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints8() (int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints9() (int, int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc IntsN(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int()\n\t}\n\treturn ret\n}\n\nfunc Int8() int8 {\n\tret, _ := strconv.ParseInt(Word(), 10, 8)\n\treturn int8(ret)\n}\n\nfunc Int8s() []int8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 8)\n\t\tret[i] = int8(v)\n\t}\n\treturn ret\n}\n\nfunc Int8s2() (int8, int8) {\n\treturn Int8(), Int8()\n}\n\nfunc Int8s3() (int8, int8, int8) {\n\treturn Int8(), Int8(), Int8()\n}\n\nfunc Int8s4() (int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s5() (int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s6() (int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s7() (int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s8() (int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s9() (int8, int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8sN(n int) []int8 {\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int8()\n\t}\n\treturn ret\n}\n\nfunc Int16() int16 {\n\tret, _ := strconv.ParseInt(Word(), 10, 16)\n\treturn int16(ret)\n}\n\nfunc Int16s() []int16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 16)\n\t\tret[i] = int16(v)\n\t}\n\treturn ret\n}\n\nfunc Int16s2() (int16, int16) {\n\treturn Int16(), Int16()\n}\n\nfunc Int16s3() (int16, int16, int16) {\n\treturn Int16(), Int16(), Int16()\n}\n\nfunc Int16s4() (int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s5() (int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s6() (int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s7() (int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s8() (int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s9() (int16, int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16sN(n int) []int16 {\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int16()\n\t}\n\treturn ret\n}\n\nfunc Int32() int32 {\n\tret, _ := strconv.ParseInt(Word(), 10, 32)\n\treturn int32(ret)\n}\n\nfunc Int32s() []int32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 32)\n\t\tret[i] = int32(v)\n\t}\n\treturn ret\n}\n\nfunc Int32s2() (int32, int32) {\n\treturn Int32(), Int32()\n}\n\nfunc Int32s3() (int32, int32, int32) {\n\treturn Int32(), Int32(), Int32()\n}\n\nfunc Int32s4() (int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s5() (int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s6() (int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s7() (int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s8() (int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s9() (int32, int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32sN(n int) []int32 {\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int32()\n\t}\n\treturn ret\n}\n\nfunc Int64() int64 {\n\tret, _ := strconv.ParseInt(Word(), 10, 64)\n\treturn int64(ret)\n}\n\nfunc Int64s() []int64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 64)\n\t\tret[i] = int64(v)\n\t}\n\treturn ret\n}\n\nfunc Int64s2() (int64, int64) {\n\treturn Int64(), Int64()\n}\n\nfunc Int64s3() (int64, int64, int64) {\n\treturn Int64(), Int64(), Int64()\n}\n\nfunc Int64s4() (int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s5() (int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s6() (int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s7() (int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s8() (int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s9() (int64, int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64sN(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int64()\n\t}\n\treturn ret\n}\n\nfunc Uint() uint {\n\tret, _ := strconv.ParseUint(Word(), 10, 0)\n\treturn uint(ret)\n}\n\nfunc Uints() []uint {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 0)\n\t\tret[i] = uint(v)\n\t}\n\treturn ret\n}\n\nfunc Uints2() (uint, uint) {\n\treturn Uint(), Uint()\n}\n\nfunc Uints3() (uint, uint, uint) {\n\treturn Uint(), Uint(), Uint()\n}\n\nfunc Uints4() (uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints5() (uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints6() (uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints7() (uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints8() (uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints9() (uint, uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc UintsN(n int) []uint {\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint()\n\t}\n\treturn ret\n}\n\nfunc Uint8() uint8 {\n\tret, _ := strconv.ParseUint(Word(), 10, 8)\n\treturn uint8(ret)\n}\n\nfunc Uint8s() []uint8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 8)\n\t\tret[i] = uint8(v)\n\t}\n\treturn ret\n}\n\nfunc Uint8s2() (uint8, uint8) {\n\treturn Uint8(), Uint8()\n}\n\nfunc Uint8s3() (uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s4() (uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s5() (uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s6() (uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s7() (uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s8() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s9() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8sN(n int) []uint8 {\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint8()\n\t}\n\treturn ret\n}\n\nfunc Uint16() uint16 {\n\tret, _ := strconv.ParseUint(Word(), 10, 16)\n\treturn uint16(ret)\n}\n\nfunc Uint16s() []uint16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 16)\n\t\tret[i] = uint16(v)\n\t}\n\treturn ret\n}\n\nfunc Uint16s2() (uint16, uint16) {\n\treturn Uint16(), Uint16()\n}\n\nfunc Uint16s3() (uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s4() (uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s5() (uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s6() (uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s7() (uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s8() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s9() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16sN(n int) []uint16 {\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint16()\n\t}\n\treturn ret\n}\n\nfunc Uint32() uint32 {\n\tret, _ := strconv.ParseUint(Word(), 10, 32)\n\treturn uint32(ret)\n}\n\nfunc Uint32s() []uint32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 32)\n\t\tret[i] = uint32(v)\n\t}\n\treturn ret\n}\n\nfunc Uint32s2() (uint32, uint32) {\n\treturn Uint32(), Uint32()\n}\n\nfunc Uint32s3() (uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s4() (uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s5() (uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s6() (uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s7() (uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s8() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s9() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32sN(n int) []uint32 {\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint32()\n\t}\n\treturn ret\n}\n\nfunc Uint64() uint64 {\n\tret, _ := strconv.ParseUint(Word(), 10, 64)\n\treturn uint64(ret)\n}\n\nfunc Uint64s() []uint64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 64)\n\t\tret[i] = uint64(v)\n\t}\n\treturn ret\n}\n\nfunc Uint64s2() (uint64, uint64) {\n\treturn Uint64(), Uint64()\n}\n\nfunc Uint64s3() (uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s4() (uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s5() (uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s6() (uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s7() (uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s8() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s9() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64sN(n int) []uint64 {\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint64()\n\t}\n\treturn ret\n}\n\nfunc Float32() float32 {\n\tret, _ := strconv.ParseFloat(Word(), 32)\n\treturn float32(ret)\n}\n\nfunc Float32s() []float32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 32)\n\t\tret[i] = float32(v)\n\t}\n\treturn ret\n}\n\nfunc Float32s2() (float32, float32) {\n\treturn Float32(), Float32()\n}\n\nfunc Float32s3() (float32, float32, float32) {\n\treturn Float32(), Float32(), Float32()\n}\n\nfunc Float32s4() (float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s5() (float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s6() (float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s7() (float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s8() (float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s9() (float32, float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32sN(n int) []float32 {\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float32()\n\t}\n\treturn ret\n}\n\nfunc Float64() float64 {\n\tret, _ := strconv.ParseFloat(Word(), 64)\n\treturn float64(ret)\n}\n\nfunc Float64s() []float64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 64)\n\t\tret[i] = float64(v)\n\t}\n\treturn ret\n}\n\nfunc Float64s2() (float64, float64) {\n\treturn Float64(), Float64()\n}\n\nfunc Float64s3() (float64, float64, float64) {\n\treturn Float64(), Float64(), Float64()\n}\n\nfunc Float64s4() (float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s5() (float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s6() (float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s7() (float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s8() (float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s9() (float64, float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64sN(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float64()\n\t}\n\treturn ret\n}\n\nfunc Words2() (string, string) {\n\treturn Word(), Word()\n}\n\nfunc Words3() (string, string, string) {\n\treturn Word(), Word(), Word()\n}\n\nfunc Words4() (string, string, string, string) {\n\treturn Word(), Word(), Word(), Word()\n}\n\nfunc Words5() (string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words6() (string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words7() (string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words8() (string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words9() (string, string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc WordsN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Word()\n\t}\n\treturn ret\n}\n\nfunc Lines2() (string, string) {\n\treturn Line(), Line()\n}\n\nfunc Lines3() (string, string, string) {\n\treturn Line(), Line(), Line()\n}\n\nfunc Lines4() (string, string, string, string) {\n\treturn Line(), Line(), Line(), Line()\n}\n\nfunc Lines5() (string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines6() (string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines7() (string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines8() (string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines9() (string, string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc LinesN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Line()\n\t}\n\treturn ret\n}\n\nfunc Bytes2() (byte, byte) {\n\treturn Byte(), Byte()\n}\n\nfunc Bytes3() (byte, byte, byte) {\n\treturn Byte(), Byte(), Byte()\n}\n\nfunc Bytes4() (byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes5() (byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes6() (byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes7() (byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes8() (byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes9() (byte, byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc BytesN(n int) []byte {\n\tret := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Byte()\n\t}\n\treturn ret\n}", "language": "Go", "metadata": {"date": 1580570084, "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/s712066059.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712066059", "user_id": "u726630158"}, "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\nvar (\n\tscanner *bufio.Scanner\n\tbyWord bool //flag for tokenization\n\teof bool //flag of end-of-file\n\tsplitter string //delimiter for Ints(), etc.\n)\n\nfunc rec(n int) int {\n\tif n == 1 {\n\t\treturn 1\n\t}\n\treturn 1 + 2*rec(n/2)\n}\n\nfunc main() {\n\th := Int()\n\tfmt.Println(rec(h))\n}\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(scanWordsOrLines)\n\teof = false\n\tsplitter = \" \"\n}\n\nfunc scanWordsOrLines(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tif byWord {\n\t\treturn bufio.ScanWords(data, atEOF)\n\t} else {\n\t\treturn bufio.ScanLines(data, atEOF)\n\t}\n}\n\nfunc text(byword bool) string {\n\tbyWord = byword\n\tif scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\teof = true\n\treturn \"\"\n}\n\n//basics\nfunc EOF() bool {\n\treturn eof\n}\n\nfunc Word() string {\n\treturn text(true)\n}\n\nfunc Words() []string {\n\treturn strings.Split(Line(), splitter)\n}\n\nfunc Line() string {\n\treturn text(false)\n}\n\nfunc Lines() []string {\n\tvar ret []string\n\tfor {\n\t\tl := Line()\n\t\tif EOF() {\n\t\t\tbreak\n\t\t}\n\t\tret = append(ret, l)\n\t}\n\treturn ret\n}\n\nfunc Byte() byte {\n\treturn byte(Uint8())\n}\n\n//auto-generated code\nfunc Int() int {\n\tret, _ := strconv.ParseInt(Word(), 10, 0)\n\treturn int(ret)\n}\n\nfunc Ints() []int {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 0)\n\t\tret[i] = int(v)\n\t}\n\treturn ret\n}\n\nfunc Ints2() (int, int) {\n\treturn Int(), Int()\n}\n\nfunc Ints3() (int, int, int) {\n\treturn Int(), Int(), Int()\n}\n\nfunc Ints4() (int, int, int, int) {\n\treturn Int(), Int(), Int(), Int()\n}\n\nfunc Ints5() (int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints6() (int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints7() (int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints8() (int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc Ints9() (int, int, int, int, int, int, int, int, int) {\n\treturn Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int(), Int()\n}\n\nfunc IntsN(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int()\n\t}\n\treturn ret\n}\n\nfunc Int8() int8 {\n\tret, _ := strconv.ParseInt(Word(), 10, 8)\n\treturn int8(ret)\n}\n\nfunc Int8s() []int8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 8)\n\t\tret[i] = int8(v)\n\t}\n\treturn ret\n}\n\nfunc Int8s2() (int8, int8) {\n\treturn Int8(), Int8()\n}\n\nfunc Int8s3() (int8, int8, int8) {\n\treturn Int8(), Int8(), Int8()\n}\n\nfunc Int8s4() (int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s5() (int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s6() (int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s7() (int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s8() (int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8s9() (int8, int8, int8, int8, int8, int8, int8, int8, int8) {\n\treturn Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8(), Int8()\n}\n\nfunc Int8sN(n int) []int8 {\n\tret := make([]int8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int8()\n\t}\n\treturn ret\n}\n\nfunc Int16() int16 {\n\tret, _ := strconv.ParseInt(Word(), 10, 16)\n\treturn int16(ret)\n}\n\nfunc Int16s() []int16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 16)\n\t\tret[i] = int16(v)\n\t}\n\treturn ret\n}\n\nfunc Int16s2() (int16, int16) {\n\treturn Int16(), Int16()\n}\n\nfunc Int16s3() (int16, int16, int16) {\n\treturn Int16(), Int16(), Int16()\n}\n\nfunc Int16s4() (int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s5() (int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s6() (int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s7() (int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s8() (int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16s9() (int16, int16, int16, int16, int16, int16, int16, int16, int16) {\n\treturn Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16(), Int16()\n}\n\nfunc Int16sN(n int) []int16 {\n\tret := make([]int16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int16()\n\t}\n\treturn ret\n}\n\nfunc Int32() int32 {\n\tret, _ := strconv.ParseInt(Word(), 10, 32)\n\treturn int32(ret)\n}\n\nfunc Int32s() []int32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 32)\n\t\tret[i] = int32(v)\n\t}\n\treturn ret\n}\n\nfunc Int32s2() (int32, int32) {\n\treturn Int32(), Int32()\n}\n\nfunc Int32s3() (int32, int32, int32) {\n\treturn Int32(), Int32(), Int32()\n}\n\nfunc Int32s4() (int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s5() (int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s6() (int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s7() (int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s8() (int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32s9() (int32, int32, int32, int32, int32, int32, int32, int32, int32) {\n\treturn Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32(), Int32()\n}\n\nfunc Int32sN(n int) []int32 {\n\tret := make([]int32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int32()\n\t}\n\treturn ret\n}\n\nfunc Int64() int64 {\n\tret, _ := strconv.ParseInt(Word(), 10, 64)\n\treturn int64(ret)\n}\n\nfunc Int64s() []int64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseInt(words[i], 10, 64)\n\t\tret[i] = int64(v)\n\t}\n\treturn ret\n}\n\nfunc Int64s2() (int64, int64) {\n\treturn Int64(), Int64()\n}\n\nfunc Int64s3() (int64, int64, int64) {\n\treturn Int64(), Int64(), Int64()\n}\n\nfunc Int64s4() (int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s5() (int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s6() (int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s7() (int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s8() (int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64s9() (int64, int64, int64, int64, int64, int64, int64, int64, int64) {\n\treturn Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64(), Int64()\n}\n\nfunc Int64sN(n int) []int64 {\n\tret := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Int64()\n\t}\n\treturn ret\n}\n\nfunc Uint() uint {\n\tret, _ := strconv.ParseUint(Word(), 10, 0)\n\treturn uint(ret)\n}\n\nfunc Uints() []uint {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 0)\n\t\tret[i] = uint(v)\n\t}\n\treturn ret\n}\n\nfunc Uints2() (uint, uint) {\n\treturn Uint(), Uint()\n}\n\nfunc Uints3() (uint, uint, uint) {\n\treturn Uint(), Uint(), Uint()\n}\n\nfunc Uints4() (uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints5() (uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints6() (uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints7() (uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints8() (uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc Uints9() (uint, uint, uint, uint, uint, uint, uint, uint, uint) {\n\treturn Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint(), Uint()\n}\n\nfunc UintsN(n int) []uint {\n\tret := make([]uint, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint()\n\t}\n\treturn ret\n}\n\nfunc Uint8() uint8 {\n\tret, _ := strconv.ParseUint(Word(), 10, 8)\n\treturn uint8(ret)\n}\n\nfunc Uint8s() []uint8 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 8)\n\t\tret[i] = uint8(v)\n\t}\n\treturn ret\n}\n\nfunc Uint8s2() (uint8, uint8) {\n\treturn Uint8(), Uint8()\n}\n\nfunc Uint8s3() (uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s4() (uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s5() (uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s6() (uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s7() (uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s8() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8s9() (uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8, uint8) {\n\treturn Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8(), Uint8()\n}\n\nfunc Uint8sN(n int) []uint8 {\n\tret := make([]uint8, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint8()\n\t}\n\treturn ret\n}\n\nfunc Uint16() uint16 {\n\tret, _ := strconv.ParseUint(Word(), 10, 16)\n\treturn uint16(ret)\n}\n\nfunc Uint16s() []uint16 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 16)\n\t\tret[i] = uint16(v)\n\t}\n\treturn ret\n}\n\nfunc Uint16s2() (uint16, uint16) {\n\treturn Uint16(), Uint16()\n}\n\nfunc Uint16s3() (uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s4() (uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s5() (uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s6() (uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s7() (uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s8() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16s9() (uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16, uint16) {\n\treturn Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16(), Uint16()\n}\n\nfunc Uint16sN(n int) []uint16 {\n\tret := make([]uint16, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint16()\n\t}\n\treturn ret\n}\n\nfunc Uint32() uint32 {\n\tret, _ := strconv.ParseUint(Word(), 10, 32)\n\treturn uint32(ret)\n}\n\nfunc Uint32s() []uint32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 32)\n\t\tret[i] = uint32(v)\n\t}\n\treturn ret\n}\n\nfunc Uint32s2() (uint32, uint32) {\n\treturn Uint32(), Uint32()\n}\n\nfunc Uint32s3() (uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s4() (uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s5() (uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s6() (uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s7() (uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s8() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32s9() (uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32, uint32) {\n\treturn Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32(), Uint32()\n}\n\nfunc Uint32sN(n int) []uint32 {\n\tret := make([]uint32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint32()\n\t}\n\treturn ret\n}\n\nfunc Uint64() uint64 {\n\tret, _ := strconv.ParseUint(Word(), 10, 64)\n\treturn uint64(ret)\n}\n\nfunc Uint64s() []uint64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseUint(words[i], 10, 64)\n\t\tret[i] = uint64(v)\n\t}\n\treturn ret\n}\n\nfunc Uint64s2() (uint64, uint64) {\n\treturn Uint64(), Uint64()\n}\n\nfunc Uint64s3() (uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s4() (uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s5() (uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s6() (uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s7() (uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s8() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64s9() (uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64, uint64) {\n\treturn Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64(), Uint64()\n}\n\nfunc Uint64sN(n int) []uint64 {\n\tret := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Uint64()\n\t}\n\treturn ret\n}\n\nfunc Float32() float32 {\n\tret, _ := strconv.ParseFloat(Word(), 32)\n\treturn float32(ret)\n}\n\nfunc Float32s() []float32 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 32)\n\t\tret[i] = float32(v)\n\t}\n\treturn ret\n}\n\nfunc Float32s2() (float32, float32) {\n\treturn Float32(), Float32()\n}\n\nfunc Float32s3() (float32, float32, float32) {\n\treturn Float32(), Float32(), Float32()\n}\n\nfunc Float32s4() (float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s5() (float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s6() (float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s7() (float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s8() (float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32s9() (float32, float32, float32, float32, float32, float32, float32, float32, float32) {\n\treturn Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32(), Float32()\n}\n\nfunc Float32sN(n int) []float32 {\n\tret := make([]float32, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float32()\n\t}\n\treturn ret\n}\n\nfunc Float64() float64 {\n\tret, _ := strconv.ParseFloat(Word(), 64)\n\treturn float64(ret)\n}\n\nfunc Float64s() []float64 {\n\twords := Words()\n\tn := len(words)\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tv, _ := strconv.ParseFloat(words[i], 64)\n\t\tret[i] = float64(v)\n\t}\n\treturn ret\n}\n\nfunc Float64s2() (float64, float64) {\n\treturn Float64(), Float64()\n}\n\nfunc Float64s3() (float64, float64, float64) {\n\treturn Float64(), Float64(), Float64()\n}\n\nfunc Float64s4() (float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s5() (float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s6() (float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s7() (float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s8() (float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64s9() (float64, float64, float64, float64, float64, float64, float64, float64, float64) {\n\treturn Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64(), Float64()\n}\n\nfunc Float64sN(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Float64()\n\t}\n\treturn ret\n}\n\nfunc Words2() (string, string) {\n\treturn Word(), Word()\n}\n\nfunc Words3() (string, string, string) {\n\treturn Word(), Word(), Word()\n}\n\nfunc Words4() (string, string, string, string) {\n\treturn Word(), Word(), Word(), Word()\n}\n\nfunc Words5() (string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words6() (string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words7() (string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words8() (string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc Words9() (string, string, string, string, string, string, string, string, string) {\n\treturn Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word(), Word()\n}\n\nfunc WordsN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Word()\n\t}\n\treturn ret\n}\n\nfunc Lines2() (string, string) {\n\treturn Line(), Line()\n}\n\nfunc Lines3() (string, string, string) {\n\treturn Line(), Line(), Line()\n}\n\nfunc Lines4() (string, string, string, string) {\n\treturn Line(), Line(), Line(), Line()\n}\n\nfunc Lines5() (string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines6() (string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines7() (string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines8() (string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc Lines9() (string, string, string, string, string, string, string, string, string) {\n\treturn Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line(), Line()\n}\n\nfunc LinesN(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Line()\n\t}\n\treturn ret\n}\n\nfunc Bytes2() (byte, byte) {\n\treturn Byte(), Byte()\n}\n\nfunc Bytes3() (byte, byte, byte) {\n\treturn Byte(), Byte(), Byte()\n}\n\nfunc Bytes4() (byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes5() (byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes6() (byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes7() (byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes8() (byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc Bytes9() (byte, byte, byte, byte, byte, byte, byte, byte, byte) {\n\treturn Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte(), Byte()\n}\n\nfunc BytesN(n int) []byte {\n\tret := make([]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = Byte()\n\t}\n\treturn ret\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 20427, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s561612564", "group_id": "codeNet:p02786", "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\tH := readi()\n\tm := make(map[int]int)\n\tm[1] = 1\n\tvar rec func(h int) int\n\trec = func(h int) int {\n\t\tv, ok := m[h]\n\t\tif ok {\n\t\t\treturn v\n\t\t}\n\t\tv = 1 + 2*rec(h/2)\n\t\tm[h] = v\n\t\treturn v\n\t}\n\n\tprintln(rec(H))\n\n}\n", "language": "Go", "metadata": {"date": 1580069704, "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/s561612564.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s561612564", "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\tH := readi()\n\tm := make(map[int]int)\n\tm[1] = 1\n\tvar rec func(h int) int\n\trec = func(h int) int {\n\t\tv, ok := m[h]\n\t\tif ok {\n\t\t\treturn v\n\t\t}\n\t\tv = 1 + 2*rec(h/2)\n\t\tm[h] = v\n\t\treturn v\n\t}\n\n\tprintln(rec(H))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5723, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s542847839", "group_id": "codeNet:p02787", "input_text": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar h, a uint32\n\tfmt.Scanf(\"%d %d\", &h, &a)\n\ttype magicType struct {\n\t\tdamage uint32\n\t\tmp uint32\n\t}\n\tmagics := make([]magicType,a)\n\tvar dp [1e4][1e3]uint32\n for i := uint32(0); i < a; i++ {\n\t\t_, err := fmt.Scanf(\"%d %d\", &magics[i].damage, &magics[i].mp)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n for hp := uint32(1); hp <= h; hp++ {\n\t\t\tvar cost uint32\n\t\t\tif hp < magics[i].damage {\n\t\t\t\tcost = magics[i].mp\n\t\t\t} else {\n\t\t\t\tcost = dp[i][hp - magics[i].damage] + magics[i].mp\n\t\t\t}\n\t\t\tif i == 0 || cost < dp[i - 1][hp] {\n\t\t\t\tdp[i][hp] = cost\n\t\t\t} else {\n\t\t\t\tdp[i][hp] = dp[i - 1][hp]\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfmt.Printf(\"%v\", dp[a - 1][h])\n}", "language": "Go", "metadata": {"date": 1582888957, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02787.html", "problem_id": "p02787", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02787/input.txt", "sample_output_relpath": "derived/input_output/data/p02787/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02787/Go/s542847839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s542847839", "user_id": "u606693908"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar h, a uint32\n\tfmt.Scanf(\"%d %d\", &h, &a)\n\ttype magicType struct {\n\t\tdamage uint32\n\t\tmp uint32\n\t}\n\tmagics := make([]magicType,a)\n\tvar dp [1e4][1e3]uint32\n for i := uint32(0); i < a; i++ {\n\t\t_, err := fmt.Scanf(\"%d %d\", &magics[i].damage, &magics[i].mp)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n for hp := uint32(1); hp <= h; hp++ {\n\t\t\tvar cost uint32\n\t\t\tif hp < magics[i].damage {\n\t\t\t\tcost = magics[i].mp\n\t\t\t} else {\n\t\t\t\tcost = dp[i][hp - magics[i].damage] + magics[i].mp\n\t\t\t}\n\t\t\tif i == 0 || cost < dp[i - 1][hp] {\n\t\t\t\tdp[i][hp] = cost\n\t\t\t} else {\n\t\t\t\tdp[i][hp] = dp[i - 1][hp]\n\t\t\t}\n\t\t}\n\t}\n\n\n\tfmt.Printf(\"%v\", dp[a - 1][h])\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nIbis is fighting with a monster.\n\nThe health of the monster is H.\n\nIbis can cast N kinds of spells. Casting the i-th spell decreases the monster's health by A_i, at the cost of B_i Magic Points.\n\nThe same spell can be cast multiple times. There is no way other than spells to decrease the monster's health.\n\nIbis wins when the health of the monster becomes 0 or below.\n\nFind the minimum total Magic Points that have to be consumed before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq N \\leq 10^3\n\n1 \\leq A_i \\leq 10^4\n\n1 \\leq B_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 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the minimum total Magic Points that have to be consumed before winning.\n\nSample Input 1\n\n9 3\n8 3\n4 2\n2 1\n\nSample Output 1\n\n4\n\nFirst, let us cast the first spell to decrease the monster's health by 8, at the cost of 3 Magic Points. The monster's health is now 1.\n\nThen, cast the third spell to decrease the monster's health by 2, at the cost of 1 Magic Point. The monster's health is now -1.\n\nIn this way, we can win at the total cost of 4 Magic Points.\n\nSample Input 2\n\n100 6\n1 1\n2 3\n3 9\n4 27\n5 81\n6 243\n\nSample Output 2\n\n100\n\nIt is optimal to cast the first spell 100 times.\n\nSample Input 3\n\n9999 10\n540 7550\n691 9680\n700 9790\n510 7150\n415 5818\n551 7712\n587 8227\n619 8671\n588 8228\n176 2461\n\nSample Output 3\n\n139815", "sample_input": "9 3\n8 3\n4 2\n2 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02787", "source_text": "Score : 500 points\n\nProblem Statement\n\nIbis is fighting with a monster.\n\nThe health of the monster is H.\n\nIbis can cast N kinds of spells. Casting the i-th spell decreases the monster's health by A_i, at the cost of B_i Magic Points.\n\nThe same spell can be cast multiple times. There is no way other than spells to decrease the monster's health.\n\nIbis wins when the health of the monster becomes 0 or below.\n\nFind the minimum total Magic Points that have to be consumed before winning.\n\nConstraints\n\n1 \\leq H \\leq 10^4\n\n1 \\leq N \\leq 10^3\n\n1 \\leq A_i \\leq 10^4\n\n1 \\leq B_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 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the minimum total Magic Points that have to be consumed before winning.\n\nSample Input 1\n\n9 3\n8 3\n4 2\n2 1\n\nSample Output 1\n\n4\n\nFirst, let us cast the first spell to decrease the monster's health by 8, at the cost of 3 Magic Points. The monster's health is now 1.\n\nThen, cast the third spell to decrease the monster's health by 2, at the cost of 1 Magic Point. The monster's health is now -1.\n\nIn this way, we can win at the total cost of 4 Magic Points.\n\nSample Input 2\n\n100 6\n1 1\n2 3\n3 9\n4 27\n5 81\n6 243\n\nSample Output 2\n\n100\n\nIt is optimal to cast the first spell 100 times.\n\nSample Input 3\n\n9999 10\n540 7550\n691 9680\n700 9790\n510 7150\n415 5818\n551 7712\n587 8227\n619 8671\n588 8228\n176 2461\n\nSample Output 3\n\n139815", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 676, "cpu_time_ms": 19, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s452857235", "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\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\tn := intScanner()\n\td := intScanner() * 2\n\ta := intScanner()\n\txh := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\txh[i] = []int{intScanner(), intScanner()}\n\t}\n\tsort.Sort(SliceSort(xh))\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif xh[i][1] > 0 {\n\t\t\tm := (xh[i][1] + a - 1) / a * a\n\t\t\tans += (xh[i][1] + a - 1) / a\n\t\t\tfor j := i; j < n; j++ {\n\t\t\t\tif xh[j][0] <= xh[i][0]+d {\n\t\t\t\t\txh[j][1] -= m\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}\n\tfmt.Println(ans)\n}\n\ntype SliceSort [][]int\n\nfunc (x SliceSort) Len() int { return len(x) }\nfunc (x SliceSort) Less(i, j int) bool { return x[i][0] < x[j][0] }\nfunc (x SliceSort) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\n", "language": "Go", "metadata": {"date": 1592258235, "filename_ext": "go", "original_language": "Go (1.6)", "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/s452857235.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s452857235", "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\"sort\"\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\tn := intScanner()\n\td := intScanner() * 2\n\ta := intScanner()\n\txh := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\txh[i] = []int{intScanner(), intScanner()}\n\t}\n\tsort.Sort(SliceSort(xh))\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif xh[i][1] > 0 {\n\t\t\tm := (xh[i][1] + a - 1) / a * a\n\t\t\tans += (xh[i][1] + a - 1) / a\n\t\t\tfor j := i; j < n; j++ {\n\t\t\t\tif xh[j][0] <= xh[i][0]+d {\n\t\t\t\t\txh[j][1] -= m\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}\n\tfmt.Println(ans)\n}\n\ntype SliceSort [][]int\n\nfunc (x SliceSort) Len() int { return len(x) }\nfunc (x SliceSort) Less(i, j int) bool { return x[i][0] < x[j][0] }\nfunc (x SliceSort) Swap(i, j int) { x[i], x[j] = x[j], x[i] }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1854, "cpu_time_ms": 2104, "memory_kb": 12160}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717855161", "group_id": "codeNet:p02788", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\ntype DArray [][]int\nfunc (a DArray) Len() int { return len(a) }\nfunc (a DArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a DArray) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\nfunc main() {\n var N, D, A int\n fmt.Scan(&N, &D, &A)\n M := make(DArray, N)\n for i := 0; i < N; i++ {\n var x, h, z int\n fmt.Scan(&x, &h)\n if h % A >= 1 {\n z = 1\n } else {\n z = 0\n }\n M[i] = []int{x, h / A + z}\n }\n sort.Sort(M)\n\n rng := 2 * D + 1\n atk := 0\n for i := 0; i < N; i++ {\n if M[i][1] > 0 {\n atk += M[i][1]\n } else {\n continue\n }\n for j:= i+1; j < N; j++ {\n if M[j][0] - M[i][0] > rng {\n break\n }\n M[j][1] -= M[i][1]\n }\n }\n fmt.Println(atk)\n}", "language": "Go", "metadata": {"date": 1582239929, "filename_ext": "go", "original_language": "Go (1.6)", "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/s717855161.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s717855161", "user_id": "u804455323"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\ntype DArray [][]int\nfunc (a DArray) Len() int { return len(a) }\nfunc (a DArray) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a DArray) Less(i, j int) bool { return a[i][0] < a[j][0] }\n\nfunc main() {\n var N, D, A int\n fmt.Scan(&N, &D, &A)\n M := make(DArray, N)\n for i := 0; i < N; i++ {\n var x, h, z int\n fmt.Scan(&x, &h)\n if h % A >= 1 {\n z = 1\n } else {\n z = 0\n }\n M[i] = []int{x, h / A + z}\n }\n sort.Sort(M)\n\n rng := 2 * D + 1\n atk := 0\n for i := 0; i < N; i++ {\n if M[i][1] > 0 {\n atk += M[i][1]\n } else {\n continue\n }\n for j:= i+1; j < N; j++ {\n if M[j][0] - M[i][0] > rng {\n break\n }\n M[j][1] -= M[i][1]\n }\n }\n fmt.Println(atk)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 767, "cpu_time_ms": 2108, "memory_kb": 12032}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s391692050", "group_id": "codeNet:p02788", "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\tx int\n\th int\n}\n\ntype bcs []bc\n\nfunc (b bcs) Len() int { return len(b) }\nfunc (b bcs) Less(i, j int) bool { return b[i].x < b[j].x }\nfunc (b bcs) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\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\td := nextInt()\n\ta := nextInt()\n\ts := make([]bc, n)\n\n\tfor i := range s {\n\t\ts[i].x = nextInt()\n\t\ts[i].h = nextInt()\n\t}\n\tsort.Sort(bcs(s))\n\n\tans := 0\n\n\tbm := make([][]int, 0, n)\n\n\tadmg := 0\n\tdebugf(\"%v\\n\", s)\n\tfor l := range s {\n\t\tif s[l].h <= 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// proceed r\n\t\t//for r < n && s[r].x <= s[l].x+2*d {\n\t\t//\tr++\n\t\t//}\n\t\tfor len(bm) > 0 && bm[0][1] < s[l].x-2*d {\n\t\t\tadmg -= bm[0][0]\n\t\t\tbm = bm[1:]\n\t\t}\n\n\t\t// drop bomb\n\t\ts[l].h -= admg\n\t\tif s[l].h > 0 {\n\t\t\tcount := (s[l].h + a - 1) / a\n\t\t\tans += count\n\t\t\tdmg := a * count\n\t\t\tadmg += dmg\n\t\t\ts[l].h -= dmg\n\t\t\tbm = append(bm, []int{dmg, s[l].x})\n\t\t}\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": 1581330935, "filename_ext": "go", "original_language": "Go (1.6)", "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/s391692050.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s391692050", "user_id": "u880731071"}, "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\"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\tx int\n\th int\n}\n\ntype bcs []bc\n\nfunc (b bcs) Len() int { return len(b) }\nfunc (b bcs) Less(i, j int) bool { return b[i].x < b[j].x }\nfunc (b bcs) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\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\td := nextInt()\n\ta := nextInt()\n\ts := make([]bc, n)\n\n\tfor i := range s {\n\t\ts[i].x = nextInt()\n\t\ts[i].h = nextInt()\n\t}\n\tsort.Sort(bcs(s))\n\n\tans := 0\n\n\tbm := make([][]int, 0, n)\n\n\tadmg := 0\n\tdebugf(\"%v\\n\", s)\n\tfor l := range s {\n\t\tif s[l].h <= 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// proceed r\n\t\t//for r < n && s[r].x <= s[l].x+2*d {\n\t\t//\tr++\n\t\t//}\n\t\tfor len(bm) > 0 && bm[0][1] < s[l].x-2*d {\n\t\t\tadmg -= bm[0][0]\n\t\t\tbm = bm[1:]\n\t\t}\n\n\t\t// drop bomb\n\t\ts[l].h -= admg\n\t\tif s[l].h > 0 {\n\t\t\tcount := (s[l].h + a - 1) / a\n\t\t\tans += count\n\t\t\tdmg := a * count\n\t\t\tadmg += dmg\n\t\t\ts[l].h -= dmg\n\t\t\tbm = append(bm, []int{dmg, s[l].x})\n\t\t}\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1492, "cpu_time_ms": 178, "memory_kb": 12544}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s678808096", "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 t struct {\n\tX int\n\tH int\n}\ntype byX []t\n\nfunc (a byX) Len() int { return len(a) }\nfunc (a byX) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byX) Less(i, j int) bool { return a[i].X < a[j].X }\n\nfunc main() {\n\tN := readInt()\n\tD := readInt()\n\tA := readInt()\n\tXH := make([]t, N)\n\tfor i := 0; i < N; i++ {\n\t\tXH[i].X = readInt()\n\t\tXH[i].H = (readInt() + (A - 1)) / A\n\t}\n\n\tsort.Sort(byX(XH))\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tif XH[i].H < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tresult += XH[i].H\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif XH[j].X > XH[i].X+2*D {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tXH[j].H -= XH[i].H\n\t\t}\n\t}\n\tfmt.Println(result)\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", "language": "Go", "metadata": {"date": 1580079929, "filename_ext": "go", "original_language": "Go (1.6)", "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/s678808096.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s678808096", "user_id": "u347640436"}, "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 t struct {\n\tX int\n\tH int\n}\ntype byX []t\n\nfunc (a byX) Len() int { return len(a) }\nfunc (a byX) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byX) Less(i, j int) bool { return a[i].X < a[j].X }\n\nfunc main() {\n\tN := readInt()\n\tD := readInt()\n\tA := readInt()\n\tXH := make([]t, N)\n\tfor i := 0; i < N; i++ {\n\t\tXH[i].X = readInt()\n\t\tXH[i].H = (readInt() + (A - 1)) / A\n\t}\n\n\tsort.Sort(byX(XH))\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tif XH[i].H < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tresult += XH[i].H\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif XH[j].X > XH[i].X+2*D {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tXH[j].H -= XH[i].H\n\t\t}\n\t}\n\tfmt.Println(result)\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2108, "memory_kb": 9472}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s606160504", "group_id": "codeNet:p02789", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tif n == m {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1587245514, "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/s606160504.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s606160504", "user_id": "u769765274"}, "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\n\tif n == m {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 142, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s910034446", "group_id": "codeNet:p02790", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tif a <= b {\n\t\tfmt.Println(strings.Repeat(strconv.Itoa(a), b))\n\t} else {\n\t\tfmt.Println(strings.Repeat(strconv.Itoa(b), a))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587524834, "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/s910034446.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s910034446", "user_id": "u131131890"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tif a <= b {\n\t\tfmt.Println(strings.Repeat(strconv.Itoa(a), b))\n\t} else {\n\t\tfmt.Println(strings.Repeat(strconv.Itoa(b), a))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s745005537", "group_id": "codeNet:p02790", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solution(a, b int) int {\n\tab := make([]int, b)\n\tba := make([]int, a)\n\n\t// aをb回\n\tfor i := 0; i < b; i++ {\n\t\tab[i] = a\n\t}\n\t// bをa回\n\tfor i := 0; i < a; i++ {\n\t\tba[i] = b\n\t}\n\n\tif dictionaryOrder(ab) < dictionaryOrder(ba) {\n\t\treturn ints2int(ab)\n\t}\n\treturn ints2int(ba)\n}\n\nfunc ints2int(nums []int) int {\n\tstrs := make([]string, len(nums))\n\n\tfor i := range nums {\n\t\tstrs[i] = strconv.Itoa(nums[i])\n\t}\n\tans, _ := strconv.Atoi(strings.Join(strs, \"\"))\n\treturn ans\n}\n\nfunc dictionaryOrder(nums []int) int {\n\tvar ans int\n\tl := len(nums)\n\tfor i := 0; i < l; i++ {\n\t\tn := nums[i]\n\t\tarr := make([]int, len(nums)-i)\n\t\tcopy(arr, nums[i:])\n\t\ta := ascNumber(arr, n) - 1\n\t\tif a == 0 {\n\t\t\tans += 0\n\t\t} else {\n\t\t\tans += a * factorical(l-i-1)\n\t\t}\n\t}\n\tans++\n\treturn ans\n}\n\nfunc ascNumber(nums []int, n int) int {\n\tsort.Ints(nums)\n\tvar i int = 1\n\tfor _, v := range nums {\n\t\tif v == n {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\treturn i\n}\n\nfunc factorical(n int) int {\n\tif n == 0 || n == 1 {\n\t\treturn 1\n\t}\n\treturn n * factorical(n-1)\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(solution(a, b))\n}\n", "language": "Go", "metadata": {"date": 1579465626, "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/s745005537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s745005537", "user_id": "u568763892"}, "prompt_components": {"gold_output": "3333\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solution(a, b int) int {\n\tab := make([]int, b)\n\tba := make([]int, a)\n\n\t// aをb回\n\tfor i := 0; i < b; i++ {\n\t\tab[i] = a\n\t}\n\t// bをa回\n\tfor i := 0; i < a; i++ {\n\t\tba[i] = b\n\t}\n\n\tif dictionaryOrder(ab) < dictionaryOrder(ba) {\n\t\treturn ints2int(ab)\n\t}\n\treturn ints2int(ba)\n}\n\nfunc ints2int(nums []int) int {\n\tstrs := make([]string, len(nums))\n\n\tfor i := range nums {\n\t\tstrs[i] = strconv.Itoa(nums[i])\n\t}\n\tans, _ := strconv.Atoi(strings.Join(strs, \"\"))\n\treturn ans\n}\n\nfunc dictionaryOrder(nums []int) int {\n\tvar ans int\n\tl := len(nums)\n\tfor i := 0; i < l; i++ {\n\t\tn := nums[i]\n\t\tarr := make([]int, len(nums)-i)\n\t\tcopy(arr, nums[i:])\n\t\ta := ascNumber(arr, n) - 1\n\t\tif a == 0 {\n\t\t\tans += 0\n\t\t} else {\n\t\t\tans += a * factorical(l-i-1)\n\t\t}\n\t}\n\tans++\n\treturn ans\n}\n\nfunc ascNumber(nums []int, n int) int {\n\tsort.Ints(nums)\n\tvar i int = 1\n\tfor _, v := range nums {\n\t\tif v == n {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t}\n\treturn i\n}\n\nfunc factorical(n int) int {\n\tif n == 0 || n == 1 {\n\t\treturn 1\n\t}\n\treturn n * factorical(n-1)\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(solution(a, b))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s953422857", "group_id": "codeNet:p02791", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\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\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\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\n\nfunc main(){\n\tvar N int\n\tvar res,min int\n\tvar P []int\n\tfmt.Scan(&N)\n\tfor i:=0;i P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 849, "cpu_time_ms": 944, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s738265899", "group_id": "codeNet:p02793", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst MOD = 1000000007\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 Max(x ...int) int {\n\tmax := x[0]\n\tfor _, v := range x {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Min(x ...int) int {\n\tmin := x[0]\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\nfunc GCD(a, b int) int {\n\tx := Min(a, b)\n\ty := Max(a, b)\n\tfor {\n\t\tt := y % x\n\t\tif t == 0 {\n\t\t\treturn x\n\t\t}\n\t\ty = x\n\t\tx = t\n\t}\n}\n\nfunc LCM(a, b int) int {\n\t// return (a % MOD * b % MOD) % MOD * ModInv(GCD(a, b), MOD) % MOD\n\tgcd := GCD(a, b)\n\treturn a * b / gcd\n}\n\nfunc ModInv(a, m int) int {\n\tb := m\n\tu := 1\n\tv := 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\n\tu %= m\n\tif (u < 0) {\n\t\tu += m\n\t}\n\n\treturn u\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tlcm := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tlcm = LCM(lcm, a[i])\n\t}\n\n\ttotal := 0\n\tfor i := 0; i < n; i++ {\n\t\tb := lcm % MOD * ModInv(a[i], MOD)\n\t\ttotal = (total % MOD + b % MOD) % MOD\n\t}\n\n\tfmt.Printf(\"%d\", total)\n}\n", "language": "Go", "metadata": {"date": 1579469204, "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/s738265899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s738265899", "user_id": "u638629468"}, "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\nconst MOD = 1000000007\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 Max(x ...int) int {\n\tmax := x[0]\n\tfor _, v := range x {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Min(x ...int) int {\n\tmin := x[0]\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\nfunc GCD(a, b int) int {\n\tx := Min(a, b)\n\ty := Max(a, b)\n\tfor {\n\t\tt := y % x\n\t\tif t == 0 {\n\t\t\treturn x\n\t\t}\n\t\ty = x\n\t\tx = t\n\t}\n}\n\nfunc LCM(a, b int) int {\n\t// return (a % MOD * b % MOD) % MOD * ModInv(GCD(a, b), MOD) % MOD\n\tgcd := GCD(a, b)\n\treturn a * b / gcd\n}\n\nfunc ModInv(a, m int) int {\n\tb := m\n\tu := 1\n\tv := 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\n\tu %= m\n\tif (u < 0) {\n\t\tu += m\n\t}\n\n\treturn u\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tlcm := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tlcm = LCM(lcm, a[i])\n\t}\n\n\ttotal := 0\n\tfor i := 0; i < n; i++ {\n\t\tb := lcm % MOD * ModInv(a[i], MOD)\n\t\ttotal = (total % MOD + b % MOD) % MOD\n\t}\n\n\tfmt.Printf(\"%d\", total)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1249, "cpu_time_ms": 8, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s344766930", "group_id": "codeNet:p02793", "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 main() {\n\n\tmod := 1000000007\n\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\n\tlcm := A[0]\n\tfor i := 1; i < N; i++ {\n\t\tlcm = lcm * A[i] / gcd(lcm, A[i])\n\t}\n\n\tans := 0\n\tfor _, a := range A {\n\t\tans += lcm / a\n\t\tans %= mod\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1579467308, "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/s344766930.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s344766930", "user_id": "u121192152"}, "prompt_components": {"gold_output": "13\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 main() {\n\n\tmod := 1000000007\n\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\n\tlcm := A[0]\n\tfor i := 1; i < N; i++ {\n\t\tlcm = lcm * A[i] / gcd(lcm, A[i])\n\t}\n\n\tans := 0\n\tfor _, a := range A {\n\t\tans += lcm / a\n\t\tans %= 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 55, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178007735", "group_id": "codeNet:p02795", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solution(h, w, n int) int {\n\tmax := max(h, w)\n\tvar ans int = 1\n\tfor max*ans < n {\n\t\tans++\n\t}\n\treturn ans\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\tvar h, w, n int\n\tfmt.Scan(&h, &w, n)\n\tfmt.Println(solution(h, w, n))\n}\n", "language": "Go", "metadata": {"date": 1579378492, "filename_ext": "go", "original_language": "Go (1.6)", "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/s178007735.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s178007735", "user_id": "u568763892"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solution(h, w, n int) int {\n\tmax := max(h, w)\n\tvar ans int = 1\n\tfor max*ans < n {\n\t\tans++\n\t}\n\treturn ans\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\tvar h, w, n int\n\tfmt.Scan(&h, &w, n)\n\tfmt.Println(solution(h, w, n))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s461919912", "group_id": "codeNet:p02796", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\n// Robot is a struct.\ntype Robot struct {\n\tX int64\n\tL int64\n\tMin int64\n\tMax int64\n}\n\n// Robots is robots.\ntype Robots []Robot\n\n// Less .\nfunc (r Robots) Less(i, j int) bool {\n\treturn r[i].Max < r[j].Max\n}\n\nfunc (r Robots) Len() int {\n\treturn len(r)\n}\n\nfunc (r Robots) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\trobots := make(Robots, 0, N)\n\tfor i := 0; i < N; i++ {\n\t\tr := Robot{}\n\t\tfmt.Scanf(\"%d %d\", &r.X, &r.L)\n\t\tr.Min = r.X - r.L + 1\n\t\tr.Max = r.X + r.L - 1\n\t\trobots = append(robots, r)\n\t}\n\tsort.Sort(robots)\n\tcount := 0\n\tflags := make([]bool, N)\n\tvar max int64\n\tmax = math.MinInt64\n\tfor i, r := range robots {\n\t\tif max >= r.Min {\n\t\t\tflags[i] = false\n\t\t\tcontinue\n\t\t}\n\t\tflags[i] = true\n\t\tif max < r.Max {\n\t\t\tmax = r.Max\n\t\t}\n\t}\n\tfor _, v := range flags {\n\t\tif v {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1579453450, "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/s461919912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s461919912", "user_id": "u162326103"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\n// Robot is a struct.\ntype Robot struct {\n\tX int64\n\tL int64\n\tMin int64\n\tMax int64\n}\n\n// Robots is robots.\ntype Robots []Robot\n\n// Less .\nfunc (r Robots) Less(i, j int) bool {\n\treturn r[i].Max < r[j].Max\n}\n\nfunc (r Robots) Len() int {\n\treturn len(r)\n}\n\nfunc (r Robots) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\trobots := make(Robots, 0, N)\n\tfor i := 0; i < N; i++ {\n\t\tr := Robot{}\n\t\tfmt.Scanf(\"%d %d\", &r.X, &r.L)\n\t\tr.Min = r.X - r.L + 1\n\t\tr.Max = r.X + r.L - 1\n\t\trobots = append(robots, r)\n\t}\n\tsort.Sort(robots)\n\tcount := 0\n\tflags := make([]bool, N)\n\tvar max int64\n\tmax = math.MinInt64\n\tfor i, r := range robots {\n\t\tif max >= r.Min {\n\t\t\tflags[i] = false\n\t\t\tcontinue\n\t\t}\n\t\tflags[i] = true\n\t\tif max < r.Max {\n\t\t\tmax = r.Max\n\t\t}\n\t}\n\tfor _, v := range flags {\n\t\tif v {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 908, "cpu_time_ms": 1384, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s753859723", "group_id": "codeNet:p02796", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Data struct {\n\tX int\n\tL int\n\tMin int\n\tMax int\n}\n\ntype Datas []Data\n\nfunc (p Datas) Len() int {\n\treturn len(p)\n}\n\nfunc (p Datas) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Datas) Less(i, j int) bool {\n\treturn p[i].X < p[j].X\n}\n\nfunc main() {\n\t//\tfmt.Println(\"start\")\n\tvar N int\n\n\tfmt.Scanf(\"%d\", &N)\n\n\td := make(Datas, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d %d\", &d[i].X, &d[i].L)\n\t\td[i].Min = d[i].X - d[i].L // + 1\n\t\td[i].Max = d[i].X + d[i].L //- 1\n\t}\n\n\tsort.Sort(d)\n\n\tfor {\n\t\tflag := make([]int, N)\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif d[i-1].Max > d[i].Min {\n\t\t\t\tflag[i-1]++\n\t\t\t\tflag[i]++\n\t\t\t}\n\t\t}\n\t\tmax := flag[0]\n\t\tpos := 0\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif flag[i] > max {\n\t\t\t\tmax = flag[i]\n\t\t\t\tpos = i\n\t\t\t}\n\t\t}\n\t\t//\t\tfmt.Println(N, d[:N])\n\n\t\tif max == 0 {\n\t\t\tbreak\n\t\t}\n\t\t// remove\n\t\tfor i := 0; i < N-1; i++ {\n\t\t\tif i >= pos {\n\t\t\t\td[i] = d[i+1]\n\t\t\t}\n\t\t}\n\t\tN--\n\t\t//\t\tfmt.Println(N, d[:N])\n\t}\n\tfmt.Println(N)\n}\n", "language": "Go", "metadata": {"date": 1579380668, "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/s753859723.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s753859723", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Data struct {\n\tX int\n\tL int\n\tMin int\n\tMax int\n}\n\ntype Datas []Data\n\nfunc (p Datas) Len() int {\n\treturn len(p)\n}\n\nfunc (p Datas) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Datas) Less(i, j int) bool {\n\treturn p[i].X < p[j].X\n}\n\nfunc main() {\n\t//\tfmt.Println(\"start\")\n\tvar N int\n\n\tfmt.Scanf(\"%d\", &N)\n\n\td := make(Datas, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d %d\", &d[i].X, &d[i].L)\n\t\td[i].Min = d[i].X - d[i].L // + 1\n\t\td[i].Max = d[i].X + d[i].L //- 1\n\t}\n\n\tsort.Sort(d)\n\n\tfor {\n\t\tflag := make([]int, N)\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif d[i-1].Max > d[i].Min {\n\t\t\t\tflag[i-1]++\n\t\t\t\tflag[i]++\n\t\t\t}\n\t\t}\n\t\tmax := flag[0]\n\t\tpos := 0\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif flag[i] > max {\n\t\t\t\tmax = flag[i]\n\t\t\t\tpos = i\n\t\t\t}\n\t\t}\n\t\t//\t\tfmt.Println(N, d[:N])\n\n\t\tif max == 0 {\n\t\t\tbreak\n\t\t}\n\t\t// remove\n\t\tfor i := 0; i < N-1; i++ {\n\t\t\tif i >= pos {\n\t\t\t\td[i] = d[i+1]\n\t\t\t}\n\t\t}\n\t\tN--\n\t\t//\t\tfmt.Println(N, d[:N])\n\t}\n\tfmt.Println(N)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 978, "cpu_time_ms": 2108, "memory_kb": 14464}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s639167702", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tp := make([]int, m)\n\ts := make([]string, m)\n\tac := make(map[int]struct{})\n\twa := make(map[int]struct{})\n\tfor i, _ := range p {\n\t\tfmt.Scan(&p[i], &s[i])\n\t\tif s[i] == \"AC\" {\n\t\t\tac[p[i]] = struct{}{}\n\t\t} else {\n\t\t\twa[p[i]] = struct{}{}\n\t\t}\n\t}\n\tfmt.Println(len(ac), len(wa))\n}", "language": "Go", "metadata": {"date": 1588734609, "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/s639167702.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s639167702", "user_id": "u370270364"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tp := make([]int, m)\n\ts := make([]string, m)\n\tac := make(map[int]struct{})\n\twa := make(map[int]struct{})\n\tfor i, _ := range p {\n\t\tfmt.Scan(&p[i], &s[i])\n\t\tif s[i] == \"AC\" {\n\t\t\tac[p[i]] = struct{}{}\n\t\t} else {\n\t\t\twa[p[i]] = struct{}{}\n\t\t}\n\t}\n\tfmt.Println(len(ac), len(wa))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 347, "cpu_time_ms": 670, "memory_kb": 7808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078728334", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, p int\n\tvar s string\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tacflag := map[int]bool{}\n\tvar ac, wa int\n\twabuf := map[int]int{}\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&p)\n\t\tfmt.Scan(&s)\n\t\tif !acflag[p] {\n\t\t\tswitch s {\n\t\t\tcase \"AC\":\n\t\t\t\tac++\n\t\t\t\tacflag[p] = true\n\t\t\t\twa += wabuf[p]\n\t\t\tcase \"WA\":\n\t\t\t\twabuf[p]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(ac)\n\tfmt.Print(\" \")\n\tfmt.Println(wa)\n}\n", "language": "Go", "metadata": {"date": 1585958462, "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/s078728334.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s078728334", "user_id": "u917346607"}, "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, p int\n\tvar s string\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tacflag := map[int]bool{}\n\tvar ac, wa int\n\twabuf := map[int]int{}\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&p)\n\t\tfmt.Scan(&s)\n\t\tif !acflag[p] {\n\t\t\tswitch s {\n\t\t\tcase \"AC\":\n\t\t\t\tac++\n\t\t\t\tacflag[p] = true\n\t\t\t\twa += wabuf[p]\n\t\t\tcase \"WA\":\n\t\t\t\twabuf[p]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(ac)\n\tfmt.Print(\" \")\n\tfmt.Println(wa)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 417, "cpu_time_ms": 717, "memory_kb": 7936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s730520157", "group_id": "codeNet:p02802", "input_text": "package main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar N,K int\n\tfmt.Scan(&N,&K)\n\tpena,acc:=0,0\n\tplob :=map[int]int{}\n\n\tfor i := 0; i < K; i++ {\n\t\tvar p int\n\t\tvar s string\n\t\tfmt.Scan(&p,&s)\n\t\ta,b:=plob[p]\n\t\tif !b {\n\t\t\tif s==\"WA\" {\n\t\t\t\tplob[p]=1\n\t\t\t}else{\n\t\t\t\tplob[p]=0\n\t\t\t\tacc++\n\t\t\t}\n\t\t}else{\n\t\t\tif a>0 && s==\"WA\" {\n\t\t\t\tplob[p]++;\n\t\t\t}else if a>0 && s==\"AC\" {\n\t\t\t\tacc++\n\t\t\t\tpena+=a\n\t\t\t\tplob[p]=0\n\t\t\t}\n\t\t}\n\n\t}\n\n\t\n\n\tfmt.Println(acc,pena)\n\n}\n\n", "language": "Go", "metadata": {"date": 1584381506, "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/s730520157.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s730520157", "user_id": "u498467508"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar N,K int\n\tfmt.Scan(&N,&K)\n\tpena,acc:=0,0\n\tplob :=map[int]int{}\n\n\tfor i := 0; i < K; i++ {\n\t\tvar p int\n\t\tvar s string\n\t\tfmt.Scan(&p,&s)\n\t\ta,b:=plob[p]\n\t\tif !b {\n\t\t\tif s==\"WA\" {\n\t\t\t\tplob[p]=1\n\t\t\t}else{\n\t\t\t\tplob[p]=0\n\t\t\t\tacc++\n\t\t\t}\n\t\t}else{\n\t\t\tif a>0 && s==\"WA\" {\n\t\t\t\tplob[p]++;\n\t\t\t}else if a>0 && s==\"AC\" {\n\t\t\t\tacc++\n\t\t\t\tpena+=a\n\t\t\t\tplob[p]=0\n\t\t\t}\n\t\t}\n\n\t}\n\n\t\n\n\tfmt.Println(acc,pena)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 678, "memory_kb": 8064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s002595547", "group_id": "codeNet:p02802", "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\tNM := sc.nextInts()\n\t// N := NM[0]\n\tM := NM[1]\n\tmAc := make(map[string]int)\n\tmWa := make(map[string]int)\n\tfor i := 0; i < M; i++ {\n\t\tprob := sc.nexts()\n\t\tnth := prob[0]\n\t\tresult := prob[1]\n\t\tif result == \"AC\" {\n\t\t\tmAc[nth] = 1\n\t\t} else {\n\t\t\tif mAc[nth] == 0 {\n\t\t\t\tmWa[nth]++\n\t\t\t}\n\t\t}\n\t}\n\tvar sumAc int\n\tvar sunWa int\n\n\tfor _, v := range mAc {\n\t\tsumAc += v\n\t}\n\n\tfor i, v := range mWa {\n\t\tif mAc[i] == 1 {\n\t\t\tsunWa += v\n\t\t}\n\t}\n\n\tfmt.Println(sumAc, sunWa)\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}\n\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\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}\n\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\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}\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}\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], 64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\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], 64)\n\t}\n\ts.resetCur()\n\treturn res\n}\n\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\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}\n\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\n\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\n\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1582420394, "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/s002595547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s002595547", "user_id": "u799236543"}, "prompt_components": {"gold_output": "2 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\tNM := sc.nextInts()\n\t// N := NM[0]\n\tM := NM[1]\n\tmAc := make(map[string]int)\n\tmWa := make(map[string]int)\n\tfor i := 0; i < M; i++ {\n\t\tprob := sc.nexts()\n\t\tnth := prob[0]\n\t\tresult := prob[1]\n\t\tif result == \"AC\" {\n\t\t\tmAc[nth] = 1\n\t\t} else {\n\t\t\tif mAc[nth] == 0 {\n\t\t\t\tmWa[nth]++\n\t\t\t}\n\t\t}\n\t}\n\tvar sumAc int\n\tvar sunWa int\n\n\tfor _, v := range mAc {\n\t\tsumAc += v\n\t}\n\n\tfor i, v := range mWa {\n\t\tif mAc[i] == 1 {\n\t\t\tsunWa += v\n\t\t}\n\t}\n\n\tfmt.Println(sumAc, sunWa)\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}\n\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\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}\n\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\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}\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}\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], 64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\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], 64)\n\t}\n\ts.resetCur()\n\treturn res\n}\n\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\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}\n\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\n\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\n\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2686, "cpu_time_ms": 89, "memory_kb": 9344}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s419008296", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype PS struct {\n\tp int\n\ts string\n}\n\nvar buf = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tbuf.Scan()\n\ti, _ := strconv.Atoi(buf.Text())\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor k, _ := range a {\n\t\ta[k] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tbuf.Scan()\n\treturn buf.Text()\n}\n\nfunc main() {\n\tbuf.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tm := scanInt()\n\tps := make([]PS, m)\n\tfor k, _ := range ps {\n\t\tps[k].p = scanInt()\n\t\tps[k].s = scanString()\n\t}\n\n\tacknowledged := make([]int, n)\n\n\tcorrectAnswers := 0\n\tpenalties := 0\n\tfor _, v := range ps {\n\t\tif acknowledged[v.p-1] == 0 {\n\t\t\tif v.s == \"AC\" {\n\t\t\t\tacknowledged[v.p-1] = 1\n\t\t\t\tcorrectAnswers++\n\t\t\t} else {\n\t\t\t\tpenalties++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", correctAnswers, penalties)\n}\n", "language": "Go", "metadata": {"date": 1578967469, "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/s419008296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s419008296", "user_id": "u768135881"}, "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\ntype PS struct {\n\tp int\n\ts string\n}\n\nvar buf = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tbuf.Scan()\n\ti, _ := strconv.Atoi(buf.Text())\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor k, _ := range a {\n\t\ta[k] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tbuf.Scan()\n\treturn buf.Text()\n}\n\nfunc main() {\n\tbuf.Split(bufio.ScanWords)\n\n\tn := scanInt()\n\tm := scanInt()\n\tps := make([]PS, m)\n\tfor k, _ := range ps {\n\t\tps[k].p = scanInt()\n\t\tps[k].s = scanString()\n\t}\n\n\tacknowledged := make([]int, n)\n\n\tcorrectAnswers := 0\n\tpenalties := 0\n\tfor _, v := range ps {\n\t\tif acknowledged[v.p-1] == 0 {\n\t\t\tif v.s == \"AC\" {\n\t\t\t\tacknowledged[v.p-1] = 1\n\t\t\t\tcorrectAnswers++\n\t\t\t} else {\n\t\t\t\tpenalties++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", correctAnswers, penalties)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 33, "memory_kb": 4608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s564304653", "group_id": "codeNet:p02802", "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\t_ = sc.NextInt()\n\tm := sc.NextInt()\n\n\tac := 0\n\twa := 0\n\n\tignore := 0\n\tfor i := 0; i < m; i++ {\n\t\tp := sc.NextInt()\n\t\ts := sc.NextLine()\n\t\tif ignore == p {\n\t\t\tcontinue\n\t\t}\n\t\tif s == \"WA\" {\n\t\t\twa++\n\t\t}\n\t\tif s == \"AC\" {\n\t\t\tac++\n\t\t\tignore = p\n\t\t}\n\t}\n\tfmt.Printf(\"%v %v\\n\", ac, wa)\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": 1578956609, "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/s564304653.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s564304653", "user_id": "u084693263"}, "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//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\t_ = sc.NextInt()\n\tm := sc.NextInt()\n\n\tac := 0\n\twa := 0\n\n\tignore := 0\n\tfor i := 0; i < m; i++ {\n\t\tp := sc.NextInt()\n\t\ts := sc.NextLine()\n\t\tif ignore == p {\n\t\t\tcontinue\n\t\t}\n\t\tif s == \"WA\" {\n\t\t\twa++\n\t\t}\n\t\tif s == \"AC\" {\n\t\t\tac++\n\t\t\tignore = p\n\t\t}\n\t}\n\tfmt.Printf(\"%v %v\\n\", ac, wa)\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 : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1854, "cpu_time_ms": 34, "memory_kb": 2176}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s628987307", "group_id": "codeNet:p02802", "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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn int64(a)\n}\n\nfunc scanFloat() float64 {\n\tsc.Scan()\n\ta, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanTextSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanText()\n\t}\n\treturn a\n}\n\nfunc scanSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanFloatSlice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanFloat()\n\t}\n\treturn a\n}\n\nfunc scanInt64Slice(n int64) []int64 {\n\ta := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\ta[i] = scanInt64()\n\t}\n\treturn a\n}\n\n// var sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tinput := scanSlice(2)\n\tn := input[0]\n\tm := input[1]\n\n\t_ = n\n\n\tmemo := make(map[int][]int)\n\n\tfor i := 0; i < m; i++ {\n\t\ttmp := scanTextSlice(2)\n\t\tp, _ := strconv.Atoi(tmp[0])\n\t\ts := tmp[1]\n\n\t\tif val, ok := memo[p]; ok {\n\t\t\tac := val[0]\n\t\t\t// penalty := val[1]\n\t\t\tif ac > 0 {\n\t\t\t\tcontinue\n\t\t\t} else if ac <= 0 && s == \"WA\" {\n\t\t\t\tmemo[p][1] = memo[p][1] + 1\n\t\t\t} else if ac <= 0 && s == \"AC\" {\n\t\t\t\tmemo[p][0] = 1\n\t\t\t}\n\t\t} else {\n\t\t\tmemo[p] = make([]int, 2)\n\t\t\tif s == \"AC\" {\n\t\t\t\tmemo[p][0] = 1\n\n\t\t\t} else {\n\t\t\t\tmemo[p][1] = 1\n\n\t\t\t}\n\t\t}\n\t}\n\n\tansAC := 0\n\tansWA := 0\n\tfor _, val := range memo {\n\t\tac := val[0]\n\t\tpenalty := val[1]\n\t\tif ac > 0 {\n\t\t\tansAC++\n\t\t}\n\t\tansWA += penalty\n\t}\n\n\tfmt.Println(ansAC, ansWA)\n\n}\n\nfunc binarySearch(arr []int, number int) int {\n\n\tl := -1\n\tr := len(arr)\n\tindex := 0\n\tfor {\n\t\tmid := l + (r-l)/2\n\t\ttmp := arr[mid]\n\n\t\tif r-l <= 1 || tmp == number {\n\t\t\tindex = mid\n\t\t\tbreak\n\t\t} else if tmp < number {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn index\n}\n\nfunc factorial(n int) int64 {\n\tsum := int64(1)\n\tfor i := 2; i <= n; i++ {\n\t\tsum *= int64(i)\n\t}\n\treturn sum\n}\n\nfunc deleteNumOfArray(arr []int, position int) []int {\n\tleft := arr[:position]\n\tr := arr[position+1:]\n\tappendArr := append(left, r...)\n\treturn appendArr\n}\n", "language": "Go", "metadata": {"date": 1578882752, "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/s628987307.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s628987307", "user_id": "u947658937"}, "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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn int64(a)\n}\n\nfunc scanFloat() float64 {\n\tsc.Scan()\n\ta, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc scanTextSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanText()\n\t}\n\treturn a\n}\n\nfunc scanSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanFloatSlice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanFloat()\n\t}\n\treturn a\n}\n\nfunc scanInt64Slice(n int64) []int64 {\n\ta := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\ta[i] = scanInt64()\n\t}\n\treturn a\n}\n\n// var sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tinput := scanSlice(2)\n\tn := input[0]\n\tm := input[1]\n\n\t_ = n\n\n\tmemo := make(map[int][]int)\n\n\tfor i := 0; i < m; i++ {\n\t\ttmp := scanTextSlice(2)\n\t\tp, _ := strconv.Atoi(tmp[0])\n\t\ts := tmp[1]\n\n\t\tif val, ok := memo[p]; ok {\n\t\t\tac := val[0]\n\t\t\t// penalty := val[1]\n\t\t\tif ac > 0 {\n\t\t\t\tcontinue\n\t\t\t} else if ac <= 0 && s == \"WA\" {\n\t\t\t\tmemo[p][1] = memo[p][1] + 1\n\t\t\t} else if ac <= 0 && s == \"AC\" {\n\t\t\t\tmemo[p][0] = 1\n\t\t\t}\n\t\t} else {\n\t\t\tmemo[p] = make([]int, 2)\n\t\t\tif s == \"AC\" {\n\t\t\t\tmemo[p][0] = 1\n\n\t\t\t} else {\n\t\t\t\tmemo[p][1] = 1\n\n\t\t\t}\n\t\t}\n\t}\n\n\tansAC := 0\n\tansWA := 0\n\tfor _, val := range memo {\n\t\tac := val[0]\n\t\tpenalty := val[1]\n\t\tif ac > 0 {\n\t\t\tansAC++\n\t\t}\n\t\tansWA += penalty\n\t}\n\n\tfmt.Println(ansAC, ansWA)\n\n}\n\nfunc binarySearch(arr []int, number int) int {\n\n\tl := -1\n\tr := len(arr)\n\tindex := 0\n\tfor {\n\t\tmid := l + (r-l)/2\n\t\ttmp := arr[mid]\n\n\t\tif r-l <= 1 || tmp == number {\n\t\t\tindex = mid\n\t\t\tbreak\n\t\t} else if tmp < number {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn index\n}\n\nfunc factorial(n int) int64 {\n\tsum := int64(1)\n\tfor i := 2; i <= n; i++ {\n\t\tsum *= int64(i)\n\t}\n\treturn sum\n}\n\nfunc deleteNumOfArray(arr []int, position int) []int {\n\tleft := arr[:position]\n\tr := arr[position+1:]\n\tappendArr := append(left, r...)\n\treturn appendArr\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2358, "cpu_time_ms": 105, "memory_kb": 12288}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218043853", "group_id": "codeNet:p02802", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tpmap := map[int]bool{}\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tvar num, ac, wa int\n\tvar ans string\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&num)\n\t\tfmt.Scan(&ans)\n\t\tval, ok := pmap[num]\n\t\t// まだ AC も WA もしてないとき\n\t\tif !ok {\n\t\t\tif ans == \"AC\" {\n\t\t\t\tpmap[num] = true\n\t\t\t\tac++\n\t\t\t} else {\n\t\t\t\tpmap[num] = false\n\t\t\t\twa++\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// 既に AC または WA してるとき\n\t\tif val {\n\t\t\t// AC 済み\n\t\t\tcontinue\n\t\t}\n\t\t// WA\n\t\tif ans == \"AC\" {\n\t\t\t// 正解した\n\t\t\tpmap[num] = true\n\t\t\tac++\n\t\t} else {\n\t\t\t// ひきつづき不正解\n\t\t\twa++\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ac, wa)\n}\n", "language": "Go", "metadata": {"date": 1578882725, "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/s218043853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s218043853", "user_id": "u737877067"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tpmap := map[int]bool{}\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tvar num, ac, wa int\n\tvar ans string\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&num)\n\t\tfmt.Scan(&ans)\n\t\tval, ok := pmap[num]\n\t\t// まだ AC も WA もしてないとき\n\t\tif !ok {\n\t\t\tif ans == \"AC\" {\n\t\t\t\tpmap[num] = true\n\t\t\t\tac++\n\t\t\t} else {\n\t\t\t\tpmap[num] = false\n\t\t\t\twa++\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\t// 既に AC または WA してるとき\n\t\tif val {\n\t\t\t// AC 済み\n\t\t\tcontinue\n\t\t}\n\t\t// WA\n\t\tif ans == \"AC\" {\n\t\t\t// 正解した\n\t\t\tpmap[num] = true\n\t\t\tac++\n\t\t} else {\n\t\t\t// ひきつづき不正解\n\t\t\twa++\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ac, wa)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 648, "cpu_time_ms": 710, "memory_kb": 7424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s346913932", "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\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc warshallFloyd(n int, d [][]int) {\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\td[i][j] = min(d[i][j], d[i][k] + d[k][j])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tH := readInt()\n\tW := readInt()\n\n\tS := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = readString()\n\t}\n\n\tn := H * W\n\td := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\td[i] = make([]int, n)\n\t\tfillInts(d[i], math.MaxInt32)\n\t\td[i][i] = 0\n\t}\n\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\tif y-1 >= 0 && S[y-1][x] != '#' {\n\t\t\t\td[y*W+x][(y-1)*W+x] = 1\n\t\t\t}\n\t\t\tif y+1 < H && S[y+1][x] != '#' {\n\t\t\t\td[y*W+x][(y+1)*W+x] = 1\n\t\t\t}\n\t\t\tif x-1 >= 0 && S[y][x-1] != '#' {\n\t\t\t\td[y*W+x][y*W+x-1] = 1\n\t\t\t}\n\t\t\tif x+1 < W && S[y][x+1] != '#' {\n\t\t\t\td[y*W+x][y*W+x+1] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\twarshallFloyd(n, d)\n\n\tresult := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif d[i][j] < math.MaxInt32 && d[i][j] > result {\n\t\t\t\tresult = d[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\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\nfunc fillInts(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": 1579659769, "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/s346913932.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s346913932", "user_id": "u347640436"}, "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\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc warshallFloyd(n int, d [][]int) {\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\td[i][j] = min(d[i][j], d[i][k] + d[k][j])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tH := readInt()\n\tW := readInt()\n\n\tS := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = readString()\n\t}\n\n\tn := H * W\n\td := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\td[i] = make([]int, n)\n\t\tfillInts(d[i], math.MaxInt32)\n\t\td[i][i] = 0\n\t}\n\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\tif y-1 >= 0 && S[y-1][x] != '#' {\n\t\t\t\td[y*W+x][(y-1)*W+x] = 1\n\t\t\t}\n\t\t\tif y+1 < H && S[y+1][x] != '#' {\n\t\t\t\td[y*W+x][(y+1)*W+x] = 1\n\t\t\t}\n\t\t\tif x-1 >= 0 && S[y][x-1] != '#' {\n\t\t\t\td[y*W+x][y*W+x-1] = 1\n\t\t\t}\n\t\t\tif x+1 < W && S[y][x+1] != '#' {\n\t\t\t\td[y*W+x][y*W+x+1] = 1\n\t\t\t}\n\t\t}\n\t}\n\n\twarshallFloyd(n, d)\n\n\tresult := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif d[i][j] < math.MaxInt32 && d[i][j] > result {\n\t\t\t\tresult = d[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\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\nfunc fillInts(a []int, x int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = x\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1657, "cpu_time_ms": 285, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s310644814", "group_id": "codeNet:p02804", "input_text": "// フェルマーの小定理\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tm = 1000000007\n)\n\nvar (\n\tfac []int\n)\n\nfunc mpow(x int, n int) int {\n\tresult := 1\n\tfor n != 0 {\n\t\tif n&1 == 1 {\n\t\t\tresult *= x\n\t\t\tresult %= m\n\t\t}\n\t\tx *= x\n\t\tx %= m\n\t\tn >>= 1\n\t}\n\treturn result\n}\n\nfunc mcomb(n int, k int) int {\n\tif n == 0 && k == 0 {\n\t\treturn 1\n\t}\n\tif n < k || k < 0 {\n\t\treturn 0\n\t}\n\treturn (fac[n] * mpow(fac[n-k], m-2) % m) * mpow(fac[k], m-2) % m\n}\n\nfunc main() {\n\tN := readInt()\n\tK := readInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\n\tfac = make([]int, N+1)\n\tfac[0] = 1\n\tfor i := 0; i < N; i++ {\n\t\tfac[i+1] = fac[i] * (i + 1) % m\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tresult := 0\n\tfor i := 0; i < N-K+1; i++ {\n\t\tresult += A[i] * mcomb(N-(i+1), K-1)\n\t\tresult %= m\n\t}\n\n\tsort.Ints(A)\n\tt := 0\n\tfor i := 0; i < N-K+1; i++ {\n\t\tt += A[i] * mcomb(N-(i+1), K-1)\n\t\tt %= m\n\t}\n\n\tresult += m - t\n\tresult %= m\n\tfmt.Println(result)\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", "language": "Go", "metadata": {"date": 1592743962, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s310644814.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s310644814", "user_id": "u347640436"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "// フェルマーの小定理\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tm = 1000000007\n)\n\nvar (\n\tfac []int\n)\n\nfunc mpow(x int, n int) int {\n\tresult := 1\n\tfor n != 0 {\n\t\tif n&1 == 1 {\n\t\t\tresult *= x\n\t\t\tresult %= m\n\t\t}\n\t\tx *= x\n\t\tx %= m\n\t\tn >>= 1\n\t}\n\treturn result\n}\n\nfunc mcomb(n int, k int) int {\n\tif n == 0 && k == 0 {\n\t\treturn 1\n\t}\n\tif n < k || k < 0 {\n\t\treturn 0\n\t}\n\treturn (fac[n] * mpow(fac[n-k], m-2) % m) * mpow(fac[k], m-2) % m\n}\n\nfunc main() {\n\tN := readInt()\n\tK := readInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\n\tfac = make([]int, N+1)\n\tfac[0] = 1\n\tfor i := 0; i < N; i++ {\n\t\tfac[i+1] = fac[i] * (i + 1) % m\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tresult := 0\n\tfor i := 0; i < N-K+1; i++ {\n\t\tresult += A[i] * mcomb(N-(i+1), K-1)\n\t\tresult %= m\n\t}\n\n\tsort.Ints(A)\n\tt := 0\n\tfor i := 0; i < N-K+1; i++ {\n\t\tt += A[i] * mcomb(N-(i+1), K-1)\n\t\tt %= m\n\t}\n\n\tresult += m - t\n\tresult %= m\n\tfmt.Println(result)\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 79, "memory_kb": 6212}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s271455331", "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\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\tx := make([]int, n)\n\ty := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tx[i] = iScan()\n\t\ty[i] = iScan()\n\t}\n\tng, ok := 0., 1000000.\n\tfor ok-ng > 1e-16 {\n\t\tmed := (ok + ng) / 2.\n\t\tf := true\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i; j < n; j++ {\n\t\t\t\tz := math.Pow(float64((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])), 0.5)\n\t\t\t\tif z > med {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif f {\n\t\t\tok = med\n\t\t} else {\n\t\t\tng = med\n\t\t}\n\t}\n\tfmt.Println(ok / 2)\n}\n", "language": "Go", "metadata": {"date": 1596585958, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s271455331.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s271455331", "user_id": "u843722521"}, "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\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\tx := make([]int, n)\n\ty := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tx[i] = iScan()\n\t\ty[i] = iScan()\n\t}\n\tng, ok := 0., 1000000.\n\tfor ok-ng > 1e-16 {\n\t\tmed := (ok + ng) / 2.\n\t\tf := true\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i; j < n; j++ {\n\t\t\t\tz := math.Pow(float64((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])), 0.5)\n\t\t\t\tif z > med {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif f {\n\t\t\tok = med\n\t\t} else {\n\t\t\tng = med\n\t\t}\n\t}\n\tfmt.Println(ok / 2)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1666, "cpu_time_ms": 2205, "memory_kb": 1804}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s737695052", "group_id": "codeNet:p02805", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc151/tasks/abc151_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\"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\tX, Y []float64\n)\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n; i++ {\n\t\tx, y := ReadInt2()\n\t\txf, yf := float64(x), float64(y)\n\t\tX = append(X, xf)\n\t\tY = append(Y, yf)\n\t}\n\n\t// res := calcTwoIntersections(0.0, 0.0, 4.0, 0.0, 1.0)\n\t// PrintfDebug(\"%v\\n\", res)\n\t// res = calcTwoIntersections(0.0, 0.0, 2.0, 2.0, 1.414)\n\t// PrintfDebug(\"%v\\n\", res)\n\n\tans := BinarySearch(10000000.0, 0.0, func(r float64) bool {\n\t\tA := [][2]float64{}\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tx1, y1, x2, y2 := X[i], Y[i], X[j], Y[j]\n\n\t\t\t\t// 2点間の距離\n\t\t\t\t// d := math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n\t\t\t\td := Distance(x1, y1, x2, y2)\n\t\t\t\tif d > 2.0*r {\n\t\t\t\t\t// 2円は交点を生じない\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 2点の中点と、交点との距離\n\t\t\t\th := calcH(d, r)\n\n\t\t\t\t// 2点間のベクトル\n\t\t\t\tdx := x1 - x2\n\t\t\t\tdy := y1 - y2\n\n\t\t\t\t// 単位ベクトル化\n\t\t\t\t// dist := math.Sqrt(dx*dx + dy*dy)\n\t\t\t\t// dx /= dist\n\t\t\t\t// dy /= dist\n\t\t\t\tdx, dy = UnitVector(dx, dy)\n\n\t\t\t\t// 90度回転\n\t\t\t\t// dx, dy = -dy, dx\n\t\t\t\t// 手法1\n\t\t\t\t// dx, dy = Rotate90(dx, dy)\n\t\t\t\t// 手法2\n\t\t\t\t// dx, dy = RotateN(dx, dy, math.Pi/2.0)\n\t\t\t\t// 手法3\n\t\t\t\tdx, dy = RotateN(dx, dy, math.Pi/4.0)\n\t\t\t\tdx, dy = RotateN(dx, dy, math.Pi/4.0)\n\n\t\t\t\t// 中点の座標\n\t\t\t\tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n\n\t\t\t\t// 交点を2つ求める\n\t\t\t\tx3, y3 := mx+h*dx, my+h*dy\n\t\t\t\tx4, y4 := mx-h*dx, my-h*dy\n\n\t\t\t\t// Aに追加\n\t\t\t\tA = append(A, [2]float64{x3, y3})\n\t\t\t\tA = append(A, [2]float64{x4, y4})\n\t\t\t}\n\t\t}\n\n\t\tfor _, P := range A {\n\t\t\tcx, cy := P[0], P[1]\n\t\t\tnum := 0\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tx, y := X[i], Y[i]\n\t\t\t\tdist := math.Sqrt((cx-x)*(cx-x) + (cy-y)*(cy-y))\n\t\t\t\t// 交点を作る2円を確実に含めるように微小値を加える\n\t\t\t\tif dist <= (r + 0.0000001) {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif num >= n {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\n\tfmt.Println(ans)\n}\n\nfunc Distance(x1, y1, x2, y2 float64) float64 {\n\treturn math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n}\n\nfunc UnitVector(dx, dy float64) (ex, ey float64) {\n\tdist := math.Sqrt(dx*dx + dy*dy)\n\treturn dx / dist, dy / dist\n}\n\nfunc Rotate90(cx, cy float64) (nx, ny float64) {\n\treturn -cy, cx\n}\n\nfunc RotateN(cx, cy, radi float64) (nx, ny float64) {\n\tnx = math.Cos(radi)*cx - math.Sin(radi)*cy\n\tny = math.Sin(radi)*cx + math.Cos(radi)*cy\n\treturn nx, ny\n}\n\nfunc calcH(d, r float64) float64 {\n\treturn math.Sqrt(r*r - (d/2.0)*(d/2.0))\n}\n\n// func calcTwoIntersections(x1, y1, x2, y2, h float64) [][2]float64 {\n// \t// 2点間のベクトル\n// \tdx := x1 - x2\n// \tdy := y1 - y2\n// \t// 単位ベクトル化\n// \tdist := math.Sqrt(dx*dx + dy*dy)\n// \tdx /= dist\n// \tdy /= dist\n// \t// 90度回転\n// \tdx, dy = -dy, dx\n// \t// 中点の座標\n// \tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n// \t// 交点を2つ求める\n// \tx3, y3 := mx+h*dx, my+h*dy\n// \tx4, y4 := mx-h*dx, my-h*dy\n\n// \treturn [][2]float64{\n// \t\t[2]float64{x3, y3}, [2]float64{x4, y4},\n// \t}\n// }\n\nfunc BinarySearch(initOK, initNG float64, isOK func(mid float64) bool) (ok float64) {\n\tng := initNG\n\tok = initOK\n\t// for int(math.Abs(float64(ok-ng))) > 1 {\n\tfor i := 0; i < 50; i++ {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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": 1595708438, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s737695052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s737695052", "user_id": "u103600314"}, "prompt_components": {"gold_output": "0.500000000000000000\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc151/tasks/abc151_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\"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\tX, Y []float64\n)\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n; i++ {\n\t\tx, y := ReadInt2()\n\t\txf, yf := float64(x), float64(y)\n\t\tX = append(X, xf)\n\t\tY = append(Y, yf)\n\t}\n\n\t// res := calcTwoIntersections(0.0, 0.0, 4.0, 0.0, 1.0)\n\t// PrintfDebug(\"%v\\n\", res)\n\t// res = calcTwoIntersections(0.0, 0.0, 2.0, 2.0, 1.414)\n\t// PrintfDebug(\"%v\\n\", res)\n\n\tans := BinarySearch(10000000.0, 0.0, func(r float64) bool {\n\t\tA := [][2]float64{}\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tx1, y1, x2, y2 := X[i], Y[i], X[j], Y[j]\n\n\t\t\t\t// 2点間の距離\n\t\t\t\t// d := math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n\t\t\t\td := Distance(x1, y1, x2, y2)\n\t\t\t\tif d > 2.0*r {\n\t\t\t\t\t// 2円は交点を生じない\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 2点の中点と、交点との距離\n\t\t\t\th := calcH(d, r)\n\n\t\t\t\t// 2点間のベクトル\n\t\t\t\tdx := x1 - x2\n\t\t\t\tdy := y1 - y2\n\n\t\t\t\t// 単位ベクトル化\n\t\t\t\t// dist := math.Sqrt(dx*dx + dy*dy)\n\t\t\t\t// dx /= dist\n\t\t\t\t// dy /= dist\n\t\t\t\tdx, dy = UnitVector(dx, dy)\n\n\t\t\t\t// 90度回転\n\t\t\t\t// dx, dy = -dy, dx\n\t\t\t\t// 手法1\n\t\t\t\t// dx, dy = Rotate90(dx, dy)\n\t\t\t\t// 手法2\n\t\t\t\t// dx, dy = RotateN(dx, dy, math.Pi/2.0)\n\t\t\t\t// 手法3\n\t\t\t\tdx, dy = RotateN(dx, dy, math.Pi/4.0)\n\t\t\t\tdx, dy = RotateN(dx, dy, math.Pi/4.0)\n\n\t\t\t\t// 中点の座標\n\t\t\t\tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n\n\t\t\t\t// 交点を2つ求める\n\t\t\t\tx3, y3 := mx+h*dx, my+h*dy\n\t\t\t\tx4, y4 := mx-h*dx, my-h*dy\n\n\t\t\t\t// Aに追加\n\t\t\t\tA = append(A, [2]float64{x3, y3})\n\t\t\t\tA = append(A, [2]float64{x4, y4})\n\t\t\t}\n\t\t}\n\n\t\tfor _, P := range A {\n\t\t\tcx, cy := P[0], P[1]\n\t\t\tnum := 0\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tx, y := X[i], Y[i]\n\t\t\t\tdist := math.Sqrt((cx-x)*(cx-x) + (cy-y)*(cy-y))\n\t\t\t\t// 交点を作る2円を確実に含めるように微小値を加える\n\t\t\t\tif dist <= (r + 0.0000001) {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif num >= n {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\n\tfmt.Println(ans)\n}\n\nfunc Distance(x1, y1, x2, y2 float64) float64 {\n\treturn math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n}\n\nfunc UnitVector(dx, dy float64) (ex, ey float64) {\n\tdist := math.Sqrt(dx*dx + dy*dy)\n\treturn dx / dist, dy / dist\n}\n\nfunc Rotate90(cx, cy float64) (nx, ny float64) {\n\treturn -cy, cx\n}\n\nfunc RotateN(cx, cy, radi float64) (nx, ny float64) {\n\tnx = math.Cos(radi)*cx - math.Sin(radi)*cy\n\tny = math.Sin(radi)*cx + math.Cos(radi)*cy\n\treturn nx, ny\n}\n\nfunc calcH(d, r float64) float64 {\n\treturn math.Sqrt(r*r - (d/2.0)*(d/2.0))\n}\n\n// func calcTwoIntersections(x1, y1, x2, y2, h float64) [][2]float64 {\n// \t// 2点間のベクトル\n// \tdx := x1 - x2\n// \tdy := y1 - y2\n// \t// 単位ベクトル化\n// \tdist := math.Sqrt(dx*dx + dy*dy)\n// \tdx /= dist\n// \tdy /= dist\n// \t// 90度回転\n// \tdx, dy = -dy, dx\n// \t// 中点の座標\n// \tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n// \t// 交点を2つ求める\n// \tx3, y3 := mx+h*dx, my+h*dy\n// \tx4, y4 := mx-h*dx, my-h*dy\n\n// \treturn [][2]float64{\n// \t\t[2]float64{x3, y3}, [2]float64{x4, y4},\n// \t}\n// }\n\nfunc BinarySearch(initOK, initNG float64, isOK func(mid float64) bool) (ok float64) {\n\tng := initNG\n\tok = initOK\n\t// for int(math.Abs(float64(ok-ng))) > 1 {\n\tfor i := 0; i < 50; i++ {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8212, "cpu_time_ms": 40, "memory_kb": 6088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s457330960", "group_id": "codeNet:p02805", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc151/tasks/abc151_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\"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\tX, Y []float64\n)\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n; i++ {\n\t\tx, y := ReadInt2()\n\t\txf, yf := float64(x), float64(y)\n\t\tX = append(X, xf)\n\t\tY = append(Y, yf)\n\t}\n\n\t// res := calcTwoIntersections(0.0, 0.0, 4.0, 0.0, 1.0)\n\t// PrintfDebug(\"%v\\n\", res)\n\t// res = calcTwoIntersections(0.0, 0.0, 2.0, 2.0, 1.414)\n\t// PrintfDebug(\"%v\\n\", res)\n\n\tans := BinarySearch(10000000.0, 0.0, func(r float64) bool {\n\t\tA := [][2]float64{}\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tx1, y1, x2, y2 := X[i], Y[i], X[j], Y[j]\n\n\t\t\t\t// 2点間の距離\n\t\t\t\t// d := math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n\t\t\t\td := Distance(x1, y1, x2, y2)\n\t\t\t\tif d > 2.0*r {\n\t\t\t\t\t// 2円は交点を生じない\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 2点の中点と、交点との距離\n\t\t\t\th := calcH(d, r)\n\n\t\t\t\t// 2点間のベクトル\n\t\t\t\tdx := x1 - x2\n\t\t\t\tdy := y1 - y2\n\t\t\t\t// 単位ベクトル化\n\t\t\t\tdist := math.Sqrt(dx*dx + dy*dy)\n\t\t\t\tdx /= dist\n\t\t\t\tdy /= dist\n\t\t\t\t// 90度回転\n\t\t\t\tdx, dy = -dy, dx\n\t\t\t\t// 中点の座標\n\t\t\t\tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n\t\t\t\t// 交点を2つ求める\n\t\t\t\tx3, y3 := mx+h*dx, my+h*dy\n\t\t\t\tx4, y4 := mx-h*dx, my-h*dy\n\t\t\t\t// Aに追加\n\t\t\t\tA = append(A, [2]float64{x3, y3})\n\t\t\t\tA = append(A, [2]float64{x4, y4})\n\t\t\t}\n\t\t}\n\n\t\tfor _, P := range A {\n\t\t\tcx, cy := P[0], P[1]\n\t\t\tnum := 0\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tx, y := X[i], Y[i]\n\t\t\t\tdist := math.Sqrt((cx-x)*(cx-x) + (cy-y)*(cy-y))\n\t\t\t\t// 交点を作る2円を確実に含めるように微小値を加える\n\t\t\t\tif dist <= (r + 0.0000001) {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif num >= n {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\n\tfmt.Println(ans)\n}\n\nfunc Distance(x1, y1, x2, y2 float64) float64 {\n\treturn math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n}\n\nfunc calcH(d, r float64) float64 {\n\treturn math.Sqrt(r*r - (d/2.0)*(d/2.0))\n}\n\n// func calcTwoIntersections(x1, y1, x2, y2, h float64) [][2]float64 {\n// \t// 2点間のベクトル\n// \tdx := x1 - x2\n// \tdy := y1 - y2\n// \t// 単位ベクトル化\n// \tdist := math.Sqrt(dx*dx + dy*dy)\n// \tdx /= dist\n// \tdy /= dist\n// \t// 90度回転\n// \tdx, dy = -dy, dx\n// \t// 中点の座標\n// \tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n// \t// 交点を2つ求める\n// \tx3, y3 := mx+h*dx, my+h*dy\n// \tx4, y4 := mx-h*dx, my-h*dy\n\n// \treturn [][2]float64{\n// \t\t[2]float64{x3, y3}, [2]float64{x4, y4},\n// \t}\n// }\n\nfunc BinarySearch(initOK, initNG float64, isOK func(mid float64) bool) (ok float64) {\n\tng := initNG\n\tok = initOK\n\t// for int(math.Abs(float64(ok-ng))) > 1 {\n\tfor i := 0; i < 50; i++ {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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": 1595707751, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s457330960.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s457330960", "user_id": "u103600314"}, "prompt_components": {"gold_output": "0.500000000000000000\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc151/tasks/abc151_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\"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\tX, Y []float64\n)\n\nfunc main() {\n\tn = ReadInt()\n\tfor i := 0; i < n; i++ {\n\t\tx, y := ReadInt2()\n\t\txf, yf := float64(x), float64(y)\n\t\tX = append(X, xf)\n\t\tY = append(Y, yf)\n\t}\n\n\t// res := calcTwoIntersections(0.0, 0.0, 4.0, 0.0, 1.0)\n\t// PrintfDebug(\"%v\\n\", res)\n\t// res = calcTwoIntersections(0.0, 0.0, 2.0, 2.0, 1.414)\n\t// PrintfDebug(\"%v\\n\", res)\n\n\tans := BinarySearch(10000000.0, 0.0, func(r float64) bool {\n\t\tA := [][2]float64{}\n\t\tfor i := 0; i < n; i++ {\n\t\t\tfor j := i + 1; j < n; j++ {\n\t\t\t\tx1, y1, x2, y2 := X[i], Y[i], X[j], Y[j]\n\n\t\t\t\t// 2点間の距離\n\t\t\t\t// d := math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n\t\t\t\td := Distance(x1, y1, x2, y2)\n\t\t\t\tif d > 2.0*r {\n\t\t\t\t\t// 2円は交点を生じない\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\t// 2点の中点と、交点との距離\n\t\t\t\th := calcH(d, r)\n\n\t\t\t\t// 2点間のベクトル\n\t\t\t\tdx := x1 - x2\n\t\t\t\tdy := y1 - y2\n\t\t\t\t// 単位ベクトル化\n\t\t\t\tdist := math.Sqrt(dx*dx + dy*dy)\n\t\t\t\tdx /= dist\n\t\t\t\tdy /= dist\n\t\t\t\t// 90度回転\n\t\t\t\tdx, dy = -dy, dx\n\t\t\t\t// 中点の座標\n\t\t\t\tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n\t\t\t\t// 交点を2つ求める\n\t\t\t\tx3, y3 := mx+h*dx, my+h*dy\n\t\t\t\tx4, y4 := mx-h*dx, my-h*dy\n\t\t\t\t// Aに追加\n\t\t\t\tA = append(A, [2]float64{x3, y3})\n\t\t\t\tA = append(A, [2]float64{x4, y4})\n\t\t\t}\n\t\t}\n\n\t\tfor _, P := range A {\n\t\t\tcx, cy := P[0], P[1]\n\t\t\tnum := 0\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tx, y := X[i], Y[i]\n\t\t\t\tdist := math.Sqrt((cx-x)*(cx-x) + (cy-y)*(cy-y))\n\t\t\t\t// 交点を作る2円を確実に含めるように微小値を加える\n\t\t\t\tif dist <= (r + 0.0000001) {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif num >= n {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n\n\tfmt.Println(ans)\n}\n\nfunc Distance(x1, y1, x2, y2 float64) float64 {\n\treturn math.Sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n}\n\nfunc calcH(d, r float64) float64 {\n\treturn math.Sqrt(r*r - (d/2.0)*(d/2.0))\n}\n\n// func calcTwoIntersections(x1, y1, x2, y2, h float64) [][2]float64 {\n// \t// 2点間のベクトル\n// \tdx := x1 - x2\n// \tdy := y1 - y2\n// \t// 単位ベクトル化\n// \tdist := math.Sqrt(dx*dx + dy*dy)\n// \tdx /= dist\n// \tdy /= dist\n// \t// 90度回転\n// \tdx, dy = -dy, dx\n// \t// 中点の座標\n// \tmx, my := (x1+x2)/2.0, (y1+y2)/2.0\n// \t// 交点を2つ求める\n// \tx3, y3 := mx+h*dx, my+h*dy\n// \tx4, y4 := mx-h*dx, my-h*dy\n\n// \treturn [][2]float64{\n// \t\t[2]float64{x3, y3}, [2]float64{x4, y4},\n// \t}\n// }\n\nfunc BinarySearch(initOK, initNG float64, isOK func(mid float64) bool) (ok float64) {\n\tng := initNG\n\tok = initOK\n\t// for int(math.Abs(float64(ok-ng))) > 1 {\n\tfor i := 0; i < 50; i++ {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7611, "cpu_time_ms": 33, "memory_kb": 6092}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s648791600", "group_id": "codeNet:p02805", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Dist(A, B *[]float64) float64 {\n D := 0.0\n for i, a := range (*A) {\n x := (*B)[i] - a\n D += x * x\n }\n return math.Sqrt(D)\n}\nfunc CrossPoint(A, B *[]float64, R float64) []*[]float64 {\n AB := Dist(A, B)\n C := math.Sqrt(4.0 * R * R / (AB * AB) - 1)\n x1 := (((*A)[0] + (*B)[0]) + ((*A)[1] - (*B)[1]) * C) / 2.0\n y1 := (((*A)[1] + (*B)[1]) - ((*A)[0] - (*B)[0]) * C) / 2.0\n x2 := (((*A)[0] + (*B)[0]) - ((*A)[1] - (*B)[1]) * C) / 2.0\n y2 := (((*A)[1] + (*B)[1]) + ((*A)[0] - (*B)[0]) * C) / 2.0\n p1 := []float64{x1, y1}\n p2 := []float64{x2, y2}\n return []*[]float64{&p1, &p2}\n}\n\nfunc main() {\n N := NextInt()\n P := make([]*[]float64, N)\n for i := range P {\n p := NextFloatVec()\n P[i] = &p\n }\n D := make([][]float64, N)\n for i := range D {\n D[i] = make([]float64, N)\n for j := range D[i] {\n D[i][j] = Dist(P[i], P[j])\n }\n }\n R := math.Sqrt(2.0 * 500.0 * 500.0)\n r := 0.0\n diff := float64(1e-7)\n for diff < R - r {\n _r := (R + r) / 2.0\n Include := 0\n for i := 0; i < N - 1 && Include == 0; i++ {\n for j := i + 1; j < N && Include == 0 ; j++ {\n if 2.0 * _r < D[i][j] {\n Include = -1\n break\n }\n CP := CrossPoint(P[i], P[j], _r)\n if D[i][j] < _r {\n CP = append(CP, []*[]float64{P[i], P[j]}...)\n }\n for _, cp := range CP {\n inc := true\n for _, p := range P {\n if _r + diff < Dist(p, cp) {\n inc = false\n break\n }\n }\n if inc {\n Include = 1\n break\n }\n }\n }\n }\n if Include < 1 {\n r = _r\n } else {\n R = _r\n }\n }\n Write(R)\n Output()\n}\n", "language": "Go", "metadata": {"date": 1578963583, "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/s648791600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s648791600", "user_id": "u415905784"}, "prompt_components": {"gold_output": "0.500000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Dist(A, B *[]float64) float64 {\n D := 0.0\n for i, a := range (*A) {\n x := (*B)[i] - a\n D += x * x\n }\n return math.Sqrt(D)\n}\nfunc CrossPoint(A, B *[]float64, R float64) []*[]float64 {\n AB := Dist(A, B)\n C := math.Sqrt(4.0 * R * R / (AB * AB) - 1)\n x1 := (((*A)[0] + (*B)[0]) + ((*A)[1] - (*B)[1]) * C) / 2.0\n y1 := (((*A)[1] + (*B)[1]) - ((*A)[0] - (*B)[0]) * C) / 2.0\n x2 := (((*A)[0] + (*B)[0]) - ((*A)[1] - (*B)[1]) * C) / 2.0\n y2 := (((*A)[1] + (*B)[1]) + ((*A)[0] - (*B)[0]) * C) / 2.0\n p1 := []float64{x1, y1}\n p2 := []float64{x2, y2}\n return []*[]float64{&p1, &p2}\n}\n\nfunc main() {\n N := NextInt()\n P := make([]*[]float64, N)\n for i := range P {\n p := NextFloatVec()\n P[i] = &p\n }\n D := make([][]float64, N)\n for i := range D {\n D[i] = make([]float64, N)\n for j := range D[i] {\n D[i][j] = Dist(P[i], P[j])\n }\n }\n R := math.Sqrt(2.0 * 500.0 * 500.0)\n r := 0.0\n diff := float64(1e-7)\n for diff < R - r {\n _r := (R + r) / 2.0\n Include := 0\n for i := 0; i < N - 1 && Include == 0; i++ {\n for j := i + 1; j < N && Include == 0 ; j++ {\n if 2.0 * _r < D[i][j] {\n Include = -1\n break\n }\n CP := CrossPoint(P[i], P[j], _r)\n if D[i][j] < _r {\n CP = append(CP, []*[]float64{P[i], P[j]}...)\n }\n for _, cp := range CP {\n inc := true\n for _, p := range P {\n if _r + diff < Dist(p, cp) {\n inc = false\n break\n }\n }\n if inc {\n Include = 1\n break\n }\n }\n }\n }\n if Include < 1 {\n r = _r\n } else {\n R = _r\n }\n }\n Write(R)\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 23, "memory_kb": 3712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s095929024", "group_id": "codeNet:p02806", "input_text": "package main\n\nimport \"fmt\"\n\ntype music struct {\n\tName string\n\tTime int\n}\n\nfunc (m music) Is(s string) bool {\n\treturn s == m.Name\n}\n\nfunc main() {\n\tvar (\n\t\tplaylist []music\n\t)\n\tvar n int\n\tfmt.Scan(&n)\n\tplaylist = make([]music, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&playlist[i].Name)\n\t\tfmt.Scan(&playlist[i].Time)\n\t}\n\tvar x string\n\tfmt.Scan(&x)\n\tvar flag bool\n\tall := 0\n\tfor i := 0; i < n; i++ {\n\t\tif flag {\n\t\t\tall += playlist[i].Time\n\t\t\tcontinue\n\t\t}\n\t\tflag = playlist[i].Is(x)\n\t}\n\tfmt.Println(all)\n}\n", "language": "Go", "metadata": {"date": 1578792838, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02806.html", "problem_id": "p02806", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02806/input.txt", "sample_output_relpath": "derived/input_output/data/p02806/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02806/Go/s095929024.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s095929024", "user_id": "u564244597"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype music struct {\n\tName string\n\tTime int\n}\n\nfunc (m music) Is(s string) bool {\n\treturn s == m.Name\n}\n\nfunc main() {\n\tvar (\n\t\tplaylist []music\n\t)\n\tvar n int\n\tfmt.Scan(&n)\n\tplaylist = make([]music, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&playlist[i].Name)\n\t\tfmt.Scan(&playlist[i].Time)\n\t}\n\tvar x string\n\tfmt.Scan(&x)\n\tvar flag bool\n\tall := 0\n\tfor i := 0; i < n; i++ {\n\t\tif flag {\n\t\t\tall += playlist[i].Time\n\t\t\tcontinue\n\t\t}\n\t\tflag = playlist[i].Is(x)\n\t}\n\tfmt.Println(all)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "sample_input": "3\ndwango 2\nsixth 5\nprelims 25\ndwango\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02806", "source_text": "Score : 200 points\n\nProblem Statement\n\nNiwango created a playlist of N songs.\nThe title and the duration of the i-th song are s_i and t_i seconds, respectively.\nIt is guaranteed that s_1,\\ldots,s_N are all distinct.\n\nNiwango was doing some work while playing this playlist. (That is, all the songs were played once, in the order they appear in the playlist, without any pause in between.)\nHowever, he fell asleep during his work, and he woke up after all the songs were played.\nAccording to his record, it turned out that he fell asleep at the very end of the song titled X.\n\nFind the duration of time when some song was played while Niwango was asleep.\n\nConstraints\n\n1 \\leq N \\leq 50\n\ns_i and X are strings of length between 1 and 100 (inclusive) consisting of lowercase English letters.\n\ns_1,\\ldots,s_N are distinct.\n\nThere exists an integer i such that s_i = X.\n\n1 \\leq t_i \\leq 1000\n\nt_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1 t_1\n\\vdots\ns_{N} t_N\nX\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\ndwango 2\nsixth 5\nprelims 25\ndwango\n\nSample Output 1\n\n30\n\nWhile Niwango was asleep, two songs were played: sixth and prelims.\n\nThe answer is the total duration of these songs, 30.\n\nSample Input 2\n\n1\nabcde 1000\nabcde\n\nSample Output 2\n\n0\n\nNo songs were played while Niwango was asleep.\n\nIn such a case, the total duration of songs is 0.\n\nSample Input 3\n\n15\nypnxn 279\nkgjgwx 464\nqquhuwq 327\nrxing 549\npmuduhznoaqu 832\ndagktgdarveusju 595\nwunfagppcoi 200\ndhavrncwfw 720\njpcmigg 658\nwrczqxycivdqn 639\nmcmkkbnjfeod 992\nhtqvkgkbhtytsz 130\ntwflegsjz 467\ndswxxrxuzzfhkp 989\nszfwtzfpnscgue 958\npmuduhznoaqu\n\nSample Output 3\n\n6348", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 502, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s740518947", "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\taflag := false\n\tbflag := false\n\tcflag := false\n\tvar cnt int\n\tfor _, v := range strings.Split(S, \"\") {\n\t\tif v == \"A\" && !aflag && !bflag && !cflag {\n\t\t\taflag = true\n\t\t} else if v == \"B\" && aflag {\n\t\t\tbflag = true\n\t\t\taflag = false\n\t\t} else if v == \"C\" && bflag {\n\t\t\tcflag = true\n\t\t\tbflag = false\n\t\t} else {\n\t\t\taflag = false\n\t\t\tbflag = false\n\t\t\tcflag = false\n\t\t}\n\t\tif cflag {\n\t\t\tcnt++\n\t\t\taflag = false\n\t\t\tbflag = false\n\t\t\tcflag = false\n\t\t}\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": 1582951031, "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/s740518947.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s740518947", "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\taflag := false\n\tbflag := false\n\tcflag := false\n\tvar cnt int\n\tfor _, v := range strings.Split(S, \"\") {\n\t\tif v == \"A\" && !aflag && !bflag && !cflag {\n\t\t\taflag = true\n\t\t} else if v == \"B\" && aflag {\n\t\t\tbflag = true\n\t\t\taflag = false\n\t\t} else if v == \"C\" && bflag {\n\t\t\tcflag = true\n\t\t\tbflag = false\n\t\t} else {\n\t\t\taflag = false\n\t\t\tbflag = false\n\t\t\tcflag = false\n\t\t}\n\t\tif cflag {\n\t\t\tcnt++\n\t\t\taflag = false\n\t\t\tbflag = false\n\t\t\tcflag = false\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s182266108", "group_id": "codeNet:p02812", "input_text": "package main\n \nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n \nfunc main() {\n\tvar wordCount int\n var abcTestStr string\n\tfmt.Scanf(\"%d\", &wordCount)\n\tfmt.Scanf(\"%s\", &abcTestStr)\n\n\tvar sLength = len([]byte(abcTestStr))\n\tif(sLength < 3 || 50 < sLength) {\n panic(\"allow length 1 to 50\")\n }\n\tif(sLength != wordCount) {\n panic(\"allow length wordCount\")\n }\n\tupperCaseAtoZRep := regexp.MustCompile(`^[A-Z]*`)\n\tif(!upperCaseAtoZRep.MatchString(abcTestStr)) {\n\t\tpanic(\"allow AtoZ only\")\n\t}\n splitAtoZRep := regexp.MustCompile(`ABC`)\n result := splitAtoZRep.FindAllStringSubmatch(abcTestStr, -1) \n\tfmt.Printf(\"%d\", len(result))\n}\n", "language": "Go", "metadata": {"date": 1578789406, "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/s182266108.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s182266108", "user_id": "u706523346"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n \nfunc main() {\n\tvar wordCount int\n var abcTestStr string\n\tfmt.Scanf(\"%d\", &wordCount)\n\tfmt.Scanf(\"%s\", &abcTestStr)\n\n\tvar sLength = len([]byte(abcTestStr))\n\tif(sLength < 3 || 50 < sLength) {\n panic(\"allow length 1 to 50\")\n }\n\tif(sLength != wordCount) {\n panic(\"allow length wordCount\")\n }\n\tupperCaseAtoZRep := regexp.MustCompile(`^[A-Z]*`)\n\tif(!upperCaseAtoZRep.MatchString(abcTestStr)) {\n\t\tpanic(\"allow AtoZ only\")\n\t}\n splitAtoZRep := regexp.MustCompile(`ABC`)\n result := splitAtoZRep.FindAllStringSubmatch(abcTestStr, -1) \n\tfmt.Printf(\"%d\", len(result))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 632, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s556759754", "group_id": "codeNet:p02812", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\t// 読み込み数取得\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcount := 0\n\n\tfor i := 0; i < (n - 2); i++ {\n\t\tif s[i:(i+3)] == \"ABC\" {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", count)\n\n}\n", "language": "Go", "metadata": {"date": 1578710111, "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/s556759754.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s556759754", "user_id": "u850393463"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\t// 読み込み数取得\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcount := 0\n\n\tfor i := 0; i < (n - 2); i++ {\n\t\tif s[i:(i+3)] == \"ABC\" {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", count)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s729405240", "group_id": "codeNet:p02813", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readI()\n\tP, Q := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tP[i] = readI()\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tQ[i] = readI()\n\t}\n\n\tif isLager(P, Q) {\n\t\tP, Q = Q, P\n\t}\n\n\ti := 0\n\tfor ; !isSame(P, Q); i++ {\n\t\tnextPermutation(P)\n\t}\n\n\tfmt.Println(i)\n}\n\nfunc isLager(a, b []int) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\tif a[i] > b[i] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\nfunc isSame(a, b []int) 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 nextPermutation(p []int) bool {\n\tswap := func(a []int, b, c int) {\n\t\ta[b], a[c] = a[c], a[b]\n\t}\n\trev := func(s []int) {\n\t\tfor i := 0; i < len(s)/2; i++ {\n\t\t\tswap(s, i, len(s)-1-i)\n\t\t}\n\t}\n\n\tl, r := len(p)-2, len(p)-1\n\n\tfor p[l] >= p[l+1] {\n\t\tif l == 0 {\n\t\t\trev(p)\n\t\t\treturn false\n\t\t}\n\t\tl--\n\t}\n\tfor p[l] >= p[r] {\n\t\tr--\n\t}\n\n\tswap(p, l, r)\n\trev(p[l+1:])\n\treturn true\n}\n\n/*-----------Input utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst buf = 200100\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, buf), buf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-2.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readR() []rune {\n\treturn []rune(readS())\n}\n\nfunc readI() int {\n\ti, _ := strconv.Atoi(readS())\n\treturn i\n}\n\nfunc readF() float64 {\n\tf, _ := strconv.ParseFloat(readS(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1600400769, "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/s729405240.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s729405240", "user_id": "u533258444"}, "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\tn := readI()\n\tP, Q := make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tP[i] = readI()\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tQ[i] = readI()\n\t}\n\n\tif isLager(P, Q) {\n\t\tP, Q = Q, P\n\t}\n\n\ti := 0\n\tfor ; !isSame(P, Q); i++ {\n\t\tnextPermutation(P)\n\t}\n\n\tfmt.Println(i)\n}\n\nfunc isLager(a, b []int) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\tif a[i] > b[i] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\nfunc isSame(a, b []int) 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 nextPermutation(p []int) bool {\n\tswap := func(a []int, b, c int) {\n\t\ta[b], a[c] = a[c], a[b]\n\t}\n\trev := func(s []int) {\n\t\tfor i := 0; i < len(s)/2; i++ {\n\t\t\tswap(s, i, len(s)-1-i)\n\t\t}\n\t}\n\n\tl, r := len(p)-2, len(p)-1\n\n\tfor p[l] >= p[l+1] {\n\t\tif l == 0 {\n\t\t\trev(p)\n\t\t\treturn false\n\t\t}\n\t\tl--\n\t}\n\tfor p[l] >= p[r] {\n\t\tr--\n\t}\n\n\tswap(p, l, r)\n\trev(p[l+1:])\n\treturn true\n}\n\n/*-----------Input utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst buf = 200100\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, buf), buf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-2.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readR() []rune {\n\treturn []rune(readS())\n}\n\nfunc readI() int {\n\ti, _ := strconv.Atoi(readS())\n\treturn i\n}\n\nfunc readF() float64 {\n\tf, _ := strconv.ParseFloat(readS(), 64)\n\treturn f\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1666, "cpu_time_ms": 6, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s915372603", "group_id": "codeNet:p02813", "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\nvar perms [][]int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\n\trest := make([]int, n)\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = readInt()\n\t\trest[i] = i + 1\n\t}\n\tq := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tq[i] = readInt()\n\t}\n\n\tperms = make([][]int, 0)\n\tperm([]int{}, rest)\n\n\tpi, pq := 0, 0\n\tfor i := 0; i < len(perms); i++ {\n\t\tif equal(perms[i], p) {\n\t\t\tpi = i\n\t\t}\n\t\tif equal(perms[i], q) {\n\t\t\tpq = i\n\t\t}\n\t}\n\tfmt.Println(abs(pi - pq))\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn x * -1\n\t}\n\treturn x\n}\n\nfunc equal(x, y []int) bool {\n\tif len(x) != len(y) {\n\t\treturn false\n\t}\n\tn := len(x)\n\tfor i := 0; i < n; i++ {\n\t\tif x[i] != y[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc perm(head, rest []int) []int {\n\tif len(rest) == 0 {\n\t\tperms = append(perms, head)\n\t\treturn head\n\t}\n\tres := make([]int, 0)\n\tfor i := 0; i < len(rest); i++ {\n\t\trestx := make([]int, len(rest))\n\t\tcopy(restx, rest)\n\n\t\theadx := make([]int, len(head))\n\t\tcopy(headx, head)\n\n\t\theadx = append(headx, restx[i])\n\t\trestx = append(restx[:i], restx[i+1:]...)\n\t\tres = perm(headx, restx)\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1586724221, "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/s915372603.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s915372603", "user_id": "u309370374"}, "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 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\nvar perms [][]int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\n\trest := make([]int, n)\n\tp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = readInt()\n\t\trest[i] = i + 1\n\t}\n\tq := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tq[i] = readInt()\n\t}\n\n\tperms = make([][]int, 0)\n\tperm([]int{}, rest)\n\n\tpi, pq := 0, 0\n\tfor i := 0; i < len(perms); i++ {\n\t\tif equal(perms[i], p) {\n\t\t\tpi = i\n\t\t}\n\t\tif equal(perms[i], q) {\n\t\t\tpq = i\n\t\t}\n\t}\n\tfmt.Println(abs(pi - pq))\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn x * -1\n\t}\n\treturn x\n}\n\nfunc equal(x, y []int) bool {\n\tif len(x) != len(y) {\n\t\treturn false\n\t}\n\tn := len(x)\n\tfor i := 0; i < n; i++ {\n\t\tif x[i] != y[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc perm(head, rest []int) []int {\n\tif len(rest) == 0 {\n\t\tperms = append(perms, head)\n\t\treturn head\n\t}\n\tres := make([]int, 0)\n\tfor i := 0; i < len(rest); i++ {\n\t\trestx := make([]int, len(rest))\n\t\tcopy(restx, rest)\n\n\t\theadx := make([]int, len(head))\n\t\tcopy(headx, head)\n\n\t\theadx = append(headx, restx[i])\n\t\trestx = append(restx[:i], restx[i+1:]...)\n\t\tres = perm(headx, restx)\n\t}\n\treturn res\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1307, "cpu_time_ms": 66, "memory_kb": 10880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s964420018", "group_id": "codeNet:p02813", "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\treadInt()\n\tS, Result, Checker := readString(), 0, 0\n\n\tfor _, c := range strings.Split(S, \"\") {\n\t\tswitch c {\n\t\tcase \"A\":\n\t\t\tChecker = 1\n\n\t\tcase \"B\":\n\t\t\tif Checker == 1 {\n\t\t\t\tChecker = 2\n\t\t\t} else {\n\t\t\t\tChecker = 0\n\t\t\t}\n\n\t\tcase \"C\":\n\t\t\tif Checker == 2 {\n\t\t\t\tResult++\n\t\t\t}\n\t\t\tChecker = 0\n\t\t}\n\t}\n\n\tfmt.Println(Result)\n}\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n\t//scanner.Split(bufio.ScanLines)\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tt, _ := strconv.Atoi(scanner.Text())\n\treturn t\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n", "language": "Go", "metadata": {"date": 1584210574, "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/s964420018.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s964420018", "user_id": "u121595121"}, "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 main() {\n\treadInt()\n\tS, Result, Checker := readString(), 0, 0\n\n\tfor _, c := range strings.Split(S, \"\") {\n\t\tswitch c {\n\t\tcase \"A\":\n\t\t\tChecker = 1\n\n\t\tcase \"B\":\n\t\t\tif Checker == 1 {\n\t\t\t\tChecker = 2\n\t\t\t} else {\n\t\t\t\tChecker = 0\n\t\t\t}\n\n\t\tcase \"C\":\n\t\t\tif Checker == 2 {\n\t\t\t\tResult++\n\t\t\t}\n\t\t\tChecker = 0\n\t\t}\n\t}\n\n\tfmt.Println(Result)\n}\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n\t//scanner.Split(bufio.ScanLines)\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tt, _ := strconv.Atoi(scanner.Text())\n\treturn t\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 683, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s873076027", "group_id": "codeNet:p02814", "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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar n, m int\nvar A []int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tA[i] /= 2\n\t}\n\n\tvar slcm int\n\tslcm = 1\n\tif n == 1 {\n\t\tslcm = A[0]\n\t} else {\n\t\tslcm = Lcm(A[0], A[1])\n\t\tif slcm >= m {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tfor i := 2; i < n; i++ {\n\t\t\tslcm = Lcm(slcm, A[i])\n\t\t\tif slcm >= m {\n\t\t\t\tfmt.Println(0)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t// fmt.Println(slcm)\n\n\t// if slcm%2 == 0 {\n\t// \tfmt.Println(0)\n\t// \treturn\n\t// }\n\n\tans := m / slcm\n\tif ans%2 == 0 {\n\t\tfmt.Println(ans / 2)\n\t} else {\n\t\tfmt.Println((ans + (2 - 1)) / 2)\n\t}\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/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n\t- MOD取る系はint64必須ですよ?\n*/\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1578711534, "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/s873076027.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s873076027", "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)\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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// PrintDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\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/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\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\nvar n, m int\nvar A []int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tA = ReadIntSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tA[i] /= 2\n\t}\n\n\tvar slcm int\n\tslcm = 1\n\tif n == 1 {\n\t\tslcm = A[0]\n\t} else {\n\t\tslcm = Lcm(A[0], A[1])\n\t\tif slcm >= m {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tfor i := 2; i < n; i++ {\n\t\t\tslcm = Lcm(slcm, A[i])\n\t\t\tif slcm >= m {\n\t\t\t\tfmt.Println(0)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t// fmt.Println(slcm)\n\n\t// if slcm%2 == 0 {\n\t// \tfmt.Println(0)\n\t// \treturn\n\t// }\n\n\tans := m / slcm\n\tif ans%2 == 0 {\n\t\tfmt.Println(ans / 2)\n\t} else {\n\t\tfmt.Println((ans + (2 - 1)) / 2)\n\t}\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/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n\t- MOD取る系はint64必須ですよ?\n*/\n\n/*******************************************************************/\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8230, "cpu_time_ms": 32, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s690982544", "group_id": "codeNet:p02816", "input_text": "package main\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 KMP(A, B []interface{}) []int {\n N := len(B)\n PMT := make([]int, N + 1)\n PMT[0] = -1\n for i, j := 2, 0; i <= N; {\n if B[i - 1] == B[j] {\n PMT[i] = j + 1\n i++\n j++\n } else if 0 < j {\n j = PMT[j]\n } else {\n PMT[i] = 0\n i++\n }\n }\n M := make([]int, 0)\n for i, j := 0, 0; i + j < len(A); {\n if A[i + j] == B[j] {\n j++\n if j == N {\n M = append(M, i)\n i += N - PMT[N]\n j = PMT[j]\n }\n } else {\n i += j - PMT[j]\n if 0 < j { j = PMT[j] }\n }\n }\n return M\n}\n\nfunc main() {\n N := NextInt()\n A := NextIntVec()\n B := NextIntVec()\n XA := make([]interface{}, N)\n XB := make([]interface{}, N)\n for i, a := range A {\n XA[i] = a ^ A[(i + 1) % N]\n XB[i] = B[i] ^ B[(i + 1) % N]\n }\n XA = append(XA, XA...)\n K := KMP(XA, XB)\n for _, k := range K {\n if N <= k { break }\n x := A[k] ^ B[0]\n WriteIntVec([]int{k, x})\n }\n Output()\n}", "language": "Go", "metadata": {"date": 1578785687, "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/s690982544.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s690982544", "user_id": "u415905784"}, "prompt_components": {"gold_output": "1 3\n", "input_to_evaluate": "package main\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 KMP(A, B []interface{}) []int {\n N := len(B)\n PMT := make([]int, N + 1)\n PMT[0] = -1\n for i, j := 2, 0; i <= N; {\n if B[i - 1] == B[j] {\n PMT[i] = j + 1\n i++\n j++\n } else if 0 < j {\n j = PMT[j]\n } else {\n PMT[i] = 0\n i++\n }\n }\n M := make([]int, 0)\n for i, j := 0, 0; i + j < len(A); {\n if A[i + j] == B[j] {\n j++\n if j == N {\n M = append(M, i)\n i += N - PMT[N]\n j = PMT[j]\n }\n } else {\n i += j - PMT[j]\n if 0 < j { j = PMT[j] }\n }\n }\n return M\n}\n\nfunc main() {\n N := NextInt()\n A := NextIntVec()\n B := NextIntVec()\n XA := make([]interface{}, N)\n XB := make([]interface{}, N)\n for i, a := range A {\n XA[i] = a ^ A[(i + 1) % N]\n XB[i] = B[i] ^ B[(i + 1) % N]\n }\n XA = append(XA, XA...)\n K := KMP(XA, XB)\n for _, k := range K {\n if N <= k { break }\n x := A[k] ^ B[0]\n WriteIntVec([]int{k, x})\n }\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1818, "cpu_time_ms": 323, "memory_kb": 44928}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s664892174", "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)\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\tS := getString()\n\tT := getString()\n\tfmt.Println(T + S)\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 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", "language": "Go", "metadata": {"date": 1584933261, "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/s664892174.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s664892174", "user_id": "u964273035"}, "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)\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\tS := getString()\n\tT := getString()\n\tfmt.Println(T + S)\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 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", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2274, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s536246168", "group_id": "codeNet:p02817", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS, T := readString(), readString()\n\tfmt.Println(T + S)\n}\n\n/////////////////////////////////////////\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n\t//scanner.Split(bufio.ScanLines)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}", "language": "Go", "metadata": {"date": 1583892677, "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/s536246168.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s536246168", "user_id": "u121595121"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS, T := readString(), readString()\n\tfmt.Println(T + S)\n}\n\n/////////////////////////////////////////\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n\t//scanner.Split(bufio.ScanLines)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 355, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s344005103", "group_id": "codeNet:p02818", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B, K int64;\n\n\tfmt.Scan(&A, &B, &K);\n\n\tif A >=1{\n\t\tif A - K <= 0 {\n\t\t\tB += A-K\n\t\t\tif B < 0{\n\t\t\t\tB = 0;\n\t\t\t}\n\t\t\tA = 0;\n\t\t}\n\t}else if B >= 1 {\n\t\tif B - K > 0{\n\t\t\tB -= K\n\t\t}else {\n\t\t\tB = 0\n\t\t}\n\t}\n\tfmt.Println(A, B);\n}", "language": "Go", "metadata": {"date": 1590521057, "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/s344005103.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s344005103", "user_id": "u283295031"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B, K int64;\n\n\tfmt.Scan(&A, &B, &K);\n\n\tif A >=1{\n\t\tif A - K <= 0 {\n\t\t\tB += A-K\n\t\t\tif B < 0{\n\t\t\t\tB = 0;\n\t\t\t}\n\t\t\tA = 0;\n\t\t}\n\t}else if B >= 1 {\n\t\tif B - K > 0{\n\t\t\tB -= K\n\t\t}else {\n\t\t\tB = 0\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 262, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s241906680", "group_id": "codeNet:p02818", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B, K int64;\n\n\tfmt.Scan(&A, &B, &K);\n\n\tif A >=1{\n\t\tif A - K <= 0 {\n\t\t\tB += A-K\n\t\t\tA = 0;\n\t\t}\n\t}else if B >= 1 {\n\t\tif B - K <= 0{\n\t\t\tB = 0\n\t\t}else {\n\t\t\tB -= K\n\t\t}\n\t}\n\tif B < 0 {B=0}\n\tfmt.Println(A, B);\n}", "language": "Go", "metadata": {"date": 1590508268, "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/s241906680.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s241906680", "user_id": "u283295031"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B, K int64;\n\n\tfmt.Scan(&A, &B, &K);\n\n\tif A >=1{\n\t\tif A - K <= 0 {\n\t\t\tB += A-K\n\t\t\tA = 0;\n\t\t}\n\t}else if B >= 1 {\n\t\tif B - K <= 0{\n\t\t\tB = 0\n\t\t}else {\n\t\t\tB -= K\n\t\t}\n\t}\n\tif B < 0 {B=0}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s764285738", "group_id": "codeNet:p02819", "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\tx := nextInt()\n\n\tfor i := x; i < 200000; i++ {\n\t\tif isPrime(i) == true {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc isPrime(a int) bool {\n\tfor i := 2; i < a; i++ {\n\t\tif a%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\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": 1594500372, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s764285738.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764285738", "user_id": "u756000295"}, "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 main() {\n\tscanInit()\n\n\tx := nextInt()\n\n\tfor i := x; i < 200000; i++ {\n\t\tif isPrime(i) == true {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc isPrime(a int) bool {\n\tfor i := 2; i < a; i++ {\n\t\tif a%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\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\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 650, "cpu_time_ms": 13, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s073713412", "group_id": "codeNet:p02819", "input_text": "package main\n\nimport \"fmt\"\n\nfunc merge(m1, m2 map[int]int) map[int]int {\n\tans := map[int]int{}\n\tfor k, v := range m1 {\n\t\tans[k] += v\n\t}\n\tfor k, v := range m2 {\n\t\tans[k] += v\n\t}\n\treturn ans\n}\n\nfunc factor(num, pnum int, v map[int]int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif v[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tv[num]++\n\t\t}\n\t\treturn len(v) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif v[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tv[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(num, pnum, v)\n}\n\nfunc main() {\n\tvar X int\n\tfmt.Scan(&X)\n\tr := 0\n\tfor i := X; r == 0; i++ {\n\t\tif factor(i, 2, map[int]int{}) {\n\t\t\tr = i\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1585883116, "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/s073713412.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s073713412", "user_id": "u534481484"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc merge(m1, m2 map[int]int) map[int]int {\n\tans := map[int]int{}\n\tfor k, v := range m1 {\n\t\tans[k] += v\n\t}\n\tfor k, v := range m2 {\n\t\tans[k] += v\n\t}\n\treturn ans\n}\n\nfunc factor(num, pnum int, v map[int]int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif v[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tv[num]++\n\t\t}\n\t\treturn len(v) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif v[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tv[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(num, pnum, v)\n}\n\nfunc main() {\n\tvar X int\n\tfmt.Scan(&X)\n\tr := 0\n\tfor i := X; r == 0; i++ {\n\t\tif factor(i, 2, map[int]int{}) {\n\t\t\tr = i\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 643, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s041224391", "group_id": "codeNet:p02820", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nconst (\n\tRock = \"Rock\"\n\tScissors = \"Scissors\"\n\tPaper = \"Paper\"\n\tFailRock = \"FailRock\"\n\tFailScissors = \"FailScissors\"\n\tFailPaper = \"FailPaper\"\n)\n\nfunc main() {\n\tin := readLineInt()\n\tCount, Dup := in[0], in[1]\n\n\tin = readLineInt()\n\tRockP, ScissorsP, PaperP := in[0], in[1], in[2]\n\n\tMachine := readLine()\n\tResultArray, Result := make([]string, Count), 0\n\n\tfmt.Println(utf8.RuneCountInString(Machine))\n\n\tfor i, M := range strings.Split(Machine, \"\") {\n\t\tvar r string\n\t\tswitch M {\n\t\tcase \"r\":\n\t\t\tr = Paper\n\t\tcase \"s\":\n\t\t\tr = Rock\n\t\tcase \"p\":\n\t\t\tr = Scissors\n\t\tdefault:\n\t\t\tfmt.Println(\"fixme: Fail at switch M\")\n\t\t}\n\n\t\tif i-Dup >= 0 {\n\t\t\tif isFail(ResultArray[i-Dup]) {\n\t\t\t\tResultArray[i] = r\n\t\t\t} else if ResultArray[i-Dup] == r {\n\t\t\t\tResultArray[i] = getFail(r)\n\t\t\t} else {\n\t\t\t\tResultArray[i] = r\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"initial\")\n\t\t\tResultArray[i] = r\n\t\t}\n\t}\n\n\tfmt.Println(ResultArray)\n\n\tfor _, v := range ResultArray {\n\t\tswitch {\n\t\tcase v == Rock:\n\t\t\tResult += RockP\n\t\tcase v == Scissors:\n\t\t\tResult += ScissorsP\n\t\tcase v == Paper:\n\t\t\tResult += PaperP\n\t\tcase isFail(v):\n\t\t\tResult += 0\n\t\t}\n\t}\n\n\tfmt.Println(Result)\n}\n\nfunc isFail(i string) bool {\n\treturn i == FailPaper || i == FailRock || i == FailScissors\n}\n\nfunc getFail(i string) string {\n\tswitch i {\n\tcase Rock:\n\t\treturn FailRock\n\tcase Scissors:\n\t\treturn FailScissors\n\tcase Paper:\n\t\treturn FailPaper\n\t}\n\tfmt.Println(\"fixme: getFail\")\n\treturn \"\"\n}\n\n/////////////////////////////////////////\n\nfunc readLineInt() []int {\n\tresult := make([]int, 0)\n\tfor _, v := range strings.Split(readLine(), \" \") {\n\t\ti, _ := strconv.Atoi(v)\n\t\tresult = append(result, i)\n\t}\n\treturn result\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readLine() string {\n\tresult := make([]byte, 0, 1e6)\n\tfor {\n\t\tline, remains, e := reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tresult = append(result, line...)\n\t\tif !remains {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(result)\n}\n", "language": "Go", "metadata": {"date": 1584222513, "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/s041224391.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s041224391", "user_id": "u121595121"}, "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\t\"unicode/utf8\"\n)\n\nconst (\n\tRock = \"Rock\"\n\tScissors = \"Scissors\"\n\tPaper = \"Paper\"\n\tFailRock = \"FailRock\"\n\tFailScissors = \"FailScissors\"\n\tFailPaper = \"FailPaper\"\n)\n\nfunc main() {\n\tin := readLineInt()\n\tCount, Dup := in[0], in[1]\n\n\tin = readLineInt()\n\tRockP, ScissorsP, PaperP := in[0], in[1], in[2]\n\n\tMachine := readLine()\n\tResultArray, Result := make([]string, Count), 0\n\n\tfmt.Println(utf8.RuneCountInString(Machine))\n\n\tfor i, M := range strings.Split(Machine, \"\") {\n\t\tvar r string\n\t\tswitch M {\n\t\tcase \"r\":\n\t\t\tr = Paper\n\t\tcase \"s\":\n\t\t\tr = Rock\n\t\tcase \"p\":\n\t\t\tr = Scissors\n\t\tdefault:\n\t\t\tfmt.Println(\"fixme: Fail at switch M\")\n\t\t}\n\n\t\tif i-Dup >= 0 {\n\t\t\tif isFail(ResultArray[i-Dup]) {\n\t\t\t\tResultArray[i] = r\n\t\t\t} else if ResultArray[i-Dup] == r {\n\t\t\t\tResultArray[i] = getFail(r)\n\t\t\t} else {\n\t\t\t\tResultArray[i] = r\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"initial\")\n\t\t\tResultArray[i] = r\n\t\t}\n\t}\n\n\tfmt.Println(ResultArray)\n\n\tfor _, v := range ResultArray {\n\t\tswitch {\n\t\tcase v == Rock:\n\t\t\tResult += RockP\n\t\tcase v == Scissors:\n\t\t\tResult += ScissorsP\n\t\tcase v == Paper:\n\t\t\tResult += PaperP\n\t\tcase isFail(v):\n\t\t\tResult += 0\n\t\t}\n\t}\n\n\tfmt.Println(Result)\n}\n\nfunc isFail(i string) bool {\n\treturn i == FailPaper || i == FailRock || i == FailScissors\n}\n\nfunc getFail(i string) string {\n\tswitch i {\n\tcase Rock:\n\t\treturn FailRock\n\tcase Scissors:\n\t\treturn FailScissors\n\tcase Paper:\n\t\treturn FailPaper\n\t}\n\tfmt.Println(\"fixme: getFail\")\n\treturn \"\"\n}\n\n/////////////////////////////////////////\n\nfunc readLineInt() []int {\n\tresult := make([]int, 0)\n\tfor _, v := range strings.Split(readLine(), \" \") {\n\t\ti, _ := strconv.Atoi(v)\n\t\tresult = append(result, i)\n\t}\n\treturn result\n}\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readLine() string {\n\tresult := make([]byte, 0, 1e6)\n\tfor {\n\t\tline, remains, e := reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tresult = append(result, line...)\n\t\tif !remains {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(result)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2019, "cpu_time_ms": 219, "memory_kb": 9984}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s892114564", "group_id": "codeNet:p02821", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tvar score int64\n\tvar power []int\n\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scanf(\"%d\", &tmp)\n\t\tpower = append(power, tmp)\n\t}\n\n\tsort.Ints(power)\n\n\tmin := findByBTree(power, m, numOfElem)\n\n\tscore, minNum, count := calcTotal(power, min)\n\n\tif m < count {\n\t\tscore -= int64(minNum * (count - m))\n\t}\n\n\tfmt.Print(score)\n}\n\nfunc calcTotal(array []int, min int) (int64, int, int) {\n\tl := len(array)\n\ttotal := int64(0)\n\tminNum := 200000\n\tcount := 0\n\tcache := []int64{0}\n\tcacheBound := make(map[int]int)\n\tsum := 0\n\tfor _, a := range array {\n\t\tcache = append(cache, int64(a+sum))\n\t\tsum += a\n\t}\n\n\tmax := cache[len(cache) - 1]\n\tfor _, a := range array {\n\t\tbound := 0\n\t\tif val, ok := cacheBound[a]; ok {\n\t\t\tbound = val\n\t\t} else {\n\t\t\tbound = findLowerBound(array, min - a)\n\t\t\tcacheBound[a] = bound\n\t\t}\n\t\tif bound != -1 {\n\t\t\tcount += l - bound\n\t\t\ttotal += max - cache[bound] + int64(a * (l - bound))\n\t\t\tif minNum > a + array[bound] {\n\t\t\t\tminNum = a + array[bound]\n\t\t\t}\n\t\t}\n\t}\n\treturn total, minNum, count\n}\n\nfunc findByBTree(array []int, target int, check func(array []int, min int, target int) int) int {\n\tleft := array[0]\n\tright := array[len(array)-1] * 2\n\tmid := 0\n\tcount := 0\n\tvar countCache []int\n\tvar midCache []int\n\tfor left <= right {\n\t\tmid = (left + right) / 2\n\t\tcount = check(array, mid, target)\n\t\tif count == target {\n\t\t\treturn mid\n\t\t} else if count > target {\n\t\t\tleft = mid + 1\n\t\t} else if count < target {\n\t\t\tright = mid - 1\n\t\t}\n\t\tcountCache = append(countCache, count)\n\t\tmidCache = append(midCache, mid)\n\t}\n\n\tif count >= target {\n\t\treturn mid\n\t}\n\tfor i := len(countCache) - 1; i >= 0; i-- {\n\t\tif countCache[i] > target {\n\t\t\treturn midCache[i]\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc numOfElem(array []int, min int, target int) int {\n\tlen := len(array)\n\tcount := 0\n\tcacheBound := make(map[int]int)\n\tfor i := len - 1; i >= 0; i-- {\n\t\tif target < count {\n\t\t\tbreak\n\t\t}\n\t\tindex := 0\n\t\tif val, ok := cacheBound[min - array[i]]; ok {\n\t\t\tindex = val\n\t\t} else {\n\t\t\tindex = findLowerBound(array, min-array[i])\n\t\t\tcacheBound[min-array[i]] = index\n\t\t}\n\t\tif index != -1 {\n\t\t\tcount += len - index\n\t\t}\n\t}\n\n\treturn count\n}\n\nfunc findLowerBound(array []int, target int) int {\n\tl := len(array)\n\tleft := 0\n\tright := l - 1\n\tmid := -1\n\ttmp := 0\n\tvar tmpCache []int\n\tvar midCache []int\n\tfor left <= right {\n\t\tmid = (left + right) / 2\n\t\ttmp = array[mid]\n\t\tif tmp == target {\n\t\t\tfor mid > 1 && array[mid] == array[mid-1] {\n\t\t\t\tmid--\n\t\t\t}\n\t\t\tbreak\n\t\t} else if tmp < target {\n\t\t\tleft = mid + 1\n\t\t} else if tmp > target {\n\t\t\tright = mid - 1\n\t\t}\n\t\ttmpCache = append(tmpCache, tmp)\n\t\tmidCache = append(midCache, mid)\n\t\tif left > right {\n\t\t\tif left == l {\n\t\t\t\tmid = -1\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif tmp >= target {\n\t\treturn mid\n\t}\n\tfor i := len(tmpCache) - 1; i >= 0; i-- {\n\t\tif tmpCache[i] > target {\n\t\t\treturn midCache[i]\n\t\t}\n\t}\n\treturn -1\n}\n", "language": "Go", "metadata": {"date": 1596071298, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02821.html", "problem_id": "p02821", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02821/input.txt", "sample_output_relpath": "derived/input_output/data/p02821/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02821/Go/s892114564.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s892114564", "user_id": "u389216994"}, "prompt_components": {"gold_output": "202\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tvar score int64\n\tvar power []int\n\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scanf(\"%d\", &tmp)\n\t\tpower = append(power, tmp)\n\t}\n\n\tsort.Ints(power)\n\n\tmin := findByBTree(power, m, numOfElem)\n\n\tscore, minNum, count := calcTotal(power, min)\n\n\tif m < count {\n\t\tscore -= int64(minNum * (count - m))\n\t}\n\n\tfmt.Print(score)\n}\n\nfunc calcTotal(array []int, min int) (int64, int, int) {\n\tl := len(array)\n\ttotal := int64(0)\n\tminNum := 200000\n\tcount := 0\n\tcache := []int64{0}\n\tcacheBound := make(map[int]int)\n\tsum := 0\n\tfor _, a := range array {\n\t\tcache = append(cache, int64(a+sum))\n\t\tsum += a\n\t}\n\n\tmax := cache[len(cache) - 1]\n\tfor _, a := range array {\n\t\tbound := 0\n\t\tif val, ok := cacheBound[a]; ok {\n\t\t\tbound = val\n\t\t} else {\n\t\t\tbound = findLowerBound(array, min - a)\n\t\t\tcacheBound[a] = bound\n\t\t}\n\t\tif bound != -1 {\n\t\t\tcount += l - bound\n\t\t\ttotal += max - cache[bound] + int64(a * (l - bound))\n\t\t\tif minNum > a + array[bound] {\n\t\t\t\tminNum = a + array[bound]\n\t\t\t}\n\t\t}\n\t}\n\treturn total, minNum, count\n}\n\nfunc findByBTree(array []int, target int, check func(array []int, min int, target int) int) int {\n\tleft := array[0]\n\tright := array[len(array)-1] * 2\n\tmid := 0\n\tcount := 0\n\tvar countCache []int\n\tvar midCache []int\n\tfor left <= right {\n\t\tmid = (left + right) / 2\n\t\tcount = check(array, mid, target)\n\t\tif count == target {\n\t\t\treturn mid\n\t\t} else if count > target {\n\t\t\tleft = mid + 1\n\t\t} else if count < target {\n\t\t\tright = mid - 1\n\t\t}\n\t\tcountCache = append(countCache, count)\n\t\tmidCache = append(midCache, mid)\n\t}\n\n\tif count >= target {\n\t\treturn mid\n\t}\n\tfor i := len(countCache) - 1; i >= 0; i-- {\n\t\tif countCache[i] > target {\n\t\t\treturn midCache[i]\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc numOfElem(array []int, min int, target int) int {\n\tlen := len(array)\n\tcount := 0\n\tcacheBound := make(map[int]int)\n\tfor i := len - 1; i >= 0; i-- {\n\t\tif target < count {\n\t\t\tbreak\n\t\t}\n\t\tindex := 0\n\t\tif val, ok := cacheBound[min - array[i]]; ok {\n\t\t\tindex = val\n\t\t} else {\n\t\t\tindex = findLowerBound(array, min-array[i])\n\t\t\tcacheBound[min-array[i]] = index\n\t\t}\n\t\tif index != -1 {\n\t\t\tcount += len - index\n\t\t}\n\t}\n\n\treturn count\n}\n\nfunc findLowerBound(array []int, target int) int {\n\tl := len(array)\n\tleft := 0\n\tright := l - 1\n\tmid := -1\n\ttmp := 0\n\tvar tmpCache []int\n\tvar midCache []int\n\tfor left <= right {\n\t\tmid = (left + right) / 2\n\t\ttmp = array[mid]\n\t\tif tmp == target {\n\t\t\tfor mid > 1 && array[mid] == array[mid-1] {\n\t\t\t\tmid--\n\t\t\t}\n\t\t\tbreak\n\t\t} else if tmp < target {\n\t\t\tleft = mid + 1\n\t\t} else if tmp > target {\n\t\t\tright = mid - 1\n\t\t}\n\t\ttmpCache = append(tmpCache, tmp)\n\t\tmidCache = append(midCache, mid)\n\t\tif left > right {\n\t\t\tif left == l {\n\t\t\t\tmid = -1\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif tmp >= target {\n\t\treturn mid\n\t}\n\tfor i := len(tmpCache) - 1; i >= 0; i-- {\n\t\tif tmpCache[i] > target {\n\t\t\treturn midCache[i]\n\t\t}\n\t}\n\treturn -1\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "sample_input": "5 3\n10 14 19 34 33\n"}, "reference_outputs": ["202\n"], "source_document_id": "p02821", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2896, "cpu_time_ms": 1483, "memory_kb": 14908}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s953163531", "group_id": "codeNet:p02821", "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\tl := 0\n\tr := len(a) - 1\n\tfor l <= r {\n\t\tm := (l + r) / 2\n\t\tif a[m] >= x {\n\t\t\tr = m - 1\n\t\t} else {\n\t\t\tl = m + 1\n\t\t}\n\t}\n\treturn l\n}\n\nfunc calc(a, s []int, x int) (int, int) {\n\ttot := 0\n\tnum := 0\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tj := lowerBound(a, x-a[i])\n\t\tnum += n - j\n\t\ttot += s[n] - s[j]\n\t\ttot += a[i] * (n - j)\n\t}\n\treturn tot, num\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, M := getInt(), getInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t}\n\tsort.Ints(a)\n\tb := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tb[i+1] = b[i] + a[i]\n\t}\n\n\tl := 0\n\tr := 200005\n\tfor l+1 < r {\n\t\tc := (l + r) >> 1\n\t\t_, num := calc(a, b, c)\n\t\tif num >= M {\n\t\t\tl = c\n\t\t} else {\n\t\t\tr = c\n\t\t}\n\t}\n\tans, num := calc(a, b, l)\n\tans -= (num - M) * l\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1588132017, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02821.html", "problem_id": "p02821", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02821/input.txt", "sample_output_relpath": "derived/input_output/data/p02821/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02821/Go/s953163531.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s953163531", "user_id": "u814575783"}, "prompt_components": {"gold_output": "202\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\tl := 0\n\tr := len(a) - 1\n\tfor l <= r {\n\t\tm := (l + r) / 2\n\t\tif a[m] >= x {\n\t\t\tr = m - 1\n\t\t} else {\n\t\t\tl = m + 1\n\t\t}\n\t}\n\treturn l\n}\n\nfunc calc(a, s []int, x int) (int, int) {\n\ttot := 0\n\tnum := 0\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tj := lowerBound(a, x-a[i])\n\t\tnum += n - j\n\t\ttot += s[n] - s[j]\n\t\ttot += a[i] * (n - j)\n\t}\n\treturn tot, num\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, M := getInt(), getInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t}\n\tsort.Ints(a)\n\tb := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tb[i+1] = b[i] + a[i]\n\t}\n\n\tl := 0\n\tr := 200005\n\tfor l+1 < r {\n\t\tc := (l + r) >> 1\n\t\t_, num := calc(a, b, c)\n\t\tif num >= M {\n\t\t\tl = c\n\t\t} else {\n\t\t\tr = c\n\t\t}\n\t}\n\tans, num := calc(a, b, l)\n\tans -= (num - M) * l\n\tout(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "sample_input": "5 3\n10 14 19 34 33\n"}, "reference_outputs": ["202\n"], "source_document_id": "p02821", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1429, "cpu_time_ms": 152, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s675125408", "group_id": "codeNet:p02821", "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\tm := getNextInt64(scanner)\n\n\taa := make(I64, n)\n\tss := make([]int64, n+1)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\n\tsort.Sort(aa)\n\tfor i := 0; i < n; i++ {\n\t\tss[i+1] = ss[i] + aa[i]\n\t}\n\n\tvar ans int64\n\tl := int64(-1)\n\tr := aa[0]<<1 + 1\n\n\tfor l+1 < r {\n\t\tmid := (l + r) >> 1\n\t\tc := m\n\t\tfor i := 0; i < n; i++ {\n\t\t\tll := i - 1\n\t\t\trr := n\n\t\t\tfor ll+1 < rr {\n\t\t\t\tmm := (ll + rr) >> 1\n\t\t\t\tif aa[mm]+aa[i] < mid {\n\t\t\t\t\trr = mm\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tll = mm\n\t\t\t}\n\t\t\tif rr-i == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc -= int64(rr-i-1)<<1 + 1\n\t\t}\n\t\tif c < 0 {\n\t\t\tl = mid\n\t\t\tcontinue\n\t\t}\n\t\tr = mid\n\t}\n\n\tc := m\n\tfor i := 0; i < n; i++ {\n\t\tll := i - 1\n\t\trr := n\n\t\tfor ll+1 < rr {\n\t\t\tmm := (ll + rr) >> 1\n\t\t\tif aa[mm]+aa[i] <= l {\n\t\t\t\trr = mm\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tll = mm\n\t\t}\n\t\tif rr-i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tans += (int64(rr-i-1)<<1)*aa[i] + (ss[rr]-ss[i])<<1\n\t\tc -= int64(rr-i-1)<<1 + 1\n\t}\n\tans += c * l\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype I64 []int64\n\nfunc (a I64) Len() int { return len(a) }\nfunc (a I64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a I64) Less(i, j int) bool { return a[i] > a[j] }\n", "language": "Go", "metadata": {"date": 1577676290, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02821.html", "problem_id": "p02821", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02821/input.txt", "sample_output_relpath": "derived/input_output/data/p02821/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02821/Go/s675125408.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s675125408", "user_id": "u150542210"}, "prompt_components": {"gold_output": "202\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\tm := getNextInt64(scanner)\n\n\taa := make(I64, n)\n\tss := make([]int64, n+1)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\n\tsort.Sort(aa)\n\tfor i := 0; i < n; i++ {\n\t\tss[i+1] = ss[i] + aa[i]\n\t}\n\n\tvar ans int64\n\tl := int64(-1)\n\tr := aa[0]<<1 + 1\n\n\tfor l+1 < r {\n\t\tmid := (l + r) >> 1\n\t\tc := m\n\t\tfor i := 0; i < n; i++ {\n\t\t\tll := i - 1\n\t\t\trr := n\n\t\t\tfor ll+1 < rr {\n\t\t\t\tmm := (ll + rr) >> 1\n\t\t\t\tif aa[mm]+aa[i] < mid {\n\t\t\t\t\trr = mm\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tll = mm\n\t\t\t}\n\t\t\tif rr-i == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc -= int64(rr-i-1)<<1 + 1\n\t\t}\n\t\tif c < 0 {\n\t\t\tl = mid\n\t\t\tcontinue\n\t\t}\n\t\tr = mid\n\t}\n\n\tc := m\n\tfor i := 0; i < n; i++ {\n\t\tll := i - 1\n\t\trr := n\n\t\tfor ll+1 < rr {\n\t\t\tmm := (ll + rr) >> 1\n\t\t\tif aa[mm]+aa[i] <= l {\n\t\t\t\trr = mm\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tll = mm\n\t\t}\n\t\tif rr-i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tans += (int64(rr-i-1)<<1)*aa[i] + (ss[rr]-ss[i])<<1\n\t\tc -= int64(rr-i-1)<<1 + 1\n\t}\n\tans += c * l\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype I64 []int64\n\nfunc (a I64) Len() int { return len(a) }\nfunc (a I64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a I64) Less(i, j int) bool { return a[i] > a[j] }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "sample_input": "5 3\n10 14 19 34 33\n"}, "reference_outputs": ["202\n"], "source_document_id": "p02821", "source_text": "Score : 500 points\n\nProblem Statement\n\nTakahashi has come to a party as a special guest.\nThere are N ordinary guests at the party. The i-th ordinary guest has a power of A_i.\n\nTakahashi has decided to perform M handshakes to increase the happiness of the party (let the current happiness be 0).\nA handshake will be performed as follows:\n\nTakahashi chooses one (ordinary) guest x for his left hand and another guest y for his right hand (x and y can be the same).\n\nThen, he shakes the left hand of Guest x and the right hand of Guest y simultaneously to increase the happiness by A_x+A_y.\n\nHowever, Takahashi should not perform the same handshake more than once. Formally, the following condition must hold:\n\nAssume that, in the k-th handshake, Takahashi shakes the left hand of Guest x_k and the right hand of Guest y_k. Then, there is no pair p, q (1 \\leq p < q \\leq M) such that (x_p,y_p)=(x_q,y_q).\n\nWhat is the maximum possible happiness after M handshakes?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq N^2\n\n1 \\leq A_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\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible happiness after M handshakes.\n\nSample Input 1\n\n5 3\n10 14 19 34 33\n\nSample Output 1\n\n202\n\nLet us say that Takahashi performs the following handshakes:\n\nIn the first handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 4.\n\nIn the second handshake, Takahashi shakes the left hand of Guest 4 and the right hand of Guest 5.\n\nIn the third handshake, Takahashi shakes the left hand of Guest 5 and the right hand of Guest 4.\n\nThen, we will have the happiness of (34+34)+(34+33)+(33+34)=202.\n\nWe cannot achieve the happiness of 203 or greater, so the answer is 202.\n\nSample Input 2\n\n9 14\n1 3 5 110 24 21 34 5 3\n\nSample Output 2\n\n1837\n\nSample Input 3\n\n9 73\n67597 52981 5828 66249 75177 64141 40773 79105 16076\n\nSample Output 3\n\n8128170", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2294, "cpu_time_ms": 111, "memory_kb": 3584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s047549650", "group_id": "codeNet:p02823", "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 := nextInt64()\n\ta := nextInt64()\n\tb := nextInt64()\n\n\tif (b-a-1)%2 == 1 {\n\t\tfmt.Println((b - a + 1) / 2)\n\t\treturn\n\t}\n\tfmt.Println(min(b-1, n-a))\n\n}\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\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 nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\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": 1596335120, "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/s047549650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s047549650", "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt64()\n\ta := nextInt64()\n\tb := nextInt64()\n\n\tif (b-a-1)%2 == 1 {\n\t\tfmt.Println((b - a + 1) / 2)\n\t\treturn\n\t}\n\tfmt.Println(min(b-1, n-a))\n\n}\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\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 nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 678, "cpu_time_ms": 3, "memory_kb": 1784}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s876789896", "group_id": "codeNet:p02823", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\tvar ans int\n\tif (B-A)%2 == 0 {\n\t\tans = (B - A) / 2\n\t} else {\n\t\t// 答えは以下の(A)+(B)+(C)になる\n\t\t// (A) 片方が1卓あるいはN卓に移動するまでに必要なラウンド - min(A-1, N-B)\n\t\t// (B) 偶奇を調整するラウンド - 1ラウンド\n // (C) 双方が出会うためのラウンド - 最初は同じ方向に進むので、距離が縮まらない。偶奇調整後は近くが、調整ラウンド1分だけ距離が縮まっているので、必要なラウンド数は(B-A-1)/2となる\n\t\tans = min(A-1, N-B) + 1 + (B-A-1)/2\n\t}\n\tfmt.Println(ans)\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": 1579191924, "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/s876789896.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876789896", "user_id": "u196030116"}, "prompt_components": {"gold_output": "1\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\tvar ans int\n\tif (B-A)%2 == 0 {\n\t\tans = (B - A) / 2\n\t} else {\n\t\t// 答えは以下の(A)+(B)+(C)になる\n\t\t// (A) 片方が1卓あるいはN卓に移動するまでに必要なラウンド - min(A-1, N-B)\n\t\t// (B) 偶奇を調整するラウンド - 1ラウンド\n // (C) 双方が出会うためのラウンド - 最初は同じ方向に進むので、距離が縮まらない。偶奇調整後は近くが、調整ラウンド1分だけ距離が縮まっているので、必要なラウンド数は(B-A-1)/2となる\n\t\tans = min(A-1, N-B) + 1 + (B-A-1)/2\n\t}\n\tfmt.Println(ans)\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s348766090", "group_id": "codeNet:p02823", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar games, a, b, result int\n\tfmt.Scan(&games)\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\n\tif (b-a)%2 == 0 {\n\t\tresult = (b - a) / 2\n\t} else {\n\t\tif a < (games - b) {\n\t\t\tresult = b - 1\n\t\t} else {\n\t\t\tresult = games - a - 1\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1577587588, "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/s348766090.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s348766090", "user_id": "u787224158"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar games, a, b, result int\n\tfmt.Scan(&games)\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\n\tif (b-a)%2 == 0 {\n\t\tresult = (b - a) / 2\n\t} else {\n\t\tif a < (games - b) {\n\t\t\tresult = b - 1\n\t\t} else {\n\t\t\tresult = games - a - 1\n\t\t}\n\t}\n\tfmt.Println(result)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s708492568", "group_id": "codeNet:p02829", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\ta := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tsort.Ints(a)\n\n\tfor i := 0; i < 2; i++ {\n\t\tif a[i] != i+1 {\n\t\t\tfmt.Println(i + 1)\n\t\t}\n\t}\n\n\tfmt.Printf(\"Hello, world\\n\")\n}", "language": "Go", "metadata": {"date": 1577123716, "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/s708492568.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s708492568", "user_id": "u110336920"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\ta := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tsort.Ints(a)\n\n\tfor i := 0; i < 2; i++ {\n\t\tif a[i] != i+1 {\n\t\t\tfmt.Println(i + 1)\n\t\t}\n\t}\n\n\tfmt.Printf(\"Hello, world\\n\")\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 245, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s434598646", "group_id": "codeNet:p02829", "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\tA, B := sc.nextInt(), sc.nextInt()\n\n\tif A != 1 && B != 1 {\n\t\tfmt.Fprintln(wtr, 1)\n\t} else if A != 2 && B != 2 {\n\t\tfmt.Fprintln(wtr, 2)\n\t} else {\n\t\tfmt.Fprintln(wtr, 3)\n\t}\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577066501, "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/s434598646.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s434598646", "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\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\tA, B := sc.nextInt(), sc.nextInt()\n\n\tif A != 1 && B != 1 {\n\t\tfmt.Fprintln(wtr, 1)\n\t} else if A != 2 && B != 2 {\n\t\tfmt.Fprintln(wtr, 2)\n\t} else {\n\t\tfmt.Fprintln(wtr, 3)\n\t}\n\twtr.Flush()\n}\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1819, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s711144221", "group_id": "codeNet:p02830", "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\tscanner := bufio.NewScanner(os.Stdin)\n\tinputArray, _ := toIntArray(splitInput(scanner, \" \"))\n\tn := inputArray[0]\n\tst := splitInput(scanner, \" \")\n\ts := st[0]\n\tt := st[1]\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%s\", s[i:i+1])\n\t\tfmt.Printf(\"%s\", t[i:i+1])\n\t}\n\tfmt.Println()\n}\n\nfunc splitInput(scanner *bufio.Scanner, sep string) []string {\n\tscanner.Scan()\n\treturn strings.Split(scanner.Text(), sep)\n}\n\nfunc toIntArray(str []string) ([]int, error) {\n\tlength := len(str)\n\tresVal := make([]int, length)\n\tvar err error\n\tfor i := 0; i < length; i++ {\n\t\tresVal[i], err = strconv.Atoi(str[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn resVal, nil\n}\n", "language": "Go", "metadata": {"date": 1577067375, "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/s711144221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711144221", "user_id": "u545672909"}, "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\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tinputArray, _ := toIntArray(splitInput(scanner, \" \"))\n\tn := inputArray[0]\n\tst := splitInput(scanner, \" \")\n\ts := st[0]\n\tt := st[1]\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Printf(\"%s\", s[i:i+1])\n\t\tfmt.Printf(\"%s\", t[i:i+1])\n\t}\n\tfmt.Println()\n}\n\nfunc splitInput(scanner *bufio.Scanner, sep string) []string {\n\tscanner.Scan()\n\treturn strings.Split(scanner.Text(), sep)\n}\n\nfunc toIntArray(str []string) ([]int, error) {\n\tlength := len(str)\n\tresVal := make([]int, length)\n\tvar err error\n\tfor i := 0; i < length; i++ {\n\t\tresVal[i], err = strconv.Atoi(str[i])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn resVal, nil\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s851236076", "group_id": "codeNet:p02831", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t return a;\n\t}\n return gcd(b, a%b);\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tcal := a * b / gcd(a, b)\n\n\tfmt.Println(cal)\n}\n", "language": "Go", "metadata": {"date": 1577914207, "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/s851236076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s851236076", "user_id": "u572998669"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t return a;\n\t}\n return gcd(b, a%b);\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tcal := a * b / gcd(a, b)\n\n\tfmt.Println(cal)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 205, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s351160420", "group_id": "codeNet:p02831", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc gcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a int, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tarray := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tsc.Scan()\n\t\tarray[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tanswer := lcm(array[0], array[1])\n\n\tfmt.Println(answer)\n}\n", "language": "Go", "metadata": {"date": 1577132110, "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/s351160420.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s351160420", "user_id": "u932741460"}, "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 gcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a int, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tarray := make([]int, 2)\n\tfor i := 0; i < 2; i++ {\n\t\tsc.Scan()\n\t\tarray[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tanswer := lcm(array[0], array[1])\n\n\tfmt.Println(answer)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 439, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s251280798", "group_id": "codeNet:p02831", "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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tA, B := sc.nextInt(), sc.nextInt()\n\n\tfmt.Fprintln(wtr, lcm(A, B))\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577066729, "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/s251280798.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s251280798", "user_id": "u924691798"}, "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\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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tA, B := sc.nextInt(), sc.nextInt()\n\n\tfmt.Fprintln(wtr, lcm(A, B))\n\twtr.Flush()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1843, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s886166450", "group_id": "codeNet:p02832", "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\tvar N int = nextInt()\n\tai := map[int]int{}\n\tvar n int = 0\n\tfor count := 1; count <= N; count++ {\n\t\tn = nextInt()\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tai[count] = n\n\t}\n\tfmt.Println(ai)\n\tbuf := 0\n\tvar ans int = 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := buf; j <= N; j++ {\n\t\t\tif ai[j] == i {\n\t\t\t\tfmt.Printf(\"ai[j]=%d:i=%d\\n\", ai[j], i)\n\t\t\t\tans += j - 1 - buf\n\t\t\t\tbuf = j\n\t\t\t\tfmt.Printf(\"ans=%d\\n\", ans)\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"ai[j]=%d:i=%d\\n\", ai[j], i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif ans == 0 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1578320233, "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/s886166450.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s886166450", "user_id": "u306631092"}, "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 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\tvar N int = nextInt()\n\tai := map[int]int{}\n\tvar n int = 0\n\tfor count := 1; count <= N; count++ {\n\t\tn = nextInt()\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tai[count] = n\n\t}\n\tfmt.Println(ai)\n\tbuf := 0\n\tvar ans int = 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := buf; j <= N; j++ {\n\t\t\tif ai[j] == i {\n\t\t\t\tfmt.Printf(\"ai[j]=%d:i=%d\\n\", ai[j], i)\n\t\t\t\tans += j - 1 - buf\n\t\t\t\tbuf = j\n\t\t\t\tfmt.Printf(\"ans=%d\\n\", ans)\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"ai[j]=%d:i=%d\\n\", ai[j], i)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif ans == 0 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 787, "cpu_time_ms": 2104, "memory_kb": 37376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s825044366", "group_id": "codeNet:p02832", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n \"strconv\"\n // \"sort\"\n // \"regexp\"\n)\n\nconst (\n initialBufSize = 10000\n maxBufSize = 1000000\n)\nvar scanner = bufio.NewScanner(os.Stdin)\nvar buf = make([]byte, initialBufSize)\n\nfunc main() {\n scanner.Buffer(buf, maxBufSize)\n var r string\n r, _ = readOneLine(scanner)\n r, _ = readOneLine(scanner)\n ios := strAry2intAry(split(r))\n fmt.Println(calc(ios))\n}\n \nfunc calc(g []int) int{\n var del int\n var next = 1\n for i:=0;i 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// }", "language": "Go", "metadata": {"date": 1577691469, "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/s825044366.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s825044366", "user_id": "u967669872"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n \"strconv\"\n // \"sort\"\n // \"regexp\"\n)\n\nconst (\n initialBufSize = 10000\n maxBufSize = 1000000\n)\nvar scanner = bufio.NewScanner(os.Stdin)\nvar buf = make([]byte, initialBufSize)\n\nfunc main() {\n scanner.Buffer(buf, maxBufSize)\n var r string\n r, _ = readOneLine(scanner)\n r, _ = readOneLine(scanner)\n ios := strAry2intAry(split(r))\n fmt.Println(calc(ios))\n}\n \nfunc calc(g []int) int{\n var del int\n var next = 1\n for i:=0;i 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// }", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2887, "cpu_time_ms": 32, "memory_kb": 6912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s654297282", "group_id": "codeNet:p02832", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, c int\n\tfmt.Scan(&n)\n\n\tb := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\n\t\tif b == t {\n\t\t\tb++\n\t\t} else {\n\t\t\tc++\n\t\t}\n\t}\n\n\tif c < n {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n\n}", "language": "Go", "metadata": {"date": 1577512166, "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/s654297282.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s654297282", "user_id": "u610801172"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, c int\n\tfmt.Scan(&n)\n\n\tb := 1\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\n\t\tif b == t {\n\t\t\tb++\n\t\t} else {\n\t\t\tc++\n\t\t}\n\t}\n\n\tif c < n {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(-1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 999, "memory_kb": 6912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s265298823", "group_id": "codeNet:p02833", "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\n\tif n%2 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 0\n\tdivisor := 2 * 5\n\tfor divisor <= n {\n\t\tans += n / divisor\n\t\tdivisor *= 5\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1586010020, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02833.html", "problem_id": "p02833", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02833/input.txt", "sample_output_relpath": "derived/input_output/data/p02833/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02833/Go/s265298823.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s265298823", "user_id": "u433254839"}, "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\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tif n%2 != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 0\n\tdivisor := 2 * 5\n\tfor divisor <= n {\n\t\tans += n / divisor\n\t\tdivisor *= 5\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "sample_input": "12\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02833", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s549211056", "group_id": "codeNet:p02833", "input_text": "package main\n\nimport \"fmt\"\n\nfunc function1(n int64) int64 {\n\n\tans := int64(0)\n\tk := int64(10)\n\tfor n >= k {\n\t\tans += n / k\n\t\tk *= 5\n\t}\n\treturn ans\n\n}\n\nfunc main() {\n\n\tvar ans, n int64\n\n\tfmt.Scan(&n)\n\n\tans = 0\n\n\tif n%2 == 0 {\n\t\tans = function1(n)\n\n\t}\n\tprintln(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1577575932, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02833.html", "problem_id": "p02833", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02833/input.txt", "sample_output_relpath": "derived/input_output/data/p02833/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02833/Go/s549211056.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s549211056", "user_id": "u932741460"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc function1(n int64) int64 {\n\n\tans := int64(0)\n\tk := int64(10)\n\tfor n >= k {\n\t\tans += n / k\n\t\tk *= 5\n\t}\n\treturn ans\n\n}\n\nfunc main() {\n\n\tvar ans, n int64\n\n\tfmt.Scan(&n)\n\n\tans = 0\n\n\tif n%2 == 0 {\n\t\tans = function1(n)\n\n\t}\n\tprintln(ans)\n\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "sample_input": "12\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02833", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 267, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s147174389", "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\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 us[nu] < vs[nu] {\n\t\t\t\tq = append(q, nu)\n\t\t\t}\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\tans = max(ans, vs[i]-1)\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": 1594264100, "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/s147174389.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s147174389", "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\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 us[nu] < vs[nu] {\n\t\t\t\tq = append(q, nu)\n\t\t\t}\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\tans = max(ans, vs[i]-1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 77, "memory_kb": 15600}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s948857439", "group_id": "codeNet:p02834", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n io := IO{bufio.NewReaderSize(os.Stdin,100),bufio.NewWriterSize(os.Stdout,100)}\n n,u,v := io.Next3Ints()\n u,v = u-1,v-1\n g := make([][]int,n)\n for i:=0;i 1 { continue }\n if du[i] < dv[i] && x < dv[i] { x = dv[i] }\n }\n fmt.Println(x-1)\n}\nfunc dfs(g [][]int,s int) []int {\n x := make([]int,len(g))\n var rec func(int,int,int)\n rec = func(v,p,d int) {\n x[v] = d\n for _,u := range g[v] {\n if u == p { continue }\n rec(u,v,d+1)\n }\n }\n rec(s,-1,0)\n return x\n}\n\ntype IO struct {\n reader *bufio.Reader\n writer *bufio.Writer\n}\nfunc(io *IO) NextLine() string {\n var buffer []byte\n for {\n line,isPrefix,err := io.reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc(io *IO) Println(a ...interface{}) (int,error) {\n return fmt.Fprintln(io.writer,a...)\n}\nfunc(io *IO) Flush() error {\n return io.writer.Flush()\n}\nfunc(io *IO) Next2Ints() (int,int) {\n s := strings.Fields(io.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(io *IO) Next3Ints() (int,int,int) {\n s := strings.Fields(io.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.Atoi(s[2])\n return x,y,z\n}", "language": "Go", "metadata": {"date": 1577074917, "filename_ext": "go", "original_language": "Go (1.6)", "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/s948857439.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s948857439", "user_id": "u506403362"}, "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\nfunc main() {\n io := IO{bufio.NewReaderSize(os.Stdin,100),bufio.NewWriterSize(os.Stdout,100)}\n n,u,v := io.Next3Ints()\n u,v = u-1,v-1\n g := make([][]int,n)\n for i:=0;i 1 { continue }\n if du[i] < dv[i] && x < dv[i] { x = dv[i] }\n }\n fmt.Println(x-1)\n}\nfunc dfs(g [][]int,s int) []int {\n x := make([]int,len(g))\n var rec func(int,int,int)\n rec = func(v,p,d int) {\n x[v] = d\n for _,u := range g[v] {\n if u == p { continue }\n rec(u,v,d+1)\n }\n }\n rec(s,-1,0)\n return x\n}\n\ntype IO struct {\n reader *bufio.Reader\n writer *bufio.Writer\n}\nfunc(io *IO) NextLine() string {\n var buffer []byte\n for {\n line,isPrefix,err := io.reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer,line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc(io *IO) Println(a ...interface{}) (int,error) {\n return fmt.Fprintln(io.writer,a...)\n}\nfunc(io *IO) Flush() error {\n return io.writer.Flush()\n}\nfunc(io *IO) Next2Ints() (int,int) {\n s := strings.Fields(io.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(io *IO) Next3Ints() (int,int,int) {\n s := strings.Fields(io.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.Atoi(s[2])\n return x,y,z\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1542, "cpu_time_ms": 161, "memory_kb": 35712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s103936890", "group_id": "codeNet:p02835", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a1, a2, a3 int\n\tfmt.Scan(&a1, &a2, &a3)\n\tif a1+a2+a3 > 21 {\n\t\tfmt.Println(\"bust\")\n\t\treturn\n\t}\n\tfmt.Println(\"win\")\n}\n", "language": "Go", "metadata": {"date": 1576803686, "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/s103936890.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s103936890", "user_id": "u846820729"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a1, a2, a3 int\n\tfmt.Scan(&a1, &a2, &a3)\n\tif a1+a2+a3 > 21 {\n\t\tfmt.Println(\"bust\")\n\t\treturn\n\t}\n\tfmt.Println(\"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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s014007396", "group_id": "codeNet:p02836", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc palindromePhilia(s string) int {\n\tl := len(s)\n\tm := l >> 1\n\tvar f, b string\n\tvar c int\n\n\tif l%2 == 0 {\n\t\t// front\n\t\tfor i := m - 1; i >= 0; i-- {\n\t\t\tf += string(s[i])\n\t\t}\n\t\t// back\n\t\tfor i := m; i < l; i++ {\n\t\t\tb += string(s[i])\n\t\t}\n\t} else {\n\t\t// front\n\t\tfor i := m; i >= 0; i-- {\n\t\t\tf += string(s[i])\n\t\t}\n\t\t// back\n\t\tfor i := m; i < l; i++ {\n\t\t\tb += string(s[i])\n\t\t}\n\t}\n\n\tif f == b {\n\t\treturn 0\n\t}\n\n\tfor i, v := range f {\n\t\tif string(v) != string(b[i]) {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(palindromePhilia(s))\n}\n", "language": "Go", "metadata": {"date": 1575859677, "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/s014007396.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s014007396", "user_id": "u568763892"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc palindromePhilia(s string) int {\n\tl := len(s)\n\tm := l >> 1\n\tvar f, b string\n\tvar c int\n\n\tif l%2 == 0 {\n\t\t// front\n\t\tfor i := m - 1; i >= 0; i-- {\n\t\t\tf += string(s[i])\n\t\t}\n\t\t// back\n\t\tfor i := m; i < l; i++ {\n\t\t\tb += string(s[i])\n\t\t}\n\t} else {\n\t\t// front\n\t\tfor i := m; i >= 0; i-- {\n\t\t\tf += string(s[i])\n\t\t}\n\t\t// back\n\t\tfor i := m; i < l; i++ {\n\t\t\tb += string(s[i])\n\t\t}\n\t}\n\n\tif f == b {\n\t\treturn 0\n\t}\n\n\tfor i, v := range f {\n\t\tif string(v) != string(b[i]) {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(palindromePhilia(s))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s488369531", "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\tsl := make([]map[int]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tsl[i] = map[int]int{}\n\t\tfor j := 0; j < a; j++ {\n\t\t\tvar x, y int\n\t\t\tfmt.Scan(&x, &y)\n\t\t\tsl[i][x-1] = y\n\t\t}\n\t}\n\n\tvar max int\n\tfor bit := 0; bit < (1 << uint(n)); bit++ {\n\t\tcorrect := true\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif (bit>>uint(i))&1 == 1 {\n\t\t\t\tfor k, v := range sl[i] {\n\t\t\t\t\tif v^((bit>>uint(k))&1) == 1 {\n\t\t\t\t\t\tcorrect = false\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}\n\t\tif correct {\n\t\t\tcnt := onesCount(bit)\n\t\t\tif cnt > max {\n\t\t\t\tmax = cnt\n\t\t\t}\n\n\t\t}\n\n\t}\n\tfmt.Println(max)\n}\n\nfunc onesCount(bit int) int {\n\tvar num int\n\tfor ; bit != 0; bit &= bit - 1 {\n\t\tnum++\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1586662713, "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/s488369531.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s488369531", "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 n int\n\tfmt.Scan(&n)\n\tsl := make([]map[int]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tsl[i] = map[int]int{}\n\t\tfor j := 0; j < a; j++ {\n\t\t\tvar x, y int\n\t\t\tfmt.Scan(&x, &y)\n\t\t\tsl[i][x-1] = y\n\t\t}\n\t}\n\n\tvar max int\n\tfor bit := 0; bit < (1 << uint(n)); bit++ {\n\t\tcorrect := true\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif (bit>>uint(i))&1 == 1 {\n\t\t\t\tfor k, v := range sl[i] {\n\t\t\t\t\tif v^((bit>>uint(k))&1) == 1 {\n\t\t\t\t\t\tcorrect = false\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}\n\t\tif correct {\n\t\t\tcnt := onesCount(bit)\n\t\t\tif cnt > max {\n\t\t\t\tmax = cnt\n\t\t\t}\n\n\t\t}\n\n\t}\n\tfmt.Println(max)\n}\n\nfunc onesCount(bit int) int {\n\tvar num int\n\tfor ; bit != 0; bit &= bit - 1 {\n\t\tnum++\n\t}\n\treturn num\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 29, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s092702953", "group_id": "codeNet:p02837", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, a, max uint\n\t\tx, y uint\n\t)\n\tfmt.Scan(&n)\n\n\tstatements := make([][][2]uint, n)\n\tfor i := uint(0); i < n; i++ {\n\t\tfmt.Scan(&a)\n\n\t\ts := make([][2]uint, a)\n\t\tfor j := uint(0); j < a; j++ {\n\t\t\tfmt.Scan(&x, &y)\n\t\t\ts[j][0] = x\n\t\t\ts[j][1] = y\n\t\t}\n\t\tstatements[i] = s\n\t}\n\n\tfor bit := uint(0); bit < 1<>_x)&1 != _y {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ok && cnt > max {\n\t\t\tmax = cnt\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1579470882, "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/s092702953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s092702953", "user_id": "u478134456"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, a, max uint\n\t\tx, y uint\n\t)\n\tfmt.Scan(&n)\n\n\tstatements := make([][][2]uint, n)\n\tfor i := uint(0); i < n; i++ {\n\t\tfmt.Scan(&a)\n\n\t\ts := make([][2]uint, a)\n\t\tfor j := uint(0); j < a; j++ {\n\t\t\tfmt.Scan(&x, &y)\n\t\t\ts[j][0] = x\n\t\t\ts[j][1] = y\n\t\t}\n\t\tstatements[i] = s\n\t}\n\n\tfor bit := uint(0); bit < 1<>_x)&1 != _y {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ok && cnt > max {\n\t\t\tmax = cnt\n\t\t}\n\t}\n\n\tfmt.Println(max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 677, "cpu_time_ms": 17, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s511106181", "group_id": "codeNet:p02837", "input_text": "package main\n\nimport \"fmt\"\n\ntype person struct {\n\tm map[int]int\n}\n\nfunc isok(persons []person, v []bool, i int) bool {\n\tp := &persons[i]\n\tpv := v[i]\n\tfor j := 0; j < i; j++ {\n\t\tq := &persons[j]\n\t\tqv := v[j]\n\n\t\tfor pp, pm := range p.m {\n\t\t\tfor qp, qm := range q.m {\n\t\t\t\tif pp != qp {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif pm == qm {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif pv && qv {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\treturn true\n}\n\nfunc resolve(persons []person, v []bool, i int) int {\n\tif i == len(v) {\n\t\tans := 0\n\t\tfor _, b := range v {\n\t\t\tif b {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t\treturn ans\n\t}\n\n\tv[i] = true\n\tans0 := 0\n\tif isok(persons, v, i) {\n\t\tans0 = resolve(persons, v, i+1)\n\t}\n\n\tv[i] = false\n\tans1 := 0\n\tif isok(persons, v, i) {\n\t\tans1 = resolve(persons, v, i+1)\n\t}\n\n\tif ans0 > ans1 {\n\t\treturn ans0\n\t}\n\treturn ans1\n}\n\nfunc main() {\n\tvar np int\n\tfmt.Scanf(\"%d\\n\", &np)\n\n\tpersons := make([]person, np, np)\n\tfor i := 0; i < np; i++ {\n\t\tvar nm int\n\t\tfmt.Scanf(\"%d\\n\", &nm)\n\t\tperson := &persons[i]\n\t\tperson.m = make(map[int]int)\n\t\tfor j := 0; j < nm; j++ {\n\t\t\tvar p, m int\n\t\t\tfmt.Scanf(\"%d %d\\n\", &p, &m)\n\t\t\tperson.m[p] = m\n\t\t}\n\t}\n\n\tv := make([]bool, np, np)\n\tfmt.Print(resolve(persons, v, 0))\n}", "language": "Go", "metadata": {"date": 1576459755, "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/s511106181.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s511106181", "user_id": "u507387074"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype person struct {\n\tm map[int]int\n}\n\nfunc isok(persons []person, v []bool, i int) bool {\n\tp := &persons[i]\n\tpv := v[i]\n\tfor j := 0; j < i; j++ {\n\t\tq := &persons[j]\n\t\tqv := v[j]\n\n\t\tfor pp, pm := range p.m {\n\t\t\tfor qp, qm := range q.m {\n\t\t\t\tif pp != qp {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif pm == qm {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif pv && qv {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\treturn true\n}\n\nfunc resolve(persons []person, v []bool, i int) int {\n\tif i == len(v) {\n\t\tans := 0\n\t\tfor _, b := range v {\n\t\t\tif b {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t\treturn ans\n\t}\n\n\tv[i] = true\n\tans0 := 0\n\tif isok(persons, v, i) {\n\t\tans0 = resolve(persons, v, i+1)\n\t}\n\n\tv[i] = false\n\tans1 := 0\n\tif isok(persons, v, i) {\n\t\tans1 = resolve(persons, v, i+1)\n\t}\n\n\tif ans0 > ans1 {\n\t\treturn ans0\n\t}\n\treturn ans1\n}\n\nfunc main() {\n\tvar np int\n\tfmt.Scanf(\"%d\\n\", &np)\n\n\tpersons := make([]person, np, np)\n\tfor i := 0; i < np; i++ {\n\t\tvar nm int\n\t\tfmt.Scanf(\"%d\\n\", &nm)\n\t\tperson := &persons[i]\n\t\tperson.m = make(map[int]int)\n\t\tfor j := 0; j < nm; j++ {\n\t\t\tvar p, m int\n\t\t\tfmt.Scanf(\"%d %d\\n\", &p, &m)\n\t\t\tperson.m[p] = m\n\t\t}\n\t}\n\n\tv := make([]bool, np, np)\n\tfmt.Print(resolve(persons, v, 0))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1165, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s899004919", "group_id": "codeNet:p02837", "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\ttable := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ttable[i] = make([]int, N)\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tA := getInt()\n\t\tfor j := 0; j < A; j++ {\n\t\t\tx := getInt()\n\t\t\ty := getInt()\n\n\t\t\ttable[i][x - 1] = y\n\t\t}\n\t}\n\n\t//for _, row := range table {\n\t//\tfmt.Println(row)\n\t//}\n\n\tmembers := make([]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i+1; j < N; j++ {\n\t\t\tif table[i][j] == table[j][i] {\n\t\t\t\tif table[i][j] == 1 {\n\t\t\t\t\tmembers[i] = 1\n\t\t\t\t\tmembers[j] = 1\n\t\t\t\t} else {\n\t\t\t\t\tmembers[i] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresult := 0\n\tfor _, flag := range members {\n\t\tif flag == 1 {\n\t\t\tresult++\n\t\t}\n\t}\n\n\tfmt.Println(result)\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": 1575858329, "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/s899004919.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s899004919", "user_id": "u964273035"}, "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\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\ttable := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ttable[i] = make([]int, N)\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tA := getInt()\n\t\tfor j := 0; j < A; j++ {\n\t\t\tx := getInt()\n\t\t\ty := getInt()\n\n\t\t\ttable[i][x - 1] = y\n\t\t}\n\t}\n\n\t//for _, row := range table {\n\t//\tfmt.Println(row)\n\t//}\n\n\tmembers := make([]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i+1; j < N; j++ {\n\t\t\tif table[i][j] == table[j][i] {\n\t\t\t\tif table[i][j] == 1 {\n\t\t\t\t\tmembers[i] = 1\n\t\t\t\t\tmembers[j] = 1\n\t\t\t\t} else {\n\t\t\t\t\tmembers[i] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tresult := 0\n\tfor _, flag := range members {\n\t\tif flag == 1 {\n\t\t\tresult++\n\t\t}\n\t}\n\n\tfmt.Println(result)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2049, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s185088129", "group_id": "codeNet:p02838", "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\nconst mod int = 1e9 + 7\n\nfunc main() {\n\tn := readInt()\n\n\tzeros := make([]int, 60)\n\tones := make([]int, 60)\n\tabins := make([][]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := readInt()\n\t\tabins[i] = []byte(fmt.Sprintf(\"%060b\", a))\n\n\t\tfor j, b := range abins[i] {\n\t\t\tif b == '0' {\n\t\t\t\tzeros[j]++\n\t\t\t} else {\n\t\t\t\tones[j]++\n\t\t\t}\n\t\t}\n\t}\n\n\ttimes := make([]int, 60)\n\tfor i := 0; i < n-1; i++ {\n\t\tfor j, b := range abins[i] {\n\t\t\tif b == '0' {\n\t\t\t\tzeros[j]--\n\t\t\t\ttimes[j] += ones[j]\n\t\t\t} else {\n\t\t\t\tones[j]--\n\t\t\t\ttimes[j] += zeros[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range times {\n\t\tans += int(math.Pow(2, float64(59-i))) % mod * times[i] % mod\n\t\tans %= mod\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": 1581004305, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02838.html", "problem_id": "p02838", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02838/input.txt", "sample_output_relpath": "derived/input_output/data/p02838/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02838/Go/s185088129.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s185088129", "user_id": "u295946532"}, "prompt_components": {"gold_output": "6\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\nconst mod int = 1e9 + 7\n\nfunc main() {\n\tn := readInt()\n\n\tzeros := make([]int, 60)\n\tones := make([]int, 60)\n\tabins := make([][]byte, n)\n\tfor i := 0; i < n; i++ {\n\t\ta := readInt()\n\t\tabins[i] = []byte(fmt.Sprintf(\"%060b\", a))\n\n\t\tfor j, b := range abins[i] {\n\t\t\tif b == '0' {\n\t\t\t\tzeros[j]++\n\t\t\t} else {\n\t\t\t\tones[j]++\n\t\t\t}\n\t\t}\n\t}\n\n\ttimes := make([]int, 60)\n\tfor i := 0; i < n-1; i++ {\n\t\tfor j, b := range abins[i] {\n\t\t\tif b == '0' {\n\t\t\t\tzeros[j]--\n\t\t\t\ttimes[j] += ones[j]\n\t\t\t} else {\n\t\t\t\tones[j]--\n\t\t\t\ttimes[j] += zeros[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range times {\n\t\tans += int(math.Pow(2, float64(59-i))) % mod * times[i] % mod\n\t\tans %= mod\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\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02838", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2468, "cpu_time_ms": 530, "memory_kb": 34688}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s940289634", "group_id": "codeNet:p02842", "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)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\t\tsc = bufio.NewScanner(strings.NewReader(`\n\t\t5 2 2\n\t\tccccc\n\t`))\n\t\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\n\tn := nextInt()\n\n\tx := math.Ceil(float64(n) / 1.08)\n\n\tif int(math.Floor(x*1.08)) == n {\n\t\tfmt.Fprintln(out, x)\n\t} else {\n\t\tfmt.Fprintln(out, \":(\")\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", "language": "Go", "metadata": {"date": 1589064796, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02842.html", "problem_id": "p02842", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02842/input.txt", "sample_output_relpath": "derived/input_output/data/p02842/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02842/Go/s940289634.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s940289634", "user_id": "u805846052"}, "prompt_components": {"gold_output": "400\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)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\t\tsc = bufio.NewScanner(strings.NewReader(`\n\t\t5 2 2\n\t\tccccc\n\t`))\n\t\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\n\tn := nextInt()\n\n\tx := math.Ceil(float64(n) / 1.08)\n\n\tif int(math.Floor(x*1.08)) == n {\n\t\tfmt.Fprintln(out, x)\n\t} else {\n\t\tfmt.Fprintln(out, \":(\")\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", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.\n\nThe consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \\times 1.08 yen (rounded down to the nearest integer).\n\nTakahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.\n\nIf there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.\n\nConstraints\n\n1 \\leq N \\leq 50000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there are values that could be X, the price of the apple pie before tax, print any one of them.\n\nIf there are multiple such values, printing any one of them will be accepted.\n\nIf no value could be X, print :(.\n\nSample Input 1\n\n432\n\nSample Output 1\n\n400\n\nIf the apple pie is priced at 400 yen before tax, you have to pay 400 \\times 1.08 = 432 yen to buy one.\n\nOtherwise, the amount you have to pay will not be 432 yen.\n\nSample Input 2\n\n1079\n\nSample Output 2\n\n:(\n\nThere is no possible price before tax for which you have to pay 1079 yen with tax.\n\nSample Input 3\n\n1001\n\nSample Output 3\n\n927\n\nIf the apple pie is priced 927 yen before tax, by rounding down 927 \\times 1.08 = 1001.16, you have to pay 1001 yen.", "sample_input": "432\n"}, "reference_outputs": ["400\n"], "source_document_id": "p02842", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it.\n\nThe consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \\times 1.08 yen (rounded down to the nearest integer).\n\nTakahashi forgot the price of his apple pie before tax, X, and wants to know it again. Write a program that takes N as input and finds X. We assume X is an integer.\n\nIf there are multiple possible values for X, find any one of them. Also, Takahashi's memory of N, the amount he paid, may be incorrect. If no value could be X, report that fact.\n\nConstraints\n\n1 \\leq N \\leq 50000\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there are values that could be X, the price of the apple pie before tax, print any one of them.\n\nIf there are multiple such values, printing any one of them will be accepted.\n\nIf no value could be X, print :(.\n\nSample Input 1\n\n432\n\nSample Output 1\n\n400\n\nIf the apple pie is priced at 400 yen before tax, you have to pay 400 \\times 1.08 = 432 yen to buy one.\n\nOtherwise, the amount you have to pay will not be 432 yen.\n\nSample Input 2\n\n1079\n\nSample Output 2\n\n:(\n\nThere is no possible price before tax for which you have to pay 1079 yen with tax.\n\nSample Input 3\n\n1001\n\nSample Output 3\n\n927\n\nIf the apple pie is priced 927 yen before tax, by rounding down 927 \\times 1.08 = 1001.16, you have to pay 1001 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1421, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s531514271", "group_id": "codeNet:p02843", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := getInt()\n\n\tans := 0\n\ta := x / 100\n\tb := x % 100\n\tif b <= 5*a {\n\t\tans = 1\n\t}\n\tfmt.Fprintln(wr, ans)\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\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\nfunc getRunes() []rune {\n\treturn []rune(getString())\n}\n", "language": "Go", "metadata": {"date": 1575432035, "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/s531514271.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s531514271", "user_id": "u543933043"}, "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 solve() {\n\tx := getInt()\n\n\tans := 0\n\ta := x / 100\n\tb := x % 100\n\tif b <= 5*a {\n\t\tans = 1\n\t}\n\tfmt.Fprintln(wr, ans)\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\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\nfunc getRunes() []rune {\n\treturn []rune(getString())\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 815, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s070683707", "group_id": "codeNet:p02843", "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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar x int\nvar dp [100000 + 500]bool\n\nfunc main() {\n\tx = ReadInt()\n\n\tdp[0] = true\n\ttmp := []int{100, 101, 102, 103, 104, 105}\n\tfor i := 0; i <= 100000; i++ {\n\t\tfor _, v := range tmp {\n\t\t\tdp[i+v] = dp[i+v] || dp[i]\n\t\t}\n\t}\n\n\tif dp[x] {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n\n/*\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n*/\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1575260899, "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/s070683707.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s070683707", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\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\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\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\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}\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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar x int\nvar dp [100000 + 500]bool\n\nfunc main() {\n\tx = ReadInt()\n\n\tdp[0] = true\n\ttmp := []int{100, 101, 102, 103, 104, 105}\n\tfor i := 0; i <= 100000; i++ {\n\t\tfor _, v := range tmp {\n\t\t\tdp[i+v] = dp[i+v] || dp[i]\n\t\t}\n\t}\n\n\tif dp[x] {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n\n/*\n- MODは最後にとりましたか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n*/\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8644, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s411976052", "group_id": "codeNet:p02844", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_d\n*/\n\npackage 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\tn int\n\tS []rune\n)\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\n\tans := 0\n\tfor i := '0'; i <= '9'; i++ {\n\t\tfor j := '0'; j <= '9'; j++ {\n\t\t\tfor k := '0'; k <= '9'; k++ {\n\t\t\t\tR := []rune{i, j, k}\n\t\t\t\tif ok(R) {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc ok(T []rune) bool {\n\tcur := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif cur == 3 {\n\t\t\tbreak\n\t\t}\n\n\t\tif S[i] == T[cur] {\n\t\t\tcur++\n\t\t}\n\t}\n\n\treturn cur == 3\n}\n\n// DuplicatePatterns returns all patterns of n^k of elems([]rune).\nfunc DuplicatePatterns(elems []rune, k int) [][]rune {\n\treturn dupliRec([]rune{}, elems, k)\n}\n\n// DFS function for DuplicatePatterns.\nfunc dupliRec(pattern, elems []rune, k int) [][]rune {\n\tif len(pattern) == k {\n\t\treturn [][]rune{pattern}\n\t}\n\n\tres := [][]rune{}\n\tfor _, e := range elems {\n\t\tnewPattern := make([]rune, len(pattern))\n\t\tcopy(newPattern, pattern)\n\t\tnewPattern = append(newPattern, e)\n\n\t\tres = append(res, dupliRec(newPattern, elems, k)...)\n\t}\n\n\treturn res\n}\n\n/*******************************************************************/\n\n/********** common constants **********/\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\n/********** bufio setting **********/\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\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/*********** Input ***********/\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/*********** Output ***********/\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// 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\n/*********** Debugging ***********/\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// 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", "language": "Go", "metadata": {"date": 1597871764, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02844.html", "problem_id": "p02844", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02844/input.txt", "sample_output_relpath": "derived/input_output/data/p02844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02844/Go/s411976052.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s411976052", "user_id": "u103600314"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_d\n*/\n\npackage 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\tn int\n\tS []rune\n)\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\n\tans := 0\n\tfor i := '0'; i <= '9'; i++ {\n\t\tfor j := '0'; j <= '9'; j++ {\n\t\t\tfor k := '0'; k <= '9'; k++ {\n\t\t\t\tR := []rune{i, j, k}\n\t\t\t\tif ok(R) {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc ok(T []rune) bool {\n\tcur := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif cur == 3 {\n\t\t\tbreak\n\t\t}\n\n\t\tif S[i] == T[cur] {\n\t\t\tcur++\n\t\t}\n\t}\n\n\treturn cur == 3\n}\n\n// DuplicatePatterns returns all patterns of n^k of elems([]rune).\nfunc DuplicatePatterns(elems []rune, k int) [][]rune {\n\treturn dupliRec([]rune{}, elems, k)\n}\n\n// DFS function for DuplicatePatterns.\nfunc dupliRec(pattern, elems []rune, k int) [][]rune {\n\tif len(pattern) == k {\n\t\treturn [][]rune{pattern}\n\t}\n\n\tres := [][]rune{}\n\tfor _, e := range elems {\n\t\tnewPattern := make([]rune, len(pattern))\n\t\tcopy(newPattern, pattern)\n\t\tnewPattern = append(newPattern, e)\n\n\t\tres = append(res, dupliRec(newPattern, elems, k)...)\n\t}\n\n\treturn res\n}\n\n/*******************************************************************/\n\n/********** common constants **********/\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\n/********** bufio setting **********/\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\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/*********** Input ***********/\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/*********** Output ***********/\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// 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\n/*********** Debugging ***********/\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// 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", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "sample_input": "4\n0224\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02844", "source_text": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5724, "cpu_time_ms": 50, "memory_kb": 2016}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s185787526", "group_id": "codeNet:p02844", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\tpasswordMap := map[string]bool{}\n\tvar count int\n\tfor i := 0; i < n-2; i++ {\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tfor k := j + 1; k < n; k++ {\n\t\t\t\tpassword := s[i:i+1] + s[j:j+1] + s[k:k+1]\n\t\t\t\tif passwordMap[password] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpasswordMap[password] = true\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1590114787, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02844.html", "problem_id": "p02844", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02844/input.txt", "sample_output_relpath": "derived/input_output/data/p02844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02844/Go/s185787526.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s185787526", "user_id": "u717943620"}, "prompt_components": {"gold_output": "3\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\tpasswordMap := map[string]bool{}\n\tvar count int\n\tfor i := 0; i < n-2; i++ {\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tfor k := j + 1; k < n; k++ {\n\t\t\t\tpassword := s[i:i+1] + s[j:j+1] + s[k:k+1]\n\t\t\t\tif passwordMap[password] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tpasswordMap[password] = true\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "sample_input": "4\n0224\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02844", "source_text": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 404, "cpu_time_ms": 2107, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s962074414", "group_id": "codeNet:p02844", "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\n// 1 2 3 1 2 3\n\n// 1 2 3 3 3 3\n// 0 1 3 6 9 12\n// 0 0 1 4 10 19\n\nfunc main() {\n\tdefer Flush()\n\tN := readi()\n\tS := readb()\n\tdp := make([][]int64, 3)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, N)\n\t}\n\tm := make(map[byte]bool)\n\tfor i, c := range S {\n\t\tm[c] = true\n\t\tdp[0][i] = int64(len(m))\n\t}\n\tmemo := make([]int64, 10)\n\tfor i := 1; i < N; i++ {\n\t\tc := int(S[i] - '0')\n\t\tu := dp[0][i-1]\n\t\tdp[1][i] = dp[1][i-1] + u - memo[c]\n\t\tmemo[c] = u\n\t}\n\n\tmemo = make([]int64, 10)\n\tfor i := 2; i < N; i++ {\n\t\tc := int(S[i] - '0')\n\t\tu := dp[1][i-1]\n\t\tdp[2][i] = dp[2][i-1] + u - memo[c]\n\t\tmemo[c] = u\n\t}\n\tprintln(dp[2][N-1])\n\n}\n", "language": "Go", "metadata": {"date": 1575256507, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02844.html", "problem_id": "p02844", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02844/input.txt", "sample_output_relpath": "derived/input_output/data/p02844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02844/Go/s962074414.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s962074414", "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)\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\n// 1 2 3 1 2 3\n\n// 1 2 3 3 3 3\n// 0 1 3 6 9 12\n// 0 0 1 4 10 19\n\nfunc main() {\n\tdefer Flush()\n\tN := readi()\n\tS := readb()\n\tdp := make([][]int64, 3)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, N)\n\t}\n\tm := make(map[byte]bool)\n\tfor i, c := range S {\n\t\tm[c] = true\n\t\tdp[0][i] = int64(len(m))\n\t}\n\tmemo := make([]int64, 10)\n\tfor i := 1; i < N; i++ {\n\t\tc := int(S[i] - '0')\n\t\tu := dp[0][i-1]\n\t\tdp[1][i] = dp[1][i-1] + u - memo[c]\n\t\tmemo[c] = u\n\t}\n\n\tmemo = make([]int64, 10)\n\tfor i := 2; i < N; i++ {\n\t\tc := int(S[i] - '0')\n\t\tu := dp[1][i-1]\n\t\tdp[2][i] = dp[2][i-1] + u - memo[c]\n\t\tmemo[c] = u\n\t}\n\tprintln(dp[2][N-1])\n\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "sample_input": "4\n0224\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02844", "source_text": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5009, "cpu_time_ms": 4, "memory_kb": 1408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s756608850", "group_id": "codeNet:p02847", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S string\n\tweek := map[string]int{\"SUN\":0,\"MON\":6,\"TUE\":5,\"WED\":4,\"THU\":3,\"FRI\":2,\"SAT\":1}\n\tfor day,_ := range week {\n\t\tif S == day{\n\t\t\tfmt.Println(week[day])\n\t\t}\n\t}\n\tfmt.Scan(&S)\n\t\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1575940612, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02847.html", "problem_id": "p02847", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02847/input.txt", "sample_output_relpath": "derived/input_output/data/p02847/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02847/Go/s756608850.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s756608850", "user_id": "u891051541"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S string\n\tweek := map[string]int{\"SUN\":0,\"MON\":6,\"TUE\":5,\"WED\":4,\"THU\":3,\"FRI\":2,\"SAT\":1}\n\tfor day,_ := range week {\n\t\tif S == day{\n\t\t\tfmt.Println(week[day])\n\t\t}\n\t}\n\tfmt.Scan(&S)\n\t\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a string S representing the day of the week today.\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.\n\nAfter how many days is the next Sunday (tomorrow or later)?\n\nConstraints\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of days before the next Sunday.\n\nSample Input 1\n\nSAT\n\nSample Output 1\n\n1\n\nIt is Saturday today, and tomorrow will be Sunday.\n\nSample Input 2\n\nSUN\n\nSample Output 2\n\n7\n\nIt is Sunday today, and seven days later, it will be Sunday again.", "sample_input": "SAT\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02847", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a string S representing the day of the week today.\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT, for Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday, respectively.\n\nAfter how many days is the next Sunday (tomorrow or later)?\n\nConstraints\n\nS is SUN, MON, TUE, WED, THU, FRI, or SAT.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of days before the next Sunday.\n\nSample Input 1\n\nSAT\n\nSample Output 1\n\n1\n\nIt is Saturday today, and tomorrow will be Sunday.\n\nSample Input 2\n\nSUN\n\nSample Output 2\n\n7\n\nIt is Sunday today, and seven days later, it will be Sunday again.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 243, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s595023762", "group_id": "codeNet:p02848", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, S := ReadInt(), ReadString()\n\tt := []byte(S)\n\tfor i := 0; i < len(t); i++ {\n\t\tt[i] = (((t[i] - 'A') + byte(N)) % 26) + 'A'\n\t}\n\tfmt.Println(string(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", "language": "Go", "metadata": {"date": 1595898426, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s595023762.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595023762", "user_id": "u328656362"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, S := ReadInt(), ReadString()\n\tt := []byte(S)\n\tfor i := 0; i < len(t); i++ {\n\t\tt[i] = (((t[i] - 'A') + byte(N)) % 26) + 'A'\n\t}\n\tfmt.Println(string(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", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 459, "cpu_time_ms": 11, "memory_kb": 1960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s324557224", "group_id": "codeNet:p02850", "input_text": "// 深さ優先探索\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc paint(currentNode, usedColor, parentNode int, edges [][]int, colors map[int]int) {\n\tcolor := 1\n\tfor _, childNode := range edges[currentNode] {\n\t\tif childNode == parentNode {\n\t\t\tcontinue\n\t\t}\n\t\tif color == usedColor {\n\t\t\tcolor++\n\t\t}\n\t\tcolors[genid(currentNode, childNode)] = color\n\t\tpaint(childNode, color, currentNode, edges, colors)\n\t\tcolor++\n\t}\n}\n\nfunc genid(a, b int) int {\n\tif b < a {\n\t\ta, b = b, a\n\t}\n\treturn a*100000 + b\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\n\tab := make([][2]int, N-1)\n\tedges := make([][]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\ta := readInt() - 1\n\t\tb := readInt() - 1\n\t\tab[i][0], ab[i][1] = a, b\n\t\tedges[a] = append(edges[a], b)\n\t\tedges[b] = append(edges[b], a)\n\t}\n\n\tcolors := make(map[int]int)\n\tpaint(0, -1, -1, edges, colors)\n\n\tK := -1\n\tfor i := 0; i < N; i++ {\n\t\tt := len(edges[i])\n\t\tif t > K {\n\t\t\tK = t\n\t\t}\n\t}\n\tprintln(K)\n\n\tfor i := 0; i < N-1; i++ {\n\t\tprintln(colors[genid(ab[i][0], ab[i][1])])\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": 1586679603, "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/s324557224.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s324557224", "user_id": "u347640436"}, "prompt_components": {"gold_output": "2\n1\n2\n", "input_to_evaluate": "// 深さ優先探索\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc paint(currentNode, usedColor, parentNode int, edges [][]int, colors map[int]int) {\n\tcolor := 1\n\tfor _, childNode := range edges[currentNode] {\n\t\tif childNode == parentNode {\n\t\t\tcontinue\n\t\t}\n\t\tif color == usedColor {\n\t\t\tcolor++\n\t\t}\n\t\tcolors[genid(currentNode, childNode)] = color\n\t\tpaint(childNode, color, currentNode, edges, colors)\n\t\tcolor++\n\t}\n}\n\nfunc genid(a, b int) int {\n\tif b < a {\n\t\ta, b = b, a\n\t}\n\treturn a*100000 + b\n}\n\nfunc main() {\n\tdefer flush()\n\n\tN := readInt()\n\n\tab := make([][2]int, N-1)\n\tedges := make([][]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\ta := readInt() - 1\n\t\tb := readInt() - 1\n\t\tab[i][0], ab[i][1] = a, b\n\t\tedges[a] = append(edges[a], b)\n\t\tedges[b] = append(edges[b], a)\n\t}\n\n\tcolors := make(map[int]int)\n\tpaint(0, -1, -1, edges, colors)\n\n\tK := -1\n\tfor i := 0; i < N; i++ {\n\t\tt := len(edges[i])\n\t\tif t > K {\n\t\t\tK = t\n\t\t}\n\t}\n\tprintln(K)\n\n\tfor i := 0; i < N-1; i++ {\n\t\tprintln(colors[genid(ab[i][0], ab[i][1])])\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1747, "cpu_time_ms": 108, "memory_kb": 31872}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s491140555", "group_id": "codeNet:p02852", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst Inf = 1 << 62\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tS := ReadString()\n\tdp := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tdp[i] = Inf\n\t}\n\tdp[N] = 0\n\tblockSize := int(math.Sqrt(float64(N + 1)))\n\tblockNum := (N + 1 + blockSize - 1) / blockSize\n\tblocks := make([]int, blockNum)\n\tfor i := 0; i < blockNum; i++ {\n\t\tblocks[i] = Inf\n\t}\n\tblocks[N/blockSize] = 0\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif S[i] == '1' {\n\t\t\tcontinue\n\t\t}\n\t\tl := i + 1\n\t\tr := Min(i+M, N) + 1\n\t\tmin := Inf\n\t\tfor l%blockSize > 0 {\n\t\t\tif min > dp[l] {\n\t\t\t\tmin = dp[l]\n\t\t\t}\n\t\t\tl++\n\t\t}\n\t\tfor r%blockSize > 0 {\n\t\t\tr--\n\t\t\tif min > dp[r] {\n\t\t\t\tmin = dp[r]\n\t\t\t}\n\t\t}\n\t\tfor l < r {\n\t\t\tif min > blocks[l/blockSize] {\n\t\t\t\tmin = blocks[l/blockSize]\n\t\t\t}\n\t\t\tl += blockSize\n\t\t}\n\t\tdp[i] = min + 1\n\t}\n\n\tif dp[0] >= Inf {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tx := 0\n\trest := dp[0]\n\tfor x < N {\n\t\trest--\n\t\ti := 1\n\t\tfor dp[x+i] != rest {\n\t\t\ti++\n\t\t}\n\t\tfmt.Printf(\"%d \", i)\n\t\tx += i\n\t}\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 ReadString() (s string) { Scan(&s); return }\n", "language": "Go", "metadata": {"date": 1595137111, "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/s491140555.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s491140555", "user_id": "u328656362"}, "prompt_components": {"gold_output": "1 3 2 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst Inf = 1 << 62\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tS := ReadString()\n\tdp := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tdp[i] = Inf\n\t}\n\tdp[N] = 0\n\tblockSize := int(math.Sqrt(float64(N + 1)))\n\tblockNum := (N + 1 + blockSize - 1) / blockSize\n\tblocks := make([]int, blockNum)\n\tfor i := 0; i < blockNum; i++ {\n\t\tblocks[i] = Inf\n\t}\n\tblocks[N/blockSize] = 0\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif S[i] == '1' {\n\t\t\tcontinue\n\t\t}\n\t\tl := i + 1\n\t\tr := Min(i+M, N) + 1\n\t\tmin := Inf\n\t\tfor l%blockSize > 0 {\n\t\t\tif min > dp[l] {\n\t\t\t\tmin = dp[l]\n\t\t\t}\n\t\t\tl++\n\t\t}\n\t\tfor r%blockSize > 0 {\n\t\t\tr--\n\t\t\tif min > dp[r] {\n\t\t\t\tmin = dp[r]\n\t\t\t}\n\t\t}\n\t\tfor l < r {\n\t\t\tif min > blocks[l/blockSize] {\n\t\t\t\tmin = blocks[l/blockSize]\n\t\t\t}\n\t\t\tl += blockSize\n\t\t}\n\t\tdp[i] = min + 1\n\t}\n\n\tif dp[0] >= Inf {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tx := 0\n\trest := dp[0]\n\tfor x < N {\n\t\trest--\n\t\ti := 1\n\t\tfor dp[x+i] != rest {\n\t\t\ti++\n\t\t}\n\t\tfmt.Printf(\"%d \", i)\n\t\tx += i\n\t}\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 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1351, "cpu_time_ms": 15, "memory_kb": 3344}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s171415697", "group_id": "codeNet:p02855", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var h, w, k int\n fmt.Scanf(\"%d %d %d\", &h, &w, &k)\n\n sc := bufio.NewScanner(os.Stdin)\n sh := make([][]int, h)\n var count int\n for sc.Scan() {\n sw := make([]int, w)\n for i, s := range strings.Split(sc.Text(), \"\") {\n if s == \".\" {\n sw[i] = 0\n } else {\n sw[i] = 1\n }\n }\n sh[count] = sw\n count++\n if count == h {\n break\n }\n }\n\n var before string\n berryCount := 1\n for _, l := range sh {\n if !checkLine(l) {\n fmt.Println(before)\n continue\n }\n\n var l2 []int\n berryCount, l2 = splitLine(berryCount, l)\n //fmt.Printf(\"%d, %v\\n\", berryCount, l2)\n before = stringLine(l2)\n fmt.Println(before)\n }\n}\n\nfunc printLine(l []int) {\n fmt.Println(stringLine(l))\n}\n\nfunc stringLine(l []int) string {\n var str string\n for _, s := range l {\n str += strconv.Itoa(s) + \" \"\n }\n str = strings.TrimRight(str, \" \")\n return str\n}\n\nfunc splitLine(start int, l []int) (int, []int) {\n l2 := make([]int, len(l))\n end := start\n init := true\n for i, s := range l {\n if s == 1 {\n if init {\n init = false\n } else {\n end++\n }\n }\n l2[i] = end\n }\n\n end++\n\n return end, l2\n}\n\nfunc checkLine(l []int) bool {\n for _, s := range l {\n if s == 1 {\n return true\n }\n }\n return false\n}", "language": "Go", "metadata": {"date": 1574565872, "filename_ext": "go", "original_language": "Go (1.6)", "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/s171415697.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s171415697", "user_id": "u502098699"}, "prompt_components": {"gold_output": "1 2 2\n1 3 4\n5 5 4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var h, w, k int\n fmt.Scanf(\"%d %d %d\", &h, &w, &k)\n\n sc := bufio.NewScanner(os.Stdin)\n sh := make([][]int, h)\n var count int\n for sc.Scan() {\n sw := make([]int, w)\n for i, s := range strings.Split(sc.Text(), \"\") {\n if s == \".\" {\n sw[i] = 0\n } else {\n sw[i] = 1\n }\n }\n sh[count] = sw\n count++\n if count == h {\n break\n }\n }\n\n var before string\n berryCount := 1\n for _, l := range sh {\n if !checkLine(l) {\n fmt.Println(before)\n continue\n }\n\n var l2 []int\n berryCount, l2 = splitLine(berryCount, l)\n //fmt.Printf(\"%d, %v\\n\", berryCount, l2)\n before = stringLine(l2)\n fmt.Println(before)\n }\n}\n\nfunc printLine(l []int) {\n fmt.Println(stringLine(l))\n}\n\nfunc stringLine(l []int) string {\n var str string\n for _, s := range l {\n str += strconv.Itoa(s) + \" \"\n }\n str = strings.TrimRight(str, \" \")\n return str\n}\n\nfunc splitLine(start int, l []int) (int, []int) {\n l2 := make([]int, len(l))\n end := start\n init := true\n for i, s := range l {\n if s == 1 {\n if init {\n init = false\n } else {\n end++\n }\n }\n l2[i] = end\n }\n\n end++\n\n return end, l2\n}\n\nfunc checkLine(l []int) bool {\n for _, s := range l {\n if s == 1 {\n return true\n }\n }\n return false\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2099, "cpu_time_ms": 59, "memory_kb": 7168}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s338888197", "group_id": "codeNet:p02856", "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\tm := r.nextInt()\n\n\ttype line struct {\n\t\td, c int\n\t}\n\tans := 0\n\n\tlines := make([]line, 0, m)\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\tlp := line{r.nextInt(), r.nextInt()}\n\t\tif lp.d == 0 {\n\t\t\tans += lp.c\n\n\t\t} else {\n\t\t\tlines = append(lines, lp)\n\t\t}\n\t}\n\n\tcur := 0\n\td1, d2 := 0, 0\n\tfor cur < len(lines) {\n\t\tlp := &lines[cur]\n\t\tans++\n\t\td2 += lp.d\n\t\tlp.c--\n\n\t\tfor d2 >= 10 {\n\t\t\td1, d2 = d2/10, d2%10\n\t\t\tans++\n\t\t\td1, d2 = 0, d1+d2\n\t\t}\n\n\t\tif lp.c <= 0 {\n\t\t\tcur++\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans-1)\n}\n", "language": "Go", "metadata": {"date": 1574566722, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02856.html", "problem_id": "p02856", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02856/input.txt", "sample_output_relpath": "derived/input_output/data/p02856/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02856/Go/s338888197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s338888197", "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\tm := r.nextInt()\n\n\ttype line struct {\n\t\td, c int\n\t}\n\tans := 0\n\n\tlines := make([]line, 0, m)\n\tfor i := 0; i < m; i++ {\n\t\tr.Scan(true)\n\t\tlp := line{r.nextInt(), r.nextInt()}\n\t\tif lp.d == 0 {\n\t\t\tans += lp.c\n\n\t\t} else {\n\t\t\tlines = append(lines, lp)\n\t\t}\n\t}\n\n\tcur := 0\n\td1, d2 := 0, 0\n\tfor cur < len(lines) {\n\t\tlp := &lines[cur]\n\t\tans++\n\t\td2 += lp.d\n\t\tlp.c--\n\n\t\tfor d2 >= 10 {\n\t\t\td1, d2 = d2/10, d2%10\n\t\t\tans++\n\t\t\td1, d2 = 0, d1+d2\n\t\t}\n\n\t\tif lp.c <= 0 {\n\t\t\tcur++\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, ans-1)\n}\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.\n\nThe preliminary stage consists of several rounds, which will take place as follows:\n\nAll the N contestants will participate in the first round.\n\nWhen X contestants participate in some round, the number of contestants advancing to the next round will be decided as follows:\n\nThe organizer will choose two consecutive digits in the decimal notation of X, and replace them with the sum of these digits. The number resulted will be the number of contestants advancing to the next round.\n\nFor example, when X = 2378, the number of contestants advancing to the next round will be 578 (if 2 and 3 are chosen), 2108 (if 3 and 7 are chosen), or 2315 (if 7 and 8 are chosen).\n\nWhen X = 100, the number of contestants advancing to the next round will be 10, no matter which two digits are chosen.\n\nThe preliminary stage ends when 9 or fewer contestants remain.\n\nRingo, the chief organizer, wants to hold as many rounds as possible.\nFind the maximum possible number of rounds in the preliminary stage.\n\nSince the number of contestants, N, can be enormous, it is given to you as two integer sequences d_1, \\ldots, d_M and c_1, \\ldots, c_M, which means the following: the decimal notation of N consists of c_1 + c_2 + \\ldots + c_M digits, whose first c_1 digits are all d_1, the following c_2 digits are all d_2, \\ldots, and the last c_M digits are all d_M.\n\nConstraints\n\n1 \\leq M \\leq 200000\n\n0 \\leq d_i \\leq 9\n\nd_1 \\neq 0\n\nd_i \\neq d_{i+1}\n\nc_i \\geq 1\n\n2 \\leq c_1 + \\ldots + c_M \\leq 10^{15}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\nd_1 c_1\nd_2 c_2\n:\nd_M c_M\n\nOutput\n\nPrint the maximum possible number of rounds in the preliminary stage.\n\nSample Input 1\n\n2\n2 2\n9 1\n\nSample Output 1\n\n3\n\nIn this case, N = 229 contestants will participate in the first round. One possible progression of the preliminary stage is as follows:\n\n229 contestants participate in Round 1, 49 contestants participate in Round 2, 13 contestants participate in Round 3, and 4 contestants advance to the finals.\n\nHere, three rounds take place in the preliminary stage, which is the maximum possible number.\n\nSample Input 2\n\n3\n1 1\n0 8\n7 1\n\nSample Output 2\n\n9\n\nIn this case, 1000000007 will participate in the first round.", "sample_input": "2\n2 2\n9 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02856", "source_text": "Score: 500 points\n\nProblem Statement\n\nN programmers are going to participate in the preliminary stage of DDCC 20XX. Due to the size of the venue, however, at most 9 contestants can participate in the finals.\n\nThe preliminary stage consists of several rounds, which will take place as follows:\n\nAll the N contestants will participate in the first round.\n\nWhen X contestants participate in some round, the number of contestants advancing to the next round will be decided as follows:\n\nThe organizer will choose two consecutive digits in the decimal notation of X, and replace them with the sum of these digits. The number resulted will be the number of contestants advancing to the next round.\n\nFor example, when X = 2378, the number of contestants advancing to the next round will be 578 (if 2 and 3 are chosen), 2108 (if 3 and 7 are chosen), or 2315 (if 7 and 8 are chosen).\n\nWhen X = 100, the number of contestants advancing to the next round will be 10, no matter which two digits are chosen.\n\nThe preliminary stage ends when 9 or fewer contestants remain.\n\nRingo, the chief organizer, wants to hold as many rounds as possible.\nFind the maximum possible number of rounds in the preliminary stage.\n\nSince the number of contestants, N, can be enormous, it is given to you as two integer sequences d_1, \\ldots, d_M and c_1, \\ldots, c_M, which means the following: the decimal notation of N consists of c_1 + c_2 + \\ldots + c_M digits, whose first c_1 digits are all d_1, the following c_2 digits are all d_2, \\ldots, and the last c_M digits are all d_M.\n\nConstraints\n\n1 \\leq M \\leq 200000\n\n0 \\leq d_i \\leq 9\n\nd_1 \\neq 0\n\nd_i \\neq d_{i+1}\n\nc_i \\geq 1\n\n2 \\leq c_1 + \\ldots + c_M \\leq 10^{15}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM\nd_1 c_1\nd_2 c_2\n:\nd_M c_M\n\nOutput\n\nPrint the maximum possible number of rounds in the preliminary stage.\n\nSample Input 1\n\n2\n2 2\n9 1\n\nSample Output 1\n\n3\n\nIn this case, N = 229 contestants will participate in the first round. One possible progression of the preliminary stage is as follows:\n\n229 contestants participate in Round 1, 49 contestants participate in Round 2, 13 contestants participate in Round 3, and 4 contestants advance to the finals.\n\nHere, three rounds take place in the preliminary stage, which is the maximum possible number.\n\nSample Input 2\n\n3\n1 1\n0 8\n7 1\n\nSample Output 2\n\n9\n\nIn this case, 1000000007 will participate in the first round.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3152, "cpu_time_ms": 2108, "memory_kb": 9876}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s309057419", "group_id": "codeNet:p02860", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &s)\n\n\tans := \"No\"\n\tif len(s)%2 == 0 {\n\t\thalf := len(s) / 2\n\t\tif s[:half] == s[half:] {\n\t\t\tans = \"Yes\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1581350771, "filename_ext": "go", "original_language": "Go (1.6)", "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/s309057419.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309057419", "user_id": "u315984289"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &s)\n\n\tans := \"No\"\n\tif len(s)%2 == 0 {\n\t\thalf := len(s) / 2\n\t\tif s[:half] == s[half:] {\n\t\t\tans = \"Yes\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s962596755", "group_id": "codeNet:p02862", "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\nconst mod = 1000000007\n\nfunc mpow(a, b int) int {\n\tif b == 0 {\n\t\treturn 1\n\t} else if b%2 == 0 {\n\t\ttmp := mpow(a, b/2)\n\t\treturn tmp * tmp % mod\n\t}\n\treturn mpow(a, b-1) * a % mod\n}\n\nvar fracMemo = []int{1, 1}\n\nfunc mfrac(n int) int {\n\tif len(fracMemo) > n {\n\t\treturn fracMemo[n]\n\t}\n\tif len(fracMemo) == 0 {\n\t\tfracMemo = append(fracMemo, 1)\n\t}\n\tfor len(fracMemo) <= n {\n\t\tsize := len(fracMemo)\n\t\tfracMemo = append(fracMemo, fracMemo[size-1]*size%mod)\n\t}\n\treturn fracMemo[n]\n}\n\nvar ifracMemo = []int{1, 1}\n\nfunc mifrac(n int) int {\n\tif len(ifracMemo) > n {\n\t\treturn ifracMemo[n]\n\t}\n\tif len(ifracMemo) == 0 {\n\t\tfracMemo = append(ifracMemo, 1)\n\t}\n\tfor len(ifracMemo) <= n {\n\t\tsize := len(ifracMemo)\n\t\tifracMemo = append(ifracMemo, ifracMemo[size-1]*mpow(size, mod-2)%mod)\n\t}\n\treturn ifracMemo[n]\n}\n\nfunc nCr(n, r int) int {\n\tif n == r {\n\t\treturn 1\n\t}\n\tif n < r || r < 0 {\n\t\treturn 0\n\t}\n\tret := 1\n\tret *= mfrac(n)\n\tret %= mod\n\tret *= mifrac(r)\n\tret %= mod\n\tret *= mifrac(n - r)\n\tret %= mod\n\treturn (ret)\n}\n\n// 逆元を使った割り算(MOD)\n// mod. m での a の逆元 a^{-1} を計算する\nfunc modinv(a, m int) int {\n\tb := m\n\tu := 1\n\tv := 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 %= m\n\tif u < 0 {\n\t\tu += m\n\t}\n\treturn u\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tX, Y := getInt(), getInt()\n\n\ta := 2*X - Y\n\tb := 2*Y - X\n\tif a%3 != 0 || b%3 != 0 {\n\t\tout(0)\n\t\treturn\n\t}\n\ta /= 3\n\tb /= 3\n\n\tans := 1\n\tfor i := 1; i <= a+b; i++ {\n\t\tans *= i\n\t\tans %= mod\n\t}\n\tas := 1\n\tfor i := 1; i <= a; i++ {\n\t\tas *= i\n\t\tas %= mod\n\t}\n\tbs := 1\n\tfor i := 1; i <= b; i++ {\n\t\tbs *= i\n\t\tbs %= mod\n\t}\n\n\t// out(ans, as, bs)\n\tans *= modinv(as, mod)\n\tans %= mod\n\tans *= modinv(bs, mod)\n\tans %= mod\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1591407765, "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/s962596755.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s962596755", "user_id": "u814575783"}, "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 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\nconst mod = 1000000007\n\nfunc mpow(a, b int) int {\n\tif b == 0 {\n\t\treturn 1\n\t} else if b%2 == 0 {\n\t\ttmp := mpow(a, b/2)\n\t\treturn tmp * tmp % mod\n\t}\n\treturn mpow(a, b-1) * a % mod\n}\n\nvar fracMemo = []int{1, 1}\n\nfunc mfrac(n int) int {\n\tif len(fracMemo) > n {\n\t\treturn fracMemo[n]\n\t}\n\tif len(fracMemo) == 0 {\n\t\tfracMemo = append(fracMemo, 1)\n\t}\n\tfor len(fracMemo) <= n {\n\t\tsize := len(fracMemo)\n\t\tfracMemo = append(fracMemo, fracMemo[size-1]*size%mod)\n\t}\n\treturn fracMemo[n]\n}\n\nvar ifracMemo = []int{1, 1}\n\nfunc mifrac(n int) int {\n\tif len(ifracMemo) > n {\n\t\treturn ifracMemo[n]\n\t}\n\tif len(ifracMemo) == 0 {\n\t\tfracMemo = append(ifracMemo, 1)\n\t}\n\tfor len(ifracMemo) <= n {\n\t\tsize := len(ifracMemo)\n\t\tifracMemo = append(ifracMemo, ifracMemo[size-1]*mpow(size, mod-2)%mod)\n\t}\n\treturn ifracMemo[n]\n}\n\nfunc nCr(n, r int) int {\n\tif n == r {\n\t\treturn 1\n\t}\n\tif n < r || r < 0 {\n\t\treturn 0\n\t}\n\tret := 1\n\tret *= mfrac(n)\n\tret %= mod\n\tret *= mifrac(r)\n\tret %= mod\n\tret *= mifrac(n - r)\n\tret %= mod\n\treturn (ret)\n}\n\n// 逆元を使った割り算(MOD)\n// mod. m での a の逆元 a^{-1} を計算する\nfunc modinv(a, m int) int {\n\tb := m\n\tu := 1\n\tv := 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 %= m\n\tif u < 0 {\n\t\tu += m\n\t}\n\treturn u\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tX, Y := getInt(), getInt()\n\n\ta := 2*X - Y\n\tb := 2*Y - X\n\tif a%3 != 0 || b%3 != 0 {\n\t\tout(0)\n\t\treturn\n\t}\n\ta /= 3\n\tb /= 3\n\n\tans := 1\n\tfor i := 1; i <= a+b; i++ {\n\t\tans *= i\n\t\tans %= mod\n\t}\n\tas := 1\n\tfor i := 1; i <= a; i++ {\n\t\tas *= i\n\t\tas %= mod\n\t}\n\tbs := 1\n\tfor i := 1; i <= b; i++ {\n\t\tbs *= i\n\t\tbs %= mod\n\t}\n\n\t// out(ans, as, bs)\n\tans *= modinv(as, mod)\n\tans %= mod\n\tans *= modinv(bs, mod)\n\tans %= mod\n\tout(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2599, "cpu_time_ms": 8, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s917841457", "group_id": "codeNet:p02862", "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 gcdex(x, y int) []int {\n\tif y == 0 {\n\t\treturn []int{1, 0, x}\n\t}\n\n\t//x - y * (x/y) = x%y\n\t//y - x%y * b = c\n\t//y*a - (x-y*(x/y))*b = c\n\t//-x*b - y*(-a - x/y * b) = c\n\tabc := gcdex(y, x%y)\n\treturn []int{y - abc[1], x - abc[0] - x/y*abc[1], abc[2]}\n}\n\nfunc gcdex2(x, y int) []int {\n\t// r2 = r0 - r1 * q0\n\t// r3 = r1 - r2 * q1\n\t// x*a2 - y*b2 = x*a0 - y*b0 -(x*a1 - y*b1) * q0\n\t// = x*(a0 - a1 * q0) - y(b0 - b1 * q0)\n\tr0, r1 := x, y\n\ta0, a1 := 1, 0\n\tb0, b1 := 0, 1\n\tfor r1 > 0 {\n\t\tq := r0 / r1\n\t\tr0, r1 = r1, r0-r1*q\n\t\ta0, a1 = a1, a0-a1*q\n\t\tb0, b1 = b1, b0-b1*q\n\t}\n\treturn []int{y + a0, x + b0, r0}\n}\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tx, y := r.nextInt(), r.nextInt()\n\tMOD := pow(10, 9, 0) + 7\n\n\tx2, y2 := -x+2*y, 2*x-y\n\n\tff := make([]int, 2*pow(10, 6, 0)+1)\n\tff[0] = 1\n\tfor i := 1; i < len(ff); i++ {\n\t\tff[i] = ff[i-1] * i % MOD\n\t}\n\n\tf := func(n int) int {\n\t\treturn ff[n]\n\t}\n\n\tans := 0\n\tif x2 >= 0 && x2%3 == 0 && y2 >= 0 && y2%3 == 0 {\n\t\tx3, y3 := int(x2/3), int(y2/3)\n\t\tans = f(x3+y3) * gcdex2(f(x3), MOD)[0] % MOD * gcdex2(f(y3), MOD)[0] % MOD\n\t}\n\tfmt.Fprintln(stdout, ans%MOD)\n}\n", "language": "Go", "metadata": {"date": 1574031463, "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/s917841457.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s917841457", "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 gcdex(x, y int) []int {\n\tif y == 0 {\n\t\treturn []int{1, 0, x}\n\t}\n\n\t//x - y * (x/y) = x%y\n\t//y - x%y * b = c\n\t//y*a - (x-y*(x/y))*b = c\n\t//-x*b - y*(-a - x/y * b) = c\n\tabc := gcdex(y, x%y)\n\treturn []int{y - abc[1], x - abc[0] - x/y*abc[1], abc[2]}\n}\n\nfunc gcdex2(x, y int) []int {\n\t// r2 = r0 - r1 * q0\n\t// r3 = r1 - r2 * q1\n\t// x*a2 - y*b2 = x*a0 - y*b0 -(x*a1 - y*b1) * q0\n\t// = x*(a0 - a1 * q0) - y(b0 - b1 * q0)\n\tr0, r1 := x, y\n\ta0, a1 := 1, 0\n\tb0, b1 := 0, 1\n\tfor r1 > 0 {\n\t\tq := r0 / r1\n\t\tr0, r1 = r1, r0-r1*q\n\t\ta0, a1 = a1, a0-a1*q\n\t\tb0, b1 = b1, b0-b1*q\n\t}\n\treturn []int{y + a0, x + b0, r0}\n}\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tx, y := r.nextInt(), r.nextInt()\n\tMOD := pow(10, 9, 0) + 7\n\n\tx2, y2 := -x+2*y, 2*x-y\n\n\tff := make([]int, 2*pow(10, 6, 0)+1)\n\tff[0] = 1\n\tfor i := 1; i < len(ff); i++ {\n\t\tff[i] = ff[i-1] * i % MOD\n\t}\n\n\tf := func(n int) int {\n\t\treturn ff[n]\n\t}\n\n\tans := 0\n\tif x2 >= 0 && x2%3 == 0 && y2 >= 0 && y2%3 == 0 {\n\t\tx3, y3 := int(x2/3), int(y2/3)\n\t\tans = f(x3+y3) * gcdex2(f(x3), MOD)[0] % MOD * gcdex2(f(y3), MOD)[0] % MOD\n\t}\n\tfmt.Fprintln(stdout, ans%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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3722, "cpu_time_ms": 43, "memory_kb": 17024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s123642173", "group_id": "codeNet:p02864", "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 Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc Compare(A, B []int) []int {\n if A[0] < B[0] { return A }\n return B\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][]int, N + 1)\n for i := range DP {\n DP[i] = make([][]int, K + 1)\n for j := range DP[i] {\n DP[i][j] = []int{int(1e9 + 7) * i, 0}\n }\n }\n for i, h := range H {\n for j, dp := range DP[i] {\n DP[i + 1][j] = Compare([]int{dp[0] + Max(h - dp[1], 0), h}, DP[i + 1][j])\n if 0 < j {\n DP[i + 1][j] = Compare(DP[i][j - 1], DP[i + 1][j])\n DP[i + 1][j] = Compare(DP[i + 1][j - 1], DP[i + 1][j])\n }\n }\n }\n Write(DP[N][K][0])\n Output()\n}", "language": "Go", "metadata": {"date": 1578304218, "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/s123642173.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s123642173", "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 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 Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc Compare(A, B []int) []int {\n if A[0] < B[0] { return A }\n return B\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][]int, N + 1)\n for i := range DP {\n DP[i] = make([][]int, K + 1)\n for j := range DP[i] {\n DP[i][j] = []int{int(1e9 + 7) * i, 0}\n }\n }\n for i, h := range H {\n for j, dp := range DP[i] {\n DP[i + 1][j] = Compare([]int{dp[0] + Max(h - dp[1], 0), h}, DP[i + 1][j])\n if 0 < j {\n DP[i + 1][j] = Compare(DP[i][j - 1], DP[i + 1][j])\n DP[i + 1][j] = Compare(DP[i + 1][j - 1], DP[i + 1][j])\n }\n }\n }\n Write(DP[N][K][0])\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1648, "cpu_time_ms": 15, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s436476495", "group_id": "codeNet:p02864", "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 Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc Compare(A, B []int) []int {\n if A[0] < B[0] { return A }\n return B\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][]int, K + 1)\n for i := range DP {\n DP[i] = make([][]int, N + 1)\n for j := range DP[i] {\n DP[i][j] = []int{int(1e9 + 7) * j, 0}\n }\n }\n for i := range DP {\n for j, h := range H {\n DP[i][j + 1] = Compare([]int{DP[i][j][0] + Max(h - DP[i][j][1], 0), h}, DP[i][j + 1])\n if 0 < i {\n DP[i][j + 1] = Compare(DP[i - 1][j], DP[i][j + 1])\n }\n }\n }\n Write(DP[K][N][0])\n Output()\n}", "language": "Go", "metadata": {"date": 1578303150, "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/s436476495.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s436476495", "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 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 Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc Compare(A, B []int) []int {\n if A[0] < B[0] { return A }\n return B\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][]int, K + 1)\n for i := range DP {\n DP[i] = make([][]int, N + 1)\n for j := range DP[i] {\n DP[i][j] = []int{int(1e9 + 7) * j, 0}\n }\n }\n for i := range DP {\n for j, h := range H {\n DP[i][j + 1] = Compare([]int{DP[i][j][0] + Max(h - DP[i][j][1], 0), h}, DP[i][j + 1])\n if 0 < i {\n DP[i][j + 1] = Compare(DP[i - 1][j], DP[i][j + 1])\n }\n }\n }\n Write(DP[K][N][0])\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1590, "cpu_time_ms": 18, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s085578315", "group_id": "codeNet:p02864", "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 Output() {\n _ = writer.Flush()\n}\n\ntype Food struct {\n A int\n B int\n}\ntype Foods []Food\nfunc (F Foods) Len() int { return len(F) }\nfunc (F Foods) Less(i, j int) bool {\n if F[i].A == F[j].A { return F[i].B > F[j].B }\n return F[i].A < F[j].A\n}\nfunc (F Foods) Swap(i, j int) { F[i], F[j] = F[j], F[i] }\n\nfunc Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc MinVec(x, y []int) []int {\n if x[0] < y[0] { return x }\n return y\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][][]int, N + 1)\n for i := range DP {\n DP[i] = make([][][]int, K + 1)\n for j := range DP[i] {\n DP[i][j] = make([][]int, 2)\n for k := range DP[i][j] {\n DP[i][j][k] = make([]int, 2)\n }\n }\n }\n for i := 0; i < N; i++ {\n DP[i + 1][0][0] = []int{DP[i][0][0][0] + Max(H[i] - DP[i][0][0][1], 0), H[i]}\n DP[i + 1][0][1] = []int{DP[i][0][1][0] + Max(H[i] - DP[i][0][1][1], 0), H[i]}\n for j := 0; j < K; j++ {\n dp00 := []int{DP[i][j + 1][0][0] + Max(H[i] - DP[i][j + 1][0][1], 0), H[i]}\n dp01 := []int{DP[i][j + 1][1][0] + Max(H[i] - DP[i][j + 1][1][1], 0), H[i]}\n dp10 := []int{DP[i][j][0][0], DP[i][j][0][1]}\n dp11 := []int{DP[i][j][1][0], DP[i][j][1][1]}\n DP[i + 1][j + 1][0] = MinVec(dp00, dp01)\n DP[i + 1][j + 1][1] = MinVec(dp10, dp11)\n }\n }\n ans := DP[N][0][0][0]\n for _, dp := range DP[N] {\n ans = Min(Min(dp[0][0], dp[1][0]), ans)\n }\n Write(ans)\n Output()\n}", "language": "Go", "metadata": {"date": 1573968191, "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/s085578315.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s085578315", "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 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 Output() {\n _ = writer.Flush()\n}\n\ntype Food struct {\n A int\n B int\n}\ntype Foods []Food\nfunc (F Foods) Len() int { return len(F) }\nfunc (F Foods) Less(i, j int) bool {\n if F[i].A == F[j].A { return F[i].B > F[j].B }\n return F[i].A < F[j].A\n}\nfunc (F Foods) Swap(i, j int) { F[i], F[j] = F[j], F[i] }\n\nfunc Max(x, y int) int {\n if x < y { return y }\n return x\n}\nfunc Min(x, y int) int {\n if x < y { return x }\n return y\n}\nfunc MinVec(x, y []int) []int {\n if x[0] < y[0] { return x }\n return y\n}\n\nfunc main() {\n NK := NextIntVec()\n N, K := NK[0], NK[1]\n H := NextIntVec()\n DP := make([][][][]int, N + 1)\n for i := range DP {\n DP[i] = make([][][]int, K + 1)\n for j := range DP[i] {\n DP[i][j] = make([][]int, 2)\n for k := range DP[i][j] {\n DP[i][j][k] = make([]int, 2)\n }\n }\n }\n for i := 0; i < N; i++ {\n DP[i + 1][0][0] = []int{DP[i][0][0][0] + Max(H[i] - DP[i][0][0][1], 0), H[i]}\n DP[i + 1][0][1] = []int{DP[i][0][1][0] + Max(H[i] - DP[i][0][1][1], 0), H[i]}\n for j := 0; j < K; j++ {\n dp00 := []int{DP[i][j + 1][0][0] + Max(H[i] - DP[i][j + 1][0][1], 0), H[i]}\n dp01 := []int{DP[i][j + 1][1][0] + Max(H[i] - DP[i][j + 1][1][1], 0), H[i]}\n dp10 := []int{DP[i][j][0][0], DP[i][j][0][1]}\n dp11 := []int{DP[i][j][1][0], DP[i][j][1][1]}\n DP[i + 1][j + 1][0] = MinVec(dp00, dp01)\n DP[i + 1][j + 1][1] = MinVec(dp10, dp11)\n }\n }\n ans := DP[N][0][0][0]\n for _, dp := range DP[N] {\n ans = Min(Min(dp[0][0], dp[1][0]), ans)\n }\n Write(ans)\n Output()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2236, "cpu_time_ms": 74, "memory_kb": 15360}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s209412122", "group_id": "codeNet:p02866", "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\tans = 1\n\tfor bit := 1 << 62; ; 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//n := r.nextInt()\n\tr.Scan(true)\n\td := r.nextStringArray().toInts()\n\n\tdc := func(a []int) map[int]int {\n\t\tc := map[int]int{}\n\t\tfor i := range a {\n\t\t\tc[a[i]]++\n\t\t}\n\t\treturn c\n\t}(d)\n\n\tans := 1\n\tconst MOD = 998244353\n\tif v, ok := dc[0]; !ok || v != 1 {\n\t\tans = 0\n\t} else {\n\t\tfor i, endi := 1, len(dc); i < endi; i++ {\n\t\t\tif _, ok := dc[i]; !ok {\n\t\t\t\tans = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor j := 0; j < dc[i]; j++ {\n\t\t\t\tans = ans * dc[i-1] % MOD\n\t\t\t}\n\t\t\t//ans = (ans * pow(dc[i-1], dc[i], MOD)) % MOD\n\t\t}\n\n\t}\n\n\tfmt.Fprintln(stdout, ans)\n}\n", "language": "Go", "metadata": {"date": 1573382288, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02866.html", "problem_id": "p02866", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02866/input.txt", "sample_output_relpath": "derived/input_output/data/p02866/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02866/Go/s209412122.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s209412122", "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\tans = 1\n\tfor bit := 1 << 62; ; 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//n := r.nextInt()\n\tr.Scan(true)\n\td := r.nextStringArray().toInts()\n\n\tdc := func(a []int) map[int]int {\n\t\tc := map[int]int{}\n\t\tfor i := range a {\n\t\t\tc[a[i]]++\n\t\t}\n\t\treturn c\n\t}(d)\n\n\tans := 1\n\tconst MOD = 998244353\n\tif v, ok := dc[0]; !ok || v != 1 {\n\t\tans = 0\n\t} else {\n\t\tfor i, endi := 1, len(dc); i < endi; i++ {\n\t\t\tif _, ok := dc[i]; !ok {\n\t\t\t\tans = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfor j := 0; j < dc[i]; j++ {\n\t\t\t\tans = ans * dc[i-1] % MOD\n\t\t\t}\n\t\t\t//ans = (ans * pow(dc[i-1], dc[i], MOD)) % MOD\n\t\t}\n\n\t}\n\n\tfmt.Fprintln(stdout, ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition:\n\nFor every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i.\n\nNotes\n\nA tree of N vertices is a connected undirected graph with N vertices and N-1 edges, and the distance between two vertices are the number of edges in the shortest path between them.\n\nTwo trees are considered different if and only if there are two vertices x and y such that there is an edge between x and y in one of those trees and not in the other.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq D_i \\leq N-1\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 answer.\n\nSample Input 1\n\n4\n0 1 1 2\n\nSample Output 1\n\n2\n\nFor example, a tree with edges (1,2), (1,3), and (2,4) satisfies the condition.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n7\n0 3 2 1 2 2 1\n\nSample Output 3\n\n24", "sample_input": "4\n0 1 1 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02866", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is an integer sequence D_1,...,D_N of N elements. Find the number, modulo 998244353, of trees with N vertices numbered 1 to N that satisfy the following condition:\n\nFor every integer i from 1 to N, the distance between Vertex 1 and Vertex i is D_i.\n\nNotes\n\nA tree of N vertices is a connected undirected graph with N vertices and N-1 edges, and the distance between two vertices are the number of edges in the shortest path between them.\n\nTwo trees are considered different if and only if there are two vertices x and y such that there is an edge between x and y in one of those trees and not in the other.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq D_i \\leq N-1\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 answer.\n\nSample Input 1\n\n4\n0 1 1 2\n\nSample Output 1\n\n2\n\nFor example, a tree with edges (1,2), (1,3), and (2,4) satisfies the condition.\n\nSample Input 2\n\n4\n1 1 1 1\n\nSample Output 2\n\n0\n\nSample Input 3\n\n7\n0 3 2 1 2 2 1\n\nSample Output 3\n\n24", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3144, "cpu_time_ms": 51, "memory_kb": 7424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s343370524", "group_id": "codeNet:p02867", "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)\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//RBNodeDir is\ntype RBNodeDir int\n\nconst (\n\n\t//RBNodeLeft is\n\tRBNodeLeft RBNodeDir = iota\n\n\t//RBNodeRight is\n\tRBNodeRight\n\n\t//RBNodeHere is\n\tRBNodeHere\n)\n\n//RBNode is\ntype RBNode struct {\n\tisRed bool\n\tIndex int\n\tparent *RBNode\n\tchildren [2]*RBNode\n}\n\n//RBTree is\ntype RBTree struct {\n\tNode *RBNode\n\tless func(i int, j int) bool\n}\n\n//RBCursor is\ntype RBCursor RBTree\n\n//NewTree is\nfunc NewTree(less func(i int, j int) bool) *RBTree {\n\ttree := &RBTree{less: less}\n\treturn tree\n}\n\n//Cursor is\nfunc (cur *RBTree) Cursor() *RBCursor {\n\twrk := RBCursor(*cur)\n\treturn &wrk\n}\n\nfunc (cur *RBTree) root() *RBTree {\n\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.parent != nil; cur.Node = cur.Node.parent {\n\n\t\t}\n\t}\n\treturn cur\n}\n\n//Move is\nfunc (cur *RBCursor) Move(dir RBNodeDir) *RBCursor {\n\trev := dir ^ 1\n\tif next := cur.Node.children[dir]; next != nil {\n\t\tfor next.children[rev] != nil {\n\t\t\tnext = next.children[rev]\n\t\t}\n\t\tcur.Node = next\n\t} else {\n\t\tfind := false\n\t\tfor cur.Node.parent != nil {\n\t\t\tnow := cur.Node\n\t\t\tcur.Node = cur.Node.parent\n\t\t\tif cur.Node.children[rev] == now {\n\t\t\t\tfind = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !find {\n\t\t\tcur.Node = nil\n\t\t}\n\t}\n\treturn cur\n}\n\n//Find is\nfunc (cur *RBTree) Find(Index int) (*RBTree, RBNodeDir) {\n\tdir := RBNodeLeft\n\tif cur.Node == nil {\n\t\treturn cur, dir\n\t}\n\tcur.root()\n\tfor {\n\t\tif cur.less(Index, cur.Node.Index) {\n\t\t\tdir = RBNodeLeft\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\n\t\t} else if cur.less(cur.Node.Index, Index) {\n\t\t\tdir = RBNodeRight\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\t\t} else {\n\t\t\tdir = RBNodeHere\n\t\t\tbreak\n\t\t}\n\t}\n\treturn cur, dir\n}\n\n//Add is\nfunc (cur *RBTree) Add(Index int) *RBTree {\n\tnewNode := &RBNode{Index: Index, isRed: true}\n\tcur.root()\n\tif cur.Node != nil {\n\t\tpnode, dir := cur.Find(newNode.Index)\n\t\tif dir != RBNodeHere {\n\t\t\tnewNode.parent = pnode.Node\n\t\t\tnewNode.parent.children[dir] = newNode\n\t\t\tnewNode.opt()\n\t\t} else {\n\t\t\tpnode.Node.Index = newNode.Index\n\t\t\tnewNode = pnode.Node\n\t\t}\n\t}\n\tcur.Node = newNode\n\treturn cur\n}\n\nfunc (Node *RBNode) flip(dir RBNodeDir) {\n\tcurGranPa := Node.parent\n\tnewParent := Node.children[dir]\n\tif curGranPa != nil {\n\t\tcurGranPa.children[Node.dir()] = newParent\n\t}\n\tnewParent.parent, Node.parent = Node.parent, newParent\n\n\tNode.children[dir] = newParent.children[dir^1]\n\tif Node.children[dir] != nil {\n\t\tNode.children[dir].parent = Node\n\t}\n\tnewParent.children[dir^1] = Node\n\n}\nfunc (Node *RBNode) dir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.parent.children[dir] != Node {\n\t\tdir = RBNodeRight\n\t}\n\treturn dir\n}\nfunc (Node *RBNode) opt() {\n\tfor Node != nil && Node.isRed {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t} else if !parent.isRed {\n\t\t\tbreak\n\t\t} else if parent.parent == nil {\n\t\t\tparent.isRed = false\n\t\t} else {\n\t\t\tgrandparent := parent.parent\n\t\t\tparentsibling := grandparent.children[parent.dir()^1]\n\t\t\tif parentsibling != nil && parentsibling.isRed {\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tparent.isRed = false\n\t\t\t\tparentsibling.isRed = false\n\t\t\t\tNode = grandparent\n\t\t\t} else {\n\t\t\t\tdir := parent.dir()\n\n\t\t\t\tif parent.children[dir] != Node {\n\t\t\t\t\tparent.flip(dir ^ 1)\n\t\t\t\t}\n\n\t\t\t\tgrandparent.flip(dir)\n\t\t\t\tgrandparent.parent.isRed = false\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n//End is\nfunc (cur *RBTree) End(dir RBNodeDir) *RBCursor {\n\tcur.root()\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.children[dir] != nil; cur.Node = cur.Node.children[dir] {\n\n\t\t}\n\t}\n\treturn cur.Cursor()\n}\n\nfunc (Node *RBNode) cut() {\n\tif Node.parent != nil {\n\t\tNode.parent.children[Node.dir()] = nil\n\t}\n}\n\nfunc (Node *RBNode) hasDir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.children[dir] == nil {\n\t\tdir = RBNodeRight\n\t\tif Node.children[dir] == nil {\n\t\t\tdir = RBNodeHere\n\t\t}\n\t}\n\treturn dir\n}\n\n//Delete is\nfunc (cur *RBTree) Delete(Index int) (ret bool) {\n\twcur, dir := cur.Find(Index)\n\tif dir != RBNodeHere {\n\t\treturn\n\t}\n\tdelNode := wcur.Node\n\tret = true\n\n\tdir = delNode.hasDir()\n\n\tif delNode.children[RBNodeLeft] != nil &&\n\t\tdelNode.children[RBNodeRight] != nil {\n\t\tvar wrk *RBCursor\n\t\tif dir != RBNodeHere {\n\t\t\twrk = wcur.Cursor().Move(dir)\n\t\t\tdelNode.Index = wrk.Node.Index\n\t\t\tdelNode = wrk.Node\n\t\t\tdir = delNode.hasDir()\n\t\t}\n\t}\n\n\tif dir == RBNodeHere {\n\t\tif delNode.isRed {\n\t\t\tdelNode.cut()\n\t\t\tcur.Node = delNode.parent\n\t\t\treturn\n\t\t}\n\t} else {\n\t\twrk := delNode.children[dir]\n\t\tdelNode.Index = wrk.Index\n\t\twrk.cut()\n\t\treturn\n\t}\n\n\tNode := delNode\n\tfor {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tdir := Node.dir()\n\t\tdirOther := dir ^ 1\n\t\tsibling := parent.children[dirOther]\n\n\t\tif sibling.isRed {\n\t\t\t//sibling is Red\n\t\t\tparent.flip(dirOther)\n\t\t\tsibling.isRed = false\n\t\t\tparent.isRed = true\n\t\t\tsibling = parent.children[dirOther]\n\t\t}\n\t\t//sibling is Black\n\n\t\tnephew := sibling.children[dirOther]\n\t\tif nephew == nil || !nephew.isRed {\n\t\t\t//far nephew is Black\n\t\t\tnephew = sibling.children[dir]\n\t\t\tif nephew == nil || !nephew.isRed {\n\t\t\t\t//near nephew is Black\n\t\t\t\tsibling.isRed = true\n\t\t\t\tif parent.isRed {\n\t\t\t\t\tparent.isRed = false\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tNode = parent\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t//near nephew is Red and far nephew is Black\n\t\t\tsibling.flip(dir)\n\t\t\tsibling, nephew = nephew, sibling\n\t\t\tsibling.isRed = false\n\t\t\tnephew.isRed = true\n\t\t}\n\t\t//sibling is Black && far nephew is Red\n\n\t\tparent.flip(dirOther)\n\t\tsibling.isRed = parent.isRed\n\t\tparent.isRed = false\n\t\tnephew.isRed = false\n\t\tbreak\n\t}\n\tdelNode.cut()\n\tcur.Node = delNode.parent\n\treturn\n}\n\ntype isA int\n\nconst (\n\tatype isA = 1\n\tbtype = 2\n)\n\ntype pair struct {\n\ta int\n\tb int\n\ti int\n}\ntype bup []pair\n\nfunc (a bup) Len() int { return len(a) }\nfunc (a bup) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a bup) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].b != a[j].b:\n\t\treturn a[i].b < a[j].b\n\tdefault:\n\t\treturn a[i].a <= a[j].a\n\t}\n}\n\ntype aup []*pair\n\nfunc (a aup) Len() int { return len(a) }\nfunc (a aup) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a aup) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].a != a[j].a:\n\t\treturn a[i].a < a[j].a\n\tdefault:\n\t\treturn a[i].b <= a[j].b\n\t}\n}\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(false)\n\tn := r.nextInt()\n\tr.Scan(true)\n\ta := r.nextStringArray().toInts()\n\tr.Scan(true)\n\tb := r.nextStringArray().toInts()\n\n\ttargetB := make([]pair, len(a))\n\tansA := make([]*pair, len(a))\n\tfor i := range a {\n\t\tp := &targetB[i]\n\t\tp.a = a[i]\n\t\tp.b = b[i]\n\t\tansA[i] = p\n\t}\n\tsort.Sort(bup(targetB))\n\tsort.Sort(aup(ansA))\n\n\tcondAltB := true\n\tcondAdpl := false\n\tfor i := range targetB {\n\t\tif ansA[i].a > targetB[i].b {\n\t\t\tcondAltB = false\n\t\t\tbreak\n\t\t}\n\n\t\tif targetB[i].a == ansA[i].a {\n\t\t\tcondAdpl = true\n\t\t}\n\n\t\tif i < n-1 && ansA[i+1].a <= targetB[i].b {\n\t\t\tcondAdpl = true\n\t\t}\n\n\t}\n\n\tans := condAltB\n\tif ans {\n\t\tans = condAdpl\n\t\tif !ans {\n\t\t\tfor i := range ansA {\n\t\t\t\tansA[i].i = i\n\t\t\t}\n\t\t\tcur := targetB[0].i\n\t\t\tcnt := 0\n\t\t\tfor cur != 0 {\n\t\t\t\tcnt++\n\t\t\t\tcur = targetB[cur].i\n\t\t\t}\n\t\t\tif cnt <= n-2 {\n\t\t\t\tans = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, []string{\"No\", \"Yes\"}[b2i(ans)])\n}\n", "language": "Go", "metadata": {"date": 1573437093, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02867.html", "problem_id": "p02867", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02867/input.txt", "sample_output_relpath": "derived/input_output/data/p02867/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02867/Go/s343370524.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s343370524", "user_id": "u463655976"}, "prompt_components": {"gold_output": "Yes\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)\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//RBNodeDir is\ntype RBNodeDir int\n\nconst (\n\n\t//RBNodeLeft is\n\tRBNodeLeft RBNodeDir = iota\n\n\t//RBNodeRight is\n\tRBNodeRight\n\n\t//RBNodeHere is\n\tRBNodeHere\n)\n\n//RBNode is\ntype RBNode struct {\n\tisRed bool\n\tIndex int\n\tparent *RBNode\n\tchildren [2]*RBNode\n}\n\n//RBTree is\ntype RBTree struct {\n\tNode *RBNode\n\tless func(i int, j int) bool\n}\n\n//RBCursor is\ntype RBCursor RBTree\n\n//NewTree is\nfunc NewTree(less func(i int, j int) bool) *RBTree {\n\ttree := &RBTree{less: less}\n\treturn tree\n}\n\n//Cursor is\nfunc (cur *RBTree) Cursor() *RBCursor {\n\twrk := RBCursor(*cur)\n\treturn &wrk\n}\n\nfunc (cur *RBTree) root() *RBTree {\n\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.parent != nil; cur.Node = cur.Node.parent {\n\n\t\t}\n\t}\n\treturn cur\n}\n\n//Move is\nfunc (cur *RBCursor) Move(dir RBNodeDir) *RBCursor {\n\trev := dir ^ 1\n\tif next := cur.Node.children[dir]; next != nil {\n\t\tfor next.children[rev] != nil {\n\t\t\tnext = next.children[rev]\n\t\t}\n\t\tcur.Node = next\n\t} else {\n\t\tfind := false\n\t\tfor cur.Node.parent != nil {\n\t\t\tnow := cur.Node\n\t\t\tcur.Node = cur.Node.parent\n\t\t\tif cur.Node.children[rev] == now {\n\t\t\t\tfind = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !find {\n\t\t\tcur.Node = nil\n\t\t}\n\t}\n\treturn cur\n}\n\n//Find is\nfunc (cur *RBTree) Find(Index int) (*RBTree, RBNodeDir) {\n\tdir := RBNodeLeft\n\tif cur.Node == nil {\n\t\treturn cur, dir\n\t}\n\tcur.root()\n\tfor {\n\t\tif cur.less(Index, cur.Node.Index) {\n\t\t\tdir = RBNodeLeft\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\n\t\t} else if cur.less(cur.Node.Index, Index) {\n\t\t\tdir = RBNodeRight\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\t\t} else {\n\t\t\tdir = RBNodeHere\n\t\t\tbreak\n\t\t}\n\t}\n\treturn cur, dir\n}\n\n//Add is\nfunc (cur *RBTree) Add(Index int) *RBTree {\n\tnewNode := &RBNode{Index: Index, isRed: true}\n\tcur.root()\n\tif cur.Node != nil {\n\t\tpnode, dir := cur.Find(newNode.Index)\n\t\tif dir != RBNodeHere {\n\t\t\tnewNode.parent = pnode.Node\n\t\t\tnewNode.parent.children[dir] = newNode\n\t\t\tnewNode.opt()\n\t\t} else {\n\t\t\tpnode.Node.Index = newNode.Index\n\t\t\tnewNode = pnode.Node\n\t\t}\n\t}\n\tcur.Node = newNode\n\treturn cur\n}\n\nfunc (Node *RBNode) flip(dir RBNodeDir) {\n\tcurGranPa := Node.parent\n\tnewParent := Node.children[dir]\n\tif curGranPa != nil {\n\t\tcurGranPa.children[Node.dir()] = newParent\n\t}\n\tnewParent.parent, Node.parent = Node.parent, newParent\n\n\tNode.children[dir] = newParent.children[dir^1]\n\tif Node.children[dir] != nil {\n\t\tNode.children[dir].parent = Node\n\t}\n\tnewParent.children[dir^1] = Node\n\n}\nfunc (Node *RBNode) dir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.parent.children[dir] != Node {\n\t\tdir = RBNodeRight\n\t}\n\treturn dir\n}\nfunc (Node *RBNode) opt() {\n\tfor Node != nil && Node.isRed {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t} else if !parent.isRed {\n\t\t\tbreak\n\t\t} else if parent.parent == nil {\n\t\t\tparent.isRed = false\n\t\t} else {\n\t\t\tgrandparent := parent.parent\n\t\t\tparentsibling := grandparent.children[parent.dir()^1]\n\t\t\tif parentsibling != nil && parentsibling.isRed {\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tparent.isRed = false\n\t\t\t\tparentsibling.isRed = false\n\t\t\t\tNode = grandparent\n\t\t\t} else {\n\t\t\t\tdir := parent.dir()\n\n\t\t\t\tif parent.children[dir] != Node {\n\t\t\t\t\tparent.flip(dir ^ 1)\n\t\t\t\t}\n\n\t\t\t\tgrandparent.flip(dir)\n\t\t\t\tgrandparent.parent.isRed = false\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n//End is\nfunc (cur *RBTree) End(dir RBNodeDir) *RBCursor {\n\tcur.root()\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.children[dir] != nil; cur.Node = cur.Node.children[dir] {\n\n\t\t}\n\t}\n\treturn cur.Cursor()\n}\n\nfunc (Node *RBNode) cut() {\n\tif Node.parent != nil {\n\t\tNode.parent.children[Node.dir()] = nil\n\t}\n}\n\nfunc (Node *RBNode) hasDir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.children[dir] == nil {\n\t\tdir = RBNodeRight\n\t\tif Node.children[dir] == nil {\n\t\t\tdir = RBNodeHere\n\t\t}\n\t}\n\treturn dir\n}\n\n//Delete is\nfunc (cur *RBTree) Delete(Index int) (ret bool) {\n\twcur, dir := cur.Find(Index)\n\tif dir != RBNodeHere {\n\t\treturn\n\t}\n\tdelNode := wcur.Node\n\tret = true\n\n\tdir = delNode.hasDir()\n\n\tif delNode.children[RBNodeLeft] != nil &&\n\t\tdelNode.children[RBNodeRight] != nil {\n\t\tvar wrk *RBCursor\n\t\tif dir != RBNodeHere {\n\t\t\twrk = wcur.Cursor().Move(dir)\n\t\t\tdelNode.Index = wrk.Node.Index\n\t\t\tdelNode = wrk.Node\n\t\t\tdir = delNode.hasDir()\n\t\t}\n\t}\n\n\tif dir == RBNodeHere {\n\t\tif delNode.isRed {\n\t\t\tdelNode.cut()\n\t\t\tcur.Node = delNode.parent\n\t\t\treturn\n\t\t}\n\t} else {\n\t\twrk := delNode.children[dir]\n\t\tdelNode.Index = wrk.Index\n\t\twrk.cut()\n\t\treturn\n\t}\n\n\tNode := delNode\n\tfor {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tdir := Node.dir()\n\t\tdirOther := dir ^ 1\n\t\tsibling := parent.children[dirOther]\n\n\t\tif sibling.isRed {\n\t\t\t//sibling is Red\n\t\t\tparent.flip(dirOther)\n\t\t\tsibling.isRed = false\n\t\t\tparent.isRed = true\n\t\t\tsibling = parent.children[dirOther]\n\t\t}\n\t\t//sibling is Black\n\n\t\tnephew := sibling.children[dirOther]\n\t\tif nephew == nil || !nephew.isRed {\n\t\t\t//far nephew is Black\n\t\t\tnephew = sibling.children[dir]\n\t\t\tif nephew == nil || !nephew.isRed {\n\t\t\t\t//near nephew is Black\n\t\t\t\tsibling.isRed = true\n\t\t\t\tif parent.isRed {\n\t\t\t\t\tparent.isRed = false\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tNode = parent\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t//near nephew is Red and far nephew is Black\n\t\t\tsibling.flip(dir)\n\t\t\tsibling, nephew = nephew, sibling\n\t\t\tsibling.isRed = false\n\t\t\tnephew.isRed = true\n\t\t}\n\t\t//sibling is Black && far nephew is Red\n\n\t\tparent.flip(dirOther)\n\t\tsibling.isRed = parent.isRed\n\t\tparent.isRed = false\n\t\tnephew.isRed = false\n\t\tbreak\n\t}\n\tdelNode.cut()\n\tcur.Node = delNode.parent\n\treturn\n}\n\ntype isA int\n\nconst (\n\tatype isA = 1\n\tbtype = 2\n)\n\ntype pair struct {\n\ta int\n\tb int\n\ti int\n}\ntype bup []pair\n\nfunc (a bup) Len() int { return len(a) }\nfunc (a bup) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a bup) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].b != a[j].b:\n\t\treturn a[i].b < a[j].b\n\tdefault:\n\t\treturn a[i].a <= a[j].a\n\t}\n}\n\ntype aup []*pair\n\nfunc (a aup) Len() int { return len(a) }\nfunc (a aup) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a aup) Less(i, j int) bool {\n\tswitch {\n\tcase a[i].a != a[j].a:\n\t\treturn a[i].a < a[j].a\n\tdefault:\n\t\treturn a[i].b <= a[j].b\n\t}\n}\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(false)\n\tn := r.nextInt()\n\tr.Scan(true)\n\ta := r.nextStringArray().toInts()\n\tr.Scan(true)\n\tb := r.nextStringArray().toInts()\n\n\ttargetB := make([]pair, len(a))\n\tansA := make([]*pair, len(a))\n\tfor i := range a {\n\t\tp := &targetB[i]\n\t\tp.a = a[i]\n\t\tp.b = b[i]\n\t\tansA[i] = p\n\t}\n\tsort.Sort(bup(targetB))\n\tsort.Sort(aup(ansA))\n\n\tcondAltB := true\n\tcondAdpl := false\n\tfor i := range targetB {\n\t\tif ansA[i].a > targetB[i].b {\n\t\t\tcondAltB = false\n\t\t\tbreak\n\t\t}\n\n\t\tif targetB[i].a == ansA[i].a {\n\t\t\tcondAdpl = true\n\t\t}\n\n\t\tif i < n-1 && ansA[i+1].a <= targetB[i].b {\n\t\t\tcondAdpl = true\n\t\t}\n\n\t}\n\n\tans := condAltB\n\tif ans {\n\t\tans = condAdpl\n\t\tif !ans {\n\t\t\tfor i := range ansA {\n\t\t\t\tansA[i].i = i\n\t\t\t}\n\t\t\tcur := targetB[0].i\n\t\t\tcnt := 0\n\t\t\tfor cur != 0 {\n\t\t\t\tcnt++\n\t\t\t\tcur = targetB[cur].i\n\t\t\t}\n\t\t\tif cnt <= n-2 {\n\t\t\t\tans = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, []string{\"No\", \"Yes\"}[b2i(ans)])\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nGiven are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N.\nDetermine if it is possible to do the following operation at most N-2 times (possibly zero) so that, for every integer i from 1 to N, A_i \\leq B_i holds:\n\nChoose two distinct integers x and y between 1 and N (inclusive), and swap the values of A_x and A_y.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i,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\nB_1 B_2 ... B_N\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\n3\n1 3 2\n1 2 3\n\nSample Output 1\n\nYes\n\nWe should swap the values of A_2 and A_3.\n\nSample Input 2\n\n3\n1 2 3\n2 2 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n3 1 2 6 3 4\n2 2 8 3 4 3\n\nSample Output 3\n\nYes", "sample_input": "3\n1 3 2\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02867", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N.\nDetermine if it is possible to do the following operation at most N-2 times (possibly zero) so that, for every integer i from 1 to N, A_i \\leq B_i holds:\n\nChoose two distinct integers x and y between 1 and N (inclusive), and swap the values of A_x and A_y.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i,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\nB_1 B_2 ... B_N\n\nOutput\n\nIf the objective is achievable, print Yes; if it is not, print No.\n\nSample Input 1\n\n3\n1 3 2\n1 2 3\n\nSample Output 1\n\nYes\n\nWe should swap the values of A_2 and A_3.\n\nSample Input 2\n\n3\n1 2 3\n2 2 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n6\n3 1 2 6 3 4\n2 2 8 3 4 3\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9624, "cpu_time_ms": 124, "memory_kb": 11648}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s449153347", "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\tv := make([]int, len(S)+1)\n\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == '<' {\n\t\t\tv[i+1] = v[i] + 1\n\t\t}\n\t}\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tif S[i] == '>' {\n\t\t\tv[i] = Max(v[i], v[i+1]+1)\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, a := range v {\n\t\tans += a\n\t}\n\tfmt.Println(ans)\n}\n\nfunc Max(xs ...int) int {\n\tmax := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif max < x {\n\t\t\tmax = x\n\t\t}\n\t}\n\treturn max\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 ReadString() (s string) { Scan(&s); return }\n", "language": "Go", "metadata": {"date": 1593403076, "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/s449153347.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s449153347", "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\tv := make([]int, len(S)+1)\n\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == '<' {\n\t\t\tv[i+1] = v[i] + 1\n\t\t}\n\t}\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tif S[i] == '>' {\n\t\t\tv[i] = Max(v[i], v[i+1]+1)\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, a := range v {\n\t\tans += a\n\t}\n\tfmt.Println(ans)\n}\n\nfunc Max(xs ...int) int {\n\tmax := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif max < x {\n\t\t\tmax = x\n\t\t}\n\t}\n\treturn max\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 ReadString() (s string) { Scan(&s); return }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 655, "cpu_time_ms": 38, "memory_kb": 9420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s754974821", "group_id": "codeNet:p02874", "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 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\tee := make(Enables, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tee[i].l = getNextInt(scanner)\n\t\tee[i].r = getNextInt(scanner)\n\t}\n\tsort.Sort(ee)\n\tseg := Segment{}\n\tseg.init(n)\n\tfor i := 0; i < n; i++ {\n\t\tseg.minimize(i, ee[i].r)\n\t}\n\tvar ans int64\n\n\tfor i := 1; i < n; i++ {\n\t\tl := seg.min(0, i) - ee[i-1].l\n\t\tif l < 0 {\n\t\t\tl = -1\n\t\t}\n\t\tr := seg.min(i, n) - ee[n-1].l\n\t\tif r < 0 {\n\t\t\tr = -1\n\t\t}\n\t\tif ans < int64(l+r+2) {\n\t\t\tans = int64(l + r + 2)\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype Enable struct {\n\tl, r int\n}\n\ntype Enables []Enable\n\nfunc (a Enables) Len() int { return len(a) }\nfunc (a Enables) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Enables) Less(i, j int) bool {\n\tif a[i].l == a[j].l{\n\t\treturn a[i].r > a[j].r\n\t}\n\treturn a[i].l < a[j].l\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i, chunk, inf 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 := 8\n\tfor i := 0; n > 1; i++ {\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}\n\tseg.h = len(seg.unit)\n\tseg.chunk = chunk\n\tseg.inf = math.MaxInt32\n}\n\nfunc (seg *Segment) minimize(index, value int) {\n\tseg.bucket[0][index] = value\n\tfor seg.i = 0; seg.i < seg.h-1; seg.i++ {\n\t\ts := index - index%seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tparent := index / seg.chunk\n\t\tmin := seg.inf\n\t\tfor i := s; i < t; i++ {\n\t\t\tif min > seg.bucket[seg.i][i] {\n\t\t\t\tmin = seg.bucket[seg.i][i]\n\t\t\t}\n\t\t}\n\t\tseg.bucket[seg.i+1][parent] = min\n\t\tindex /= seg.chunk\n\t}\n}\nfunc (seg *Segment) min(l, r int) int {\n\tif seg.n < r {\n\t\tr = seg.n\n\t}\n\tmin := seg.inf\n\tfor index := l; index < r; index += seg.unit[seg.i] {\n\t\tfor seg.i = 0; seg.i < seg.h-1 && index%seg.unit[seg.i+1] == 0; seg.i++ {\n\t\t\tif index+seg.unit[seg.i+1] >= r {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif min > seg.bucket[seg.i][index/seg.unit[seg.i]] {\n\t\t\tmin = seg.bucket[seg.i][index/seg.unit[seg.i]]\n\t\t}\n\t}\n\n\treturn min\n}\n", "language": "Go", "metadata": {"date": 1572908580, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02874.html", "problem_id": "p02874", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02874/input.txt", "sample_output_relpath": "derived/input_output/data/p02874/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02874/Go/s754974821.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s754974821", "user_id": "u150542210"}, "prompt_components": {"gold_output": "6\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 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\tee := make(Enables, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tee[i].l = getNextInt(scanner)\n\t\tee[i].r = getNextInt(scanner)\n\t}\n\tsort.Sort(ee)\n\tseg := Segment{}\n\tseg.init(n)\n\tfor i := 0; i < n; i++ {\n\t\tseg.minimize(i, ee[i].r)\n\t}\n\tvar ans int64\n\n\tfor i := 1; i < n; i++ {\n\t\tl := seg.min(0, i) - ee[i-1].l\n\t\tif l < 0 {\n\t\t\tl = -1\n\t\t}\n\t\tr := seg.min(i, n) - ee[n-1].l\n\t\tif r < 0 {\n\t\t\tr = -1\n\t\t}\n\t\tif ans < int64(l+r+2) {\n\t\t\tans = int64(l + r + 2)\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype Enable struct {\n\tl, r int\n}\n\ntype Enables []Enable\n\nfunc (a Enables) Len() int { return len(a) }\nfunc (a Enables) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Enables) Less(i, j int) bool {\n\tif a[i].l == a[j].l{\n\t\treturn a[i].r > a[j].r\n\t}\n\treturn a[i].l < a[j].l\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i, chunk, inf 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 := 8\n\tfor i := 0; n > 1; i++ {\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}\n\tseg.h = len(seg.unit)\n\tseg.chunk = chunk\n\tseg.inf = math.MaxInt32\n}\n\nfunc (seg *Segment) minimize(index, value int) {\n\tseg.bucket[0][index] = value\n\tfor seg.i = 0; seg.i < seg.h-1; seg.i++ {\n\t\ts := index - index%seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tparent := index / seg.chunk\n\t\tmin := seg.inf\n\t\tfor i := s; i < t; i++ {\n\t\t\tif min > seg.bucket[seg.i][i] {\n\t\t\t\tmin = seg.bucket[seg.i][i]\n\t\t\t}\n\t\t}\n\t\tseg.bucket[seg.i+1][parent] = min\n\t\tindex /= seg.chunk\n\t}\n}\nfunc (seg *Segment) min(l, r int) int {\n\tif seg.n < r {\n\t\tr = seg.n\n\t}\n\tmin := seg.inf\n\tfor index := l; index < r; index += seg.unit[seg.i] {\n\t\tfor seg.i = 0; seg.i < seg.h-1 && index%seg.unit[seg.i+1] == 0; seg.i++ {\n\t\t\tif index+seg.unit[seg.i+1] >= r {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif min > seg.bucket[seg.i][index/seg.unit[seg.i]] {\n\t\t\tmin = seg.bucket[seg.i][index/seg.unit[seg.i]]\n\t\t}\n\t}\n\n\treturn min\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "sample_input": "4\n4 7\n1 4\n5 8\n2 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02874", "source_text": "Score : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3212, "cpu_time_ms": 413, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s763917958", "group_id": "codeNet:p02874", "input_text": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\ntype entry struct {\n\tlower int\n\tupper int\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tee := make([]entry, N)\n\n\tvar iMaxL, iMinU = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&ee[i].lower, &ee[i].upper)\n\t}\n\n\tsort.Sort(byUpper(ee))\n\n\tfor i := 0; i < N; i++ {\n\t\tif ee[iMaxL].lower < ee[i].lower {\n\t\t\tiMaxL = i\n\t\t}\n\t\tif ee[iMinU].upper > ee[i].upper {\n\t\t\tiMinU = i\n\t\t}\n\t}\n\n\tif iMaxL == iMinU {\n\t\tmax := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif i == iMaxL {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmax = Max(max, ee[i].upper-ee[i].lower+1)\n\t\t}\n\n\t\tfmt.Println(max + Max(ee[iMaxL].upper-ee[iMaxL].lower+1, 0))\n\t\treturn\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif i == iMaxL || i == iMinU {\n\t\t\tcontinue\n\t\t}\n\t\tif ee[i].upper >= ee[iMaxL].upper {\n\t\t\tcontinue\n\t\t}\n\t\tif ee[i].lower <= ee[iMinU].lower {\n\t\t\tcontinue\n\t\t}\n\t\tscoreL := ee[i].upper - ee[iMinU].lower\n\t\tscoreU := ee[iMaxL].upper - ee[i].lower\n\t\tif scoreL > scoreU {\n\t\t\tee[iMaxL].upper = ee[i].upper\n\t\t} else {\n\t\t\tee[iMinU].lower = ee[i].lower\n\t\t}\n\t}\n\n\tresult := Max(ee[iMaxL].upper-ee[iMaxL].lower+1, 0) + Max(ee[iMinU].upper-ee[iMinU].lower+1, 0)\n\tfmt.Println(result)\n}\n\ntype byUpper []entry\n\nfunc (a byUpper) Len() int { return len(a) }\nfunc (a byUpper) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byUpper) Less(i, j int) bool { return a[i].upper < a[j].upper }\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": 1572850026, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02874.html", "problem_id": "p02874", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02874/input.txt", "sample_output_relpath": "derived/input_output/data/p02874/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02874/Go/s763917958.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s763917958", "user_id": "u764320774"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\ntype entry struct {\n\tlower int\n\tupper int\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tee := make([]entry, N)\n\n\tvar iMaxL, iMinU = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&ee[i].lower, &ee[i].upper)\n\t}\n\n\tsort.Sort(byUpper(ee))\n\n\tfor i := 0; i < N; i++ {\n\t\tif ee[iMaxL].lower < ee[i].lower {\n\t\t\tiMaxL = i\n\t\t}\n\t\tif ee[iMinU].upper > ee[i].upper {\n\t\t\tiMinU = i\n\t\t}\n\t}\n\n\tif iMaxL == iMinU {\n\t\tmax := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif i == iMaxL {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmax = Max(max, ee[i].upper-ee[i].lower+1)\n\t\t}\n\n\t\tfmt.Println(max + Max(ee[iMaxL].upper-ee[iMaxL].lower+1, 0))\n\t\treturn\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif i == iMaxL || i == iMinU {\n\t\t\tcontinue\n\t\t}\n\t\tif ee[i].upper >= ee[iMaxL].upper {\n\t\t\tcontinue\n\t\t}\n\t\tif ee[i].lower <= ee[iMinU].lower {\n\t\t\tcontinue\n\t\t}\n\t\tscoreL := ee[i].upper - ee[iMinU].lower\n\t\tscoreU := ee[iMaxL].upper - ee[i].lower\n\t\tif scoreL > scoreU {\n\t\t\tee[iMaxL].upper = ee[i].upper\n\t\t} else {\n\t\t\tee[iMinU].lower = ee[i].lower\n\t\t}\n\t}\n\n\tresult := Max(ee[iMaxL].upper-ee[iMaxL].lower+1, 0) + Max(ee[iMinU].upper-ee[iMinU].lower+1, 0)\n\tfmt.Println(result)\n}\n\ntype byUpper []entry\n\nfunc (a byUpper) Len() int { return len(a) }\nfunc (a byUpper) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byUpper) Less(i, j int) bool { return a[i].upper < a[j].upper }\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 : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "sample_input": "4\n4 7\n1 4\n5 8\n2 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02874", "source_text": "Score : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1468, "cpu_time_ms": 1340, "memory_kb": 6912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s374983038", "group_id": "codeNet:p02874", "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\tN := nextInt()\n\tQ := make(pairs, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tl := nextInt()\n\t\tr := nextInt()\n\t\tQ[i] = pair{l, r}\n\t}\n\tsort.Sort(sort.Reverse(Q))\n\n\tl1 := -1\n\tl2 := -1\n\tr1 := int(1e10 + 1)\n\tr2 := int(1e10 + 1)\n\n\tfor i := 0; i < N; i++ {\n\t\t// 1回目に入れるか2回目に入れるかを決める\n\t\tc1 := score(min(r1, Q[i].r), max(l1, Q[i].l)) + score(r2, l2)\n\t\tc2 := score(min(r2, Q[i].r), max(l2, Q[i].l)) + score(r1, l1)\n\n\t\tif c1 > c2 {\n\t\t\tr1 = min(r1, Q[i].r)\n\t\t\tl1 = max(l1, Q[i].l)\n\t\t} else {\n\t\t\tr2 = min(r2, Q[i].r)\n\t\t\tl2 = max(l2, Q[i].l)\n\t\t}\n\t}\n\n\ts1 := score(r1, l1) + score(r2, l2)\n\n\tl1 = -1\n\tl2 = -1\n\tr1 = int(1e10 + 1)\n\tr2 = int(1e10 + 1)\n\n\tsort.Sort(Q)\n\n\tfor i := 0; i < N; i++ {\n\t\t// 1回目に入れるか2回目に入れるかを決める\n\t\tc1 := score(min(r1, Q[i].r), max(l1, Q[i].l)) + score(r2, l2)\n\t\tc2 := score(min(r2, Q[i].r), max(l2, Q[i].l)) + score(r1, l1)\n\n\t\tif c1 > c2 {\n\t\t\tr1 = min(r1, Q[i].r)\n\t\t\tl1 = max(l1, Q[i].l)\n\t\t} else {\n\t\t\tr2 = min(r2, Q[i].r)\n\t\t\tl2 = max(l2, Q[i].l)\n\t\t}\n\t}\n\n\ts2 := score(r1, l1) + score(r2, l2)\n\n\tfmt.Println(max(s1, s2))\n}\n\nfunc score(r, l int) int {\n\tif l < 0 {\n\t\treturn 0\n\t}\n\n\tif l > r {\n\t\treturn 0\n\t}\n\treturn r - l + 1\n}\n\ntype pair struct {\n\tl int\n\tr 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 { return a[i].r-a[i].l < a[j].r-a[j].l }\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\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": 1572849649, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02874.html", "problem_id": "p02874", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02874/input.txt", "sample_output_relpath": "derived/input_output/data/p02874/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02874/Go/s374983038.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s374983038", "user_id": "u578274732"}, "prompt_components": {"gold_output": "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 main() {\n\tN := nextInt()\n\tQ := make(pairs, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tl := nextInt()\n\t\tr := nextInt()\n\t\tQ[i] = pair{l, r}\n\t}\n\tsort.Sort(sort.Reverse(Q))\n\n\tl1 := -1\n\tl2 := -1\n\tr1 := int(1e10 + 1)\n\tr2 := int(1e10 + 1)\n\n\tfor i := 0; i < N; i++ {\n\t\t// 1回目に入れるか2回目に入れるかを決める\n\t\tc1 := score(min(r1, Q[i].r), max(l1, Q[i].l)) + score(r2, l2)\n\t\tc2 := score(min(r2, Q[i].r), max(l2, Q[i].l)) + score(r1, l1)\n\n\t\tif c1 > c2 {\n\t\t\tr1 = min(r1, Q[i].r)\n\t\t\tl1 = max(l1, Q[i].l)\n\t\t} else {\n\t\t\tr2 = min(r2, Q[i].r)\n\t\t\tl2 = max(l2, Q[i].l)\n\t\t}\n\t}\n\n\ts1 := score(r1, l1) + score(r2, l2)\n\n\tl1 = -1\n\tl2 = -1\n\tr1 = int(1e10 + 1)\n\tr2 = int(1e10 + 1)\n\n\tsort.Sort(Q)\n\n\tfor i := 0; i < N; i++ {\n\t\t// 1回目に入れるか2回目に入れるかを決める\n\t\tc1 := score(min(r1, Q[i].r), max(l1, Q[i].l)) + score(r2, l2)\n\t\tc2 := score(min(r2, Q[i].r), max(l2, Q[i].l)) + score(r1, l1)\n\n\t\tif c1 > c2 {\n\t\t\tr1 = min(r1, Q[i].r)\n\t\t\tl1 = max(l1, Q[i].l)\n\t\t} else {\n\t\t\tr2 = min(r2, Q[i].r)\n\t\t\tl2 = max(l2, Q[i].l)\n\t\t}\n\t}\n\n\ts2 := score(r1, l1) + score(r2, l2)\n\n\tfmt.Println(max(s1, s2))\n}\n\nfunc score(r, l int) int {\n\tif l < 0 {\n\t\treturn 0\n\t}\n\n\tif l > r {\n\t\treturn 0\n\t}\n\treturn r - l + 1\n}\n\ntype pair struct {\n\tl int\n\tr 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 { return a[i].r-a[i].l < a[j].r-a[j].l }\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\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 : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "sample_input": "4\n4 7\n1 4\n5 8\n2 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02874", "source_text": "Score : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2157, "cpu_time_ms": 112, "memory_kb": 5376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390092178", "group_id": "codeNet:p02874", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tL := make([]int, N)\n\tU := make([]int, N)\n\n\tvar iMaxL, iMinU = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&L[i], &U[i])\n\t\tif L[iMaxL] < L[i] {\n\t\t\tiMaxL = i\n\t\t}\n\t\tif U[iMinU] > U[i] {\n\t\t\tiMinU = i\n\t\t}\n\t}\n\n\tif iMaxL == iMinU {\n\t\tmax := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif i == iMaxL {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmax = Max(max, U[i]-L[i]+1)\n\t\t}\n\n\t\tfmt.Println(max + Max(U[iMaxL]-L[iMaxL]+1, 0))\n\t\treturn\n\t}\n\n\tuForMaxL := U[iMaxL]\n\tlForMinU := L[iMinU]\n\tfor i := 0; i < N; i++ {\n\t\tif i == iMaxL || i == iMinU {\n\t\t\tcontinue\n\t\t}\n\t\tif U[i] >= U[iMaxL] {\n\t\t\tcontinue\n\t\t}\n\t\tif L[i] <= L[iMinU] {\n\t\t\tcontinue\n\t\t}\n\t\tscoreL := U[i] - L[iMinU]\n\t\tscoreU := U[iMaxL] - L[i]\n\t\tif scoreL > scoreU {\n\t\t\tuForMaxL = Min(U[i], uForMaxL)\n\t\t} else {\n\t\t\tlForMinU = Max(L[i], lForMinU)\n\t\t}\n\t}\n\n\tresult := Max(uForMaxL-L[iMaxL]+1, 0) + Max(U[iMinU]-lForMinU+1, 0)\n\tfmt.Println(result)\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": 1572848150, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02874.html", "problem_id": "p02874", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02874/input.txt", "sample_output_relpath": "derived/input_output/data/p02874/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02874/Go/s390092178.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s390092178", "user_id": "u764320774"}, "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\n\tL := make([]int, N)\n\tU := make([]int, N)\n\n\tvar iMaxL, iMinU = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&L[i], &U[i])\n\t\tif L[iMaxL] < L[i] {\n\t\t\tiMaxL = i\n\t\t}\n\t\tif U[iMinU] > U[i] {\n\t\t\tiMinU = i\n\t\t}\n\t}\n\n\tif iMaxL == iMinU {\n\t\tmax := 0\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif i == iMaxL {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmax = Max(max, U[i]-L[i]+1)\n\t\t}\n\n\t\tfmt.Println(max + Max(U[iMaxL]-L[iMaxL]+1, 0))\n\t\treturn\n\t}\n\n\tuForMaxL := U[iMaxL]\n\tlForMinU := L[iMinU]\n\tfor i := 0; i < N; i++ {\n\t\tif i == iMaxL || i == iMinU {\n\t\t\tcontinue\n\t\t}\n\t\tif U[i] >= U[iMaxL] {\n\t\t\tcontinue\n\t\t}\n\t\tif L[i] <= L[iMinU] {\n\t\t\tcontinue\n\t\t}\n\t\tscoreL := U[i] - L[iMinU]\n\t\tscoreU := U[iMaxL] - L[i]\n\t\tif scoreL > scoreU {\n\t\t\tuForMaxL = Min(U[i], uForMaxL)\n\t\t} else {\n\t\t\tlForMinU = Max(L[i], lForMinU)\n\t\t}\n\t}\n\n\tresult := Max(uForMaxL-L[iMaxL]+1, 0) + Max(U[iMinU]-lForMinU+1, 0)\n\tfmt.Println(result)\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 : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "sample_input": "4\n4 7\n1 4\n5 8\n2 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02874", "source_text": "Score : 600 points\n\nProblem Statement\n\n10^9 contestants, numbered 1 to 10^9, will compete in a competition.\nThere will be two contests in this competition.\n\nThe organizer prepared N problems, numbered 1 to N, to use in these contests.\nWhen Problem i is presented in a contest, it will be solved by all contestants from Contestant L_i to Contestant R_i (inclusive), and will not be solved by any other contestants.\n\nThe organizer will use these N problems in the two contests.\nEach problem must be used in exactly one of the contests, and each contest must have at least one problem.\n\nThe joyfulness of each contest is the number of contestants who will solve all the problems in the contest.\nFind the maximum possible total joyfulness of the two contests.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq L_i \\leq R_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 R_1\nL_2 R_2\n\\vdots\nL_N R_N\n\nOutput\n\nPrint the maximum possible total joyfulness of the two contests.\n\nSample Input 1\n\n4\n4 7\n1 4\n5 8\n2 5\n\nSample Output 1\n\n6\n\nThe optimal choice is:\n\nUse Problem 1 and 3 in the first contest. Contestant 5, 6, and 7 will solve both of them, so the joyfulness of this contest is 3.\n\nUse Problem 2 and 4 in the second contest. Contestant 2, 3, and 4 will solve both of them, so the joyfulness of this contest is 3.\n\nThe total joyfulness of these two contests is 6. We cannot make the total joyfulness greater than 6.\n\nSample Input 2\n\n4\n1 20\n2 19\n3 18\n4 17\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n457835016 996058008\n456475528 529149798\n455108441 512701454\n455817105 523506955\n457368248 814532746\n455073228 459494089\n456651538 774276744\n457667152 974637457\n457293701 800549465\n456580262 636471526\n\nSample Output 3\n\n540049931", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1309, "memory_kb": 7424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s759152398", "group_id": "codeNet:p02880", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tif a > 81 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfor i := 1; i < 10; i++ {\n\t\t\tfor j := 1; j < 10; j++ {\n\t\t\t\tif a%(i*j) == 0 && a/(i*j) < 10 {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1572545310, "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/s759152398.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s759152398", "user_id": "u200527996"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tif a > 81 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfor i := 1; i < 10; i++ {\n\t\t\tfor j := 1; j < 10; j++ {\n\t\t\t\tif a%(i*j) == 0 && a/(i*j) < 10 {\n\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\tos.Exit(0)\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\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "sample_input": "10\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02880", "source_text": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 295, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s072081064", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmin := n\n\tfor i:=1; i<=n; i++{\n\t\tfor j:=i+1; j<=n; j++{\n\t\t\tif i*j == n && (i-1)+(j-1) < min{\n\t\t\t\tmin = (i-1)+(j-1)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(min)\n}", "language": "Go", "metadata": {"date": 1597362785, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s072081064.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s072081064", "user_id": "u223172005"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmin := n\n\tfor i:=1; i<=n; i++{\n\t\tfor j:=i+1; j<=n; j++{\n\t\t\tif i*j == n && (i-1)+(j-1) < min{\n\t\t\t\tmin = (i-1)+(j-1)\n\t\t\t\tbreak\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 226, "cpu_time_ms": 2205, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s796082753", "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\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 N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\tans := powInt(10, 12)\n\tsqrtn := int(math.Sqrt(float64(N)))\n\tfor x := 1; x <= sqrtn; x++ {\n\t\tif N%x != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tans = minInt(ans, x+(N/x)-2)\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592643128, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s796082753.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s796082753", "user_id": "u432333240"}, "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\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 N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\tans := powInt(10, 12)\n\tsqrtn := int(math.Sqrt(float64(N)))\n\tfor x := 1; x <= sqrtn; x++ {\n\t\tif N%x != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tans = minInt(ans, x+(N/x)-2)\n\t}\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2426, "cpu_time_ms": 25, "memory_kb": 1800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s923388547", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, r int\n\tfmt.Scan(&n)\n\tvar a []int\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\ta = append(a, i)\n\t\t\tif i != n/i {\n\t\t\t\ta = append(a, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\n\tmin := math.MaxInt64\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tfor j := i + 1; j < len(a); j++ {\n\t\t\tif a[i]*a[j] == n {\n\t\t\t\tif min > a[j]-a[i] {\n\t\t\t\t\tr = (a[i] - 1) + (a[j] - 1)\n\t\t\t\t\tmin = a[j] - a[i]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1578574079, "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/s923388547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923388547", "user_id": "u298152049"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, r int\n\tfmt.Scan(&n)\n\tvar a []int\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\ta = append(a, i)\n\t\t\tif i != n/i {\n\t\t\t\ta = append(a, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(sort.IntSlice(a))\n\n\tmin := math.MaxInt64\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tfor j := i + 1; j < len(a); j++ {\n\t\t\tif a[i]*a[j] == n {\n\t\t\t\tif min > a[j]-a[i] {\n\t\t\t\t\tr = (a[i] - 1) + (a[j] - 1)\n\t\t\t\t\tmin = a[j] - a[i]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 482, "cpu_time_ms": 43, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s949685747", "group_id": "codeNet:p02881", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, ans int\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := n; i >= 1; i-- {\n\t\tfor j := n; j >= i; j-- {\n\t\t\tif i*j == n {\n\t\t\t\tans = i + j - 2\n\t\t\t\tfmt.Printf(\"%d\", ans)\n\t\t\t\tgoto LOOPEND\n\t\t\t}\n\t\t}\n\t}\nLOOPEND:\n}", "language": "Go", "metadata": {"date": 1572769382, "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/s949685747.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s949685747", "user_id": "u839663068"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, ans int\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := n; i >= 1; i-- {\n\t\tfor j := n; j >= i; j-- {\n\t\t\tif i*j == n {\n\t\t\t\tans = i + j - 2\n\t\t\t\tfmt.Printf(\"%d\", ans)\n\t\t\t\tgoto LOOPEND\n\t\t\t}\n\t\t}\n\t}\nLOOPEND:\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 237, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913753467", "group_id": "codeNet:p02881", "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.Int64()\n\n\tfor i := int64(2); i < int64(math.Ceil(math.Sqrt(float64(n)))); i++ {\n\t\tif n%i == 0 {\n\t\t\tif i*i == n {\n\t\t\t\tfmt.Println(i*2 - 1)\n\t\t\t} else {\n\t\t\t\tfmt.Println(int64(math.Floor(math.Sqrt(float64(n))))*2 - 1)\n\t\t\t}\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(n - 1)\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) Int64() 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) 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": 1572225628, "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/s913753467.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s913753467", "user_id": "u134387396"}, "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\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn := io.Int64()\n\n\tfor i := int64(2); i < int64(math.Ceil(math.Sqrt(float64(n)))); i++ {\n\t\tif n%i == 0 {\n\t\t\tif i*i == n {\n\t\t\t\tfmt.Println(i*2 - 1)\n\t\t\t} else {\n\t\t\t\tfmt.Println(int64(math.Floor(math.Sqrt(float64(n))))*2 - 1)\n\t\t\t}\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(n - 1)\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) Int64() 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) 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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5621, "cpu_time_ms": 15, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s660897078", "group_id": "codeNet:p02882", "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 nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := strings.Split(nextLine(), \" \")\n\ta, _ := strconv.ParseFloat(s[0], 64)\n\tb, _ := strconv.ParseFloat(s[1], 64)\n\tx, _ := strconv.ParseFloat(s[2], 64)\n\tvar result float64\n\n\tif hulf := a * a * b / 2; x < hulf {\n\t\tresult = math.Atan(a*b*b/2/x) * 180 / math.Pi\n\t} else if x == hulf {\n\t\tresult = 45\n\t} else {\n\t\tresult = math.Atan((a*a*b-x)*2/a/a/a) * 180 / math.Pi\n\t}\n\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1573332526, "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/s660897078.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s660897078", "user_id": "u380987495"}, "prompt_components": {"gold_output": "45.0000000000\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 nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := strings.Split(nextLine(), \" \")\n\ta, _ := strconv.ParseFloat(s[0], 64)\n\tb, _ := strconv.ParseFloat(s[1], 64)\n\tx, _ := strconv.ParseFloat(s[2], 64)\n\tvar result float64\n\n\tif hulf := a * a * b / 2; x < hulf {\n\t\tresult = math.Atan(a*b*b/2/x) * 180 / math.Pi\n\t} else if x == hulf {\n\t\tresult = 45\n\t} else {\n\t\tresult = math.Atan((a*a*b-x)*2/a/a/a) * 180 / math.Pi\n\t}\n\n\tfmt.Println(result)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s463058080", "group_id": "codeNet:p02885", "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\tfmt.Print(getUnhiddenLength(a, b))\n}\n\nfunc getUnhiddenLength(a, b int) int {\n\tunhiddenLength := a - b*2\n\tif unhiddenLength <= 0 {\n\t\treturn 0\n\t}\n\treturn unhiddenLength\n}\n", "language": "Go", "metadata": {"date": 1573106837, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02885.html", "problem_id": "p02885", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02885/input.txt", "sample_output_relpath": "derived/input_output/data/p02885/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02885/Go/s463058080.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s463058080", "user_id": "u581064717"}, "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.Scanf(\"%d %d\", &a, &b)\n\tfmt.Print(getUnhiddenLength(a, b))\n}\n\nfunc getUnhiddenLength(a, b int) int {\n\tunhiddenLength := a - b*2\n\tif unhiddenLength <= 0 {\n\t\treturn 0\n\t}\n\treturn unhiddenLength\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "sample_input": "12 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02885", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s802544698", "group_id": "codeNet:p02886", "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\tscanner.Split(bufio.ScanWords)\n\n\t// N\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// d\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\ttarget, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\td[i] = target\n\t}\n\n\tall := 0\n\tfor x := 0; x < N; x++ {\n\t\tfor y := 0; y < N; y++ {\n\t\t\tall += d[x] * d[y]\n\t\t}\n\t\tall -= d[x] * d[x]\n\t}\n\n\tfmt.Println(all / 2)\n\n}", "language": "Go", "metadata": {"date": 1599761033, "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/s802544698.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s802544698", "user_id": "u785064577"}, "prompt_components": {"gold_output": "11\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\tscanner.Split(bufio.ScanWords)\n\n\t// N\n\tscanner.Scan()\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// d\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\ttarget, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\td[i] = target\n\t}\n\n\tall := 0\n\tfor x := 0; x < N; x++ {\n\t\tfor y := 0; y < N; y++ {\n\t\t\tall += d[x] * d[y]\n\t\t}\n\t\tall -= d[x] * d[x]\n\t}\n\n\tfmt.Println(all / 2)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 566, "cpu_time_ms": 9, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s548323276", "group_id": "codeNet:p02886", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n n := 0\n hp := 0\n //たこ焼きの個数を受け取る\n fmt.Scanf(\"%d\",n)\n \n //たこ焼きのおいしさを配列に格納\n num := make([]int,n)\n for i:=0; i < n; i++ {\n \tfmt.Scanf(\"%d\",num[i])\n }\n\n for i:=0; i < n-1; i++ {\n for j:=i+1; j 1 {\n\t\tmid = (ok + ng) / 2\n\t\tif a[mid] >= x {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\treturn ok\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar inf = 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\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": 1584919415, "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/s260310745.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s260310745", "user_id": "u696272993"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tvar n int\n\tfmt.Scan(&n)\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&l[i])\n\t}\n\tvar cnt int\n\tsort.Ints(l)\n\tfor i := 0; i < n-2; i++ {\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\ta := l[i]\n\t\t\tb := l[j]\n\t\t\tk := lower_bound(l, a+b)\n\t\t\tcnt += k - j - 1\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\nfunc lower_bound(a []int, x int) int {\n\tvar ok, ng, mid int\n\tng = -1\n\tok = len(a)\n\tfor ok-ng > 1 {\n\t\tmid = (ok + ng) / 2\n\t\tif a[mid] >= x {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\treturn ok\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar inf = 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\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1515, "cpu_time_ms": 86, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001748543", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, r int\n\tfmt.Scan(&n)\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&l[i])\n\t}\n\tsort.Sort(sort.IntSlice(l))\n\tfor i := 0; i < n-2; i++ {\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tt := l[j+1:]\n\t\t\tsum := l[i] + l[j]\n\t\t\tw := sort.Search(len(t), func(i int) bool { return t[i] > sum })\n\t\t\tfor k := 0; k < w; k++ {\n\t\t\t\tif l[i] < l[j]+t[k] && l[j] < t[k]+l[i] && t[k] < l[i]+l[j] {\n\t\t\t\t\tr++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1578756247, "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/s001748543.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s001748543", "user_id": "u298152049"}, "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, r int\n\tfmt.Scan(&n)\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&l[i])\n\t}\n\tsort.Sort(sort.IntSlice(l))\n\tfor i := 0; i < n-2; i++ {\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tt := l[j+1:]\n\t\t\tsum := l[i] + l[j]\n\t\t\tw := sort.Search(len(t), func(i int) bool { return t[i] > sum })\n\t\t\tfor k := 0; k < w; k++ {\n\t\t\t\tif l[i] < l[j]+t[k] && l[j] < t[k]+l[i] && t[k] < l[i]+l[j] {\n\t\t\t\t\tr++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 486, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750240944", "group_id": "codeNet:p02888", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n \"sort\"\n)\n\n// var f, _ = os.Open(\"input.txt\")\n// var rdr = bufio.NewReaderSize(f, 1000000)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc read_line() 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 upper(Ls [] int, val int) int {\n var low int = 0\n var high int = len(Ls)\n mid := (high + low) / 2\n for high - low > 1 {\n if Ls[mid] > val {\n high = mid\n } else {\n low = mid\n }\n mid = (high + low) / 2\n }\n\n if Ls[low] > val {\n return low\n }\n return high\n}\n\nfunc upper_equal(Ls [] int, val int) int {\n var low int = 0\n var high int = len(Ls)\n mid := (high + low) / 2\n for high - low > 1 {\n if Ls[mid] >= val {\n high = mid\n } else {\n low = mid\n }\n mid = (high + low) / 2\n }\n\n if Ls[low] >= val {\n return low\n }\n return high\n}\n\nfunc main() {\n // as := make([] int, 5)\n // for i, word := range strings.Split(read_line(), \" \") {\n // as[i], _ = strconv.Atoi(word)\n // }\n\n N, _ := strconv.Atoi(read_line())\n Ls := make([] int, N)\n for i, L := range strings.Split(read_line(), \" \") {\n Ls[i], _ = strconv.Atoi(L)\n }\n\n sort.Ints(Ls) \n\n var res int = 0\n for i := 0; i < N; i++ {\n for j := i + 1; j < N; j++ {\n max_index := upper_equal(Ls, Ls[j] + Ls[i])\n min_index := upper(Ls, Ls[j] - Ls[i])\n res += max_index - min_index\n if min_index <= i && i < max_index {\n res--\n }\n if min_index <= j && j < max_index {\n res--\n }\n }\n }\n\n fmt.Println(res / 3)\n}", "language": "Go", "metadata": {"date": 1572405573, "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/s750240944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750240944", "user_id": "u592290074"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n \"sort\"\n)\n\n// var f, _ = os.Open(\"input.txt\")\n// var rdr = bufio.NewReaderSize(f, 1000000)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc read_line() 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 upper(Ls [] int, val int) int {\n var low int = 0\n var high int = len(Ls)\n mid := (high + low) / 2\n for high - low > 1 {\n if Ls[mid] > val {\n high = mid\n } else {\n low = mid\n }\n mid = (high + low) / 2\n }\n\n if Ls[low] > val {\n return low\n }\n return high\n}\n\nfunc upper_equal(Ls [] int, val int) int {\n var low int = 0\n var high int = len(Ls)\n mid := (high + low) / 2\n for high - low > 1 {\n if Ls[mid] >= val {\n high = mid\n } else {\n low = mid\n }\n mid = (high + low) / 2\n }\n\n if Ls[low] >= val {\n return low\n }\n return high\n}\n\nfunc main() {\n // as := make([] int, 5)\n // for i, word := range strings.Split(read_line(), \" \") {\n // as[i], _ = strconv.Atoi(word)\n // }\n\n N, _ := strconv.Atoi(read_line())\n Ls := make([] int, N)\n for i, L := range strings.Split(read_line(), \" \") {\n Ls[i], _ = strconv.Atoi(L)\n }\n\n sort.Ints(Ls) \n\n var res int = 0\n for i := 0; i < N; i++ {\n for j := i + 1; j < N; j++ {\n max_index := upper_equal(Ls, Ls[j] + Ls[i])\n min_index := upper(Ls, Ls[j] - Ls[i])\n res += max_index - min_index\n if min_index <= i && i < max_index {\n res--\n }\n if min_index <= j && j < max_index {\n res--\n }\n }\n }\n\n fmt.Println(res / 3)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1957, "cpu_time_ms": 167, "memory_kb": 2816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s029284734", "group_id": "codeNet:p02888", "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\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeWordScanner()\n\tn := eGetInt(scanner)\n\tls := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tls[i] = eGetInt(scanner)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tcount := 0\n\tfor i := 0; i < n-2; i++ {\n\t\ta := ls[i]\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tb := ls[j]\n\t\t\tleft := j + 1\n\t\t\tright := n\n\t\t\tmid := (left + right) / 2\n\t\t\tfor right-left >= 1 {\n\t\t\t\tif a < b+ls[mid] {\n\t\t\t\t\tleft = mid + 1\n\t\t\t\t} else {\n\t\t\t\t\tright = mid\n\t\t\t\t}\n\t\t\t\tmid = (left + right) / 2\n\t\t\t}\n\t\t\tcount += left - (j + 1)\n\t\t\t// for k := j + 1; k < n; k++ {\n\t\t\t// \tc := ls[k]\n\t\t\t// \tここを二分探索で検索可能\n\t\t\t//\n\t\t\t// \tif b+c > a {\n\t\t\t// \t\tcount++\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}\n\tfmt.Println(count)\n}\n\n////////////////////////////////////////////////////////////////////////////////\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}\n", "language": "Go", "metadata": {"date": 1571761619, "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/s029284734.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s029284734", "user_id": "u663116078"}, "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\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeWordScanner()\n\tn := eGetInt(scanner)\n\tls := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tls[i] = eGetInt(scanner)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tcount := 0\n\tfor i := 0; i < n-2; i++ {\n\t\ta := ls[i]\n\t\tfor j := i + 1; j < n-1; j++ {\n\t\t\tb := ls[j]\n\t\t\tleft := j + 1\n\t\t\tright := n\n\t\t\tmid := (left + right) / 2\n\t\t\tfor right-left >= 1 {\n\t\t\t\tif a < b+ls[mid] {\n\t\t\t\t\tleft = mid + 1\n\t\t\t\t} else {\n\t\t\t\t\tright = mid\n\t\t\t\t}\n\t\t\t\tmid = (left + right) / 2\n\t\t\t}\n\t\t\tcount += left - (j + 1)\n\t\t\t// for k := j + 1; k < n; k++ {\n\t\t\t// \tc := ls[k]\n\t\t\t// \tここを二分探索で検索可能\n\t\t\t//\n\t\t\t// \tif b+c > a {\n\t\t\t// \t\tcount++\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}\n\tfmt.Println(count)\n}\n\n////////////////////////////////////////////////////////////////////////////////\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}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2498, "cpu_time_ms": 73, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994977262", "group_id": "codeNet:p02888", "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\tinputs := scanNums(N)\n\tsort.Sort(sort.Reverse(sort.IntSlice(inputs)))\n\tres := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif inputs[i] >= 2*inputs[j] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif inputs[i] == inputs[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := j + 1; k < N; k++ {\n\n\t\t\t\ta := inputs[i]\n\t\t\t\tb := inputs[j]\n\t\t\t\tc := inputs[k]\n\t\t\t\tif a >= b+c {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\t// if a >= b+c {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\t// if b >= a+c {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\t// if c >= a+b {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(res)\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", "language": "Go", "metadata": {"date": 1571542273, "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/s994977262.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s994977262", "user_id": "u950580836"}, "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 int\n\tfmt.Scan(&N)\n\n\tinputs := scanNums(N)\n\tsort.Sort(sort.Reverse(sort.IntSlice(inputs)))\n\tres := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif inputs[i] >= 2*inputs[j] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif inputs[i] == inputs[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := j + 1; k < N; k++ {\n\n\t\t\t\ta := inputs[i]\n\t\t\t\tb := inputs[j]\n\t\t\t\tc := inputs[k]\n\t\t\t\tif a >= b+c {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\t// if a >= b+c {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\t// if b >= a+c {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\t// if c >= a+b {\n\t\t\t\t// \tcontinue\n\t\t\t\t// }\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(res)\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 763, "cpu_time_ms": 1343, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250443056", "group_id": "codeNet:p02888", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n \"os\"\n)\n\nfunc main() {\n\tvar N int\n\n\tvar ln []int\n\n\tfmt.Scanf(\"%d\", &N)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tdn := scanner.Text()\n\tdn = strings.TrimSpace(dn)\n\n\tdnn := strings.Fields(dn)\n\n\tfor j := range dnn {\n\t\tvar iparam int\n\t\tiparam, _ = strconv.Atoi(dnn[j])\n\t\tln = append(ln, iparam)\n\t}\n\n\tsum := 0\n\n\tfor i:=0; i<(N-2); i++ {\n\t\tfor j:=i+1; j<(N-1); j++ {\n\t\t\tfor k:=j+1; k 0 && a[i-1] >= ans { i-- }\n if ans*(n-i)+s[i] >= ans*k { break }\n ans--\n }\n fmt.Println(ans)\n }\n}", "language": "Go", "metadata": {"date": 1571550108, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02890.html", "problem_id": "p02890", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02890/input.txt", "sample_output_relpath": "derived/input_output/data/p02890/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02890/Go/s699481270.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s699481270", "user_id": "u506403362"}, "prompt_components": {"gold_output": "3\n1\n0\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\nfunc main() {\n var n,x int\n fmt.Scan(&n)\n a := make([]int,n)\n s := make([]int,n+1)\n for i:=0;i 0 && a[i-1] >= ans { i-- }\n if ans*(n-i)+s[i] >= ans*k { break }\n ans--\n }\n fmt.Println(ans)\n }\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N cards. The i-th of these cards has an integer A_i written on it.\n\nTakahashi will choose an integer K, and then repeat the following operation some number of times:\n\nChoose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)\n\nFor each K = 1,2, \\ldots, N, find the maximum number of times Takahashi can do the operation.\n\nConstraints\n\n1 \\le N \\le 3 \\times 10^5\n\n1 \\le A_i \\le 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 \\ldots A_N\n\nOutput\n\nPrint N integers.\nThe t-th (1 \\le t \\le N) of them should be the answer for the case K=t.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n3\n1\n0\n\nFor K = 1, we can do the operation as follows:\n\nChoose the first card to eat.\n\nChoose the second card to eat.\n\nChoose the third card to eat.\n\nFor K = 2, we can do the operation as follows:\n\nChoose the first and second cards to eat.\n\nFor K = 3, we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n5\n2\n1\n1\n1\n\nSample Input 3\n\n4\n1 3 3 3\n\nSample Output 3\n\n4\n1\n0\n0", "sample_input": "3\n2 1 2\n"}, "reference_outputs": ["3\n1\n0\n"], "source_document_id": "p02890", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N cards. The i-th of these cards has an integer A_i written on it.\n\nTakahashi will choose an integer K, and then repeat the following operation some number of times:\n\nChoose exactly K cards such that the integers written on them are all different, and eat those cards. (The eaten cards disappear.)\n\nFor each K = 1,2, \\ldots, N, find the maximum number of times Takahashi can do the operation.\n\nConstraints\n\n1 \\le N \\le 3 \\times 10^5\n\n1 \\le A_i \\le 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 \\ldots A_N\n\nOutput\n\nPrint N integers.\nThe t-th (1 \\le t \\le N) of them should be the answer for the case K=t.\n\nSample Input 1\n\n3\n2 1 2\n\nSample Output 1\n\n3\n1\n0\n\nFor K = 1, we can do the operation as follows:\n\nChoose the first card to eat.\n\nChoose the second card to eat.\n\nChoose the third card to eat.\n\nFor K = 2, we can do the operation as follows:\n\nChoose the first and second cards to eat.\n\nFor K = 3, we cannot do the operation at all. Note that we cannot choose the first and third cards at the same time.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n5\n2\n1\n1\n1\n\nSample Input 3\n\n4\n1 3 3 3\n\nSample Output 3\n\n4\n1\n0\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 420, "cpu_time_ms": 2108, "memory_kb": 12928}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s748955277", "group_id": "codeNet:p02897", "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\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif N%2 == 0 {\n\t\tfmt.Println(float32((N / 2)) / float32(N))\n\t} else {\n\t\tfmt.Println(float32(((N - 1) / 2)) / float32(N))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1599936207, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s748955277.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s748955277", "user_id": "u785064577"}, "prompt_components": {"gold_output": "0.5000000000\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\n\tN, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif N%2 == 0 {\n\t\tfmt.Println(float32((N / 2)) / float32(N))\n\t} else {\n\t\tfmt.Println(float32(((N - 1) / 2)) / float32(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s675017363", "group_id": "codeNet:p02897", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var n int\n fmt.Scan(&n)\n\n half := n / 2\n ans := float64(n - half) / float64(n)\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1573090409, "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/s675017363.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s675017363", "user_id": "u689167014"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var n int\n fmt.Scan(&n)\n\n half := n / 2\n ans := float64(n - half) / float64(n)\n fmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 160, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187377577", "group_id": "codeNet:p02898", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\ths := ReadInts(N)\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] >= K {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\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\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": 1593219712, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s187377577.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187377577", "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\tN, K := ReadInt(), ReadInt()\n\ths := ReadInts(N)\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] >= K {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\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\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 52, "memory_kb": 2980}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792593720", "group_id": "codeNet:p02898", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K, w, cnt int\n\tfmt.Scan(&N, &K)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&w)\n\t\tif w >= K {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1569752864, "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/s792593720.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s792593720", "user_id": "u298152049"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K, w, cnt int\n\tfmt.Scan(&N, &K)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&w)\n\t\tif w >= K {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 321, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717178768", "group_id": "codeNet:p02899", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tnums := make([]int, n)\n\tans := make([]int, n)\n\tfor i, _ := range nums{\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tfor i:=1; i<=n; i++{\n\t\tfor j:=0; j 0; i-- {\n for j := 2; j < i; j++ {\n //最大公約数が1以外ならその約数は素数ではない⇒探索終了\n if max_div(div[i],j) != 1 {\n p = !p\n break\n }\n }\n //最後までtrueなら素数\n if p {\n ans++\n }\n p = true\n }\n fmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1570636236, "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/s725786521.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s725786521", "user_id": "u150749188"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n\n//2つの入力値の最大公約数を返す\nfunc max_div(num1 int, num2 int) int {\n \n if num1 < num2 {\n temp := num1\n num1 = num2\n num2 = temp\n }\n //ユークリッド互除法\n var rem int\n for { \n rem = num1 % num2\n if rem == 0 {\n break\n }\n num1 = num2\n num2 = rem\n }\n return num2\n}\n\nfunc main() {\n \n var a,b int\n fmt.Scan(&a,&b)\n m := max_div(a,b)\n \n //A,Bの最大公約数の約数を求める\n var div []int\n count := 0\n\n //約数を保持\n for i := 1; i <= m; i++ {\n if m % i == 0 {\n div = append(div,i)\n count++\n }\n }\n\n ans := 1 //答えは必ず1以上\n var p bool\n p = true //素数\n \n //保持した約数と、その約数以下の値との最大公約数を計算\n for i := count-1; i > 0; i-- {\n for j := 2; j < i; j++ {\n //最大公約数が1以外ならその約数は素数ではない⇒探索終了\n if max_div(div[i],j) != 1 {\n p = !p\n break\n }\n }\n //最後までtrueなら素数\n if p {\n ans++\n }\n p = true\n }\n fmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841235348", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\t// 最大公約数を求める\n\tr := a % b\n\tfor r != 0 {\n\t\ta = b\n\t\tb = r\n\t\tr = a % b\n\t}\n\n\tif b == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\t// 約数を求める\n\t// 約数を求める際の右の列の最小の数\n\tminRight := b\n\tvar divisors []int\n\tfor i := 1; i < minRight; i++ {\n\t\tif b%i == 0 {\n\t\t\tdivisors = append(divisors, i)\n\t\t\tdivisors = append(divisors, b/i)\n\t\t\tminRight = b / i\n\t\t}\n\t}\n\n\t// 互いに素な整数の配列を返す\n\tsort.Ints(divisors[:])\n\tresult := 0\n\ttmp := b\n\tfor _, num := range divisors {\n\t\tif num == 1 {\n\t\t\tresult++\n\t\t\tcontinue\n\t\t}\n\t\tif tmp == 1 {\n\t\t\tbreak\n\t\t}\n\t\tfor tmp%num == 0 {\n\t\t\ttmp = tmp / num\n\t\t}\n\t\tresult++\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1569723984, "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/s841235348.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s841235348", "user_id": "u523014857"}, "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 a, b int\n\tfmt.Scan(&a, &b)\n\n\t// 最大公約数を求める\n\tr := a % b\n\tfor r != 0 {\n\t\ta = b\n\t\tb = r\n\t\tr = a % b\n\t}\n\n\tif b == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\t// 約数を求める\n\t// 約数を求める際の右の列の最小の数\n\tminRight := b\n\tvar divisors []int\n\tfor i := 1; i < minRight; i++ {\n\t\tif b%i == 0 {\n\t\t\tdivisors = append(divisors, i)\n\t\t\tdivisors = append(divisors, b/i)\n\t\t\tminRight = b / i\n\t\t}\n\t}\n\n\t// 互いに素な整数の配列を返す\n\tsort.Ints(divisors[:])\n\tresult := 0\n\ttmp := b\n\tfor _, num := range divisors {\n\t\tif num == 1 {\n\t\t\tresult++\n\t\t\tcontinue\n\t\t}\n\t\tif tmp == 1 {\n\t\t\tbreak\n\t\t}\n\t\tfor tmp%num == 0 {\n\t\t\ttmp = tmp / num\n\t\t}\n\t\tresult++\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 755, "cpu_time_ms": 2107, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254053152", "group_id": "codeNet:p02900", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\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\tA := uint64(getInt())\n\tB := uint64(getInt())\n\n\tgcm := gcd(A, B)\n\tprimes := primes(int(gcm))\n\n\tfmt.Println(len(primes) + 1)\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\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 primes(n int) []int {\n\tvar results []int\n\tfor i := 1; i <= n; i++ {\n\t\tif n % i == 0 && big.NewInt(int64(i)).ProbablyPrime(1) {\n\t\t\tresults = append(results, i)\n\t\t}\n\t}\n\treturn results\n}\n", "language": "Go", "metadata": {"date": 1569723832, "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/s254053152.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s254053152", "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\"math/big\"\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\tA := uint64(getInt())\n\tB := uint64(getInt())\n\n\tgcm := gcd(A, B)\n\tprimes := primes(int(gcm))\n\n\tfmt.Println(len(primes) + 1)\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\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 primes(n int) []int {\n\tvar results []int\n\tfor i := 1; i <= n; i++ {\n\t\tif n % i == 0 && big.NewInt(int64(i)).ProbablyPrime(1) {\n\t\t\tresults = append(results, i)\n\t\t}\n\t}\n\treturn results\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1746, "cpu_time_ms": 2107, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425390108", "group_id": "codeNet:p02900", "input_text": "// https://atcoder.jp/contests/abc142/tasks/abc142_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\tA := io.NextInt()\n\tB := io.NextInt()\n\n\t// 公約数のペアに含まれる素数と 1\n\n\tmax := Max(A, B)\n\tnums := []int{}\n\n\ttried := 0\n\n\tfor num := 2; num*num <= max; num++ {\n\t\ttried = num * num\n\t\tif A%num == 0 && B%num == 0 {\n\t\t\tnums = append(nums, num)\n\t\t}\n\t}\n\n\tif A%B == 0 && B > tried && B != 1 {\n\t\tnums = append(nums, B)\n\t} else if B%A == 0 && A > tried && A != 1 {\n\t\tnums = append(nums, A)\n\t}\n\n\tres := 1\n\n\tfor i, num := range nums {\n\t\tprime := true\n\n\t\tfor j := 0; j < i; j++ {\n\t\t\tother := nums[j]\n\n\t\t\tif num%other == 0 {\n\t\t\t\tprime = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif prime {\n\t\t\tres++\n\t\t}\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": 1569721018, "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/s425390108.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s425390108", "user_id": "u751468134"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc142/tasks/abc142_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\tA := io.NextInt()\n\tB := io.NextInt()\n\n\t// 公約数のペアに含まれる素数と 1\n\n\tmax := Max(A, B)\n\tnums := []int{}\n\n\ttried := 0\n\n\tfor num := 2; num*num <= max; num++ {\n\t\ttried = num * num\n\t\tif A%num == 0 && B%num == 0 {\n\t\t\tnums = append(nums, num)\n\t\t}\n\t}\n\n\tif A%B == 0 && B > tried && B != 1 {\n\t\tnums = append(nums, B)\n\t} else if B%A == 0 && A > tried && A != 1 {\n\t\tnums = append(nums, A)\n\t}\n\n\tres := 1\n\n\tfor i, num := range nums {\n\t\tprime := true\n\n\t\tfor j := 0; j < i; j++ {\n\t\t\tother := nums[j]\n\n\t\t\tif num%other == 0 {\n\t\t\t\tprime = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif prime {\n\t\t\tres++\n\t\t}\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6672, "cpu_time_ms": 12, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s734889533", "group_id": "codeNet:p02900", "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 divisors(n int) (r map[int]int) {\n\tr = make(map[int]int, 0)\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tr[i]++\n\t\t}\n\t}\n\tif n > 1 {\n\t\tr[n]++\n\t}\n\treturn r\n}\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\t// fmt.Println(\"A\", A, \"B\", B, \"GCD\", gcd(A, B), \"divs(GCD)\", divisors(gcd(A, B)))\n\tfmt.Println(len(divisors(gcd(A, B))) + 1)\n}\n", "language": "Go", "metadata": {"date": 1569720828, "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/s734889533.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s734889533", "user_id": "u196030116"}, "prompt_components": {"gold_output": "3\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 divisors(n int) (r map[int]int) {\n\tr = make(map[int]int, 0)\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tr[i]++\n\t\t}\n\t}\n\tif n > 1 {\n\t\tr[n]++\n\t}\n\treturn r\n}\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\t// fmt.Println(\"A\", A, \"B\", B, \"GCD\", gcd(A, B), \"divs(GCD)\", divisors(gcd(A, B)))\n\tfmt.Println(len(divisors(gcd(A, B))) + 1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 453, "cpu_time_ms": 11, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s543272214", "group_id": "codeNet:p02903", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar h, w, a, b int\n\tfmt.Scanf(\"%d %d %d %d\", &h, &w, &a, &b)\n\t//h, w, a, b = 3, 3, 1, 1\n\n\t// fmt.Println(gen(h, w, 2), a, b)\n\tmax, _ := strconv.ParseInt(strings.Repeat(\"1\", h*w), 2, 64)\n\n\t// fmt.Println(max)\n\tfor i := 0; int64(i) <= max; i++ {\n\t\tif check2(i, h, w, a, b) {\n\t\t\tprint(gen(h, w, i))\n\t\t\treturn\n\t\t}\n\t\t// g := gen(h, w, i)\n\t\t// if check(g, h, w, a, b) {\n\t\t// \tprint(g)\n\t\t// \treturn\n\t\t// }\n\n\t}\n\tfmt.Print(\"No\")\n\n}\n\nfunc check2(v, h, w, a, b int) bool {\n\tval := strconv.FormatInt(int64(v), 2)\n\tfor i := 0; i < h; i++ {\n\t\trowCount := 0\n\t\tfor j := 0; j < w; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > i*w+j {\n\t\t\t\tnum = val[i*w+j]\n\t\t\t\tif num == '1' {\n\t\t\t\t\trowCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif rowCount == a || rowCount == w-a {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\tfor i := 0; i < w; i++ {\n\t\twCount := 0\n\t\tfor j := 0; j < h; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > j*w+i {\n\t\t\t\tnum = val[j*w+i]\n\t\t\t\tif num == '1' {\n\t\t\t\t\twCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif wCount == b || wCount == h-b {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc check(g [][]int, h, w, a, b int) bool {\n\tfor i := 0; i < h; i++ {\n\t\trowCount := 0\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif g[i][j] == 1 {\n\t\t\t\trowCount++\n\t\t\t}\n\t\t}\n\t\tif rowCount == a || rowCount == w-a {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\tfor i := 0; i < w; i++ {\n\t\twCount := 0\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif g[j][i] == 1 {\n\t\t\t\twCount++\n\t\t\t}\n\t\t}\n\t\tif wCount == b || wCount == h-b {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n\n}\n\nfunc gen(h, w, v int) [][]int {\n\trows := make([][]int, h)\n\tval := strconv.FormatInt(int64(v), 2)\n\tfor i := 0; i < h; i++ {\n\t\trow := make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > i*w+j {\n\t\t\t\tnum = val[i*w+j]\n\t\t\t}\n\t\t\tif num == '1' {\n\t\t\t\trow[j] = 1\n\t\t\t}\n\t\t}\n\t\trows[i] = row\n\t}\n\treturn rows\n}\n\nfunc print(g [][]int) {\n\tfor _, row := range g {\n\t\tfor _, cell := range row {\n\t\t\tfmt.Print(cell)\n\t\t}\n\t\tfmt.Print(\"\\n\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1569118061, "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/s543272214.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s543272214", "user_id": "u314928583"}, "prompt_components": {"gold_output": "100\n010\n001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar h, w, a, b int\n\tfmt.Scanf(\"%d %d %d %d\", &h, &w, &a, &b)\n\t//h, w, a, b = 3, 3, 1, 1\n\n\t// fmt.Println(gen(h, w, 2), a, b)\n\tmax, _ := strconv.ParseInt(strings.Repeat(\"1\", h*w), 2, 64)\n\n\t// fmt.Println(max)\n\tfor i := 0; int64(i) <= max; i++ {\n\t\tif check2(i, h, w, a, b) {\n\t\t\tprint(gen(h, w, i))\n\t\t\treturn\n\t\t}\n\t\t// g := gen(h, w, i)\n\t\t// if check(g, h, w, a, b) {\n\t\t// \tprint(g)\n\t\t// \treturn\n\t\t// }\n\n\t}\n\tfmt.Print(\"No\")\n\n}\n\nfunc check2(v, h, w, a, b int) bool {\n\tval := strconv.FormatInt(int64(v), 2)\n\tfor i := 0; i < h; i++ {\n\t\trowCount := 0\n\t\tfor j := 0; j < w; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > i*w+j {\n\t\t\t\tnum = val[i*w+j]\n\t\t\t\tif num == '1' {\n\t\t\t\t\trowCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif rowCount == a || rowCount == w-a {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\tfor i := 0; i < w; i++ {\n\t\twCount := 0\n\t\tfor j := 0; j < h; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > j*w+i {\n\t\t\t\tnum = val[j*w+i]\n\t\t\t\tif num == '1' {\n\t\t\t\t\twCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif wCount == b || wCount == h-b {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc check(g [][]int, h, w, a, b int) bool {\n\tfor i := 0; i < h; i++ {\n\t\trowCount := 0\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif g[i][j] == 1 {\n\t\t\t\trowCount++\n\t\t\t}\n\t\t}\n\t\tif rowCount == a || rowCount == w-a {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\tfor i := 0; i < w; i++ {\n\t\twCount := 0\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif g[j][i] == 1 {\n\t\t\t\twCount++\n\t\t\t}\n\t\t}\n\t\tif wCount == b || wCount == h-b {\n\t\t\tcontinue\n\t\t}\n\t\treturn false\n\t}\n\treturn true\n\n}\n\nfunc gen(h, w, v int) [][]int {\n\trows := make([][]int, h)\n\tval := strconv.FormatInt(int64(v), 2)\n\tfor i := 0; i < h; i++ {\n\t\trow := make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tnum := \"0\"[0]\n\t\t\tif len(val) > i*w+j {\n\t\t\t\tnum = val[i*w+j]\n\t\t\t}\n\t\t\tif num == '1' {\n\t\t\t\trow[j] = 1\n\t\t\t}\n\t\t}\n\t\trows[i] = row\n\t}\n\treturn rows\n}\n\nfunc print(g [][]int) {\n\tfor _, row := range g {\n\t\tfor _, cell := range row {\n\t\t\tfmt.Print(cell)\n\t\t}\n\t\tfmt.Print(\"\\n\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1967, "cpu_time_ms": 2108, "memory_kb": 14208}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s344915657", "group_id": "codeNet:p02910", "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\tdances := strings.Split(s, \"\")\n\teasy := true\n\tfor i, dance := range dances {\n\t\tif i%2 != 0 {\n\t\t\tif dance == \"R\" {\n\t\t\t\teasy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif dance == \"L\" {\n\t\t\t\teasy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif easy {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1568677657, "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/s344915657.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s344915657", "user_id": "u523014857"}, "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\tdances := strings.Split(s, \"\")\n\teasy := true\n\tfor i, dance := range dances {\n\t\tif i%2 != 0 {\n\t\t\tif dance == \"R\" {\n\t\t\t\teasy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif dance == \"L\" {\n\t\t\t\teasy = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif easy {\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\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "sample_input": "RUDLUDR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02910", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 371, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s220875674", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tK, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tQ, _ := strconv.Atoi(sc.Text())\n\n\tA := make([]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tpoints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i] = K - Q\n\t}\n\n\tfor _, person := range A {\n\t\tpoints[person-1]++\n\t}\n\n\twriter := bufio.NewWriter(os.Stdout)\n\tfor _, point := range points {\n\t\tif point > 0 {\n\t\t\twriter.WriteString(\"Yes\\n\")\n\t\t} else {\n\t\t\twriter.WriteString(\"No\\n\")\n\t\t}\n\t}\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1569276580, "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/s220875674.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s220875674", "user_id": "u876149922"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tK, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tQ, _ := strconv.Atoi(sc.Text())\n\n\tA := make([]int, Q)\n\tfor i := 0; i < Q; i++ {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tpoints := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tpoints[i] = K - Q\n\t}\n\n\tfor _, person := range A {\n\t\tpoints[person-1]++\n\t}\n\n\twriter := bufio.NewWriter(os.Stdout)\n\tfor _, point := range points {\n\t\tif point > 0 {\n\t\t\twriter.WriteString(\"Yes\\n\")\n\t\t} else {\n\t\t\twriter.WriteString(\"No\\n\")\n\t\t}\n\t}\n\twriter.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 21, "memory_kb": 3200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s112042089", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, q int\n\tfmt.Scanf(\"%d %d %d\", &n, &k, &q)\n\n\tas := make([]int, q)\n\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scanf(\"%d\", &as[i])\n\t}\n\n\tfor _, v := range *check(n, k, q ,&as) {\n\t\tfmt.Println(v)\n\t}\n}\n\nfunc check(n int, k int, q int, as *[]int) *[]string {\n\tp := make([]int, n)\n\tresults := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = k\n\t}\n\tfor _, a := range *as {\n\t\tfor i, _ := range p {\n\t\t\tif a != i+1 {\n\t\t\t\tp[i] -= 1\n\t\t\t}\n\t\t}\n\t}\n\tfor k, v := range p {\n\t\tif v <= 0 {\n\t\t\tresults[k] = \"No\"\n\t\t} else {\n\t\t\tresults[k] = \"Yes\"\n\t\t}\n\t}\n\treturn &results\n}", "language": "Go", "metadata": {"date": 1569096052, "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/s112042089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s112042089", "user_id": "u119830165"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, q int\n\tfmt.Scanf(\"%d %d %d\", &n, &k, &q)\n\n\tas := make([]int, q)\n\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scanf(\"%d\", &as[i])\n\t}\n\n\tfor _, v := range *check(n, k, q ,&as) {\n\t\tfmt.Println(v)\n\t}\n}\n\nfunc check(n int, k int, q int, as *[]int) *[]string {\n\tp := make([]int, n)\n\tresults := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tp[i] = k\n\t}\n\tfor _, a := range *as {\n\t\tfor i, _ := range p {\n\t\t\tif a != i+1 {\n\t\t\t\tp[i] -= 1\n\t\t\t}\n\t\t}\n\t}\n\tfor k, v := range p {\n\t\tif v <= 0 {\n\t\t\tresults[k] = \"No\"\n\t\t} else {\n\t\t\tresults[k] = \"Yes\"\n\t\t}\n\t}\n\treturn &results\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2111, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s712170592", "group_id": "codeNet:p02911", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, q int\n\tfmt.Scan(&n, &k, &q)\n\n\tvar a = make([]int, q)\n\tfor i:=0; i 0; j++ {\n\t\t\tif j == s {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnn[j] -= 1\n\t\t}\n\t}\n\n\tfor i:=0; i 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1568823952, "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/s712170592.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s712170592", "user_id": "u536614266"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k, q int\n\tfmt.Scan(&n, &k, &q)\n\n\tvar a = make([]int, q)\n\tfor i:=0; i 0; j++ {\n\t\t\tif j == s {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnn[j] -= 1\n\t\t}\n\t}\n\n\tfor i:=0; i 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 454, "cpu_time_ms": 2112, "memory_kb": 7936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s316016039", "group_id": "codeNet:p02915", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc readInt() int {\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\treturn n\n}\n\nfunc main() {\n\tn := readInt()\n\tfmt.Println(n * n * n)\n}", "language": "Go", "metadata": {"date": 1586016661, "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/s316016039.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s316016039", "user_id": "u121595121"}, "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 (\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc readInt() int {\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\treturn n\n}\n\nfunc main() {\n\tn := readInt()\n\tfmt.Println(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 249, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s624194690", "group_id": "codeNet:p02915", "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\n\tfmt.Println(N * N * N)\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": 1570072422, "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/s624194690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s624194690", "user_id": "u578274732"}, "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 main() {\n\tN := nextInt()\n\n\tfmt.Println(N * N * N)\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 : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 630, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s492186179", "group_id": "codeNet:p02916", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, sum int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tb := make([]int, n)\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\n\tc := make([]int, n-1)\n\tfor i := range c {\n\t\tfmt.Scan(&c[i])\n\t}\n\n\ty := len(a) + 1\n\tfor _, v := range a {\n\t\tv = v - 1\n\t\tsum += b[v]\n\t\tif y == v-1 {\n\t\t\tsum += c[y]\n\t\t}\n\t\ty = v\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1567996201, "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/s492186179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s492186179", "user_id": "u550296200"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, sum int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tb := make([]int, n)\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\n\tc := make([]int, n-1)\n\tfor i := range c {\n\t\tfmt.Scan(&c[i])\n\t}\n\n\ty := len(a) + 1\n\tfor _, v := range a {\n\t\tv = v - 1\n\t\tsum += b[v]\n\t\tif y == v-1 {\n\t\t\tsum += c[y]\n\t\t}\n\t\ty = v\n\t}\n\tfmt.Println(sum)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 396, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s939483933", "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\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer writer.Flush()\n\tn := scanInt()\n\tb := scanInts(n - 1)\n\n\tif n == 2 {\n\t\tfmt.Println(b[0] * 2)\n\t\treturn\n\t}\n\n\tmin := func(n ...int) int {\n\t\tret := math.MaxInt64\n\t\tfor _, v := range n {\n\t\t\tif v < ret {\n\t\t\t\tret = v\n\t\t\t}\n\t\t}\n\t\treturn ret\n\t}\n\n\tans := b[0] + b[n-2]\n\tfor i := 1; i < n-1; i++ {\n\t\tans += min(b[i-1], b[i])\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\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(scanString(), 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 scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\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 perm(n, r int) int {\n\tret := 1\n\tfor i := 0; i < r; i++ {\n\t\tret *= n\n\t\tn--\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": 1587002887, "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/s939483933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s939483933", "user_id": "u550884590"}, "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\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer writer.Flush()\n\tn := scanInt()\n\tb := scanInts(n - 1)\n\n\tif n == 2 {\n\t\tfmt.Println(b[0] * 2)\n\t\treturn\n\t}\n\n\tmin := func(n ...int) int {\n\t\tret := math.MaxInt64\n\t\tfor _, v := range n {\n\t\t\tif v < ret {\n\t\t\t\tret = v\n\t\t\t}\n\t\t}\n\t\treturn ret\n\t}\n\n\tans := b[0] + b[n-2]\n\tfor i := 1; i < n-1; i++ {\n\t\tans += min(b[i-1], b[i])\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\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(scanString(), 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 scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\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 perm(n, r int) int {\n\tret := 1\n\tfor i := 0; i < r; i++ {\n\t\tret *= n\n\t\tn--\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2040, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930237083", "group_id": "codeNet:p02917", "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 gets() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc atoi(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 main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar A []int\n\n\tB := strings.Split(gets(), \" \")\n\n\t// fmt.Println(A)\n\t// fmt.Println(B)\n\n\tfor i := 0; i < n-2; i++ {\n\t\tif atoi(B[i+1]) < (atoi(B[i])) {\n\t\t\tA = append(A, atoi(B[i+1]))\n\t\t} else {\n\t\t\tA = append(A, atoi(B[i]))\n\t\t}\n\t}\n\tA = append(A, atoi(B[n-2]))\n\n\t// fmt.Println(A[:n])\n\n\tsum := 0\n\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1567912155, "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/s930237083.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s930237083", "user_id": "u922833741"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc gets() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc atoi(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 main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar A []int\n\n\tB := strings.Split(gets(), \" \")\n\n\t// fmt.Println(A)\n\t// fmt.Println(B)\n\n\tfor i := 0; i < n-2; i++ {\n\t\tif atoi(B[i+1]) < (atoi(B[i])) {\n\t\t\tA = append(A, atoi(B[i+1]))\n\t\t} else {\n\t\t\tA = append(A, atoi(B[i]))\n\t\t}\n\t}\n\tA = append(A, atoi(B[n-2]))\n\n\t// fmt.Println(A[:n])\n\n\tsum := 0\n\n\tfor _, a := range A {\n\t\tsum += a\n\t}\n\n\tfmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s763524106", "group_id": "codeNet:p02918", "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\tS := getString()\n\n\trow := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == 'L' {\n\t\t\trow[i] = 0\n\t\t} else {\n\t\t\trow[i] = 1\n\t\t}\n\t}\n\n\tstartTarget := 0\n\tendTarget := 0\n\tif row[0] == 0 {\n\t\tstartTarget = 1\n\t\tendTarget = 0\n\t} else {\n\t\tstartTarget = 0\n\t\tendTarget = 1\n\t}\n\n\tfor i := 0; i < K; i++ {\n\t\tl := -1\n\t\tr := -1\n\n\t\tfor index, p := range row {\n\t\t\tif l == -1 {\n\t\t\t\tif p == startTarget {\n\t\t\t\t\tl = index\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif l != -1 {\n\t\t\t\tif p == endTarget {\n\t\t\t\t\tr = index - 1\n\t\t\t\t\tbreak\n\t\t\t\t} else if index == N-1 {\n\t\t\t\t\tr = index\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif l == -1 || r == -1 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor index := l; index <= r; index++ {\n\t\t\trow[index] = endTarget\n\t\t}\n\n\t\t//fmt.Println(row)\n\t}\n\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i == 0 && row[i] == 0 {\n\t\t\tcontinue\n\t\t} else if i == N-1 && row[i] == 1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif row[i] == 0 && row[i-1] == 0 {\n\t\t\tresult++\n\t\t} else if row[i] == 1 && row[i+1] == 1 {\n\t\t\tresult++\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 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": 1585716107, "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/s763524106.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s763524106", "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\tK := getInt()\n\tS := getString()\n\n\trow := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == 'L' {\n\t\t\trow[i] = 0\n\t\t} else {\n\t\t\trow[i] = 1\n\t\t}\n\t}\n\n\tstartTarget := 0\n\tendTarget := 0\n\tif row[0] == 0 {\n\t\tstartTarget = 1\n\t\tendTarget = 0\n\t} else {\n\t\tstartTarget = 0\n\t\tendTarget = 1\n\t}\n\n\tfor i := 0; i < K; i++ {\n\t\tl := -1\n\t\tr := -1\n\n\t\tfor index, p := range row {\n\t\t\tif l == -1 {\n\t\t\t\tif p == startTarget {\n\t\t\t\t\tl = index\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif l != -1 {\n\t\t\t\tif p == endTarget {\n\t\t\t\t\tr = index - 1\n\t\t\t\t\tbreak\n\t\t\t\t} else if index == N-1 {\n\t\t\t\t\tr = index\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif l == -1 || r == -1 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor index := l; index <= r; index++ {\n\t\t\trow[index] = endTarget\n\t\t}\n\n\t\t//fmt.Println(row)\n\t}\n\n\tresult := 0\n\tfor i := 0; i < N; i++ {\n\t\tif i == 0 && row[i] == 0 {\n\t\t\tcontinue\n\t\t} else if i == N-1 && row[i] == 1 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif row[i] == 0 && row[i-1] == 0 {\n\t\t\tresult++\n\t\t} else if row[i] == 1 && row[i+1] == 1 {\n\t\t\tresult++\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 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 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5997, "cpu_time_ms": 2107, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s441015142", "group_id": "codeNet:p02918", "input_text": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n \nfunc run() {\n\tn := nextInt()\n\tk := nextInt()\n\ts := next()\n\t\n\tv := make([]int, 0)\n\t\n\tfor i := 0; i < n; i++ {\n\t\tif(string(s[i]) == \"R\"){\n\t\t\tv = append(v, 1)\n\t\t}else {\n\t\t\tv = append(v, 0)\n\t\t}\n\t}\n\t\n\tcount := 0\n\tcount2 := 1\n\tte := v[0]\n\t\n\tfor i := 1; i < n; i++ {\n\t\tif(te == v[i]){ \n\t\t\tcount ++\n\t\t}else{\n\t\t\tcount2 ++\n\t\t\tte = v[i]\n\t\t}\n\t} \n\t\n\tif (count2 / 2 < k) {\n\t\tPrintln(count + (count2 / 2) * 2)\n\t} else{\n\t\tPrintln(count + k * 2 - (count2 % 2))\n\t}\n\t\n}\n\n// --- template ---\n// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695\n \nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n \n// Caution: You will get unexpected result if a single token is larger than this size.\nconst BufferSize = 64 * 1024 * 1024\n \nfunc Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(out, a...)\n}\n \nfunc Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(out, format, a...)\n}\n \nfunc Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(out, a...)\n}\n \nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\ta, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n \nfunc nextFloat() float64 {\n\ta, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\n \nfunc main() {\n\tsc.Buffer(make([]byte, 0, BufferSize), BufferSize)\n\tsc.Split(bufio.ScanWords)\n\trun()\n\tout.Flush()\n}", "language": "Go", "metadata": {"date": 1567913494, "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/s441015142.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s441015142", "user_id": "u770238087"}, "prompt_components": {"gold_output": "3\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 run() {\n\tn := nextInt()\n\tk := nextInt()\n\ts := next()\n\t\n\tv := make([]int, 0)\n\t\n\tfor i := 0; i < n; i++ {\n\t\tif(string(s[i]) == \"R\"){\n\t\t\tv = append(v, 1)\n\t\t}else {\n\t\t\tv = append(v, 0)\n\t\t}\n\t}\n\t\n\tcount := 0\n\tcount2 := 1\n\tte := v[0]\n\t\n\tfor i := 1; i < n; i++ {\n\t\tif(te == v[i]){ \n\t\t\tcount ++\n\t\t}else{\n\t\t\tcount2 ++\n\t\t\tte = v[i]\n\t\t}\n\t} \n\t\n\tif (count2 / 2 < k) {\n\t\tPrintln(count + (count2 / 2) * 2)\n\t} else{\n\t\tPrintln(count + k * 2 - (count2 % 2))\n\t}\n\t\n}\n\n// --- template ---\n// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695\n \nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n \n// Caution: You will get unexpected result if a single token is larger than this size.\nconst BufferSize = 64 * 1024 * 1024\n \nfunc Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(out, a...)\n}\n \nfunc Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(out, format, a...)\n}\n \nfunc Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(out, a...)\n}\n \nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\ta, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n \nfunc nextFloat() float64 {\n\ta, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\n \nfunc main() {\n\tsc.Buffer(make([]byte, 0, BufferSize), BufferSize)\n\tsc.Split(bufio.ScanWords)\n\trun()\n\tout.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1493, "cpu_time_ms": 10, "memory_kb": 7424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s972638693", "group_id": "codeNet:p02919", "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\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}\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\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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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// DigitNumOfDecimal returns digits number of n.\n// n is non negative number.\nfunc DigitNumOfDecimal(n int) int {\n\tres := 0\n\n\tfor n > 0 {\n\t\tn /= 10\n\t\tres++\n\t}\n\n\treturn res\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// Kiriage returns Ceil(a/b)\n// a >= 0, b > 0\nfunc Kiriage(a, b int) int {\n\treturn (a + (b - 1)) / b\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// 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n int\nvar P []int\n\ntype Item struct {\n\tkey int\n\tval, idx int\n}\ntype ItemList []*Item\ntype byKey struct {\n\tItemList\n}\n\nfunc (l ItemList) Len() int {\n\treturn len(l)\n}\nfunc (l ItemList) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc (l byKey) Less(i, j int) bool {\n\treturn l.ItemList[i].key < l.ItemList[j].key\n}\n\n// how to use\n// L := make(ItemList, 0, 200000+5)\n// L = append(L, &Item{key: intValue})\n// sort.Stable(byKey{ L }) // Stable ASC\n// sort.Stable(sort.Reverse(byKey{ L })) // Stable DESC\n\nfunc main() {\n\tn = ReadInt()\n\tP = ReadIntSlice(n)\n\n\tL := make(ItemList, n)\n\tfor i := 0; i < n; i++ {\n\t\tL[i] = &Item{key: P[i], idx: i, val: P[i]}\n\t}\n\tsort.Stable(sort.Reverse(byKey{L}))\n\n\tans := 0\n\ttr := NewTreap()\n\tfor i := 0; i < n; i++ {\n\t\titem := L[i]\n\n\t\tright1 := tr.BiggerUpperBound(item.idx)\n\t\tleft1 := tr.SmallerLowerBound(item.idx)\n\n\t\tif right1 == nil && left1 == nil {\n\t\t\ttr.Insert(item.idx)\n\t\t\tcontinue\n\t\t}\n\n\t\tl, r := 0, 0\n\t\tif right1 == nil && left1 != nil {\n\t\t\t// 左側を含めれば右側はどこまでも伸ばせる\n\t\t\t// 左側にさらに大きいものがあったら、それは含んではいけない\n\t\t\tl = left1.key\n\t\t\tleft2 := tr.SmallerLowerBound(l)\n\t\t\tl2 := 0\n\t\t\tif left2 == nil {\n\t\t\t\tl2 = -1\n\t\t\t} else {\n\t\t\t\tl2 = left2.key\n\t\t\t}\n\t\t\tr = n\n\t\t\tans += item.val * ((r - item.idx) * (l - l2))\n\t\t} else if right1 != nil && left1 == nil {\n\t\t\t// 右側を含めれば左側はどこまでも伸ばせる\n\t\t\t// 右側にさらに大きいものがあったら、それは含んではいけない\n\t\t\tl = -1\n\t\t\tr = right1.key\n\t\t\tright2 := tr.BiggerUpperBound(r)\n\t\t\tr2 := 0\n\t\t\tif right2 == nil {\n\t\t\t\tr2 = n\n\t\t\t} else {\n\t\t\t\tr2 = right2.key\n\t\t\t}\n\t\t\tans += item.val * ((item.idx - l) * (r2 - r))\n\t\t} else {\n\t\t\t// 右・左のどちらかを含める場合のすべてを数える\n\t\t\tl = left1.key\n\t\t\tr = right1.key\n\t\t\tleft2 := tr.SmallerLowerBound(l)\n\t\t\tl2 := 0\n\t\t\tif left2 == nil {\n\t\t\t\tl2 = -1\n\t\t\t} else {\n\t\t\t\tl2 = left2.key\n\t\t\t}\n\t\t\tright2 := tr.BiggerUpperBound(r)\n\t\t\tr2 := 0\n\t\t\tif right2 == nil {\n\t\t\t\tr2 = n\n\t\t\t} else {\n\t\t\t\tr2 = right2.key\n\t\t\t}\n\t\t\t// ans += item.val * ((r - item.idx) + (item.idx - l))\n\t\t\tans += item.val * ((r - item.idx) * (l - l2))\n\t\t\tans += item.val * ((r2 - r) * (item.idx - l))\n\t\t}\n\t\t// fmt.Printf(\"m: %d, l: %d, r: %d\\n\", item.idx, l, r)\n\n\t\t// ans += item.val * ((r - item.idx) + (item.idx - l))\n\t\ttr.Insert(item.idx)\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Treap usage\n// tr := NewTreap()\n// tr.Insert(k)\n// node := tr.Find(k)\n// min := tr.FindMinimum()\n// max := tr.FindMaximum()\n// tr.Delete(k)\n// node := tr.BigggerLowerBound(x)\n// node := tr.BiggerUpperBound(x)\n// node := tr.SmallerUpperBound(x)\n// node := tr.SmallerLowerBound(x)\n// fmt.Println(PrintIntsLine(tr.Inorder()...))\n// fmt.Println(PrintIntsLine(tr.Preorder()...))\n// tr.InsertBySettingPri(k, p)\n\ntype Node struct {\n\tkey, priority int\n\tright, left *Node\n}\n\ntype Treap struct {\n\troot *Node\n}\n\n/*************************************/\n// Public method\n/*************************************/\n\n// NewTreap returns a pointer of a Treap instance.\nfunc NewTreap() *Treap {\n\ttr := new(Treap)\n\ttr.root = nil\n\treturn tr\n}\n\n// InsertBySettingPri method inserts a new node consisting of new key and priority.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) InsertBySettingPri(key, priority int) {\n\ttr.root = tr.insert(tr.root, key, priority)\n}\n\n// for XorShift\nvar _gtx, _gty, _gtz, _gtw = 123456789, 362436069, 521288629, 88675123\n\n// Insert method inserts a new node consisting o new key.\n// The priority is automatically set by random value.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) Insert(key int) {\n\t// XorShiftによる乱数生成\n\t// 下記URLを参考\n\t// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\n\trandInt := func() int {\n\t\ttt := (_gtx ^ (_gtx << 11))\n\t\t_gtx = _gty\n\t\t_gty = _gtz\n\t\t_gtz = _gtw\n\t\t_gtw = (_gtw ^ (_gtw >> 19)) ^ (tt ^ (tt >> 8))\n\t\treturn _gtw\n\t}\n\n\ttr.root = tr.insert(tr.root, key, randInt())\n}\n\n// Find returns a node that has an argument key value.\n// Find returns nil when there is no node that has an argument key value.\nfunc (tr *Treap) Find(k int) *Node {\n\tu := tr.root\n\tfor u != nil && k != u.key {\n\t\tif k < u.key {\n\t\t\tu = u.left\n\t\t} else {\n\t\t\tu = u.right\n\t\t}\n\t}\n\treturn u\n}\n\n// FindMinimum returns a node that has the minimum key in the treap.\n// FindMinimum returns nil when there is no nodes.\nfunc (tr *Treap) FindMinimum() *Node {\n\tu := tr.root\n\tfor u != nil && u.left != nil {\n\t\tu = u.left\n\t}\n\treturn u\n}\n\n// FindMaximum returns a node that has the maximum key in the treap.\n// FindMaximum returns nil when there is no nodes.\nfunc (tr *Treap) FindMaximum() *Node {\n\tu := tr.root\n\tfor u != nil && u.right != nil {\n\t\tu = u.right\n\t}\n\treturn u\n}\n\n// Delete method deletes a node that has an argument key value.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) Delete(key int) {\n\ttr.root = tr.delete(tr.root, key)\n}\n\n// Inorder returns a slice consisting of treap nodes in order of INORDER.\n// The nodes are sorted by key values.\nfunc (tr *Treap) Inorder() []int {\n\tres := make([]int, 0, 200000+5)\n\ttr.inorder(tr.root, &res)\n\treturn res\n}\n\n// Preorder returns a slice consisting of treap nodes in order of PREORDER.\nfunc (tr *Treap) Preorder() []int {\n\tres := make([]int, 0, 200000+5)\n\ttr.preorder(tr.root, &res)\n\treturn res\n}\n\n// BiggerLowerBound returns a node that has MINIMUM KEY MEETING key >= x.\n// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\nfunc (tr *Treap) BiggerLowerBound(x int) *Node {\n\treturn tr.biggerLowerBound(tr.root, x)\n}\n\n// BiggerUpperBound returns a node that has MINIMUM KEY MEETING key > x.\n// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\nfunc (tr *Treap) BiggerUpperBound(x int) *Node {\n\treturn tr.biggerUpperBound(tr.root, x)\n}\n\n// SmallerUpperBound returns a node that has MAXIMUM KEY MEETING key <= x.\n// for AGC005-B\nfunc (tr *Treap) SmallerUpperBound(x int) *Node {\n\treturn tr.smallerUpperBound(tr.root, x)\n}\n\n// SmallerLowerBound returns a node that has MAXIMUM KEY MEETING key < x.\n// for AGC005-B\nfunc (tr *Treap) SmallerLowerBound(x int) *Node {\n\treturn tr.smallerLowerBound(tr.root, x)\n}\n\n/*************************************/\n// Private method\n/*************************************/\n\nfunc (tr *Treap) insert(t *Node, key, priority int) *Node {\n\t// 葉に到達したら新しい節点を生成して返す\n\tif t == nil {\n\t\tnode := new(Node)\n\t\tnode.key, node.priority = key, priority\n\t\treturn node\n\t}\n\n\t// 重複したkeyは無視\n\tif key == t.key {\n\t\treturn t\n\t}\n\n\tif key < t.key {\n\t\t// 左の子へ移動\n\t\tt.left = tr.insert(t.left, key, priority) // 左の子へのポインタを更新\n\t\t// 左の子の方が優先度が高い場合右回転\n\t\tif t.priority < t.left.priority {\n\t\t\tt = tr.rightRotate(t)\n\t\t}\n\t} else {\n\t\t// 右の子へ移動\n\t\tt.right = tr.insert(t.right, key, priority) // 右の子へのポインタを更新\n\t\tif t.priority < t.right.priority {\n\t\t\t// 右の子の方が優先度が高い場合左回転\n\t\t\tt = tr.leftRotate(t)\n\t\t}\n\t}\n\n\treturn t\n}\n\n// 削除対象の節点を回転によって葉まで移動させた後に削除する\nfunc (tr *Treap) delete(t *Node, key int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\t// 削除対象を検索\n\tif key < t.key {\n\t\tt.left = tr.delete(t.left, key)\n\t} else if key > t.key {\n\t\tt.right = tr.delete(t.right, key)\n\t} else {\n\t\t// 削除対象を発見、葉ノードとなるように回転を繰り返す\n\t\treturn tr._delete(t, key)\n\t}\n\n\treturn t\n}\n\n// 削除対象の節点の場合\nfunc (tr *Treap) _delete(t *Node, key int) *Node {\n\tif t.left == nil && t.right == nil {\n\t\t// 葉の場合\n\t\treturn nil\n\t} else if t.left == nil {\n\t\t// 右の子のみを持つ場合は左回転\n\t\tt = tr.leftRotate(t)\n\t} else if t.right == nil {\n\t\t// 左の子のみを持つ場合は右回転\n\t\tt = tr.rightRotate(t)\n\t} else {\n\t\t// 優先度が高い方を持ち上げる\n\t\tif t.left.priority > t.right.priority {\n\t\t\tt = tr.rightRotate(t)\n\t\t} else {\n\t\t\tt = tr.leftRotate(t)\n\t\t}\n\t}\n\n\treturn tr.delete(t, key)\n}\n\nfunc (tr *Treap) rightRotate(t *Node) *Node {\n\ts := t.left\n\tt.left = s.right\n\ts.right = t\n\treturn s\n}\n\nfunc (tr *Treap) leftRotate(t *Node) *Node {\n\ts := t.right\n\tt.right = s.left\n\ts.left = t\n\treturn s\n}\n\n// rootからスタートする\nfunc (tr *Treap) biggerLowerBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key >= x {\n\t\t// 探索キーxが現在のノードキー以下の場合、左を探索する\n\t\tnode := tr.biggerLowerBound(t.left, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\t// 探索キーxが現在のノードキーより大きい場合、右を探索する\n\t\treturn tr.biggerLowerBound(t.right, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) biggerUpperBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key > x {\n\t\t// 探索キーxが現在のノードキーより小さい場合、左を探索する\n\t\tnode := tr.biggerUpperBound(t.left, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\t// 探索キーxが現在のノードキー以上の場合、右を探索する\n\t\treturn tr.biggerUpperBound(t.right, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) smallerUpperBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key <= x {\n\t\tnode := tr.smallerUpperBound(t.right, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\treturn tr.smallerUpperBound(t.left, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) smallerLowerBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key < x {\n\t\tnode := tr.smallerLowerBound(t.right, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\treturn tr.smallerLowerBound(t.left, x)\n\t}\n}\n\nfunc (tr *Treap) inorder(u *Node, res *[]int) {\n\tif u == nil {\n\t\treturn\n\t}\n\ttr.inorder(u.left, res)\n\t*res = append(*res, u.key)\n\ttr.inorder(u.right, res)\n}\n\nfunc (tr *Treap) preorder(u *Node, res *[]int) {\n\tif u == nil {\n\t\treturn\n\t}\n\t*res = append(*res, u.key)\n\ttr.preorder(u.left, res)\n\ttr.preorder(u.right, res)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1568568837, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02919.html", "problem_id": "p02919", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02919/input.txt", "sample_output_relpath": "derived/input_output/data/p02919/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02919/Go/s972638693.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s972638693", "user_id": "u103600314"}, "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\"sort\"\n\t\"strconv\"\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}\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\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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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// DigitNumOfDecimal returns digits number of n.\n// n is non negative number.\nfunc DigitNumOfDecimal(n int) int {\n\tres := 0\n\n\tfor n > 0 {\n\t\tn /= 10\n\t\tres++\n\t}\n\n\treturn res\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// Kiriage returns Ceil(a/b)\n// a >= 0, b > 0\nfunc Kiriage(a, b int) int {\n\treturn (a + (b - 1)) / b\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// 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/********** 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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n int\nvar P []int\n\ntype Item struct {\n\tkey int\n\tval, idx int\n}\ntype ItemList []*Item\ntype byKey struct {\n\tItemList\n}\n\nfunc (l ItemList) Len() int {\n\treturn len(l)\n}\nfunc (l ItemList) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc (l byKey) Less(i, j int) bool {\n\treturn l.ItemList[i].key < l.ItemList[j].key\n}\n\n// how to use\n// L := make(ItemList, 0, 200000+5)\n// L = append(L, &Item{key: intValue})\n// sort.Stable(byKey{ L }) // Stable ASC\n// sort.Stable(sort.Reverse(byKey{ L })) // Stable DESC\n\nfunc main() {\n\tn = ReadInt()\n\tP = ReadIntSlice(n)\n\n\tL := make(ItemList, n)\n\tfor i := 0; i < n; i++ {\n\t\tL[i] = &Item{key: P[i], idx: i, val: P[i]}\n\t}\n\tsort.Stable(sort.Reverse(byKey{L}))\n\n\tans := 0\n\ttr := NewTreap()\n\tfor i := 0; i < n; i++ {\n\t\titem := L[i]\n\n\t\tright1 := tr.BiggerUpperBound(item.idx)\n\t\tleft1 := tr.SmallerLowerBound(item.idx)\n\n\t\tif right1 == nil && left1 == nil {\n\t\t\ttr.Insert(item.idx)\n\t\t\tcontinue\n\t\t}\n\n\t\tl, r := 0, 0\n\t\tif right1 == nil && left1 != nil {\n\t\t\t// 左側を含めれば右側はどこまでも伸ばせる\n\t\t\t// 左側にさらに大きいものがあったら、それは含んではいけない\n\t\t\tl = left1.key\n\t\t\tleft2 := tr.SmallerLowerBound(l)\n\t\t\tl2 := 0\n\t\t\tif left2 == nil {\n\t\t\t\tl2 = -1\n\t\t\t} else {\n\t\t\t\tl2 = left2.key\n\t\t\t}\n\t\t\tr = n\n\t\t\tans += item.val * ((r - item.idx) * (l - l2))\n\t\t} else if right1 != nil && left1 == nil {\n\t\t\t// 右側を含めれば左側はどこまでも伸ばせる\n\t\t\t// 右側にさらに大きいものがあったら、それは含んではいけない\n\t\t\tl = -1\n\t\t\tr = right1.key\n\t\t\tright2 := tr.BiggerUpperBound(r)\n\t\t\tr2 := 0\n\t\t\tif right2 == nil {\n\t\t\t\tr2 = n\n\t\t\t} else {\n\t\t\t\tr2 = right2.key\n\t\t\t}\n\t\t\tans += item.val * ((item.idx - l) * (r2 - r))\n\t\t} else {\n\t\t\t// 右・左のどちらかを含める場合のすべてを数える\n\t\t\tl = left1.key\n\t\t\tr = right1.key\n\t\t\tleft2 := tr.SmallerLowerBound(l)\n\t\t\tl2 := 0\n\t\t\tif left2 == nil {\n\t\t\t\tl2 = -1\n\t\t\t} else {\n\t\t\t\tl2 = left2.key\n\t\t\t}\n\t\t\tright2 := tr.BiggerUpperBound(r)\n\t\t\tr2 := 0\n\t\t\tif right2 == nil {\n\t\t\t\tr2 = n\n\t\t\t} else {\n\t\t\t\tr2 = right2.key\n\t\t\t}\n\t\t\t// ans += item.val * ((r - item.idx) + (item.idx - l))\n\t\t\tans += item.val * ((r - item.idx) * (l - l2))\n\t\t\tans += item.val * ((r2 - r) * (item.idx - l))\n\t\t}\n\t\t// fmt.Printf(\"m: %d, l: %d, r: %d\\n\", item.idx, l, r)\n\n\t\t// ans += item.val * ((r - item.idx) + (item.idx - l))\n\t\ttr.Insert(item.idx)\n\t}\n\n\tfmt.Println(ans)\n}\n\n// Treap usage\n// tr := NewTreap()\n// tr.Insert(k)\n// node := tr.Find(k)\n// min := tr.FindMinimum()\n// max := tr.FindMaximum()\n// tr.Delete(k)\n// node := tr.BigggerLowerBound(x)\n// node := tr.BiggerUpperBound(x)\n// node := tr.SmallerUpperBound(x)\n// node := tr.SmallerLowerBound(x)\n// fmt.Println(PrintIntsLine(tr.Inorder()...))\n// fmt.Println(PrintIntsLine(tr.Preorder()...))\n// tr.InsertBySettingPri(k, p)\n\ntype Node struct {\n\tkey, priority int\n\tright, left *Node\n}\n\ntype Treap struct {\n\troot *Node\n}\n\n/*************************************/\n// Public method\n/*************************************/\n\n// NewTreap returns a pointer of a Treap instance.\nfunc NewTreap() *Treap {\n\ttr := new(Treap)\n\ttr.root = nil\n\treturn tr\n}\n\n// InsertBySettingPri method inserts a new node consisting of new key and priority.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) InsertBySettingPri(key, priority int) {\n\ttr.root = tr.insert(tr.root, key, priority)\n}\n\n// for XorShift\nvar _gtx, _gty, _gtz, _gtw = 123456789, 362436069, 521288629, 88675123\n\n// Insert method inserts a new node consisting o new key.\n// The priority is automatically set by random value.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) Insert(key int) {\n\t// XorShiftによる乱数生成\n\t// 下記URLを参考\n\t// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\n\trandInt := func() int {\n\t\ttt := (_gtx ^ (_gtx << 11))\n\t\t_gtx = _gty\n\t\t_gty = _gtz\n\t\t_gtz = _gtw\n\t\t_gtw = (_gtw ^ (_gtw >> 19)) ^ (tt ^ (tt >> 8))\n\t\treturn _gtw\n\t}\n\n\ttr.root = tr.insert(tr.root, key, randInt())\n}\n\n// Find returns a node that has an argument key value.\n// Find returns nil when there is no node that has an argument key value.\nfunc (tr *Treap) Find(k int) *Node {\n\tu := tr.root\n\tfor u != nil && k != u.key {\n\t\tif k < u.key {\n\t\t\tu = u.left\n\t\t} else {\n\t\t\tu = u.right\n\t\t}\n\t}\n\treturn u\n}\n\n// FindMinimum returns a node that has the minimum key in the treap.\n// FindMinimum returns nil when there is no nodes.\nfunc (tr *Treap) FindMinimum() *Node {\n\tu := tr.root\n\tfor u != nil && u.left != nil {\n\t\tu = u.left\n\t}\n\treturn u\n}\n\n// FindMaximum returns a node that has the maximum key in the treap.\n// FindMaximum returns nil when there is no nodes.\nfunc (tr *Treap) FindMaximum() *Node {\n\tu := tr.root\n\tfor u != nil && u.right != nil {\n\t\tu = u.right\n\t}\n\treturn u\n}\n\n// Delete method deletes a node that has an argument key value.\n// A duplicate key is ignored and nothing happens.\nfunc (tr *Treap) Delete(key int) {\n\ttr.root = tr.delete(tr.root, key)\n}\n\n// Inorder returns a slice consisting of treap nodes in order of INORDER.\n// The nodes are sorted by key values.\nfunc (tr *Treap) Inorder() []int {\n\tres := make([]int, 0, 200000+5)\n\ttr.inorder(tr.root, &res)\n\treturn res\n}\n\n// Preorder returns a slice consisting of treap nodes in order of PREORDER.\nfunc (tr *Treap) Preorder() []int {\n\tres := make([]int, 0, 200000+5)\n\ttr.preorder(tr.root, &res)\n\treturn res\n}\n\n// BiggerLowerBound returns a node that has MINIMUM KEY MEETING key >= x.\n// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\nfunc (tr *Treap) BiggerLowerBound(x int) *Node {\n\treturn tr.biggerLowerBound(tr.root, x)\n}\n\n// BiggerUpperBound returns a node that has MINIMUM KEY MEETING key > x.\n// https://qiita.com/tubo28/items/f058582e457f6870a800#lower_bound-upper_bound\nfunc (tr *Treap) BiggerUpperBound(x int) *Node {\n\treturn tr.biggerUpperBound(tr.root, x)\n}\n\n// SmallerUpperBound returns a node that has MAXIMUM KEY MEETING key <= x.\n// for AGC005-B\nfunc (tr *Treap) SmallerUpperBound(x int) *Node {\n\treturn tr.smallerUpperBound(tr.root, x)\n}\n\n// SmallerLowerBound returns a node that has MAXIMUM KEY MEETING key < x.\n// for AGC005-B\nfunc (tr *Treap) SmallerLowerBound(x int) *Node {\n\treturn tr.smallerLowerBound(tr.root, x)\n}\n\n/*************************************/\n// Private method\n/*************************************/\n\nfunc (tr *Treap) insert(t *Node, key, priority int) *Node {\n\t// 葉に到達したら新しい節点を生成して返す\n\tif t == nil {\n\t\tnode := new(Node)\n\t\tnode.key, node.priority = key, priority\n\t\treturn node\n\t}\n\n\t// 重複したkeyは無視\n\tif key == t.key {\n\t\treturn t\n\t}\n\n\tif key < t.key {\n\t\t// 左の子へ移動\n\t\tt.left = tr.insert(t.left, key, priority) // 左の子へのポインタを更新\n\t\t// 左の子の方が優先度が高い場合右回転\n\t\tif t.priority < t.left.priority {\n\t\t\tt = tr.rightRotate(t)\n\t\t}\n\t} else {\n\t\t// 右の子へ移動\n\t\tt.right = tr.insert(t.right, key, priority) // 右の子へのポインタを更新\n\t\tif t.priority < t.right.priority {\n\t\t\t// 右の子の方が優先度が高い場合左回転\n\t\t\tt = tr.leftRotate(t)\n\t\t}\n\t}\n\n\treturn t\n}\n\n// 削除対象の節点を回転によって葉まで移動させた後に削除する\nfunc (tr *Treap) delete(t *Node, key int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t}\n\n\t// 削除対象を検索\n\tif key < t.key {\n\t\tt.left = tr.delete(t.left, key)\n\t} else if key > t.key {\n\t\tt.right = tr.delete(t.right, key)\n\t} else {\n\t\t// 削除対象を発見、葉ノードとなるように回転を繰り返す\n\t\treturn tr._delete(t, key)\n\t}\n\n\treturn t\n}\n\n// 削除対象の節点の場合\nfunc (tr *Treap) _delete(t *Node, key int) *Node {\n\tif t.left == nil && t.right == nil {\n\t\t// 葉の場合\n\t\treturn nil\n\t} else if t.left == nil {\n\t\t// 右の子のみを持つ場合は左回転\n\t\tt = tr.leftRotate(t)\n\t} else if t.right == nil {\n\t\t// 左の子のみを持つ場合は右回転\n\t\tt = tr.rightRotate(t)\n\t} else {\n\t\t// 優先度が高い方を持ち上げる\n\t\tif t.left.priority > t.right.priority {\n\t\t\tt = tr.rightRotate(t)\n\t\t} else {\n\t\t\tt = tr.leftRotate(t)\n\t\t}\n\t}\n\n\treturn tr.delete(t, key)\n}\n\nfunc (tr *Treap) rightRotate(t *Node) *Node {\n\ts := t.left\n\tt.left = s.right\n\ts.right = t\n\treturn s\n}\n\nfunc (tr *Treap) leftRotate(t *Node) *Node {\n\ts := t.right\n\tt.right = s.left\n\ts.left = t\n\treturn s\n}\n\n// rootからスタートする\nfunc (tr *Treap) biggerLowerBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key >= x {\n\t\t// 探索キーxが現在のノードキー以下の場合、左を探索する\n\t\tnode := tr.biggerLowerBound(t.left, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\t// 探索キーxが現在のノードキーより大きい場合、右を探索する\n\t\treturn tr.biggerLowerBound(t.right, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) biggerUpperBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key > x {\n\t\t// 探索キーxが現在のノードキーより小さい場合、左を探索する\n\t\tnode := tr.biggerUpperBound(t.left, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\t// 探索キーxが現在のノードキー以上の場合、右を探索する\n\t\treturn tr.biggerUpperBound(t.right, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) smallerUpperBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key <= x {\n\t\tnode := tr.smallerUpperBound(t.right, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\treturn tr.smallerUpperBound(t.left, x)\n\t}\n}\n\n// rootからスタートする\nfunc (tr *Treap) smallerLowerBound(t *Node, x int) *Node {\n\tif t == nil {\n\t\treturn nil\n\t} else if t.key < x {\n\t\tnode := tr.smallerLowerBound(t.right, x)\n\t\tif node != nil {\n\t\t\treturn node\n\t\t} else {\n\t\t\treturn t\n\t\t}\n\t} else {\n\t\treturn tr.smallerLowerBound(t.left, x)\n\t}\n}\n\nfunc (tr *Treap) inorder(u *Node, res *[]int) {\n\tif u == nil {\n\t\treturn\n\t}\n\ttr.inorder(u.left, res)\n\t*res = append(*res, u.key)\n\ttr.inorder(u.right, res)\n}\n\nfunc (tr *Treap) preorder(u *Node, res *[]int) {\n\tif u == nil {\n\t\treturn\n\t}\n\t*res = append(*res, u.key)\n\ttr.preorder(u.left, res)\n\ttr.preorder(u.right, res)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nGiven is a permutation P of \\{1, 2, \\ldots, N\\}.\n\nFor a pair (L, R) (1 \\le L \\lt R \\le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \\ldots, P_R.\n\nFind \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le P_i \\le N\n\nP_i \\neq P_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\nP_1 P_2 \\ldots P_N\n\nOutput\n\nPrint \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n5\n\nX_{1, 2} = 2, X_{1, 3} = 2, and X_{2, 3} = 1, so the sum is 2 + 2 + 1 = 5.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n30\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n136", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02919", "source_text": "Score: 500 points\n\nProblem Statement\n\nGiven is a permutation P of \\{1, 2, \\ldots, N\\}.\n\nFor a pair (L, R) (1 \\le L \\lt R \\le N), let X_{L, R} be the second largest value among P_L, P_{L+1}, \\ldots, P_R.\n\nFind \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le P_i \\le N\n\nP_i \\neq P_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\nP_1 P_2 \\ldots P_N\n\nOutput\n\nPrint \\displaystyle \\sum_{L=1}^{N-1} \\sum_{R=L+1}^{N} X_{L,R}.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n5\n\nX_{1, 2} = 2, X_{1, 3} = 2, and X_{2, 3} = 1, so the sum is 2 + 2 + 1 = 5.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n30\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n136", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 17894, "cpu_time_ms": 288, "memory_kb": 8704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s362476818", "group_id": "codeNet:p02921", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar count int\n\tvar forecast, weather string\n\t\n\tfmt.Scanf(\"%s\",&forecast)\n\tfmt.Scanf(\"%s\",&weather)\n\t\n\tfor i:=0; i < len(forecast); i++ {\n\t\tif forecast[i] == weather[i] {\n\t\t\tcount++\n\t\t}\n\t}\n\t\n\tfmt.Printf(\"%d\",count)\n}", "language": "Go", "metadata": {"date": 1573107794, "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/s362476818.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s362476818", "user_id": "u689167014"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar count int\n\tvar forecast, weather string\n\t\n\tfmt.Scanf(\"%s\",&forecast)\n\tfmt.Scanf(\"%s\",&weather)\n\t\n\tfor i:=0; i < len(forecast); i++ {\n\t\tif forecast[i] == weather[i] {\n\t\t\tcount++\n\t\t}\n\t}\n\t\n\tfmt.Printf(\"%d\",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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 258, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478703484", "group_id": "codeNet:p02921", "input_text": "package main\nimport \"fmt\"\n\nfunc main(){\n var a, b string\n fmt.Scanf( \"%s\", &a )\n fmt.Scanf( \"%s\", &b )\n count := 0\n\n for i, _ := range a{\n if a[ i ] == b[ i ]{\n count ++\n }\n } \n fmt.Printf( \"%d\", count )\n\n}\n", "language": "Go", "metadata": {"date": 1567593225, "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/s478703484.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s478703484", "user_id": "u759489850"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main(){\n var a, b string\n fmt.Scanf( \"%s\", &a )\n fmt.Scanf( \"%s\", &b )\n count := 0\n\n for i, _ := range a{\n if a[ i ] == b[ i ]{\n count ++\n }\n } \n fmt.Printf( \"%d\", count )\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 315, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s116603043", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanf(\"%d %d\", &A, &B)\n\n\ttap := 1 //必要なタップ数.\n\tif A >= B {\n\t\tfmt.Println(tap)\n\t} else {\n\t\ttap += B / A\n\t\tfmt.Println(tap)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598278158, "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/s116603043.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s116603043", "user_id": "u295901950"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanf(\"%d %d\", &A, &B)\n\n\ttap := 1 //必要なタップ数.\n\tif A >= B {\n\t\tfmt.Println(tap)\n\t} else {\n\t\ttap += B / A\n\t\tfmt.Println(tap)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 7, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s467985972", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n \n ans := 1\n c := 1\n for {\n if ans > b {\n \tbreak;\n }\n \n ans --\n ans += a\n c++\n }\n \n fmt.Println(c)\n \n}", "language": "Go", "metadata": {"date": 1588685917, "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/s467985972.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s467985972", "user_id": "u916347059"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n \n ans := 1\n c := 1\n for {\n if ans > b {\n \tbreak;\n }\n \n ans --\n ans += a\n c++\n }\n \n fmt.Println(c)\n \n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 208, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s203842277", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\ta := B / A\n\tif a*A < B {\n\t\ta++\n\t}\n\tfmt.Println(a)\n}\n", "language": "Go", "metadata": {"date": 1572796845, "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/s203842277.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s203842277", "user_id": "u902409225"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\ta := B / A\n\tif a*A < B {\n\t\ta++\n\t}\n\tfmt.Println(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 127, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s609880500", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc run() {\n\ta := nextInt()\n\tb := nextInt()\n\tans := 0\n\tcur := 1\n\tfor cur < b {\n\t\tcur = cur + a - 1\n\t\tans++\n\t}\n\tPrintln(ans)\n}\n\n// --- template ---\n// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\n// Caution: You will get unexpected result if a single token is larger than this size.\nconst BufferSize = 64 * 1024 * 1024\n\nfunc Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(out, a...)\n}\n\nfunc Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(out, format, a...)\n}\n\nfunc Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(out, a...)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0, BufferSize), BufferSize)\n\tsc.Split(bufio.ScanWords)\n\trun()\n\tout.Flush()\n}\n", "language": "Go", "metadata": {"date": 1567613929, "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/s609880500.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s609880500", "user_id": "u181736559"}, "prompt_components": {"gold_output": "3\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 run() {\n\ta := nextInt()\n\tb := nextInt()\n\tans := 0\n\tcur := 1\n\tfor cur < b {\n\t\tcur = cur + a - 1\n\t\tans++\n\t}\n\tPrintln(ans)\n}\n\n// --- template ---\n// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\n// Caution: You will get unexpected result if a single token is larger than this size.\nconst BufferSize = 64 * 1024 * 1024\n\nfunc Print(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprint(out, a...)\n}\n\nfunc Printf(format string, a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintf(out, format, a...)\n}\n\nfunc Println(a ...interface{}) (n int, err error) {\n\treturn fmt.Fprintln(out, a...)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0, BufferSize), BufferSize)\n\tsc.Split(bufio.ScanWords)\n\trun()\n\tout.Flush()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1158, "cpu_time_ms": 3, "memory_kb": 2816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s652045571", "group_id": "codeNet:p02922", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\ti := 1\n\tc := i * a\n\tfor {\n\t\tif c >= b {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t\tc = i*a - (i - 1)\n\t}\n\tfmt.Println(i)\n}\n", "language": "Go", "metadata": {"date": 1567365287, "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/s652045571.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s652045571", "user_id": "u351241495"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\ti := 1\n\tc := i * a\n\tfor {\n\t\tif c >= b {\n\t\t\tbreak\n\t\t}\n\t\ti++\n\t\tc = i*a - (i - 1)\n\t}\n\tfmt.Println(i)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 193, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s227172952", "group_id": "codeNet:p02924", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfmt.Println(n * (n - 1) / 2)\n}\n", "language": "Go", "metadata": {"date": 1567462205, "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/s227172952.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227172952", "user_id": "u367259152"}, "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\tfmt.Println(n * (n - 1) / 2)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 100, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s335411805", "group_id": "codeNet:p02924", "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\tans := (N - 1) * N / 2\n\tfmt.Fprintln(out, ans)\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": 1567368220, "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/s335411805.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s335411805", "user_id": "u445515168"}, "prompt_components": {"gold_output": "1\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\tans := (N - 1) * N / 2\n\tfmt.Fprintln(out, ans)\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 : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2054, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s158555345", "group_id": "codeNet:p02925", "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\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\ttable := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\telems := strings.Split(sc.Text(), \" \")\n\t\ttable[i] = make([]int, N-1)\n\t\tfor j, elem := range elems {\n\t\t\ttable[i][j], _ = strconv.Atoi(elem)\n\t\t\ttable[i][j]--\n\t\t}\n\t}\n\n\tnissuu := 0\n\tsiaisuu := 0\n\n\tmadaaru := make(map[int]bool)\n\tfor i := 0; i < N; i++ {\n\t\tmadaaru[i] = true\n\t}\n\n\tfor siaisuu < N*(N-1)/2 {\n\t\tzoubunn := 0\n\n\t\tyatta := make([]bool, N)\n\n\t\tfor i := range madaaru {\n\t\t\tif yatta[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif len(table[i]) == 0 {\n\t\t\t\tdelete(madaaru, i)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\taite := table[i][0]\n\t\t\tif len(table[aite]) == 0 {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif yatta[aite] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif table[aite][0] != i {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsiaisuu++\n\t\t\tzoubunn++\n\t\t\ttable[i] = table[i][1:]\n\t\t\ttable[aite] = table[aite][1:]\n\t\t\tyatta[i] = true\n\t\t\tyatta[aite] = true\n\t\t}\n\t\tif zoubunn == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tnissuu++\n\t}\n\n\tfmt.Println(nissuu)\n}\n", "language": "Go", "metadata": {"date": 1567367903, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02925.html", "problem_id": "p02925", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02925/input.txt", "sample_output_relpath": "derived/input_output/data/p02925/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02925/Go/s158555345.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s158555345", "user_id": "u328099989"}, "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 main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\ttable := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\telems := strings.Split(sc.Text(), \" \")\n\t\ttable[i] = make([]int, N-1)\n\t\tfor j, elem := range elems {\n\t\t\ttable[i][j], _ = strconv.Atoi(elem)\n\t\t\ttable[i][j]--\n\t\t}\n\t}\n\n\tnissuu := 0\n\tsiaisuu := 0\n\n\tmadaaru := make(map[int]bool)\n\tfor i := 0; i < N; i++ {\n\t\tmadaaru[i] = true\n\t}\n\n\tfor siaisuu < N*(N-1)/2 {\n\t\tzoubunn := 0\n\n\t\tyatta := make([]bool, N)\n\n\t\tfor i := range madaaru {\n\t\t\tif yatta[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif len(table[i]) == 0 {\n\t\t\t\tdelete(madaaru, i)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\taite := table[i][0]\n\t\t\tif len(table[aite]) == 0 {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif yatta[aite] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif table[aite][0] != i {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsiaisuu++\n\t\t\tzoubunn++\n\t\t\ttable[i] = table[i][1:]\n\t\t\ttable[aite] = table[aite][1:]\n\t\t\tyatta[i] = true\n\t\t\tyatta[aite] = true\n\t\t}\n\t\tif zoubunn == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tnissuu++\n\t}\n\n\tfmt.Println(nissuu)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nN players will participate in a tennis tournament. We will call them Player 1, Player 2, \\ldots, Player N.\n\nThe tournament is round-robin format, and there will be N(N-1)/2 matches in total.\nIs it possible to schedule these matches so that all of the following conditions are satisfied? If the answer is yes, also find the minimum number of days required.\n\nEach player plays at most one matches in a day.\n\nEach player i (1 \\leq i \\leq N) plays one match against Player A_{i, 1}, A_{i, 2}, \\ldots, A_{i, N-1} in this order.\n\nConstraints\n\n3 \\leq N \\leq 1000\n\n1 \\leq A_{i, j} \\leq N\n\nA_{i, j} \\neq i\n\nA_{i, 1}, A_{i, 2}, \\ldots, A_{i, N-1} are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} \\ldots A_{1, N-1}\nA_{2, 1} A_{2, 2} \\ldots A_{2, N-1}\n:\nA_{N, 1} A_{N, 2} \\ldots A_{N, N-1}\n\nOutput\n\nIf it is possible to schedule all the matches so that all of the conditions are satisfied, print the minimum number of days required; if it is impossible, print -1.\n\nSample Input 1\n\n3\n2 3\n1 3\n1 2\n\nSample Output 1\n\n3\n\nAll the conditions can be satisfied if the matches are scheduled for three days as follows:\n\nDay 1: Player 1 vs Player 2\n\nDay 2: Player 1 vs Player 3\n\nDay 3: Player 2 vs Player 3\n\nThis is the minimum number of days required.\n\nSample Input 2\n\n4\n2 3 4\n1 3 4\n4 1 2\n3 1 2\n\nSample Output 2\n\n4\n\nAll the conditions can be satisfied if the matches are scheduled for four days as follows:\n\nDay 1: Player 1 vs Player 2, Player 3 vs Player 4\n\nDay 2: Player 1 vs Player 3\n\nDay 3: Player 1 vs Player 4, Player 2 vs Player 3\n\nDay 4: Player 2 vs Player 4\n\nThis is the minimum number of days required.\n\nSample Input 3\n\n3\n2 3\n3 1\n1 2\n\nSample Output 3\n\n-1\n\nAny scheduling of the matches violates some condition.", "sample_input": "3\n2 3\n1 3\n1 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02925", "source_text": "Score : 500 points\n\nProblem Statement\n\nN players will participate in a tennis tournament. We will call them Player 1, Player 2, \\ldots, Player N.\n\nThe tournament is round-robin format, and there will be N(N-1)/2 matches in total.\nIs it possible to schedule these matches so that all of the following conditions are satisfied? If the answer is yes, also find the minimum number of days required.\n\nEach player plays at most one matches in a day.\n\nEach player i (1 \\leq i \\leq N) plays one match against Player A_{i, 1}, A_{i, 2}, \\ldots, A_{i, N-1} in this order.\n\nConstraints\n\n3 \\leq N \\leq 1000\n\n1 \\leq A_{i, j} \\leq N\n\nA_{i, j} \\neq i\n\nA_{i, 1}, A_{i, 2}, \\ldots, A_{i, N-1} are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1, 1} A_{1, 2} \\ldots A_{1, N-1}\nA_{2, 1} A_{2, 2} \\ldots A_{2, N-1}\n:\nA_{N, 1} A_{N, 2} \\ldots A_{N, N-1}\n\nOutput\n\nIf it is possible to schedule all the matches so that all of the conditions are satisfied, print the minimum number of days required; if it is impossible, print -1.\n\nSample Input 1\n\n3\n2 3\n1 3\n1 2\n\nSample Output 1\n\n3\n\nAll the conditions can be satisfied if the matches are scheduled for three days as follows:\n\nDay 1: Player 1 vs Player 2\n\nDay 2: Player 1 vs Player 3\n\nDay 3: Player 2 vs Player 3\n\nThis is the minimum number of days required.\n\nSample Input 2\n\n4\n2 3 4\n1 3 4\n4 1 2\n3 1 2\n\nSample Output 2\n\n4\n\nAll the conditions can be satisfied if the matches are scheduled for four days as follows:\n\nDay 1: Player 1 vs Player 2, Player 3 vs Player 4\n\nDay 2: Player 1 vs Player 3\n\nDay 3: Player 1 vs Player 4, Player 2 vs Player 3\n\nDay 4: Player 2 vs Player 4\n\nThis is the minimum number of days required.\n\nSample Input 3\n\n3\n2 3\n3 1\n1 2\n\nSample Output 3\n\n-1\n\nAny scheduling of the matches violates some condition.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1104, "cpu_time_ms": 2104, "memory_kb": 17280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s852345664", "group_id": "codeNet:p02926", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\n \"sort\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxFloat(x, y float64) float64 {\n if x < y { return y }\n return x\n}\nfunc Dist02(A *[]float64) float64 {\n x, y := (*A)[0], (*A)[1]\n return x * x + y * y\n}\nfunc InnerProduct(A, B *[]float64) float64 {\n return (*A)[0] * (*B)[0] + (*A)[1] * (*B)[1]\n}\nfunc Angle(A, B *[]float64) float64 {\n acos := math.Acos(InnerProduct(A, B) / math.Sqrt(Dist02(A)) / math.Sqrt(Dist02(B)))\n return acos / math.Pi * 180.0\n}\n\ntype Engines [][]float64\nfunc (E Engines) Len() int { return len(E) }\nfunc (E Engines) Less(i, j int) bool { return E[i][2] < E[j][2] }\nfunc (E Engines) Swap(i, j int) { E[i], E[j] = E[j], E[i] }\n\nfunc main() {\n N := NextInt()\n E := make([][]float64, 0)\n X := []float64{1.0, 0.0}\n for i := 0; i < N; i++ {\n XY := NextFloatVec()\n if XY[0] != 0.0 || XY[1] != 0.0 {\n angle := Angle(&X, &XY)\n if XY[1] < 0 { angle = 360.0 - angle }\n XY = append(XY, angle)\n E = append(E, XY)\n E = append(E, []float64{0.0, 0.0, angle - 180.0})\n E = append(E, []float64{XY[0], XY[1], angle + 360.0})\n E = append(E, []float64{0.0, 0.0, angle + 540.0})\n }\n }\n sort.Sort(Engines(E))\n ans := 0.0\n t := 0\n D := []float64{0.0, 0.0}\n for _, e := range E {\n if 360.0 <= e[2] { break }\n for E[t][2] - e[2] <= 180.0 {\n D[0] += E[t][0]\n D[1] += E[t][1]\n t++\n }\n ans = MaxFloat(math.Sqrt(Dist02(&D)), ans)\n D[0] -= e[0]\n D[1] -= e[1]\n }\n Write(ans)\n Output()\n}", "language": "Go", "metadata": {"date": 1578367748, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02926.html", "problem_id": "p02926", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02926/input.txt", "sample_output_relpath": "derived/input_output/data/p02926/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02926/Go/s852345664.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s852345664", "user_id": "u415905784"}, "prompt_components": {"gold_output": "10.000000000000000000000000000000000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\n \"sort\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxFloat(x, y float64) float64 {\n if x < y { return y }\n return x\n}\nfunc Dist02(A *[]float64) float64 {\n x, y := (*A)[0], (*A)[1]\n return x * x + y * y\n}\nfunc InnerProduct(A, B *[]float64) float64 {\n return (*A)[0] * (*B)[0] + (*A)[1] * (*B)[1]\n}\nfunc Angle(A, B *[]float64) float64 {\n acos := math.Acos(InnerProduct(A, B) / math.Sqrt(Dist02(A)) / math.Sqrt(Dist02(B)))\n return acos / math.Pi * 180.0\n}\n\ntype Engines [][]float64\nfunc (E Engines) Len() int { return len(E) }\nfunc (E Engines) Less(i, j int) bool { return E[i][2] < E[j][2] }\nfunc (E Engines) Swap(i, j int) { E[i], E[j] = E[j], E[i] }\n\nfunc main() {\n N := NextInt()\n E := make([][]float64, 0)\n X := []float64{1.0, 0.0}\n for i := 0; i < N; i++ {\n XY := NextFloatVec()\n if XY[0] != 0.0 || XY[1] != 0.0 {\n angle := Angle(&X, &XY)\n if XY[1] < 0 { angle = 360.0 - angle }\n XY = append(XY, angle)\n E = append(E, XY)\n E = append(E, []float64{0.0, 0.0, angle - 180.0})\n E = append(E, []float64{XY[0], XY[1], angle + 360.0})\n E = append(E, []float64{0.0, 0.0, angle + 540.0})\n }\n }\n sort.Sort(Engines(E))\n ans := 0.0\n t := 0\n D := []float64{0.0, 0.0}\n for _, e := range E {\n if 360.0 <= e[2] { break }\n for E[t][2] - e[2] <= 180.0 {\n D[0] += E[t][0]\n D[1] += E[t][1]\n t++\n }\n ans = MaxFloat(math.Sqrt(Dist02(&D)), ans)\n D[0] -= e[0]\n D[1] -= e[1]\n }\n Write(ans)\n Output()\n}", "problem_context": "Score: 600 points\n\nProblem Statement\n\nE869120 is initially standing at the origin (0, 0) in a two-dimensional plane.\n\nHe has N engines, which can be used as follows:\n\nWhen E869120 uses the i-th engine, his X- and Y-coordinate change by x_i and y_i, respectively. In other words, if E869120 uses the i-th engine from coordinates (X, Y), he will move to the coordinates (X + x_i, Y + y_i).\n\nE869120 can use these engines in any order, but each engine can be used at most once. He may also choose not to use some of the engines.\n\nHe wants to go as far as possible from the origin.\nLet (X, Y) be his final coordinates. Find the maximum possible value of \\sqrt{X^2 + Y^2}, the distance from the origin.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n-1 \\ 000 \\ 000 \\leq x_i \\leq 1 \\ 000 \\ 000\n\n-1 \\ 000 \\ 000 \\leq y_i \\leq 1 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n: :\nx_N y_N\n\nOutput\n\nPrint the maximum possible final distance from the origin, as a real value.\nYour output is considered correct when the relative or absolute error from the true answer is at most 10^{-10}.\n\nSample Input 1\n\n3\n0 10\n5 -5\n-5 -5\n\nSample Output 1\n\n10.000000000000000000000000000000000000000000000000\n\nThe final distance from the origin can be 10 if we use the engines in one of the following three ways:\n\nUse Engine 1 to move to (0, 10).\n\nUse Engine 2 to move to (5, -5), and then use Engine 3 to move to (0, -10).\n\nUse Engine 3 to move to (-5, -5), and then use Engine 2 to move to (0, -10).\n\nThe distance cannot be greater than 10, so the maximum possible distance is 10.\n\nSample Input 2\n\n5\n1 1\n1 0\n0 1\n-1 0\n0 -1\n\nSample Output 2\n\n2.828427124746190097603377448419396157139343750753\n\nThe maximum possible final distance is 2 \\sqrt{2} = 2.82842....\nOne of the ways to achieve it is:\n\nUse Engine 1 to move to (1, 1), and then use Engine 2 to move to (2, 1), and finally use Engine 3 to move to (2, 2).\n\nSample Input 3\n\n5\n1 1\n2 2\n3 3\n4 4\n5 5\n\nSample Output 3\n\n21.213203435596425732025330863145471178545078130654\n\nIf we use all the engines in the order 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 \\rightarrow 5, we will end up at (15, 15), with the distance 15 \\sqrt{2} = 21.2132... from the origin.\n\nSample Input 4\n\n3\n0 0\n0 1\n1 0\n\nSample Output 4\n\n1.414213562373095048801688724209698078569671875376\n\nThere can be useless engines with (x_i, y_i) = (0, 0).\n\nSample Input 5\n\n1\n90447 91000\n\nSample Output 5\n\n128303.000000000000000000000000000000000000000000000000\n\nNote that there can be only one engine.\n\nSample Input 6\n\n2\n96000 -72000\n-72000 54000\n\nSample Output 6\n\n120000.000000000000000000000000000000000000000000000000\n\nThere can be only two engines, too.\n\nSample Input 7\n\n10\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20\n\nSample Output 7\n\n148.660687473185055226120082139313966514489855137208", "sample_input": "3\n0 10\n5 -5\n-5 -5\n"}, "reference_outputs": ["10.000000000000000000000000000000000000000000000000\n"], "source_document_id": "p02926", "source_text": "Score: 600 points\n\nProblem Statement\n\nE869120 is initially standing at the origin (0, 0) in a two-dimensional plane.\n\nHe has N engines, which can be used as follows:\n\nWhen E869120 uses the i-th engine, his X- and Y-coordinate change by x_i and y_i, respectively. In other words, if E869120 uses the i-th engine from coordinates (X, Y), he will move to the coordinates (X + x_i, Y + y_i).\n\nE869120 can use these engines in any order, but each engine can be used at most once. He may also choose not to use some of the engines.\n\nHe wants to go as far as possible from the origin.\nLet (X, Y) be his final coordinates. Find the maximum possible value of \\sqrt{X^2 + Y^2}, the distance from the origin.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n-1 \\ 000 \\ 000 \\leq x_i \\leq 1 \\ 000 \\ 000\n\n-1 \\ 000 \\ 000 \\leq y_i \\leq 1 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n: :\nx_N y_N\n\nOutput\n\nPrint the maximum possible final distance from the origin, as a real value.\nYour output is considered correct when the relative or absolute error from the true answer is at most 10^{-10}.\n\nSample Input 1\n\n3\n0 10\n5 -5\n-5 -5\n\nSample Output 1\n\n10.000000000000000000000000000000000000000000000000\n\nThe final distance from the origin can be 10 if we use the engines in one of the following three ways:\n\nUse Engine 1 to move to (0, 10).\n\nUse Engine 2 to move to (5, -5), and then use Engine 3 to move to (0, -10).\n\nUse Engine 3 to move to (-5, -5), and then use Engine 2 to move to (0, -10).\n\nThe distance cannot be greater than 10, so the maximum possible distance is 10.\n\nSample Input 2\n\n5\n1 1\n1 0\n0 1\n-1 0\n0 -1\n\nSample Output 2\n\n2.828427124746190097603377448419396157139343750753\n\nThe maximum possible final distance is 2 \\sqrt{2} = 2.82842....\nOne of the ways to achieve it is:\n\nUse Engine 1 to move to (1, 1), and then use Engine 2 to move to (2, 1), and finally use Engine 3 to move to (2, 2).\n\nSample Input 3\n\n5\n1 1\n2 2\n3 3\n4 4\n5 5\n\nSample Output 3\n\n21.213203435596425732025330863145471178545078130654\n\nIf we use all the engines in the order 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 \\rightarrow 5, we will end up at (15, 15), with the distance 15 \\sqrt{2} = 21.2132... from the origin.\n\nSample Input 4\n\n3\n0 0\n0 1\n1 0\n\nSample Output 4\n\n1.414213562373095048801688724209698078569671875376\n\nThere can be useless engines with (x_i, y_i) = (0, 0).\n\nSample Input 5\n\n1\n90447 91000\n\nSample Output 5\n\n128303.000000000000000000000000000000000000000000000000\n\nNote that there can be only one engine.\n\nSample Input 6\n\n2\n96000 -72000\n-72000 54000\n\nSample Output 6\n\n120000.000000000000000000000000000000000000000000000000\n\nThere can be only two engines, too.\n\nSample Input 7\n\n10\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20\n\nSample Output 7\n\n148.660687473185055226120082139313966514489855137208", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2201, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s413759858", "group_id": "codeNet:p02927", "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 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 = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tm, d := nextInt(), nextInt()\n\n\tans := 0\n\tfor mth := 1; mth <= m; mth++ {\n\t\tfor div := 2; div <= 9; div++ {\n\t\t\tif mth/div < 10 && mth/div > 1 && mth%div == 0 {\n\t\t\t\tif (mth/div)*10+div <= d {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t\tif div*10+(mth/div) <= d {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\n}\n", "language": "Go", "metadata": {"date": 1566830454, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02927.html", "problem_id": "p02927", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02927/input.txt", "sample_output_relpath": "derived/input_output/data/p02927/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02927/Go/s413759858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s413759858", "user_id": "u712822150"}, "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.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\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tm, d := nextInt(), nextInt()\n\n\tans := 0\n\tfor mth := 1; mth <= m; mth++ {\n\t\tfor div := 2; div <= 9; div++ {\n\t\t\tif mth/div < 10 && mth/div > 1 && mth%div == 0 {\n\t\t\t\tif (mth/div)*10+div <= d {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t\tif div*10+(mth/div) <= d {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nToday is August 24, one of the five Product Days in a year.\n\nA date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):\n\nd_1 \\geq 2\n\nd_{10} \\geq 2\n\nd_1 \\times d_{10} = m\n\nTakahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.\n\nIn Takahashi Calendar, how many Product Days does a year have?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq M \\leq 100\n\n1 \\leq D \\leq 99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM D\n\nOutput\n\nPrint the number of Product Days in a year in Takahashi Calender.\n\nSample Input 1\n\n15 40\n\nSample Output 1\n\n10\n\nThere are 10 Product Days in a year, as follows (m-d denotes Month m, Day d):\n\n4-22\n\n6-23\n\n6-32\n\n8-24\n\n9-33\n\n10-25\n\n12-26\n\n12-34\n\n14-27\n\n15-35\n\nSample Input 2\n\n12 31\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "sample_input": "15 40\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02927", "source_text": "Score : 200 points\n\nProblem Statement\n\nToday is August 24, one of the five Product Days in a year.\n\nA date m-d (m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):\n\nd_1 \\geq 2\n\nd_{10} \\geq 2\n\nd_1 \\times d_{10} = m\n\nTakahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M, and each month consists of D days from Day 1 to Day D.\n\nIn Takahashi Calendar, how many Product Days does a year have?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq M \\leq 100\n\n1 \\leq D \\leq 99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nM D\n\nOutput\n\nPrint the number of Product Days in a year in Takahashi Calender.\n\nSample Input 1\n\n15 40\n\nSample Output 1\n\n10\n\nThere are 10 Product Days in a year, as follows (m-d denotes Month m, Day d):\n\n4-22\n\n6-23\n\n6-32\n\n8-24\n\n9-33\n\n10-25\n\n12-26\n\n12-34\n\n14-27\n\n15-35\n\nSample Input 2\n\n12 31\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 555, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493366900", "group_id": "codeNet:p02928", "input_text": "// https://atcoder.jp/contests/jsc2019-qual/tasks/jsc2019_qual_b\n\npackage main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tN := nextInt()\n\tK := nextInt()\n\tA := make([]int, N)\n\n\tfor i := range A {\n\t\tA[i] = nextInt()\n\t}\n\n\tw := 0\n\th := 0\n\tfor i := range A {\n\t\tfor j := range A {\n\t\t\tif A[i] > A[j] {\n\t\t\t\tw++\n\t\t\t\tif i < j {\n\t\t\t\t\th++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tD := 1000000000 + 7\n\tans := (K*h%D + ((K-1)*K/2%D)*w) % D\n\tfmt.Println(ans)\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": 1566702267, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02928.html", "problem_id": "p02928", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02928/input.txt", "sample_output_relpath": "derived/input_output/data/p02928/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02928/Go/s493366900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s493366900", "user_id": "u764320774"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// https://atcoder.jp/contests/jsc2019-qual/tasks/jsc2019_qual_b\n\npackage main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tN := nextInt()\n\tK := nextInt()\n\tA := make([]int, N)\n\n\tfor i := range A {\n\t\tA[i] = nextInt()\n\t}\n\n\tw := 0\n\th := 0\n\tfor i := range A {\n\t\tfor j := range A {\n\t\t\tif A[i] > A[j] {\n\t\t\t\tw++\n\t\t\t\tif i < j {\n\t\t\t\t\th++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tD := 1000000000 + 7\n\tans := (K*h%D + ((K-1)*K/2%D)*w) % D\n\tfmt.Println(ans)\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\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "sample_input": "2 2\n2 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02928", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 909, "cpu_time_ms": 16, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s333362287", "group_id": "codeNet:p02928", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K, a, out int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tA[i] = a\n\t}\n\tout = 0\n\tvar h, r int // A内の転倒数, A内で自分より小さい値の個数\n\t// 成分番号ごとにカウントする\n\tfor i := 0; i < N; i++ {\n\t\t// h,rを計算\n\t\th = 0\n\t\tr = 0\n\t\tfor ii := 0; ii < N; ii++ {\n\t\t\tif A[ii] < A[i] {\n\t\t\t\th++\n\t\t\t\tif ii > i {\n\t\t\t\t\tr++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//fmt.Printf(\"h:%d\\n\", h)\n\t\t//fmt.Printf(\"r:%d\\n\", r)\n\t\tout += h*K + r*(K-1)*K/2\n\t\t//fmt.Printf(\"h:%d\\n\", h)\n\t\t//fmt.Printf(\"r%d\\n\", r)\n\t\t//fmt.Printf(\"K%d\\n\", K)\n\t\t//fmt.Printf(\"out:%d\\n\", out)\n\t}\n\t//fmt.Println(A)\n\t// fmt.Printf(\"out:%d\\n\", out)\n\tfmt.Println(out % (1000000000 + 7))\n}\n", "language": "Go", "metadata": {"date": 1566700692, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02928.html", "problem_id": "p02928", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02928/input.txt", "sample_output_relpath": "derived/input_output/data/p02928/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02928/Go/s333362287.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s333362287", "user_id": "u474502175"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K, a, out int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tA[i] = a\n\t}\n\tout = 0\n\tvar h, r int // A内の転倒数, A内で自分より小さい値の個数\n\t// 成分番号ごとにカウントする\n\tfor i := 0; i < N; i++ {\n\t\t// h,rを計算\n\t\th = 0\n\t\tr = 0\n\t\tfor ii := 0; ii < N; ii++ {\n\t\t\tif A[ii] < A[i] {\n\t\t\t\th++\n\t\t\t\tif ii > i {\n\t\t\t\t\tr++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//fmt.Printf(\"h:%d\\n\", h)\n\t\t//fmt.Printf(\"r:%d\\n\", r)\n\t\tout += h*K + r*(K-1)*K/2\n\t\t//fmt.Printf(\"h:%d\\n\", h)\n\t\t//fmt.Printf(\"r%d\\n\", r)\n\t\t//fmt.Printf(\"K%d\\n\", K)\n\t\t//fmt.Printf(\"out:%d\\n\", out)\n\t}\n\t//fmt.Println(A)\n\t// fmt.Printf(\"out:%d\\n\", out)\n\tfmt.Println(out % (1000000000 + 7))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "sample_input": "2 2\n2 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02928", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a sequence of N integers A~=~A_0,~A_1,~...,~A_{N - 1}.\n\nLet B be a sequence of K \\times N integers obtained by concatenating K copies of A. For example, if A~=~1,~3,~2 and K~=~2, B~=~1,~3,~2,~1,~3,~2.\n\nFind the inversion number of B, modulo 10^9 + 7.\n\nHere the inversion number of B is defined as the number of ordered pairs of integers (i,~j)~(0 \\leq i < j \\leq K \\times N - 1) such that B_i > B_j.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i \\leq 2000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_0 A_1 ... A_{N - 1}\n\nOutput\n\nPrint the inversion number of B, modulo 10^9 + 7.\n\nSample Input 1\n\n2 2\n2 1\n\nSample Output 1\n\n3\n\nIn this case, B~=~2,~1,~2,~1. We have:\n\nB_0 > B_1\n\nB_0 > B_3\n\nB_2 > B_3\n\nThus, the inversion number of B is 3.\n\nSample Input 2\n\n3 5\n1 1 1\n\nSample Output 2\n\n0\n\nA may contain multiple occurrences of the same number.\n\nSample Input 3\n\n10 998244353\n10 9 8 7 5 6 3 4 2 1\n\nSample Output 3\n\n185297239\n\nBe sure to print the output modulo 10^9 + 7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 752, "cpu_time_ms": 24, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s713641036", "group_id": "codeNet:p02934", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar ans float64\n\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\n\t\tans += 1.0 / float64(a)\n\t}\n\n\tfmt.Printf(\"%f\\n\", 1.0/ans)\n\n}\n", "language": "Go", "metadata": {"date": 1567323955, "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/s713641036.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s713641036", "user_id": "u161067211"}, "prompt_components": {"gold_output": "7.5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar ans float64\n\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\n\t\tans += 1.0 / float64(a)\n\t}\n\n\tfmt.Printf(\"%f\\n\", 1.0/ans)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s470443961", "group_id": "codeNet:p02934", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a int\n\tvar st string\n\tfmt.Scan(&a)\n\tfmt.Scan(&st)\n\tsts := strings.Split(st, \" \")\n\tvar total float64\n\tfor i := 0; i < a; i++ {\n\t\tv := sts[i]\n\t\tn, _ := strconv. ParseFloat(v, 64)\n\t\tvar x float64\n\t\tx = 1 / n\n\t\ttotal = total + x\n\t}\n\t\n\tvar ans float64\n\tans = 1 / total\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1566960833, "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/s470443961.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s470443961", "user_id": "u506898932"}, "prompt_components": {"gold_output": "7.5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar a int\n\tvar st string\n\tfmt.Scan(&a)\n\tfmt.Scan(&st)\n\tsts := strings.Split(st, \" \")\n\tvar total float64\n\tfor i := 0; i < a; i++ {\n\t\tv := sts[i]\n\t\tn, _ := strconv. ParseFloat(v, 64)\n\t\tvar x float64\n\t\tx = 1 / n\n\t\ttotal = total + x\n\t}\n\t\n\tvar ans float64\n\tans = 1 / total\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 358, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s656522837", "group_id": "codeNet:p02937", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n sc.Scan()\n return sc.Text()\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": 1567736855, "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/s656522837.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s656522837", "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 sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n sc.Scan()\n return sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s601629022", "group_id": "codeNet:p02939", "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\tans := int64(0)\n\tp := \"\"\n\tfor i := 0; i < len(S); i++ {\n\t\tif p != string(S[i]) {\n\t\t\tans++\n\t\t\tp = string(S[i])\n\t\t} else {\n\t\t\tif i+1 < len(S) {\n\t\t\t\tans++\n\t\t\t\ti++\n\t\t\t\tp = string(S[i : i+2])\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": 1589275132, "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/s601629022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s601629022", "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\tS := readString()\n\tans := int64(0)\n\tp := \"\"\n\tfor i := 0; i < len(S); i++ {\n\t\tif p != string(S[i]) {\n\t\t\tans++\n\t\t\tp = string(S[i])\n\t\t} else {\n\t\t\tif i+1 < len(S) {\n\t\t\t\tans++\n\t\t\t\ti++\n\t\t\t\tp = string(S[i : i+2])\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 : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "sample_input": "aabbaa\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02939", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5800, "cpu_time_ms": 19, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s445351778", "group_id": "codeNet:p02941", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar H int\nvar A []*pair\n\ntype pair struct {\n\tindex int\n\tvalue int\n}\n\nfunc maxHeapify(i int) {\n\tl := 2 * i\n\tr := 2*i + 1\n\tvar largest int\n\tif l <= H && A[l].value > A[i].value {\n\t\tlargest = l\n\t} else {\n\t\tlargest = i\n\t}\n\tif r <= H && A[r].value > A[largest].value {\n\t\tlargest = r\n\t}\n\tif largest != i {\n\t\tA[i], A[largest] = A[largest], A[i]\n\t\tmaxHeapify(largest)\n\t}\n}\n\nfunc extract() *pair {\n\tvar maxv *pair\n\t// if H < 1 {\n\t// \treturn &pair{\n\t// \t\tindex: -1,\n\t// \t\tvalue: -9999999999999,\n\t// \t}\n\t// }\n\tmaxv = A[1]\n\tA[1] = A[H]\n\tH--\n\tmaxHeapify(1)\n\treturn maxv\n}\n\nfunc increaseKey(i int, key *pair) {\n\tif key.value < A[i].value {\n\t\treturn\n\t}\n\tA[i] = key\n\tfor i > 1 && A[i/2].value < A[i].value {\n\t\tA[i], A[i/2] = A[i/2], A[i]\n\t\ti /= 2\n\t}\n}\n\nfunc insert(key *pair) {\n\tH++\n\tA[H] = &pair{\n\t\tindex: -1,\n\t\tvalue: 0,\n\t}\n\tincreaseKey(H, key)\n}\n\n// 1万回以上scanするならこっち(10万回で600msとかだった)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc rs() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc ri() int {\n\ts := rs()\n\ta, _ := strconv.Atoi(s)\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\tA = make([]*pair, n+10)\n\tar := make([]int, n)\n\tfor i := range ar {\n\t\tar[i] = ri()\n\t}\n\tbr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tbr[i] = ri()\n\t\tinsert(&pair{\n\t\t\tindex: i,\n\t\t\tvalue: br[i],\n\t\t})\n\t}\n\tsum := 0\n\tfor H > 0 {\n\t\tp := extract()\n\t\tif ar[p.index] == p.value {\n\t\t\tcontinue\n\t\t}\n\t\tleft := p.index - 1\n\t\tright := p.index + 1\n\t\tif left < 0 {\n\t\t\tleft = n - 1\n\t\t}\n\t\tif right == n {\n\t\t\tright = 0\n\t\t}\n\t\tse := extract()\n\t\tsecond := se.value\n\t\tinsert(se)\n\t\tmv := second\n\t\tif mm := (p.value - mv) / (br[left] + br[right]); mm >= 100 {\n\t\t\tvalue := p.value - (br[left]-br[right])*(mm-10)\n\n\t\t\tif value < ar[p.index] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsum += mm - 10\n\t\t\tp.value = value\n\t\t\tinsert(p)\n\t\t\tbr[p.index] = value\n\t\t} else {\n\t\t\tvalue := p.value - br[left] - br[right]\n\n\t\t\tif value < ar[p.index] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsum++\n\t\t\tp.value = value\n\t\t\tinsert(p)\n\t\t\tbr[p.index] = value\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1566098732, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02941.html", "problem_id": "p02941", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02941/input.txt", "sample_output_relpath": "derived/input_output/data/p02941/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02941/Go/s445351778.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s445351778", "user_id": "u375977529"}, "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 H int\nvar A []*pair\n\ntype pair struct {\n\tindex int\n\tvalue int\n}\n\nfunc maxHeapify(i int) {\n\tl := 2 * i\n\tr := 2*i + 1\n\tvar largest int\n\tif l <= H && A[l].value > A[i].value {\n\t\tlargest = l\n\t} else {\n\t\tlargest = i\n\t}\n\tif r <= H && A[r].value > A[largest].value {\n\t\tlargest = r\n\t}\n\tif largest != i {\n\t\tA[i], A[largest] = A[largest], A[i]\n\t\tmaxHeapify(largest)\n\t}\n}\n\nfunc extract() *pair {\n\tvar maxv *pair\n\t// if H < 1 {\n\t// \treturn &pair{\n\t// \t\tindex: -1,\n\t// \t\tvalue: -9999999999999,\n\t// \t}\n\t// }\n\tmaxv = A[1]\n\tA[1] = A[H]\n\tH--\n\tmaxHeapify(1)\n\treturn maxv\n}\n\nfunc increaseKey(i int, key *pair) {\n\tif key.value < A[i].value {\n\t\treturn\n\t}\n\tA[i] = key\n\tfor i > 1 && A[i/2].value < A[i].value {\n\t\tA[i], A[i/2] = A[i/2], A[i]\n\t\ti /= 2\n\t}\n}\n\nfunc insert(key *pair) {\n\tH++\n\tA[H] = &pair{\n\t\tindex: -1,\n\t\tvalue: 0,\n\t}\n\tincreaseKey(H, key)\n}\n\n// 1万回以上scanするならこっち(10万回で600msとかだった)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc rs() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc ri() int {\n\ts := rs()\n\ta, _ := strconv.Atoi(s)\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\tA = make([]*pair, n+10)\n\tar := make([]int, n)\n\tfor i := range ar {\n\t\tar[i] = ri()\n\t}\n\tbr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tbr[i] = ri()\n\t\tinsert(&pair{\n\t\t\tindex: i,\n\t\t\tvalue: br[i],\n\t\t})\n\t}\n\tsum := 0\n\tfor H > 0 {\n\t\tp := extract()\n\t\tif ar[p.index] == p.value {\n\t\t\tcontinue\n\t\t}\n\t\tleft := p.index - 1\n\t\tright := p.index + 1\n\t\tif left < 0 {\n\t\t\tleft = n - 1\n\t\t}\n\t\tif right == n {\n\t\t\tright = 0\n\t\t}\n\t\tse := extract()\n\t\tsecond := se.value\n\t\tinsert(se)\n\t\tmv := second\n\t\tif mm := (p.value - mv) / (br[left] + br[right]); mm >= 100 {\n\t\t\tvalue := p.value - (br[left]-br[right])*(mm-10)\n\n\t\t\tif value < ar[p.index] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsum += mm - 10\n\t\t\tp.value = value\n\t\t\tinsert(p)\n\t\t\tbr[p.index] = value\n\t\t} else {\n\t\t\tvalue := p.value - br[left] - br[right]\n\n\t\t\tif value < ar[p.index] {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsum++\n\t\t\tp.value = value\n\t\t\tinsert(p)\n\t\t\tbr[p.index] = value\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nThere are N positive integers arranged in a circle.\n\nNow, the i-th number is A_i. Takahashi wants the i-th number to be B_i. For this objective, he will repeatedly perform the following operation:\n\nChoose an integer i such that 1 \\leq i \\leq N.\n\nLet a, b, c be the (i-1)-th, i-th, and (i+1)-th numbers, respectively. Replace the i-th number with a+b+c.\n\nHere the 0-th number is the N-th number, and the (N+1)-th number is the 1-st number.\n\nDetermine if Takahashi can achieve his objective.\nIf the answer is yes, find the minimum number of operations required.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, 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 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the minimum number of operations required, or -1 if the objective cannot be achieved.\n\nSample Input 1\n\n3\n1 1 1\n13 5 7\n\nSample Output 1\n\n4\n\nTakahashi can achieve his objective by, for example, performing the following operations:\n\nReplace the second number with 3.\n\nReplace the second number with 5.\n\nReplace the third number with 7.\n\nReplace the first number with 13.\n\nSample Input 2\n\n4\n1 2 3 4\n2 3 4 5\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n5\n5 6 5 2 1\n9817 1108 6890 4343 8704\n\nSample Output 3\n\n25", "sample_input": "3\n1 1 1\n13 5 7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02941", "source_text": "Score : 800 points\n\nProblem Statement\n\nThere are N positive integers arranged in a circle.\n\nNow, the i-th number is A_i. Takahashi wants the i-th number to be B_i. For this objective, he will repeatedly perform the following operation:\n\nChoose an integer i such that 1 \\leq i \\leq N.\n\nLet a, b, c be the (i-1)-th, i-th, and (i+1)-th numbers, respectively. Replace the i-th number with a+b+c.\n\nHere the 0-th number is the N-th number, and the (N+1)-th number is the 1-st number.\n\nDetermine if Takahashi can achieve his objective.\nIf the answer is yes, find the minimum number of operations required.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, 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 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the minimum number of operations required, or -1 if the objective cannot be achieved.\n\nSample Input 1\n\n3\n1 1 1\n13 5 7\n\nSample Output 1\n\n4\n\nTakahashi can achieve his objective by, for example, performing the following operations:\n\nReplace the second number with 3.\n\nReplace the second number with 5.\n\nReplace the third number with 7.\n\nReplace the first number with 13.\n\nSample Input 2\n\n4\n1 2 3 4\n2 3 4 5\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n5\n5 6 5 2 1\n9817 1108 6890 4343 8704\n\nSample Output 3\n\n25", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2108, "cpu_time_ms": 2107, "memory_kb": 16896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s702421568", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n \n if a + b > a - b {\n if a + b > a * b {\n fmt.Println(a + b)\n } else {\n fmt.Println(a * b)\n }\n } else {\n if a - b > a * b {\n fmt.Println(a - b)\n } else {\n fmt.Println(a * b)\n }\n }\n}", "language": "Go", "metadata": {"date": 1570068408, "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/s702421568.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s702421568", "user_id": "u195309147"}, "prompt_components": {"gold_output": "-10\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 a + b > a - b {\n if a + b > a * b {\n fmt.Println(a + b)\n } else {\n fmt.Println(a * b)\n }\n } else {\n if a - b > a * b {\n fmt.Println(a - b)\n } else {\n fmt.Println(a * b)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 300, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s297089413", "group_id": "codeNet:p02945", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scan(&a, &b)\n\n\tn := [3]int{a + b, a - b, a * b}\n\tm := n[0]\n\tfor i := 1; i < len(n); i++ {\n\t\tif m < n[i] {\n\t\t\tm = n[i]\n\t\t}\n\t}\n\n\tfmt.Println(m)\n}\n", "language": "Go", "metadata": {"date": 1565493442, "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/s297089413.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s297089413", "user_id": "u640783024"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scan(&a, &b)\n\n\tn := [3]int{a + b, a - b, a * b}\n\tm := n[0]\n\tfor i := 1; i < len(n); i++ {\n\t\tif m < n[i] {\n\t\t\tm = n[i]\n\t\t}\n\t}\n\n\tfmt.Println(m)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s514774020", "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\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tarr := scanArrayInt()\n\tout := make([]string, arr[0]+(arr[0]-1))\n\tj := 0\n\tfor i := arr[1] - (arr[0] - 1); i < arr[1]+(arr[0]); i++ {\n\t\tout[j] = fmt.Sprintf(\"%v\", i)\n\t\tj++\n\t}\n\tfmt.Println(strings.Join(out, \" \"))\n}\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\n}", "language": "Go", "metadata": {"date": 1568553986, "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/s514774020.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s514774020", "user_id": "u564244597"}, "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\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tarr := scanArrayInt()\n\tout := make([]string, arr[0]+(arr[0]-1))\n\tj := 0\n\tfor i := arr[1] - (arr[0] - 1); i < arr[1]+(arr[0]); i++ {\n\t\tout[j] = fmt.Sprintf(\"%v\", i)\n\t\tj++\n\t}\n\tfmt.Println(strings.Join(out, \" \"))\n}\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867073532", "group_id": "codeNet:p02946", "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 cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tK, _ := strconv.Atoi(read())\n\tX, _ := strconv.Atoi(read())\n\n\tfor i := -1000000; i <= 1000000; i++ {\n\t\tif X-K < i && i < X+K {\n\t\t\tfmt.Printf(\"%d \", i)\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\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": 1565485733, "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/s867073532.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s867073532", "user_id": "u266742706"}, "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\"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 cnt int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tK, _ := strconv.Atoi(read())\n\tX, _ := strconv.Atoi(read())\n\n\tfor i := -1000000; i <= 1000000; i++ {\n\t\tif X-K < i && i < X+K {\n\t\t\tfmt.Printf(\"%d \", i)\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\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\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2773, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s912902419", "group_id": "codeNet:p02946", "input_text": "// B - One Clue\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scanf(\"%d %d\", &K, &X)\n\n\tfrom := X - K + 1\n\tto := X + K - 1\n\tfmt.Print(from)\n\tfor i := from + 1; i <= to; i++ {\n\t\tfmt.Printf(\" %d\", i)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565485477, "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/s912902419.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s912902419", "user_id": "u764320774"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "// B - One Clue\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, X int\n\tfmt.Scanf(\"%d %d\", &K, &X)\n\n\tfrom := X - K + 1\n\tto := X + K - 1\n\tfmt.Print(from)\n\tfor i := from + 1; i <= to; i++ {\n\t\tfmt.Printf(\" %d\", i)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s828632554", "group_id": "codeNet:p02947", "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 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\tN := scanInt()\n\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tS[i] = sc.Text()\n\n\t\tsp := strings.Split(S[i], \"\")\n\t\tsort.Strings(sp)\n\t\tS[i] = strings.Join(sp, \"\")\n\t}\n\n\tsort.Strings(S)\n\tans := 0\n\tcnt := 1\n\tfor i := 1; i < N; i++ {\n\t\tif S[i] == S[i-1] {\n\t\t\tcnt++\n\t\t} else {\n\t\t\tans += ((cnt) * (cnt - 1)) / 2\n\t\t\tcnt = 1\n\t\t}\n\t}\n\tans += ((cnt) * (cnt - 1)) / 2\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1589390653, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/Go/s828632554.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s828632554", "user_id": "u941434715"}, "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\t\"strings\"\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\tN := scanInt()\n\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tS[i] = sc.Text()\n\n\t\tsp := strings.Split(S[i], \"\")\n\t\tsort.Strings(sp)\n\t\tS[i] = strings.Join(sp, \"\")\n\t}\n\n\tsort.Strings(S)\n\tans := 0\n\tcnt := 1\n\tfor i := 1; i < N; i++ {\n\t\tif S[i] == S[i-1] {\n\t\t\tcnt++\n\t\t} else {\n\t\t\tans += ((cnt) * (cnt - 1)) / 2\n\t\t\tcnt = 1\n\t\t}\n\t}\n\tans += ((cnt) * (cnt - 1)) / 2\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 663, "cpu_time_ms": 228, "memory_kb": 6656}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s543548033", "group_id": "codeNet:p02947", "input_text": "//THIS IS A UBER HUGE BLACKISH DICK MOVE!\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\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 := PrintlnInts(X...)\n\n/*******************************************************************/\n\ntype freq [26]int\n\nfunc str2freq(s string) freq {\n\tvar f freq\n\tfor i := 0; i < len(s); i++ {\n\t\tf[s[i]-'a']++\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := ReadInt()\n\tf := make(map[freq]int)\n\tfor i := 0; i < n; i++ {\n\t\ts := ReadString()\n\t\tf[str2freq(s)]++\n\t}\n\tans := 0\n\tfor _, v := range f {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n\n/*********** Math ***********/\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmin := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] < min {\n\t\t\tmin = args[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmax := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] > max {\n\t\t\tmax = args[i]\n\t\t}\n\t}\n\treturn max\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 gcd(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tgcd := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tgcd = _gcd(gcd, args[i])\n\t}\n\treturn gcd\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}\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\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// 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// PrintIntsLine returns integers string delimited by a space.\nfunc PrintlnInts(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", "language": "Go", "metadata": {"date": 1565604405, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/Go/s543548033.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s543548033", "user_id": "u917552603"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "//THIS IS A UBER HUGE BLACKISH DICK MOVE!\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\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 := PrintlnInts(X...)\n\n/*******************************************************************/\n\ntype freq [26]int\n\nfunc str2freq(s string) freq {\n\tvar f freq\n\tfor i := 0; i < len(s); i++ {\n\t\tf[s[i]-'a']++\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := ReadInt()\n\tf := make(map[freq]int)\n\tfor i := 0; i < n; i++ {\n\t\ts := ReadString()\n\t\tf[str2freq(s)]++\n\t}\n\tans := 0\n\tfor _, v := range f {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n\n/*********** Math ***********/\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmin := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] < min {\n\t\t\tmin = args[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tmax := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tif args[i] > max {\n\t\t\tmax = args[i]\n\t\t}\n\t}\n\treturn max\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 gcd(args ...int) int {\n\tif len(args) == 0 {\n\t\tpanic(\"empty!\")\n\t}\n\tgcd := args[0]\n\tfor i := 1; i < len(args); i++ {\n\t\tgcd = _gcd(gcd, args[i])\n\t}\n\treturn gcd\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}\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\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// 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// PrintIntsLine returns integers string delimited by a space.\nfunc PrintlnInts(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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3505, "cpu_time_ms": 88, "memory_kb": 25216}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s017456961", "group_id": "codeNet:p02947", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc getString() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc getInt() int {\n\ts.Scan()\n\ta, _ := strconv.Atoi(s.Text())\n\treturn int(a)\n}\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\tn := getInt()\n\n\tnums := make(map[int]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tstr := getString()\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tn += int(str[j])\n\t\t}\n\t\tnums[n]++\n\t}\n\tfmt.Println(nums)\n\tvar ans uint64\n\tans = 0\n\tfor _, v := range nums {\n\t\tans += (v * (v - 1)) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1565494833, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/Go/s017456961.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s017456961", "user_id": "u262602763"}, "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 s = bufio.NewScanner(os.Stdin)\n\nfunc getString() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc getInt() int {\n\ts.Scan()\n\ta, _ := strconv.Atoi(s.Text())\n\treturn int(a)\n}\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\tn := getInt()\n\n\tnums := make(map[int]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\tstr := getString()\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tn += int(str[j])\n\t\t}\n\t\tnums[n]++\n\t}\n\tfmt.Println(nums)\n\tvar ans uint64\n\tans = 0\n\tfor _, v := range nums {\n\t\tans += (v * (v - 1)) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 554, "cpu_time_ms": 39, "memory_kb": 4608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s235662621", "group_id": "codeNet:p02947", "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\tb := make([]int, len(a))\n\tcopy(b, a)\n\tsort.Ints(b)\n\treturn b\n}\n\n// 逆順のsort\nfunc reverse(a []int) []int {\n\tb := make([]int, len(a))\n\tcopy(b, a)\n\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\treturn b\n}\n\nfunc main() {\n\tn := readInt()\n\ts := make([]string, n)\n\tvar c int\n\tfor i := 0; i < n; i++ {\n\t\ta := strings.Split(readLine(), \"\")\n\t\tsort.Strings(a)\n\t\ts[i] = strings.Join(a, \"\")\n\t\tfor j := 0; j < i; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n", "language": "Go", "metadata": {"date": 1565487172, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/Go/s235662621.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s235662621", "user_id": "u468482169"}, "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\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\tb := make([]int, len(a))\n\tcopy(b, a)\n\tsort.Ints(b)\n\treturn b\n}\n\n// 逆順のsort\nfunc reverse(a []int) []int {\n\tb := make([]int, len(a))\n\tcopy(b, a)\n\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\treturn b\n}\n\nfunc main() {\n\tn := readInt()\n\ts := make([]string, n)\n\tvar c int\n\tfor i := 0; i < n; i++ {\n\t\ta := strings.Split(readLine(), \"\")\n\t\tsort.Strings(a)\n\t\ts[i] = strings.Join(a, \"\")\n\t\tfor j := 0; j < i; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1294, "cpu_time_ms": 2107, "memory_kb": 5120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s514011526", "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\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\ntype Task struct {\n\ta int\n\tb int\n}\n\ntype sortTasks []Task\n\nfunc (s sortTasks) Less(i, j int) bool {\n\tif s[i].a == s[j].a {\n\t\treturn s[i].b > s[j].b\n\t}\n\treturn s[i].a < s[j].a\n}\n\nfunc (s sortTasks) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s sortTasks) Len() int {\n\treturn len(s)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\ttasks := make([]Task, n)\n\tfor i := 0; i < n; i++ {\n\t\ttasks[i] = Task{scanInt(), scanInt()}\n\t}\n\tanswer := maxRevenue(n, m, tasks)\n\tfmt.Println(answer)\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\nfunc maxRevenue(n, m int, tasks []Task) int {\n\tsort.Sort(sortTasks(tasks))\n\tedges := make([]int, m+1)\n\tfor i := 0; i < m+1; i++ {\n\t\tedges[i] = -1\n\t}\n\n\tfor i, nextEdge := 0, 1; i < n && nextEdge <= m; {\n\t\tdebug(i, nextEdge, tasks[i])\n\t\tif tasks[i].a == nextEdge {\n\t\t\tedges[nextEdge] = i\n\t\t\tnextEdge++\n\t\t\tcontinue\n\t\t} else if tasks[i].a > nextEdge {\n\t\t\tnextEdge++\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\trevenue := 0\n\tdebug(edges)\n\tdebug(tasks)\n\t// 5 3 1\n\t// 4 2\n\tfor i := 1; i <= m; i++ {\n\t\tmaxForDay := 0\n\t\tselected := -1\n\t\tdebug(\"search task for day \", i)\n\t\tfor j := i; j > 0; j-- {\n\t\t\tdebug(edges)\n\t\t\tif edges[j] == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt := tasks[edges[j]]\n\t\t\tif t.a <= j && t.b > maxForDay {\n\t\t\t\tmaxForDay = tasks[edges[j]].b\n\t\t\t\tselected = j\n\t\t\t}\n\t\t}\n\t\tif selected != -1 {\n\t\t\tdebug(\"selected\", selected)\n\t\t\tdebug(\"selected for day \", i, \" :\", selected, tasks[edges[selected]])\n\t\t\tedges[selected]++\n\t\t\trevenue += maxForDay\n\t\t}\n\t}\n\treturn revenue\n}\n", "language": "Go", "metadata": {"date": 1591883669, "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/s514011526.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s514011526", "user_id": "u238461782"}, "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\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\ntype Task struct {\n\ta int\n\tb int\n}\n\ntype sortTasks []Task\n\nfunc (s sortTasks) Less(i, j int) bool {\n\tif s[i].a == s[j].a {\n\t\treturn s[i].b > s[j].b\n\t}\n\treturn s[i].a < s[j].a\n}\n\nfunc (s sortTasks) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc (s sortTasks) Len() int {\n\treturn len(s)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\ttasks := make([]Task, n)\n\tfor i := 0; i < n; i++ {\n\t\ttasks[i] = Task{scanInt(), scanInt()}\n\t}\n\tanswer := maxRevenue(n, m, tasks)\n\tfmt.Println(answer)\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\nfunc maxRevenue(n, m int, tasks []Task) int {\n\tsort.Sort(sortTasks(tasks))\n\tedges := make([]int, m+1)\n\tfor i := 0; i < m+1; i++ {\n\t\tedges[i] = -1\n\t}\n\n\tfor i, nextEdge := 0, 1; i < n && nextEdge <= m; {\n\t\tdebug(i, nextEdge, tasks[i])\n\t\tif tasks[i].a == nextEdge {\n\t\t\tedges[nextEdge] = i\n\t\t\tnextEdge++\n\t\t\tcontinue\n\t\t} else if tasks[i].a > nextEdge {\n\t\t\tnextEdge++\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\trevenue := 0\n\tdebug(edges)\n\tdebug(tasks)\n\t// 5 3 1\n\t// 4 2\n\tfor i := 1; i <= m; i++ {\n\t\tmaxForDay := 0\n\t\tselected := -1\n\t\tdebug(\"search task for day \", i)\n\t\tfor j := i; j > 0; j-- {\n\t\t\tdebug(edges)\n\t\t\tif edges[j] == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt := tasks[edges[j]]\n\t\t\tif t.a <= j && t.b > maxForDay {\n\t\t\t\tmaxForDay = tasks[edges[j]].b\n\t\t\t\tselected = j\n\t\t\t}\n\t\t}\n\t\tif selected != -1 {\n\t\t\tdebug(\"selected\", selected)\n\t\t\tdebug(\"selected for day \", i, \" :\", selected, tasks[edges[selected]])\n\t\t\tedges[selected]++\n\t\t\trevenue += maxForDay\n\t\t}\n\t}\n\treturn revenue\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1977, "cpu_time_ms": 2108, "memory_kb": 4480}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s454452759", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\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\n\tfmt.Fscanln(stdin, &n, &m)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar info inInfo\n\t\tfmt.Fscanln(stdin, &info.after, &info.in)\n\t\tinfos = append(infos, info)\n\t}\n\n\tsort.Sort(inInfoSorter(infos))\n\n\tvar ans = make([]int, m)\n\tvar p = make([]int, m)\n\tfor i := range p {\n\t\tp[i] = i\n\t}\n\tptrs := ptr(p)\n\n\tfor _, w := range infos {\n\t\ti := ptrs.top(m - w.after)\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": 1565656209, "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/s454452759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s454452759", "user_id": "u463655976"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\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\n\tfmt.Fscanln(stdin, &n, &m)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar info inInfo\n\t\tfmt.Fscanln(stdin, &info.after, &info.in)\n\t\tinfos = append(infos, info)\n\t}\n\n\tsort.Sort(inInfoSorter(infos))\n\n\tvar ans = make([]int, m)\n\tvar p = make([]int, m)\n\tfor i := range p {\n\t\tp[i] = i\n\t}\n\tptrs := ptr(p)\n\n\tfor _, w := range infos {\n\t\ti := ptrs.top(m - w.after)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1356, "cpu_time_ms": 827, "memory_kb": 8960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s074169387", "group_id": "codeNet:p02948", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\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\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\ntype item struct {\n\tindex int\n\tA int\n\tB int\n}\n\ntype priorityQueue []*item\n\nfunc (pq priorityQueue) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq priorityQueue) Less(i, j int) bool {\n\treturn pq[i].B > pq[j].B\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\titem := x.(*item)\n\titem.index = len(*pq)\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *priorityQueue) Pop() interface{} {\n\tn := len(*pq)\n\titem := (*pq)[n-1]\n\titem.index = -1\n\t*pq = (*pq)[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar N, M int\n\tfmt.Fscanf(input, \"%d %d\\n\", &N, &M)\n\tA := make([]int, N)\n\tB := make([]int, N)\n\tfor n := 0; n < N; n++ {\n\t\tfmt.Fscanf(input, \"%d %d\\n\", &A[n], &B[n])\n\t}\n\n\tm := make([][]int, M+1)\n\tfor i := range m {\n\t\tm[i] = make([]int, 0)\n\t}\n\tfor n := 0; n < N; n++ {\n\t\tif A[n] <= M {\n\t\t\tm[A[n]] = append(m[A[n]], n)\n\t\t}\n\t}\n\n\tpq := make(priorityQueue, 0)\n\theap.Init(&pq)\n\tvar ans int\n\tfor i := 1; i <= M; i++ {\n\t\tfor _, n := range m[i] {\n\t\t\titem := &item{\n\t\t\t\tA: A[n],\n\t\t\t\tB: B[n],\n\t\t\t}\n\t\t\theap.Push(&pq, item)\n\t\t\theap.Fix(&pq, item.index)\n\t\t}\n\t\tif pq.Len() > 0 {\n\t\t\tx := heap.Pop(&pq)\n\t\t\titem := x.(*item)\n\t\t\tans += item.B\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1565494445, "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/s074169387.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s074169387", "user_id": "u419255487"}, "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)\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\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\ntype item struct {\n\tindex int\n\tA int\n\tB int\n}\n\ntype priorityQueue []*item\n\nfunc (pq priorityQueue) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq priorityQueue) Less(i, j int) bool {\n\treturn pq[i].B > pq[j].B\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\titem := x.(*item)\n\titem.index = len(*pq)\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *priorityQueue) Pop() interface{} {\n\tn := len(*pq)\n\titem := (*pq)[n-1]\n\titem.index = -1\n\t*pq = (*pq)[0 : n-1]\n\treturn item\n}\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\n\tvar N, M int\n\tfmt.Fscanf(input, \"%d %d\\n\", &N, &M)\n\tA := make([]int, N)\n\tB := make([]int, N)\n\tfor n := 0; n < N; n++ {\n\t\tfmt.Fscanf(input, \"%d %d\\n\", &A[n], &B[n])\n\t}\n\n\tm := make([][]int, M+1)\n\tfor i := range m {\n\t\tm[i] = make([]int, 0)\n\t}\n\tfor n := 0; n < N; n++ {\n\t\tif A[n] <= M {\n\t\t\tm[A[n]] = append(m[A[n]], n)\n\t\t}\n\t}\n\n\tpq := make(priorityQueue, 0)\n\theap.Init(&pq)\n\tvar ans int\n\tfor i := 1; i <= M; i++ {\n\t\tfor _, n := range m[i] {\n\t\t\titem := &item{\n\t\t\t\tA: A[n],\n\t\t\t\tB: B[n],\n\t\t\t}\n\t\t\theap.Push(&pq, item)\n\t\t\theap.Fix(&pq, item.index)\n\t\t}\n\t\tif pq.Len() > 0 {\n\t\t\tx := heap.Pop(&pq)\n\t\t\titem := x.(*item)\n\t\t\tans += item.B\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1529, "cpu_time_ms": 278, "memory_kb": 12800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s283640767", "group_id": "codeNet:p02950", "input_text": "package main\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nfunc Inverse(p int) []int {\n Inv := make([]int, p)\n Inv[0] = 1\n Inv[1] = 1\n for i := 2; i < p; i++ {\n Inv[i] = p - Inv[p % i] * (p / i) % p\n }\n return Inv\n}\n\ntype ModIntOperator struct {\n Inv []int\n Mod int\n}\nfunc InitMIO(p int) ModIntOperator {\n Inv := Inverse(p)\n return ModIntOperator{Inv, p}\n}\nfunc (M ModIntOperator) Num(a int) int {\n a %= M.Mod\n if a < 0 { a += M.Mod }\n return a\n}\nfunc (M ModIntOperator) Add(a, b int) int {\n return (M.Num(a) + M.Num(b)) % M.Mod\n}\nfunc (M ModIntOperator) Sub(a, b int) int {\n return (M.Num(a) - M.Num(b) + M.Mod) % M.Mod\n}\nfunc (M ModIntOperator) Mul(a, b int) int {\n return M.Num(a) * M.Num(b) % M.Mod\n}\nfunc (M ModIntOperator) Div(a, b int) int {\n return M.Num(a) * M.Inv[M.Num(b)] % M.Mod\n}\n\nfunc Solve() {\n var p, d, m int\n var A []int\n NextInt(&p)\n NextIntVec(&A)\n M := InitMIO(p)\n B := make([][]int, p)\n for i := range B {\n B[i] = make([]int, p)\n B[i][0]++\n for j := range B[i][1:] {\n B[i][j + 1] = M.Mul(B[i][j], i)\n }\n }\n for i := 0; i < p; i++ {\n d = B[i][i]\n for j := i; j < p; j++ { B[i][j] = M.Div(B[i][j], d) }\n A[i] = M.Div(A[i], d)\n for j := 1; j < p; j++ {\n if i == j { continue }\n m = B[j][i]\n for k := i; k < p; k++ {\n B[j][k] = M.Sub(B[j][k], M.Mul(B[i][k], m))\n }\n A[j] = M.Sub(A[j], M.Mul(A[i], m))\n }\n }\n for _, b := range B { fmt.Println(b) }\n WriteIntVec(A)\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": 1591146396, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02950.html", "problem_id": "p02950", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02950/input.txt", "sample_output_relpath": "derived/input_output/data/p02950/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02950/Go/s283640767.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s283640767", "user_id": "u415905784"}, "prompt_components": {"gold_output": "1 1\n", "input_to_evaluate": "package main\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nfunc Inverse(p int) []int {\n Inv := make([]int, p)\n Inv[0] = 1\n Inv[1] = 1\n for i := 2; i < p; i++ {\n Inv[i] = p - Inv[p % i] * (p / i) % p\n }\n return Inv\n}\n\ntype ModIntOperator struct {\n Inv []int\n Mod int\n}\nfunc InitMIO(p int) ModIntOperator {\n Inv := Inverse(p)\n return ModIntOperator{Inv, p}\n}\nfunc (M ModIntOperator) Num(a int) int {\n a %= M.Mod\n if a < 0 { a += M.Mod }\n return a\n}\nfunc (M ModIntOperator) Add(a, b int) int {\n return (M.Num(a) + M.Num(b)) % M.Mod\n}\nfunc (M ModIntOperator) Sub(a, b int) int {\n return (M.Num(a) - M.Num(b) + M.Mod) % M.Mod\n}\nfunc (M ModIntOperator) Mul(a, b int) int {\n return M.Num(a) * M.Num(b) % M.Mod\n}\nfunc (M ModIntOperator) Div(a, b int) int {\n return M.Num(a) * M.Inv[M.Num(b)] % M.Mod\n}\n\nfunc Solve() {\n var p, d, m int\n var A []int\n NextInt(&p)\n NextIntVec(&A)\n M := InitMIO(p)\n B := make([][]int, p)\n for i := range B {\n B[i] = make([]int, p)\n B[i][0]++\n for j := range B[i][1:] {\n B[i][j + 1] = M.Mul(B[i][j], i)\n }\n }\n for i := 0; i < p; i++ {\n d = B[i][i]\n for j := i; j < p; j++ { B[i][j] = M.Div(B[i][j], d) }\n A[i] = M.Div(A[i], d)\n for j := 1; j < p; j++ {\n if i == j { continue }\n m = B[j][i]\n for k := i; k < p; k++ {\n B[j][k] = M.Sub(B[j][k], M.Mul(B[i][k], m))\n }\n A[j] = M.Sub(A[j], M.Mul(A[i], m))\n }\n }\n for _, b := range B { fmt.Println(b) }\n WriteIntVec(A)\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 : 600 points\n\nProblem Statement\n\nGiven are a prime number p and a sequence of p integers a_0, \\ldots, a_{p-1} consisting of zeros and ones.\n\nFind a polynomial of degree at most p-1, f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \\ldots + b_0, satisfying the following conditions:\n\nFor each i (0 \\leq i \\leq p-1), b_i is an integer such that 0 \\leq b_i \\leq p-1.\n\nFor each i (0 \\leq i \\leq p-1), f(i) \\equiv a_i \\pmod p.\n\nConstraints\n\n2 \\leq p \\leq 2999\n\np is a prime number.\n\n0 \\leq a_i \\leq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\np\na_0 a_1 \\ldots a_{p-1}\n\nOutput\n\nPrint b_0, b_1, \\ldots, b_{p-1} of a polynomial f(x) satisfying the conditions, in this order, with spaces in between.\n\nIt can be proved that a solution always exists. If multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n2\n1 0\n\nSample Output 1\n\n1 1\n\nf(x) = x + 1 satisfies the conditions, as follows:\n\nf(0) = 0 + 1 = 1 \\equiv 1 \\pmod 2\n\nf(1) = 1 + 1 = 2 \\equiv 0 \\pmod 2\n\nSample Input 2\n\n3\n0 0 0\n\nSample Output 2\n\n0 0 0\n\nf(x) = 0 is also valid.\n\nSample Input 3\n\n5\n0 1 0 1 0\n\nSample Output 3\n\n0 2 0 1 3", "sample_input": "2\n1 0\n"}, "reference_outputs": ["1 1\n"], "source_document_id": "p02950", "source_text": "Score : 600 points\n\nProblem Statement\n\nGiven are a prime number p and a sequence of p integers a_0, \\ldots, a_{p-1} consisting of zeros and ones.\n\nFind a polynomial of degree at most p-1, f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \\ldots + b_0, satisfying the following conditions:\n\nFor each i (0 \\leq i \\leq p-1), b_i is an integer such that 0 \\leq b_i \\leq p-1.\n\nFor each i (0 \\leq i \\leq p-1), f(i) \\equiv a_i \\pmod p.\n\nConstraints\n\n2 \\leq p \\leq 2999\n\np is a prime number.\n\n0 \\leq a_i \\leq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\np\na_0 a_1 \\ldots a_{p-1}\n\nOutput\n\nPrint b_0, b_1, \\ldots, b_{p-1} of a polynomial f(x) satisfying the conditions, in this order, with spaces in between.\n\nIt can be proved that a solution always exists. If multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n2\n1 0\n\nSample Output 1\n\n1 1\n\nf(x) = x + 1 satisfies the conditions, as follows:\n\nf(0) = 0 + 1 = 1 \\equiv 1 \\pmod 2\n\nf(1) = 1 + 1 = 2 \\equiv 0 \\pmod 2\n\nSample Input 2\n\n3\n0 0 0\n\nSample Output 2\n\n0 0 0\n\nf(x) = 0 is also valid.\n\nSample Input 3\n\n5\n0 1 0 1 0\n\nSample Output 3\n\n0 2 0 1 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3084, "cpu_time_ms": 2115, "memory_kb": 78564}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s237672827", "group_id": "codeNet:p02951", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scanln(&A, &B, &C)\n\n\tans := C - (A - B)\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1567277014, "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/s237672827.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s237672827", "user_id": "u020639289"}, "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 int\n\tfmt.Scanln(&A, &B, &C)\n\n\tans := C - (A - B)\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s639194344", "group_id": "codeNet:p02951", "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\tstr := sc.Text()\n\treturn str\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 main(){\n\tsc.Split(bufio.ScanWords)\n\ta, b, c := nextInt(), nextInt(), nextInt()\n\tans := c - a + b\n if ans < 0 {\n ans = 0\n }\n fmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1564967096, "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/s639194344.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s639194344", "user_id": "u693512270"}, "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 nextWord() string {\n\tsc.Scan()\n\tstr := sc.Text()\n\treturn str\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 main(){\n\tsc.Split(bufio.ScanWords)\n\ta, b, c := nextInt(), nextInt(), nextInt()\n\tans := c - a + b\n if ans < 0 {\n ans = 0\n }\n fmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s982389711", "group_id": "codeNet:p02951", "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\n// ----------------------------------------------------------------\n\nfunc main() {\n\tvar a int\n\tvar b int\n\tvar c int\n\tfmt.Scan(&a, &b, &c)\n\n\tif a-b >= c {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(c - a + b)\n\t}\n}\n\n// ----------------------------------------------------------------\n\nvar dx = []int{0, 1, 0, -1, 0}\nvar dy = []int{1, 0, -1, 0, 0}\nvar inf = 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}\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}\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\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}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\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}\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\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\n\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\n\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\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\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1564967068, "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/s982389711.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s982389711", "user_id": "u381460455"}, "prompt_components": {"gold_output": "1\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\n// ----------------------------------------------------------------\n\nfunc main() {\n\tvar a int\n\tvar b int\n\tvar c int\n\tfmt.Scan(&a, &b, &c)\n\n\tif a-b >= c {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(c - a + b)\n\t}\n}\n\n// ----------------------------------------------------------------\n\nvar dx = []int{0, 1, 0, -1, 0}\nvar dy = []int{1, 0, -1, 0, 0}\nvar inf = 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}\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}\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\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}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\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}\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\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\n\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\n\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\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\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2090, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s025142814", "group_id": "codeNet:p02952", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tcount := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif 1 <= i && i < 10 || 100 <= i && i < 1000 || 10000 <= i && i < 100000 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1590868415, "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/s025142814.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s025142814", "user_id": "u162326103"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tcount := 0\n\tfor i := 1; i <= N; i++ {\n\t\tif 1 <= i && i < 10 || 100 <= i && i < 1000 || 10000 <= i && i < 100000 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s284882033", "group_id": "codeNet:p02952", "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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t\n\tn := scanInt()\n\n\tans := 0\n\td := 1\n\tfor i := 1; i < n+1; i*=10 {\n\t\tif d%2 == 0 {\n\t\t\td++\n\t\t\tcontinue\n\t\t}\n\t\t\n\t\tif n/i/10 == 0 {\n\t\t\tans += n-i+1\n\t\t} else {\n\t\t\tans += i*10-i\n\t\t}\n\t\td++\n\t}\n\t\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1575267924, "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/s284882033.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s284882033", "user_id": "u548992197"}, "prompt_components": {"gold_output": "9\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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t\n\tn := scanInt()\n\n\tans := 0\n\td := 1\n\tfor i := 1; i < n+1; i*=10 {\n\t\tif d%2 == 0 {\n\t\t\td++\n\t\t\tcontinue\n\t\t}\n\t\t\n\t\tif n/i/10 == 0 {\n\t\t\tans += n-i+1\n\t\t} else {\n\t\t\tans += i*10-i\n\t\t}\n\t\td++\n\t}\n\t\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 477, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s779751507", "group_id": "codeNet:p02952", "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 GetIntAbs = getIntAbs\n}\n\nfunc main() {\n\tn := ReadInt()\n var ans int\n for i := 1; i <= n; i++ {\n s := len(strconv.Itoa(i))\n if s % 2 == 1 {\n ans++\n }\n }\n fmt.Println(ans)\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, 1024), 2048)\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": 1564973224, "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/s779751507.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s779751507", "user_id": "u657610454"}, "prompt_components": {"gold_output": "9\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 GetIntAbs = getIntAbs\n}\n\nfunc main() {\n\tn := ReadInt()\n var ans int\n for i := 1; i <= n; i++ {\n s := len(strconv.Itoa(i))\n if s % 2 == 1 {\n ans++\n }\n }\n fmt.Println(ans)\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, 1024), 2048)\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 : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2298, "cpu_time_ms": 7, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s255448900", "group_id": "codeNet:p02952", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tketa := 6\n\twarukazu := 100000\n\tfor N/warukazu < 1 {\n\t\twarukazu /= 10\n\t\tketa--\n\t}\n\n\tvar count int\n\tif keta <= 1 {\n\t\tcount = 1\n\t} else if keta <= 2 {\n\t\tcount = 9\n\t} else if keta <= 3 {\n\t\tcount = N - 90\n\t} else if keta <= 4 {\n\t\tcount = 909\n\t} else if keta <= 5 {\n\t\tcount = N - 9090\n\t} else if keta <= 6 {\n\t\tcount = 90909\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n\n}\n", "language": "Go", "metadata": {"date": 1564972774, "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/s255448900.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s255448900", "user_id": "u117391285"}, "prompt_components": {"gold_output": "9\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\tketa := 6\n\twarukazu := 100000\n\tfor N/warukazu < 1 {\n\t\twarukazu /= 10\n\t\tketa--\n\t}\n\n\tvar count int\n\tif keta <= 1 {\n\t\tcount = 1\n\t} else if keta <= 2 {\n\t\tcount = 9\n\t} else if keta <= 3 {\n\t\tcount = N - 90\n\t} else if keta <= 4 {\n\t\tcount = 909\n\t} else if keta <= 5 {\n\t\tcount = N - 9090\n\t} else if keta <= 6 {\n\t\tcount = 90909\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 426, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s207397453", "group_id": "codeNet:p02954", "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\ts := readString()\n\tans := make([]int, len(s))\n\n\tfor i := range s {\n\t\tc := s[i]\n\t\tj := 1\n\t\tif c == 'R' {\n\t\t\tfor s[i+j] == 'R' {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j%2 == 0 {\n\t\t\t\tans[i+j]++\n\t\t\t} else {\n\t\t\t\tans[i+j-1]++\n\t\t\t}\n\t\t} else {\n\t\t\tfor s[i-j] == 'L' {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j%2 == 0 {\n\t\t\t\tans[i-j]++\n\t\t\t} else {\n\t\t\t\tans[i-j+1]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range ans {\n\t\tfmt.Printf(\"%v \", ans[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1569339377, "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/s207397453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s207397453", "user_id": "u295946532"}, "prompt_components": {"gold_output": "0 1 2 1 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)\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\ts := readString()\n\tans := make([]int, len(s))\n\n\tfor i := range s {\n\t\tc := s[i]\n\t\tj := 1\n\t\tif c == 'R' {\n\t\t\tfor s[i+j] == 'R' {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j%2 == 0 {\n\t\t\t\tans[i+j]++\n\t\t\t} else {\n\t\t\t\tans[i+j-1]++\n\t\t\t}\n\t\t} else {\n\t\t\tfor s[i-j] == 'L' {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j%2 == 0 {\n\t\t\t\tans[i-j]++\n\t\t\t} else {\n\t\t\t\tans[i-j+1]++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := range ans {\n\t\tfmt.Printf(\"%v \", ans[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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2709, "cpu_time_ms": 2107, "memory_kb": 2816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s161304991", "group_id": "codeNet:p02956", "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\tnums := make([]int, int(math.Pow(2, float64(n))))\n\tmax := 0\n\tfor i := 0; i < int(math.Pow(2, float64(n))); i++ {\n\t\tfmt.Scan(&nums[i])\n\t\tif nums[i] > max {\n\t\t\tmax = nums[i]\n\t\t}\n\t}\n\n\tmaxCount := 0\n\tcondition := 0\n\tfor _, num := range nums {\n\t\tif num == max {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tcondition = 1\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-1 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > n {\n\t\t\tbreak\n\t\t}\n\t}\n\tcondition = n\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-2 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1)) / 2) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1)) / 2) > n {\n\t\tcondition = ((n * (n - 1)) / 2)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-3 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2)) / 6) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2)) / 6) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2)) / 6)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-4 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2) * (n - 3)) / 24) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2) * (n - 3)) / 24) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2) * (n - 3)) / 24)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-5 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1567909399, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02956.html", "problem_id": "p02956", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02956/input.txt", "sample_output_relpath": "derived/input_output/data/p02956/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02956/Go/s161304991.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s161304991", "user_id": "u703454820"}, "prompt_components": {"gold_output": "13\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\tnums := make([]int, int(math.Pow(2, float64(n))))\n\tmax := 0\n\tfor i := 0; i < int(math.Pow(2, float64(n))); i++ {\n\t\tfmt.Scan(&nums[i])\n\t\tif nums[i] > max {\n\t\t\tmax = nums[i]\n\t\t}\n\t}\n\n\tmaxCount := 0\n\tcondition := 0\n\tfor _, num := range nums {\n\t\tif num == max {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tcondition = 1\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-1 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > n {\n\t\t\tbreak\n\t\t}\n\t}\n\tcondition = n\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-2 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1)) / 2) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1)) / 2) > n {\n\t\tcondition = ((n * (n - 1)) / 2)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-3 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2)) / 6) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2)) / 6) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2)) / 6)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-4 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2) * (n - 3)) / 24) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2) * (n - 3)) / 24) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2) * (n - 3)) / 24)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tmaxCount = 0\n\tfor _, num := range nums {\n\t\tif num == max-5 {\n\t\t\tmaxCount++\n\t\t}\n\t\tif maxCount > ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120) {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120) > n {\n\t\tcondition = ((n * (n - 1) * (n - 2) * (n - 3) * (n - 4)) / 120)\n\t}\n\tif maxCount > condition {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates.\n\nFor a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in T. More formally, we define f(T) as follows:\n\nf(T) := (the number of integers i (1 \\leq i \\leq N) such that a \\leq x_i \\leq b and c \\leq y_i \\leq d, where a, b, c, and d are the minimum x-coordinate, the maximum x-coordinate, the minimum y-coordinate, and the maximum y-coordinate of the points in T)\n\nFind the sum of f(T) over all non-empty subset T of S. Since it can be enormous, print the sum modulo 998244353.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq x_i, y_i \\leq 10^9\n\nx_i \\neq x_j (i \\neq j)\n\ny_i \\neq y_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\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the sum of f(T) over all non-empty subset T of S, modulo 998244353.\n\nSample Input 1\n\n3\n-1 3\n2 1\n3 -2\n\nSample Output 1\n\n13\n\nLet the first, second, and third points be P_1, P_2, and P_3, respectively. S = \\{P_1, P_2, P_3\\} has seven non-empty subsets, and f has the following values for each of them:\n\nf(\\{P_1\\}) = 1\n\nf(\\{P_2\\}) = 1\n\nf(\\{P_3\\}) = 1\n\nf(\\{P_1, P_2\\}) = 2\n\nf(\\{P_2, P_3\\}) = 2\n\nf(\\{P_3, P_1\\}) = 3\n\nf(\\{P_1, P_2, P_3\\}) = 3\n\nThe sum of these is 13.\n\nSample Input 2\n\n4\n1 4\n2 1\n3 3\n4 2\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n19 -11\n-3 -12\n5 3\n3 -15\n8 -14\n-9 -20\n10 -9\n0 2\n-7 17\n6 -6\n\nSample Output 3\n\n7222\n\nBe sure to print the sum modulo 998244353.", "sample_input": "3\n-1 3\n2 1\n3 -2\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02956", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a set S of N points in a two-dimensional plane. The coordinates of the i-th point are (x_i, y_i). The N points have distinct x-coordinates and distinct y-coordinates.\n\nFor a non-empty subset T of S, let f(T) be the number of points contained in the smallest rectangle, whose sides are parallel to the coordinate axes, that contains all the points in T. More formally, we define f(T) as follows:\n\nf(T) := (the number of integers i (1 \\leq i \\leq N) such that a \\leq x_i \\leq b and c \\leq y_i \\leq d, where a, b, c, and d are the minimum x-coordinate, the maximum x-coordinate, the minimum y-coordinate, and the maximum y-coordinate of the points in T)\n\nFind the sum of f(T) over all non-empty subset T of S. Since it can be enormous, print the sum modulo 998244353.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^9 \\leq x_i, y_i \\leq 10^9\n\nx_i \\neq x_j (i \\neq j)\n\ny_i \\neq y_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\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the sum of f(T) over all non-empty subset T of S, modulo 998244353.\n\nSample Input 1\n\n3\n-1 3\n2 1\n3 -2\n\nSample Output 1\n\n13\n\nLet the first, second, and third points be P_1, P_2, and P_3, respectively. S = \\{P_1, P_2, P_3\\} has seven non-empty subsets, and f has the following values for each of them:\n\nf(\\{P_1\\}) = 1\n\nf(\\{P_2\\}) = 1\n\nf(\\{P_3\\}) = 1\n\nf(\\{P_1, P_2\\}) = 2\n\nf(\\{P_2, P_3\\}) = 2\n\nf(\\{P_3, P_1\\}) = 3\n\nf(\\{P_1, P_2, P_3\\}) = 3\n\nThe sum of these is 13.\n\nSample Input 2\n\n4\n1 4\n2 1\n3 3\n4 2\n\nSample Output 2\n\n34\n\nSample Input 3\n\n10\n19 -11\n-3 -12\n5 3\n3 -15\n8 -14\n-9 -20\n10 -9\n0 2\n-7 17\n6 -6\n\nSample Output 3\n\n7222\n\nBe sure to print the sum modulo 998244353.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1914, "cpu_time_ms": 1402, "memory_kb": 8960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s490880811", "group_id": "codeNet:p02957", "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)\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575687939, "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/s490880811.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s490880811", "user_id": "u475329018"}, "prompt_components": {"gold_output": "9\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)\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s914935678", "group_id": "codeNet:p02958", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tbefore := 0\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scanf(\"%d\", &v)\n\t\tif v - before != 1 {\n\t\t\tcount++\n\t\t}\n\t\tbefore++\n\t}\n\tfmt.Println(count)\n\tif count == 2 || count == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594947807, "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/s914935678.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s914935678", "user_id": "u642892744"}, "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.Scanf(\"%d\", &n)\n\tbefore := 0\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scanf(\"%d\", &v)\n\t\tif v - before != 1 {\n\t\t\tcount++\n\t\t}\n\t\tbefore++\n\t}\n\tfmt.Println(count)\n\tif count == 2 || count == 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\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 7, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s297466033", "group_id": "codeNet:p02958", "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\tp := scanNums(n)\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tif p[i] != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count == 2 || count == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\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}", "language": "Go", "metadata": {"date": 1569490134, "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/s297466033.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s297466033", "user_id": "u625741705"}, "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 int\n\tfmt.Scan(&n)\n\tp := scanNums(n)\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tif p[i] != i+1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count == 2 || count == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\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}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100596585", "group_id": "codeNet:p02958", "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\tps := getIntSlice(n)\n\n\tcnt := 0\n\tfor i, p := range ps {\n\t\tif p != i+1 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tans := \"YES\"\n\tif cnt > 2 {\n\t\tans = \"NO\"\n\t}\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 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\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1564277178, "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/s100596585.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s100596585", "user_id": "u543933043"}, "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\tn := getInt()\n\tps := getIntSlice(n)\n\n\tcnt := 0\n\tfor i, p := range ps {\n\t\tif p != i+1 {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tans := \"YES\"\n\tif cnt > 2 {\n\t\tans = \"NO\"\n\t}\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 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\tscanner.Scan()\n\ts := scanner.Text()\n\treturn s\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 737, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614356337", "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tl := nextLine()\n\n\ta := make([]int, n+1)\n\tb := make([]int, n)\n\n\tfor i, h := range strings.Split(l, \" \") {\n\t\tinteger, _ := strconv.Atoi(h)\n\t\ta[i] = integer\n\t}\n\n\tl = nextLine()\n\n\tfor i, h := range strings.Split(l, \" \") {\n\t\tinteger, _ := strconv.Atoi(h)\n\t\tb[i] = integer\n\t}\n\n\ttotal := 0\n\tfor i:=0; i= 0; i-- {\n\t\tif s[i] == '?' {\n\t\t\tfor m := 0; m < 10; m++ {\n\t\t\t\tfor mod, cnt := range dp[i+1] {\n\t\t\t\t\tshifted := (mod + m * digit) % 13\n\t\t\t\t\tdp[i][shifted] += cnt\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tm := int(s[i] - '0')\n\t\t\tfor mod, cnt := range dp[i+1] {\n\t\t\t\tshifted := (mod + m * digit) % 13\n\t\t\t\tdp[i][shifted] += cnt\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor j := 0; j < 13; j++ {\n\t\t\tdp[i][j] %= MOD\n\t\t}\n\t\tdigit = (digit * 10) % 13\n\t}\n\n\tfmt.Println(dp[0][5])\n}", "language": "Go", "metadata": {"date": 1564332921, "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/s382545676.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s382545676", "user_id": "u569280127"}, "prompt_components": {"gold_output": "768\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\t\n\tn := len(s)\n\tdp := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = make([]int, 13)\n\t}\n\n\tif s[n-1] == '?' {\n\t\tfor i := 0; i < 13; i++ {\n\t\t\tif i < 10 {\n\t\t\t\tdp[n-1][i] = 1\n\t\t\t} else {\n\t\t\t\tdp[n-1][i] = 0\n\t\t\t}\n\t\t}\n\t} else {\n\t\tc := int(s[n-1] - '0')\n\t\tfor i := 0; i < 13; i++ {\n\t\t\tif i == c {\n\t\t\t\tdp[n-1][i] = 1\n\t\t\t} else {\n\t\t\t\tdp[n-1][i] = 0\n\t\t\t}\n\t\t}\n\t}\n\t\n\tdigit := 10\n\tfor i := n - 2; i >= 0; i-- {\n\t\tif s[i] == '?' {\n\t\t\tfor m := 0; m < 10; m++ {\n\t\t\t\tfor mod, cnt := range dp[i+1] {\n\t\t\t\t\tshifted := (mod + m * digit) % 13\n\t\t\t\t\tdp[i][shifted] += cnt\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tm := int(s[i] - '0')\n\t\t\tfor mod, cnt := range dp[i+1] {\n\t\t\t\tshifted := (mod + m * digit) % 13\n\t\t\t\tdp[i][shifted] += cnt\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor j := 0; j < 13; j++ {\n\t\t\tdp[i][j] %= MOD\n\t\t}\n\t\tdigit = (digit * 10) % 13\n\t}\n\n\tfmt.Println(dp[0][5])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 916, "cpu_time_ms": 127, "memory_kb": 14592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110451634", "group_id": "codeNet:p02963", "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\n\ts := nextInt()\n\n\tx1, x2, x3 := 0, 0, 0\n\ty1, y2, y3 := 0, 0, 0\n\n\tx2 = 1000000000\n\ty2 = 1\n\ty3 = s / x2\n\tx3 = s % x2\n\tfmt.Printf(\"%d %d %d %d %d %d\\n\", x1, y1, x2, y2, x3, y3)\n\n}\n\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n\n// \ts := nextInt()\n\n// \tx1, x2, x3 := 0, 0, 0\n// \ty1, y2, y3 := 0, 0, 0\n\n// \tvar y23 int\n// \tfor i := 1; ; i++ {\n// \t\tif s%i == 0 && s/i >= 2 {\n// \t\t\ty23 = s / i\n// \t\t\tx1 = i\n// \t\t\tbreak\n// \t\t}\n// \t}\n\n// \ty3 = 0\n// \ty2 = y23 + y3\n// \ty1 = y2 + 100\n\n// \tfmt.Printf(\"%d %d %d %d %d %d\\n\", x1, y1, x2, y2, x3, y3)\n\n// }\n", "language": "Go", "metadata": {"date": 1563806083, "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/s110451634.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s110451634", "user_id": "u710190793"}, "prompt_components": {"gold_output": "1 0 2 2 0 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 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\n\ts := nextInt()\n\n\tx1, x2, x3 := 0, 0, 0\n\ty1, y2, y3 := 0, 0, 0\n\n\tx2 = 1000000000\n\ty2 = 1\n\ty3 = s / x2\n\tx3 = s % x2\n\tfmt.Printf(\"%d %d %d %d %d %d\\n\", x1, y1, x2, y2, x3, y3)\n\n}\n\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n\n// \ts := nextInt()\n\n// \tx1, x2, x3 := 0, 0, 0\n// \ty1, y2, y3 := 0, 0, 0\n\n// \tvar y23 int\n// \tfor i := 1; ; i++ {\n// \t\tif s%i == 0 && s/i >= 2 {\n// \t\t\ty23 = s / i\n// \t\t\tx1 = i\n// \t\t\tbreak\n// \t\t}\n// \t}\n\n// \ty3 = 0\n// \ty2 = y23 + y3\n// \ty1 = y2 + 100\n\n// \tfmt.Printf(\"%d %d %d %d %d %d\\n\", x1, y1, x2, y2, x3, y3)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 845, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s125457662", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var r int\n fmt.Scan(&r)\n \n fmt.Println(3 * r * r)\n}", "language": "Go", "metadata": {"date": 1570067439, "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/s125457662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s125457662", "user_id": "u195309147"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var r int\n fmt.Scan(&r)\n \n fmt.Println(3 * r * r)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 98, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s333748698", "group_id": "codeNet:p02969", "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\treader := bufio.NewReader(os.Stdin)\n\ttmp, _ := reader.ReadString('\\n')\n\ttmp = strings.Trim(tmp, \"\\n\")\n\n\ta, _ := strconv.ParseInt(tmp, 10, 64)\n\n\tfmt.Println(3 * a * a)\n}\n", "language": "Go", "metadata": {"date": 1563671700, "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/s333748698.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s333748698", "user_id": "u549085051"}, "prompt_components": {"gold_output": "48\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\treader := bufio.NewReader(os.Stdin)\n\ttmp, _ := reader.ReadString('\\n')\n\ttmp = strings.Trim(tmp, \"\\n\")\n\n\ta, _ := strconv.ParseInt(tmp, 10, 64)\n\n\tfmt.Println(3 * a * a)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 254, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s724107051", "group_id": "codeNet:p02969", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main(){\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tvar s string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\t// ここからロジック\n\tn, _ := strconv.ParseInt(s, 10, 64)\n\tans := 3 * n * n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1563670960, "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/s724107051.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s724107051", "user_id": "u640431305"}, "prompt_components": {"gold_output": "48\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 sc = bufio.NewScanner(os.Stdin)\n\tvar s string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\t// ここからロジック\n\tn, _ := strconv.ParseInt(s, 10, 64)\n\tans := 3 * n * n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s375426940", "group_id": "codeNet:p02969", "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\tr := io.Int()\n\n\tfmt.Println(r * r * 3)\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", "language": "Go", "metadata": {"date": 1563670847, "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/s375426940.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s375426940", "user_id": "u134387396"}, "prompt_components": {"gold_output": "48\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\tr := io.Int()\n\n\tfmt.Println(r * r * 3)\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", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4909, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s159923062", "group_id": "codeNet:p02971", "input_text": "package main\n\nimport (\n \"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n\n\ta := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n\t}\n\ttmp := make([]int, n)\n\tfor idx, value := range(a) {\n\t\ttmp[idx] = value\n\t}\n sort.Ints(a)\n\tmax1 := a[len(a)-1]\n\tmax2 := a[len(a)-2]\n\n\tfor _, x := range(tmp) {\n\t\tif max1 == max2 {\n\t\t\tfmt.Println(max1)\n\t\t} else {\n\t\t\tif x != max1 {\n\t\t\t\tfmt.Println(max1)\n\t\t\t} else { \n\t\t\t\tfmt.Println(max2)\n\t\t\t}\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1563673613, "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/s159923062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s159923062", "user_id": "u750378652"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n\n\ta := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n\t}\n\ttmp := make([]int, n)\n\tfor idx, value := range(a) {\n\t\ttmp[idx] = value\n\t}\n sort.Ints(a)\n\tmax1 := a[len(a)-1]\n\tmax2 := a[len(a)-2]\n\n\tfor _, x := range(tmp) {\n\t\tif max1 == max2 {\n\t\t\tfmt.Println(max1)\n\t\t} else {\n\t\t\tif x != max1 {\n\t\t\t\tfmt.Println(max1)\n\t\t\t} else { \n\t\t\t\tfmt.Println(max2)\n\t\t\t}\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 468, "cpu_time_ms": 1396, "memory_kb": 8064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s965138572", "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} else if n%3 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tx := a[0]\n\ty := a[1]\n\tz := a[2]\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": 1563167489, "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/s965138572.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s965138572", "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} else if n%3 != 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tx := a[0]\n\ty := a[1]\n\tz := a[2]\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1383, "cpu_time_ms": 21, "memory_kb": 6528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s340291139", "group_id": "codeNet:p02981", "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\nvar (\n\tN int\n\tA int\n\tB int\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, A, B = nextInt(), nextInt(), nextInt()\n\n\tfmt.Println(min(N*A, B))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1562548251, "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/s340291139.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s340291139", "user_id": "u710190793"}, "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 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\nvar (\n\tN int\n\tA int\n\tB int\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, A, B = nextInt(), nextInt(), nextInt()\n\n\tfmt.Println(min(N*A, B))\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 468, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s645502557", "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\tt := n * a\n\tif t > b {\n\t\tfmt.Println(b)\n\t} else {\n\t\tfmt.Println(t)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1562547725, "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/s645502557.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645502557", "user_id": "u102310764"}, "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\tt := n * a\n\tif t > b {\n\t\tfmt.Println(b)\n\t} else {\n\t\tfmt.Println(t)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 155, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218398342", "group_id": "codeNet:p02982", "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\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, d := scanInt(sc), scanInt(sc)\n\tds := make([][]int, n)\n\tfor i := range loop0(n) {\n\t\tds[i] = make([]int, d)\n\t\tfor j := range loop0(d) {\n\t\t\tds[i][j] = scanInt(sc)\n\t\t}\n\t}\n\tnum := 0\n\tt := squreNums(160000)\n\tfor i := range loop0(n) {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum := 0\n\t\t\tfor k := 0; k < d; k++ {\n\t\t\t\tdf := ds[i][k] - ds[j][k]\n\t\t\t\tsum += df * df\n\t\t\t}\n\t\t\tif t[sum] {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\treturn num\n}\n\nfunc loop0(n int) chan int {\n\treturn loop(0, n-1, 1)\n}\n\nfunc loop1(n int) chan int {\n\treturn loop(1, n, 1)\n}\n\nfunc loop(s, e, d int) chan int {\n\tch := make(chan int)\n\tgo func() {\n\t\tfor i := s; i <= e; i += d {\n\t\t\tch <- i\n\t\t}\n\t\tclose(ch)\n\t}()\n\treturn ch\n}\n\nfunc squreNums(max int) []bool {\n\tt := make([]bool, max)\n\tfor i := 1; i*i <= max; i++ {\n\t\tt[i*i] = true\n\t}\n\treturn t\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1593054750, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s218398342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s218398342", "user_id": "u623007471"}, "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)\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, d := scanInt(sc), scanInt(sc)\n\tds := make([][]int, n)\n\tfor i := range loop0(n) {\n\t\tds[i] = make([]int, d)\n\t\tfor j := range loop0(d) {\n\t\t\tds[i][j] = scanInt(sc)\n\t\t}\n\t}\n\tnum := 0\n\tt := squreNums(160000)\n\tfor i := range loop0(n) {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tsum := 0\n\t\t\tfor k := 0; k < d; k++ {\n\t\t\t\tdf := ds[i][k] - ds[j][k]\n\t\t\t\tsum += df * df\n\t\t\t}\n\t\t\tif t[sum] {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\treturn num\n}\n\nfunc loop0(n int) chan int {\n\treturn loop(0, n-1, 1)\n}\n\nfunc loop1(n int) chan int {\n\treturn loop(1, n, 1)\n}\n\nfunc loop(s, e, d int) chan int {\n\tch := make(chan int)\n\tgo func() {\n\t\tfor i := s; i <= e; i += d {\n\t\t\tch <- i\n\t\t}\n\t\tclose(ch)\n\t}()\n\treturn ch\n}\n\nfunc squreNums(max int) []bool {\n\tt := make([]bool, max)\n\tfor i := 1; i*i <= max; i++ {\n\t\tt[i*i] = true\n\t}\n\treturn t\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1476, "cpu_time_ms": 12, "memory_kb": 1988}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s919542793", "group_id": "codeNet:p02982", "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\tX := make([][]float64, N)\n\tfor i := 0; i < N; i++ {\n\t\tX[i] = make([]float64, D)\n\t\tfor j := 0; j < D; j++ {\n\t\t\tfmt.Scan(&X[i][j])\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tsum := 0.0\n\t\t\tfor d := 0; d < D; d++ {\n\t\t\t\ty := X[i][d]\n\t\t\t\tz := X[j][d]\n\t\t\t\tsum += math.Pow(y-z, 2)\n\t\t\t}\n\t\t\tdd := math.Sqrt(sum)\n\t\t\tif dd == float64(int64(dd)) {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562548501, "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/s919542793.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s919542793", "user_id": "u649037611"}, "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 int\n\tfmt.Scan(&N, &D)\n\n\tX := make([][]float64, N)\n\tfor i := 0; i < N; i++ {\n\t\tX[i] = make([]float64, D)\n\t\tfor j := 0; j < D; j++ {\n\t\t\tfmt.Scan(&X[i][j])\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tsum := 0.0\n\t\t\tfor d := 0; d < D; d++ {\n\t\t\t\ty := X[i][d]\n\t\t\t\tz := X[j][d]\n\t\t\t\tsum += math.Pow(y-z, 2)\n\t\t\t}\n\t\t\tdd := math.Sqrt(sum)\n\t\t\tif dd == float64(int64(dd)) {\n\t\t\t\tans++\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 504, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s195659330", "group_id": "codeNet:p02984", "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\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tx := 0\n\tfor i := 0; i < n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tx += a[i]\n\t\t} else {\n\t\t\tx -= a[i]\n\t\t}\n\t}\n\n\tans := make([]int, n)\n\tans[0] = x / 2\n\tfor i := 0; i < n-1; i++ {\n\t\tans[i+1] = a[i] - ans[i]\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tans[i] *= 2\n\t}\n\n\tfmt.Println(strings.Trim(fmt.Sprint(ans), \"[]\"))\n}\n", "language": "Go", "metadata": {"date": 1581566924, "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/s195659330.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s195659330", "user_id": "u902409225"}, "prompt_components": {"gold_output": "4 0 4\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\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tx := 0\n\tfor i := 0; i < n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tx += a[i]\n\t\t} else {\n\t\t\tx -= a[i]\n\t\t}\n\t}\n\n\tans := make([]int, n)\n\tans[0] = x / 2\n\tfor i := 0; i < n-1; i++ {\n\t\tans[i+1] = a[i] - ans[i]\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tans[i] *= 2\n\t}\n\n\tfmt.Println(strings.Trim(fmt.Sprint(ans), \"[]\"))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 758, "memory_kb": 9856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s413021890", "group_id": "codeNet:p02987", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tm := make(map[byte]int, 0)\n\tfor i := 0; i < 4; i++ {\n\t\tm[s[i]]++\n\t}\n\t\n\tfor i := 0; i < 4; i++ {\n\t\tif len(m) > 2 || m[s[i]] > 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1564718774, "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/s413021890.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s413021890", "user_id": "u863279562"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tm := make(map[byte]int, 0)\n\tfor i := 0; i < 4; i++ {\n\t\tm[s[i]]++\n\t}\n\t\n\tfor i := 0; i < 4; i++ {\n\t\tif len(m) > 2 || m[s[i]] > 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 265, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s176574432", "group_id": "codeNet:p02987", "input_text": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n \"strings\"\n)\n\n\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans := \"No\"\n s = SortString(s)\n if s[0]==s[1] && s[1]!=s[2] && s[2]==s[3]{\n ans = \"Yes\"\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; i P[i] || P[i] < P[i+1] {\n\t\t\tif P[i-1] < P[i] || P[i] > P[i+1] {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tp.PrintInt(cnt)\n}\n\nvar (\n\tdebug bool\n\toutput string\n)\n\nfunc main() {\n\tflag.BoolVar(&debug, \"debug\", false, \"Print debug logs\")\n\tflag.BoolVar(&debug, \"d\", false, \"Print debug logs\")\n\tflag.StringVar(&output, \"output\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.StringVar(&output, \"o\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.Parse()\n\n\tif debug {\n\t\tout := os.Stdout\n\t\tif output != \"stdout\" {\n\t\t\tlogfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer logfile.Close()\n\t\t\tout = logfile\n\t\t}\n\t\tlog.SetOutput(out)\n\t} else {\n\t\tlog.SetOutput(ioutil.Discard)\n\t}\n\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tp.solve()\n\n\tif err := p.out.Flush(); err != nil {\n\t\tpanic(err)\n\t}\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\\n\", 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) Printfln(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, fmt.Sprintf(\"%v\\n\", 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}\n", "language": "Go", "metadata": {"date": 1561857573, "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/s298314200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s298314200", "user_id": "u610608464"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc (p *problem) solve() {\n\tN := p.NextInt()\n\tP := p.NextInts()\n\tend := N - 1\n\tvar cnt int\n\tfor i := 1; i < end; i++ {\n\t\tif P[i-1] > P[i] || P[i] < P[i+1] {\n\t\t\tif P[i-1] < P[i] || P[i] > P[i+1] {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tp.PrintInt(cnt)\n}\n\nvar (\n\tdebug bool\n\toutput string\n)\n\nfunc main() {\n\tflag.BoolVar(&debug, \"debug\", false, \"Print debug logs\")\n\tflag.BoolVar(&debug, \"d\", false, \"Print debug logs\")\n\tflag.StringVar(&output, \"output\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.StringVar(&output, \"o\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.Parse()\n\n\tif debug {\n\t\tout := os.Stdout\n\t\tif output != \"stdout\" {\n\t\t\tlogfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer logfile.Close()\n\t\t\tout = logfile\n\t\t}\n\t\tlog.SetOutput(out)\n\t} else {\n\t\tlog.SetOutput(ioutil.Discard)\n\t}\n\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tp.solve()\n\n\tif err := p.out.Flush(); err != nil {\n\t\tpanic(err)\n\t}\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\\n\", 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) Printfln(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, fmt.Sprintf(\"%v\\n\", 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}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2196, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s009486381", "group_id": "codeNet:p02989", "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 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 := scanInt()\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\td[i] = scanInt()\n\t}\n\tsort.Ints(d)\n\n\tfmt.Println(d[N/2] - d[N/2-1])\n}\n", "language": "Go", "metadata": {"date": 1590264064, "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/s009486381.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s009486381", "user_id": "u941434715"}, "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 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 := scanInt()\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\td[i] = scanInt()\n\t}\n\tsort.Ints(d)\n\n\tfmt.Println(d[N/2] - d[N/2-1])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 40, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s141345252", "group_id": "codeNet:p02989", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc readf(sc *bufio.Scanner) float64 {\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\n\td := make([]int, n)\n\tfor i := range d {\n\t\tsc.Scan()\n\t\td[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tsort.Ints(d)\n\n\thalf := len(d) / 2\n\tfmt.Println(d[half] - d[half-1])\n}\n", "language": "Go", "metadata": {"date": 1586123736, "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/s141345252.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141345252", "user_id": "u183912232"}, "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 readf(sc *bufio.Scanner) float64 {\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\n\td := make([]int, n)\n\tfor i := range d {\n\t\tsc.Scan()\n\t\td[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tsort.Ints(d)\n\n\thalf := len(d) / 2\n\tfmt.Println(d[half] - d[half-1])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 40, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218680607", "group_id": "codeNet:p02989", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// (l, r]\nfunc lowerbound(a []int, k int) int {\n\tl := -1\n\tr := len(a)\n\tfor r-l > 1 {\n\t\tmid := (l + r) / 2\n\t\tif a[mid] >= k {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid\n\t\t}\n\t}\n\treturn r\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([]int, n)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Ints(a)\n\tans := 0\n\tfor k := 1; k <= a[n-1]; k++ {\n\t\tif lowerbound(a, k) == n/2 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562030686, "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/s218680607.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s218680607", "user_id": "u150861392"}, "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// (l, r]\nfunc lowerbound(a []int, k int) int {\n\tl := -1\n\tr := len(a)\n\tfor r-l > 1 {\n\t\tmid := (l + r) / 2\n\t\tif a[mid] >= k {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid\n\t\t}\n\t}\n\treturn r\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([]int, n)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Ints(a)\n\tans := 0\n\tfor k := 1; k <= a[n-1]; k++ {\n\t\tif lowerbound(a, k) == n/2 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 47, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s496035587", "group_id": "codeNet:p02989", "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\n// 一行読み出し\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 文字列リバース関数\nfunc strReverse(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// スペース区切りの文字列から int のスライスを得る\nfunc intSlice(s string) []int {\n\tss := strings.Split(s, \" \")\n\tres := make([]int, len(ss))\n\tfor i, v := range ss {\n\t\tiv, _ := strconv.Atoi(v)\n\t\tres[i] = iv\n\t}\n\n\treturn res\n}\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := nextLine()\n\tns := intSlice(s)\n\n\tsort.Ints(ns)\n\n\tans := 0\n\tif ns[n/2-1] == ns[n/2] {\n\t\t// 真ん中の2つの値が同じ場合等しくわけられない\n\t\tans = 0\n\t} else {\n\t\tans = ns[n/2] - ns[n/2-1]\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1561929678, "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/s496035587.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s496035587", "user_id": "u494568266"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\n\n// 一行読み出し\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 文字列リバース関数\nfunc strReverse(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// スペース区切りの文字列から int のスライスを得る\nfunc intSlice(s string) []int {\n\tss := strings.Split(s, \" \")\n\tres := make([]int, len(ss))\n\tfor i, v := range ss {\n\t\tiv, _ := strconv.Atoi(v)\n\t\tres[i] = iv\n\t}\n\n\treturn res\n}\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\ts := nextLine()\n\tns := intSlice(s)\n\n\tsort.Ints(ns)\n\n\tans := 0\n\tif ns[n/2-1] == ns[n/2] {\n\t\t// 真ん中の2つの値が同じ場合等しくわけられない\n\t\tans = 0\n\t} else {\n\t\tans = ns[n/2] - ns[n/2-1]\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 901, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s888597105", "group_id": "codeNet:p02989", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\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 scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\td := scanNums(n)\n\tsort.Ints(d)\n\tif d[(n/2) - 1] == d[n/2] {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(d[n/2] - d[(n/2) - 1])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561858904, "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/s888597105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s888597105", "user_id": "u651597583"}, "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\"sort\"\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 scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\td := scanNums(n)\n\tsort.Ints(d)\n\tif d[(n/2) - 1] == d[n/2] {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(d[n/2] - d[(n/2) - 1])\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 536, "cpu_time_ms": 43, "memory_kb": 5760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s894176129", "group_id": "codeNet:p02989", "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\tnn := make([]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnn = append(nn, nextInt())\n\t}\n\n\tsort.Sort(sort.IntSlice(nn))\n\th := n / 2\n\n\tdivless := nn[h-1]\n\tdivmore := nn[h]\n\n\tfmt.Println(divmore - divless)\n}\n\nfunc IntReverse(vv []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(vv)))\n}\n", "language": "Go", "metadata": {"date": 1561857935, "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/s894176129.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s894176129", "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\tnn := make([]int, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnn = append(nn, nextInt())\n\t}\n\n\tsort.Sort(sort.IntSlice(nn))\n\th := n / 2\n\n\tdivless := nn[h-1]\n\tdivmore := nn[h]\n\n\tfmt.Println(divmore - divless)\n}\n\nfunc IntReverse(vv []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(vv)))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 634, "cpu_time_ms": 40, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s501828341", "group_id": "codeNet:p02990", "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\nvar mod int64 = 1e9 + 7\n\nfunc main() {\n\tn := readInt()\n\tk := readInt()\n\tdp := make([][]int64, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, n+1)\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = 1\n\t\t}\n\t}\n\n\tfor i := 2; i < n+1; i++ {\n\t\tfor j := 1; j < n+1; j++ {\n\t\t\tif i-1 < j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % mod\n\t\t}\n\t}\n\tfor i := 1; i <= k; i++ {\n\t\tans := dp[n-k+1][i] * dp[k-1][i-1]\n\t\tfmt.Println(ans % mod)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561922480, "filename_ext": "go", "original_language": "Go (1.6)", "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/s501828341.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s501828341", "user_id": "u295946532"}, "prompt_components": {"gold_output": "3\n6\n1\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\nvar mod int64 = 1e9 + 7\n\nfunc main() {\n\tn := readInt()\n\tk := readInt()\n\tdp := make([][]int64, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, n+1)\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = 1\n\t\t}\n\t}\n\n\tfor i := 2; i < n+1; i++ {\n\t\tfor j := 1; j < n+1; j++ {\n\t\t\tif i-1 < j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i][j] = (dp[i-1][j] + dp[i-1][j-1]) % mod\n\t\t}\n\t}\n\tfor i := 1; i <= k; i++ {\n\t\tans := dp[n-k+1][i] * dp[k-1][i-1]\n\t\tfmt.Println(ans % mod)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2750, "cpu_time_ms": 81, "memory_kb": 33920}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s446353787", "group_id": "codeNet:p02990", "input_text": "package main\n\nimport \"fmt\"\n\nconst mod = 1000000007\n\nfunc cmb(a, b int) int {\n\tans := 1\n\tfor i := 1; i <= b; i++ {\n\t\tans *= (a - i + 1)\n\t\tans /= i\n\t\tans %= mod\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tfor i := 1; i <= k; i++ {\n\t\tfmt.Println(cmb(n-k+1, i) * cmb(k-1, i-1) % mod)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561895258, "filename_ext": "go", "original_language": "Go (1.6)", "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/s446353787.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s446353787", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n6\n1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nconst mod = 1000000007\n\nfunc cmb(a, b int) int {\n\tans := 1\n\tfor i := 1; i <= b; i++ {\n\t\tans *= (a - i + 1)\n\t\tans /= i\n\t\tans %= mod\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tfor i := 1; i <= k; i++ {\n\t\tfmt.Println(cmb(n-k+1, i) * cmb(k-1, i-1) % mod)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 307, "cpu_time_ms": 82, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s086723288", "group_id": "codeNet:p02990", "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\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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n, k int\n\nvar memo [4000 + 5]int\nvar modMemo [4000 + 5]int\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\n\tinitMemos()\n\n\t// for i := 0; i < k; i++ {\n\tfor i := 1; i <= k; i++ {\n\t\tbluePattern := i\n\t\tblueNokori := k - i\n\t\tredPattern := (i - 1) + 2\n\t\tredNokori := (n - k) - (i - 1)\n\n\t\tif blueNokori < 0 || redNokori < 0 {\n\t\t\tfmt.Println(0)\n\t\t\tcontinue\n\t\t}\n\n\t\tans := 1\n\t\tans *= sub(redPattern, redNokori)\n\t\tans %= MOD\n\t\tans *= sub(bluePattern, blueNokori)\n\t\tans %= MOD\n\n\t\tfmt.Println(ans)\n\t}\n}\n\n// 重複組合せ\nfunc sub(n, r int) int {\n\treturn combination(n+r-1, r)\n}\n\nfunc combination(n, r int) int {\n\t// if r > n-r {\n\t// \treturn combination(n, n-r)\n\t// }\n\n\tres := 1\n\tres *= memo[n]\n\tres %= MOD\n\tres *= modMemo[r]\n\tres %= MOD\n\tres *= modMemo[n-r]\n\tres %= MOD\n\n\treturn res\n}\n\n// 初期\nfunc initMemos() {\n\tfor i := 0; i <= 4002; i++ {\n\t\tif i == 0 {\n\t\t\tmemo[i] = 1\n\t\t\tmodMemo[i] = ModInv(memo[i], MOD)\n\t\t\tcontinue\n\t\t}\n\n\t\tnum := i * memo[i-1]\n\t\tnum %= MOD\n\t\tmemo[i] = num\n\t\tmodMemo[i] = ModInv(memo[i], MOD)\n\t}\n}\n\n// ModInv returns $a^{-1} mod m$ by Fermat's little theorem.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc ModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\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// MODはとったか?\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 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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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", "language": "Go", "metadata": {"date": 1561860203, "filename_ext": "go", "original_language": "Go (1.6)", "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/s086723288.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s086723288", "user_id": "u103600314"}, "prompt_components": {"gold_output": "3\n6\n1\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\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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n, k int\n\nvar memo [4000 + 5]int\nvar modMemo [4000 + 5]int\n\nfunc main() {\n\tn, k = ReadInt(), ReadInt()\n\n\tinitMemos()\n\n\t// for i := 0; i < k; i++ {\n\tfor i := 1; i <= k; i++ {\n\t\tbluePattern := i\n\t\tblueNokori := k - i\n\t\tredPattern := (i - 1) + 2\n\t\tredNokori := (n - k) - (i - 1)\n\n\t\tif blueNokori < 0 || redNokori < 0 {\n\t\t\tfmt.Println(0)\n\t\t\tcontinue\n\t\t}\n\n\t\tans := 1\n\t\tans *= sub(redPattern, redNokori)\n\t\tans %= MOD\n\t\tans *= sub(bluePattern, blueNokori)\n\t\tans %= MOD\n\n\t\tfmt.Println(ans)\n\t}\n}\n\n// 重複組合せ\nfunc sub(n, r int) int {\n\treturn combination(n+r-1, r)\n}\n\nfunc combination(n, r int) int {\n\t// if r > n-r {\n\t// \treturn combination(n, n-r)\n\t// }\n\n\tres := 1\n\tres *= memo[n]\n\tres %= MOD\n\tres *= modMemo[r]\n\tres %= MOD\n\tres *= modMemo[n-r]\n\tres %= MOD\n\n\treturn res\n}\n\n// 初期\nfunc initMemos() {\n\tfor i := 0; i <= 4002; i++ {\n\t\tif i == 0 {\n\t\t\tmemo[i] = 1\n\t\t\tmodMemo[i] = ModInv(memo[i], MOD)\n\t\t\tcontinue\n\t\t}\n\n\t\tnum := i * memo[i-1]\n\t\tnum %= MOD\n\t\tmemo[i] = num\n\t\tmodMemo[i] = ModInv(memo[i], MOD)\n\t}\n}\n\n// ModInv returns $a^{-1} mod m$ by Fermat's little theorem.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc ModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\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// MODはとったか?\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 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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8811, "cpu_time_ms": 9, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s720790448", "group_id": "codeNet:p02991", "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\"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\tm := getNextInt(scanner)\n\tg := make([][]int, n)\n\tgg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0)\n\t\tgg[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\t\tg[u] = append(g[u], v)\n\t}\n\n\ts := getNextInt(scanner) - 1\n\tt := getNextInt(scanner) - 1\n\n\tvar q [4][]int\n\tfor i := 0; i < 4; i++ {\n\t\tq[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tq[j] = q[j][:0]\n\t\t}\n\t\tq[0] = append(q[0], i)\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfor _, from := range q[j] {\n\t\t\t\tfor _, to := range g[from] {\n\t\t\t\t\tq[j+1] = append(q[j+1], to)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort.Ints(q[3])\n\t\tprev := -1\n\t\tfor _, to := range q[3] {\n\t\t\tif prev == to {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif i != to {\n\t\t\t\tgg[i] = append(gg[i], to)\n\t\t\t}\n\t\t\tprev = to\n\t\t}\n\t}\n\tnodes := &Nodes{}\n\theap.Init(nodes)\n\theap.Push(nodes, Node{\n\t\ti: s,\n\t\tcost: 0,\n\t})\n\tdd := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdd[i] = math.MaxInt32\n\t}\n\tvisited := make([]int, n)\n\tfor nodes.Len() > 0 {\n\t\tp := heap.Pop(nodes).(Node)\n\t\tif dd[p.i] < p.cost {\n\t\t\tcontinue\n\t\t}\n\t\tdd[p.i] = p.cost\n\t\tvisited[p.i] = 1\n\t\tfor _, to := range gg[p.i] {\n\t\t\tif visited[to] == 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\theap.Push(nodes, Node{\n\t\t\t\ti: to,\n\t\t\t\tcost: p.cost + 1,\n\t\t\t})\n\t\t}\n\t}\n\n\tans := dd[t]\n\tif ans == math.MaxInt32 {\n\t\tans = -1\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype Node struct {\n\ti, cost int\n}\n\ntype Nodes []Node\n\nfunc (h Nodes) Len() int { return len(h) }\nfunc (h Nodes) Less(i, j int) bool { return h[i].cost < h[j].cost }\nfunc (h Nodes) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *Nodes) Push(x interface{}) {\n\t*h = append(*h, x.(Node))\n}\nfunc (h *Nodes) 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": 1575922445, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02991.html", "problem_id": "p02991", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02991/input.txt", "sample_output_relpath": "derived/input_output/data/p02991/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02991/Go/s720790448.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s720790448", "user_id": "u150542210"}, "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\"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\tm := getNextInt(scanner)\n\tg := make([][]int, n)\n\tgg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0)\n\t\tgg[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\t\tg[u] = append(g[u], v)\n\t}\n\n\ts := getNextInt(scanner) - 1\n\tt := getNextInt(scanner) - 1\n\n\tvar q [4][]int\n\tfor i := 0; i < 4; i++ {\n\t\tq[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tq[j] = q[j][:0]\n\t\t}\n\t\tq[0] = append(q[0], i)\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfor _, from := range q[j] {\n\t\t\t\tfor _, to := range g[from] {\n\t\t\t\t\tq[j+1] = append(q[j+1], to)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort.Ints(q[3])\n\t\tprev := -1\n\t\tfor _, to := range q[3] {\n\t\t\tif prev == to {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif i != to {\n\t\t\t\tgg[i] = append(gg[i], to)\n\t\t\t}\n\t\t\tprev = to\n\t\t}\n\t}\n\tnodes := &Nodes{}\n\theap.Init(nodes)\n\theap.Push(nodes, Node{\n\t\ti: s,\n\t\tcost: 0,\n\t})\n\tdd := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdd[i] = math.MaxInt32\n\t}\n\tvisited := make([]int, n)\n\tfor nodes.Len() > 0 {\n\t\tp := heap.Pop(nodes).(Node)\n\t\tif dd[p.i] < p.cost {\n\t\t\tcontinue\n\t\t}\n\t\tdd[p.i] = p.cost\n\t\tvisited[p.i] = 1\n\t\tfor _, to := range gg[p.i] {\n\t\t\tif visited[to] == 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\theap.Push(nodes, Node{\n\t\t\t\ti: to,\n\t\t\t\tcost: p.cost + 1,\n\t\t\t})\n\t\t}\n\t}\n\n\tans := dd[t]\n\tif ans == math.MaxInt32 {\n\t\tans = -1\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\ntype Node struct {\n\ti, cost int\n}\n\ntype Nodes []Node\n\nfunc (h Nodes) Len() int { return len(h) }\nfunc (h Nodes) Less(i, j int) bool { return h[i].cost < h[j].cost }\nfunc (h Nodes) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *Nodes) Push(x interface{}) {\n\t*h = append(*h, x.(Node))\n}\nfunc (h *Nodes) 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 : 500 points\n\nProblem Statement\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G.\nG consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.\n\nFirst, Ken stands on Vertex S. He wants to reach Vertex T by repeating ken-ken-pa. In one ken-ken-pa, he does the following exactly three times: follow an edge pointing from the vertex on which he is standing.\n\nDetermine if he can reach Vertex T by repeating ken-ken-pa. If the answer is yes, find the minimum number of ken-ken-pa needed to reach Vertex T. Note that visiting Vertex T in the middle of a ken-ken-pa does not count as reaching Vertex T by repeating ken-ken-pa.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq \\min(10^5, N (N-1))\n\n1 \\leq u_i, v_i \\leq N(1 \\leq i \\leq M)\n\nu_i \\neq v_i (1 \\leq i \\leq M)\n\nIf i \\neq j, (u_i, v_i) \\neq (u_j, v_j).\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nu_1 v_1\n:\nu_M v_M\nS T\n\nOutput\n\nIf Ken cannot reach Vertex T from Vertex S by repeating ken-ken-pa, print -1.\nIf he can, print the minimum number of ken-ken-pa needed to reach vertex T.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n\nSample Output 1\n\n2\n\nKen can reach Vertex 3 from Vertex 1 in two ken-ken-pa, as follows: 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 in the first ken-ken-pa, then 4 \\rightarrow 1 \\rightarrow 2 \\rightarrow 3 in the second ken-ken-pa. This is the minimum number of ken-ken-pa needed.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n3 1\n1 2\n\nSample Output 2\n\n-1\n\nAny number of ken-ken-pa will bring Ken back to Vertex 1, so he cannot reach Vertex 2, though he can pass through it in the middle of a ken-ken-pa.\n\nSample Input 3\n\n2 0\n1 2\n\nSample Output 3\n\n-1\n\nVertex S and Vertex T may be disconnected.\n\nSample Input 4\n\n6 8\n1 2\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 6\n1 6\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02991", "source_text": "Score : 500 points\n\nProblem Statement\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G.\nG consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.\n\nFirst, Ken stands on Vertex S. He wants to reach Vertex T by repeating ken-ken-pa. In one ken-ken-pa, he does the following exactly three times: follow an edge pointing from the vertex on which he is standing.\n\nDetermine if he can reach Vertex T by repeating ken-ken-pa. If the answer is yes, find the minimum number of ken-ken-pa needed to reach Vertex T. Note that visiting Vertex T in the middle of a ken-ken-pa does not count as reaching Vertex T by repeating ken-ken-pa.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq \\min(10^5, N (N-1))\n\n1 \\leq u_i, v_i \\leq N(1 \\leq i \\leq M)\n\nu_i \\neq v_i (1 \\leq i \\leq M)\n\nIf i \\neq j, (u_i, v_i) \\neq (u_j, v_j).\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nu_1 v_1\n:\nu_M v_M\nS T\n\nOutput\n\nIf Ken cannot reach Vertex T from Vertex S by repeating ken-ken-pa, print -1.\nIf he can, print the minimum number of ken-ken-pa needed to reach vertex T.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n\nSample Output 1\n\n2\n\nKen can reach Vertex 3 from Vertex 1 in two ken-ken-pa, as follows: 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 in the first ken-ken-pa, then 4 \\rightarrow 1 \\rightarrow 2 \\rightarrow 3 in the second ken-ken-pa. This is the minimum number of ken-ken-pa needed.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n3 1\n1 2\n\nSample Output 2\n\n-1\n\nAny number of ken-ken-pa will bring Ken back to Vertex 1, so he cannot reach Vertex 2, though he can pass through it in the middle of a ken-ken-pa.\n\nSample Input 3\n\n2 0\n1 2\n\nSample Output 3\n\n-1\n\nVertex S and Vertex T may be disconnected.\n\nSample Input 4\n\n6 8\n1 2\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 6\n1 6\n\nSample Output 4\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2972, "cpu_time_ms": 2122, "memory_kb": 416640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218291962", "group_id": "codeNet:p02991", "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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype vert struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t\n\tn,m := scanInt(),scanInt()\n\tg := make([][]int, n)\n\tfor i := 0; i < m; i++ {\n\t\tu,v := scanInt()-1,scanInt()-1\n\t\tg[u] = append(g[u],v)\n\t}\n\n\ts,t := scanInt()-1,scanInt()-1\n\n\tg3 := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg3[i] = append(g3[i], []int{-1,-1,-1}...)\n\t}\n\n\tg3[s][0] = 0\n\n\tqueue := make([]vert, 0)\n\tqueue = append(queue, vert{s,0})\n\tfor ; len(queue) > 0; {\n\t\ta,b := queue[0].a, queue[0].b\n\t\tfor _, e := range g[a] {\n\t\t\tif g3[e][(b+1)%3] != -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tg3[e][(b+1)%3] = g3[a][b]+1\n\t\t\tqueue = append(queue, vert{e,(b+1)%3})\n\t\t}\n\t\tqueue = queue[1:]\n\t}\n\n\tif g3[t][0] == -1 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(g3[t][0]/3)\n\t}\n\n\t// fmt.Println(g3)\n}\n", "language": "Go", "metadata": {"date": 1575349385, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02991.html", "problem_id": "p02991", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02991/input.txt", "sample_output_relpath": "derived/input_output/data/p02991/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02991/Go/s218291962.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s218291962", "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 scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype vert struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t\n\tn,m := scanInt(),scanInt()\n\tg := make([][]int, n)\n\tfor i := 0; i < m; i++ {\n\t\tu,v := scanInt()-1,scanInt()-1\n\t\tg[u] = append(g[u],v)\n\t}\n\n\ts,t := scanInt()-1,scanInt()-1\n\n\tg3 := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg3[i] = append(g3[i], []int{-1,-1,-1}...)\n\t}\n\n\tg3[s][0] = 0\n\n\tqueue := make([]vert, 0)\n\tqueue = append(queue, vert{s,0})\n\tfor ; len(queue) > 0; {\n\t\ta,b := queue[0].a, queue[0].b\n\t\tfor _, e := range g[a] {\n\t\t\tif g3[e][(b+1)%3] != -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tg3[e][(b+1)%3] = g3[a][b]+1\n\t\t\tqueue = append(queue, vert{e,(b+1)%3})\n\t\t}\n\t\tqueue = queue[1:]\n\t}\n\n\tif g3[t][0] == -1 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(g3[t][0]/3)\n\t}\n\n\t// fmt.Println(g3)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G.\nG consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.\n\nFirst, Ken stands on Vertex S. He wants to reach Vertex T by repeating ken-ken-pa. In one ken-ken-pa, he does the following exactly three times: follow an edge pointing from the vertex on which he is standing.\n\nDetermine if he can reach Vertex T by repeating ken-ken-pa. If the answer is yes, find the minimum number of ken-ken-pa needed to reach Vertex T. Note that visiting Vertex T in the middle of a ken-ken-pa does not count as reaching Vertex T by repeating ken-ken-pa.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq \\min(10^5, N (N-1))\n\n1 \\leq u_i, v_i \\leq N(1 \\leq i \\leq M)\n\nu_i \\neq v_i (1 \\leq i \\leq M)\n\nIf i \\neq j, (u_i, v_i) \\neq (u_j, v_j).\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nu_1 v_1\n:\nu_M v_M\nS T\n\nOutput\n\nIf Ken cannot reach Vertex T from Vertex S by repeating ken-ken-pa, print -1.\nIf he can, print the minimum number of ken-ken-pa needed to reach vertex T.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n\nSample Output 1\n\n2\n\nKen can reach Vertex 3 from Vertex 1 in two ken-ken-pa, as follows: 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 in the first ken-ken-pa, then 4 \\rightarrow 1 \\rightarrow 2 \\rightarrow 3 in the second ken-ken-pa. This is the minimum number of ken-ken-pa needed.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n3 1\n1 2\n\nSample Output 2\n\n-1\n\nAny number of ken-ken-pa will bring Ken back to Vertex 1, so he cannot reach Vertex 2, though he can pass through it in the middle of a ken-ken-pa.\n\nSample Input 3\n\n2 0\n1 2\n\nSample Output 3\n\n-1\n\nVertex S and Vertex T may be disconnected.\n\nSample Input 4\n\n6 8\n1 2\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 6\n1 6\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02991", "source_text": "Score : 500 points\n\nProblem Statement\n\nKen loves ken-ken-pa (Japanese version of hopscotch). Today, he will play it on a directed graph G.\nG consists of N vertices numbered 1 to N, and M edges. The i-th edge points from Vertex u_i to Vertex v_i.\n\nFirst, Ken stands on Vertex S. He wants to reach Vertex T by repeating ken-ken-pa. In one ken-ken-pa, he does the following exactly three times: follow an edge pointing from the vertex on which he is standing.\n\nDetermine if he can reach Vertex T by repeating ken-ken-pa. If the answer is yes, find the minimum number of ken-ken-pa needed to reach Vertex T. Note that visiting Vertex T in the middle of a ken-ken-pa does not count as reaching Vertex T by repeating ken-ken-pa.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq \\min(10^5, N (N-1))\n\n1 \\leq u_i, v_i \\leq N(1 \\leq i \\leq M)\n\nu_i \\neq v_i (1 \\leq i \\leq M)\n\nIf i \\neq j, (u_i, v_i) \\neq (u_j, v_j).\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nu_1 v_1\n:\nu_M v_M\nS T\n\nOutput\n\nIf Ken cannot reach Vertex T from Vertex S by repeating ken-ken-pa, print -1.\nIf he can, print the minimum number of ken-ken-pa needed to reach vertex T.\n\nSample Input 1\n\n4 4\n1 2\n2 3\n3 4\n4 1\n1 3\n\nSample Output 1\n\n2\n\nKen can reach Vertex 3 from Vertex 1 in two ken-ken-pa, as follows: 1 \\rightarrow 2 \\rightarrow 3 \\rightarrow 4 in the first ken-ken-pa, then 4 \\rightarrow 1 \\rightarrow 2 \\rightarrow 3 in the second ken-ken-pa. This is the minimum number of ken-ken-pa needed.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n3 1\n1 2\n\nSample Output 2\n\n-1\n\nAny number of ken-ken-pa will bring Ken back to Vertex 1, so he cannot reach Vertex 2, though he can pass through it in the middle of a ken-ken-pa.\n\nSample Input 3\n\n2 0\n1 2\n\nSample Output 3\n\n-1\n\nVertex S and Vertex T may be disconnected.\n\nSample Input 4\n\n6 8\n1 2\n2 3\n3 4\n4 5\n5 1\n1 4\n1 5\n4 6\n1 6\n\nSample Output 4\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 986, "cpu_time_ms": 107, "memory_kb": 18688}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276023880", "group_id": "codeNet:p02993", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\n\tfmt.Scanln(s)\n\n\tfmt.Println(logic(s))\n}\n\nfunc logic(s string) string {\n\tfor i, c := range s {\n\t\tif len(s)-1 == i {\n\t\t\tcontinue\n\t\t}\n\n\t\tif c == rune(s[i+1]) {\n\t\t\treturn \"Bad\"\n\t\t}\n\t}\n\treturn \"Good\"\n}\n", "language": "Go", "metadata": {"date": 1573181348, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/Go/s276023880.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s276023880", "user_id": "u434868408"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\n\tfmt.Scanln(s)\n\n\tfmt.Println(logic(s))\n}\n\nfunc logic(s string) string {\n\tfor i, c := range s {\n\t\tif len(s)-1 == i {\n\t\t\tcontinue\n\t\t}\n\n\t\tif c == rune(s[i+1]) {\n\t\t\treturn \"Bad\"\n\t\t}\n\t}\n\treturn \"Good\"\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s837939204", "group_id": "codeNet:p02993", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\n\tn := strings.Split(a, \"\")\n\n\tcount := 0\n\tfor i := 0; i < 3; i++ {\n\t\tif n[i] == n[i+1] {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count == 0 {\n\t\tfmt.Println(\"Good\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1565065333, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/Go/s837939204.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s837939204", "user_id": "u262602763"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\n\tn := strings.Split(a, \"\")\n\n\tcount := 0\n\tfor i := 0; i < 3; i++ {\n\t\tif n[i] == n[i+1] {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count == 0 {\n\t\tfmt.Println(\"Good\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256084058", "group_id": "codeNet:p02993", "input_text": "package main\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 main() {\n\tscanner := makeScanner(1024)\n\ts := eGetLine(scanner)\n\n\tlastc := ' '\n\tfor _, c := range s {\n\t\tif lastc == c {\n\t\t\tfmt.Println(\"Bad\")\n\t\t\treturn\n\t\t}\n\t\tlastc = c\n\t}\n\tfmt.Println(\"Good\")\n}\n\n////////////////////////////////////////////////////////////////////////////////\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 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 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 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\tbuf.WriteString(\"[\")\n\tsep := \"\"\n\tfor _, v := range s {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\tsep = \", \"\n\t}\n\tbuf.WriteString(\"]\")\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}\n\n// func min(a []int) int {\n// \tm := a[0]\n// \tfor _, v := range a {\n// \t\tif v < m {\n// \t\t\tm = v\n// \t\t}\n// \t}\n// \treturn m\n// }\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}\nfunc find(n int, a ints) int {\n\tfor i, v := range a {\n\t\tif n == v {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n", "language": "Go", "metadata": {"date": 1561251903, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/Go/s256084058.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s256084058", "user_id": "u663116078"}, "prompt_components": {"gold_output": "Bad\n", "input_to_evaluate": "package main\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 main() {\n\tscanner := makeScanner(1024)\n\ts := eGetLine(scanner)\n\n\tlastc := ' '\n\tfor _, c := range s {\n\t\tif lastc == c {\n\t\t\tfmt.Println(\"Bad\")\n\t\t\treturn\n\t\t}\n\t\tlastc = c\n\t}\n\tfmt.Println(\"Good\")\n}\n\n////////////////////////////////////////////////////////////////////////////////\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 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 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 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\tbuf.WriteString(\"[\")\n\tsep := \"\"\n\tfor _, v := range s {\n\t\tbuf.WriteString(fmt.Sprintf(\"%s%d\", sep, v))\n\t\tsep = \", \"\n\t}\n\tbuf.WriteString(\"]\")\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}\n\n// func min(a []int) int {\n// \tm := a[0]\n// \tfor _, v := range a {\n// \t\tif v < m {\n// \t\t\tm = v\n// \t\t}\n// \t}\n// \treturn m\n// }\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}\nfunc find(n int, a ints) int {\n\tfor i, v := range a {\n\t\tif n == v {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2303, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065458062", "group_id": "codeNet:p02993", "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 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\tfor i := 1; i < 4; i++ {\n\t\tif s[i] == s[i-1] {\n\t\t\tfmt.Fprintln(writer, \"Bad\")\n\t\t\twriter.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, \"Good\")\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1561251775, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02993.html", "problem_id": "p02993", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02993/input.txt", "sample_output_relpath": "derived/input_output/data/p02993/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02993/Go/s065458062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s065458062", "user_id": "u150542210"}, "prompt_components": {"gold_output": "Bad\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 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\tfor i := 1; i < 4; i++ {\n\t\tif s[i] == s[i-1] {\n\t\t\tfmt.Fprintln(writer, \"Bad\")\n\t\t\twriter.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, \"Good\")\n\twriter.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "sample_input": "3776\n"}, "reference_outputs": ["Bad\n"], "source_document_id": "p02993", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe door of Snuke's laboratory is locked with a security code.\n\nThe security code is a 4-digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same.\n\nYou are given the current security code S. If S is hard to enter, print Bad; otherwise, print Good.\n\nConstraints\n\nS is a 4-character string consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is hard to enter, print Bad; otherwise, print Good.\n\nSample Input 1\n\n3776\n\nSample Output 1\n\nBad\n\nThe second and third digits are the same, so 3776 is hard to enter.\n\nSample Input 2\n\n8080\n\nSample Output 2\n\nGood\n\nThere are no two consecutive digits that are the same, so 8080 is not hard to enter.\n\nSample Input 3\n\n1333\n\nSample Output 3\n\nBad\n\nSample Input 4\n\n0024\n\nSample Output 4\n\nBad", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s762889060", "group_id": "codeNet:p02994", "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 = true\n\nfunc main() {\n\tnextReader = newScanner()\n\n\tn := nextInt()\n\tl := nextInt()\n\n\tmin := 0\n\tsums := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tscore := l + i - 1 + 1\n\n\t\tdebugln(i, score)\n\t\tsums += score\n\n\t\tdelta := abs(score)\n\n\t\tif i == 0 || delta < abs(min) {\n\t\t\tmin = score\n\t\t}\n\n\t}\n\n\tfmt.Println(sums - min)\n}\n\nfunc abs(i int) int {\n\treturn int(math.Abs(float64(i)))\n}\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\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", "language": "Go", "metadata": {"date": 1561253588, "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/s762889060.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s762889060", "user_id": "u867254940"}, "prompt_components": {"gold_output": "18\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 = true\n\nfunc main() {\n\tnextReader = newScanner()\n\n\tn := nextInt()\n\tl := nextInt()\n\n\tmin := 0\n\tsums := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tscore := l + i - 1 + 1\n\n\t\tdebugln(i, score)\n\t\tsums += score\n\n\t\tdelta := abs(score)\n\n\t\tif i == 0 || delta < abs(min) {\n\t\t\tmin = score\n\t\t}\n\n\t}\n\n\tfmt.Println(sums - min)\n}\n\nfunc abs(i int) int {\n\treturn int(math.Abs(float64(i)))\n}\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\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1497, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s278843310", "group_id": "codeNet:p02995", "input_text": "//https://atcoder.jp/contests/abc131/tasks/abc131_c\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tA, B, C, D int\n\tanswer int\n)\n\nfunc readVariables() {\n\tA, B, C, D = nextInt(), nextInt(), nextInt(), nextInt()\n}\n\nfunc main() {\n\treadVariables()\n\tif countMultiples(3, 9, 4) != 2 {\n\t\tfmt.Println(countMultiples(3, 9, 4))\n\t}\n\ttotal := B - A + 1\n\tcMultiple := countMultiples(A, B, C)\n\tdMultiple := countMultiples(A, B, D)\n\tcdMultiple := countMultiples(A, B, lcm(C, D))\n\tanswer = total - cMultiple - dMultiple + cdMultiple\n\t// fmt.Println(total, cMultiple, dMultiple, cdMultiple, answer)\n\tfmt.Println(answer)\n}\n\nfunc countMultiples(left, right, divider int) int {\n\tvar first, last int\n\tif left%divider != 0 {\n\t\tfirst = left + divider - left%divider\n\t} else {\n\t\tfirst = left\n\t}\n\tif right%divider != 0 {\n\t\tlast = right - right%divider\n\t} else {\n\t\tlast = right\n\t}\n\tif first > right {\n\t\treturn 0\n\t}\n\treturn (last-first)/divider + 1\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", "language": "Go", "metadata": {"date": 1582699965, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/Go/s278843310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s278843310", "user_id": "u390694622"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "//https://atcoder.jp/contests/abc131/tasks/abc131_c\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tA, B, C, D int\n\tanswer int\n)\n\nfunc readVariables() {\n\tA, B, C, D = nextInt(), nextInt(), nextInt(), nextInt()\n}\n\nfunc main() {\n\treadVariables()\n\tif countMultiples(3, 9, 4) != 2 {\n\t\tfmt.Println(countMultiples(3, 9, 4))\n\t}\n\ttotal := B - A + 1\n\tcMultiple := countMultiples(A, B, C)\n\tdMultiple := countMultiples(A, B, D)\n\tcdMultiple := countMultiples(A, B, lcm(C, D))\n\tanswer = total - cMultiple - dMultiple + cdMultiple\n\t// fmt.Println(total, cMultiple, dMultiple, cdMultiple, answer)\n\tfmt.Println(answer)\n}\n\nfunc countMultiples(left, right, divider int) int {\n\tvar first, last int\n\tif left%divider != 0 {\n\t\tfirst = left + divider - left%divider\n\t} else {\n\t\tfirst = left\n\t}\n\tif right%divider != 0 {\n\t\tlast = right - right%divider\n\t} else {\n\t\tlast = right\n\t}\n\tif first > right {\n\t\treturn 0\n\t}\n\treturn (last-first)/divider + 1\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3202, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s072051517", "group_id": "codeNet:p02995", "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\ta, b, c, d := io.Int(), io.Int(), io.Int(), io.Int()\n\n\tans := calc(a, b, c, d)\n\tfmt.Println(ans)\n}\n\nfunc calc(a int64, b int64, c int64, d int64) int64 {\n\tunderB := b - b/c - b/d + b/LCM(c, d)\n\tunderA := a - 1 - (a-1)/c - (a-1)/d + +(a-1)/LCM(c, d)\n\n\treturn underB - underA\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() 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) 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 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\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", "language": "Go", "metadata": {"date": 1561236403, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/Go/s072051517.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s072051517", "user_id": "u134387396"}, "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\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\ta, b, c, d := io.Int(), io.Int(), io.Int(), io.Int()\n\n\tans := calc(a, b, c, d)\n\tfmt.Println(ans)\n}\n\nfunc calc(a int64, b int64, c int64, d int64) int64 {\n\tunderB := b - b/c - b/d + b/LCM(c, d)\n\tunderA := a - 1 - (a-1)/c - (a-1)/d + +(a-1)/LCM(c, d)\n\n\treturn underB - underA\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() 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) 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 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\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5166, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s872960188", "group_id": "codeNet:p02995", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\tcla := b / c\n\tcsm := a / c\n\tcsum := cla - csm\n\tif a%c == 0 {\n\t\tcsum++\n\t}\n\tdla := b / d\n\tdsm := a / d\n\tdsum := dla - dsm\n\tif a%d == 0 {\n\t\tdsum++\n\t}\n\tlc := lcm(c, d)\n\tela := b / lc\n\tesm := a / lc\n\tesum := ela - esm\n\tif a%d == 0 {\n\t\tesum++\n\t}\n\tfmt.Println(b - a + 1 - csum - dsum + esum)\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", "language": "Go", "metadata": {"date": 1561230922, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02995.html", "problem_id": "p02995", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02995/input.txt", "sample_output_relpath": "derived/input_output/data/p02995/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02995/Go/s872960188.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s872960188", "user_id": "u375977529"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\tcla := b / c\n\tcsm := a / c\n\tcsum := cla - csm\n\tif a%c == 0 {\n\t\tcsum++\n\t}\n\tdla := b / d\n\tdsm := a / d\n\tdsum := dla - dsm\n\tif a%d == 0 {\n\t\tdsum++\n\t}\n\tlc := lcm(c, d)\n\tela := b / lc\n\tesm := a / lc\n\tesum := ela - esm\n\tif a%d == 0 {\n\t\tesum++\n\t}\n\tfmt.Println(b - a + 1 - csum - dsum + esum)\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "sample_input": "4 9 2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02995", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given four integers A, B, C, and D. Find the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nConstraints\n\n1\\leq A\\leq B\\leq 10^{18}\n\n1\\leq C,D\\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the number of integers between A and B (inclusive) that can be evenly divided by neither C nor D.\n\nSample Input 1\n\n4 9 2 3\n\nSample Output 1\n\n2\n\n5 and 7 satisfy the condition.\n\nSample Input 2\n\n10 40 6 8\n\nSample Output 2\n\n23\n\nSample Input 3\n\n314159265358979323 846264338327950288 419716939 937510582\n\nSample Output 3\n\n532105071133627368", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s460698527", "group_id": "codeNet:p02996", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype job struct {\n\ta, b int\n}\ntype js []job\n\nfunc (job js) Len() int {\n\treturn len(job)\n}\nfunc (job js) Less(i, j int) bool {\n\treturn job[i].b < job[j].b\n}\nfunc (job js) Swap(i, j int) {\n\tjob[i], job[j] = job[j], job[i]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tjobs := make([]job, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tjobs[i].a, _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tjobs[i].b, _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(js(jobs))\n\t// fmt.Println(\"N\", N, \"jobs\", jobs)\n\tt := 0\n\tfor i := range jobs {\n\t\tt += jobs[i].a\n\t\tif t > jobs[i].b {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1574845526, "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/s460698527.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s460698527", "user_id": "u196030116"}, "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\ntype job struct {\n\ta, b int\n}\ntype js []job\n\nfunc (job js) Len() int {\n\treturn len(job)\n}\nfunc (job js) Less(i, j int) bool {\n\treturn job[i].b < job[j].b\n}\nfunc (job js) Swap(i, j int) {\n\tjob[i], job[j] = job[j], job[i]\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tjobs := make([]job, N)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tjobs[i].a, _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tjobs[i].b, _ = strconv.Atoi(sc.Text())\n\t}\n\tsort.Sort(js(jobs))\n\t// fmt.Println(\"N\", N, \"jobs\", jobs)\n\tt := 0\n\tfor i := range jobs {\n\t\tt += jobs[i].a\n\t\tif t > jobs[i].b {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 737, "cpu_time_ms": 126, "memory_kb": 6272}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s267767031", "group_id": "codeNet:p02996", "input_text": "package main\n\nimport (\n\t\"container/heap\"\n\t\"fmt\"\n)\n\ntype Job struct {\n\tA, B int\n}\n\nfunc main() {\n\t// N := readInt()\n\tvar N int\n\tfmt.Scan(&N)\n\tJ := make([]Job, N)\n\tvar a,b int\n\tfor i := range J {\n\t\tfmt.Scan(&a, &b)\n\t\tJ[i].A = a\n\t\tJ[i].B = b\n\t\t/*\n\t\tJ[i].A = readInt()\n\t\tJ[i].B = readInt()\n\t\t*/\n\t}\n\n\tpq := new(PriorityQueue)\n\n\tfor _, x := range J {\n\t\t// push(x)\n\t\theap.Push(pq,x)\n\t}\n\tt := 0\n\tfor pq.Len() != 0 {\n\t\tj := heap.Pop(pq).(Job)\n\t\tt += j.A\n\t\tif j.B < t {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\n}\n\n// -----------------------------------------------------------------------------\n\ntype PriorityQueue []Job\n\nfunc (pq PriorityQueue) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\treturn pq[i].B < pq[j].B\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\told := *pq\n\t*pq = append(old, x.(Job))\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old) - 1\n\tx := old[n]\n\t*pq = old[:n]\n\treturn x\n}", "language": "Go", "metadata": {"date": 1561254306, "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/s267767031.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s267767031", "user_id": "u116518875"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"container/heap\"\n\t\"fmt\"\n)\n\ntype Job struct {\n\tA, B int\n}\n\nfunc main() {\n\t// N := readInt()\n\tvar N int\n\tfmt.Scan(&N)\n\tJ := make([]Job, N)\n\tvar a,b int\n\tfor i := range J {\n\t\tfmt.Scan(&a, &b)\n\t\tJ[i].A = a\n\t\tJ[i].B = b\n\t\t/*\n\t\tJ[i].A = readInt()\n\t\tJ[i].B = readInt()\n\t\t*/\n\t}\n\n\tpq := new(PriorityQueue)\n\n\tfor _, x := range J {\n\t\t// push(x)\n\t\theap.Push(pq,x)\n\t}\n\tt := 0\n\tfor pq.Len() != 0 {\n\t\tj := heap.Pop(pq).(Job)\n\t\tt += j.A\n\t\tif j.B < t {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n\n}\n\n// -----------------------------------------------------------------------------\n\ntype PriorityQueue []Job\n\nfunc (pq PriorityQueue) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\treturn pq[i].B < pq[j].B\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\told := *pq\n\t*pq = append(old, x.(Job))\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old) - 1\n\tx := old[n]\n\t*pq = old[:n]\n\treturn x\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1039, "cpu_time_ms": 2064, "memory_kb": 20864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s916772461", "group_id": "codeNet:p02996", "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 task struct {\n\ta int\n\tb int\n}\n\ntype tasks []task\n\nfunc (b tasks) Len() int { return len(b) }\nfunc (b tasks) Less(i, j int) bool { return b[i].b < b[j].b }\nfunc (b tasks) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\n\nconst MaxUint = ^uint(0)\nconst MinUint = 0\nconst MaxInt = int(MaxUint >> 1)\nconst MinInt = -MaxInt - 1\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\tt := make([]task, n)\n\n\tfor i := range t {\n\t\tt[i].a = nextInt()\n\t\tt[i].b = nextInt()\n\t}\n\tsort.Sort(sort.Reverse(tasks(t)))\n\n\td := t[0].b\n\n\tfor i := range t {\n\t\td -= t[i].a\n\t\tdebugf(\"i: %d, a: %d, d: %d\\n\", i, t[i].a, d)\n\t\tif d < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif d >= 0 {\n\t\t_, _ = fmt.Fprint(writer, \"Yes\")\n\t} else {\n\t\t_, _ = fmt.Fprint(writer, \"No\")\n\t}\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1561232821, "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/s916772461.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s916772461", "user_id": "u880731071"}, "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 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 task struct {\n\ta int\n\tb int\n}\n\ntype tasks []task\n\nfunc (b tasks) Len() int { return len(b) }\nfunc (b tasks) Less(i, j int) bool { return b[i].b < b[j].b }\nfunc (b tasks) Swap(i, j int) { b[i], b[j] = b[j], b[i] }\n\nconst MaxUint = ^uint(0)\nconst MinUint = 0\nconst MaxInt = int(MaxUint >> 1)\nconst MinInt = -MaxInt - 1\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\tt := make([]task, n)\n\n\tfor i := range t {\n\t\tt[i].a = nextInt()\n\t\tt[i].b = nextInt()\n\t}\n\tsort.Sort(sort.Reverse(tasks(t)))\n\n\td := t[0].b\n\n\tfor i := range t {\n\t\td -= t[i].a\n\t\tdebugf(\"i: %d, a: %d, d: %d\\n\", i, t[i].a, d)\n\t\tif d < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif d >= 0 {\n\t\t_, _ = fmt.Fprint(writer, \"Yes\")\n\t} else {\n\t\t_, _ = fmt.Fprint(writer, \"No\")\n\t}\n}\n\nfunc main() {\n\tproduction = true\n\tanswer(os.Stdin, os.Stdout)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1298, "cpu_time_ms": 194, "memory_kb": 8192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s259382601", "group_id": "codeNet:p02996", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Task struct {\n\ta int\n\tb int\n}\n\ntype Tasks []Task\n\nfunc (l Tasks) Len() int {\n\treturn len(l)\n}\n\nfunc (l Tasks) Less(i, j int) bool {\n\tif l[i].b == l[j].b {\n\t\treturn l[i].a < l[j].a\n\t}\n\treturn l[i].b < l[j].b\n}\n\nfunc (l Tasks) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n)\n\n\ttasks := make(Tasks, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a, &b)\n\t\ttasks[i] = Task{a, b}\n\t}\n\n\tsort.Sort(tasks)\n\n\ttime := 0\n\tfor _, t := range tasks {\n\t\ttime += t.a\n\t\tif time > t.b {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1561232682, "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/s259382601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s259382601", "user_id": "u889640107"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Task struct {\n\ta int\n\tb int\n}\n\ntype Tasks []Task\n\nfunc (l Tasks) Len() int {\n\treturn len(l)\n}\n\nfunc (l Tasks) Less(i, j int) bool {\n\tif l[i].b == l[j].b {\n\t\treturn l[i].a < l[j].a\n\t}\n\treturn l[i].b < l[j].b\n}\n\nfunc (l Tasks) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n)\n\n\ttasks := make(Tasks, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a, &b)\n\t\ttasks[i] = Task{a, b}\n\t}\n\n\tsort.Sort(tasks)\n\n\ttime := 0\n\tfor _, t := range tasks {\n\t\ttime += t.a\n\t\tif time > t.b {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2101, "memory_kb": 8320}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s446226236", "group_id": "codeNet:p02997", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\n\tif k <= (n - 1) * (n - 2) / 2 {\n\t\tfmt.Println(n * (n - 1) / 2 - k)\n\n\t\tfor j := 1; j < n; j++ {\t\t\t\n\t\t\tfmt.Println(j, n)\n\t\t}\n\n\t\ti := k;\n\t\tfor j1 := 1; j1 < n; j1++ {\n\t\t\tfor j2 := j1 + 1; j2 < n; j2++ {\n\t\t\t\ti++;\n\t\t\t\tif i <= (n - 1) * (n - 2) / 2 {\n\t\t\t\t\tfmt.Println(j1, j2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}", "language": "Go", "metadata": {"date": 1580260370, "filename_ext": "go", "original_language": "Go (1.6)", "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/s446226236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s446226236", "user_id": "u253759478"}, "prompt_components": {"gold_output": "5\n4 3\n1 2\n3 1\n4 5\n2 3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\n\tfmt.Scan(&n)\n\tfmt.Scan(&k)\n\n\tif k <= (n - 1) * (n - 2) / 2 {\n\t\tfmt.Println(n * (n - 1) / 2 - k)\n\n\t\tfor j := 1; j < n; j++ {\t\t\t\n\t\t\tfmt.Println(j, n)\n\t\t}\n\n\t\ti := k;\n\t\tfor j1 := 1; j1 < n; j1++ {\n\t\t\tfor j2 := j1 + 1; j2 < n; j2++ {\n\t\t\t\ti++;\n\t\t\t\tif i <= (n - 1) * (n - 2) / 2 {\n\t\t\t\t\tfmt.Println(j1, j2)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(-1)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 404, "cpu_time_ms": 13, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s464715661", "group_id": "codeNet:p02998", "input_text": "// https://atcoder.jp/contests/abc131/tasks/abc131_f\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 UnionFind struct {\n\tparents []int\n}\n\nfunc (uf *UnionFind) init(n int) {\n\tuf.parents = make([]int, n)\n\n\tfor i := range uf.parents {\n\t\tuf.parents[i] = -1\n\t}\n}\n\nfunc (uf *UnionFind) root(x int) int {\n\tif uf.parents[x] < 0 {\n\t\treturn x\n\t}\n\n\tr := uf.root(uf.parents[x])\n\tuf.parents[x] = r\n\treturn r\n}\n\nfunc (uf *UnionFind) same(x, y int) bool {\n\treturn uf.root(x) == uf.root(y)\n}\n\nfunc (uf *UnionFind) merge(x, y int) {\n\txr := uf.root(x)\n\tyr := uf.root(y)\n\n\tif xr == yr {\n\t\treturn\n\t}\n\n\tif xr > yr {\n\t\txr, yr = yr, xr\n\t}\n\n\tuf.parents[xr] += uf.parents[yr]\n\tuf.parents[yr] = xr\n}\n\ntype point struct {\n\tx int\n\ty int\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tps := make([]*point, N)\n\n\t// x もしくは y が等しいもので union find を作る\n\t// uf で merge するためには merge 先を知らないといけない → x, y 一方のみでクエリできる���うにする必要がある\n\t// 同一グループのうち一つの要素さえ得られれば merge はできるから、同一グループ(同一 x / y 座標)の値を一つ持つ map を用意する\n\t// key: 座標, value: その座標を持つある point の index\n\txs := map[int]int{}\n\tys := map[int]int{}\n\n\tuf := &UnionFind{}\n\tuf.init(N)\n\n\tfor i := 0; i < N; i++ {\n\t\tx := io.NextInt()\n\t\ty := io.NextInt()\n\n\t\tps[i] = &point{\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t}\n\n\t\tif _, xAdded := xs[x]; xAdded {\n\t\t\tuf.merge(xs[x], i)\n\t\t} else {\n\t\t\txs[x] = i\n\t\t}\n\n\t\tif _, yAdded := ys[y]; yAdded {\n\t\t\tuf.merge(ys[y], i)\n\t\t} else {\n\t\t\tys[y] = i\n\t\t}\n\t}\n\n\t// key: root index, value: x / y 座標の種類の個数\n\t// NOTE: UF で x, y の pair を持たずに y を y + X_MAX として単一次元で表現すれば uf 構成時点で x, y それぞれの個数を作ることができ\n\t// Set を使わない分速い -> solve 2\n\txCountForGroup := map[int]*Set{}\n\tyCountForGroup := map[int]*Set{}\n\n\tfor i := 0; i < N; i++ {\n\t\tp := ps[i]\n\t\troot := uf.root(i)\n\n\t\tif _, exists := xCountForGroup[root]; !exists {\n\t\t\txCountForGroup[root] = NewSet()\n\t\t}\n\t\tif _, exists := yCountForGroup[root]; !exists {\n\t\t\tyCountForGroup[root] = NewSet()\n\t\t}\n\n\t\txCountForGroup[root].Add(p.x)\n\t\tyCountForGroup[root].Add(p.y)\n\t}\n\n\ttotal := 0\n\tfor ri := range xCountForGroup {\n\t\txCt := len(*xCountForGroup[ri])\n\t\tyCt := len(*yCountForGroup[ri])\n\t\ttotal += xCt * yCt\n\t}\n\n\tres := total - N\n\tio.Println(res)\n}\n\n// WIP: WA & RE\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\n\tuf := &UnionFind{}\n\n\tmax := 100000\n\tuf.init(2*max + 1) // index 1..max for x, max+1..2*max for y.\n\n\tfor i := 0; i < N; i++ {\n\t\tx := io.NextInt()\n\t\ty := io.NextInt()\n\n\t\tuf.merge(x, y+max)\n\t}\n\n\tmx := map[int]int{}\n\tmy := map[int]int{}\n\tfor i := 1; i <= max; i++ {\n\t\tmx[uf.root(i)]++\n\t}\n\tfor i := max + 1; i <= 2*max; i++ {\n\t\tmy[uf.root(i)]++\n\t}\n\n\ttotal := 0\n\tfor i := 1; i <= max*2; i++ {\n\t\t// 存在しなかった座標は mx, my いずれかが 0 になっている\n\t\ttotal += mx[i] * my[i]\n\t}\n\n\tres := total - N\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// 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// 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/* 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": 1561333447, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02998.html", "problem_id": "p02998", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02998/input.txt", "sample_output_relpath": "derived/input_output/data/p02998/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02998/Go/s464715661.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s464715661", "user_id": "u751468134"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc131/tasks/abc131_f\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 UnionFind struct {\n\tparents []int\n}\n\nfunc (uf *UnionFind) init(n int) {\n\tuf.parents = make([]int, n)\n\n\tfor i := range uf.parents {\n\t\tuf.parents[i] = -1\n\t}\n}\n\nfunc (uf *UnionFind) root(x int) int {\n\tif uf.parents[x] < 0 {\n\t\treturn x\n\t}\n\n\tr := uf.root(uf.parents[x])\n\tuf.parents[x] = r\n\treturn r\n}\n\nfunc (uf *UnionFind) same(x, y int) bool {\n\treturn uf.root(x) == uf.root(y)\n}\n\nfunc (uf *UnionFind) merge(x, y int) {\n\txr := uf.root(x)\n\tyr := uf.root(y)\n\n\tif xr == yr {\n\t\treturn\n\t}\n\n\tif xr > yr {\n\t\txr, yr = yr, xr\n\t}\n\n\tuf.parents[xr] += uf.parents[yr]\n\tuf.parents[yr] = xr\n}\n\ntype point struct {\n\tx int\n\ty int\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tps := make([]*point, N)\n\n\t// x もしくは y が等しいもので union find を作る\n\t// uf で merge するためには merge 先を知らないといけない → x, y 一方のみでクエリできるようにする必要がある\n\t// 同一グループのうち一つの要素さえ得られれば merge はできるから、同一グループ(同一 x / y 座標)の値を一つ持つ map を用意する\n\t// key: 座標, value: その座標を持つある point の index\n\txs := map[int]int{}\n\tys := map[int]int{}\n\n\tuf := &UnionFind{}\n\tuf.init(N)\n\n\tfor i := 0; i < N; i++ {\n\t\tx := io.NextInt()\n\t\ty := io.NextInt()\n\n\t\tps[i] = &point{\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t}\n\n\t\tif _, xAdded := xs[x]; xAdded {\n\t\t\tuf.merge(xs[x], i)\n\t\t} else {\n\t\t\txs[x] = i\n\t\t}\n\n\t\tif _, yAdded := ys[y]; yAdded {\n\t\t\tuf.merge(ys[y], i)\n\t\t} else {\n\t\t\tys[y] = i\n\t\t}\n\t}\n\n\t// key: root index, value: x / y 座標の種類の個数\n\t// NOTE: UF で x, y の pair を持たずに y を y + X_MAX として単一次元で表現すれば uf 構成時点で x, y それぞれの個数を作ることができ\n\t// Set を使わない分速い -> solve 2\n\txCountForGroup := map[int]*Set{}\n\tyCountForGroup := map[int]*Set{}\n\n\tfor i := 0; i < N; i++ {\n\t\tp := ps[i]\n\t\troot := uf.root(i)\n\n\t\tif _, exists := xCountForGroup[root]; !exists {\n\t\t\txCountForGroup[root] = NewSet()\n\t\t}\n\t\tif _, exists := yCountForGroup[root]; !exists {\n\t\t\tyCountForGroup[root] = NewSet()\n\t\t}\n\n\t\txCountForGroup[root].Add(p.x)\n\t\tyCountForGroup[root].Add(p.y)\n\t}\n\n\ttotal := 0\n\tfor ri := range xCountForGroup {\n\t\txCt := len(*xCountForGroup[ri])\n\t\tyCt := len(*yCountForGroup[ri])\n\t\ttotal += xCt * yCt\n\t}\n\n\tres := total - N\n\tio.Println(res)\n}\n\n// WIP: WA & RE\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\n\tuf := &UnionFind{}\n\n\tmax := 100000\n\tuf.init(2*max + 1) // index 1..max for x, max+1..2*max for y.\n\n\tfor i := 0; i < N; i++ {\n\t\tx := io.NextInt()\n\t\ty := io.NextInt()\n\n\t\tuf.merge(x, y+max)\n\t}\n\n\tmx := map[int]int{}\n\tmy := map[int]int{}\n\tfor i := 1; i <= max; i++ {\n\t\tmx[uf.root(i)]++\n\t}\n\tfor i := max + 1; i <= 2*max; i++ {\n\t\tmy[uf.root(i)]++\n\t}\n\n\ttotal := 0\n\tfor i := 1; i <= max*2; i++ {\n\t\t// 存在しなかった座標は mx, my いずれかが 0 になっている\n\t\ttotal += mx[i] * my[i]\n\t}\n\n\tres := total - N\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// 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// 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/* 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 : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "sample_input": "3\n1 1\n5 1\n5 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02998", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N dots in a two-dimensional plane. The coordinates of the i-th dot are (x_i, y_i).\n\nWe will repeat the following operation as long as possible:\n\nChoose four integers a, b, c, d (a \\neq c, b \\neq d) such that there are dots at exactly three of the positions (a, b), (a, d), (c, b) and (c, d), and add a dot at the remaining position.\n\nWe can prove that we can only do this operation a finite number of times. Find the maximum number of times we can do the operation.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq 10^5\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 maximum number of times we can do the operation.\n\nSample Input 1\n\n3\n1 1\n5 1\n5 5\n\nSample Output 1\n\n1\n\nBy choosing a = 1, b = 1, c = 5, d = 5, we can add a dot at (1, 5). We cannot do the operation any more, so the maximum number of operations is 1.\n\nSample Input 2\n\n2\n10 10\n20 20\n\nSample Output 2\n\n0\n\nThere are only two dots, so we cannot do the operation at all.\n\nSample Input 3\n\n9\n1 1\n2 1\n3 1\n4 1\n5 1\n1 2\n1 3\n1 4\n1 5\n\nSample Output 3\n\n16\n\nWe can do the operation for all choices of the form a = 1, b = 1, c = i, d = j (2 \\leq i,j \\leq 5), and no more. Thus, the maximum number of operations is 16.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8713, "cpu_time_ms": 125, "memory_kb": 12160}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s639529743", "group_id": "codeNet:p02999", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, a int\n\tfmt.Scan(&x, &a)\n\tif x < a {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(10)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565550940, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02999/input.txt", "sample_output_relpath": "derived/input_output/data/p02999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02999/Go/s639529743.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s639529743", "user_id": "u512138205"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, a int\n\tfmt.Scan(&x, &a)\n\tif x < a {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(10)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02999", "source_text": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 141, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818214026", "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\n\tfor i:=0; D[i] <= X; i++ {\n\t\tif i == N {\n\t\t\tqtd++\n\t\t\tbreak\n\t\t}\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}\n\n// func testaTudoZero(N int, L []int) bool{\n// \ttst := true\n// \tfor i:=0; i < N; i++ {\n// \t\tif L[i] != 0 {\n// \t\t\ttst = false\n// \t\t\tbreak\n// \t\t}\n// \t}\n// \treturn tst\n// }", "language": "Go", "metadata": {"date": 1587015959, "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/s818214026.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818214026", "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\n\tfor i:=0; D[i] <= X; i++ {\n\t\tif i == N {\n\t\t\tqtd++\n\t\t\tbreak\n\t\t}\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}\n\n// func testaTudoZero(N int, L []int) bool{\n// \ttst := true\n// \tfor i:=0; i < N; i++ {\n// \t\tif L[i] != 0 {\n// \t\t\ttst = false\n// \t\t\tbreak\n// \t\t}\n// \t}\n// \treturn tst\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s828175643", "group_id": "codeNet:p03000", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, x := ri(), ri()\n\n\tans := 0\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tl := ri()\n\t\tsum += l\n\t\tif sum <= x {\n\t\t\tans++\n\t\t}\n\t}\n\n\tans++\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1560712989, "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/s828175643.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s828175643", "user_id": "u554269352"}, "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, x := ri(), ri()\n\n\tans := 0\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tl := ri()\n\t\tsum += l\n\t\tif sum <= x {\n\t\t\tans++\n\t\t}\n\t}\n\n\tans++\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 421, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s646551618", "group_id": "codeNet:p03001", "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 max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar w, h, x, y int\n\tfmt.Scan(&w, &h, &x, &y)\n\n\tif (x == 0 && y == 0) || (x == w && y == h) || (x == 0 && y == h) || (x == w && y == 0) {\n\t\tfmt.Println(float64(w*h/2), 0)\n\t\treturn\n\t}\n\n\ta := x * h\n\tb := (w - x) * h\n\tc := y * w\n\td := (h - y) * w\n\tminx, miny := min(a, b), min(c, d)\n\tif minx == miny {\n\t\tfmt.Println(minx, 1)\n\t} else {\n\t\tfmt.Println(max(minx, miny), 0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560715194, "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/s646551618.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s646551618", "user_id": "u102310764"}, "prompt_components": {"gold_output": "3.000000 0\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 max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar w, h, x, y int\n\tfmt.Scan(&w, &h, &x, &y)\n\n\tif (x == 0 && y == 0) || (x == w && y == h) || (x == 0 && y == h) || (x == w && y == 0) {\n\t\tfmt.Println(float64(w*h/2), 0)\n\t\treturn\n\t}\n\n\ta := x * h\n\tb := (w - x) * h\n\tc := y * w\n\td := (h - y) * w\n\tminx, miny := min(a, b), min(c, d)\n\tif minx == miny {\n\t\tfmt.Println(minx, 1)\n\t} else {\n\t\tfmt.Println(max(minx, miny), 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 541, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s213014728", "group_id": "codeNet:p03006", "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 main() {\n\tin := nextInt\n\ttype Point struct {\n\t\tx, y int\n\t}\n\n\tn := in()\n\tpb := make([]Point, n)\n\tfor i := 0; i < n; i++ {\n\t\tpb[i].x = in()\n\t\tpb[i].y = in()\n\t}\n\n\tm := make(map[Point]int)\n\tfor a := 0; a < n; a++ {\n\t\tfor b := 0; b < n; b++ {\n\t\t\tif a == b {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tx := pb[a].x - pb[b].x\n\t\t\ty := pb[a].y - pb[b].y\n\t\t\tm[Point{x, y}]++\n\t\t}\n\t}\n\n\tmax := 0\n\tfor _, v := range m {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tans := n - max\n\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 anser(b bool, y string, n string) string {\n\tif b {\n\t\treturn y\n\t}\n\treturn n\n}", "language": "Go", "metadata": {"date": 1560664797, "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/s213014728.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213014728", "user_id": "u217010036"}, "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 init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tin := nextInt\n\ttype Point struct {\n\t\tx, y int\n\t}\n\n\tn := in()\n\tpb := make([]Point, n)\n\tfor i := 0; i < n; i++ {\n\t\tpb[i].x = in()\n\t\tpb[i].y = in()\n\t}\n\n\tm := make(map[Point]int)\n\tfor a := 0; a < n; a++ {\n\t\tfor b := 0; b < n; b++ {\n\t\t\tif a == b {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tx := pb[a].x - pb[b].x\n\t\t\ty := pb[a].y - pb[b].y\n\t\t\tm[Point{x, y}]++\n\t\t}\n\t}\n\n\tmax := 0\n\tfor _, v := range m {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tans := n - max\n\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 anser(b bool, y string, n string) string {\n\tif b {\n\t\treturn y\n\t}\n\treturn 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 847, "cpu_time_ms": 2, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s114036939", "group_id": "codeNet:p03011", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst mod = 1000000007\n\nfunc contains(arr []int, el int) bool {\n\tfor _, v := range arr {\n\t\tif el == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tnm := strings.Split(sc.Text(), \" \")\n\tn, _ := strconv.Atoi(nm[0])\n\tm, _ := strconv.Atoi(nm[1])\n\tbads := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tbad, _ := strconv.Atoi(sc.Text())\n\t\tbads[i] = bad\n\t}\n\n\tdp := make([]int, n+1)\n\tdp[0] = 1\n\tif !contains(bads, 1) {\n\t\tdp[1] = 1\n\t}\n\tfor i := 2; i <= n; i++ {\n\t\tif !contains(bads, i-1) {\n\t\t\tdp[i] += dp[i-1]\n\t\t}\n\t\tif !contains(bads, i-2) {\n\t\t\tdp[i] += dp[i-2]\n\t\t}\n\t\tdp[i] %= mod\n\t}\n\tfmt.Println(dp[len(dp)-1])\n}\n", "language": "Go", "metadata": {"date": 1565816780, "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/s114036939.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s114036939", "user_id": "u675497468"}, "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\nconst mod = 1000000007\n\nfunc contains(arr []int, el int) bool {\n\tfor _, v := range arr {\n\t\tif el == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tnm := strings.Split(sc.Text(), \" \")\n\tn, _ := strconv.Atoi(nm[0])\n\tm, _ := strconv.Atoi(nm[1])\n\tbads := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tbad, _ := strconv.Atoi(sc.Text())\n\t\tbads[i] = bad\n\t}\n\n\tdp := make([]int, n+1)\n\tdp[0] = 1\n\tif !contains(bads, 1) {\n\t\tdp[1] = 1\n\t}\n\tfor i := 2; i <= n; i++ {\n\t\tif !contains(bads, i-1) {\n\t\t\tdp[i] += dp[i-1]\n\t\t}\n\t\tif !contains(bads, i-2) {\n\t\t\tdp[i] += dp[i-2]\n\t\t}\n\t\tdp[i] %= mod\n\t}\n\tfmt.Println(dp[len(dp)-1])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s652040913", "group_id": "codeNet:p03011", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tL := [3]int{}\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scan(&L[i])\n\t}\n\n\tsort.Ints(L[:])\n\tans := L[0] + L[1]\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1560461786, "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/s652040913.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s652040913", "user_id": "u879870653"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tL := [3]int{}\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scan(&L[i])\n\t}\n\n\tsort.Ints(L[:])\n\tans := L[0] + L[1]\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s315327300", "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\n\tfor i:=0; i n[i] {\n\t\t\tmin = n[i]\n\t\t}\n\t}\n\treturn min\n}\n", "language": "Go", "metadata": {"date": 1560130822, "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/s764692653.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s764692653", "user_id": "u423781392"}, "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\tw := make([]int, n)\n\tt := make([]int, n-1)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&w[i])\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tt[i-1] = absolute(sumValue(w[:i]) - sumValue(w[i:]))\n\t}\n\n\tmin := minValue(t)\n\tfmt.Println(min)\n\n}\n\nfunc absolute(num int) int {\n\tif num < 0 {\n\t\treturn -num\n\t} else {\n\t\treturn num\n\t}\n}\n\nfunc sumValue(n []int) int {\n\tsum := 0\n\tfor i := 0; i < len(n); i++ {\n\t\tsum += n[i]\n\t}\n\n\treturn sum\n}\n\nfunc minValue(n []int) int {\n\tmin := n[0]\n\tfor i := 1; i < len(n); i++ {\n\t\tif min > n[i] {\n\t\t\tmin = n[i]\n\t\t}\n\t}\n\treturn min\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 608, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994271836", "group_id": "codeNet:p03012", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"math\"\n)\n\nfunc main() {\n var w [100]int\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n\n for i := 0; i < n; i++ {\n sc.Scan()\n w[i], _ = strconv.Atoi(sc.Text())\n }\n\n out := math.MaxInt32\n for i := 0; i < n; i++ {\n left := 0\n for j := 0; j <= i; j++ {\n left += w[j]\n }\n right := 0\n for j := i + 1; j < n; j++ {\n right += w[j]\n }\n if int(math.Abs(float64(left - right))) < out {\n out = int(math.Abs(float64(left - right)))\n }\n }\n fmt.Println(out)\n\n}\n", "language": "Go", "metadata": {"date": 1560129084, "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/s994271836.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s994271836", "user_id": "u212486902"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"math\"\n)\n\nfunc main() {\n var w [100]int\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n\n for i := 0; i < n; i++ {\n sc.Scan()\n w[i], _ = strconv.Atoi(sc.Text())\n }\n\n out := math.MaxInt32\n for i := 0; i < n; i++ {\n left := 0\n for j := 0; j <= i; j++ {\n left += w[j]\n }\n right := 0\n for j := i + 1; j < n; j++ {\n right += w[j]\n }\n if int(math.Abs(float64(left - right))) < out {\n out = int(math.Abs(float64(left - right)))\n }\n }\n fmt.Println(out)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s777937220", "group_id": "codeNet:p03013", "input_text": "package main\n\nimport \"fmt\"\n\nfunc calc(N int, am map[int]struct{}) int64 {\n\tdp := make([]int64, N+1)\n\tdp[0] = 1\n\tdp[1] = 1\n\tif _, ok := am[1]; ok {\n\t\tdp[1] = 0\n\t}\n\n\tfor i := 2; i <= N; i++ {\n\t\tif dp[i-1] == 0 && dp[i-2] == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tdp[i] = (dp[i-1] + dp[i-2]) % 1000000007\n\t\tif _, ok := am[i]; ok {\n\t\t\tdp[i] = 0\n\t\t}\n\t}\n\n\treturn dp[N]\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\tam := map[int]struct{}{}\n\tfor i := 1; i <= M; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tam[a] = struct{}{}\n\t}\n\n\tans := calc(N, am)\n\tfmt.Println(ans % 1000000007)\n}\n", "language": "Go", "metadata": {"date": 1581535646, "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/s777937220.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s777937220", "user_id": "u727190365"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc calc(N int, am map[int]struct{}) int64 {\n\tdp := make([]int64, N+1)\n\tdp[0] = 1\n\tdp[1] = 1\n\tif _, ok := am[1]; ok {\n\t\tdp[1] = 0\n\t}\n\n\tfor i := 2; i <= N; i++ {\n\t\tif dp[i-1] == 0 && dp[i-2] == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tdp[i] = (dp[i-1] + dp[i-2]) % 1000000007\n\t\tif _, ok := am[i]; ok {\n\t\t\tdp[i] = 0\n\t\t}\n\t}\n\n\treturn dp[N]\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\tam := map[int]struct{}{}\n\tfor i := 1; i <= M; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tam[a] = struct{}{}\n\t}\n\n\tans := calc(N, am)\n\tfmt.Println(ans % 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 484, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s037176823", "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\tlist := make([]int, m)\n\tbroken := make([]bool, n+1)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&list[i])\n\t\tbroken[list[i]] = true\n\t}\n\n\tdp := make([]int, n+1)\n\tdp[0] = 1\n\tif !broken[1] {\n\t\tdp[1] = 1\n\t}\n\tfor i := 2; i <= n; i++ {\n\t\tif !broken[i-1] {\n\t\t\tdp[i] += dp[i-1]\n\t\t}\n\t\tif !broken[i-2] {\n\t\t\tdp[i] += dp[i-2]\n\t\t}\n\t}\n\tfmt.Println(dp[n] % 1000000007)\n}\n", "language": "Go", "metadata": {"date": 1581113105, "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/s037176823.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s037176823", "user_id": "u346986631"}, "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\tlist := make([]int, m)\n\tbroken := make([]bool, n+1)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&list[i])\n\t\tbroken[list[i]] = true\n\t}\n\n\tdp := make([]int, n+1)\n\tdp[0] = 1\n\tif !broken[1] {\n\t\tdp[1] = 1\n\t}\n\tfor i := 2; i <= n; i++ {\n\t\tif !broken[i-1] {\n\t\t\tdp[i] += dp[i-1]\n\t\t}\n\t\tif !broken[i-2] {\n\t\t\tdp[i] += dp[i-2]\n\t\t}\n\t}\n\tfmt.Println(dp[n] % 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 428, "cpu_time_ms": 435, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s220190650", "group_id": "codeNet:p03013", "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, m := io.NextInt(), io.NextInt()\n\n\tbrokens := []int{}\n\tfor i := 0; i < m; i++ {\n\t\tbrokens = append(brokens, io.NextInt())\n\t}\n\n\tans := calc(n, brokens)\n\n\tio.PrintLn(ans)\n}\n\nfunc calc(n int, brokens []int) int64 {\n\tif n == 1 {\n\t\treturn int64(1)\n\t}\n\n\tdp := make([]int64, n+1)\n\tdp[0] = 1\n\n\tfor _, b := range brokens {\n\t\tdp[b] = -1\n\t}\n\n\tif dp[1] == -1 {\n\t\tdp[1] = 0\n\t} else {\n\t\tdp[1] = 1\n\t}\n\n\tif n <= 1 {\n\t\treturn dp[n]\n\t}\n\n\tfor i := 2; i < n+1; i++ {\n\t\tif dp[i] == -1 {\n\t\t\tdp[i] = 0\n\t\t} else {\n\t\t\tdp[i] = dp[i-1] + dp[i-2]\n\t\t\t//dp[i] %= (1e9 + 7)\n\t\t}\n\t\t//fmt.Printf(\"%#v\\n\", dp)\n\t}\n\n\treturn dp[n] % int64(1e9+7)\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": 1560137803, "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/s220190650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s220190650", "user_id": "u134387396"}, "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\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn, m := io.NextInt(), io.NextInt()\n\n\tbrokens := []int{}\n\tfor i := 0; i < m; i++ {\n\t\tbrokens = append(brokens, io.NextInt())\n\t}\n\n\tans := calc(n, brokens)\n\n\tio.PrintLn(ans)\n}\n\nfunc calc(n int, brokens []int) int64 {\n\tif n == 1 {\n\t\treturn int64(1)\n\t}\n\n\tdp := make([]int64, n+1)\n\tdp[0] = 1\n\n\tfor _, b := range brokens {\n\t\tdp[b] = -1\n\t}\n\n\tif dp[1] == -1 {\n\t\tdp[1] = 0\n\t} else {\n\t\tdp[1] = 1\n\t}\n\n\tif n <= 1 {\n\t\treturn dp[n]\n\t}\n\n\tfor i := 2; i < n+1; i++ {\n\t\tif dp[i] == -1 {\n\t\t\tdp[i] = 0\n\t\t} else {\n\t\t\tdp[i] = dp[i-1] + dp[i-2]\n\t\t\t//dp[i] %= (1e9 + 7)\n\t\t}\n\t\t//fmt.Printf(\"%#v\\n\", dp)\n\t}\n\n\treturn dp[n] % int64(1e9+7)\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 : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3451, "cpu_time_ms": 43, "memory_kb": 6272}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s968156439", "group_id": "codeNet:p03013", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc main() {\n\tvar N, M, a int\n\tfmt.Scan(&N)\n\tfmt.Scan(&M)\n\n\tvar as []int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&a)\n\t\tas = append(as, a)\n\t}\n\n\tres := 1\n\tfor i := 0; i < M; i++ {\n\t\tn := 0\n\t\tif i == 0 {\n\t\t\tn = as[i] - 1\n\t\t} else {\n\t\t\tn = as[i] - as[i - 1] - 2\n\t\t}\n\n\t\tif n < 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\n\t\tres *= fib(n) % MOD\n\t\tres = res % MOD\n\t}\n\n\tif M > 0 {\n\t\tres *= fib(N-as[M-1]-1) % MOD\n\t\tres = res % MOD\n\t} else {\n\t\tres *= fib(N) % MOD\n\t}\n\n\tfmt.Println(res)\n}\n\nfunc fib(N int) int {\n\tif N < 2 {\n\t\treturn 1\n\t}\n\n\tn1, n2, f := 1, 1, 1\n\n\tfor i := 0; i < N - 1; i++ {\n\t\tf = n1 + n2\n\t\tn1 = n2\n\t\tn2 = f\n\t}\n\n\treturn f\n}", "language": "Go", "metadata": {"date": 1560130662, "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/s968156439.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s968156439", "user_id": "u703739962"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nconst MOD = 1000000007\n\nfunc main() {\n\tvar N, M, a int\n\tfmt.Scan(&N)\n\tfmt.Scan(&M)\n\n\tvar as []int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&a)\n\t\tas = append(as, a)\n\t}\n\n\tres := 1\n\tfor i := 0; i < M; i++ {\n\t\tn := 0\n\t\tif i == 0 {\n\t\t\tn = as[i] - 1\n\t\t} else {\n\t\t\tn = as[i] - as[i - 1] - 2\n\t\t}\n\n\t\tif n < 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\n\t\tres *= fib(n) % MOD\n\t\tres = res % MOD\n\t}\n\n\tif M > 0 {\n\t\tres *= fib(N-as[M-1]-1) % MOD\n\t\tres = res % MOD\n\t} else {\n\t\tres *= fib(N) % MOD\n\t}\n\n\tfmt.Println(res)\n}\n\nfunc fib(N int) int {\n\tif N < 2 {\n\t\treturn 1\n\t}\n\n\tn1, n2, f := 1, 1, 1\n\n\tfor i := 0; i < N - 1; i++ {\n\t\tf = n1 + n2\n\t\tn1 = n2\n\t\tn2 = f\n\t}\n\n\treturn f\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 678, "cpu_time_ms": 457, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s476615887", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\t_, a, b, c, d := nextInt(), nextInt()-1, nextInt()-1, nextInt()-1, nextInt()-1\n\ts := next()\n\n\t// 連続する岩がないか\n\tfor i := a + 1; i < max(c, d); i++ {\n\t\tif s[i] == '#' && s[i+1] == '#' {\n\t\t\tYesOrNo(false)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif c < d {\n\t\tYesOrNo(true)\n\t\treturn\n\t}\n\n\t// 3連続の空白があるか\n\tok := false\n\tfor i := b; i <= d; i++ {\n\t\tif s[i-1] == '.' && s[i] == '.' && s[i+1] == '.' {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\tYesOrNo(ok)\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 YesOrNo(ok bool) {\n\tif ok {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\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", "language": "Go", "metadata": {"date": 1584139000, "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/s476615887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s476615887", "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\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\t_, a, b, c, d := nextInt(), nextInt()-1, nextInt()-1, nextInt()-1, nextInt()-1\n\ts := next()\n\n\t// 連続する岩がないか\n\tfor i := a + 1; i < max(c, d); i++ {\n\t\tif s[i] == '#' && s[i+1] == '#' {\n\t\t\tYesOrNo(false)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif c < d {\n\t\tYesOrNo(true)\n\t\treturn\n\t}\n\n\t// 3連続の空白があるか\n\tok := false\n\tfor i := b; i <= d; i++ {\n\t\tif s[i-1] == '.' && s[i] == '.' && s[i+1] == '.' {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\tYesOrNo(ok)\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 YesOrNo(ok bool) {\n\tif ok {\n\t\tputs(\"Yes\")\n\t} else {\n\t\tputs(\"No\")\n\t}\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", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1125, "cpu_time_ms": 9, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913464716", "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 {\n\t\t\tif a == c {\n\t\t\t\tbreak\n\t\t\t}\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 a+1 == c {\n\t\t\t\tbreak\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": 1559527487, "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/s913464716.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s913464716", "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 {\n\t\t\tif a == c {\n\t\t\t\tbreak\n\t\t\t}\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 a+1 == c {\n\t\t\t\tbreak\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1160, "cpu_time_ms": 2107, "memory_kb": 1664}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s709472167", "group_id": "codeNet:p03024", "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\tvar ans int\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == 'o' {\n\t\t\tans++\n\t\t}\n\t}\n\tif 15-len(S)+ans >= 8 {\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": 1599006605, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s709472167.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s709472167", "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\tvar ans int\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == 'o' {\n\t\t\tans++\n\t\t}\n\t}\n\tif 15-len(S)+ans >= 8 {\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 : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "sample_input": "oxoxoxoxoxoxox\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03024", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5740, "cpu_time_ms": 5, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s040136832", "group_id": "codeNet:p03024", "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\tfor i := len(s); i < 15; i++ {\n\t\ts = s + \"o\"\n\t}\n\tfmt.Println(s)\n\tfmt.Println(strings.Count(s, \"o\"))\n\tif strings.Count(s, \"o\") >= 8 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559438886, "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/s040136832.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s040136832", "user_id": "u423781392"}, "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\tfor i := len(s); i < 15; i++ {\n\t\ts = s + \"o\"\n\t}\n\tfmt.Println(s)\n\tfmt.Println(strings.Count(s, \"o\"))\n\tif strings.Count(s, \"o\") >= 8 {\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\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "sample_input": "oxoxoxoxoxoxox\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03024", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s213794047", "group_id": "codeNet:p03024", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\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\ttorikumi := nextLine()\n\tif strings.Count(torikumi, \"o\")+15-len(torikumi) >= 8 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}", "language": "Go", "metadata": {"date": 1559437711, "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/s213794047.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213794047", "user_id": "u900615460"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\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\ttorikumi := nextLine()\n\tif strings.Count(torikumi, \"o\")+15-len(torikumi) >= 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s731345335", "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 x == 0 {\n\t\t\tfmt.Println(0)\n\t\t\tbreak\n\t\t}\n\t\tif d == 0 {\n\t\t\tfmt.Println(pow(x, n))\n\t\t\tbreak\n\t\t}\n\n\t\txdd := divide(x, d)\n\t\tif xdd+n-1 >= mod {\n\t\t\tfmt.Println(0)\n\t\t\tbreak\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": 1559489003, "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/s731345335.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s731345335", "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 x == 0 {\n\t\t\tfmt.Println(0)\n\t\t\tbreak\n\t\t}\n\t\tif d == 0 {\n\t\t\tfmt.Println(pow(x, n))\n\t\t\tbreak\n\t\t}\n\n\t\txdd := divide(x, d)\n\t\tif xdd+n-1 >= mod {\n\t\t\tfmt.Println(0)\n\t\t\tbreak\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1122, "cpu_time_ms": 24, "memory_kb": 8704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s193505380", "group_id": "codeNet:p03029", "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)\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\n\ta, p := oneInt(), oneInt()\n\n\tfragment := a * 3\n\tfmt.Println((fragment + p) / 2)\n}\n\nfunc oneInt() 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 oneStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums(len int) (nums []int) {\n\tfor i := 0; i < len; i++ {\n\t\tnums = append(nums, oneInt())\n\t}\n\treturn nums\n}\n\nfunc scanStrings(len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstrs = append(strs, oneStr())\n\t}\n\treturn strs\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": 1558918874, "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/s193505380.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s193505380", "user_id": "u134387396"}, "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\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\n\ta, p := oneInt(), oneInt()\n\n\tfragment := a * 3\n\tfmt.Println((fragment + p) / 2)\n}\n\nfunc oneInt() 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 oneStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums(len int) (nums []int) {\n\tfor i := 0; i < len; i++ {\n\t\tnums = append(nums, oneInt())\n\t}\n\treturn nums\n}\n\nfunc scanStrings(len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstrs = append(strs, oneStr())\n\t}\n\treturn strs\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 : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "sample_input": "1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03029", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1886, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s004345123", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype restaurant struct {\n\tid int\n\tcity string\n\tpoint 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].point > r[j].point\n\t}\n\treturn r[i].city < r[j].city\n}\n\nfunc (r restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\trs := make([]restaurant, n)\n\tfor i := range rs {\n\t\trs[i].id = i + 1\n\t\tfmt.Scan(&rs[i].city, &rs[i].point)\n\t}\n\n\tsort.Sort(restaurants(rs))\n\n\tfor _, v := range rs {\n\t\tfmt.Println(v.id)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588100275, "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/s004345123.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s004345123", "user_id": "u620351704"}, "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\tid int\n\tcity string\n\tpoint 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].point > r[j].point\n\t}\n\treturn r[i].city < r[j].city\n}\n\nfunc (r restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\trs := make([]restaurant, n)\n\tfor i := range rs {\n\t\trs[i].id = i + 1\n\t\tfmt.Scan(&rs[i].city, &rs[i].point)\n\t}\n\n\tsort.Sort(restaurants(rs))\n\n\tfor _, v := range rs {\n\t\tfmt.Println(v.id)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 623, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s598862772", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype restaurant struct {\n\ts string\n\tp int\n\tindex int\n}\n\ntype lessFunc func(r1, r2 *restaurant) bool\n\ntype multiSorter struct {\n\trestaurants []restaurant\n\tless []lessFunc\n}\n\nfunc (ms *multiSorter) Sort(restaurants []restaurant) {\n\tms.restaurants = restaurants\n\tsort.Sort(ms)\n}\n\nfunc orderedBy(less ...lessFunc) *multiSorter {\n\treturn &multiSorter{\n\t\tless: less,\n\t}\n}\n\nfunc (ms *multiSorter) Len() int { return len(ms.restaurants) }\nfunc (ms *multiSorter) Swap(i, j int) {\n\tms.restaurants[i], ms.restaurants[j] = ms.restaurants[j], ms.restaurants[i]\n}\nfunc (ms *multiSorter) Less(i, j int) bool {\n\tp, q := &ms.restaurants[i], &ms.restaurants[j]\n\tvar k int\n\tfor k = 0; k < len(ms.less)-1; k++ {\n\t\tless := ms.less[k]\n\t\tswitch {\n\t\tcase less(p, q):\n\t\t\treturn true\n\t\tcase less(q, p):\n\t\t\treturn false\n\t\t}\n\t}\n\treturn ms.less[k](p, q)\n}\n\nfunc main() {\n\tcity := func(r1, r2 *restaurant) bool {\n\t\treturn r1.s < r2.s\n\t}\n\tpoint := func(r1, r2 *restaurant) bool {\n\t\treturn r2.p < r1.p\n\t}\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\trestaurants := make([]restaurant, n)\n\tfor i := range restaurants {\n\t\tfmt.Scan(&restaurants[i].s, &restaurants[i].p)\n\t\trestaurants[i].index = i + 1\n\t}\n\n\torderedBy(city, point).Sort(restaurants)\n\n\tfor _, r := range restaurants {\n\t\tfmt.Println(r.index)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559162941, "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/s598862772.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s598862772", "user_id": "u543933043"}, "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\ts string\n\tp int\n\tindex int\n}\n\ntype lessFunc func(r1, r2 *restaurant) bool\n\ntype multiSorter struct {\n\trestaurants []restaurant\n\tless []lessFunc\n}\n\nfunc (ms *multiSorter) Sort(restaurants []restaurant) {\n\tms.restaurants = restaurants\n\tsort.Sort(ms)\n}\n\nfunc orderedBy(less ...lessFunc) *multiSorter {\n\treturn &multiSorter{\n\t\tless: less,\n\t}\n}\n\nfunc (ms *multiSorter) Len() int { return len(ms.restaurants) }\nfunc (ms *multiSorter) Swap(i, j int) {\n\tms.restaurants[i], ms.restaurants[j] = ms.restaurants[j], ms.restaurants[i]\n}\nfunc (ms *multiSorter) Less(i, j int) bool {\n\tp, q := &ms.restaurants[i], &ms.restaurants[j]\n\tvar k int\n\tfor k = 0; k < len(ms.less)-1; k++ {\n\t\tless := ms.less[k]\n\t\tswitch {\n\t\tcase less(p, q):\n\t\t\treturn true\n\t\tcase less(q, p):\n\t\t\treturn false\n\t\t}\n\t}\n\treturn ms.less[k](p, q)\n}\n\nfunc main() {\n\tcity := func(r1, r2 *restaurant) bool {\n\t\treturn r1.s < r2.s\n\t}\n\tpoint := func(r1, r2 *restaurant) bool {\n\t\treturn r2.p < r1.p\n\t}\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\trestaurants := make([]restaurant, n)\n\tfor i := range restaurants {\n\t\tfmt.Scan(&restaurants[i].s, &restaurants[i].p)\n\t\trestaurants[i].index = i + 1\n\t}\n\n\torderedBy(city, point).Sort(restaurants)\n\n\tfor _, r := range restaurants {\n\t\tfmt.Println(r.index)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1312, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930514868", "group_id": "codeNet:p03030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Restaurant struct {\n\tIndex int\n\tCity string\n\tPoint 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 true\n\t} else if r[i].City == r[j].City {\n\t\treturn r[i].Point > r[j].Point\n\t}\n\treturn false\n}\n\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\trestaurants := make([]Restaurant, n)\n\n\tfor i := 0; i < n; i++ {\n\t\trestaurant := Restaurant{}\n\t\trestaurant.Index = i + 1\n\t\tfmt.Scan(&restaurant.City, &restaurant.Point)\n\t\trestaurants[i] = restaurant\n\t}\n\n\tsort.Sort(Restaurants(restaurants))\n\n\tfor _, restaurant := range restaurants {\n\t\tfmt.Println(restaurant.Index)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558920737, "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/s930514868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s930514868", "user_id": "u262403099"}, "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\tIndex int\n\tCity string\n\tPoint 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 true\n\t} else if r[i].City == r[j].City {\n\t\treturn r[i].Point > r[j].Point\n\t}\n\treturn false\n}\n\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\trestaurants := make([]Restaurant, n)\n\n\tfor i := 0; i < n; i++ {\n\t\trestaurant := Restaurant{}\n\t\trestaurant.Index = i + 1\n\t\tfmt.Scan(&restaurant.City, &restaurant.Point)\n\t\trestaurants[i] = restaurant\n\t}\n\n\tsort.Sort(Restaurants(restaurants))\n\n\tfor _, restaurant := range restaurants {\n\t\tfmt.Println(restaurant.Index)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 787, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s464946830", "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\ntype Restaurants [][]int\n\nfunc (r Restaurants) Len() int {\n\treturn len(r)\n}\nfunc (r Restaurants) Less(i, j int) bool {\n\treturn r[i][1] > r[j][1]\n}\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tvar cities []string\n\trestaurantsMap := make(map[string]Restaurants)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ts := scanner.Text()\n\t\tscanner.Scan()\n\t\tp, _ := strconv.Atoi(scanner.Text())\n\t\tif _, ok := restaurantsMap[s]; !ok {\n\t\t\tcities = append(cities, s)\n\t\t\trestaurantsMap[s] = [][]int{}\n\t\t}\n\t\trestaurantsMap[s] = append(restaurantsMap[s], []int{i + 1, p})\n\t}\n\n\tsort.Strings(cities)\n\tfor i := 0; i < len(cities); i++ {\n\t\trestaurants := restaurantsMap[cities[i]]\n\t\tsort.Sort(restaurants)\n\t\tfor j := 0; j < len(restaurants); j++ {\n\t\t\tfmt.Println(restaurants[j][0])\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558919461, "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/s464946830.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s464946830", "user_id": "u836866227"}, "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\ntype Restaurants [][]int\n\nfunc (r Restaurants) Len() int {\n\treturn len(r)\n}\nfunc (r Restaurants) Less(i, j int) bool {\n\treturn r[i][1] > r[j][1]\n}\nfunc (r Restaurants) Swap(i, j int) {\n\tr[i], r[j] = r[j], r[i]\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tvar cities []string\n\trestaurantsMap := make(map[string]Restaurants)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ts := scanner.Text()\n\t\tscanner.Scan()\n\t\tp, _ := strconv.Atoi(scanner.Text())\n\t\tif _, ok := restaurantsMap[s]; !ok {\n\t\t\tcities = append(cities, s)\n\t\t\trestaurantsMap[s] = [][]int{}\n\t\t}\n\t\trestaurantsMap[s] = append(restaurantsMap[s], []int{i + 1, p})\n\t}\n\n\tsort.Strings(cities)\n\tfor i := 0; i < len(cities); i++ {\n\t\trestaurants := restaurantsMap[cities[i]]\n\t\tsort.Sort(restaurants)\n\t\tfor j := 0; j < len(restaurants); j++ {\n\t\t\tfmt.Println(restaurants[j][0])\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s678403414", "group_id": "codeNet:p03031", "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, 1000005), 1000005)\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 = 2\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\tm := getNextInt(scanner)\n\tss := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tk := getNextInt(scanner)\n\t\tfor j := 0; j < k; j++ {\n\t\t\ts := getNextInt(scanner) - 1\n\t\t\tss[i] |= 1 << uint(s)\n\t\t}\n\t}\n\n\tpp := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tpp[i] = getNextInt(scanner)\n\t}\n\tans := 0\n\tfor b := 0; b < 1<> uint(j) & 1\n\t\t\t}\n\t\t\tif on%2 == pp[i] {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == m {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n}\n", "language": "Go", "metadata": {"date": 1583295964, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03031.html", "problem_id": "p03031", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03031/input.txt", "sample_output_relpath": "derived/input_output/data/p03031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03031/Go/s678403414.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s678403414", "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, 1000005), 1000005)\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 = 2\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\tm := getNextInt(scanner)\n\tss := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tk := getNextInt(scanner)\n\t\tfor j := 0; j < k; j++ {\n\t\t\ts := getNextInt(scanner) - 1\n\t\t\tss[i] |= 1 << uint(s)\n\t\t}\n\t}\n\n\tpp := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tpp[i] = getNextInt(scanner)\n\t}\n\tans := 0\n\tfor b := 0; b < 1<> uint(j) & 1\n\t\t\t}\n\t\t\tif on%2 == pp[i] {\n\t\t\t\tsum++\n\t\t\t}\n\t\t}\n\t\tif sum == m {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "sample_input": "2 2\n2 1 2\n1 2\n0 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03031", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1947, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s280091150", "group_id": "codeNet:p03031", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n fmt.Scan(&n, &m)\n ls := make([]int, m)\n for i := 0; i < m; i++ {\n var k int\n fmt.Scan(&k)\n var sb int\n for j := 0; j < k; j++ {\n var s uint\n fmt.Scan(&s)\n s--\n sb |= 1 << s\n }\n ls[i] = sb\n }\n ps := make([]int, m)\n for i := 0; i < m; i++ {\n var p int\n fmt.Scan(&p)\n ps[i] = p\n }\n var sc int\n for i := 0; i < 1< 0 {\n cnt++\n }\n }\n if cnt%2 != ps[j] {\n ng = true\n }\n }\n if !ng {\n sc++\n }\n }\n fmt.Println(sc)\n}\n", "language": "Go", "metadata": {"date": 1558920550, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03031.html", "problem_id": "p03031", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03031/input.txt", "sample_output_relpath": "derived/input_output/data/p03031/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03031/Go/s280091150.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s280091150", "user_id": "u282164747"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, m int\n fmt.Scan(&n, &m)\n ls := make([]int, m)\n for i := 0; i < m; i++ {\n var k int\n fmt.Scan(&k)\n var sb int\n for j := 0; j < k; j++ {\n var s uint\n fmt.Scan(&s)\n s--\n sb |= 1 << s\n }\n ls[i] = sb\n }\n ps := make([]int, m)\n for i := 0; i < m; i++ {\n var p int\n fmt.Scan(&p)\n ps[i] = p\n }\n var sc int\n for i := 0; i < 1< 0 {\n cnt++\n }\n }\n if cnt%2 != ps[j] {\n ng = true\n }\n }\n if !ng {\n sc++\n }\n }\n fmt.Println(sc)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "sample_input": "2 2\n2 1 2\n1 2\n0 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03031", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N switches with \"on\" and \"off\" state, and M bulbs. The switches are numbered 1 to N, and the bulbs are numbered 1 to M.\n\nBulb i is connected to k_i switches: Switch s_{i1}, s_{i2}, ..., and s_{ik_i}. It is lighted when the number of switches that are \"on\" among these switches is congruent to p_i modulo 2.\n\nHow many combinations of \"on\" and \"off\" states of the switches light all the bulbs?\n\nConstraints\n\n1 \\leq N, M \\leq 10\n\n1 \\leq k_i \\leq N\n\n1 \\leq s_{ij} \\leq N\n\ns_{ia} \\neq s_{ib} (a \\neq b)\n\np_i is 0 or 1.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nk_1 s_{11} s_{12} ... s_{1k_1}\n:\nk_M s_{M1} s_{M2} ... s_{Mk_M}\np_1 p_2 ... p_M\n\nOutput\n\nPrint the number of combinations of \"on\" and \"off\" states of the switches that light all the bulbs.\n\nSample Input 1\n\n2 2\n2 1 2\n1 2\n0 1\n\nSample Output 1\n\n1\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nThere are four possible combinations of states of (Switch 1, Switch 2): (on, on), (on, off), (off, on) and (off, off). Among them, only (on, on) lights all the bulbs, so we should print 1.\n\nSample Input 2\n\n2 3\n2 1 2\n1 1\n1 2\n0 0 1\n\nSample Output 2\n\n0\n\nBulb 1 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1 and 2.\n\nBulb 2 is lighted when there is an even number of switches that are \"on\" among the following: Switch 1.\n\nBulb 3 is lighted when there is an odd number of switches that are \"on\" among the following: Switch 2.\n\nSwitch 1 has to be \"off\" to light Bulb 2 and Switch 2 has to be \"on\" to light Bulb 3, but then Bulb 1 will not be lighted. Thus, there are no combinations of states of the switches that light all the bulbs, so we should print 0.\n\nSample Input 3\n\n5 2\n3 1 2 5\n2 2 3\n1 0\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 922, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s000739127", "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\nfunc main() {\n\tscan_init()\n\ta := scanInt()\n\tb := scanInt()\n\tif 6 <= a && a <= 12 {\n\t\tfmt.Println(b/2)\n\t} else {\n\t\tif a <= 5 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(b)\n\t\t}\n\t}\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scan_init() {\n\tsc.Split(bufio.ScanWords)\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 200000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 200000)\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}\nfunc readLineToNumber() int {\n\tS := readLine()\n\tnumber, _ := strconv.Atoi(S)\n\treturn number\n}\nfunc readLineToSlice() []string {\n\tS := readLine()\n\tlist := strings.Split(S, \"\")\n\treturn list\n}\nfunc readLineToNumberSlice(memo map[string]int) []int {\n\t// err時は-1を代入\n\tS := readLine()\n\tintList := make([]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\tif val, ok := memo[string(S[i])]; ok {\n\t\t\tintList[i] = val\n\t\t} else {\n\t\t\tintList[i] = -1\n\t\t}\n\t}\n\treturn intList\n}", "language": "Go", "metadata": {"date": 1599096922, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s000739127.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000739127", "user_id": "u184577857"}, "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\nfunc main() {\n\tscan_init()\n\ta := scanInt()\n\tb := scanInt()\n\tif 6 <= a && a <= 12 {\n\t\tfmt.Println(b/2)\n\t} else {\n\t\tif a <= 5 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(b)\n\t\t}\n\t}\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scan_init() {\n\tsc.Split(bufio.ScanWords)\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 200000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 200000)\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}\nfunc readLineToNumber() int {\n\tS := readLine()\n\tnumber, _ := strconv.Atoi(S)\n\treturn number\n}\nfunc readLineToSlice() []string {\n\tS := readLine()\n\tlist := strings.Split(S, \"\")\n\treturn list\n}\nfunc readLineToNumberSlice(memo map[string]int) []int {\n\t// err時は-1を代入\n\tS := readLine()\n\tintList := make([]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\tif val, ok := memo[string(S[i])]; ok {\n\t\t\tintList[i] = val\n\t\t} else {\n\t\t\tintList[i] = -1\n\t\t}\n\t}\n\treturn intList\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909858822", "group_id": "codeNet:p03035", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanln(&A, &B)\n\n\tvar ans int\n\tif 6 <= A && A <= 12 {\n\t\tans = B / 2\n\t} else if 12 < A {\n\t\tans = B\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1567616751, "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/s909858822.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909858822", "user_id": "u020639289"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanln(&A, &B)\n\n\tvar ans int\n\tif 6 <= A && A <= 12 {\n\t\tans = B / 2\n\t} else if 12 < A {\n\t\tans = B\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s509294157", "group_id": "codeNet:p03035", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n\n var a, b int\n\n fmt.Scan(&a, &b)\n\n if a > 12 {\n fmt.Println(b)\n } else if a >= 6 {\n fmt.Println(b / 2)\n } else {\n fmt.Println(0)\n }\n \n}", "language": "Go", "metadata": {"date": 1560311440, "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/s509294157.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s509294157", "user_id": "u140680196"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n\n var a, b int\n\n fmt.Scan(&a, &b)\n\n if a > 12 {\n fmt.Println(b)\n } else if a >= 6 {\n fmt.Println(b / 2)\n } else {\n fmt.Println(0)\n }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s236862075", "group_id": "codeNet:p03035", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a >= 13 {\n\t\tfmt.Println(b)\n\t} else if a >= 6 && a <= 12 {\n\t\tfmt.Println(b / 2)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558833386, "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/s236862075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s236862075", "user_id": "u710190793"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a >= 13 {\n\t\tfmt.Println(b)\n\t} else if a >= 6 && a <= 12 {\n\t\tfmt.Println(b / 2)\n\t} else {\n\t\tfmt.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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s822341377", "group_id": "codeNet:p03036", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r,d,x2000 int\n\tfmt.Scan(&r,&d,&x2000)\n\t\n\tx := make([]int, 11)\n\tx[0] = r*x2000 - d\n\tfmt.Println(x[0])\n\tfor i:=1; i<10; i++ {\n\t\tx[i] = r*x[i-1] - d\n\t\tfmt.Println(x[i])\n\t}\n}", "language": "Go", "metadata": {"date": 1564726497, "filename_ext": "go", "original_language": "Go (1.6)", "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/s822341377.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s822341377", "user_id": "u750378652"}, "prompt_components": {"gold_output": "30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r,d,x2000 int\n\tfmt.Scan(&r,&d,&x2000)\n\t\n\tx := make([]int, 11)\n\tx[0] = r*x2000 - d\n\tfmt.Println(x[0])\n\tfor i:=1; i<10; i++ {\n\t\tx[i] = r*x[i-1] - d\n\t\tfmt.Println(x[i])\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "sample_input": "2 10 20\n"}, "reference_outputs": ["30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n"], "source_document_id": "p03036", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 222, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s797603570", "group_id": "codeNet:p03037", "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, m := scanInt(sc), scanInt(sc)\n\tlmax, rmin := 1, math.MaxInt32\n\tfor i := 0; i < m; i++ {\n\t\tl, r := scanInt(sc), scanInt(sc)\n\t\tif lmax < l {\n\t\t\tlmax = l\n\t\t}\n\t\tif r < rmin {\n\t\t\trmin = r\n\t\t}\n\t}\n\treturn max(0, min(n, rmin)-lmax+1)\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\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1592792279, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s797603570.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s797603570", "user_id": "u623007471"}, "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\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, m := scanInt(sc), scanInt(sc)\n\tlmax, rmin := 1, math.MaxInt32\n\tfor i := 0; i < m; i++ {\n\t\tl, r := scanInt(sc), scanInt(sc)\n\t\tif lmax < l {\n\t\t\tlmax = l\n\t\t}\n\t\tif r < rmin {\n\t\t\trmin = r\n\t\t}\n\t}\n\treturn max(0, min(n, rmin)-lmax+1)\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\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1059, "cpu_time_ms": 39, "memory_kb": 2984}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064913952", "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\tleft := 1\n\tright := N\n\tvar L, R int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&L, &R)\n\t\tif left < L {\n\t\t\tleft = L\n\t\t}\n\t\tif R < right {\n\t\t\tright = R\n\t\t}\n\t}\n\n\tans := 0\n\tif left <= right {\n\t\tans = right - left + 1\n\t}\n\tfmt.Println(ans, left, right)\n}\n\n/*\n1234\nooox\nxooo\nooxx\n\nxxoo\nooxx\n\n\noooo\n*/\n", "language": "Go", "metadata": {"date": 1573101211, "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/s064913952.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s064913952", "user_id": "u902409225"}, "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\tleft := 1\n\tright := N\n\tvar L, R int\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&L, &R)\n\t\tif left < L {\n\t\t\tleft = L\n\t\t}\n\t\tif R < right {\n\t\t\tright = R\n\t\t}\n\t}\n\n\tans := 0\n\tif left <= right {\n\t\tans = right - left + 1\n\t}\n\tfmt.Println(ans, left, right)\n}\n\n/*\n1234\nooox\nxooo\nooxx\n\nxxoo\nooxx\n\n\noooo\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 827, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s175305326", "group_id": "codeNet:p03037", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\n\tvar re int\n\tgate := map[int]int{}\n\n\tfor index := 0; index < m; index++ {\n\t\tvar l, r int\n\t\tfmt.Scan(&l)\n\t\tfmt.Scan(&r)\n\t\tgate[l] = r\n\t}\n\n\tfor j := 1; j <= n; j++ {\n\t\tvar valid bool\n\t\tfor l, r := range gate {\n\t\t\tif l > j || r < j {\n\t\t\t\tvalid = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !valid {\n\t\t\tre++\n\t\t}\n\t}\n\tfmt.Println(re)\n}\n", "language": "Go", "metadata": {"date": 1558833836, "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/s175305326.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s175305326", "user_id": "u317845566"}, "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)\n\tfmt.Scan(&m)\n\n\tvar re int\n\tgate := map[int]int{}\n\n\tfor index := 0; index < m; index++ {\n\t\tvar l, r int\n\t\tfmt.Scan(&l)\n\t\tfmt.Scan(&r)\n\t\tgate[l] = r\n\t}\n\n\tfor j := 1; j <= n; j++ {\n\t\tvar valid bool\n\t\tfor l, r := range gate {\n\t\t\tif l > j || r < j {\n\t\t\t\tvalid = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !valid {\n\t\t\tre++\n\t\t}\n\t}\n\tfmt.Println(re)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 400, "cpu_time_ms": 2108, "memory_kb": 7936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717798662", "group_id": "codeNet:p03042", "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\tvalue, _ := strconv.Atoi(sc.Text())\n\treturn value\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tS := sc.Text()\n\thead, _ := strconv.Atoi(S[:2])\n\ttail, _ := strconv.Atoi(S[2:])\n\tif head > 12 {\n\t\tif tail > 12 {\n\t\t\tfmt.Printf(\"NA\")\n\t\t} else {\n\t\t\tfmt.Printf(\"YYMM\")\n\t\t}\n\t} else {\n\t\tif tail > 12 {\n\t\t\tfmt.Printf(\"MMYY\")\n\t\t} else {\n\t\t\tfmt.Printf(\"AMBIGUOUS\")\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1558829944, "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/s717798662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s717798662", "user_id": "u967442619"}, "prompt_components": {"gold_output": "YYMM\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\tvalue, _ := strconv.Atoi(sc.Text())\n\treturn value\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Scan()\n\tS := sc.Text()\n\thead, _ := strconv.Atoi(S[:2])\n\ttail, _ := strconv.Atoi(S[2:])\n\tif head > 12 {\n\t\tif tail > 12 {\n\t\t\tfmt.Printf(\"NA\")\n\t\t} else {\n\t\t\tfmt.Printf(\"YYMM\")\n\t\t}\n\t} else {\n\t\tif tail > 12 {\n\t\t\tfmt.Printf(\"MMYY\")\n\t\t} else {\n\t\t\tfmt.Printf(\"AMBIGUOUS\")\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s782153679", "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 c > 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase 0 < c && c <= 12 && d > 12:\n\t\tfmt.Println(\"MMYY\")\n\tdefault:\n\t\tfmt.Println(\"NA\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558811026, "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/s782153679.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s782153679", "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 c > 12 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase 0 < c && c <= 12 && d > 12:\n\t\tfmt.Println(\"MMYY\")\n\tdefault:\n\t\tfmt.Println(\"NA\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 446, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s675312174", "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 > 0 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase d > 0 && 0 < c && c <= 12:\n\t\tfmt.Println(\"MMYY\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558810660, "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/s675312174.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s675312174", "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 > 0 && 0 < d && d <= 12:\n\t\tfmt.Println(\"YYMM\")\n\tcase d > 0 && 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s549922710", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc isMonth(n int) bool {\n\treturn 1 <= n && n <= 12\n}\n\nfunc main() {\n\n\tstdin := bufio.NewScanner(os.Stdin)\n\n\t// 一行目\n\tstdin.Scan()\n\tline1 := stdin.Text()\n\thead, _ := strconv.Atoi(line1[0:2])\n\ttail, _ := strconv.Atoi(line1[2:4])\n\n\tif isMonth(head) && isMonth(tail) {\n\t\tfmt.Println(\"AMBIGUOUS\")\n\t} else if isMonth(head) {\n\t\tfmt.Println(\"MMYY\")\n\t} else if isMonth(tail) {\n\t\tfmt.Println(\"YYMM\")\n\t} else {\n\t\tfmt.Println(\"NA\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558332819, "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/s549922710.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s549922710", "user_id": "u578274732"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc isMonth(n int) bool {\n\treturn 1 <= n && n <= 12\n}\n\nfunc main() {\n\n\tstdin := bufio.NewScanner(os.Stdin)\n\n\t// 一行目\n\tstdin.Scan()\n\tline1 := stdin.Text()\n\thead, _ := strconv.Atoi(line1[0:2])\n\ttail, _ := strconv.Atoi(line1[2:4])\n\n\tif isMonth(head) && isMonth(tail) {\n\t\tfmt.Println(\"AMBIGUOUS\")\n\t} else if isMonth(head) {\n\t\tfmt.Println(\"MMYY\")\n\t} else if isMonth(tail) {\n\t\tfmt.Println(\"YYMM\")\n\t} else {\n\t\tfmt.Println(\"NA\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s016512555", "group_id": "codeNet:p03042", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tFint, _ := strconv.Atoi(S[0:2])\n\tSint, _ := strconv.Atoi(S[2:4])\n\tif Fint == 0 && Sint == 0 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif Fint > 12 && Sint > 12 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif Fint <= 12 && Sint <= 12 {\n\t\tif Fint == 0 {\n\t\t\tfmt.Println(\"YYMM\")\n\t\t\treturn\n\t\t}\n\t\tif Sint == 0 {\n\t\t\tfmt.Println(\"MMYY\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"AMBIGUOUS\")\n\t} else if Fint <= 12 && Sint > 12 {\n\t\tfmt.Println(\"MMYY\")\n\t} else if Fint > 12 && Sint <= 12 {\n\t\tfmt.Println(\"YYMM\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558319462, "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/s016512555.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s016512555", "user_id": "u008666209"}, "prompt_components": {"gold_output": "YYMM\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tFint, _ := strconv.Atoi(S[0:2])\n\tSint, _ := strconv.Atoi(S[2:4])\n\tif Fint == 0 && Sint == 0 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif Fint > 12 && Sint > 12 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif Fint <= 12 && Sint <= 12 {\n\t\tif Fint == 0 {\n\t\t\tfmt.Println(\"YYMM\")\n\t\t\treturn\n\t\t}\n\t\tif Sint == 0 {\n\t\t\tfmt.Println(\"MMYY\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"AMBIGUOUS\")\n\t} else if Fint <= 12 && Sint > 12 {\n\t\tfmt.Println(\"MMYY\")\n\t} else if Fint > 12 && Sint <= 12 {\n\t\tfmt.Println(\"YYMM\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s516737932", "group_id": "codeNet:p03042", "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\ts := getNextLine(scanner)\n\tpart1, _ := strconv.Atoi(s[0:2])\n\tpart2, _ := strconv.Atoi(s[2:])\n\tif part1 == 0 || part2 == 0 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif part1 > 12 && part2 > 12 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif part1 > 12 && part2 <= 12 {\n\t\tfmt.Println(\"YYMM\")\n\t\treturn\n\t}\n\tif part2 > 12 && part1 <= 12 {\n\t\tfmt.Println(\"MMYY\")\n\t\treturn\n\t}\n\tfmt.Println(\"AMBIGUOUS\")\n}\n", "language": "Go", "metadata": {"date": 1558314837, "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/s516737932.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s516737932", "user_id": "u150542210"}, "prompt_components": {"gold_output": "YYMM\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\ts := getNextLine(scanner)\n\tpart1, _ := strconv.Atoi(s[0:2])\n\tpart2, _ := strconv.Atoi(s[2:])\n\tif part1 == 0 || part2 == 0 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif part1 > 12 && part2 > 12 {\n\t\tfmt.Println(\"NA\")\n\t\treturn\n\t}\n\tif part1 > 12 && part2 <= 12 {\n\t\tfmt.Println(\"YYMM\")\n\t\treturn\n\t}\n\tif part2 > 12 && part1 <= 12 {\n\t\tfmt.Println(\"MMYY\")\n\t\treturn\n\t}\n\tfmt.Println(\"AMBIGUOUS\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 996, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s231951320", "group_id": "codeNet:p03043", "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\tans := 0.0\n\tfor i := 1; i <= n; i++ {\n\t\tscore := i\n\t\tcal := 1.0 / float64(n)\n\t\tfor score < k {\n\t\t\tscore *= 2\n\t\t\tcal *= 0.5\n\t\t}\n\t\tans += cal\n\t}\n\tfmt.Print(ans)\n}\n", "language": "Go", "metadata": {"date": 1578252784, "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/s231951320.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s231951320", "user_id": "u303616227"}, "prompt_components": {"gold_output": "0.145833333333\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\tans := 0.0\n\tfor i := 1; i <= n; i++ {\n\t\tscore := i\n\t\tcal := 1.0 / float64(n)\n\t\tfor score < k {\n\t\t\tscore *= 2\n\t\t\tcal *= 0.5\n\t\t}\n\t\tans += cal\n\t}\n\tfmt.Print(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 242, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117000104", "group_id": "codeNet:p03043", "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\tN := oneInt()\n\tK := oneInt()\n\tvar temp = asK(K) - 1\n\tvar result float64\n\tresult = 0.5\n\tfor index := 0; index < temp - 1; index++ {\n\t\tresult += 0.5 * result\n\t}\n\tresult = float64(1/N) * result\n\tfmt.Printf(\"%f\",result)\n}\n\nfunc asK(val int) int {\n\tvar count int\n\tvar kaijo int\n\tkaijo = 1\n\tcount = 0\n\tfor {\n\t\tif kaijo > val {\n\t\t\treturn count\n\t\t}\n\t\tkaijo = kaijo * 2\n\t\tcount++\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558319825, "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/s117000104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117000104", "user_id": "u643520570"}, "prompt_components": {"gold_output": "0.145833333333\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\tN := oneInt()\n\tK := oneInt()\n\tvar temp = asK(K) - 1\n\tvar result float64\n\tresult = 0.5\n\tfor index := 0; index < temp - 1; index++ {\n\t\tresult += 0.5 * result\n\t}\n\tresult = float64(1/N) * result\n\tfmt.Printf(\"%f\",result)\n}\n\nfunc asK(val int) int {\n\tvar count int\n\tvar kaijo int\n\tkaijo = 1\n\tcount = 0\n\tfor {\n\t\tif kaijo > val {\n\t\t\treturn count\n\t\t}\n\t\tkaijo = kaijo * 2\n\t\tcount++\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2041, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187080480", "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\tans := float64(0)\n\tfor i := 1; i <= n; i++ {\n\t\tbnb := n\n\t\tsum := i\n\t\tfor sum < k {\n\t\t\tbnb *= 2\n\t\t\tsum *= 2\n\t\t}\n\t\tans += float64(1) / float64(bnb)\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1558315120, "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/s187080480.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187080480", "user_id": "u375977529"}, "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\tans := float64(0)\n\tfor i := 1; i <= n; i++ {\n\t\tbnb := n\n\t\tsum := i\n\t\tfor sum < k {\n\t\t\tbnb *= 2\n\t\t\tsum *= 2\n\t\t}\n\t\tans += float64(1) / float64(bnb)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s651662226", "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 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 dfs(v, c int) bool {\n\tcolors[v] = c\n\tfor _, nextv := range G[v] {\n\t\tif colors[nextv.to] != -1 {\n\t\t\tif colors[nextv.to] == c {\n\t\t\t\tif nextv.cost%2 == 0 {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t\n\t\t\tcontinue\n\t\t}\n\n\t\tif !dfs(nextv.to, 1-c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\ntype edge struct {\n\tto int\n\tcost int\n}\n\nvar G [][]edge\nvar N int\nvar colors []int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN = nextInt()\n\tG = make([][]edge, N)\n\tfor i := 0; i < N; i++ {\n\t\tG[i] = make([]edge, 0)\n\t}\n\tcolors = make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcolors[i] = -1\n\t}\n\n\tfor i := 0; i < N-1; i++ {\n\t\tu, v, w := nextInt()-1, nextInt()-1, nextInt()\n\t\tG[u] = append(G[u], edge{to: v, cost: w})\n\t\tG[v] = append(G[v], edge{to: u, cost: w})\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif colors[i] != -1 {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(i, 0)\n\t}\n\n\tfor _, c := range colors {\n\t\tfmt.Println(c)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564082398, "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/s651662226.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s651662226", "user_id": "u710190793"}, "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 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 dfs(v, c int) bool {\n\tcolors[v] = c\n\tfor _, nextv := range G[v] {\n\t\tif colors[nextv.to] != -1 {\n\t\t\tif colors[nextv.to] == c {\n\t\t\t\tif nextv.cost%2 == 0 {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\t\n\t\t\tcontinue\n\t\t}\n\n\t\tif !dfs(nextv.to, 1-c) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\ntype edge struct {\n\tto int\n\tcost int\n}\n\nvar G [][]edge\nvar N int\nvar colors []int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN = nextInt()\n\tG = make([][]edge, N)\n\tfor i := 0; i < N; i++ {\n\t\tG[i] = make([]edge, 0)\n\t}\n\tcolors = make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcolors[i] = -1\n\t}\n\n\tfor i := 0; i < N-1; i++ {\n\t\tu, v, w := nextInt()-1, nextInt()-1, nextInt()\n\t\tG[u] = append(G[u], edge{to: v, cost: w})\n\t\tG[v] = append(G[v], edge{to: u, cost: w})\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif colors[i] != -1 {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(i, 0)\n\t}\n\n\tfor _, c := range colors {\n\t\tfmt.Println(c)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "sample_input": "3\n1 2 2\n2 3 1\n"}, "reference_outputs": ["0\n0\n1\n"], "source_document_id": "p03044", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1084, "cpu_time_ms": 301, "memory_kb": 23424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s658061328", "group_id": "codeNet:p03045", "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\tN := readi()\n\tM := readi()\n\n\tuf := NewUnionFind(N)\n\tfor i := 0; i < M; i++ {\n\t\tx := readi() - 1\n\t\ty := readi() - 1\n\t\t_ = readi()\n\t\tuf.Union(x, y)\n\t}\n\tvar ans int\n\tcounted := make([]bool, N)\n\tfor i := range counted {\n\t\tp := uf.Find(i)\n\t\tif !counted[p] {\n\t\t\tcounted[p] = true\n\t\t\tans++\n\t\t}\n\t}\n\tprintln(ans)\n}\n\ntype UnionFind struct {\n\tparent []int\n\trank []int\n\tsize []int\n}\n\n// Initialize UnionFind for [0, n) elements.\n// If you need [1, n] items, use NewUnionFind(n+1) then ignore 0.\nfunc NewUnionFind(n int) *UnionFind {\n\tu := &UnionFind{\n\t\tparent: make([]int, n),\n\t\trank: make([]int, n),\n\t\tsize: make([]int, n),\n\t}\n\n\tfor i := range u.parent {\n\t\tu.parent[i] = i\n\t\tu.rank[i] = 0\n\t\tu.size[i] = 1\n\t}\n\n\treturn u\n}\n\nfunc (u *UnionFind) Find(i int) int {\n\tif u.parent[i] == i {\n\t\treturn i\n\t}\n\tp := u.Find(u.parent[i])\n\tu.parent[i] = p\n\treturn p\n}\n\nfunc (u *UnionFind) Union(i, j int) {\n\tp := u.Find(i)\n\tq := u.Find(j)\n\n\tif p == q {\n\t\treturn\n\t}\n\n\tif u.rank[p] < u.rank[q] {\n\t\tp, q = q, p\n\t}\n\tu.parent[p] = q\n\tif u.rank[p] == u.rank[q] {\n\t\tu.rank[q]++\n\t}\n\tu.size[q] += u.size[p]\n}\n\nfunc (u *UnionFind) Size(i int) int {\n\tp := u.Find(i)\n\treturn u.size[p]\n}\n", "language": "Go", "metadata": {"date": 1579723690, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03045.html", "problem_id": "p03045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03045/input.txt", "sample_output_relpath": "derived/input_output/data/p03045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03045/Go/s658061328.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s658061328", "user_id": "u705974985"}, "prompt_components": {"gold_output": "2\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\tN := readi()\n\tM := readi()\n\n\tuf := NewUnionFind(N)\n\tfor i := 0; i < M; i++ {\n\t\tx := readi() - 1\n\t\ty := readi() - 1\n\t\t_ = readi()\n\t\tuf.Union(x, y)\n\t}\n\tvar ans int\n\tcounted := make([]bool, N)\n\tfor i := range counted {\n\t\tp := uf.Find(i)\n\t\tif !counted[p] {\n\t\t\tcounted[p] = true\n\t\t\tans++\n\t\t}\n\t}\n\tprintln(ans)\n}\n\ntype UnionFind struct {\n\tparent []int\n\trank []int\n\tsize []int\n}\n\n// Initialize UnionFind for [0, n) elements.\n// If you need [1, n] items, use NewUnionFind(n+1) then ignore 0.\nfunc NewUnionFind(n int) *UnionFind {\n\tu := &UnionFind{\n\t\tparent: make([]int, n),\n\t\trank: make([]int, n),\n\t\tsize: make([]int, n),\n\t}\n\n\tfor i := range u.parent {\n\t\tu.parent[i] = i\n\t\tu.rank[i] = 0\n\t\tu.size[i] = 1\n\t}\n\n\treturn u\n}\n\nfunc (u *UnionFind) Find(i int) int {\n\tif u.parent[i] == i {\n\t\treturn i\n\t}\n\tp := u.Find(u.parent[i])\n\tu.parent[i] = p\n\treturn p\n}\n\nfunc (u *UnionFind) Union(i, j int) {\n\tp := u.Find(i)\n\tq := u.Find(j)\n\n\tif p == q {\n\t\treturn\n\t}\n\n\tif u.rank[p] < u.rank[q] {\n\t\tp, q = q, p\n\t}\n\tu.parent[p] = q\n\tif u.rank[p] == u.rank[q] {\n\t\tu.rank[q]++\n\t}\n\tu.size[q] += u.size[p]\n}\n\nfunc (u *UnionFind) Size(i int) int {\n\tp := u.Find(i)\n\treturn u.size[p]\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "sample_input": "3 1\n1 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03045", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6673, "cpu_time_ms": 58, "memory_kb": 9984}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787156837", "group_id": "codeNet:p03049", "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 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 min(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 main() {\n\tn := scanInt()\n\tans := 0\n\tcab, ca, cb := 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\ts := scanString()\n\t\tans += strings.Count(s, \"AB\")\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tcab++\n\t\t} else if s[0] == 'B' {\n\t\t\tcb++\n\t\t} else if s[len(s)-1] == 'A' {\n\t\t\tca++\n\t\t}\n\t}\n\tif ca > 0 && cab > 0 {\n\t\tca--\n\t\tans++\n\t}\n\tif cb > 0 && cab > 0 {\n\t\tcb--\n\t\tans++\n\t}\n\tif cab > 0 {\n\t\tans += cab - 1\n\t}\n\tans += min(ca, cb)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1589199873, "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/s787156837.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s787156837", "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\"strconv\"\n\t\"strings\"\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 min(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 main() {\n\tn := scanInt()\n\tans := 0\n\tcab, ca, cb := 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\ts := scanString()\n\t\tans += strings.Count(s, \"AB\")\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tcab++\n\t\t} else if s[0] == 'B' {\n\t\t\tcb++\n\t\t} else if s[len(s)-1] == 'A' {\n\t\t\tca++\n\t\t}\n\t}\n\tif ca > 0 && cab > 0 {\n\t\tca--\n\t\tans++\n\t}\n\tif cb > 0 && cab > 0 {\n\t\tcb--\n\t\tans++\n\t}\n\tif cab > 0 {\n\t\tans += cab - 1\n\t}\n\tans += min(ca, cb)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 885, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s234013284", "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 if hb > ta {\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} else {\n\t\tif ta < hbta {\n\t\t\tans += 2 * ta\n\t\t\thbta -= ta\n\t\t\tans += hbta - 1\n\t\t} else {\n\t\t\tans += 2 * hbta\n\t\t\tta -= hbta\n\t\t\tans += ta\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557629845, "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/s234013284.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s234013284", "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 if hb > ta {\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} else {\n\t\tif ta < hbta {\n\t\t\tans += 2 * ta\n\t\t\thbta -= ta\n\t\t\tans += hbta - 1\n\t\t} else {\n\t\t\tans += 2 * hbta\n\t\t\tta -= hbta\n\t\t\tans += ta\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 47, "memory_kb": 1408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269956998", "group_id": "codeNet:p03049", "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\tbstart := 0\n\taend := 0\n\tboth := 0\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\ts := getNextLine(scanner)\n\t\tif s[0] == 'B' {\n\t\t\tbstart++\n\t\t}\n\t\tif s[len(s)-1] == 'A' {\n\t\t\taend++\n\t\t}\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tboth++\n\t\t}\n\t\tfor j := 1; j < len(s); j++ {\n\t\t\tif s[j-1] == 'A' && s[j] == 'B' {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tans += minint(minint(bstart, aend), n-1)\n\tif bstart == aend && bstart == both && n > both {\n\t\tans--\n\t}\n\tfmt.Println(ans)\n}\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}", "language": "Go", "metadata": {"date": 1557628983, "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/s269956998.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s269956998", "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\"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\tbstart := 0\n\taend := 0\n\tboth := 0\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\ts := getNextLine(scanner)\n\t\tif s[0] == 'B' {\n\t\t\tbstart++\n\t\t}\n\t\tif s[len(s)-1] == 'A' {\n\t\t\taend++\n\t\t}\n\t\tif s[0] == 'B' && s[len(s)-1] == 'A' {\n\t\t\tboth++\n\t\t}\n\t\tfor j := 1; j < len(s); j++ {\n\t\t\tif s[j-1] == 'A' && s[j] == 'B' {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tans += minint(minint(bstart, aend), n-1)\n\tif bstart == aend && bstart == both && n > both {\n\t\tans--\n\t}\n\tfmt.Println(ans)\n}\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1178, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s406403977", "group_id": "codeNet:p03049", "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\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 rs() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\n\tvar s string\n\tctAB, ctTailA, ctHeadB, ctTailAHeadB := 0, 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\ts = rs()\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\tctAB++\n\t\t\t}\n\t\t}\n\t\tif s[len(s)-1] == 'A' {\n\t\t\tctTailA++\n\t\t}\n\t\tif s[0] == 'B' {\n\t\t\tctHeadB++\n\t\t}\n\t\tif s[len(s)-1] == 'A' && s[0] == 'B' {\n\t\t\tctTailAHeadB++\n\t\t}\n\t}\n\n\tans := -1\n\tans = ctAB + smaller(ctTailA, ctHeadB)\n\tif ctTailAHeadB != 0 && ctTailAHeadB == ctTailA && ctTailAHeadB == ctHeadB {\n\t\tans--\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557628561, "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/s406403977.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s406403977", "user_id": "u554269352"}, "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 sc = bufio.NewScanner(os.Stdin)\n\nconst inf = 1 << 60\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 rs() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\n\tvar s string\n\tctAB, ctTailA, ctHeadB, ctTailAHeadB := 0, 0, 0, 0\n\tfor i := 0; i < n; i++ {\n\t\ts = rs()\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\tctAB++\n\t\t\t}\n\t\t}\n\t\tif s[len(s)-1] == 'A' {\n\t\t\tctTailA++\n\t\t}\n\t\tif s[0] == 'B' {\n\t\t\tctHeadB++\n\t\t}\n\t\tif s[len(s)-1] == 'A' && s[0] == 'B' {\n\t\t\tctTailAHeadB++\n\t\t}\n\t}\n\n\tans := -1\n\tans = ctAB + smaller(ctTailA, ctHeadB)\n\tif ctTailAHeadB != 0 && ctTailAHeadB == ctTailA && ctTailAHeadB == ctHeadB {\n\t\tans--\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 878, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s383060181", "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\tif sumOfAB > 0 {\n\t\tresult = result - 1\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": 1557627544, "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/s383060181.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s383060181", "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\tif sumOfAB > 0 {\n\t\tresult = result - 1\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2584, "cpu_time_ms": 49, "memory_kb": 2176}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s743497493", "group_id": "codeNet:p03050", "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 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\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tans := 0\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 && i < n/i-1{\n\t\t\tans += n/i-1\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n", "language": "Go", "metadata": {"date": 1582329293, "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/s743497493.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s743497493", "user_id": "u548992197"}, "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, 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\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tans := 0\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 && i < n/i-1{\n\t\t\tans += n/i-1\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1005, "cpu_time_ms": 12, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s461209897", "group_id": "codeNet:p03050", "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)\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/*********** 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n int\n\nfunc main() {\n\tn = ReadInt()\n\n\tans := 0\n\tfor a := 1; a*a+a < n; a++ {\n\t\tm := n/a - 1\n\t\tif n%a == 0 {\n\t\t\tans += m\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1557638168, "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/s461209897.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s461209897", "user_id": "u103600314"}, "prompt_components": {"gold_output": "10\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)\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/*********** 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n int\n\nfunc main() {\n\tn = ReadInt()\n\n\tans := 0\n\tfor a := 1; a*a+a < n; a++ {\n\t\tm := n/a - 1\n\t\tif n%a == 0 {\n\t\t\tans += m\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6134, "cpu_time_ms": 23, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s595565532", "group_id": "codeNet:p03054", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w, n, sr, sc int\n\tvar s, t string\n\tfmt.Scan(&h, &w, &n, &sr, &sc, &s, &t)\n\n\tans := \"YES\"\n\n\tri := w\n\tli := 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif t[i] == 'L' && ri < w {\n\t\t\tri++\n\t\t} else if t[i] == 'R' && li > 1 {\n\t\t\tli--\n\t\t}\n\t\tif s[i] == 'L' {\n\t\t\tli++\n\t\t} else if s[i] == 'R' {\n\t\t\tri--\n\t\t}\n\t\tif li > ri {\n\t\t\tans = \"NO\"\n\t\t\tbreak\n\t\t}\n\t}\n\tif sc < li || ri < sc {\n\t\tans = \"NO\"\n\t}\n\n\tdi := h\n\tui := 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif t[i] == 'U' && di < h {\n\t\t\tdi++\n\t\t} else if t[i] == 'D' && ui > 1 {\n\t\t\tui--\n\t\t}\n\t\tif s[i] == 'U' {\n\t\t\tui++\n\t\t} else if s[i] == 'D' {\n\t\t\tdi--\n\t\t}\n\t\tif ui > di {\n\t\t\tans = \"NO\"\n\t\t\tbreak\n\t\t}\n\t}\n\tif sr < ui || di < sr {\n\t\tans = \"NO\"\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1557022274, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03054.html", "problem_id": "p03054", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03054/input.txt", "sample_output_relpath": "derived/input_output/data/p03054/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03054/Go/s595565532.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595565532", "user_id": "u113872560"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w, n, sr, sc int\n\tvar s, t string\n\tfmt.Scan(&h, &w, &n, &sr, &sc, &s, &t)\n\n\tans := \"YES\"\n\n\tri := w\n\tli := 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif t[i] == 'L' && ri < w {\n\t\t\tri++\n\t\t} else if t[i] == 'R' && li > 1 {\n\t\t\tli--\n\t\t}\n\t\tif s[i] == 'L' {\n\t\t\tli++\n\t\t} else if s[i] == 'R' {\n\t\t\tri--\n\t\t}\n\t\tif li > ri {\n\t\t\tans = \"NO\"\n\t\t\tbreak\n\t\t}\n\t}\n\tif sc < li || ri < sc {\n\t\tans = \"NO\"\n\t}\n\n\tdi := h\n\tui := 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif t[i] == 'U' && di < h {\n\t\t\tdi++\n\t\t} else if t[i] == 'D' && ui > 1 {\n\t\t\tui--\n\t\t}\n\t\tif s[i] == 'U' {\n\t\t\tui++\n\t\t} else if s[i] == 'D' {\n\t\t\tdi--\n\t\t}\n\t\tif ui > di {\n\t\t\tans = \"NO\"\n\t\t\tbreak\n\t\t}\n\t}\n\tif sr < ui || di < sr {\n\t\tans = \"NO\"\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a rectangular grid of squares with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left.\nOn this grid, there is a piece, which is initially placed at square (s_r,s_c).\n\nTakahashi and Aoki will play a game, where each player has a string of length N.\nTakahashi's string is S, and Aoki's string is T. S and T both consist of four kinds of letters: L, R, U and D.\n\nThe game consists of N steps. The i-th step proceeds as follows:\n\nFirst, Takahashi performs a move. He either moves the piece in the direction of S_i, or does not move the piece.\n\nSecond, Aoki performs a move. He either moves the piece in the direction of T_i, or does not move the piece.\n\nHere, to move the piece in the direction of L, R, U and D, is to move the piece from square (r,c) to square (r,c-1), (r,c+1), (r-1,c) and (r+1,c), respectively. If the destination square does not exist, the piece is removed from the grid, and the game ends, even if less than N steps are done.\n\nTakahashi wants to remove the piece from the grid in one of the N steps.\nAoki, on the other hand, wants to finish the N steps with the piece remaining on the grid.\nDetermine if the piece will remain on the grid at the end of the game when both players play optimally.\n\nConstraints\n\n2 \\leq H,W \\leq 2 \\times 10^5\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq s_r \\leq H\n\n1 \\leq s_c \\leq W\n\n|S|=|T|=N\n\nS and T consists of the four kinds of letters L, R, U and D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W N\ns_r s_c\nS\nT\n\nOutput\n\nIf the piece will remain on the grid at the end of the game, print YES; otherwise, print NO.\n\nSample Input 1\n\n2 3 3\n2 2\nRRL\nLUD\n\nSample Output 1\n\nYES\n\nHere is one possible progress of the game:\n\nTakahashi moves the piece right. The piece is now at (2,3).\n\nAoki moves the piece left. The piece is now at (2,2).\n\nTakahashi does not move the piece. The piece remains at (2,2).\n\nAoki moves the piece up. The piece is now at (1,2).\n\nTakahashi moves the piece left. The piece is now at (1,1).\n\nAoki does not move the piece. The piece remains at (1,1).\n\nSample Input 2\n\n4 3 5\n2 2\nUDRRR\nLLDUD\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n5 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD\n\nSample Output 3\n\nNO", "sample_input": "2 3 3\n2 2\nRRL\nLUD\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03054", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a rectangular grid of squares with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i-th row from the top and the j-th column from the left.\nOn this grid, there is a piece, which is initially placed at square (s_r,s_c).\n\nTakahashi and Aoki will play a game, where each player has a string of length N.\nTakahashi's string is S, and Aoki's string is T. S and T both consist of four kinds of letters: L, R, U and D.\n\nThe game consists of N steps. The i-th step proceeds as follows:\n\nFirst, Takahashi performs a move. He either moves the piece in the direction of S_i, or does not move the piece.\n\nSecond, Aoki performs a move. He either moves the piece in the direction of T_i, or does not move the piece.\n\nHere, to move the piece in the direction of L, R, U and D, is to move the piece from square (r,c) to square (r,c-1), (r,c+1), (r-1,c) and (r+1,c), respectively. If the destination square does not exist, the piece is removed from the grid, and the game ends, even if less than N steps are done.\n\nTakahashi wants to remove the piece from the grid in one of the N steps.\nAoki, on the other hand, wants to finish the N steps with the piece remaining on the grid.\nDetermine if the piece will remain on the grid at the end of the game when both players play optimally.\n\nConstraints\n\n2 \\leq H,W \\leq 2 \\times 10^5\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq s_r \\leq H\n\n1 \\leq s_c \\leq W\n\n|S|=|T|=N\n\nS and T consists of the four kinds of letters L, R, U and D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W N\ns_r s_c\nS\nT\n\nOutput\n\nIf the piece will remain on the grid at the end of the game, print YES; otherwise, print NO.\n\nSample Input 1\n\n2 3 3\n2 2\nRRL\nLUD\n\nSample Output 1\n\nYES\n\nHere is one possible progress of the game:\n\nTakahashi moves the piece right. The piece is now at (2,3).\n\nAoki moves the piece left. The piece is now at (2,2).\n\nTakahashi does not move the piece. The piece remains at (2,2).\n\nAoki moves the piece up. The piece is now at (1,2).\n\nTakahashi moves the piece left. The piece is now at (1,1).\n\nAoki does not move the piece. The piece remains at (1,1).\n\nSample Input 2\n\n4 3 5\n2 2\nUDRRR\nLLDUD\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n5 6 11\n2 1\nRLDRRUDDLRL\nURRDRLLDLRD\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 732, "cpu_time_ms": 218, "memory_kb": 2176}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s934777940", "group_id": "codeNet:p03055", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\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 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}\n\nfunc dijkstra(E *[][]int, s int) (D []int) {\n N := len((*E))\n D = make([]int, N)\n for i := 0; i < N; i++ {\n if i != s {\n D[i] = -1\n }\n }\n Q := make([]int, N)\n Q[0] = s\n var v int\n pos := 1\n for i := 0; i < N; i++ {\n v = Q[i]\n for _, adj := range (*E)[v] {\n if D[adj] >= 0 {\n continue\n }\n D[adj] = D[v] + 1\n Q[pos] = adj\n pos += 1\n }\n }\n return\n}\n\nfunc max(A *[]int) (i, a int) {\n i = 0\n a = (*A)[0]\n for _i, _a := range (*A) {\n if _a > a {\n a = _a\n i = _i\n }\n }\n return\n}\n\nfunc main() {\n var N int\n N = NextInt()\n E := make([][]int, N)\n for i := range E {\n E[i] = make([]int, 0)\n }\n var a, b int\n for i := 0; i < N - 1; i++ {\n ab := NextIntVec()\n a = ab[0]\n b = ab[1]\n E[a - 1] = append(E[a - 1], b - 1)\n E[b - 1] = append(E[b - 1], a - 1)\n }\n D0 := dijkstra(&E, 0)\n s, _ := max(&D0)\n D1 := dijkstra(&E, s)\n _, L := max(&D1)\n if L % 3 != 1 {\n fmt.Println(\"First\")\n } else {\n fmt.Println(\"Second\")\n }\n}", "language": "Go", "metadata": {"date": 1569214948, "filename_ext": "go", "original_language": "Go (1.6)", "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/s934777940.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s934777940", "user_id": "u415905784"}, "prompt_components": {"gold_output": "First\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\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 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}\n\nfunc dijkstra(E *[][]int, s int) (D []int) {\n N := len((*E))\n D = make([]int, N)\n for i := 0; i < N; i++ {\n if i != s {\n D[i] = -1\n }\n }\n Q := make([]int, N)\n Q[0] = s\n var v int\n pos := 1\n for i := 0; i < N; i++ {\n v = Q[i]\n for _, adj := range (*E)[v] {\n if D[adj] >= 0 {\n continue\n }\n D[adj] = D[v] + 1\n Q[pos] = adj\n pos += 1\n }\n }\n return\n}\n\nfunc max(A *[]int) (i, a int) {\n i = 0\n a = (*A)[0]\n for _i, _a := range (*A) {\n if _a > a {\n a = _a\n i = _i\n }\n }\n return\n}\n\nfunc main() {\n var N int\n N = NextInt()\n E := make([][]int, N)\n for i := range E {\n E[i] = make([]int, 0)\n }\n var a, b int\n for i := 0; i < N - 1; i++ {\n ab := NextIntVec()\n a = ab[0]\n b = ab[1]\n E[a - 1] = append(E[a - 1], b - 1)\n E[b - 1] = append(E[b - 1], a - 1)\n }\n D0 := dijkstra(&E, 0)\n s, _ := max(&D0)\n D1 := dijkstra(&E, s)\n _, L := max(&D1)\n if L % 3 != 1 {\n fmt.Println(\"First\")\n } else {\n fmt.Println(\"Second\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1649, "cpu_time_ms": 230, "memory_kb": 23296}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s245791182", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport \"fmt\"\n\n// import \"fmt\"\nfunc readline(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\treturn a\n}\n\nfunc main() {\n\tv := readline(3)\n\ta := v[0]\n\tb := v[1]\n\tt := v[2]\n\tres := (t / a) * b\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1558242444, "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/s245791182.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s245791182", "user_id": "u267552846"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\n// import \"fmt\"\nfunc readline(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\treturn a\n}\n\nfunc main() {\n\tv := readline(3)\n\ta := v[0]\n\tb := v[1]\n\tt := v[2]\n\tres := (t / a) * b\n\tfmt.Println(res)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s860673899", "group_id": "codeNet:p03059", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc stdioText(s *bufio.Scanner) string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc stdioNum(s *bufio.Scanner) int {\n\tnum, _ := strconv.Atoi(stdioText(s))\n\treturn num\n}\n\nfunc stdioNums(s *bufio.Scanner) []int {\n\tvar nums []int\n\tfor _, v := range strings.Split(stdioText(s), \" \") {\n\t\ti, _ := strconv.Atoi(v)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\tnums := stdioNums(s)\n\tfmt.Println(nums[2] / nums[0] * nums[1])\n}\n", "language": "Go", "metadata": {"date": 1556653529, "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/s860673899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s860673899", "user_id": "u425059542"}, "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\nfunc stdioText(s *bufio.Scanner) string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc stdioNum(s *bufio.Scanner) int {\n\tnum, _ := strconv.Atoi(stdioText(s))\n\treturn num\n}\n\nfunc stdioNums(s *bufio.Scanner) []int {\n\tvar nums []int\n\tfor _, v := range strings.Split(stdioText(s), \" \") {\n\t\ti, _ := strconv.Atoi(v)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\tnums := stdioNums(s)\n\tfmt.Println(nums[2] / nums[0] * nums[1])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 528, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s939073609", "group_id": "codeNet:p03060", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, r int\n\tfmt.Scan(&N)\n\tva := make([]int, N)\n\tca := make([]int, N)\n\tfor i := range va {\n\t\tfmt.Scan(&va[i])\n\t}\n\tfor i := range ca {\n\t\tfmt.Scan(&ca[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif va[i] > ca[i] {\n\t\t\tr += va[i] - ca[i]\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1557065704, "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/s939073609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s939073609", "user_id": "u298152049"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, r int\n\tfmt.Scan(&N)\n\tva := make([]int, N)\n\tca := make([]int, N)\n\tfor i := range va {\n\t\tfmt.Scan(&va[i])\n\t}\n\tfor i := range ca {\n\t\tfmt.Scan(&ca[i])\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif va[i] > ca[i] {\n\t\t\tr += va[i] - ca[i]\n\t\t}\n\t}\n\tfmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s698235365", "group_id": "codeNet:p03060", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&vs[i])\n\t}\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cs[i])\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif v := vs[i] - cs[i]; v > 0 {\n\t\t\tsum += v\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1556413957, "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/s698235365.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s698235365", "user_id": "u461993794"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&vs[i])\n\t}\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cs[i])\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif v := vs[i] - cs[i]; v > 0 {\n\t\t\tsum += v\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 316, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s532721554", "group_id": "codeNet:p03060", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvs := make([]int, n)\n\tfor i := range vs {\n\t\tfmt.Scan(&vs[i])\n\t}\n\tcs := make([]int, n)\n\tfor i := range cs {\n\t\tfmt.Scan(&cs[i])\n\t}\n\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tif tmp := vs[i] - cs[i]; tmp > 0 {\n\t\t\tans += tmp\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1556413791, "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/s532721554.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s532721554", "user_id": "u543933043"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvs := make([]int, n)\n\tfor i := range vs {\n\t\tfmt.Scan(&vs[i])\n\t}\n\tcs := make([]int, n)\n\tfor i := range cs {\n\t\tfmt.Scan(&cs[i])\n\t}\n\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tif tmp := vs[i] - cs[i]; tmp > 0 {\n\t\t\tans += tmp\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s976065464", "group_id": "codeNet:p03062", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"math\"\n)\n\nfunc makeabs(A []int) []int {\n\tfor i := 0; i < len(A); i++ {\n\t\tA[i] = int(math.Abs(float64(A[i])))\n\t}\n\treturn A\n}\n\nfunc sum(A []int) int {\n\ts := 0\n\tfor _, a := range A {\n\t\ts += a\n\t}\n\treturn s\n}\n\nfunc minAbs(A []int) int {\n\ts := math.Abs(float64(A[0]))\n\n\tfor i := 1; i < len(A); i++ {\n\t\tif t := math.Abs(float64(A[i])); t < s {\n\t\t\ts = t\n\t\t}\n\t}\n\n\treturn int(s)\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\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tn_neg := 0\n\tfor _, a := range A {\n\t\tif a < 0 {\n\t\t\tn_neg++\n\t\t}\n\t}\n\n\tif n_neg % 2 == 0 {\n\t\tfmt.Println(sum(makeabs(A)))\n\t} else {\n\t\tfmt.Println(sum(makeabs(A)) - 2 * minAbs(A))\n\t}\n}", "language": "Go", "metadata": {"date": 1560486459, "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/s976065464.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976065464", "user_id": "u255280439"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"math\"\n)\n\nfunc makeabs(A []int) []int {\n\tfor i := 0; i < len(A); i++ {\n\t\tA[i] = int(math.Abs(float64(A[i])))\n\t}\n\treturn A\n}\n\nfunc sum(A []int) int {\n\ts := 0\n\tfor _, a := range A {\n\t\ts += a\n\t}\n\treturn s\n}\n\nfunc minAbs(A []int) int {\n\ts := math.Abs(float64(A[0]))\n\n\tfor i := 1; i < len(A); i++ {\n\t\tif t := math.Abs(float64(A[i])); t < s {\n\t\t\ts = t\n\t\t}\n\t}\n\n\treturn int(s)\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\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tn_neg := 0\n\tfor _, a := range A {\n\t\tif a < 0 {\n\t\t\tn_neg++\n\t\t}\n\t}\n\n\tif n_neg % 2 == 0 {\n\t\tfmt.Println(sum(makeabs(A)))\n\t} else {\n\t\tfmt.Println(sum(makeabs(A)) - 2 * minAbs(A))\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 758, "cpu_time_ms": 762, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s538074591", "group_id": "codeNet:p03062", "input_text": "package main\n\nimport \"fmt\"\n\nfunc abs(x int64) int64 {\n if x > 0 {\n return x\n }\n return -x\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int64, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int64 = 0\n var min_a int64 = 1000000007\n var min_i int\n for i, v := range a {\n v = abs(v)\n if min_a > v {\n min_i = i\n min_a = v\n }\n }\n for i := 0; i < min_i; i++ {\n if a[i] < 0 {\n a[i] *= -1\n a[i + 1] *= -1\n }\n }\n for i := n - 1; i > min_i; i-- {\n if a[i] < 0 {\n a[i] *= -1\n a[i - 1] *= -1\n }\n }\n for _, v := range a {\n ans += v\n }\n fmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1556414234, "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/s538074591.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s538074591", "user_id": "u280512618"}, "prompt_components": {"gold_output": "19\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc abs(x int64) int64 {\n if x > 0 {\n return x\n }\n return -x\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int64, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n var ans int64 = 0\n var min_a int64 = 1000000007\n var min_i int\n for i, v := range a {\n v = abs(v)\n if min_a > v {\n min_i = i\n min_a = v\n }\n }\n for i := 0; i < min_i; i++ {\n if a[i] < 0 {\n a[i] *= -1\n a[i + 1] *= -1\n }\n }\n for i := n - 1; i > min_i; i-- {\n if a[i] < 0 {\n a[i] *= -1\n a[i - 1] *= -1\n }\n }\n for _, v := range a {\n ans += v\n }\n fmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 758, "cpu_time_ms": 723, "memory_kb": 6656}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s651034303", "group_id": "codeNet:p03063", "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\nfunc main() {\n\tn := nextInt()\n\ts := nextString()\n\tif len(s) != n {\n\t\tfmt.Println(s[n-1])\n\t}\n\ts1 := []byte(s)\n\ts2 := []byte(s)\n\tcnt1 := 0\n\tcnt2 := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tif s1[i] == '#' && s1[i+1] == '.' {\n\t\t\ts1[i] = '.'\n\t\t\tcnt1++\n\t\t\tfor j := i - 1; j >= 0; j-- {\n\t\t\t\tif s1[j] == '#' && s1[j+1] == '.' {\n\t\t\t\t\ts1[j] = '.'\n\t\t\t\t\tcnt1++\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}\n\tfor i := 0; i < n-1; i++ {\n\t\tif s2[i] == '#' && s2[i+1] == '.' {\n\t\t\ts2[i+1] = '#'\n\t\t\tcnt2++\n\t\t}\n\t}\n\tlog.Println(cnt1, string(s1))\n\tlog.Println(cnt2, string(s2))\n\tfmt.Println(min(cnt1, cnt2))\n}\n\nvar dy = []int{1, 0, -1, 0, 0}\nvar dx = []int{0, 1, 0, -1, 0}\nvar inf = 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\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\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 10000), int(1000000))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(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(string(nextReader()), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1555812007, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03063.html", "problem_id": "p03063", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03063/input.txt", "sample_output_relpath": "derived/input_output/data/p03063/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03063/Go/s651034303.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s651034303", "user_id": "u696272993"}, "prompt_components": {"gold_output": "1\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\nfunc main() {\n\tn := nextInt()\n\ts := nextString()\n\tif len(s) != n {\n\t\tfmt.Println(s[n-1])\n\t}\n\ts1 := []byte(s)\n\ts2 := []byte(s)\n\tcnt1 := 0\n\tcnt2 := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tif s1[i] == '#' && s1[i+1] == '.' {\n\t\t\ts1[i] = '.'\n\t\t\tcnt1++\n\t\t\tfor j := i - 1; j >= 0; j-- {\n\t\t\t\tif s1[j] == '#' && s1[j+1] == '.' {\n\t\t\t\t\ts1[j] = '.'\n\t\t\t\t\tcnt1++\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}\n\tfor i := 0; i < n-1; i++ {\n\t\tif s2[i] == '#' && s2[i+1] == '.' {\n\t\t\ts2[i+1] = '#'\n\t\t\tcnt2++\n\t\t}\n\t}\n\tlog.Println(cnt1, string(s1))\n\tlog.Println(cnt2, string(s2))\n\tfmt.Println(min(cnt1, cnt2))\n}\n\nvar dy = []int{1, 0, -1, 0, 0}\nvar dx = []int{0, 1, 0, -1, 0}\nvar inf = 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\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\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 10000), int(1000000))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(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(string(nextReader()), 64)\n\treturn f\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": "p03063", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2379, "cpu_time_ms": 14, "memory_kb": 3200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s058979604", "group_id": "codeNet:p03067", "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, _ := 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\ta, b, c := nextInt(), nextInt(), nextInt()\n\tif (a < c && c < b) || (a > c && c > b) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577766948, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03067.html", "problem_id": "p03067", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03067/input.txt", "sample_output_relpath": "derived/input_output/data/p03067/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03067/Go/s058979604.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058979604", "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\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\ta, b, c := nextInt(), nextInt(), nextInt()\n\tif (a < c && c < b) || (a > c && 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\nThere are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively.\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nConstraints\n\n0\\leq A,B,C\\leq 100\n\nA, B and C are distinct integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nSample Input 1\n\n3 8 5\n\nSample Output 1\n\nYes\n\nWe pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8.\n\nSample Input 2\n\n7 3 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n10 2 4\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n31 41 59\n\nSample Output 4\n\nNo", "sample_input": "3 8 5\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03067", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively.\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nConstraints\n\n0\\leq A,B,C\\leq 100\n\nA, B and C are distinct integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nSample Input 1\n\n3 8 5\n\nSample Output 1\n\nYes\n\nWe pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8.\n\nSample Input 2\n\n7 3 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n10 2 4\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n31 41 59\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 616, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s489139399", "group_id": "codeNet:p03067", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt() int {\n\tvar n int\n\tfmt.Scan(&n)\n\treturn n\n}\n\nfunc ReadIntF(f io.Reader) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadIntsF(f io.Reader, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadWord(f io.Reader) string {\n\tvar str string\n\tfmt.Scan(&str)\n\treturn str\n}\n\nfunc ReadWordF(f io.Reader) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\treturn str\n}\n\nfunc ReadLine() string {\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLineF(f io.Reader) string {\n\tr := bufio.NewReader(f)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLines(n int) []string {\n\tr := bufio.NewReader(os.Stdin)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\n\nfunc ReadLinesF(f io.Reader, n int) []string {\n\tr := bufio.NewReader(f)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\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}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc AllComb(n int) [][]int {\n\tn2 := 1 << uint(n)\n\tret := make([][]int, n2)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tret[i] = pat\n\t}\n\treturn ret\n}\n\nfunc AllCombChan(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\nfunc PermuteInts(nums []int) [][]int {\n\tn := Factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermuteInts(nums, &ret)\n\treturn ret\n}\n\nfunc permuteInts(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\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}\n\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n\n// }}}\n\nfunc main() {\n\ta, b, c := ReadInt(), ReadInt(), ReadInt()\n\tif (c > a && c < b) || (c > b && c < a) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1555808906, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03067.html", "problem_id": "p03067", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03067/input.txt", "sample_output_relpath": "derived/input_output/data/p03067/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03067/Go/s489139399.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s489139399", "user_id": "u700477434"}, "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\"strings\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt() int {\n\tvar n int\n\tfmt.Scan(&n)\n\treturn n\n}\n\nfunc ReadIntF(f io.Reader) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadIntsF(f io.Reader, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadWord(f io.Reader) string {\n\tvar str string\n\tfmt.Scan(&str)\n\treturn str\n}\n\nfunc ReadWordF(f io.Reader) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\treturn str\n}\n\nfunc ReadLine() string {\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLineF(f io.Reader) string {\n\tr := bufio.NewReader(f)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLines(n int) []string {\n\tr := bufio.NewReader(os.Stdin)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\n\nfunc ReadLinesF(f io.Reader, n int) []string {\n\tr := bufio.NewReader(f)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\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}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc AllComb(n int) [][]int {\n\tn2 := 1 << uint(n)\n\tret := make([][]int, n2)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tret[i] = pat\n\t}\n\treturn ret\n}\n\nfunc AllCombChan(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\nfunc PermuteInts(nums []int) [][]int {\n\tn := Factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermuteInts(nums, &ret)\n\treturn ret\n}\n\nfunc permuteInts(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\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}\n\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n\n// }}}\n\nfunc main() {\n\ta, b, c := ReadInt(), ReadInt(), ReadInt()\n\tif (c > a && c < b) || (c > b && c < a) {\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\nThere are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively.\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nConstraints\n\n0\\leq A,B,C\\leq 100\n\nA, B and C are distinct integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nSample Input 1\n\n3 8 5\n\nSample Output 1\n\nYes\n\nWe pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8.\n\nSample Input 2\n\n7 3 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n10 2 4\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n31 41 59\n\nSample Output 4\n\nNo", "sample_input": "3 8 5\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03067", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively.\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nConstraints\n\n0\\leq A,B,C\\leq 100\n\nA, B and C are distinct integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.\n\nSample Input 1\n\n3 8 5\n\nSample Output 1\n\nYes\n\nWe pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8.\n\nSample Input 2\n\n7 3 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n10 2 4\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n31 41 59\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5163, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s391026968", "group_id": "codeNet:p03068", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tvar s string\n\tfmt.Scan(&n, &s, &k)\n\tc := s[k-1 : k]\n\tans := \"\"\n\tfor _, v := range s {\n\t\tif string(v) == c {\n\t\t\tans += string(v)\n\t\t} else {\n\t\t\tans += \"*\"\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1555809006, "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/s391026968.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s391026968", "user_id": "u375977529"}, "prompt_components": {"gold_output": "*rr*r\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tvar s string\n\tfmt.Scan(&n, &s, &k)\n\tc := s[k-1 : k]\n\tans := \"\"\n\tfor _, v := range s {\n\t\tif string(v) == c {\n\t\t\tans += string(v)\n\t\t} else {\n\t\t\tans += \"*\"\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 237, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s916098466", "group_id": "codeNet:p03069", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tconst white, black = '.', '#'\n\tbeforeColor, toBlackCount, toWhiteCount := '.', 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tcurrentColor := int32(s[i])\n\t\tif beforeColor == black && currentColor == white {\n\t\t\ttoBlackCount++\n\t\t\tcurrentColor = black\n\t\t} else if currentColor == black && i != n - 1 {\n\t\t\ttoWhiteCount++\n\t\t}\n\t\tbeforeColor = currentColor\n\t}\n\n\tvar result int\n\tif toBlackCount < toWhiteCount {\n\t\tresult = toBlackCount\n\t} else {\n\t\tresult = toWhiteCount\n\t}\n\tfmt.Print(result);\n}\n", "language": "Go", "metadata": {"date": 1556219072, "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/s916098466.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s916098466", "user_id": "u252712957"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tconst white, black = '.', '#'\n\tbeforeColor, toBlackCount, toWhiteCount := '.', 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tcurrentColor := int32(s[i])\n\t\tif beforeColor == black && currentColor == white {\n\t\t\ttoBlackCount++\n\t\t\tcurrentColor = black\n\t\t} else if currentColor == black && i != n - 1 {\n\t\t\ttoWhiteCount++\n\t\t}\n\t\tbeforeColor = currentColor\n\t}\n\n\tvar result int\n\tif toBlackCount < toWhiteCount {\n\t\tresult = toBlackCount\n\t} else {\n\t\tresult = toWhiteCount\n\t}\n\tfmt.Print(result);\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 106, "memory_kb": 1920}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s893057806", "group_id": "codeNet:p03069", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n)\n\nfunc main() {\n\tdefer writer.Flush() // Use printf, scanf\n\n\t// CODE\n\tvar N int\n\tvar S []byte\n\tscanf(\"%d\\n\", &N)\n\tscanf(\"%s\\n\", &S)\n\n\t// #.##.\n\t// 232343\n\n\t// startBlack = 0\n\tv := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == '.' {\n\t\t\tv[0]++\n\t\t}\n\t}\n\n\tfor startBlack := 1; startBlack < N; startBlack++ {\n\t\tv[startBlack] = v[startBlack-1]\n\t\tif S[startBlack-1] == '.' {\n\t\t\tv[startBlack]--\n\t\t} else {\n\t\t\tv[startBlack]++\n\t\t}\n\t}\n\n\t// startBlack = N\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == '#' {\n\t\t\tv[N]++\n\t\t}\n\t}\n\n\tans := int(1e10)\n\tfor _, t := range v {\n\t\tans = minInt(ans, t)\n\t}\n\n\tprintf(\"%d\\n\", ans)\n}\n\n// I/O {{{\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tscanf(\"%d \", &res[i])\n\t}\n\tscanf(\"%d\\n\", &res[n-1])\n\treturn res\n}\n\n// }}}\n// {{{ dummy\nfunc dummy() {\n\tfmt.Printf(\"Hello, World\\n\")\n\tfmt.Printf(\"%v\", reflect.TypeOf(0))\n\n\tarr := []int{10, 9, 8, 7, 1}\n\tsort.Ints(arr)\n\tfmt.Println(arr)\n}\n\n// }}}\n// Set {{{\n// s := NewSet()\n// s.Add(\"a\")\n// s.Add(\"b\")\n\n// for i, v := range s.GetSlice() {\n// \t// 0 a\n// \t// 1 b\n// \tprintf(\"%d %s\\n\", i, v.(string))\n// }\n\n// printf(\"%v\\n\", s.Contains(\"a\")) // true\n// printf(\"%v\\n\", s.Contains(\"x\")) // false\ntype Set map[interface{}]struct{}\n\nfunc NewSet() Set {\n\treturn Set{}\n}\n\nfunc (s *Set) Add(x interface{}) {\n\t(*s)[x] = struct{}{}\n}\n\nfunc (s Set) Contains(x interface{}) bool {\n\t_, ok := s[x]\n\treturn ok\n}\n\nfunc (s Set) GetSlice() []interface{} {\n\trc := []interface{}{}\n\tfor key, _ := range s {\n\t\trc = append(rc, key)\n\t}\n\treturn rc\n}\n\n// }}}\n// Math {{{\nfunc maxInt(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc minInt(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// }}}\n// PriorityQueue {{{\n// Usage:\n// type Person struct {\n// \tname string\n// \tage int\n// }\n//\n// func (p1 Person) Less(p2 interface{}) bool {\n// \treturn p1.age < p2.(Person).age\n// }\n//\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n// \tdefer out.Flush() // Use printf\n//\n// \t// CODE\n// \tq := NewPriorityQueue()\n// \tq.Push(Person{name: \"B\", age: 11})\n// \tq.Push(Person{name: \"A\", age: 10})\n// \tq.Push(Person{name: \"C\", age: 12})\n//\n// \tfor q.Len() > 0 {\n// \t\tp := q.Pop().(Person)\n// \t\tprintf(\"%s %d\\n\", p.name, p.age)\n// \t}\n// }\nfunc NewPriorityQueue() *PriorityQueue {\n\tq := &PriorityQueue{s: new(sorter)}\n\theap.Init(q.s)\n\treturn q\n}\n\nfunc (q *PriorityQueue) Pop() Comparable {\n\treturn heap.Pop(q.s).(Comparable)\n}\n\nfunc (q *PriorityQueue) Top() Comparable {\n\tif len(*q.s) > 0 {\n\t\treturn (*q.s)[0].(Comparable)\n\t}\n\treturn nil\n}\n\nfunc (q *PriorityQueue) Fix(x Comparable, i int) {\n\t(*q.s)[i] = x\n\theap.Fix(q.s, i)\n}\n\nfunc (q *PriorityQueue) Remove(i int) Comparable {\n\treturn heap.Remove(q.s, i).(Comparable)\n}\n\nfunc (q *PriorityQueue) Len() int {\n\treturn q.s.Len()\n}\n\ntype Comparable interface {\n\tLess(other interface{}) bool\n}\n\ntype sorter []Comparable\n\nfunc (s *sorter) Push(x interface{}) {\n\t*s = append(*s, x.(Comparable))\n}\n\nfunc (s *sorter) Pop() interface{} {\n\tn := len(*s)\n\tif n > 0 {\n\t\tx := (*s)[n-1]\n\t\t*s = (*s)[0 : n-1]\n\t\treturn x\n\t}\n\treturn nil\n}\n\nfunc (s *sorter) Len() int {\n\treturn len(*s)\n}\n\nfunc (s *sorter) Less(i, j int) bool {\n\treturn (*s)[i].Less((*s)[j])\n}\n\nfunc (s *sorter) Swap(i, j int) {\n\t(*s)[i], (*s)[j] = (*s)[j], (*s)[i]\n}\n\n// Define priority queue struct\ntype PriorityQueue struct {\n\ts *sorter\n}\n\nfunc (q *PriorityQueue) Push(x Comparable) {\n\theap.Push(q.s, x)\n}\n\n// }}}\n// Sort {{{\n// sort.Stable(IntSlice(a))\ntype IntSlice []int\n\nfunc (a IntSlice) Len() int {\n\treturn len(a)\n}\nfunc (a IntSlice) Less(i, j int) bool {\n\treturn a[i] < a[j]\n}\nfunc (a IntSlice) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\n// }}}\n// SegmentTree {{{\n// segInt := InitSegmentTree(\n// \t[]int{1, 9, 5, 3, 7, 2, 4, 6, 8},\n// \tint(1e9),\n// \tIntMergerMin,\n// )\n// fmt.Println(segInt.GetRange(1, 2)) // 9 = min(9)\n// fmt.Println(segInt.GetRange(3, 5)) // 3 = min(3, 7)\ntype SegmentTree struct {\n\toffset int\n\tinf interface{}\n\tdata []interface{}\n\tmerge interface{}\n}\n\nfunc IntMergerMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc FloatMergerMin(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc StringMergerMin(a, b string) string {\n\tstrSlice := sort.StringSlice([]string{a, b})\n\tstrSlice.Sort()\n\tif a == strSlice[0] {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc InitSegmentTree(a, inf, merge interface{}) *SegmentTree {\n\tav := reflect.ValueOf(a)\n\tn := av.Len()\n\tsize := 1\n\tfor size < n {\n\t\tsize *= 2\n\t}\n\tdata := make([]interface{}, size*2)\n\tfor j, i := 0, size-1; i < size+n-1; i++ {\n\t\tdata[i] = av.Index(j).Interface()\n\t\tj++\n\t}\n\tfor i := size + n - 1; i < size*2; i++ {\n\t\tdata[i] = inf\n\t}\n\n\tfor i := size - 2; i >= 0; i-- {\n\t\tdata[i] = reflect.ValueOf(merge).\n\t\t\tCall([]reflect.Value{reflect.ValueOf(data[i*2+1]), reflect.ValueOf(data[i*2+2])})[0].\n\t\t\tInterface()\n\t}\n\n\treturn &SegmentTree{\n\t\tinf: inf,\n\t\toffset: size,\n\t\tdata: data,\n\t\tmerge: merge,\n\t}\n}\n\nfunc (tree *SegmentTree) GetRange(from, to int) interface{} {\n\treturn tree.getRange(from, to, 0, 0, tree.offset)\n}\n\nfunc (tree *SegmentTree) getRange(from, to, index, left, right int) interface{} {\n\tif to <= left || right <= from {\n\t\treturn tree.inf\n\t}\n\tif from <= left && right <= to {\n\t\treturn tree.data[index]\n\t}\n\tmed := (left + right) / 2\n\tlvalue := tree.getRange(from, to, index*2+1, left, med)\n\trvalue := tree.getRange(from, to, index*2+2, med, right)\n\n\treturn reflect.ValueOf(tree.merge).\n\t\tCall([]reflect.Value{reflect.ValueOf(lvalue), reflect.ValueOf(rvalue)})[0].\n\t\tInterface()\n}\n\nfunc (tree *SegmentTree) UpdateAt(index int, value interface{}) {\n\tidx := tree.offset - 1 + index\n\ttree.data[idx] = value\n\tfor idx >= 1 {\n\t\tparent := idx / 2\n\t\tleft := parent * 2\n\t\tright := parent*2 + 1\n\t\ttree.data[parent] = reflect.ValueOf(tree.merge).\n\t\t\tCall([]reflect.Value{reflect.ValueOf(tree.data[left]), reflect.ValueOf(tree.data[right])})[0].\n\t\t\tInterface()\n\t\tidx = parent\n\t}\n}\n\n// }}}\n// UnionFind {{{\n// u := NewUnionFind(3)\n// u.Unit(0, 1)\n// printf(\"%v\\n\", u.Same(0, 1)) // true\n// printf(\"%v\\n\", u.Same(0, 2)) // false\ntype UnionFind struct {\n\tpar []int // 親\n\trank []int // 木の深さ\n\tcount int // 要素数\n}\n\nfunc NewUnionFind(count int) *UnionFind {\n\tpar := make([]int, count)\n\trank := make([]int, count)\n\tfor i := 0; i < count; i++ {\n\t\tpar[i] = i\n\t\trank[i] = 0\n\t}\n\treturn &UnionFind{par: par, rank: rank, count: count}\n}\n\nfunc (uf UnionFind) Find(x int) int {\n\tif uf.par[x] == x {\n\t\treturn x\n\t} else {\n\t\tuf.par[x] = uf.par[uf.par[x]]\n\t\treturn uf.Find(uf.par[x])\n\t}\n}\n\nfunc (uf *UnionFind) Unit(x, y int) {\n\tx = uf.Find(x)\n\ty = uf.Find(y)\n\tif x == y {\n\t\treturn\n\t} else if uf.rank[x] < uf.rank[y] {\n\t\tuf.par[x] = y\n\t} else {\n\t\tuf.par[y] = x\n\t\tif uf.rank[x] == uf.rank[y] {\n\t\t\tuf.rank[x]++\n\t\t}\n\t}\n}\n\nfunc (uf UnionFind) Same(x, y int) bool {\n\treturn uf.Find(x) == uf.Find(y)\n}\n\n//}}}\n// Prime {{{\nconst Q int = 10010\n\nvar isPrime [Q]bool\nvar primeList []int\n\nfunc initPrime() {\n\tfor i := 0; i < Q; i++ {\n\t\tisPrime[i] = true\n\t}\n\tisPrime[0], isPrime[1] = false, false\n\tfor i := 2; i < Q; i++ {\n\t\tif !isPrime[i] {\n\t\t\tcontinue\n\t\t}\n\t\tprimeList = append(primeList, i)\n\t\tfor k := i * 2; k < Q; k += i {\n\t\t\tisPrime[k] = false\n\t\t}\n\t}\n}\n\n// }}}\n// Combination {{{\nvar memo [1000][1000]int\n\nfunc c(n, k, m int) int {\n\tif memo[n][k] != 0 {\n\t\treturn memo[n][k]\n\t}\n\n\tif n == k {\n\t\tmemo[n][k] = 1\n\t} else if k == 0 {\n\t\tmemo[n][k] = 1\n\t} else {\n\t\tmemo[n][k] = (c(n-1, k-1, m) + c(n-1, k, m)) % m\n\t}\n\treturn memo[n][k]\n}\n\n// 重複組合せ O(n+k)\nfunc hcomp(n, k, m int) int {\n\treturn c(k+n-1, k, m)\n}\n\n// }}}\n// GCD {{{\nfunc GCD(x, y int) int {\n\tif x > y {\n\t\treturn GCD(y, x)\n\t} else if x == 0 {\n\t\treturn y\n\t}\n\treturn GCD(y%x, x)\n}\n\n// }}}\n", "language": "Go", "metadata": {"date": 1555900199, "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/s893057806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s893057806", "user_id": "u702996070"}, "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\t\"reflect\"\n\t\"sort\"\n)\n\nfunc main() {\n\tdefer writer.Flush() // Use printf, scanf\n\n\t// CODE\n\tvar N int\n\tvar S []byte\n\tscanf(\"%d\\n\", &N)\n\tscanf(\"%s\\n\", &S)\n\n\t// #.##.\n\t// 232343\n\n\t// startBlack = 0\n\tv := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == '.' {\n\t\t\tv[0]++\n\t\t}\n\t}\n\n\tfor startBlack := 1; startBlack < N; startBlack++ {\n\t\tv[startBlack] = v[startBlack-1]\n\t\tif S[startBlack-1] == '.' {\n\t\t\tv[startBlack]--\n\t\t} else {\n\t\t\tv[startBlack]++\n\t\t}\n\t}\n\n\t// startBlack = N\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == '#' {\n\t\t\tv[N]++\n\t\t}\n\t}\n\n\tans := int(1e10)\n\tfor _, t := range v {\n\t\tans = minInt(ans, t)\n\t}\n\n\tprintf(\"%d\\n\", ans)\n}\n\n// I/O {{{\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tscanf(\"%d \", &res[i])\n\t}\n\tscanf(\"%d\\n\", &res[n-1])\n\treturn res\n}\n\n// }}}\n// {{{ dummy\nfunc dummy() {\n\tfmt.Printf(\"Hello, World\\n\")\n\tfmt.Printf(\"%v\", reflect.TypeOf(0))\n\n\tarr := []int{10, 9, 8, 7, 1}\n\tsort.Ints(arr)\n\tfmt.Println(arr)\n}\n\n// }}}\n// Set {{{\n// s := NewSet()\n// s.Add(\"a\")\n// s.Add(\"b\")\n\n// for i, v := range s.GetSlice() {\n// \t// 0 a\n// \t// 1 b\n// \tprintf(\"%d %s\\n\", i, v.(string))\n// }\n\n// printf(\"%v\\n\", s.Contains(\"a\")) // true\n// printf(\"%v\\n\", s.Contains(\"x\")) // false\ntype Set map[interface{}]struct{}\n\nfunc NewSet() Set {\n\treturn Set{}\n}\n\nfunc (s *Set) Add(x interface{}) {\n\t(*s)[x] = struct{}{}\n}\n\nfunc (s Set) Contains(x interface{}) bool {\n\t_, ok := s[x]\n\treturn ok\n}\n\nfunc (s Set) GetSlice() []interface{} {\n\trc := []interface{}{}\n\tfor key, _ := range s {\n\t\trc = append(rc, key)\n\t}\n\treturn rc\n}\n\n// }}}\n// Math {{{\nfunc maxInt(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc minInt(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// }}}\n// PriorityQueue {{{\n// Usage:\n// type Person struct {\n// \tname string\n// \tage int\n// }\n//\n// func (p1 Person) Less(p2 interface{}) bool {\n// \treturn p1.age < p2.(Person).age\n// }\n//\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n// \tdefer out.Flush() // Use printf\n//\n// \t// CODE\n// \tq := NewPriorityQueue()\n// \tq.Push(Person{name: \"B\", age: 11})\n// \tq.Push(Person{name: \"A\", age: 10})\n// \tq.Push(Person{name: \"C\", age: 12})\n//\n// \tfor q.Len() > 0 {\n// \t\tp := q.Pop().(Person)\n// \t\tprintf(\"%s %d\\n\", p.name, p.age)\n// \t}\n// }\nfunc NewPriorityQueue() *PriorityQueue {\n\tq := &PriorityQueue{s: new(sorter)}\n\theap.Init(q.s)\n\treturn q\n}\n\nfunc (q *PriorityQueue) Pop() Comparable {\n\treturn heap.Pop(q.s).(Comparable)\n}\n\nfunc (q *PriorityQueue) Top() Comparable {\n\tif len(*q.s) > 0 {\n\t\treturn (*q.s)[0].(Comparable)\n\t}\n\treturn nil\n}\n\nfunc (q *PriorityQueue) Fix(x Comparable, i int) {\n\t(*q.s)[i] = x\n\theap.Fix(q.s, i)\n}\n\nfunc (q *PriorityQueue) Remove(i int) Comparable {\n\treturn heap.Remove(q.s, i).(Comparable)\n}\n\nfunc (q *PriorityQueue) Len() int {\n\treturn q.s.Len()\n}\n\ntype Comparable interface {\n\tLess(other interface{}) bool\n}\n\ntype sorter []Comparable\n\nfunc (s *sorter) Push(x interface{}) {\n\t*s = append(*s, x.(Comparable))\n}\n\nfunc (s *sorter) Pop() interface{} {\n\tn := len(*s)\n\tif n > 0 {\n\t\tx := (*s)[n-1]\n\t\t*s = (*s)[0 : n-1]\n\t\treturn x\n\t}\n\treturn nil\n}\n\nfunc (s *sorter) Len() int {\n\treturn len(*s)\n}\n\nfunc (s *sorter) Less(i, j int) bool {\n\treturn (*s)[i].Less((*s)[j])\n}\n\nfunc (s *sorter) Swap(i, j int) {\n\t(*s)[i], (*s)[j] = (*s)[j], (*s)[i]\n}\n\n// Define priority queue struct\ntype PriorityQueue struct {\n\ts *sorter\n}\n\nfunc (q *PriorityQueue) Push(x Comparable) {\n\theap.Push(q.s, x)\n}\n\n// }}}\n// Sort {{{\n// sort.Stable(IntSlice(a))\ntype IntSlice []int\n\nfunc (a IntSlice) Len() int {\n\treturn len(a)\n}\nfunc (a IntSlice) Less(i, j int) bool {\n\treturn a[i] < a[j]\n}\nfunc (a IntSlice) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\n// }}}\n// SegmentTree {{{\n// segInt := InitSegmentTree(\n// \t[]int{1, 9, 5, 3, 7, 2, 4, 6, 8},\n// \tint(1e9),\n// \tIntMergerMin,\n// )\n// fmt.Println(segInt.GetRange(1, 2)) // 9 = min(9)\n// fmt.Println(segInt.GetRange(3, 5)) // 3 = min(3, 7)\ntype SegmentTree struct {\n\toffset int\n\tinf interface{}\n\tdata []interface{}\n\tmerge interface{}\n}\n\nfunc IntMergerMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc FloatMergerMin(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc StringMergerMin(a, b string) string {\n\tstrSlice := sort.StringSlice([]string{a, b})\n\tstrSlice.Sort()\n\tif a == strSlice[0] {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc InitSegmentTree(a, inf, merge interface{}) *SegmentTree {\n\tav := reflect.ValueOf(a)\n\tn := av.Len()\n\tsize := 1\n\tfor size < n {\n\t\tsize *= 2\n\t}\n\tdata := make([]interface{}, size*2)\n\tfor j, i := 0, size-1; i < size+n-1; i++ {\n\t\tdata[i] = av.Index(j).Interface()\n\t\tj++\n\t}\n\tfor i := size + n - 1; i < size*2; i++ {\n\t\tdata[i] = inf\n\t}\n\n\tfor i := size - 2; i >= 0; i-- {\n\t\tdata[i] = reflect.ValueOf(merge).\n\t\t\tCall([]reflect.Value{reflect.ValueOf(data[i*2+1]), reflect.ValueOf(data[i*2+2])})[0].\n\t\t\tInterface()\n\t}\n\n\treturn &SegmentTree{\n\t\tinf: inf,\n\t\toffset: size,\n\t\tdata: data,\n\t\tmerge: merge,\n\t}\n}\n\nfunc (tree *SegmentTree) GetRange(from, to int) interface{} {\n\treturn tree.getRange(from, to, 0, 0, tree.offset)\n}\n\nfunc (tree *SegmentTree) getRange(from, to, index, left, right int) interface{} {\n\tif to <= left || right <= from {\n\t\treturn tree.inf\n\t}\n\tif from <= left && right <= to {\n\t\treturn tree.data[index]\n\t}\n\tmed := (left + right) / 2\n\tlvalue := tree.getRange(from, to, index*2+1, left, med)\n\trvalue := tree.getRange(from, to, index*2+2, med, right)\n\n\treturn reflect.ValueOf(tree.merge).\n\t\tCall([]reflect.Value{reflect.ValueOf(lvalue), reflect.ValueOf(rvalue)})[0].\n\t\tInterface()\n}\n\nfunc (tree *SegmentTree) UpdateAt(index int, value interface{}) {\n\tidx := tree.offset - 1 + index\n\ttree.data[idx] = value\n\tfor idx >= 1 {\n\t\tparent := idx / 2\n\t\tleft := parent * 2\n\t\tright := parent*2 + 1\n\t\ttree.data[parent] = reflect.ValueOf(tree.merge).\n\t\t\tCall([]reflect.Value{reflect.ValueOf(tree.data[left]), reflect.ValueOf(tree.data[right])})[0].\n\t\t\tInterface()\n\t\tidx = parent\n\t}\n}\n\n// }}}\n// UnionFind {{{\n// u := NewUnionFind(3)\n// u.Unit(0, 1)\n// printf(\"%v\\n\", u.Same(0, 1)) // true\n// printf(\"%v\\n\", u.Same(0, 2)) // false\ntype UnionFind struct {\n\tpar []int // 親\n\trank []int // 木の深さ\n\tcount int // 要素数\n}\n\nfunc NewUnionFind(count int) *UnionFind {\n\tpar := make([]int, count)\n\trank := make([]int, count)\n\tfor i := 0; i < count; i++ {\n\t\tpar[i] = i\n\t\trank[i] = 0\n\t}\n\treturn &UnionFind{par: par, rank: rank, count: count}\n}\n\nfunc (uf UnionFind) Find(x int) int {\n\tif uf.par[x] == x {\n\t\treturn x\n\t} else {\n\t\tuf.par[x] = uf.par[uf.par[x]]\n\t\treturn uf.Find(uf.par[x])\n\t}\n}\n\nfunc (uf *UnionFind) Unit(x, y int) {\n\tx = uf.Find(x)\n\ty = uf.Find(y)\n\tif x == y {\n\t\treturn\n\t} else if uf.rank[x] < uf.rank[y] {\n\t\tuf.par[x] = y\n\t} else {\n\t\tuf.par[y] = x\n\t\tif uf.rank[x] == uf.rank[y] {\n\t\t\tuf.rank[x]++\n\t\t}\n\t}\n}\n\nfunc (uf UnionFind) Same(x, y int) bool {\n\treturn uf.Find(x) == uf.Find(y)\n}\n\n//}}}\n// Prime {{{\nconst Q int = 10010\n\nvar isPrime [Q]bool\nvar primeList []int\n\nfunc initPrime() {\n\tfor i := 0; i < Q; i++ {\n\t\tisPrime[i] = true\n\t}\n\tisPrime[0], isPrime[1] = false, false\n\tfor i := 2; i < Q; i++ {\n\t\tif !isPrime[i] {\n\t\t\tcontinue\n\t\t}\n\t\tprimeList = append(primeList, i)\n\t\tfor k := i * 2; k < Q; k += i {\n\t\t\tisPrime[k] = false\n\t\t}\n\t}\n}\n\n// }}}\n// Combination {{{\nvar memo [1000][1000]int\n\nfunc c(n, k, m int) int {\n\tif memo[n][k] != 0 {\n\t\treturn memo[n][k]\n\t}\n\n\tif n == k {\n\t\tmemo[n][k] = 1\n\t} else if k == 0 {\n\t\tmemo[n][k] = 1\n\t} else {\n\t\tmemo[n][k] = (c(n-1, k-1, m) + c(n-1, k, m)) % m\n\t}\n\treturn memo[n][k]\n}\n\n// 重複組合せ O(n+k)\nfunc hcomp(n, k, m int) int {\n\treturn c(k+n-1, k, m)\n}\n\n// }}}\n// GCD {{{\nfunc GCD(x, y int) int {\n\tif x > y {\n\t\treturn GCD(y, x)\n\t} else if x == 0 {\n\t\treturn y\n\t}\n\treturn GCD(y%x, x)\n}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7959, "cpu_time_ms": 13, "memory_kb": 3840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s680230888", "group_id": "codeNet:p03071", "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 > b {\n\t\tfmt.Println(a + a - 1)\n\t} else if a == b {\n\t\tfmt.Println(a + b)\n\t} else {\n\t\tfmt.Println(b + b - 1)\n\t}\n}", "language": "Go", "metadata": {"date": 1569309124, "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/s680230888.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s680230888", "user_id": "u390374229"}, "prompt_components": {"gold_output": "9\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 > b {\n\t\tfmt.Println(a + a - 1)\n\t} else if a == b {\n\t\tfmt.Println(a + b)\n\t} else {\n\t\tfmt.Println(b + b - 1)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s167642215", "group_id": "codeNet:p03071", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, Y , r int\n\tfmt.Scan(&X, &Y)\n\n\tfor i:=0; i<2; i++ {\n\t\tif X >= Y {\n\t\t\tr += X\n\t\t\tX--\n\t\t} else {\n\t\t\tr += Y\n\t\t\tY--\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1556432681, "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/s167642215.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s167642215", "user_id": "u298152049"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, Y , r int\n\tfmt.Scan(&X, &Y)\n\n\tfor i:=0; i<2; i++ {\n\t\tif X >= Y {\n\t\t\tr += X\n\t\t\tX--\n\t\t} else {\n\t\t\tr += Y\n\t\t\tY--\n\t\t}\n\t}\n\tfmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 184, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s598729435", "group_id": "codeNet:p03071", "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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tstrs := strings.Split(text, \" \")\n\n\tA, _ := strconv.Atoi(strs[0])\n\tB, _ := strconv.Atoi(strs[1])\n\n\tret := max(max(2*A-1, A+B), 2*B-1)\n\tfmt.Println(ret)\n\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": 1555316546, "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/s598729435.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s598729435", "user_id": "u017421706"}, "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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tstrs := strings.Split(text, \" \")\n\n\tA, _ := strconv.Atoi(strs[0])\n\tB, _ := strconv.Atoi(strs[1])\n\n\tret := max(max(2*A-1, A+B), 2*B-1)\n\tfmt.Println(ret)\n\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 : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 376, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s438193562", "group_id": "codeNet:p03071", "input_text": "package main\nimport \"fmt\"\nfunc main() {\n var a,b,m int\n fmt.Scan(&a,&b)\n m = 0\n if a < b {\n m += b\n b--\n } else {\n m += a\n a--\n }\n if a < b {\n m += b\n b--\n } else {\n m += a\n a--\n }\n fmt.Println(m)\n}", "language": "Go", "metadata": {"date": 1555182168, "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/s438193562.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s438193562", "user_id": "u506403362"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main() {\n var a,b,m int\n fmt.Scan(&a,&b)\n m = 0\n if a < b {\n m += b\n b--\n } else {\n m += a\n a--\n }\n if a < b {\n m += b\n b--\n } else {\n m += a\n a--\n }\n fmt.Println(m)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s251356328", "group_id": "codeNet:p03072", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tvar m int = 0\n\tvar cnt int = 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\tif x >= m {\n\t\t\tcnt++\n\t\t\tm = x\n\t\t}\n\t}\n\n\tfmt.Print(cnt)\n}\n", "language": "Go", "metadata": {"date": 1598486419, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03072.html", "problem_id": "p03072", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03072/input.txt", "sample_output_relpath": "derived/input_output/data/p03072/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03072/Go/s251356328.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s251356328", "user_id": "u090225501"}, "prompt_components": {"gold_output": "3\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\tvar m int = 0\n\tvar cnt int = 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\tif x >= m {\n\t\t\tcnt++\n\t\t\tm = x\n\t\t}\n\t}\n\n\tfmt.Print(cnt)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "sample_input": "4\n6 5 6 8\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03072", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 8, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s584316818", "group_id": "codeNet:p03073", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tret1 := 0\n\t/* 0101 */\n\tfor i, t := range text {\n\t if i % 2 == 0 {\n\t if t != '0' {\n\t ret1++\n\t }\n\t }else {\n\t if t != '1' {\n\t ret1++\n\t }\n\t }\n\t}\n\tret2 := 0\n\t/* 1010 */\n\tfor i, t := range text {\n\t if i % 2 == 0 {\n\t if t != '1' {\n\t ret2++\n\t }\n\t }else {\n\t if t != '0' {\n\t ret2++\n\t }\n\t }\n\t}\n\tfmt.Println(min(ret1,ret2))\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "language": "Go", "metadata": {"date": 1555329525, "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/s584316818.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s584316818", "user_id": "u017421706"}, "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\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tret1 := 0\n\t/* 0101 */\n\tfor i, t := range text {\n\t if i % 2 == 0 {\n\t if t != '0' {\n\t ret1++\n\t }\n\t }else {\n\t if t != '1' {\n\t ret1++\n\t }\n\t }\n\t}\n\tret2 := 0\n\t/* 1010 */\n\tfor i, t := range text {\n\t if i % 2 == 0 {\n\t if t != '1' {\n\t ret2++\n\t }\n\t }else {\n\t if t != '0' {\n\t ret2++\n\t }\n\t }\n\t}\n\tfmt.Println(min(ret1,ret2))\n}\n\nfunc min(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\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 632, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s804385672", "group_id": "codeNet:p03073", "input_text": "package main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strings\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\nvar rdr = bufio.NewReaderSize(os.Stdin,1000000)\nfunc readLine() string{\n\t//長いトークンを読み込みたい場合\n\tbuf := make([]byte,0,1000000)\n\tfor {\n\t\tread,isPrefix,error := rdr.ReadLine()\n\t\tif error!= nil{\n\t\t\tpanic(error)\n\t\t}\n\t\tbuf = append(buf,read...)\n\t\tif !isPrefix{\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc Input_Str() string {\n\t//かんたんに読み込みたい場合\n\tstdin.Scan()\n\tstringInput := stdin.Text()\n\tout := strings.TrimSpace(stringInput)\n\treturn out\n}\n\nfunc main(){\n\tstdin.Split(bufio.ScanWords)\n\ts := readLine()\n\tcount_W:=0\n\tcount_B:=0\n\n\tfor i:=0;i len(csum)-1 {\n\t\t\trightIndex = len(csum) - 1\n\t\t}\n\t\tright = csum[rightIndex]\n\n\t\tleftIndex := leftIndexFunc(i)\n\t\tvar left int\n\t\tif leftIndex < 0 {\n\t\t\tleftIndex = -1\n\t\t\tleft = 0\n\t\t} else {\n\t\t\tleft = csum[leftIndex]\n\t\t}\n\t\tlength := right - left\n\t\t// fmt.Printf(\"[%d](%d) - [%d](%d): %d\\n\", leftIndex, left, rightIndex, right, length)\n\t\tif length > max {\n\t\t\tmax = length\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", max)\n}\n\nfunc zeroLeftIndex(i int) int {\n\treturn i - 2\n}\n\nfunc oneLeftIndex(i int) int {\n\treturn i - 1\n}\n\nfunc zeroRightIndex(i int, k int) int {\n\treturn i + 2*k - 1\n}\n\nfunc oneRightIndex(i int, k int) int {\n\treturn i + 2*k\n}\n\nfunc scaleUp() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tk := scanInt(sc)\n\ts := scanStr(sc)\n\n\t// fmt.Printf(\"n = %+v\\n\", n)\n\t// fmt.Printf(\"k = %+v\\n\", k)\n\t// fmt.Printf(\"s = %+v\\n\", s)\n\n\tflipCount := 0\n\tprev := s[0]\n\tmax := 0\n\tlength := 0\n\tleft := 0\n\tright := 1\n\n\t// left move loop\n\tfor left < n {\n\t\t// right move lop\n\t\tfor right < n {\n\t\t\t// count 0 -> 1 or 1 -> 0\n\t\t\tif s[right] != prev {\n\t\t\t\tflipCount++\n\t\t\t}\n\n\t\t\t// memory prev\n\t\t\tprev = s[right]\n\n\t\t\tif s[left] == '0' {\n\t\t\t\t// right limit if 0 start\n\t\t\t\tif flipCount > 2*k-1 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// right limit if 1 start\n\t\t\t\tif flipCount > 2*k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tright++\n\t\t\t// fmt.Printf(\"right++: left = %+v, right = %+v, length = %+v\\n\", left, right, right-left)\n\t\t}\n\n\t\t// update max\n\t\tlength = right - left\n\t\tif length > max {\n\t\t\tmax = length\n\t\t\t// fmt.Printf(\" max changed: left = %+v, right = %+v, length = %+v\\n\", left, right, right-left)\n\t\t}\n\t\t// fmt.Printf(\" left = %+v, right = %+v, length = %+v, flipCount = %+v\\n\", left, right, right-left, flipCount)\n\n\t\t// no more max length\n\t\tif right >= n {\n\t\t\tbreak\n\t\t}\n\n\t\tindex := left\n\t\tleft++\n\t\t// left move\n\t\tfor left < right {\n\t\t\tif s[left] != s[index] {\n\t\t\t\tflipCount--\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tleft++\n\t\t}\n\t\t// fmt.Printf(\" left++: left = %+v, right = %+v, length = %+v, flipCount = %+v\\n\", left, right, right-left, flipCount)\n\t}\n\n\tfmt.Printf(\"%d\\n\", max)\n}\n\nfunc main() {\n\t// cSum()\n\tscaleUp()\n}\n", "language": "Go", "metadata": {"date": 1555447324, "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/s870089972.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s870089972", "user_id": "u566651462"}, "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\tBufferSize = 10 * 10 * 10 * 10 * 10 * 10\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 scanStr(sc *bufio.Scanner) string {\n\tif !sc.Scan() {\n\t\tpanic(nil)\n\t}\n\n\treturn sc.Text()\n}\n\nfunc getRev(before byte) byte {\n\tif before == '0' {\n\t\treturn '1'\n\t}\n\treturn '0'\n}\n\nfunc cSum() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tk := scanInt(sc)\n\ts := scanStr(sc)\n\n\t// fmt.Printf(\"n = %+v\\n\", n)\n\t// fmt.Printf(\"k = %+v\\n\", k)\n\t// fmt.Printf(\"s = %+v\\n\", s)\n\n\tcsum := make([]int, 0, len(s)+10)\n\n\tbefore := s[0]\n\tcsum = append(csum, 1)\n\tfor i := 1; i < n; i++ {\n\t\tif s[i] != before {\n\t\t\tcsum = append(csum, csum[len(csum)-1]+1)\n\t\t} else {\n\t\t\tcsum[len(csum)-1]++\n\t\t}\n\t\tbefore = s[i]\n\t}\n\n\t// fmt.Printf(\"csum = %+v\\n\", csum)\n\n\tmax := 0\n\trightIndexFunc := zeroRightIndex\n\tif s[0] != '0' {\n\t\trightIndexFunc = oneRightIndex\n\t}\n\tleftIndexFunc := zeroLeftIndex\n\tif s[0] != '0' {\n\t\tleftIndexFunc = oneLeftIndex\n\t}\n\tfor i := 0; i < len(csum); i += 2 {\n\t\trightIndex := rightIndexFunc(i, k)\n\t\tvar right int\n\t\tif rightIndex > len(csum)-1 {\n\t\t\trightIndex = len(csum) - 1\n\t\t}\n\t\tright = csum[rightIndex]\n\n\t\tleftIndex := leftIndexFunc(i)\n\t\tvar left int\n\t\tif leftIndex < 0 {\n\t\t\tleftIndex = -1\n\t\t\tleft = 0\n\t\t} else {\n\t\t\tleft = csum[leftIndex]\n\t\t}\n\t\tlength := right - left\n\t\t// fmt.Printf(\"[%d](%d) - [%d](%d): %d\\n\", leftIndex, left, rightIndex, right, length)\n\t\tif length > max {\n\t\t\tmax = length\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", max)\n}\n\nfunc zeroLeftIndex(i int) int {\n\treturn i - 2\n}\n\nfunc oneLeftIndex(i int) int {\n\treturn i - 1\n}\n\nfunc zeroRightIndex(i int, k int) int {\n\treturn i + 2*k - 1\n}\n\nfunc oneRightIndex(i int, k int) int {\n\treturn i + 2*k\n}\n\nfunc scaleUp() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tk := scanInt(sc)\n\ts := scanStr(sc)\n\n\t// fmt.Printf(\"n = %+v\\n\", n)\n\t// fmt.Printf(\"k = %+v\\n\", k)\n\t// fmt.Printf(\"s = %+v\\n\", s)\n\n\tflipCount := 0\n\tprev := s[0]\n\tmax := 0\n\tlength := 0\n\tleft := 0\n\tright := 1\n\n\t// left move loop\n\tfor left < n {\n\t\t// right move lop\n\t\tfor right < n {\n\t\t\t// count 0 -> 1 or 1 -> 0\n\t\t\tif s[right] != prev {\n\t\t\t\tflipCount++\n\t\t\t}\n\n\t\t\t// memory prev\n\t\t\tprev = s[right]\n\n\t\t\tif s[left] == '0' {\n\t\t\t\t// right limit if 0 start\n\t\t\t\tif flipCount > 2*k-1 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// right limit if 1 start\n\t\t\t\tif flipCount > 2*k {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tright++\n\t\t\t// fmt.Printf(\"right++: left = %+v, right = %+v, length = %+v\\n\", left, right, right-left)\n\t\t}\n\n\t\t// update max\n\t\tlength = right - left\n\t\tif length > max {\n\t\t\tmax = length\n\t\t\t// fmt.Printf(\" max changed: left = %+v, right = %+v, length = %+v\\n\", left, right, right-left)\n\t\t}\n\t\t// fmt.Printf(\" left = %+v, right = %+v, length = %+v, flipCount = %+v\\n\", left, right, right-left, flipCount)\n\n\t\t// no more max length\n\t\tif right >= n {\n\t\t\tbreak\n\t\t}\n\n\t\tindex := left\n\t\tleft++\n\t\t// left move\n\t\tfor left < right {\n\t\t\tif s[left] != s[index] {\n\t\t\t\tflipCount--\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tleft++\n\t\t}\n\t\t// fmt.Printf(\" left++: left = %+v, right = %+v, length = %+v, flipCount = %+v\\n\", left, right, right-left, flipCount)\n\t}\n\n\tfmt.Printf(\"%d\\n\", max)\n}\n\nfunc main() {\n\t// cSum()\n\tscaleUp()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3428, "cpu_time_ms": 4, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s008099878", "group_id": "codeNet:p03074", "input_text": "package main\nimport (\n \"container/list\"\n \"fmt\"\n \"os\"\n)\nfunc main() {\n var n,k,r,m int\n var s string\n var a []int\n fmt.Scan(&n,&k)\n fmt.Scan(&s)\n a = make([]int,n)\n r = 1\n if s[0:1] == \"0\" { r = -1 }\n a[0] = r\n p2n := list.New()\n n2p := list.New()\n for i:=1;i 0 {\n p2n.PushBack(i-1)\n } else {\n n2p.PushBack(i-1)\n }\n r = -r\n a[i] = r\n }\n }\n if a[n-1] > 0 {\n p2n.PushBack(n-1)\n } else {\n n2p.PushBack(n-1)\n }\n if p2n.Len() == 0 || n2p.Len() == 0 {\n fmt.Println(abs(a[n-1]))\n os.Exit(0)\n }\n used_p2n := list.New()\n used_n2p := list.New()\n m = 0\n if p2n.Len() == n2p.Len() && a[n-1] > 0 ||\n p2n.Len() != n2p.Len() && a[n-1] < 0 {\n j,_ := n2p.Remove(n2p.Front()).(int)\n m -= a[j]\n k--\n used_n2p.PushBack(j)\n }\n j,_ := p2n.Remove(p2n.Front()).(int)\n m += a[j]\n used_p2n.PushBack(j)\n for c:=0;c 0 {\n p2n.PushBack(i-1)\n } else {\n n2p.PushBack(i-1)\n }\n r = -r\n a[i] = r\n }\n }\n if a[n-1] > 0 {\n p2n.PushBack(n-1)\n } else {\n n2p.PushBack(n-1)\n }\n if p2n.Len() == 0 || n2p.Len() == 0 {\n fmt.Println(abs(a[n-1]))\n os.Exit(0)\n }\n used_p2n := list.New()\n used_n2p := list.New()\n m = 0\n if p2n.Len() == n2p.Len() && a[n-1] > 0 ||\n p2n.Len() != n2p.Len() && a[n-1] < 0 {\n j,_ := n2p.Remove(n2p.Front()).(int)\n m -= a[j]\n k--\n used_n2p.PushBack(j)\n }\n j,_ := p2n.Remove(p2n.Front()).(int)\n m += a[j]\n used_p2n.PushBack(j)\n for c:=0;c 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\tA := sc.nextIntSlice(5)\n\tk := sc.nextInt()\n\tok := true\n\tfor i := 0; i < 5; i++ {\n\t\tfor j := i + 1; j < 5; j++ {\n\t\t\tif abs(A[i]-A[j]) > k {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1575147264, "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/s949120090.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s949120090", "user_id": "u924691798"}, "prompt_components": {"gold_output": "Yay!\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) 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 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\tA := sc.nextIntSlice(5)\n\tk := sc.nextInt()\n\tok := true\n\tfor i := 0; i < 5; i++ {\n\t\tfor j := i + 1; j < 5; j++ {\n\t\t\tif abs(A[i]-A[j]) > k {\n\t\t\t\tok = false\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\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\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1419, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s241063593", "group_id": "codeNet:p03075", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c, d, e, k int\n fmt.Scan(&a, &b, &c, &d, &e, &k)\n if e-a > k {\n fmt.Println(\":(\")\n return\n }\n fmt.Println(\"Yay!\")\n}\n", "language": "Go", "metadata": {"date": 1554965736, "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/s241063593.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s241063593", "user_id": "u471449221"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c, d, e, k int\n fmt.Scan(&a, &b, &c, &d, &e, &k)\n if e-a > k {\n fmt.Println(\":(\")\n return\n }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s287168773", "group_id": "codeNet:p03075", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar (\n\ta []int\n\tk int\n)\n\nfunc main() {\n\ta = make([]int, 5)\n\tfmt.Scan(&a[0])\n\tfmt.Scan(&a[1])\n\tfmt.Scan(&a[2])\n\tfmt.Scan(&a[3])\n\tfmt.Scan(&a[4])\n\tfmt.Scan(&k)\n\n\tsort.Ints(a)\n\tif a[4] - a[0] > k {\n\t\tfmt.Println(\":(\")\n\t} else {\n\t\tfmt.Println(\"Yay!\")\n\t}\n}", "language": "Go", "metadata": {"date": 1554580744, "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/s287168773.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287168773", "user_id": "u671357638"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar (\n\ta []int\n\tk int\n)\n\nfunc main() {\n\ta = make([]int, 5)\n\tfmt.Scan(&a[0])\n\tfmt.Scan(&a[1])\n\tfmt.Scan(&a[2])\n\tfmt.Scan(&a[3])\n\tfmt.Scan(&a[4])\n\tfmt.Scan(&k)\n\n\tsort.Ints(a)\n\tif a[4] - a[0] > 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s334425665", "group_id": "codeNet:p03075", "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 nextStr() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRuneAt(s string, i int) rune {\n\trs := []rune(s)\n\treturn rs[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tvar val []int\n\tval = make([]int, 5)\n\tfor index := 0; index < 5; index++ {\n\t\tval[index] = nextInt()\n\t}\n\tk := nextInt()\n\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := i + 1; j < 5; j++ {\n\t\t\tif !canCommunicate(val[i], val[j], k) {\n\t\t\t\tfmt.Print(\":(\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(\"Yay!\")\n}\n\nfunc canCommunicate(a int, b int, waveRange int) bool {\n\treturn (b - a) <= waveRange\n}\n", "language": "Go", "metadata": {"date": 1554579109, "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/s334425665.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s334425665", "user_id": "u643520570"}, "prompt_components": {"gold_output": "Yay!\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 nextStr() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRuneAt(s string, i int) rune {\n\trs := []rune(s)\n\treturn rs[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tvar val []int\n\tval = make([]int, 5)\n\tfor index := 0; index < 5; index++ {\n\t\tval[index] = nextInt()\n\t}\n\tk := nextInt()\n\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := i + 1; j < 5; j++ {\n\t\t\tif !canCommunicate(val[i], val[j], k) {\n\t\t\t\tfmt.Print(\":(\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(\"Yay!\")\n}\n\nfunc canCommunicate(a int, b int, waveRange int) bool {\n\treturn (b - a) <= waveRange\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 754, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s862161650", "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\ta := scanInt()-1\n\tb := scanInt()-1\n\tc := scanInt()-1\n\td := scanInt()-1\n\te := scanInt()-1\n\n\tt := min(a%10,min(b%10,min(c%10,min(d%10,e%10))))+1\n\n\ta += 10\n\tb += 10\n\tc += 10\n\td += 10\n\te += 10\n\n\ta /= 10\n\tb /= 10\n\tc /= 10\n\td /= 10\n\te /= 10\n\n\tfmt.Fprintln(wr, (a+b+c+d+e)*10-10+t)\n}\n", "language": "Go", "metadata": {"date": 1584310606, "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/s862161650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s862161650", "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\ta := scanInt()-1\n\tb := scanInt()-1\n\tc := scanInt()-1\n\td := scanInt()-1\n\te := scanInt()-1\n\n\tt := min(a%10,min(b%10,min(c%10,min(d%10,e%10))))+1\n\n\ta += 10\n\tb += 10\n\tc += 10\n\td += 10\n\te += 10\n\n\ta /= 10\n\tb /= 10\n\tc /= 10\n\td /= 10\n\te /= 10\n\n\tfmt.Fprintln(wr, (a+b+c+d+e)*10-10+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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1271, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s487007520", "group_id": "codeNet:p03076", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar dishes = [5]string{}\n\tfmt.Scan(&dishes[0])\n\tfmt.Scan(&dishes[1])\n\tfmt.Scan(&dishes[2])\n\tfmt.Scan(&dishes[3])\n\tfmt.Scan(&dishes[4])\n\n\tres := 0\n\tfor _, dish := range dishes {\n\t\tdishNum, err := strconv.Atoi(dish)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tres = res + dishNum\n\t}\n\n\tfmt.Println(strconv.Itoa(res))\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1555181901, "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/s487007520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s487007520", "user_id": "u514906225"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar dishes = [5]string{}\n\tfmt.Scan(&dishes[0])\n\tfmt.Scan(&dishes[1])\n\tfmt.Scan(&dishes[2])\n\tfmt.Scan(&dishes[3])\n\tfmt.Scan(&dishes[4])\n\n\tres := 0\n\tfor _, dish := range dishes {\n\t\tdishNum, err := strconv.Atoi(dish)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tres = res + dishNum\n\t}\n\n\tfmt.Println(strconv.Itoa(res))\n\treturn\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 373, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s168530398", "group_id": "codeNet:p03077", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c, d, e int\n\tresult := 0\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &a)\n\tfmt.Scanf(\"%d\", &b)\n\tfmt.Scanf(\"%d\", &c)\n\tfmt.Scanf(\"%d\", &d)\n\tfmt.Scanf(\"%d\", &e)\n \tbasic := a\n\tcanTrasnportNum := &[5]int{a, b, c, d, e}\n\tfor _, current := range canTrasnportNum {\n\t\tif current < basic {\n\t\t\tbasic = current\n\t\t}\n\t}\n if basic >= n {\n\t\tresult = 5\n }else{\n \t result = len(canTrasnportNum)\n if (n - basic) / basic == 0 {\n result = result + 1\n }else{\n result = result + (n - basic) / basic\n }\n if (n-basic)/basic != 0 {\n result = result + 1\n }\t\n }\n fmt.Printf(\"%d\", result)\n}\n", "language": "Go", "metadata": {"date": 1556479588, "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/s168530398.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s168530398", "user_id": "u860928177"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c, d, e int\n\tresult := 0\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Scanf(\"%d\", &a)\n\tfmt.Scanf(\"%d\", &b)\n\tfmt.Scanf(\"%d\", &c)\n\tfmt.Scanf(\"%d\", &d)\n\tfmt.Scanf(\"%d\", &e)\n \tbasic := a\n\tcanTrasnportNum := &[5]int{a, b, c, d, e}\n\tfor _, current := range canTrasnportNum {\n\t\tif current < basic {\n\t\t\tbasic = current\n\t\t}\n\t}\n if basic >= n {\n\t\tresult = 5\n }else{\n \t result = len(canTrasnportNum)\n if (n - basic) / basic == 0 {\n result = result + 1\n }else{\n result = result + (n - basic) / basic\n }\n if (n-basic)/basic != 0 {\n result = result + 1\n }\t\n }\n fmt.Printf(\"%d\", result)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 674, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s082256384", "group_id": "codeNet:p03077", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, min, x int\n\tfmt.Scan(&n, &min)\n\tfor i := 1; i < 5; i++ {\n\t\tfmt.Scan(&x)\n\t\tif x < min {\n\t\t\tmin = x\n\t\t}\n\t}\n\tfmt.Println(int(math.Ceil(float64(n)/float64(min))) + 4)\n}\n", "language": "Go", "metadata": {"date": 1556228053, "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/s082256384.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s082256384", "user_id": "u461993794"}, "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 n, min, x int\n\tfmt.Scan(&n, &min)\n\tfor i := 1; i < 5; i++ {\n\t\tfmt.Scan(&x)\n\t\tif x < min {\n\t\t\tmin = x\n\t\t}\n\t}\n\tfmt.Println(int(math.Ceil(float64(n)/float64(min))) + 4)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s785723193", "group_id": "codeNet:p03077", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc read() []int64 {\n\tvar tmp int64\n\tlist := make([]int64, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tlist[i] = tmp\n\t}\n\treturn list\n}\n\nfunc fetchMinval(list []int64) (min int64, idx int) {\n\tmin = math.MaxInt64\n\tfor i := 0; i < len(list)-1; i++ {\n\t\tif min > list[i] {\n\t\t\tmin = list[i]\n\t\t\tidx = i\n\t\t}\n\t}\n\treturn\n}\n\nfunc main() {\n\tlist := read()\n\tmin, idx := fetchMinval(list[1:])\n\tif idx == 0 {\n\t\tdiv := float64(list[0]) / float64(min)\n\t\tcolSize := int64(div)\n\t\tlineSize := int64(len(list[1:]))\n\t\tfmt.Println(colSize + lineSize - 1)\n\t} else {\n\t\tcolSize := int64(math.Ceil(float64(list[0]) / float64(min)))\n\t\tlineSize := int64(len(list[1:]) - idx)\n\t\tfmt.Println(colSize + lineSize)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1554938409, "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/s785723193.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s785723193", "user_id": "u212738766"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc read() []int64 {\n\tvar tmp int64\n\tlist := make([]int64, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tlist[i] = tmp\n\t}\n\treturn list\n}\n\nfunc fetchMinval(list []int64) (min int64, idx int) {\n\tmin = math.MaxInt64\n\tfor i := 0; i < len(list)-1; i++ {\n\t\tif min > list[i] {\n\t\t\tmin = list[i]\n\t\t\tidx = i\n\t\t}\n\t}\n\treturn\n}\n\nfunc main() {\n\tlist := read()\n\tmin, idx := fetchMinval(list[1:])\n\tif idx == 0 {\n\t\tdiv := float64(list[0]) / float64(min)\n\t\tcolSize := int64(div)\n\t\tlineSize := int64(len(list[1:]))\n\t\tfmt.Println(colSize + lineSize - 1)\n\t} else {\n\t\tcolSize := int64(math.Ceil(float64(list[0]) / float64(min)))\n\t\tlineSize := int64(len(list[1:]) - idx)\n\t\tfmt.Println(colSize + lineSize)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 731, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s856871076", "group_id": "codeNet:p03077", "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\nfunc nextStr() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRuneAt(s string, i int) rune {\n\trs := []rune(s)\n\treturn rs[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\tvar val []int\n\tval = make([]int, 5)\n\tfor index := 0; index < 5; index++ {\n\t\tval[index] = nextInt()\n\t}\n\tval = sort.IntSlice(val)\n\tif val[0] >= n {\n\t\tfmt.Print(5)\n\t\treturn\n\t}\n\n\tif n%val[0] == 0 {\n\t\tfmt.Print(n/val[0] + 5)\n\t} else {\n\t\tfmt.Print(n/val[0] + 6)\n\t}\n\n}", "language": "Go", "metadata": {"date": 1554582854, "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/s856871076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s856871076", "user_id": "u643520570"}, "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 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 nextStr() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRuneAt(s string, i int) rune {\n\trs := []rune(s)\n\treturn rs[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\tvar val []int\n\tval = make([]int, 5)\n\tfor index := 0; index < 5; index++ {\n\t\tval[index] = nextInt()\n\t}\n\tval = sort.IntSlice(val)\n\tif val[0] >= n {\n\t\tfmt.Print(5)\n\t\treturn\n\t}\n\n\tif n%val[0] == 0 {\n\t\tfmt.Print(n/val[0] + 5)\n\t} else {\n\t\tfmt.Print(n/val[0] + 6)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 669, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s477595537", "group_id": "codeNet:p03077", "input_text": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n\n min := int(1e15)\n for i := 0; i < 5; i++ {\n var t int\n fmt.Scan(&t)\n if t < min {\n min = t\n }\n }\n r := int(n / min)\n if n%min > 0 {\n r += 1\n }\n r += 4\n\n fmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1554578538, "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/s477595537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s477595537", "user_id": "u282164747"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n\n min := int(1e15)\n for i := 0; i < 5; i++ {\n var t int\n fmt.Scan(&t)\n if t < min {\n min = t\n }\n }\n r := int(n / min)\n if n%min > 0 {\n r += 1\n }\n r += 4\n\n fmt.Println(r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187405815", "group_id": "codeNet:p03078", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\t\n\tscanner := bufio.NewScanner(os.Stdin)\n\tas := strToInt64Slice(scanLine(scanner))\n\tbs := strToInt64Slice(scanLine(scanner))\n\tcs := strToInt64Slice(scanLine(scanner))\n\n\tsumList := calcEachSum(as, bs, cs, x, y, z)\n\tsortDescInt64Slice(sumList)\n\n\tfor i := 0; i < k; i++ {\n\t\tfmt.Printf(\"%d\\n\", sumList[i]);\n\t}\n}\n\nfunc scanLine(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc strToInt64Slice(line string) []int64 {\n\tstrSlice := strings.Split(line, \" \")\n\n\tvar intSlice []int64\n\tfor _, str := range strSlice {\n\t\tintValue, _ := strconv.ParseInt(str, 10, 64)\n\t\tintSlice = append(intSlice, intValue)\n\t}\n\n\treturn intSlice\n}\n\nfunc sortDescInt64Slice(ints []int64) {\n\tsort.Sort(sort.Reverse(Int64Slice(ints)))\n}\n\nfunc calcEachSum(as, bs, cs []int64, x, y, z int) []int64 {\n\tvar sumList []int64\n\tfor i := 0; i < x; i++ {\n\t\tfor j := 0; j < y; j++ {\n\t\t\tfor k := 0; k < z; k++ {\n\t\t\t\tsumList = append(sumList, as[i] + bs[j] + cs[k])\n\t\t\t}\n\t\t}\n\t}\n\treturn sumList\n}\n\ntype Int64Slice []int64\n \nfunc (s Int64Slice) Len() int {\n\treturn len(s)\n}\nfunc (s Int64Slice) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\nfunc (s Int64Slice) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}", "language": "Go", "metadata": {"date": 1555598994, "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/s187405815.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s187405815", "user_id": "u252712957"}, "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\"strconv\"\n\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, z, k int\n\tfmt.Scan(&x, &y, &z, &k)\n\t\n\tscanner := bufio.NewScanner(os.Stdin)\n\tas := strToInt64Slice(scanLine(scanner))\n\tbs := strToInt64Slice(scanLine(scanner))\n\tcs := strToInt64Slice(scanLine(scanner))\n\n\tsumList := calcEachSum(as, bs, cs, x, y, z)\n\tsortDescInt64Slice(sumList)\n\n\tfor i := 0; i < k; i++ {\n\t\tfmt.Printf(\"%d\\n\", sumList[i]);\n\t}\n}\n\nfunc scanLine(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc strToInt64Slice(line string) []int64 {\n\tstrSlice := strings.Split(line, \" \")\n\n\tvar intSlice []int64\n\tfor _, str := range strSlice {\n\t\tintValue, _ := strconv.ParseInt(str, 10, 64)\n\t\tintSlice = append(intSlice, intValue)\n\t}\n\n\treturn intSlice\n}\n\nfunc sortDescInt64Slice(ints []int64) {\n\tsort.Sort(sort.Reverse(Int64Slice(ints)))\n}\n\nfunc calcEachSum(as, bs, cs []int64, x, y, z int) []int64 {\n\tvar sumList []int64\n\tfor i := 0; i < x; i++ {\n\t\tfor j := 0; j < y; j++ {\n\t\t\tfor k := 0; k < z; k++ {\n\t\t\t\tsumList = append(sumList, as[i] + bs[j] + cs[k])\n\t\t\t}\n\t\t}\n\t}\n\treturn sumList\n}\n\ntype Int64Slice []int64\n \nfunc (s Int64Slice) Len() int {\n\treturn len(s)\n}\nfunc (s Int64Slice) Less(i, j int) bool {\n\treturn s[i] < s[j]\n}\nfunc (s Int64Slice) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1318, "cpu_time_ms": 2144, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s097936969", "group_id": "codeNet:p03080", "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\t_ = nextInt()\n\ts := nextLine()\n\tr, b := 0, 0\n\tfor _, v := range s {\n\t\tif v == 'R' {\n\t\t\tr++\n\t\t} else {\n\t\t\tb++\n\t\t}\n\t}\n\tif r > b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nconst size = 1000000\n\nvar reader = bufio.NewReaderSize(os.Stdin, size)\n\nfunc nextLine() string {\n\tvar line, buffer []byte\n\tisPrefix := true\n\tvar err error\n\tfor isPrefix {\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}\n\treturn string(buffer)\n}\nfunc nextStringArray() []string {\n\treturn strings.Split(nextLine(), \" \")\n}\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(nextLine())\n\treturn n\n}\n\nfunc nextIntArray() []int {\n\ts := strings.Split(nextLine(), \" \")\n\tn := len(s)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\n\nfunc min(i, j int) int {\n\tif i > j {\n\t\treturn j\n\t}\n\treturn i\n}\n\nfunc max(i, j int) int {\n\tif i < j {\n\t\treturn j\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1553976462, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03080.html", "problem_id": "p03080", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03080/input.txt", "sample_output_relpath": "derived/input_output/data/p03080/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03080/Go/s097936969.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s097936969", "user_id": "u177398299"}, "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\t_ = nextInt()\n\ts := nextLine()\n\tr, b := 0, 0\n\tfor _, v := range s {\n\t\tif v == 'R' {\n\t\t\tr++\n\t\t} else {\n\t\t\tb++\n\t\t}\n\t}\n\tif r > b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc gcd(a, b int64) int64 {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nconst size = 1000000\n\nvar reader = bufio.NewReaderSize(os.Stdin, size)\n\nfunc nextLine() string {\n\tvar line, buffer []byte\n\tisPrefix := true\n\tvar err error\n\tfor isPrefix {\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}\n\treturn string(buffer)\n}\nfunc nextStringArray() []string {\n\treturn strings.Split(nextLine(), \" \")\n}\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(nextLine())\n\treturn n\n}\n\nfunc nextIntArray() []int {\n\ts := strings.Split(nextLine(), \" \")\n\tn := len(s)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\n\nfunc min(i, j int) int {\n\tif i > j {\n\t\treturn j\n\t}\n\treturn i\n}\n\nfunc max(i, j int) int {\n\tif i < j {\n\t\treturn j\n\t}\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "sample_input": "4\nRRBR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03080", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1159, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s718293759", "group_id": "codeNet:p03081", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc BinComb(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\n// }}}\n\ntype Pair struct {\n\tfirst string\n\tsecond string\n}\n\nfunc simulate(s string, qs []Pair, pos int) int {\n\tfor _, query := range qs {\n\t\tif query.first != string(s[pos]) {\n\t\t\tcontinue\n\t\t}\n\t\tif query.second == \"R\" {\n\t\t\tpos++\n\t\t} else {\n\t\t\tpos--\n\t\t}\n\n\t\tif pos == -1 {\n\t\t\treturn -1\n\t\t} else if pos == len(s) {\n\t\t\treturn 1\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc solve(s string, qs []Pair) int {\n\tl := sort.Search(len(s), func(i int) bool { return simulate(s, qs, i) == 0 })\n\tr := sort.Search(len(s), func(i int) bool { return simulate(s, qs, i) == 1 })\n\n\treturn r - l\n}\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n, &q)\n\n\tvar s string\n\tfmt.Scan(&s)\n\n\tqs := make([]Pair, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scan(&qs[i].first, &qs[i].second)\n\t}\n\n\tfmt.Println(solve(s, qs))\n}", "language": "Go", "metadata": {"date": 1554476380, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03081.html", "problem_id": "p03081", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03081/input.txt", "sample_output_relpath": "derived/input_output/data/p03081/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03081/Go/s718293759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s718293759", "user_id": "u700477434"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc BinComb(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\n// }}}\n\ntype Pair struct {\n\tfirst string\n\tsecond string\n}\n\nfunc simulate(s string, qs []Pair, pos int) int {\n\tfor _, query := range qs {\n\t\tif query.first != string(s[pos]) {\n\t\t\tcontinue\n\t\t}\n\t\tif query.second == \"R\" {\n\t\t\tpos++\n\t\t} else {\n\t\t\tpos--\n\t\t}\n\n\t\tif pos == -1 {\n\t\t\treturn -1\n\t\t} else if pos == len(s) {\n\t\t\treturn 1\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc solve(s string, qs []Pair) int {\n\tl := sort.Search(len(s), func(i int) bool { return simulate(s, qs, i) == 0 })\n\tr := sort.Search(len(s), func(i int) bool { return simulate(s, qs, i) == 1 })\n\n\treturn r - l\n}\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n, &q)\n\n\tvar s string\n\tfmt.Scan(&s)\n\n\tqs := make([]Pair, q)\n\tfor i := 0; i < q; i++ {\n\t\tfmt.Scan(&qs[i].first, &qs[i].second)\n\t}\n\n\tfmt.Println(solve(s, qs))\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "sample_input": "3 4\nABC\nA L\nB L\nB R\nA R\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03081", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4278, "cpu_time_ms": 976, "memory_kb": 11648}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s200600951", "group_id": "codeNet:p03085", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar b string\n\tfmt.Scan(&b)\n\n\tswitch b {\n\tcase \"A\":\n\t\tfmt.Println(\"T\")\n\tcase \"T\":\n\t\tfmt.Println(\"A\")\n\tcase \"C\":\n\t\tfmt.Println(\"G\")\n\tcase \"G\":\n\t\tfmt.Println(\"C\")\n\tdefault:\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557298083, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/Go/s200600951.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s200600951", "user_id": "u947370605"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar b string\n\tfmt.Scan(&b)\n\n\tswitch b {\n\tcase \"A\":\n\t\tfmt.Println(\"T\")\n\tcase \"T\":\n\t\tfmt.Println(\"A\")\n\tcase \"C\":\n\t\tfmt.Println(\"G\")\n\tcase \"G\":\n\t\tfmt.Println(\"C\")\n\tdefault:\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 223, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837687898", "group_id": "codeNet:p03086", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tb string\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tb = scanner.Text()\n\tcur := \"\"\n\tbuff := bytes.NewBufferString(cur)\n\tmax := 0\n\n\tfor i := 0; i < len(b); i++ {\n\t\tif b[i] == 'A' || b[i] == 'C' || b[i] == 'G' || b[i] == 'T' {\n\t\t\tbuff.WriteByte(b[i])\n\t\t} else {\n\t\t\tif max < buff.Len() {\n\t\t\t\tmax = buff.Len()\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1553463140, "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/s837687898.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s837687898", "user_id": "u671357638"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tb string\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tb = scanner.Text()\n\tcur := \"\"\n\tbuff := bytes.NewBufferString(cur)\n\tmax := 0\n\n\tfor i := 0; i < len(b); i++ {\n\t\tif b[i] == 'A' || b[i] == 'C' || b[i] == 'G' || b[i] == 'T' {\n\t\t\tbuff.WriteByte(b[i])\n\t\t} else {\n\t\t\tif max < buff.Len() {\n\t\t\t\tmax = buff.Len()\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 432, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s684706465", "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\n//var sc = bufio.NewScanner(os.Stdin)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc nextLine() []string {\n\tline := readLine()\n\treturn strings.Split(line, \" \")\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100)\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//sc.Split(bufio.ScanLines)\n\ttmp := nextLine()\n\tQ, _ := strconv.Atoi(tmp[1])\n\n\tS := readLine()\n\n\tfmt.Println(Q)\n\tfmt.Println(S)\n\tfor i := 0; i < Q; i++ {\n\t\ttmp = nextLine()\n\t\tfmt.Println(tmp)\n\t\t// l, _ := strconv.Atoi(tmp[0])\n\t\t// r, _ := strconv.Atoi(tmp[1])\n\t\t// subS := S[l-1 : r]\n\t\t// fmt.Println(strings.Count(subS, \"AC\"))\n\t}\n}", "language": "Go", "metadata": {"date": 1560253336, "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/s684706465.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s684706465", "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\n//var sc = bufio.NewScanner(os.Stdin)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc nextLine() []string {\n\tline := readLine()\n\treturn strings.Split(line, \" \")\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100)\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//sc.Split(bufio.ScanLines)\n\ttmp := nextLine()\n\tQ, _ := strconv.Atoi(tmp[1])\n\n\tS := readLine()\n\n\tfmt.Println(Q)\n\tfmt.Println(S)\n\tfor i := 0; i < Q; i++ {\n\t\ttmp = nextLine()\n\t\tfmt.Println(tmp)\n\t\t// l, _ := strconv.Atoi(tmp[0])\n\t\t// r, _ := strconv.Atoi(tmp[1])\n\t\t// subS := S[l-1 : r]\n\t\t// fmt.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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 362, "memory_kb": 6912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269253667", "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\ttmp := strings.Split(sc.Text(), \" \")\n\tif len(tmp) < 2 {\n\t\ttmp = strings.Split(sc.Text(), \"\t\")\n\t}\n\treturn tmp\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanLines)\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) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else if len(tmp) < 2 {\n\t\t\tsubS = S\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": 1559906411, "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/s269253667.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s269253667", "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\ttmp := strings.Split(sc.Text(), \" \")\n\tif len(tmp) < 2 {\n\t\ttmp = strings.Split(sc.Text(), \"\t\")\n\t}\n\treturn tmp\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanLines)\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) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else if len(tmp) < 2 {\n\t\t\tsubS = S\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 252, "memory_kb": 5120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s275337808", "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\ttmp := strings.Split(sc.Text(), \" \")\n\tif len(tmp) < 2 {\n\t\ttmp = strings.Split(sc.Text(), \"\t\")\n\t}\n\treturn tmp\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) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else if len(tmp) < 2 {\n\t\t\tsubS = S\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": 1559906107, "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/s275337808.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s275337808", "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\ttmp := strings.Split(sc.Text(), \" \")\n\tif len(tmp) < 2 {\n\t\ttmp = strings.Split(sc.Text(), \"\t\")\n\t}\n\treturn tmp\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) < 1 {\n\t\t\tpanic(\"none\")\n\t\t} else if len(tmp) < 2 {\n\t\t\tsubS = S\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 672, "cpu_time_ms": 258, "memory_kb": 5120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s672042627", "group_id": "codeNet:p03087", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tBufferSize = 7 + 100000 + (7+1+7)*100000 + 1\n\tPattern = \"AC\"\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 count() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tq := scanInt(sc)\n\ts := scanStr(sc)\n\n\ttargetIndex := make([]int, 100001)\n\tfor i := 0; i < n; i++ {\n\t\ttarget := string(s[i])\n\t\tif target == \"A\" {\n\t\t\tif i+1 > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif next := string(s[i+1]); next == \"C\" {\n\t\t\t\ttargetIndex[i] = 1\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tcount := 0\n\t\tl := scanInt(sc)\n\t\tr := scanInt(sc)\n\t\tif r-l < 2 {\n\t\t\t// fmt.Printf(\"%d\\n\", 0)\n\t\t}\n\t\tfor j := 0; j < len(targetIndex); j++ {\n\t\t\tcount += targetIndex[j]\n\t\t}\n\t\t// fmt.Printf(\"%d\\n\", count)\n\t}\n}\n\nfunc compare() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tq := scanInt(sc)\n\ts := scanStr(sc)\n\n\ttargetIndex := make([]int, 0, 500001)\n\tfor i := 0; i < n; i++ {\n\t\ttarget := string(s[i])\n\t\tif target == \"A\" {\n\t\t\tif i+1 > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif next := string(s[i+1]); next == \"C\" {\n\t\t\t\ttargetIndex = append(targetIndex, i)\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tcount := 0\n\t\tl := scanInt(sc)\n\t\tr := scanInt(sc)\n\t\tif r-l < 2 {\n\t\t\t// fmt.Printf(\"%d\\n\", 0)\n\t\t}\n\t\tfor j := 0; j < len(targetIndex); j++ {\n\t\t\tif l-1 <= targetIndex[j] && targetIndex[j]+1 <= r-1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\t// fmt.Printf(\"%d\\n\", count)\n\t}\n}\n\nfunc main() {\n\t// compare()\n\tcount()\n}\n", "language": "Go", "metadata": {"date": 1554237974, "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/s672042627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s672042627", "user_id": "u566651462"}, "prompt_components": {"gold_output": "2\n0\n3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tBufferSize = 7 + 100000 + (7+1+7)*100000 + 1\n\tPattern = \"AC\"\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 count() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tq := scanInt(sc)\n\ts := scanStr(sc)\n\n\ttargetIndex := make([]int, 100001)\n\tfor i := 0; i < n; i++ {\n\t\ttarget := string(s[i])\n\t\tif target == \"A\" {\n\t\t\tif i+1 > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif next := string(s[i+1]); next == \"C\" {\n\t\t\t\ttargetIndex[i] = 1\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tcount := 0\n\t\tl := scanInt(sc)\n\t\tr := scanInt(sc)\n\t\tif r-l < 2 {\n\t\t\t// fmt.Printf(\"%d\\n\", 0)\n\t\t}\n\t\tfor j := 0; j < len(targetIndex); j++ {\n\t\t\tcount += targetIndex[j]\n\t\t}\n\t\t// fmt.Printf(\"%d\\n\", count)\n\t}\n}\n\nfunc compare() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, BufferSize)\n\tsc.Buffer(buf, BufferSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tq := scanInt(sc)\n\ts := scanStr(sc)\n\n\ttargetIndex := make([]int, 0, 500001)\n\tfor i := 0; i < n; i++ {\n\t\ttarget := string(s[i])\n\t\tif target == \"A\" {\n\t\t\tif i+1 > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif next := string(s[i+1]); next == \"C\" {\n\t\t\t\ttargetIndex = append(targetIndex, i)\n\t\t\t\ti++\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tcount := 0\n\t\tl := scanInt(sc)\n\t\tr := scanInt(sc)\n\t\tif r-l < 2 {\n\t\t\t// fmt.Printf(\"%d\\n\", 0)\n\t\t}\n\t\tfor j := 0; j < len(targetIndex); j++ {\n\t\t\tif l-1 <= targetIndex[j] && targetIndex[j]+1 <= r-1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\t// fmt.Printf(\"%d\\n\", count)\n\t}\n}\n\nfunc main() {\n\t// compare()\n\tcount()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1793, "cpu_time_ms": 2107, "memory_kb": 3200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s041747981", "group_id": "codeNet:p03101", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar H, W, h, w int\n\tfmt.Scan(&H, &W, &h, &w)\n\tfmt.Println((H - h) * (W - w))\n}\n", "language": "Go", "metadata": {"date": 1597162403, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s041747981.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s041747981", "user_id": "u825925638"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar H, W, h, w int\n\tfmt.Scan(&H, &W, &h, &w)\n\tfmt.Println((H - h) * (W - w))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "sample_input": "3 2\n2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03101", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 128, "cpu_time_ms": 8, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s747462896", "group_id": "codeNet:p03101", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H, W, h, w int\n\tfmt.Scan(&H, &W, &h, &w)\n\n\twhite := H * W\n\tblack := h * W\n\tblack += w*H - (h * w)\n\n\tfmt.Println(white - black)\n}\n", "language": "Go", "metadata": {"date": 1552166078, "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/s747462896.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s747462896", "user_id": "u268471421"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H, W, h, w int\n\tfmt.Scan(&H, &W, &h, &w)\n\n\twhite := H * W\n\tblack := h * W\n\tblack += w*H - (h * w)\n\n\tfmt.Println(white - black)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "sample_input": "3 2\n2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03101", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 176, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s406766252", "group_id": "codeNet:p03103", "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)\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}\n\ntype line struct {\n\taYen int\n\tbHon int\n}\n\nfunc min(v int, vs ...int) int {\n\tfor _, vi := range vs {\n\t\tif vi < v {\n\t\t\tv = vi\n\t\t}\n\t}\n\treturn v\n}\n\ntype lineSorter []*line\n\nfunc (a lineSorter) Len() int { return len(a) }\nfunc (a lineSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a lineSorter) Less(i, j int) bool { return a[i].aYen < a[j].aYen }\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, m := r.nextInt(), r.nextInt()\n\n\tlines := make([]*line, n)\n\tfor i := 0; i < n; i++ {\n\t\tr.ScanAndSplit()\n\t\tlines[i] = &line{aYen: r.nextInt(), bHon: r.nextInt()}\n\t}\n\n\tsort.Sort(lineSorter(lines))\n\n\tans := 0\n\tfor _, l := range lines {\n\t\tif m <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tw := min(m, l.bHon)\n\t\tm -= w\n\t\tans += w * l.aYen\n\t}\n\tfmt.Fprintln(stdout, ans)\n}\n\n", "language": "Go", "metadata": {"date": 1565800298, "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/s406766252.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s406766252", "user_id": "u463655976"}, "prompt_components": {"gold_output": "12\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)\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}\n\ntype line struct {\n\taYen int\n\tbHon int\n}\n\nfunc min(v int, vs ...int) int {\n\tfor _, vi := range vs {\n\t\tif vi < v {\n\t\t\tv = vi\n\t\t}\n\t}\n\treturn v\n}\n\ntype lineSorter []*line\n\nfunc (a lineSorter) Len() int { return len(a) }\nfunc (a lineSorter) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a lineSorter) Less(i, j int) bool { return a[i].aYen < a[j].aYen }\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, m := r.nextInt(), r.nextInt()\n\n\tlines := make([]*line, n)\n\tfor i := 0; i < n; i++ {\n\t\tr.ScanAndSplit()\n\t\tlines[i] = &line{aYen: r.nextInt(), bHon: r.nextInt()}\n\t}\n\n\tsort.Sort(lineSorter(lines))\n\n\tans := 0\n\tfor _, l := range lines {\n\t\tif m <= 0 {\n\t\t\tbreak\n\t\t}\n\t\tw := min(m, l.bHon)\n\t\tm -= w\n\t\tans += w * l.aYen\n\t}\n\tfmt.Fprintln(stdout, ans)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3219, "cpu_time_ms": 124, "memory_kb": 4864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s374039094", "group_id": "codeNet:p03103", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype shop struct {\n\ta, b int\n}\n\ntype byPrice []shop\n\nfunc (a byPrice) Len() int { return len(a) }\nfunc (a byPrice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byPrice) Less(i, j int) bool { return a[i].a < a[j].a }\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ts := make([]shop, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s[i].a, &s[i].b)\n\t}\n\n\tsort.Sort(byPrice(s))\n\n\tc := 0\n\tfor i := 0; i < n; i++ {\n\t\tif s[i].b >= m {\n\t\t\tc += s[i].a * m\n\t\t\tfmt.Println(c)\n\t\t\treturn\n\t\t}\n\t\tm -= s[i].b\n\t\tc += s[i].a * s[i].b\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559896399, "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/s374039094.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s374039094", "user_id": "u102310764"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype shop struct {\n\ta, b int\n}\n\ntype byPrice []shop\n\nfunc (a byPrice) Len() int { return len(a) }\nfunc (a byPrice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a byPrice) Less(i, j int) bool { return a[i].a < a[j].a }\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ts := make([]shop, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s[i].a, &s[i].b)\n\t}\n\n\tsort.Sort(byPrice(s))\n\n\tc := 0\n\tfor i := 0; i < n; i++ {\n\t\tif s[i].b >= m {\n\t\t\tc += s[i].a * m\n\t\t\tfmt.Println(c)\n\t\t\treturn\n\t\t}\n\t\tm -= s[i].b\n\t\tc += s[i].a * s[i].b\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 576, "cpu_time_ms": 1132, "memory_kb": 5376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787534233", "group_id": "codeNet:p03107", "input_text": "// https://atcoder.jp/contests/abc120/tasks/abc120_c\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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\n\treturn x\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\n\tzeroCt := 0\n\tfor _, ch := range chars {\n\t\tif ch == '0' {\n\t\t\tzeroCt++\n\t\t}\n\t}\n\n\tres := len(chars) - abs(len(chars)-2*zeroCt)\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// 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// 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/* 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": 1562286890, "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/s787534233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s787534233", "user_id": "u751468134"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc120/tasks/abc120_c\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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\n\treturn x\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\n\tzeroCt := 0\n\tfor _, ch := range chars {\n\t\tif ch == '0' {\n\t\t\tzeroCt++\n\t\t}\n\t}\n\n\tres := len(chars) - abs(len(chars)-2*zeroCt)\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// 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// 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/* 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 : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6091, "cpu_time_ms": 5, "memory_kb": 1280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s020347238", "group_id": "codeNet:p03107", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tvar lines []string\n\treader := bufio.NewReader(f)\n\tfor i := 0; i < n; i++ {\n\t\tbytes, _, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tlines = append(lines, string(bytes))\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\n// }}}\n\nfunc ReadLine(f *os.File) string {\n\treader := bufio.NewReader(f)\n\tbytes, _, _ := reader.ReadLine()\n\n\treturn string(bytes)\n}\n\nfunc remove(str *string, char string) bool {\n\tif !strings.Contains(*str, char) {\n\t\treturn false\n\t} else {\n\t\tstrings.Replace(*str, char+char, \"\", -1)\n\t\treturn true\n\t}\n}\n\nfunc solve(str string) string {\n\tfor {\n\t\ti0 := strings.Index(str, \"01\")\n\t\ti1 := strings.Index(str, \"10\")\n\t\tif i0 == -1 && i1 == -1 {\n\t\t\tbreak\n\t\t} else if i0 == -1 || (i1 != -1 && i1 < i0) {\n\t\t\tstr = strings.Replace(str, \"10\", \"\", 1)\n\t\t} else {\n\t\t\tstr = strings.Replace(str, \"01\", \"\", 1)\n\t\t}\n\t}\n\treturn str\n}\n\nfunc main() {\n\tstr := ReadLine(os.Stdin)\n\tfmt.Println(len(str) - len(solve(str)))\n}", "language": "Go", "metadata": {"date": 1551645594, "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/s020347238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s020347238", "user_id": "u700477434"}, "prompt_components": {"gold_output": "4\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\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tvar lines []string\n\treader := bufio.NewReader(f)\n\tfor i := 0; i < n; i++ {\n\t\tbytes, _, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tlines = append(lines, string(bytes))\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\n// }}}\n\nfunc ReadLine(f *os.File) string {\n\treader := bufio.NewReader(f)\n\tbytes, _, _ := reader.ReadLine()\n\n\treturn string(bytes)\n}\n\nfunc remove(str *string, char string) bool {\n\tif !strings.Contains(*str, char) {\n\t\treturn false\n\t} else {\n\t\tstrings.Replace(*str, char+char, \"\", -1)\n\t\treturn true\n\t}\n}\n\nfunc solve(str string) string {\n\tfor {\n\t\ti0 := strings.Index(str, \"01\")\n\t\ti1 := strings.Index(str, \"10\")\n\t\tif i0 == -1 && i1 == -1 {\n\t\t\tbreak\n\t\t} else if i0 == -1 || (i1 != -1 && i1 < i0) {\n\t\t\tstr = strings.Replace(str, \"10\", \"\", 1)\n\t\t} else {\n\t\t\tstr = strings.Replace(str, \"01\", \"\", 1)\n\t\t}\n\t}\n\treturn str\n}\n\nfunc main() {\n\tstr := ReadLine(os.Stdin)\n\tfmt.Println(len(str) - len(solve(str)))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3339, "cpu_time_ms": 29, "memory_kb": 6528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s989313508", "group_id": "codeNet:p03108", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tuft []int\n\tch []int\n\tans []int64\n)\n\nfunc find(x int) int {\n\tif uft[x] == x {\n\t\treturn x\n\t}\n\n\tuft[x] = find(uft[x])\n\treturn uft[x]\n}\n\nfunc union(a, b, i int) {\n\tans[i-1] = ans[i]\n\tar, br := find(a), find(b)\n\tif ar == br {\n\t\treturn\n\t}\n\n\tans[i-1] -= int64(ch[ar] * ch[br])\n\tuft[ar] = uft[br]\n\tch[br] += ch[ar]\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\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tuft = make([]int, n+1)\n\tch = make([]int, n+1)\n\tfor i := range uft {\n\t\tuft[i] = i\n\t\tch[i]++\n\t}\n\n\tans = make([]int64, m)\n\tans[m-1] = int64(n * (n - 1) / 2)\n\tfor i := m - 1; i >= 1; i-- {\n\t\tunion(as[i], bs[i], i)\n\t}\n\n\tfor _, v := range ans {\n\t\tfmt.Println(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561604868, "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/s989313508.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s989313508", "user_id": "u461993794"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tuft []int\n\tch []int\n\tans []int64\n)\n\nfunc find(x int) int {\n\tif uft[x] == x {\n\t\treturn x\n\t}\n\n\tuft[x] = find(uft[x])\n\treturn uft[x]\n}\n\nfunc union(a, b, i int) {\n\tans[i-1] = ans[i]\n\tar, br := find(a), find(b)\n\tif ar == br {\n\t\treturn\n\t}\n\n\tans[i-1] -= int64(ch[ar] * ch[br])\n\tuft[ar] = uft[br]\n\tch[br] += ch[ar]\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\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tuft = make([]int, n+1)\n\tch = make([]int, n+1)\n\tfor i := range uft {\n\t\tuft[i] = i\n\t\tch[i]++\n\t}\n\n\tans = make([]int64, m)\n\tans[m-1] = int64(n * (n - 1) / 2)\n\tfor i := m - 1; i >= 1; i-- {\n\t\tunion(as[i], bs[i], i)\n\t}\n\n\tfor _, v := range ans {\n\t\tfmt.Println(v)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 919, "cpu_time_ms": 250, "memory_kb": 7552}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s275039470", "group_id": "codeNet:p03108", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tuft []int\n\tchildren map[int]int64\n)\n\nfunc find(x int) int {\n\tif uft[x] == x {\n\t\treturn x\n\t}\n\n\tuft[x] = find(uft[x])\n\treturn uft[x]\n}\n\nfunc union(a, b int) {\n\tuft[a] = uft[b]\n\tchildren[b] += children[a]\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\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tuft = make([]int, n+1)\n\tchildren = make(map[int]int64)\n\tfor i := range uft {\n\t\tuft[i] = i\n\t\tchildren[i]++\n\t}\n\n\tans := make([]int64, m)\n\tans[m-1] = int64(n * (n - 1) / 2)\n\tfor i := m - 1; i >= 1; i-- {\n\t\tar := find(as[i])\n\t\tbr := find(bs[i])\n\n\t\tif ar != br {\n\t\t\tans[i-1] = ans[i] - children[ar]*children[br]\n\t\t\tunion(ar, br)\n\t\t\tcontinue\n\t\t}\n\t\tans[i-1] = ans[i]\n\t}\n\n\tfor _, v := range ans {\n\t\tfmt.Println(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1561581285, "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/s275039470.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s275039470", "user_id": "u461993794"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tuft []int\n\tchildren map[int]int64\n)\n\nfunc find(x int) int {\n\tif uft[x] == x {\n\t\treturn x\n\t}\n\n\tuft[x] = find(uft[x])\n\treturn uft[x]\n}\n\nfunc union(a, b int) {\n\tuft[a] = uft[b]\n\tchildren[b] += children[a]\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\tas := make([]int, m)\n\tbs := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tuft = make([]int, n+1)\n\tchildren = make(map[int]int64)\n\tfor i := range uft {\n\t\tuft[i] = i\n\t\tchildren[i]++\n\t}\n\n\tans := make([]int64, m)\n\tans[m-1] = int64(n * (n - 1) / 2)\n\tfor i := m - 1; i >= 1; i-- {\n\t\tar := find(as[i])\n\t\tbr := find(bs[i])\n\n\t\tif ar != br {\n\t\t\tans[i-1] = ans[i] - children[ar]*children[br]\n\t\t\tunion(ar, br)\n\t\t\tcontinue\n\t\t}\n\t\tans[i-1] = ans[i]\n\t}\n\n\tfor _, v := range ans {\n\t\tfmt.Println(v)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 968, "cpu_time_ms": 285, "memory_kb": 10880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s039092283", "group_id": "codeNet:p03109", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s <= \"2019/04/30\" {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1580476337, "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/s039092283.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s039092283", "user_id": "u346986631"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s <= \"2019/04/30\" {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s128989159", "group_id": "codeNet:p03109", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s <= \"2019/04/30\" {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}", "language": "Go", "metadata": {"date": 1567461757, "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/s128989159.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s128989159", "user_id": "u899421906"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s <= \"2019/04/30\" {\n\t\tfmt.Println(\"Heisei\")\n\t} else {\n\t\tfmt.Println(\"TBD\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 154, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s815394310", "group_id": "codeNet:p03110", "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\t// sc.Split(bufio.ScanLines)\n\tn := readInt()\n\tvar sum float64\n\tfor i := 0; i < n; i++ {\n\t\tx := readFloat()\n\t\tu := read()\n\t\tif u == \"BTC\" {\n\t\t\tsum += 380000 * x\n\t\t} else {\n\t\t\tsum += x\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n//便利関数群\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, _ := strconv.Atoi(read())\n\treturn i\n}\n\nfunc readFloat() float64 {\n\ti, _ := strconv.ParseFloat(read(), 64)\n\treturn i\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc abs(x, y int) int {\n\tif x-y > 0 {\n\t\treturn x - y\n\t}\n\treturn -(x - y)\n}\n\ntype XY struct {\n\tx, y int\n}\n\ntype Points []XY\n\nfunc (p Points) Len() int {\n\treturn len(p)\n}\nfunc (p Points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc (p Points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\nfunc (p Points) remove(i int) Points {\n\tif i >= len(p) {\n\t\treturn p\n\t}\n\treturn append(p[:i], p[i+1:]...)\n}\n", "language": "Go", "metadata": {"date": 1551039128, "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/s815394310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s815394310", "user_id": "u598491497"}, "prompt_components": {"gold_output": "48000.0\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\t// sc.Split(bufio.ScanLines)\n\tn := readInt()\n\tvar sum float64\n\tfor i := 0; i < n; i++ {\n\t\tx := readFloat()\n\t\tu := read()\n\t\tif u == \"BTC\" {\n\t\t\tsum += 380000 * x\n\t\t} else {\n\t\t\tsum += x\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n//便利関数群\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt() int {\n\ti, _ := strconv.Atoi(read())\n\treturn i\n}\n\nfunc readFloat() float64 {\n\ti, _ := strconv.ParseFloat(read(), 64)\n\treturn i\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 min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc abs(x, y int) int {\n\tif x-y > 0 {\n\t\treturn x - y\n\t}\n\treturn -(x - y)\n}\n\ntype XY struct {\n\tx, y int\n}\n\ntype Points []XY\n\nfunc (p Points) Len() int {\n\treturn len(p)\n}\nfunc (p Points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\nfunc (p Points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\nfunc (p Points) remove(i int) Points {\n\tif i >= len(p) {\n\t\treturn p\n\t}\n\treturn append(p[:i], p[i+1:]...)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1115, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s527128857", "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000007)\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(Scanner())\n\tb, _ := strconv.Atoi(Scanner())\n\tq, _ := strconv.Atoi(Scanner())\n\ts := make([]int, a)\n\tt := make([]int, b)\n\tfor i := 0; i < a; i++ {\n\t\ts[i], _ = strconv.Atoi(Scanner())\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tt[i], _ = strconv.Atoi(Scanner())\n\t}\n\tfor i := 0; i < q; i++ {\n\t\tx, _ := strconv.Atoi(Scanner())\n\t\tsidx := sort.SearchInts(s, x)\n\t\ttidx := sort.SearchInts(t, x)\n\t\tans := 1000000000000\n\t\tif sidx > 0 && tidx > 0 {\n\t\t\tans = smaller(larger(x-s[sidx-1], x-t[tidx-1]), ans)\n\t\t}\n\t\tif sidx < a && tidx > 0 {\n\t\t\tans = smaller(larger(s[sidx]-x, x-t[tidx-1])+smaller(s[sidx]-x, x-t[tidx-1])*2, ans)\n\t\t}\n\t\tif sidx > 0 && tidx < b {\n\t\t\tans = smaller(larger(x-s[sidx-1], t[tidx]-x)+smaller(x-s[sidx-1], t[tidx]-x)*2, ans)\n\t\t}\n\t\tif sidx < a && tidx < b {\n\t\t\tans = smaller(larger(s[sidx]-x, t[tidx]-x), ans)\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\nfunc smaller(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\nfunc larger(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585124471, "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/s527128857.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s527128857", "user_id": "u843722521"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000007)\n\tsc.Split(bufio.ScanWords)\n\ta, _ := strconv.Atoi(Scanner())\n\tb, _ := strconv.Atoi(Scanner())\n\tq, _ := strconv.Atoi(Scanner())\n\ts := make([]int, a)\n\tt := make([]int, b)\n\tfor i := 0; i < a; i++ {\n\t\ts[i], _ = strconv.Atoi(Scanner())\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tt[i], _ = strconv.Atoi(Scanner())\n\t}\n\tfor i := 0; i < q; i++ {\n\t\tx, _ := strconv.Atoi(Scanner())\n\t\tsidx := sort.SearchInts(s, x)\n\t\ttidx := sort.SearchInts(t, x)\n\t\tans := 1000000000000\n\t\tif sidx > 0 && tidx > 0 {\n\t\t\tans = smaller(larger(x-s[sidx-1], x-t[tidx-1]), ans)\n\t\t}\n\t\tif sidx < a && tidx > 0 {\n\t\t\tans = smaller(larger(s[sidx]-x, x-t[tidx-1])+smaller(s[sidx]-x, x-t[tidx-1])*2, ans)\n\t\t}\n\t\tif sidx > 0 && tidx < b {\n\t\t\tans = smaller(larger(x-s[sidx-1], t[tidx]-x)+smaller(x-s[sidx-1], t[tidx]-x)*2, ans)\n\t\t}\n\t\tif sidx < a && tidx < b {\n\t\t\tans = smaller(larger(s[sidx]-x, t[tidx]-x), ans)\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\nfunc smaller(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\nfunc larger(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 367, "memory_kb": 6528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s650656187", "group_id": "codeNet:p03126", "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\tvar n, m, ans int\n\tvar k [30]int\n\tvar array [30]int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tfor i := 0; i < n; i++ {\n\t\tk[i] = nextInt()\n\t\tfor j := 0; j < k[i]; j++ {\n\t\t\ta := nextInt()\n\t\t\ta--\n\t\t\tarray[a]++\n\t\t}\n\t}\n\n\tfor _, a := range array {\n\t\tif a == n {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1592973342, "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/s650656187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s650656187", "user_id": "u194216936"}, "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 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\tvar n, m, ans int\n\tvar k [30]int\n\tvar array [30]int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tfor i := 0; i < n; i++ {\n\t\tk[i] = nextInt()\n\t\tfor j := 0; j < k[i]; j++ {\n\t\t\ta := nextInt()\n\t\t\ta--\n\t\t\tarray[a]++\n\t\t}\n\t}\n\n\tfor _, a := range array {\n\t\tif a == n {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s126910582", "group_id": "codeNet:p03126", "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\tfoods := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tfmt.Scan(&d)\n\n\t\tlst := make([]int, d)\n\t\tfor i := range lst {\n\t\t\tfmt.Scan(&lst[i])\n\t\t}\n\n\t\tfor _, v := range lst {\n\t\t\tfoods[v]++\n\t\t}\n\t}\n\n\tcount := 0\n\tfor _, v := range foods {\n\t\tif v == n {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1555454678, "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/s126910582.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s126910582", "user_id": "u102310764"}, "prompt_components": {"gold_output": "1\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\tfoods := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tfmt.Scan(&d)\n\n\t\tlst := make([]int, d)\n\t\tfor i := range lst {\n\t\t\tfmt.Scan(&lst[i])\n\t\t}\n\n\t\tfor _, v := range lst {\n\t\t\tfoods[v]++\n\t\t}\n\t}\n\n\tcount := 0\n\tfor _, v := range foods {\n\t\tif v == n {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s589770870", "group_id": "codeNet:p03127", "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\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 scanInts(n int) []int {\n\tis := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tis[i] = nextInt()\n\t}\n\treturn is\n}\n\nfunc main() {\n\tN := nextInt()\n\tIS := scanInts(N)\n\tsort.Sort(sort.IntSlice(IS))\n\tif len(IS) > 10 {\n\t\tIS = IS[0:9]\n\t}\n\tfor {\n\t\tif len(IS) == 1 {\n\t\t\tfmt.Println(IS[0])\n\t\t\treturn\n\t\t}\n\t\tif IS[0] == IS[1] {\n\t\t\tIS = IS[1:]\n\t\t\tcontinue\n\t\t} else if IS[0] == 1 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t\ta := IS[1] - IS[0]\n\t\tb := IS[0]\n\t\tIS[1] = max(a, b)\n\t\tIS[0] = min(a, 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 max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598927247, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s589770870.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s589770870", "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\"sort\"\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 scanInts(n int) []int {\n\tis := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tis[i] = nextInt()\n\t}\n\treturn is\n}\n\nfunc main() {\n\tN := nextInt()\n\tIS := scanInts(N)\n\tsort.Sort(sort.IntSlice(IS))\n\tif len(IS) > 10 {\n\t\tIS = IS[0:9]\n\t}\n\tfor {\n\t\tif len(IS) == 1 {\n\t\t\tfmt.Println(IS[0])\n\t\t\treturn\n\t\t}\n\t\tif IS[0] == IS[1] {\n\t\t\tIS = IS[1:]\n\t\t\tcontinue\n\t\t} else if IS[0] == 1 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t\ta := IS[1] - IS[0]\n\t\tb := IS[0]\n\t\tIS[1] = max(a, b)\n\t\tIS[0] = min(a, 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 max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "sample_input": "4\n2 10 8 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03127", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1125, "cpu_time_ms": 42, "memory_kb": 5200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s643928932", "group_id": "codeNet:p03128", "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\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\nvar score []int = []int{0, 2, 5, 5, 4, 5, 6, 3, 7, 6}\n\ntype sortTarget0Slice []int\n\nfunc (s sortTarget0Slice) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortTarget0Slice) Less(i, j int) bool {\n\tif score[s[i]] < score[s[j]] {\n\t\treturn true\n\t} else if score[s[i]] > score[s[j]] {\n\t\treturn false\n\t}\n\treturn s[i] > s[j]\n}\n\nfunc (s sortTarget0Slice) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc less(a, b string) bool {\n\tif len(a) < len(b) {\n\t\treturn true\n\t} else if len(a) > len(b) {\n\t\treturn false\n\t}\n\tav, _ := strconv.ParseInt(a[:1], 0, 64)\n\tbv, _ := strconv.ParseInt(b[:1], 0, 64)\n\tif av < bv {\n\t\treturn true\n\t} else if av > bv {\n\t\treturn false\n\t}\n\treturn less(a[1:], b[1:])\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\n\tm := readInt()\n\ta := make([]int, m)\n\tfor i := range a {\n\t\ta[i] = readInt()\n\t}\n\tsort.Sort(sortTarget0Slice(a))\n\n\tdp := make([]string, n+1)\n\tfor i := range dp {\n\t\tdp[i] = \"_\"\n\t}\n\tdp[0] = \"\"\n\tfor i := 1; i <= n; i++ {\n\t\tfor _, x := range a {\n\t\t\tp := i - score[x]\n\t\t\tif p < 0 || dp[p] == \"_\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ts := fmt.Sprintf(\"%d%s\", x, dp[p])\n\t\t\tif dp[i] == \"_\" || less(dp[i], s) {\n\t\t\t\tdp[i] = s\n\t\t\t}\n\t\t}\n\t}\n\tprintln(dp[n])\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1550373859, "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/s643928932.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s643928932", "user_id": "u705974985"}, "prompt_components": {"gold_output": "777773\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\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\nvar score []int = []int{0, 2, 5, 5, 4, 5, 6, 3, 7, 6}\n\ntype sortTarget0Slice []int\n\nfunc (s sortTarget0Slice) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortTarget0Slice) Less(i, j int) bool {\n\tif score[s[i]] < score[s[j]] {\n\t\treturn true\n\t} else if score[s[i]] > score[s[j]] {\n\t\treturn false\n\t}\n\treturn s[i] > s[j]\n}\n\nfunc (s sortTarget0Slice) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\nfunc less(a, b string) bool {\n\tif len(a) < len(b) {\n\t\treturn true\n\t} else if len(a) > len(b) {\n\t\treturn false\n\t}\n\tav, _ := strconv.ParseInt(a[:1], 0, 64)\n\tbv, _ := strconv.ParseInt(b[:1], 0, 64)\n\tif av < bv {\n\t\treturn true\n\t} else if av > bv {\n\t\treturn false\n\t}\n\treturn less(a[1:], b[1:])\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\n\tm := readInt()\n\ta := make([]int, m)\n\tfor i := range a {\n\t\ta[i] = readInt()\n\t}\n\tsort.Sort(sortTarget0Slice(a))\n\n\tdp := make([]string, n+1)\n\tfor i := range dp {\n\t\tdp[i] = \"_\"\n\t}\n\tdp[0] = \"\"\n\tfor i := 1; i <= n; i++ {\n\t\tfor _, x := range a {\n\t\t\tp := i - score[x]\n\t\t\tif p < 0 || dp[p] == \"_\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ts := fmt.Sprintf(\"%d%s\", x, dp[p])\n\t\t\tif dp[i] == \"_\" || less(dp[i], s) {\n\t\t\t\tdp[i] = s\n\t\t\t}\n\t\t}\n\t}\n\tprintln(dp[n])\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2554, "cpu_time_ms": 276, "memory_kb": 112384}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s393787206", "group_id": "codeNet:p03129", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\tm := (n-1)/2 + 1\n\tif k <= m {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1555299962, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/Go/s393787206.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s393787206", "user_id": "u150861392"}, "prompt_components": {"gold_output": "YES\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\tm := (n-1)/2 + 1\n\tif k <= m {\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\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 166, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s138194612", "group_id": "codeNet:p03129", "input_text": "package main\n\nimport(\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tvar num int\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tfmt.Sscanf(sc.Text(), \"%d %d\", &n, &k)\n\n\tif n%2 == 0{\n\t\tnum = n/2\n\t} else {\n\t\tnum = ((n+1)/2) + 1\n\t}\n\n\n\tif k <= num{\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1549769889, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/Go/s138194612.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s138194612", "user_id": "u900303768"}, "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\tvar n int\n\tvar k int\n\tvar num int\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tfmt.Sscanf(sc.Text(), \"%d %d\", &n, &k)\n\n\tif n%2 == 0{\n\t\tnum = n/2\n\t} else {\n\t\tnum = ((n+1)/2) + 1\n\t}\n\n\n\tif k <= num{\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\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 315, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s400749221", "group_id": "codeNet:p03130", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := make([]int, 3)\n b := make([]int, 3)\n for i := 0; i < 3; i++ {\n fmt.Scan(&a[i])\n fmt.Scan(&b[i])\n }\n isTwoCount := 0\n isYes := true\n for i := 1; i < 5; i++ {\n count := 0\n for j := 0; j < 3; j++ {\n if a[j] == i || b [j] == i {\n count++\n }\n }\n if count > 2 {\n isYes = false\n break\n }\n if count > 1 {\n isTwoCount++\n }\n }\n if isYes || isTwoCount == 1 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n", "language": "Go", "metadata": {"date": 1550414358, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03130.html", "problem_id": "p03130", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03130/input.txt", "sample_output_relpath": "derived/input_output/data/p03130/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03130/Go/s400749221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s400749221", "user_id": "u540996900"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := make([]int, 3)\n b := make([]int, 3)\n for i := 0; i < 3; i++ {\n fmt.Scan(&a[i])\n fmt.Scan(&b[i])\n }\n isTwoCount := 0\n isYes := true\n for i := 1; i < 5; i++ {\n count := 0\n for j := 0; j < 3; j++ {\n if a[j] == i || b [j] == i {\n count++\n }\n }\n if count > 2 {\n isYes = false\n break\n }\n if count > 1 {\n isTwoCount++\n }\n }\n if isYes || isTwoCount == 1 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "sample_input": "4 2\n1 3\n2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03130", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 532, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s391981143", "group_id": "codeNet:p03131", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\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\t// A := strings.Split(nextLine(), \" \")\n\n\tX := strings.Split(nextLine(), \" \")\n\n\t// Z := strings.Split(nextLine(), \" \")\n\n\t// n, _ := strconv.Atoi(input[0])\n\n\t// memo = make([]bool, n+1, n+2)\n\n\tK, _ := strconv.Atoi(X[0])\n\tA, _ := strconv.Atoi(X[1])\n\tB, _ := strconv.Atoi(X[2])\n\n\t// ans := K+1\n\tbuiscket := int64(K + 1)\n\ttmp := int64(1)\n\tmoney := int64(0)\n\n\tfor i := 0; i < K; i++ {\n\n\t\tif money < 1 {\n\n\t\t\tif i >= K-1 {\n\t\t\t\ttmp++\n\t\t\t} else if tmp < int64(A) {\n\t\t\t\ttmp++\n\t\t\t} else {\n\t\t\t\ttmp, money = exchangeToYen(tmp, int64(A))\n\t\t\t}\n\t\t} else {\n\t\t\ttmp, money = exchangeToBuiscket(money, tmp, int64(B))\n\t\t}\n\t\t// fmt.Printf(\"tmp: %d , money: %d \\n\", tmp, money)\n\t}\n\n\tbuiscket = max(buiscket, tmp)\n\n\tfmt.Fprintln(wtr, buiscket)\n\n\t_ = wtr.Flush()\n}\n\nfunc addBuiscket(b int64) int64 {\n\treturn b + 1\n}\nfunc exchangeToYen(b int64, rate int64) (rest int64, money int64) {\n\treturn b - rate, 1\n}\nfunc exchangeToBuiscket(mone int64, buis int64, rate int64) (b int64, money int64) {\n\treturn buis + rate, mone - 1\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\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 int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc com(a, b int) int {\n\n\tif a > b {\n\t\treturn 0\n\t}\n\treturn abs(a - b)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\ntype dishh struct {\n\tfirst int\n\tsecond int\n}\n\ntype dish []dishh\n\nfunc (p dish) Len() int {\n\treturn len(p)\n}\n\nfunc (p dish) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p dish) Less(i, j int) bool {\n\n\treturn p[i].first+p[i].second > p[j].first+p[j].second\n}\n", "language": "Go", "metadata": {"date": 1549768613, "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/s391981143.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s391981143", "user_id": "u947658937"}, "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\t\"strings\"\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\t// A := strings.Split(nextLine(), \" \")\n\n\tX := strings.Split(nextLine(), \" \")\n\n\t// Z := strings.Split(nextLine(), \" \")\n\n\t// n, _ := strconv.Atoi(input[0])\n\n\t// memo = make([]bool, n+1, n+2)\n\n\tK, _ := strconv.Atoi(X[0])\n\tA, _ := strconv.Atoi(X[1])\n\tB, _ := strconv.Atoi(X[2])\n\n\t// ans := K+1\n\tbuiscket := int64(K + 1)\n\ttmp := int64(1)\n\tmoney := int64(0)\n\n\tfor i := 0; i < K; i++ {\n\n\t\tif money < 1 {\n\n\t\t\tif i >= K-1 {\n\t\t\t\ttmp++\n\t\t\t} else if tmp < int64(A) {\n\t\t\t\ttmp++\n\t\t\t} else {\n\t\t\t\ttmp, money = exchangeToYen(tmp, int64(A))\n\t\t\t}\n\t\t} else {\n\t\t\ttmp, money = exchangeToBuiscket(money, tmp, int64(B))\n\t\t}\n\t\t// fmt.Printf(\"tmp: %d , money: %d \\n\", tmp, money)\n\t}\n\n\tbuiscket = max(buiscket, tmp)\n\n\tfmt.Fprintln(wtr, buiscket)\n\n\t_ = wtr.Flush()\n}\n\nfunc addBuiscket(b int64) int64 {\n\treturn b + 1\n}\nfunc exchangeToYen(b int64, rate int64) (rest int64, money int64) {\n\treturn b - rate, 1\n}\nfunc exchangeToBuiscket(mone int64, buis int64, rate int64) (b int64, money int64) {\n\treturn buis + rate, mone - 1\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\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 int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc com(a, b int) int {\n\n\tif a > b {\n\t\treturn 0\n\t}\n\treturn abs(a - b)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\ntype dishh struct {\n\tfirst int\n\tsecond int\n}\n\ntype dish []dishh\n\nfunc (p dish) Len() int {\n\treturn len(p)\n}\n\nfunc (p dish) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p dish) Less(i, j int) bool {\n\n\treturn p[i].first+p[i].second > p[j].first+p[j].second\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1623, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s440910969", "group_id": "codeNet:p03136", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc maxInt(a ...int) int {m := a[0]; for _, x := range a {if x > m {m = x}}; return m}\nfunc minInt(a ...int) int {m := a[0]; for _, x := range a {if x < m {m = x}}; return m}\nfunc sumInt(a ...int) int {s := 0; for _, v := range a {s += v}; return s}\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n l := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&l[i])\n }\n\n ans := \"No\"\n if sumInt(l...) > maxInt(l...) * 2 {\n ans = \"Yes\"\n }\n fmt.Println(ans)\n\n\n}", "language": "Go", "metadata": {"date": 1588057593, "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/s440910969.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s440910969", "user_id": "u254871849"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc maxInt(a ...int) int {m := a[0]; for _, x := range a {if x > m {m = x}}; return m}\nfunc minInt(a ...int) int {m := a[0]; for _, x := range a {if x < m {m = x}}; return m}\nfunc sumInt(a ...int) int {s := 0; for _, v := range a {s += v}; return s}\n\nfunc main() {\n var n int \n fmt.Scan(&n)\n l := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&l[i])\n }\n\n ans := \"No\"\n if sumInt(l...) > maxInt(l...) * 2 {\n ans = \"Yes\"\n }\n fmt.Println(ans)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 497, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970592602", "group_id": "codeNet:p03136", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n int\n\tvar max int\n\tvar sum int\n\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar l int\n\t\tfmt.Scan(&l)\n\t\tsum += l\n\t\tif max < l {\n\t\t\tmax = l\n\t\t}\n\t}\n\n\tsum -= max\n\n\tif max < sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1549247411, "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/s970592602.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s970592602", "user_id": "u592723381"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n int\n\tvar max int\n\tvar sum int\n\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar l int\n\t\tfmt.Scan(&l)\n\t\tsum += l\n\t\tif max < l {\n\t\t\tmax = l\n\t\t}\n\t}\n\n\tsum -= max\n\n\tif max < sum {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 285, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s804124048", "group_id": "codeNet:p03140", "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\tA := sc.NextLine()\n\tB := sc.NextLine()\n\tC := sc.NextLine()\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tmp := map[byte]bool{}\n\t\tmp[A[i]] = true\n\t\tmp[B[i]] = true\n\t\tmp[C[i]] = true\n\n\t\tif len(mp) == 2 {\n\t\t\tans += 1\n\t\t} else if len(mp) == 3 {\n\t\t\tans += 2\n\t\t}\n\t}\n\tfmt.Println(ans)\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": 1548641416, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03140.html", "problem_id": "p03140", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03140/input.txt", "sample_output_relpath": "derived/input_output/data/p03140/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03140/Go/s804124048.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s804124048", "user_id": "u504669764"}, "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\tsc := NewScanner()\n\tN := sc.NextInt()\n\tA := sc.NextLine()\n\tB := sc.NextLine()\n\tC := sc.NextLine()\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tmp := map[byte]bool{}\n\t\tmp[A[i]] = true\n\t\tmp[B[i]] = true\n\t\tmp[C[i]] = true\n\n\t\tif len(mp) == 2 {\n\t\t\tans += 1\n\t\t} else if len(mp) == 3 {\n\t\t\tans += 2\n\t\t}\n\t}\n\tfmt.Println(ans)\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\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "sample_input": "4\nwest\neast\nwait\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03140", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given three strings A, B and C. Each of these is a string of length N consisting of lowercase English letters.\n\nOur objective is to make all these three strings equal. For that, you can repeatedly perform the following operation:\n\nOperation: Choose one of the strings A, B and C, and specify an integer i between 1 and N (inclusive). Change the i-th character from the beginning of the chosen string to some other lowercase English letter.\n\nWhat is the minimum number of operations required to achieve the objective?\n\nConstraints\n\n1 \\leq N \\leq 100\n\nEach of the strings A, B and C is a string of length N.\n\nEach character in each of the strings A, B and C is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\n4\nwest\neast\nwait\n\nSample Output 1\n\n3\n\nIn this sample, initially A = west、B = east、C = wait. We can achieve the objective in the minimum number of operations by performing three operations as follows:\n\nChange the second character in A to a. A is now wast.\n\nChange the first character in B to w. B is now wast.\n\nChange the third character in C to s. C is now wast.\n\nSample Input 2\n\n9\ndifferent\ndifferent\ndifferent\n\nSample Output 2\n\n0\n\nIf A, B and C are already equal in the beginning, the number of operations required is 0.\n\nSample Input 3\n\n7\nzenkoku\ntouitsu\nprogram\n\nSample Output 3\n\n13", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2214, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s226784483", "group_id": "codeNet:p03141", "input_text": "// ProblemURL : https://atcoder.jp/contests/nikkei2019-qual/tasks/nikkei2019_qual_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) (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 cumsum(a []int) []int {\n\tb := intsCopy(a)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc cumsumZeroHead(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 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\treturn\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\treturn\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 strCountAlphabets(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 strCountAlphabets: argument must be lowercase string\")\n\t\t}\n\t\tct[ss-'a']++\n\t}\n\treturn ct\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 runeIsUpperAlphabet(r rune) bool { return 'A' <= r && r <= 'Z' }\nfunc runeIsLowerAlphabet(r rune) bool { return 'a' <= r && r <= 'z' }\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 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\ntype tuple struct{ a, b, c int }\ntype byC []tuple\n\nfunc (p byC) Len() int { return len(p) }\nfunc (p byC) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byC) Less(i, j int) bool { return p[i].c < p[j].c }\n\nfunc solve() {\n\tn := ri()\n\tas := make([]int, n)\n\tbs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = ri()\n\t\tbs[i] = ri()\n\t}\n\n\tcs := make([]tuple, n)\n\tfor i := 0; i < n; i++ {\n\t\tcs[i] = tuple{a: as[i], b: bs[i], c: as[i] + bs[i]}\n\t}\n\tsort.Sort(sort.Reverse(byC(cs)))\n\n\tscore := 0\n\tfor i := range cs {\n\t\tif isEven(i) {\n\t\t\tscore += cs[i].a\n\t\t} else {\n\t\t\tscore -= cs[i].b\n\t\t}\n\t}\n\tpln(score)\n}\n", "language": "Go", "metadata": {"date": 1575068200, "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/s226784483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s226784483", "user_id": "u554269352"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/nikkei2019-qual/tasks/nikkei2019_qual_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) (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 cumsum(a []int) []int {\n\tb := intsCopy(a)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc cumsumZeroHead(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 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\treturn\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\treturn\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 strCountAlphabets(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 strCountAlphabets: argument must be lowercase string\")\n\t\t}\n\t\tct[ss-'a']++\n\t}\n\treturn ct\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 runeIsUpperAlphabet(r rune) bool { return 'A' <= r && r <= 'Z' }\nfunc runeIsLowerAlphabet(r rune) bool { return 'a' <= r && r <= 'z' }\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 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\ntype tuple struct{ a, b, c int }\ntype byC []tuple\n\nfunc (p byC) Len() int { return len(p) }\nfunc (p byC) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byC) Less(i, j int) bool { return p[i].c < p[j].c }\n\nfunc solve() {\n\tn := ri()\n\tas := make([]int, n)\n\tbs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = ri()\n\t\tbs[i] = ri()\n\t}\n\n\tcs := make([]tuple, n)\n\tfor i := 0; i < n; i++ {\n\t\tcs[i] = tuple{a: as[i], b: bs[i], c: as[i] + bs[i]}\n\t}\n\tsort.Sort(sort.Reverse(byC(cs)))\n\n\tscore := 0\n\tfor i := range cs {\n\t\tif isEven(i) {\n\t\t\tscore += cs[i].a\n\t\t} else {\n\t\t\tscore -= cs[i].b\n\t\t}\n\t}\n\tpln(score)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11440, "cpu_time_ms": 86, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s401762135", "group_id": "codeNet:p03147", "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\n\tnFlowers := scanInt(sc)\n\n\theights := make([]int, nFlowers+1)\n\tmax := 0\n\tfor i := 0; i < nFlowers; i++ {\n\t\theights[i] = scanInt(sc)\n\t\tif heights[i] > max {\n\t\t\tmax = heights[i]\n\t\t}\n\t}\n\theights[nFlowers] = 0\n\n\ttotal := 0\n\tfor min := 0; min < max; min++ {\n\t\tcnt := 0\n\t\tseq := false\n\t\tfor _, h := range heights {\n\t\t\tif h <= min {\n\t\t\t\tif seq {\n\t\t\t\t\tcnt += 1\n\t\t\t\t\tseq = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseq = true\n\t\t\t}\n\t\t}\n\t\ttotal += cnt\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}\n", "language": "Go", "metadata": {"date": 1548494469, "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/s401762135.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s401762135", "user_id": "u307252896"}, "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\n\tnFlowers := scanInt(sc)\n\n\theights := make([]int, nFlowers+1)\n\tmax := 0\n\tfor i := 0; i < nFlowers; i++ {\n\t\theights[i] = scanInt(sc)\n\t\tif heights[i] > max {\n\t\t\tmax = heights[i]\n\t\t}\n\t}\n\theights[nFlowers] = 0\n\n\ttotal := 0\n\tfor min := 0; min < max; min++ {\n\t\tcnt := 0\n\t\tseq := false\n\t\tfor _, h := range heights {\n\t\t\tif h <= min {\n\t\t\t\tif seq {\n\t\t\t\t\tcnt += 1\n\t\t\t\t\tseq = false\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tseq = true\n\t\t\t}\n\t\t}\n\t\ttotal += cnt\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}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 683, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s382349287", "group_id": "codeNet:p03147", "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 NewxtSlice(num int) []int {\n\n\trep := make([]int, num)\n\tin.Scan()\n\tele := strings.Split(in.Text(), \" \")\n\tfor i := 0; i < num; i++ {\n\t\tn, _ := strconv.Atoi(ele[i])\n\t\trep[i] = n\n\t}\n\treturn rep\n}\nfunc iszero(num []int) bool {\n\tfor _, v := range num {\n\t\tif v == 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\nfunc max(num []int) int {\n\tmax := 0\n\tfor _, v := range num {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\nfunc isOrder(num []int) bool {\n\tfor i := 1; i < len(num)-1; i++ {\n\t\tif num[i] > num[i-1] && num[i] < num[i+1] {\n\t\t\tcontinue\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\trep := NewxtSlice(N)\n\ttemp := 0\n\tcount := 0\n\tvar Maxs []int\nLABEL1:\n\tif iszero(rep) {\n\t\tfor i := 0; i < N; i++ {\n\t\tLABEL2:\n\t\t\tif rep[i] == 0 {\n\t\t\t\tif i == 0 {\n\t\t\t\t\ttemp = i + 1\n\t\t\t\t} else {\n\t\t\t\t\tif temp == i {\n\t\t\t\t\t\ttemp++\n\t\t\t\t\t\ti++\n\t\t\t\t\t\tgoto LABEL2\n\t\t\t\t\t} else if isOrder(rep[temp:i]) {\n\t\t\t\t\t\tMaxNum := max(rep[temp:i])\n\t\t\t\t\t\tMaxs = append(Maxs, MaxNum)\n\t\t\t\t\t\ttemp = i + 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor iszero(rep[temp:i]) != true {\n\t\t\t\t\t\t\tfor k := temp; k < i; k++ {\n\t\t\t\t\t\t\t\trep[k]--\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgoto LABEL2\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if i == N-1 {\n\t\t\t\tif isOrder(rep[temp:]) {\n\t\t\t\t\tMaxNum := max(rep[temp:])\n\t\t\t\t\tMaxs = append(Maxs, MaxNum)\n\t\t\t\t} else {\n\t\t\t\t\tfor iszero(rep[temp:i+1]) != true {\n\t\t\t\t\t\tfor k := temp; k <= i; k++ {\n\t\t\t\t\t\t\trep[k]--\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++\n\t\t\t\t\t}\n\t\t\t\t\ttemptemp := temp\n\t\t\t\tLABEL3:\n\t\t\t\t\tif iszero(rep[temp : i+1]) {\n\t\t\t\t\t\tfor t, v := range rep[temp : i+1] {\n\t\t\t\t\t\t\tif v == 0 {\n\t\t\t\t\t\t\t\tMaxs = append(Maxs, max(rep[temp:temp+t]))\n\t\t\t\t\t\t\t\ttemp = temp + t + 1\n\t\t\t\t\t\t\t\tgoto LABEL3\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\ttemp = temptemp\n\t\t\t\t\ttemp++\n\n\t\t\t\t\tgoto LABEL2\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t} else {\n\t\tfor iszero(rep) != true {\n\t\t\tfor i := 0; i < len(rep); i++ {\n\t\t\t\trep[i]--\n\t\t\t}\n\t\t\tcount++\n\t\t\tgoto LABEL1\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range Maxs {\n\t\tans += v\n\t}\n\tans += count\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1548263498, "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/s382349287.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s382349287", "user_id": "u370270364"}, "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 NewxtSlice(num int) []int {\n\n\trep := make([]int, num)\n\tin.Scan()\n\tele := strings.Split(in.Text(), \" \")\n\tfor i := 0; i < num; i++ {\n\t\tn, _ := strconv.Atoi(ele[i])\n\t\trep[i] = n\n\t}\n\treturn rep\n}\nfunc iszero(num []int) bool {\n\tfor _, v := range num {\n\t\tif v == 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\nfunc max(num []int) int {\n\tmax := 0\n\tfor _, v := range num {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\nfunc isOrder(num []int) bool {\n\tfor i := 1; i < len(num)-1; i++ {\n\t\tif num[i] > num[i-1] && num[i] < num[i+1] {\n\t\t\tcontinue\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\trep := NewxtSlice(N)\n\ttemp := 0\n\tcount := 0\n\tvar Maxs []int\nLABEL1:\n\tif iszero(rep) {\n\t\tfor i := 0; i < N; i++ {\n\t\tLABEL2:\n\t\t\tif rep[i] == 0 {\n\t\t\t\tif i == 0 {\n\t\t\t\t\ttemp = i + 1\n\t\t\t\t} else {\n\t\t\t\t\tif temp == i {\n\t\t\t\t\t\ttemp++\n\t\t\t\t\t\ti++\n\t\t\t\t\t\tgoto LABEL2\n\t\t\t\t\t} else if isOrder(rep[temp:i]) {\n\t\t\t\t\t\tMaxNum := max(rep[temp:i])\n\t\t\t\t\t\tMaxs = append(Maxs, MaxNum)\n\t\t\t\t\t\ttemp = i + 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor iszero(rep[temp:i]) != true {\n\t\t\t\t\t\t\tfor k := temp; k < i; k++ {\n\t\t\t\t\t\t\t\trep[k]--\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgoto LABEL2\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if i == N-1 {\n\t\t\t\tif isOrder(rep[temp:]) {\n\t\t\t\t\tMaxNum := max(rep[temp:])\n\t\t\t\t\tMaxs = append(Maxs, MaxNum)\n\t\t\t\t} else {\n\t\t\t\t\tfor iszero(rep[temp:i+1]) != true {\n\t\t\t\t\t\tfor k := temp; k <= i; k++ {\n\t\t\t\t\t\t\trep[k]--\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++\n\t\t\t\t\t}\n\t\t\t\t\ttemptemp := temp\n\t\t\t\tLABEL3:\n\t\t\t\t\tif iszero(rep[temp : i+1]) {\n\t\t\t\t\t\tfor t, v := range rep[temp : i+1] {\n\t\t\t\t\t\t\tif v == 0 {\n\t\t\t\t\t\t\t\tMaxs = append(Maxs, max(rep[temp:temp+t]))\n\t\t\t\t\t\t\t\ttemp = temp + t + 1\n\t\t\t\t\t\t\t\tgoto LABEL3\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\ttemp = temptemp\n\t\t\t\t\ttemp++\n\n\t\t\t\t\tgoto LABEL2\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t} else {\n\t\tfor iszero(rep) != true {\n\t\t\tfor i := 0; i < len(rep); i++ {\n\t\t\t\trep[i]--\n\t\t\t}\n\t\t\tcount++\n\t\t\tgoto LABEL1\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range Maxs {\n\t\tans += v\n\t}\n\tans += count\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2065, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s421218002", "group_id": "codeNet:p03147", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\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 length := len(line)\n for i := 0;i < length; i++ {\n n, _ := strconv.Atoi(line[i])\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc readInt() int {\n sc.Scan()\n str := sc.Text()\n n, _ := strconv.Atoi(str)\n return n\n}\n\nfunc main() {\n readInt()\n hList := readLineToInt()\n cnt := 0\n preValue := 0\n for _, value := range hList {\n if preValue < value {\n cnt += value - preValue\n }\n preValue = value\n }\n fmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1548120470, "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/s421218002.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s421218002", "user_id": "u145035045"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strings\"\n \"strconv\"\n \"fmt\"\n)\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 length := len(line)\n for i := 0;i < length; i++ {\n n, _ := strconv.Atoi(line[i])\n intLine = append(intLine, n)\n }\n return intLine\n}\n\nfunc readInt() int {\n sc.Scan()\n str := sc.Text()\n n, _ := strconv.Atoi(str)\n return n\n}\n\nfunc main() {\n readInt()\n hList := readLineToInt()\n cnt := 0\n preValue := 0\n for _, value := range hList {\n if preValue < value {\n cnt += value - preValue\n }\n preValue = value\n }\n fmt.Println(cnt)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s434478833", "group_id": "codeNet:p03150", "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\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\tresolve(parseProblem())\n}\n\nfunc parseProblem() string {\n\treturn scanString(sc)\n}\n\nconst (\n\tPre = 0 + iota\n\tRemoving\n\tPost\n)\n\nfunc resolve(str string) {\n\tconst target = \"keyence\"\n\tif strings.HasSuffix(str, target) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tif str[0:len(target)] == target {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\ti := 0\n\tfor ; i < len(str); i++ {\n\t\tif str[i] != target[i] {\n\t\t\tbreak\n\t\t}\n\t}\n\tif strings.HasSuffix(str, target[i:len(target)]) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n\treturn\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1594067783, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s434478833.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s434478833", "user_id": "u623007471"}, "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\t\"strings\"\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\tresolve(parseProblem())\n}\n\nfunc parseProblem() string {\n\treturn scanString(sc)\n}\n\nconst (\n\tPre = 0 + iota\n\tRemoving\n\tPost\n)\n\nfunc resolve(str string) {\n\tconst target = \"keyence\"\n\tif strings.HasSuffix(str, target) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tif str[0:len(target)] == target {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\ti := 0\n\tfor ; i < len(str); i++ {\n\t\tif str[i] != target[i] {\n\t\t\tbreak\n\t\t}\n\t}\n\tif strings.HasSuffix(str, target[i:len(target)]) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n\treturn\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 10, "memory_kb": 1780}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390115039", "group_id": "codeNet:p03150", "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\tsc.Buffer([]byte{}, 1000000)\n\ts := getString()\n\n\tt := \"keyence\"\n\tl := 0\n\tfor i := 0; s[i] == t[i]; i++ {\n\t\tl++\n\t\tif l == len(t) {\n\t\t\tbreak\n\t\t}\n\t}\n\t// out(l)\n\n\trt := \"ecneyek\"\n\tr := 0\n\tfor i := 0; i < 7; i++ {\n\t\tif s[len(s)-1-i] != rt[i] {\n\t\t\tbreak\n\t\t}\n\t\tr++\n\t}\n\t// out(r)\n\n\tif r+l >= 7 {\n\t\tout(\"YES\")\n\t} else {\n\t\tout(\"NO\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1588691515, "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/s390115039.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390115039", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\ts := getString()\n\n\tt := \"keyence\"\n\tl := 0\n\tfor i := 0; s[i] == t[i]; i++ {\n\t\tl++\n\t\tif l == len(t) {\n\t\t\tbreak\n\t\t}\n\t}\n\t// out(l)\n\n\trt := \"ecneyek\"\n\tr := 0\n\tfor i := 0; i < 7; i++ {\n\t\tif s[len(s)-1-i] != rt[i] {\n\t\t\tbreak\n\t\t}\n\t\tr++\n\t}\n\t// out(r)\n\n\tif r+l >= 7 {\n\t\tout(\"YES\")\n\t} else {\n\t\tout(\"NO\")\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s416491579", "group_id": "codeNet:p03150", "input_text": "// by syu\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar in = NewScanner(os.Stdin, 0)\n\nfunc main() {\n\ts := in.String()\n\tswitch {\n\tcase check(s, \"k\", \"eyence\"):\n\t\tfallthrough\n\tcase check(s, \"ke\", \"yence\"):\n\t\tfallthrough\n\tcase check(s, \"key\", \"ence\"):\n\t\tfallthrough\n\tcase check(s, \"keye\", \"nce\"):\n\t\tfallthrough\n\tcase check(s, \"keyen\", \"ce\"):\n\t\tfallthrough\n\tcase check(s, \"keyenc\", \"e\"):\n\t\tfallthrough\n\tcase check(s, \"keyence\", \"\"):\n\t\tRln(\"YES\")\n\tdefault:\n\t\tRln(\"NO\")\n\t}\n}\nfunc check(a, x, y string) bool {\n\tf1 := strings.Index(a, x)\n\tif f1 < 0 {\n\t\treturn false\n\t}\n\tf2 := strings.Index(a[f1+len(x)-1:], y)\n\tif f2 < 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\ntype Scanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader, max int) *Scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(scanWords)\n\tif max <= 0 {\n\t\tmax = 1048576\n\t}\n\ts.Buffer([]byte{}, max)\n\treturn &Scanner{s}\n}\nfunc (s *Scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\nfunc isSpace(b byte) bool {\n\treturn b == ' ' || b == '\\n' || b == '\\r' || b == '\\t'\n}\nfunc scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tstart := 0\n\tfor start < len(data) && isSpace(data[start]) {\n\t\tstart++\n\t}\n\tfor i := start; i < len(data); i++ {\n\t\tif isSpace(data[i]) {\n\t\t\treturn i + 1, data[start:i], nil\n\t\t}\n\t}\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\treturn start, nil, nil\n}\nfunc Rln(s ...interface{}) {\n\tfmt.Println(s...)\n\tos.Exit(0)\n}\n\ntype ByteSlice []byte\ntype IntSlice []byte\n", "language": "Go", "metadata": {"date": 1547410373, "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/s416491579.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s416491579", "user_id": "u502859637"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// by syu\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar in = NewScanner(os.Stdin, 0)\n\nfunc main() {\n\ts := in.String()\n\tswitch {\n\tcase check(s, \"k\", \"eyence\"):\n\t\tfallthrough\n\tcase check(s, \"ke\", \"yence\"):\n\t\tfallthrough\n\tcase check(s, \"key\", \"ence\"):\n\t\tfallthrough\n\tcase check(s, \"keye\", \"nce\"):\n\t\tfallthrough\n\tcase check(s, \"keyen\", \"ce\"):\n\t\tfallthrough\n\tcase check(s, \"keyenc\", \"e\"):\n\t\tfallthrough\n\tcase check(s, \"keyence\", \"\"):\n\t\tRln(\"YES\")\n\tdefault:\n\t\tRln(\"NO\")\n\t}\n}\nfunc check(a, x, y string) bool {\n\tf1 := strings.Index(a, x)\n\tif f1 < 0 {\n\t\treturn false\n\t}\n\tf2 := strings.Index(a[f1+len(x)-1:], y)\n\tif f2 < 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\ntype Scanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader, max int) *Scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(scanWords)\n\tif max <= 0 {\n\t\tmax = 1048576\n\t}\n\ts.Buffer([]byte{}, max)\n\treturn &Scanner{s}\n}\nfunc (s *Scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\nfunc isSpace(b byte) bool {\n\treturn b == ' ' || b == '\\n' || b == '\\r' || b == '\\t'\n}\nfunc scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tstart := 0\n\tfor start < len(data) && isSpace(data[start]) {\n\t\tstart++\n\t}\n\tfor i := start; i < len(data); i++ {\n\t\tif isSpace(data[i]) {\n\t\t\treturn i + 1, data[start:i], nil\n\t\t}\n\t}\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\treturn start, nil, nil\n}\nfunc Rln(s ...interface{}) {\n\tfmt.Println(s...)\n\tos.Exit(0)\n}\n\ntype ByteSlice []byte\ntype IntSlice []byte\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1506, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s180627185", "group_id": "codeNet:p03162", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\n\thappiness := make([][]int, n)\n\tfor i := range happiness {\n\t\thappiness[i] = sc.Ints(3)\n\t}\n\n\tm := make([][]int, n)\n\tfor i := range m {\n\t\tm[i] = make([]int, 3)\n\t}\n\tm[0][0] = happiness[0][0]\n\tm[0][1] = happiness[0][1]\n\tm[0][2] = happiness[0][2]\n\n\tfor i := range happiness[1:] {\n\t\tm[i+1][0] = Max(m[i][1], m[i][2]) + happiness[i+1][0]\n\t\tm[i+1][1] = Max(m[i][0], m[i][2]) + happiness[i+1][1]\n\t\tm[i+1][2] = Max(m[i][0], m[i][1]) + happiness[i+1][2]\n\t}\n\n\tfmt.Println(MaxInts(m[n-1]...))\n}\n\n// generated by https://github.com/murosan/gollect\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInts(n ...int) int {\n\tmax := n[0]\n\tfor _, v := range n[1:] {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader) *Scanner {\n\ts := &Scanner{sc: bufio.NewScanner(r)}\n\ts.sc.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc (s *Scanner) Bytes() []byte {\n\ts.sc.Scan()\n\treturn s.sc.Bytes()\n}\n\nfunc (s *Scanner) Int() int { return BytesToInt(s.Bytes()) }\n\nfunc (s *Scanner) Ints(len int) []int {\n\ta := make([]int, len)\n\tfor i := 0; i < len; i++ {\n\t\ta[i] = s.Int()\n\t}\n\treturn a\n}\n\nfunc BytesToInt(b []byte) (n int) {\n\tvar i int\n\tnegative := b[0] == 45\n\tif negative {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn = n*10 + int(b[i]-'0')\n\t}\n\tif negative {\n\t\treturn -n\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1584927104, "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/s180627185.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s180627185", "user_id": "u478134456"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\n\thappiness := make([][]int, n)\n\tfor i := range happiness {\n\t\thappiness[i] = sc.Ints(3)\n\t}\n\n\tm := make([][]int, n)\n\tfor i := range m {\n\t\tm[i] = make([]int, 3)\n\t}\n\tm[0][0] = happiness[0][0]\n\tm[0][1] = happiness[0][1]\n\tm[0][2] = happiness[0][2]\n\n\tfor i := range happiness[1:] {\n\t\tm[i+1][0] = Max(m[i][1], m[i][2]) + happiness[i+1][0]\n\t\tm[i+1][1] = Max(m[i][0], m[i][2]) + happiness[i+1][1]\n\t\tm[i+1][2] = Max(m[i][0], m[i][1]) + happiness[i+1][2]\n\t}\n\n\tfmt.Println(MaxInts(m[n-1]...))\n}\n\n// generated by https://github.com/murosan/gollect\n\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInts(n ...int) int {\n\tmax := n[0]\n\tfor _, v := range n[1:] {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader) *Scanner {\n\ts := &Scanner{sc: bufio.NewScanner(r)}\n\ts.sc.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc (s *Scanner) Bytes() []byte {\n\ts.sc.Scan()\n\treturn s.sc.Bytes()\n}\n\nfunc (s *Scanner) Int() int { return BytesToInt(s.Bytes()) }\n\nfunc (s *Scanner) Ints(len int) []int {\n\ta := make([]int, len)\n\tfor i := 0; i < len; i++ {\n\t\ta[i] = s.Int()\n\t}\n\treturn a\n}\n\nfunc BytesToInt(b []byte) (n int) {\n\tvar i int\n\tnegative := b[0] == 45\n\tif negative {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn = n*10 + int(b[i]-'0')\n\t}\n\tif negative {\n\t\treturn -n\n\t}\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1442, "cpu_time_ms": 66, "memory_kb": 11904}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s223871722", "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 scanInt() 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 maxs(x ...int) int {\n\tmv := x[0]\n\tfor _, v := range x[1:] {\n\t\tif v > mv {\n\t\t\tmv = v\n\t\t}\n\t}\n\treturn mv\n}\n\nfunc main() {\n\tn := scanInt()\n\ta, b, c := make([]int, n), make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i], c[i] = scanInt(), scanInt(), scanInt()\n\t}\n\n\taa, ab, ac := make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\taa[i] = a[i-1] + maxs(ab[i-1], ac[i-1])\n\t\tab[i] = b[i-1] + maxs(aa[i-1], ac[i-1])\n\t\tac[i] = c[i-1] + maxs(aa[i-1], ab[i-1])\n\t}\n\tfmt.Println(maxs(aa[n], ab[n], ac[n]))\n}\n", "language": "Go", "metadata": {"date": 1584132424, "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/s223871722.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s223871722", "user_id": "u461993794"}, "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 scanInt() 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 maxs(x ...int) int {\n\tmv := x[0]\n\tfor _, v := range x[1:] {\n\t\tif v > mv {\n\t\t\tmv = v\n\t\t}\n\t}\n\treturn mv\n}\n\nfunc main() {\n\tn := scanInt()\n\ta, b, c := make([]int, n), make([]int, n), make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i], c[i] = scanInt(), scanInt(), scanInt()\n\t}\n\n\taa, ab, ac := make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\taa[i] = a[i-1] + maxs(ab[i-1], ac[i-1])\n\t\tab[i] = b[i-1] + maxs(aa[i-1], ac[i-1])\n\t\tac[i] = c[i-1] + maxs(aa[i-1], ab[i-1])\n\t}\n\tfmt.Println(maxs(aa[n], ab[n], ac[n]))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 768, "cpu_time_ms": 56, "memory_kb": 7168}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s086228183", "group_id": "codeNet:p03162", "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\tN := getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i], c[i] = getInt(), getInt(), getInt()\n\t}\n\n\tvar dp [100000][3]int\n\tdp[0][0] = a[0]\n\tdp[0][1] = b[0]\n\tdp[0][2] = c[0]\n\tfor i := 1; i < N; i++ {\n\t\tdp[i][0] = max(dp[i-1][1]+a[i], dp[i-1][2]+a[i])\n\t\tdp[i][1] = max(dp[i-1][0]+b[i], dp[i-1][2]+b[i])\n\t\tdp[i][2] = max(dp[i-1][0]+c[i], dp[i-1][1]+c[i])\n\t}\n\n\tout(max(dp[N-1][0], max(dp[N-1][1], dp[N-1][2])))\n\n}\n", "language": "Go", "metadata": {"date": 1581367432, "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/s086228183.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s086228183", "user_id": "u814575783"}, "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\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\tN := getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tc := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i], c[i] = getInt(), getInt(), getInt()\n\t}\n\n\tvar dp [100000][3]int\n\tdp[0][0] = a[0]\n\tdp[0][1] = b[0]\n\tdp[0][2] = c[0]\n\tfor i := 1; i < N; i++ {\n\t\tdp[i][0] = max(dp[i-1][1]+a[i], dp[i-1][2]+a[i])\n\t\tdp[i][1] = max(dp[i-1][0]+b[i], dp[i-1][2]+b[i])\n\t\tdp[i][2] = max(dp[i-1][0]+c[i], dp[i-1][1]+c[i])\n\t}\n\n\tout(max(dp[N-1][0], max(dp[N-1][1], dp[N-1][2])))\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 885, "cpu_time_ms": 55, "memory_kb": 7168}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117376152", "group_id": "codeNet:p03164", "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)\nvar rdr = bufio.NewReaderSize(os.Stdin, 0x100000)\nvar wtr = bufio.NewWriter(os.Stdout)\n\n// SplitSpace 空白で分割設定\nfunc SplitSpace() {\n\tscanner.Split(bufio.ScanWords)\n}\n\n// NextLine 標準入力から1行読み込む\nfunc NextLine() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\n// NextInt 標準入力から数値を一つ読み込む\nfunc NextInt() int {\n\tn, _ := strconv.Atoi(NextLine())\n\treturn n\n}\n\n// ReadLine 標準入力から長めの1行を読み込む\nfunc ReadLine() string {\n\tbuf := make([]byte, 0, 0x100000)\n\tfor {\n\t\tline, isPrefix, err := rdr.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf = append(buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\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, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\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}\n\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}\n\n//================\n\nfunc main() {\n\tSplitSpace()\n\tN := NextInt()\n\tW := NextInt()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tdp := make([][]int, N+1)\n\tmaxv:=0\n\tfor i := 0; i < N; i++ {\n\t\tw[i] = NextInt()\n\t\tv[i] = NextInt()\n\t\tChMax( &maxv, v[i] )\n\t}\n\tmaxv *= N\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int, maxv+1)\n\t\tfor j := 0; j < maxv+1; j++ {\n\t\t\tdp[i][j] = 1 << 29\n\t\t}\n\t}\n\tdp[0][0] = 0\n\tfor i := 0; i < N; i++ {\n\t\tfor sv := 0; sv <= maxv; sv++ {\n\t\t\tif sv-v[i] >= 0 {\n\t\t\t\tChMin(&dp[i+1][sv], dp[i][sv-v[i]]+w[i])\n\t\t\t}\n\t\t\tChMin(&dp[i+1][sv], dp[i][sv])\n\t\t}\n\t}\n\tres := 0\n\tfor i := 0; i < maxv; i++ {\n\t\tif dp[N][i] <= W {\n\t\t\tres = i\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1580317919, "filename_ext": "go", "original_language": "Go (1.6)", "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/s117376152.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117376152", "user_id": "u883150518"}, "prompt_components": {"gold_output": "90\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)\nvar rdr = bufio.NewReaderSize(os.Stdin, 0x100000)\nvar wtr = bufio.NewWriter(os.Stdout)\n\n// SplitSpace 空白で分割設定\nfunc SplitSpace() {\n\tscanner.Split(bufio.ScanWords)\n}\n\n// NextLine 標準入力から1行読み込む\nfunc NextLine() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\n// NextInt 標準入力から数値を一つ読み込む\nfunc NextInt() int {\n\tn, _ := strconv.Atoi(NextLine())\n\treturn n\n}\n\n// ReadLine 標準入力から長めの1行を読み込む\nfunc ReadLine() string {\n\tbuf := make([]byte, 0, 0x100000)\n\tfor {\n\t\tline, isPrefix, err := rdr.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf = append(buf, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\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, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc Max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\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}\n\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}\n\n//================\n\nfunc main() {\n\tSplitSpace()\n\tN := NextInt()\n\tW := NextInt()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tdp := make([][]int, N+1)\n\tmaxv:=0\n\tfor i := 0; i < N; i++ {\n\t\tw[i] = NextInt()\n\t\tv[i] = NextInt()\n\t\tChMax( &maxv, v[i] )\n\t}\n\tmaxv *= N\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int, maxv+1)\n\t\tfor j := 0; j < maxv+1; j++ {\n\t\t\tdp[i][j] = 1 << 29\n\t\t}\n\t}\n\tdp[0][0] = 0\n\tfor i := 0; i < N; i++ {\n\t\tfor sv := 0; sv <= maxv; sv++ {\n\t\t\tif sv-v[i] >= 0 {\n\t\t\t\tChMin(&dp[i+1][sv], dp[i][sv-v[i]]+w[i])\n\t\t\t}\n\t\t\tChMin(&dp[i+1][sv], dp[i][sv])\n\t\t}\n\t}\n\tres := 0\n\tfor i := 0; i < maxv; i++ {\n\t\tif dp[N][i] <= W {\n\t\t\tres = i\n\t\t}\n\t}\n\tfmt.Println(res)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1845, "cpu_time_ms": 132, "memory_kb": 82432}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s165805563", "group_id": "codeNet:p03164", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\nvar writer *bufio.Writer\n\nvar inputFile = flag.String(\"input\", \"\", \"\")\n\nfunc init() {\n\tflag.Parse()\n\tvar i io.Reader\n\tif *inputFile != \"\" {\n\t\ti, _ = os.Open(*inputFile)\n\t} else {\n\t\ti = os.Stdin\n\t}\n\treader = bufio.NewReaderSize(i, 1<<20)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<20)\n}\n\nfunc println(a ...interface{}) {\n\t_, _ = fmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\t_, _ = fmt.Fprintf(writer, format, a...)\n}\n\nfunc scanf(format string, a ...interface{}) {\n\t_, _ = fmt.Fscanf(reader, format, a...)\n}\n\nfunc scan(a interface{}) {\n\t_, _ = fmt.Fscan(reader, a)\n}\n\nfunc NextInt64() int64 {\n\tvar res int64\n\tscan(&res)\n\treturn res\n}\n\nfunc NextInt() int {\n\tvar res int\n\tscan(&res)\n\treturn res\n}\n\nfunc NextIntArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextString() string {\n\tvar res string\n\tscan(&res)\n\treturn res\n}\n\nfunc NextBigInt() *big.Int {\n\tn := new(big.Int)\n\tn, _ = n.SetString(NextString(), 10)\n\treturn n\n}\n\nfunc AbsInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc MinInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn := NextInt()\n\tW := NextInt64()\n\n\tdp := make([]int64, 100001)\n\n\tfor i := range dp {\n\t\tdp[i] = math.MaxInt64 / 2\n\t}\n\tdp[0] = 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tw := NextInt64()\n\t\tv := NextInt()\n\n\t\tfor j := 100000; j >= v; j-- {\n\t\t\tdp[j] = MinInt64(dp[j], dp[j - v] + w)\n\t\t}\n\t}\n\n\tanswer := int64(0)\n\tfor i := 0; i <= 100000; i++ {\n\t\tif dp[i] <= W {\n\t\t\tanswer = MaxInt64(answer, int64(i))\n\t\t}\n\t}\n\tprintln(answer)\n}\n", "language": "Go", "metadata": {"date": 1550034605, "filename_ext": "go", "original_language": "Go (1.6)", "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/s165805563.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s165805563", "user_id": "u159884263"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\nvar writer *bufio.Writer\n\nvar inputFile = flag.String(\"input\", \"\", \"\")\n\nfunc init() {\n\tflag.Parse()\n\tvar i io.Reader\n\tif *inputFile != \"\" {\n\t\ti, _ = os.Open(*inputFile)\n\t} else {\n\t\ti = os.Stdin\n\t}\n\treader = bufio.NewReaderSize(i, 1<<20)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<20)\n}\n\nfunc println(a ...interface{}) {\n\t_, _ = fmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\t_, _ = fmt.Fprintf(writer, format, a...)\n}\n\nfunc scanf(format string, a ...interface{}) {\n\t_, _ = fmt.Fscanf(reader, format, a...)\n}\n\nfunc scan(a interface{}) {\n\t_, _ = fmt.Fscan(reader, a)\n}\n\nfunc NextInt64() int64 {\n\tvar res int64\n\tscan(&res)\n\treturn res\n}\n\nfunc NextInt() int {\n\tvar res int\n\tscan(&res)\n\treturn res\n}\n\nfunc NextIntArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextString() string {\n\tvar res string\n\tscan(&res)\n\treturn res\n}\n\nfunc NextBigInt() *big.Int {\n\tn := new(big.Int)\n\tn, _ = n.SetString(NextString(), 10)\n\treturn n\n}\n\nfunc AbsInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc MinInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn := NextInt()\n\tW := NextInt64()\n\n\tdp := make([]int64, 100001)\n\n\tfor i := range dp {\n\t\tdp[i] = math.MaxInt64 / 2\n\t}\n\tdp[0] = 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tw := NextInt64()\n\t\tv := NextInt()\n\n\t\tfor j := 100000; j >= v; j-- {\n\t\t\tdp[j] = MinInt64(dp[j], dp[j - v] + w)\n\t\t}\n\t}\n\n\tanswer := int64(0)\n\tfor i := 0; i <= 100000; i++ {\n\t\tif dp[i] <= W {\n\t\t\tanswer = MaxInt64(answer, int64(i))\n\t\t}\n\t}\n\tprintln(answer)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1899, "cpu_time_ms": 22, "memory_kb": 2816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s664397911", "group_id": "codeNet:p03166", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\nvar writer *bufio.Writer\n\nvar inputFile = flag.String(\"input\", \"\", \"\")\n\nfunc init() {\n\tflag.Parse()\n\tvar i io.Reader\n\tif *inputFile != \"\" {\n\t\ti, _ = os.Open(*inputFile)\n\t} else {\n\t\ti = os.Stdin\n\t}\n\treader = bufio.NewReaderSize(i, 1<<20)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<20)\n}\n\nfunc println(a ...interface{}) {\n\t_, _ = fmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\t_, _ = fmt.Fprintf(writer, format, a...)\n}\n\nfunc scanf(format string, a ...interface{}) {\n\t_, _ = fmt.Fscanf(reader, format, a...)\n}\n\nfunc scan(a interface{}) {\n\t_, _ = fmt.Fscan(reader, a)\n}\n\nfunc NextInt64() int64 {\n\tvar res int64\n\tscan(&res)\n\treturn res\n}\n\nfunc NextInt() int {\n\tvar res int\n\tscan(&res)\n\treturn res\n}\n\nfunc NextIntArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextString() string {\n\tvar res string\n\tscan(&res)\n\treturn res\n}\n\nfunc NextBigInt() *big.Int {\n\tn := new(big.Int)\n\tn, _ = n.SetString(NextString(), 10)\n\treturn n\n}\n\nfunc AbsInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc MinInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn := NextInt()\n\tm := NextInt()\n\n\tg := make([][]int, n)\n\n\tfor i := 0; i < m; i++ {\n\t\tu := NextInt()\n\t\tv := NextInt()\n\n\t\tg[u] = append(g[u], v)\n\t}\n\n\tcache := make([]int, n)\n\tvar solve func(x int ) int\n\n\tsolve = func(x int ) int {\n\t\tif cache[x] != 0 {\n\t\t\treturn cache[x]\n\t\t}\n\t\tfor _, to := range g[x] {\n\t\t\tt := solve(to) + 1\n\t\t\tif t > cache[x] {\n\t\t\t\tcache[x] = t\n\t\t\t}\n\t\t}\n\t\treturn cache[x]\n\t}\n\n\tanswer := 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tt := solve(i)\n\t\tif t > answer {\n\t\t\tanswer = t\n\t\t}\n\t}\n\t\n\tprintln(answer)\n}\n", "language": "Go", "metadata": {"date": 1550035737, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/Go/s664397911.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s664397911", "user_id": "u159884263"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\nvar writer *bufio.Writer\n\nvar inputFile = flag.String(\"input\", \"\", \"\")\n\nfunc init() {\n\tflag.Parse()\n\tvar i io.Reader\n\tif *inputFile != \"\" {\n\t\ti, _ = os.Open(*inputFile)\n\t} else {\n\t\ti = os.Stdin\n\t}\n\treader = bufio.NewReaderSize(i, 1<<20)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<20)\n}\n\nfunc println(a ...interface{}) {\n\t_, _ = fmt.Fprintln(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\t_, _ = fmt.Fprintf(writer, format, a...)\n}\n\nfunc scanf(format string, a ...interface{}) {\n\t_, _ = fmt.Fscanf(reader, format, a...)\n}\n\nfunc scan(a interface{}) {\n\t_, _ = fmt.Fscan(reader, a)\n}\n\nfunc NextInt64() int64 {\n\tvar res int64\n\tscan(&res)\n\treturn res\n}\n\nfunc NextInt() int {\n\tvar res int\n\tscan(&res)\n\treturn res\n}\n\nfunc NextIntArray(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tscan(&res[i])\n\t}\n\treturn res\n}\n\nfunc NextString() string {\n\tvar res string\n\tscan(&res)\n\treturn res\n}\n\nfunc NextBigInt() *big.Int {\n\tn := new(big.Int)\n\tn, _ = n.SetString(NextString(), 10)\n\treturn n\n}\n\nfunc AbsInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc MinInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc MaxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tn := NextInt()\n\tm := NextInt()\n\n\tg := make([][]int, n)\n\n\tfor i := 0; i < m; i++ {\n\t\tu := NextInt()\n\t\tv := NextInt()\n\n\t\tg[u] = append(g[u], v)\n\t}\n\n\tcache := make([]int, n)\n\tvar solve func(x int ) int\n\n\tsolve = func(x int ) int {\n\t\tif cache[x] != 0 {\n\t\t\treturn cache[x]\n\t\t}\n\t\tfor _, to := range g[x] {\n\t\t\tt := solve(to) + 1\n\t\t\tif t > cache[x] {\n\t\t\t\tcache[x] = t\n\t\t\t}\n\t\t}\n\t\treturn cache[x]\n\t}\n\n\tanswer := 0\n\t\n\tfor i := 0; i < n; i++ {\n\t\tt := solve(i)\n\t\tif t > answer {\n\t\t\tanswer = t\n\t\t}\n\t}\n\t\n\tprintln(answer)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2056, "cpu_time_ms": 249, "memory_kb": 9856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s876261244", "group_id": "codeNet:p03169", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tN, x, y, z int\n\tdp [301][301][301]float64\n)\n\nfunc readVariables() {\n\tN = nextInt()\n\tfor i := 0; i < N; i++ {\n\t\ta := nextInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tx++\n\t\tcase 2:\n\t\t\ty++\n\t\tcase 3:\n\t\t\tz++\n\t\t}\n\t}\n}\n\nfunc solve(x, y, z int) float64 {\n\tif x == 0 && y == 0 && z == 0 {\n\t\treturn 0\n\t}\n\tif dp[x][y][z] > 0 {\n\t\treturn dp[x][y][z]\n\t}\n\tresult := 0.0\n\tS := x + y + z\n\tif x > 0 {\n\t\tresult += solve(x-1, y, z) * float64(x) / float64(S)\n\t}\n\tif y > 0 {\n\t\tresult += solve(x+1, y-1, z) * float64(y) / float64(S)\n\t}\n\tif z > 0 {\n\t\tresult += solve(x, y+1, z-1) * float64(z) / float64(S)\n\t}\n\tresult += float64(N) / float64(S)\n\tdp[x][y][z] = result\n\treturn result\n}\n\nfunc main() {\n\treadVariables()\n\tfmt.Println(solve(x, y, z))\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", "language": "Go", "metadata": {"date": 1582731774, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03169.html", "problem_id": "p03169", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03169/input.txt", "sample_output_relpath": "derived/input_output/data/p03169/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03169/Go/s876261244.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876261244", "user_id": "u390694622"}, "prompt_components": {"gold_output": "5.5\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, x, y, z int\n\tdp [301][301][301]float64\n)\n\nfunc readVariables() {\n\tN = nextInt()\n\tfor i := 0; i < N; i++ {\n\t\ta := nextInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tx++\n\t\tcase 2:\n\t\t\ty++\n\t\tcase 3:\n\t\t\tz++\n\t\t}\n\t}\n}\n\nfunc solve(x, y, z int) float64 {\n\tif x == 0 && y == 0 && z == 0 {\n\t\treturn 0\n\t}\n\tif dp[x][y][z] > 0 {\n\t\treturn dp[x][y][z]\n\t}\n\tresult := 0.0\n\tS := x + y + z\n\tif x > 0 {\n\t\tresult += solve(x-1, y, z) * float64(x) / float64(S)\n\t}\n\tif y > 0 {\n\t\tresult += solve(x+1, y-1, z) * float64(y) / float64(S)\n\t}\n\tif z > 0 {\n\t\tresult += solve(x, y+1, z-1) * float64(z) / float64(S)\n\t}\n\tresult += float64(N) / float64(S)\n\tdp[x][y][z] = result\n\treturn result\n}\n\nfunc main() {\n\treadVariables()\n\tfmt.Println(solve(x, y, z))\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", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "sample_input": "3\n1 1 1\n"}, "reference_outputs": ["5.5\n"], "source_document_id": "p03169", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3039, "cpu_time_ms": 280, "memory_kb": 211968}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063134104", "group_id": "codeNet:p03169", "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)\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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n int\nvar A []int\n\nvar dp [301][301][301]float64\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n)\n\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\tdp[i][j][k] = -1.0\n\t\t\t}\n\t\t}\n\t}\n\tdp[0][0][0] = 0.0\n\n\tone, two, three := 0, 0, 0\n\tfor _, a := range A {\n\t\tif a == 1 {\n\t\t\tone++\n\t\t} else if a == 2 {\n\t\t\ttwo++\n\t\t} else if a == 3 {\n\t\t\tthree++\n\t\t}\n\t}\n\n\tsub(one, two, three)\n\n\tfmt.Println(dp[one][two][three])\n}\n\nfunc sub(i, j, k int) float64 {\n\tif i == 0 && j == 0 && k == 0 {\n\t\treturn dp[0][0][0]\n\t}\n\n\tif dp[i][j][k] >= -0.1 {\n\t\treturn dp[i][j][k]\n\t}\n\n\tres := 0.0\n\n\tif i-1 >= 0 {\n\t\tres += sub(i-1, j, k) * float64(i)\n\t}\n\tif j-1 >= 0 {\n\t\tres += sub(i+1, j-1, k) * float64(j)\n\t}\n\tif k-1 >= 0 {\n\t\tres += sub(i, j+1, k-1) * float64(k)\n\t}\n\tres += float64(n)\n\tres *= 1.0 / (float64(i + j + k))\n\n\tdp[i][j][k] = res\n\n\treturn dp[i][j][k]\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1560060881, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03169.html", "problem_id": "p03169", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03169/input.txt", "sample_output_relpath": "derived/input_output/data/p03169/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03169/Go/s063134104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s063134104", "user_id": "u103600314"}, "prompt_components": {"gold_output": "5.5\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)\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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar n int\nvar A []int\n\nvar dp [301][301][301]float64\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n)\n\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\tdp[i][j][k] = -1.0\n\t\t\t}\n\t\t}\n\t}\n\tdp[0][0][0] = 0.0\n\n\tone, two, three := 0, 0, 0\n\tfor _, a := range A {\n\t\tif a == 1 {\n\t\t\tone++\n\t\t} else if a == 2 {\n\t\t\ttwo++\n\t\t} else if a == 3 {\n\t\t\tthree++\n\t\t}\n\t}\n\n\tsub(one, two, three)\n\n\tfmt.Println(dp[one][two][three])\n}\n\nfunc sub(i, j, k int) float64 {\n\tif i == 0 && j == 0 && k == 0 {\n\t\treturn dp[0][0][0]\n\t}\n\n\tif dp[i][j][k] >= -0.1 {\n\t\treturn dp[i][j][k]\n\t}\n\n\tres := 0.0\n\n\tif i-1 >= 0 {\n\t\tres += sub(i-1, j, k) * float64(i)\n\t}\n\tif j-1 >= 0 {\n\t\tres += sub(i+1, j-1, k) * float64(j)\n\t}\n\tif k-1 >= 0 {\n\t\tres += sub(i, j+1, k-1) * float64(k)\n\t}\n\tres += float64(n)\n\tres *= 1.0 / (float64(i + j + k))\n\n\tdp[i][j][k] = res\n\n\treturn dp[i][j][k]\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "sample_input": "3\n1 1 1\n"}, "reference_outputs": ["5.5\n"], "source_document_id": "p03169", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N dishes, numbered 1, 2, \\ldots, N.\nInitially, for each i (1 \\leq i \\leq N), Dish i has a_i (1 \\leq a_i \\leq 3) pieces of sushi on it.\n\nTaro will perform the following operation repeatedly until all the pieces of sushi are eaten:\n\nRoll a die that shows the numbers 1, 2, \\ldots, N with equal probabilities, and let i be the outcome. If there are some pieces of sushi on Dish i, eat one of them; if there is none, do nothing.\n\nFind the expected number of times the operation is performed before all the pieces of sushi are eaten.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 3\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 expected number of times the operation is performed before all the pieces of sushi are eaten.\nThe output is considered correct when the relative difference is not greater than 10^{-9}.\n\nSample Input 1\n\n3\n1 1 1\n\nSample Output 1\n\n5.5\n\nThe expected number of operations before the first piece of sushi is eaten, is 1.\nAfter that, the expected number of operations before the second sushi is eaten, is 1.5.\nAfter that, the expected number of operations before the third sushi is eaten, is 3.\nThus, the expected total number of operations is 1 + 1.5 + 3 = 5.5.\n\nSample Input 2\n\n1\n3\n\nSample Output 2\n\n3\n\nOutputs such as 3.00, 3.000000003 and 2.999999997 will also be accepted.\n\nSample Input 3\n\n2\n1 2\n\nSample Output 3\n\n4.5\n\nSample Input 4\n\n10\n1 3 2 3 3 2 3 2 1 3\n\nSample Output 4\n\n54.48064457488221", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7566, "cpu_time_ms": 292, "memory_kb": 213760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s431698197", "group_id": "codeNet:p03170", "input_text": "package main\n\nimport \"fmt\"\n\nvar a [100]int\nvar n int\n\nfunc solve(k int) int {\n\tif k < a[0] {\n\t\treturn -1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\ts := solve(k - a[i])\n\t\tif s < 0 {\n\t\t\treturn 1\n\t\t}\n\t}\n\n\treturn -1\n}\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tif solve(k) < 0 {\n\t\tfmt.Println(\"Second\")\n\t} else {\n\t\tfmt.Println(\"First\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584474916, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03170.html", "problem_id": "p03170", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03170/input.txt", "sample_output_relpath": "derived/input_output/data/p03170/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03170/Go/s431698197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s431698197", "user_id": "u371942102"}, "prompt_components": {"gold_output": "First\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar a [100]int\nvar n int\n\nfunc solve(k int) int {\n\tif k < a[0] {\n\t\treturn -1\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\ts := solve(k - a[i])\n\t\tif s < 0 {\n\t\t\treturn 1\n\t\t}\n\t}\n\n\treturn -1\n}\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tif solve(k) < 0 {\n\t\tfmt.Println(\"Second\")\n\t} else {\n\t\tfmt.Println(\"First\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a set A = \\{ a_1, a_2, \\ldots, a_N \\} consisting of N positive integers.\nTaro and Jiro will play the following game against each other.\n\nInitially, we have a pile consisting of K stones.\nThe two players perform the following operation alternately, starting from Taro:\n\nChoose an element x in A, and remove exactly x stones from the pile.\n\nA player loses when he becomes unable to play.\nAssuming that both players play optimally, determine the winner.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 10^5\n\n1 \\leq a_1 < a_2 < \\cdots < a_N \\leq K\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 \\ldots a_N\n\nOutput\n\nIf Taro will win, print First; if Jiro will win, print Second.\n\nSample Input 1\n\n2 4\n2 3\n\nSample Output 1\n\nFirst\n\nIf Taro removes three stones, Jiro cannot make a move.\nThus, Taro wins.\n\nSample Input 2\n\n2 5\n2 3\n\nSample Output 2\n\nSecond\n\nWhatever Taro does in his operation, Jiro wins, as follows:\n\nIf Taro removes two stones, Jiro can remove three stones to make Taro unable to make a move.\n\nIf Taro removes three stones, Jiro can remove two stones to make Taro unable to make a move.\n\nSample Input 3\n\n2 7\n2 3\n\nSample Output 3\n\nFirst\n\nTaro should remove two stones. Then, whatever Jiro does in his operation, Taro wins, as follows:\n\nIf Jiro removes two stones, Taro can remove three stones to make Jiro unable to make a move.\n\nIf Jiro removes three stones, Taro can remove two stones to make Jiro unable to make a move.\n\nSample Input 4\n\n3 20\n1 2 3\n\nSample Output 4\n\nSecond\n\nSample Input 5\n\n3 21\n1 2 3\n\nSample Output 5\n\nFirst\n\nSample Input 6\n\n1 100000\n1\n\nSample Output 6\n\nSecond", "sample_input": "2 4\n2 3\n"}, "reference_outputs": ["First\n"], "source_document_id": "p03170", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a set A = \\{ a_1, a_2, \\ldots, a_N \\} consisting of N positive integers.\nTaro and Jiro will play the following game against each other.\n\nInitially, we have a pile consisting of K stones.\nThe two players perform the following operation alternately, starting from Taro:\n\nChoose an element x in A, and remove exactly x stones from the pile.\n\nA player loses when he becomes unable to play.\nAssuming that both players play optimally, determine the winner.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 10^5\n\n1 \\leq a_1 < a_2 < \\cdots < a_N \\leq K\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 \\ldots a_N\n\nOutput\n\nIf Taro will win, print First; if Jiro will win, print Second.\n\nSample Input 1\n\n2 4\n2 3\n\nSample Output 1\n\nFirst\n\nIf Taro removes three stones, Jiro cannot make a move.\nThus, Taro wins.\n\nSample Input 2\n\n2 5\n2 3\n\nSample Output 2\n\nSecond\n\nWhatever Taro does in his operation, Jiro wins, as follows:\n\nIf Taro removes two stones, Jiro can remove three stones to make Taro unable to make a move.\n\nIf Taro removes three stones, Jiro can remove two stones to make Taro unable to make a move.\n\nSample Input 3\n\n2 7\n2 3\n\nSample Output 3\n\nFirst\n\nTaro should remove two stones. Then, whatever Jiro does in his operation, Taro wins, as follows:\n\nIf Jiro removes two stones, Taro can remove three stones to make Jiro unable to make a move.\n\nIf Jiro removes three stones, Taro can remove two stones to make Jiro unable to make a move.\n\nSample Input 4\n\n3 20\n1 2 3\n\nSample Output 4\n\nSecond\n\nSample Input 5\n\n3 21\n1 2 3\n\nSample Output 5\n\nFirst\n\nSample Input 6\n\n1 100000\n1\n\nSample Output 6\n\nSecond", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 2108, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837772408", "group_id": "codeNet:p03171", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar a [3000]int64\nvar result [3001][3001]int64\nvar UNKNOWN = int64(1000000000) * 3000 * 2\n\nfunc solve(left, right int) int64 {\n\tif r := result[left][right]; r != UNKNOWN {\n\t\treturn r\n\t}\n\n\t// fmt.Println(a[left : N-right])\n\n\tif left+right+1 == N {\n\t\treturn a[left]\n\t}\n\n\ta1 := a[left] - solve(left+1, right)\n\ta2 := a[N-right-1] - solve(left, right+1)\n\n\tvar result int64\n\tif a1 > a2 {\n\t\tresult = a1\n\t} else {\n\t\tresult = a2\n\t}\n\n\treturn result\n}\n\nfunc main() {\n\tfmt.Scan(&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\tresult[i][j] = UNKNOWN\n\t\t}\n\t}\n\n\tfmt.Println(solve(0, 0))\n}\n", "language": "Go", "metadata": {"date": 1584522873, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03171.html", "problem_id": "p03171", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03171/input.txt", "sample_output_relpath": "derived/input_output/data/p03171/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03171/Go/s837772408.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s837772408", "user_id": "u371942102"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar a [3000]int64\nvar result [3001][3001]int64\nvar UNKNOWN = int64(1000000000) * 3000 * 2\n\nfunc solve(left, right int) int64 {\n\tif r := result[left][right]; r != UNKNOWN {\n\t\treturn r\n\t}\n\n\t// fmt.Println(a[left : N-right])\n\n\tif left+right+1 == N {\n\t\treturn a[left]\n\t}\n\n\ta1 := a[left] - solve(left+1, right)\n\ta2 := a[N-right-1] - solve(left, right+1)\n\n\tvar result int64\n\tif a1 > a2 {\n\t\tresult = a1\n\t} else {\n\t\tresult = a2\n\t}\n\n\treturn result\n}\n\nfunc main() {\n\tfmt.Scan(&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\tresult[i][j] = UNKNOWN\n\t\t}\n\t}\n\n\tfmt.Println(solve(0, 0))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro and Jiro will play the following game against each other.\n\nInitially, they are given a sequence a = (a_1, a_2, \\ldots, a_N).\nUntil a becomes empty, the two players perform the following operation alternately, starting from Taro:\n\nRemove the element at the beginning or the end of a. The player earns x points, where x is the removed element.\n\nLet X and Y be Taro's and Jiro's total score at the end of the game, respectively.\nTaro tries to maximize X - Y, while Jiro tries to minimize X - Y.\n\nAssuming that the two players play optimally, find the resulting value of X - Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3000\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 resulting value of X - Y, assuming that the two players play optimally.\n\nSample Input 1\n\n4\n10 80 90 30\n\nSample Output 1\n\n10\n\nThe game proceeds as follows when the two players play optimally (the element being removed is written bold):\n\nTaro: (10, 80, 90, 30) → (10, 80, 90)\n\nJiro: (10, 80, 90) → (10, 80)\n\nTaro: (10, 80) → (10)\n\nJiro: (10) → ()\n\nHere, X = 30 + 80 = 110 and Y = 90 + 10 = 100.\n\nSample Input 2\n\n3\n10 100 10\n\nSample Output 2\n\n-80\n\nThe game proceeds, for example, as follows when the two players play optimally:\n\nTaro: (10, 100, 10) → (100, 10)\n\nJiro: (100, 10) → (10)\n\nTaro: (10) → ()\n\nHere, X = 10 + 10 = 20 and Y = 100.\n\nSample Input 3\n\n1\n10\n\nSample Output 3\n\n10\n\nSample Input 4\n\n10\n1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1\n\nSample Output 4\n\n4999999995\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 5\n\n6\n4 2 9 7 1 5\n\nSample Output 5\n\n2\n\nThe game proceeds, for example, as follows when the two players play optimally:\n\nTaro: (4, 2, 9, 7, 1, 5) → (4, 2, 9, 7, 1)\n\nJiro: (4, 2, 9, 7, 1) → (2, 9, 7, 1)\n\nTaro: (2, 9, 7, 1) → (2, 9, 7)\n\nJiro: (2, 9, 7) → (2, 9)\n\nTaro: (2, 9) → (2)\n\nJiro: (2) → ()\n\nHere, X = 5 + 1 + 9 = 15 and Y = 4 + 7 + 2 = 13.", "sample_input": "4\n10 80 90 30\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03171", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro and Jiro will play the following game against each other.\n\nInitially, they are given a sequence a = (a_1, a_2, \\ldots, a_N).\nUntil a becomes empty, the two players perform the following operation alternately, starting from Taro:\n\nRemove the element at the beginning or the end of a. The player earns x points, where x is the removed element.\n\nLet X and Y be Taro's and Jiro's total score at the end of the game, respectively.\nTaro tries to maximize X - Y, while Jiro tries to minimize X - Y.\n\nAssuming that the two players play optimally, find the resulting value of X - Y.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3000\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 resulting value of X - Y, assuming that the two players play optimally.\n\nSample Input 1\n\n4\n10 80 90 30\n\nSample Output 1\n\n10\n\nThe game proceeds as follows when the two players play optimally (the element being removed is written bold):\n\nTaro: (10, 80, 90, 30) → (10, 80, 90)\n\nJiro: (10, 80, 90) → (10, 80)\n\nTaro: (10, 80) → (10)\n\nJiro: (10) → ()\n\nHere, X = 30 + 80 = 110 and Y = 90 + 10 = 100.\n\nSample Input 2\n\n3\n10 100 10\n\nSample Output 2\n\n-80\n\nThe game proceeds, for example, as follows when the two players play optimally:\n\nTaro: (10, 100, 10) → (100, 10)\n\nJiro: (100, 10) → (10)\n\nTaro: (10) → ()\n\nHere, X = 10 + 10 = 20 and Y = 100.\n\nSample Input 3\n\n1\n10\n\nSample Output 3\n\n10\n\nSample Input 4\n\n10\n1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1\n\nSample Output 4\n\n4999999995\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 5\n\n6\n4 2 9 7 1 5\n\nSample Output 5\n\n2\n\nThe game proceeds, for example, as follows when the two players play optimally:\n\nTaro: (4, 2, 9, 7, 1, 5) → (4, 2, 9, 7, 1)\n\nJiro: (4, 2, 9, 7, 1) → (2, 9, 7, 1)\n\nTaro: (2, 9, 7, 1) → (2, 9, 7)\n\nJiro: (2, 9, 7) → (2, 9)\n\nTaro: (2, 9) → (2)\n\nJiro: (2) → ()\n\nHere, X = 5 + 1 + 9 = 15 and Y = 4 + 7 + 2 = 13.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 678, "cpu_time_ms": 2107, "memory_kb": 71296}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s685816470", "group_id": "codeNet:p03172", "input_text": "package main\n\nimport \"fmt\"\n\nvar CYCLE = 1000000007\nvar N, K int\nvar a [100]int\nvar results [100][100001]int\n\nfunc max(a int, 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\tfmt.Scan(&N, &K)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor j := 0; j <= a[N-1] && j <= K; j++ {\n\t\tresults[N-1][j] = 1\n\t}\n\n\tfor i := N - 2; i >= 0; i-- {\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tr := results[i+1][j]\n\t\t\tif j > 0 {\n\t\t\t\tr += results[i][j-1]\n\t\t\t}\n\t\t\tif j-1-a[i] >= 0 {\n\t\t\t\tr -= results[i+1][j-1-a[i]]\n\t\t\t}\n\t\t\tresults[i][j] = r % CYCLE\n\t\t}\n\t}\n\n\tfmt.Println(results[0][K])\n\n\t// for i := 0; i < N; i++ {\n\t// \tfmt.Println(results[i][:K+1])\n\t// }\n}\n", "language": "Go", "metadata": {"date": 1584481758, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03172.html", "problem_id": "p03172", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03172/input.txt", "sample_output_relpath": "derived/input_output/data/p03172/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03172/Go/s685816470.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s685816470", "user_id": "u371942102"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar CYCLE = 1000000007\nvar N, K int\nvar a [100]int\nvar results [100][100001]int\n\nfunc max(a int, 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\tfmt.Scan(&N, &K)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor j := 0; j <= a[N-1] && j <= K; j++ {\n\t\tresults[N-1][j] = 1\n\t}\n\n\tfor i := N - 2; i >= 0; i-- {\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tr := results[i+1][j]\n\t\t\tif j > 0 {\n\t\t\t\tr += results[i][j-1]\n\t\t\t}\n\t\t\tif j-1-a[i] >= 0 {\n\t\t\t\tr -= results[i+1][j-1-a[i]]\n\t\t\t}\n\t\t\tresults[i][j] = r % CYCLE\n\t\t}\n\t}\n\n\tfmt.Println(results[0][K])\n\n\t// for i := 0; i < N; i++ {\n\t// \tfmt.Println(results[i][:K+1])\n\t// }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, \\ldots, N.\n\nThey have decided to share K candies among themselves.\nHere, for each i (1 \\leq i \\leq N), Child i must receive between 0 and a_i candies (inclusive).\nAlso, no candies should be left over.\n\nFind the number of ways for them to share candies, modulo 10^9 + 7.\nHere, two ways are said to be different when there exists a child who receives a different number of candies.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq K \\leq 10^5\n\n0 \\leq a_i \\leq K\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the number of ways for the children to share candies, modulo 10^9 + 7.\n\nSample Input 1\n\n3 4\n1 2 3\n\nSample Output 1\n\n5\n\nThere are five ways for the children to share candies, as follows:\n\n(0, 1, 3)\n\n(0, 2, 2)\n\n(1, 0, 3)\n\n(1, 1, 2)\n\n(1, 2, 1)\n\nHere, in each sequence, the i-th element represents the number of candies that Child i receives.\n\nSample Input 2\n\n1 10\n9\n\nSample Output 2\n\n0\n\nThere may be no ways for the children to share candies.\n\nSample Input 3\n\n2 0\n0 0\n\nSample Output 3\n\n1\n\nThere is one way for the children to share candies, as follows:\n\n(0, 0)\n\nSample Input 4\n\n4 100000\n100000 100000 100000 100000\n\nSample Output 4\n\n665683269\n\nBe sure to print the answer modulo 10^9 + 7.", "sample_input": "3 4\n1 2 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03172", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, \\ldots, N.\n\nThey have decided to share K candies among themselves.\nHere, for each i (1 \\leq i \\leq N), Child i must receive between 0 and a_i candies (inclusive).\nAlso, no candies should be left over.\n\nFind the number of ways for them to share candies, modulo 10^9 + 7.\nHere, two ways are said to be different when there exists a child who receives a different number of candies.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq K \\leq 10^5\n\n0 \\leq a_i \\leq K\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 \\ldots a_N\n\nOutput\n\nPrint the number of ways for the children to share candies, modulo 10^9 + 7.\n\nSample Input 1\n\n3 4\n1 2 3\n\nSample Output 1\n\n5\n\nThere are five ways for the children to share candies, as follows:\n\n(0, 1, 3)\n\n(0, 2, 2)\n\n(1, 0, 3)\n\n(1, 1, 2)\n\n(1, 2, 1)\n\nHere, in each sequence, the i-th element represents the number of candies that Child i receives.\n\nSample Input 2\n\n1 10\n9\n\nSample Output 2\n\n0\n\nThere may be no ways for the children to share candies.\n\nSample Input 3\n\n2 0\n0 0\n\nSample Output 3\n\n1\n\nThere is one way for the children to share candies, as follows:\n\n(0, 0)\n\nSample Input 4\n\n4 100000\n100000 100000 100000 100000\n\nSample Output 4\n\n665683269\n\nBe sure to print the answer modulo 10^9 + 7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 660, "cpu_time_ms": 179, "memory_kb": 78592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s737096891", "group_id": "codeNet:p03174", "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 bitCount(bits int) int {\n\n\tbits = (bits & 0x55555555) + (bits >> 1 & 0x55555555)\n\tbits = (bits & 0x33333333) + (bits >> 2 & 0x33333333)\n\tbits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f)\n\tbits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff)\n\treturn (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff)\n}\n\nconst mod = 1000000007\n\nfunc rec(N int, a [22][22]int) int {\n\tvar dp [22][1 << 22]int\n\tdp[0][0] = 1\n\tfor i := 0; i < N; i++ {\n\t\tfor bit := 0; bit < 1<> 1 & 0x55555555)\n\tbits = (bits & 0x33333333) + (bits >> 2 & 0x33333333)\n\tbits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f)\n\tbits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff)\n\treturn (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff)\n}\n\nconst mod = 1000000007\n\nfunc rec(N int, a [22][22]int) int {\n\tvar dp [22][1 << 22]int\n\tdp[0][0] = 1\n\tfor i := 0; i < N; i++ {\n\t\tfor bit := 0; bit < 1<= 0 {\n\t\treturn T[i][prefix]\n\t}\n\tmaxD := 9\n\tif isEqual {\n\t\tmaxD = d[i]\n\t}\n\tvar sum int64\n\tfor digit := 0; digit <= maxD; digit++ {\n \tsum += int64(solve(i+1, (prefix+digit) % D, isEqual && digit == maxD))\n\t}\n\tsum %= MOD\n\tif !isEqual {\n \tT[i][prefix] = int(sum)\n\t}\n \treturn int(sum)\n}\n \nfunc main() {\n\tvar K string\n\tfmt.Scanln(&K)\n\tfmt.Scanln(&D)\n\tn = len(K)\n\tfor i := 0; i < n; i++ {\n \td[i] = int(K[i] - '0')\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < D; j++ {\n\t\t\tT[i][j] = -1\n\t\t}\n\t}\n\t\n fmt.Println((solve(0, 0, true) - 1 + MOD) % MOD) // minus 1 for 0\n}", "language": "Go", "metadata": {"date": 1598397436, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03178.html", "problem_id": "p03178", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03178/input.txt", "sample_output_relpath": "derived/input_output/data/p03178/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03178/Go/s258805630.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s258805630", "user_id": "u028014484"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\nimport \"fmt\"\n \n/*\ni 的遍历顺序从最高位到最低位\nT(i, prefix_remainder, isEqual) 表示第 i 位、\n更高位的数字和 mod D 为 prefix_remainder、\n状态为 isEqual(true 表示前缀与 K 的相应前缀相等,false < K 的相应前缀) 的方案数\n则 T(hi, 0, true) 为最终答案,其中 hi = K 的最高位对应的 i,\n比如:98765,则最高位 i = 5\n \n状态转移:\nT(i, prefix_remainder, isEqual) = \nSum{ \n\tT(i-1, prefix_remainder + d_i, isEqual && d_i == d[i])\n\t0 <= d_i <= 9 if !isEqual = false or d[i] if isEqual\n}\n其中,d_i 表示在 i 位上的数字选择,d[i] 表示 K 在 i 位上的数字\n \n边界条件:\nT(0, any, any) = 1,遍历到 0 意味着个位数字都已经确定完了\n \n下面的具体实现与上述推导不符\n*/\n \nconst MAXL = 1e5+5\nconst MAXD = 105\nconst MOD = 1e9+7\n \nvar n int\nvar D int\nvar d [MAXL]int\nvar T [MAXL][MAXD]int\n \nfunc solve(i int, prefix int, isEqual bool) int {\n\tif i == n {\n \tif prefix == 0 {\n \treturn 1\n \t} else {\n \treturn 0\n \t}\n\t}\n\tif !isEqual && T[i][prefix] >= 0 {\n\t\treturn T[i][prefix]\n\t}\n\tmaxD := 9\n\tif isEqual {\n\t\tmaxD = d[i]\n\t}\n\tvar sum int64\n\tfor digit := 0; digit <= maxD; digit++ {\n \tsum += int64(solve(i+1, (prefix+digit) % D, isEqual && digit == maxD))\n\t}\n\tsum %= MOD\n\tif !isEqual {\n \tT[i][prefix] = int(sum)\n\t}\n \treturn int(sum)\n}\n \nfunc main() {\n\tvar K string\n\tfmt.Scanln(&K)\n\tfmt.Scanln(&D)\n\tn = len(K)\n\tfor i := 0; i < n; i++ {\n \td[i] = int(K[i] - '0')\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < D; j++ {\n\t\t\tT[i][j] = -1\n\t\t}\n\t}\n\t\n fmt.Println((solve(0, 0, true) - 1 + MOD) % MOD) // minus 1 for 0\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nFind the number of integers between 1 and K (inclusive) satisfying the following condition, modulo 10^9 + 7:\n\nThe sum of the digits in base ten is a multiple of D.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K < 10^{10000}\n\n1 \\leq D \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nD\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n30\n4\n\nSample Output 1\n\n6\n\nThose six integers are: 4, 8, 13, 17, 22 and 26.\n\nSample Input 2\n\n1000000009\n1\n\nSample Output 2\n\n2\n\nBe sure to print the number modulo 10^9 + 7.\n\nSample Input 3\n\n98765432109876543210\n58\n\nSample Output 3\n\n635270834", "sample_input": "30\n4\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03178", "source_text": "Score : 100 points\n\nProblem Statement\n\nFind the number of integers between 1 and K (inclusive) satisfying the following condition, modulo 10^9 + 7:\n\nThe sum of the digits in base ten is a multiple of D.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K < 10^{10000}\n\n1 \\leq D \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nD\n\nOutput\n\nPrint the number of integers satisfying the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n30\n4\n\nSample Output 1\n\n6\n\nThose six integers are: 4, 8, 13, 17, 22 and 26.\n\nSample Input 2\n\n1000000009\n1\n\nSample Output 2\n\n2\n\nBe sure to print the number modulo 10^9 + 7.\n\nSample Input 3\n\n98765432109876543210\n58\n\nSample Output 3\n\n635270834", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1667, "cpu_time_ms": 181, "memory_kb": 12004}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s878100896", "group_id": "codeNet:p03186", "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\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\treply string\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a+b >= c {\n\t\tfmt.Println(b + c)\n\t\treturn\n\t}\n\tfmt.Println(a + 2*b + 1)\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 nextSlice() []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 scanSlice2(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 scanFloatSlice2(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\n// ---------------------------------------------------\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}\n\n// ---------------------------------------------------\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\treply = \"Yes\"\n\t\tfmt.Println(reply)\n\t\treturn\n\t}\n\treply = \"No\"\n\tfmt.Println(reply)\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\treply = \"YES\"\n\t\tfmt.Println(reply)\n\t\treturn\n\t}\n\treply = \"NO\"\n\tfmt.Println(reply)\n}", "language": "Go", "metadata": {"date": 1580942493, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03186.html", "problem_id": "p03186", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03186/input.txt", "sample_output_relpath": "derived/input_output/data/p03186/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03186/Go/s878100896.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s878100896", "user_id": "u963686413"}, "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\t\"strings\"\n)\n\nvar (\n\trdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\treply string\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a+b >= c {\n\t\tfmt.Println(b + c)\n\t\treturn\n\t}\n\tfmt.Println(a + 2*b + 1)\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 nextSlice() []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 scanSlice2(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 scanFloatSlice2(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\n// ---------------------------------------------------\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}\n\n// ---------------------------------------------------\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\treply = \"Yes\"\n\t\tfmt.Println(reply)\n\t\treturn\n\t}\n\treply = \"No\"\n\tfmt.Println(reply)\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\treply = \"YES\"\n\t\tfmt.Println(reply)\n\t\treturn\n\t}\n\treply = \"NO\"\n\tfmt.Println(reply)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "sample_input": "3 1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03186", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1930, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901237831", "group_id": "codeNet:p03187", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar in = bufio.NewReader(os.Stdin)\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\t_ = stdin.Scan()\n\tline, _ := strconv.Atoi(stdin.Text())\n\treturn line\n}\nfunc nextInts(num int) []int {\n\tvar a = make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\ta[i] = nextInt()\n\t\t//a = append(a, temp)\n\t}\n\tsort.Ints(a)\n\treturn a\n}\nfunc solve(l, n int, a []int) int {\n\tcount := 0\n\tvar temp int\n\tfor i := 0; i < len(a); i++ {\n\t\tif (a[i] - temp) > (a[n-1]-l-temp)*(-1) {\n\t\t\tcount += a[i] - temp\n\t\t\ttemp = a[i]\n\t\t} else if (a[i] - temp) < (a[n-1]-l-temp)*(-1) {\n\t\t\tcount += (-1) * (a[n-1] - l - temp)\n\t\t\ttemp = a[n-1] - l\n\t\t} else {\n\t\t\tif a[i+1]-temp > (a[n-2]-l-temp)*(-1) {\n\t\t\t\tcount += a[i] - temp + a[i+1] - temp\n\t\t\t\ttemp = a[i+1] - temp\n\t\t\t\ti++\n\t\t\t} else if a[i+1]-temp < (a[n-2]-l-temp)*(-1) {\n\t\t\t\t{\n\t\t\t\t\tcount += a[i] - temp + (a[n-2]-l-temp)*(-1)\n\t\t\t\t\ttemp = a[n-2] - l\n\t\t\t\t\ti++\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tfmt.Println(i, temp)\n\t}\n\treturn count\n}\nfunc main() {\n\tvar l, n int\n\tfmt.Fscanf(in, \"%d %d¥n\", &l, &n)\n\n\tx := nextInts(n)\n\tfmt.Println(x)\n\n\tans := solve(l, n, x)\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1546141472, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03187.html", "problem_id": "p03187", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03187/input.txt", "sample_output_relpath": "derived/input_output/data/p03187/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03187/Go/s901237831.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s901237831", "user_id": "u370270364"}, "prompt_components": {"gold_output": "15\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 in = bufio.NewReader(os.Stdin)\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\t_ = stdin.Scan()\n\tline, _ := strconv.Atoi(stdin.Text())\n\treturn line\n}\nfunc nextInts(num int) []int {\n\tvar a = make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\ta[i] = nextInt()\n\t\t//a = append(a, temp)\n\t}\n\tsort.Ints(a)\n\treturn a\n}\nfunc solve(l, n int, a []int) int {\n\tcount := 0\n\tvar temp int\n\tfor i := 0; i < len(a); i++ {\n\t\tif (a[i] - temp) > (a[n-1]-l-temp)*(-1) {\n\t\t\tcount += a[i] - temp\n\t\t\ttemp = a[i]\n\t\t} else if (a[i] - temp) < (a[n-1]-l-temp)*(-1) {\n\t\t\tcount += (-1) * (a[n-1] - l - temp)\n\t\t\ttemp = a[n-1] - l\n\t\t} else {\n\t\t\tif a[i+1]-temp > (a[n-2]-l-temp)*(-1) {\n\t\t\t\tcount += a[i] - temp + a[i+1] - temp\n\t\t\t\ttemp = a[i+1] - temp\n\t\t\t\ti++\n\t\t\t} else if a[i+1]-temp < (a[n-2]-l-temp)*(-1) {\n\t\t\t\t{\n\t\t\t\t\tcount += a[i] - temp + (a[n-2]-l-temp)*(-1)\n\t\t\t\t\ttemp = a[n-2] - l\n\t\t\t\t\ti++\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tfmt.Println(i, temp)\n\t}\n\treturn count\n}\nfunc main() {\n\tvar l, n int\n\tfmt.Fscanf(in, \"%d %d¥n\", &l, &n)\n\n\tx := nextInts(n)\n\tfmt.Println(x)\n\n\tans := solve(l, n, x)\n\tfmt.Println(ans)\n\n}\n", "problem_context": "Score : 800 points\n\nProblem Statement\n\nTakahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi.\nEach point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise.\n\nThere are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence.\n\nStarting at his residence, Takahashi will repeat the following action:\n\nIf all trees are burnt, terminate the process.\n\nSpecify a direction: clockwise or counter-clockwise.\n\nWalk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time.\n\nWhen the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step.\n\nFind the longest possible total distance Takahashi walks during the process.\n\nPartial Score\n\nA partial score can be obtained in this problem:\n\n300 points will be awarded for passing the input satisfying N \\leq 2000.\n\nConstraints\n\n2 \\leq L \\leq 10^9\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq X_1 < ... < X_N \\leq L-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL N\nX_1\n:\nX_N\n\nOutput\n\nPrint the longest possible total distance Takahashi walks during the process.\n\nSample Input 1\n\n10 3\n2\n7\n9\n\nSample Output 1\n\n15\n\nTakahashi walks the distance of 15 if the process goes as follows:\n\nWalk a distance of 2 counter-clockwise, burn the tree at the coordinate 2 and stay there.\n\nWalk a distance of 5 counter-clockwise, burn the tree at the coordinate 7 and stay there.\n\nWalk a distance of 8 clockwise, burn the tree at the coordinate 9 and stay there.\n\nSample Input 2\n\n10 6\n1\n2\n3\n6\n7\n9\n\nSample Output 2\n\n27\n\nSample Input 3\n\n314159265 7\n21662711\n77271666\n89022761\n156626166\n160332356\n166902656\n298992265\n\nSample Output 3\n\n1204124749", "sample_input": "10 3\n2\n7\n9\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03187", "source_text": "Score : 800 points\n\nProblem Statement\n\nTakahashi Lake has a perimeter of L. On the circumference of the lake, there is a residence of the lake's owner, Takahashi.\nEach point on the circumference of the lake has a coordinate between 0 and L (including 0 but not L), which is the distance from the Takahashi's residence, measured counter-clockwise.\n\nThere are N trees around the lake; the coordinate of the i-th tree is X_i. There is no tree at coordinate 0, the location of Takahashi's residence.\n\nStarting at his residence, Takahashi will repeat the following action:\n\nIf all trees are burnt, terminate the process.\n\nSpecify a direction: clockwise or counter-clockwise.\n\nWalk around the lake in the specified direction, until the coordinate of a tree that is not yet burnt is reached for the first time.\n\nWhen the coordinate with the tree is reached, burn that tree, stay at the position and go back to the first step.\n\nFind the longest possible total distance Takahashi walks during the process.\n\nPartial Score\n\nA partial score can be obtained in this problem:\n\n300 points will be awarded for passing the input satisfying N \\leq 2000.\n\nConstraints\n\n2 \\leq L \\leq 10^9\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq X_1 < ... < X_N \\leq L-1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL N\nX_1\n:\nX_N\n\nOutput\n\nPrint the longest possible total distance Takahashi walks during the process.\n\nSample Input 1\n\n10 3\n2\n7\n9\n\nSample Output 1\n\n15\n\nTakahashi walks the distance of 15 if the process goes as follows:\n\nWalk a distance of 2 counter-clockwise, burn the tree at the coordinate 2 and stay there.\n\nWalk a distance of 5 counter-clockwise, burn the tree at the coordinate 7 and stay there.\n\nWalk a distance of 8 clockwise, burn the tree at the coordinate 9 and stay there.\n\nSample Input 2\n\n10 6\n1\n2\n3\n6\n7\n9\n\nSample Output 2\n\n27\n\nSample Input 3\n\n314159265 7\n21662711\n77271666\n89022761\n156626166\n160332356\n166902656\n298992265\n\nSample Output 3\n\n1204124749", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1146, "cpu_time_ms": 547, "memory_kb": 15488}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s094727736", "group_id": "codeNet:p03192", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\txm := make(map[rune]int)\n\tfor _, r := range n {\n\t\txm[r]++\n\t}\n\tfmt.Println(xm['2'])\n}\n", "language": "Go", "metadata": {"date": 1590151364, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03192.html", "problem_id": "p03192", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03192/input.txt", "sample_output_relpath": "derived/input_output/data/p03192/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03192/Go/s094727736.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s094727736", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\txm := make(map[rune]int)\n\tfor _, r := range n {\n\t\txm[r]++\n\t}\n\tfmt.Println(xm['2'])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N that has exactly four digits in base ten.\nHow many times does 2 occur in the base-ten representation of N?\n\nConstraints\n\n1000 \\leq N \\leq 9999\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\n1222\n\nSample Output 1\n\n3\n\n2 occurs three times in 1222. By the way, this contest is held on December 22 (JST).\n\nSample Input 2\n\n3456\n\nSample Output 2\n\n0\n\nSample Input 3\n\n9592\n\nSample Output 3\n\n1", "sample_input": "1222\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03192", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer N that has exactly four digits in base ten.\nHow many times does 2 occur in the base-ten representation of N?\n\nConstraints\n\n1000 \\leq N \\leq 9999\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\n1222\n\nSample Output 1\n\n3\n\n2 occurs three times in 1222. By the way, this contest is held on December 22 (JST).\n\nSample Input 2\n\n3456\n\nSample Output 2\n\n0\n\nSample Input 3\n\n9592\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s498264344", "group_id": "codeNet:p03193", "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, H, W := readInt(), readInt(), readInt()\n\tA := make([]int64, N)\n\tB := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i], B[i] = readInt(), readInt()\n\t}\n\tvar ans int64\n\tfor i := int64(0); i < N; i++ {\n\t\tans += min(A[i]/H, B[i]/W)\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": 1594777038, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03193.html", "problem_id": "p03193", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03193/input.txt", "sample_output_relpath": "derived/input_output/data/p03193/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03193/Go/s498264344.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s498264344", "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, H, W := readInt(), readInt(), readInt()\n\tA := make([]int64, N)\n\tB := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i], B[i] = readInt(), readInt()\n\t}\n\tvar ans int64\n\tfor i := int64(0); i < N; i++ {\n\t\tans += min(A[i]/H, B[i]/W)\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\nThere are N rectangular plate materials made of special metal called AtCoder Alloy.\nThe dimensions of the i-th material are A_i \\times B_i (A_i vertically and B_i horizontally).\n\nTakahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are exactly H \\times W.\nHe is trying to obtain such a plate by choosing one of the N materials and cutting it if necessary.\nWhen cutting a material, the cuts must be parallel to one of the sides of the material.\nAlso, the materials have fixed directions and cannot be rotated.\nFor example, a 5 \\times 3 material cannot be used as a 3 \\times 5 plate.\n\nOut of the N materials, how many can produce an H \\times W plate if properly cut?\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq H \\leq 10^9\n\n1 \\leq W \\leq 10^9\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 H W\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 5 2\n10 3\n5 2\n2 5\n\nSample Output 1\n\n2\n\nTakahashi wants a 5 \\times 2 plate.\n\nThe dimensions of the first material are 10 \\times 3. We can obtain a 5 \\times 2 plate by properly cutting it.\n\nThe dimensions of the second material are 5 \\times 2. We can obtain a 5 \\times 2 plate without cutting it.\n\nThe dimensions of the third material are 2 \\times 5. We cannot obtain a 5 \\times 2 plate, whatever cuts are made. Note that the material cannot be rotated and used as a 5 \\times 2 plate.\n\nSample Input 2\n\n10 587586158 185430194\n894597290 708587790\n680395892 306946994\n590262034 785368612\n922328576 106880540\n847058850 326169610\n936315062 193149191\n702035777 223363392\n11672949 146832978\n779291680 334178158\n615808191 701464268\n\nSample Output 2\n\n8", "sample_input": "3 5 2\n10 3\n5 2\n2 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03193", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N rectangular plate materials made of special metal called AtCoder Alloy.\nThe dimensions of the i-th material are A_i \\times B_i (A_i vertically and B_i horizontally).\n\nTakahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are exactly H \\times W.\nHe is trying to obtain such a plate by choosing one of the N materials and cutting it if necessary.\nWhen cutting a material, the cuts must be parallel to one of the sides of the material.\nAlso, the materials have fixed directions and cannot be rotated.\nFor example, a 5 \\times 3 material cannot be used as a 3 \\times 5 plate.\n\nOut of the N materials, how many can produce an H \\times W plate if properly cut?\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n1 \\leq H \\leq 10^9\n\n1 \\leq W \\leq 10^9\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 H W\nA_1 B_1\nA_2 B_2\n:\nA_N B_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 5 2\n10 3\n5 2\n2 5\n\nSample Output 1\n\n2\n\nTakahashi wants a 5 \\times 2 plate.\n\nThe dimensions of the first material are 10 \\times 3. We can obtain a 5 \\times 2 plate by properly cutting it.\n\nThe dimensions of the second material are 5 \\times 2. We can obtain a 5 \\times 2 plate without cutting it.\n\nThe dimensions of the third material are 2 \\times 5. We cannot obtain a 5 \\times 2 plate, whatever cuts are made. Note that the material cannot be rotated and used as a 5 \\times 2 plate.\n\nSample Input 2\n\n10 587586158 185430194\n894597290 708587790\n680395892 306946994\n590262034 785368612\n922328576 106880540\n847058850 326169610\n936315062 193149191\n702035777 223363392\n11672949 146832978\n779291680 334178158\n615808191 701464268\n\nSample Output 2\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5823, "cpu_time_ms": 7, "memory_kb": 1824}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s137998846", "group_id": "codeNet:p03194", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\ntype Entry struct {\n\tprime int64\n\tcount int64\n}\n\ntype Entries []Entry\n\nfunc (es Entries) Len() int {\n\treturn len(es)\n}\n\nfunc (es Entries) Less(i, j int) bool {\n\treturn es[i].count > es[j].count\n}\n\nfunc (es Entries) Swap(i, j int) {\n\tes[i], es[j] = es[j], es[i]\n}\n\nfunc main() {\n\tvar n, p int64\n\tfmt.Scanf(\"%d %d\\n\", &n, &p)\n\n\tprimeLimit := int64(math.Sqrt(float64(p)))\n\tallPrimes := listPrimes(primeLimit)\n\tentries := countPrimes(p, allPrimes)\n\n\tsort.Sort(Entries(entries))\n\n\tfactor := int64(1)\n\tfor _, e := range entries {\n\t\tif e.count >= n {\n\t\t\tv := e.prime * (e.count / n)\n\t\t\tfactor *= v\n\t\t}\n\t}\n\n\tfmt.Println(factor)\n}\n\nfunc countPrimes(n int64, allPrimes []int64) []Entry {\n\tes := []Entry{}\n\n\tfor _, p := range allPrimes {\n\t\tif p*p > n {\n\t\t\tbreak\n\t\t}\n\t\tcnt := int64(0)\n\t\tfor n%p == 0 {\n\t\t\tcnt += 1\n\t\t\tn /= p\n\t\t}\n\t\tif cnt > 0 {\n\t\t\tes = append(es, Entry{p, cnt})\n\t\t}\n\t}\n\tif n > 1 {\n\t\tes = append(es, Entry{n, 1})\n\t}\n\n\treturn es\n}\n\nfunc listPrimes(limit int64) []int64 {\n\tns := make([]int64, limit-1)\n\tfor i := int64(2); i <= limit; i++ {\n\t\tns[i-2] = i\n\t}\n\n\tdivided := make([]bool, limit+1)\n\n\tps := make([]int64, 0)\n\tfor _, n := range ns {\n\t\tif divided[n] {\n\t\t\tcontinue\n\t\t}\n\t\tps = append(ps, n)\n\t\tfor i := n; i < int64(len(divided)); i += n {\n\t\t\tdivided[i] = true\n\t\t}\n\t}\n\n\treturn ps\n}\n", "language": "Go", "metadata": {"date": 1545535689, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03194.html", "problem_id": "p03194", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03194/input.txt", "sample_output_relpath": "derived/input_output/data/p03194/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03194/Go/s137998846.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s137998846", "user_id": "u307252896"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\ntype Entry struct {\n\tprime int64\n\tcount int64\n}\n\ntype Entries []Entry\n\nfunc (es Entries) Len() int {\n\treturn len(es)\n}\n\nfunc (es Entries) Less(i, j int) bool {\n\treturn es[i].count > es[j].count\n}\n\nfunc (es Entries) Swap(i, j int) {\n\tes[i], es[j] = es[j], es[i]\n}\n\nfunc main() {\n\tvar n, p int64\n\tfmt.Scanf(\"%d %d\\n\", &n, &p)\n\n\tprimeLimit := int64(math.Sqrt(float64(p)))\n\tallPrimes := listPrimes(primeLimit)\n\tentries := countPrimes(p, allPrimes)\n\n\tsort.Sort(Entries(entries))\n\n\tfactor := int64(1)\n\tfor _, e := range entries {\n\t\tif e.count >= n {\n\t\t\tv := e.prime * (e.count / n)\n\t\t\tfactor *= v\n\t\t}\n\t}\n\n\tfmt.Println(factor)\n}\n\nfunc countPrimes(n int64, allPrimes []int64) []Entry {\n\tes := []Entry{}\n\n\tfor _, p := range allPrimes {\n\t\tif p*p > n {\n\t\t\tbreak\n\t\t}\n\t\tcnt := int64(0)\n\t\tfor n%p == 0 {\n\t\t\tcnt += 1\n\t\t\tn /= p\n\t\t}\n\t\tif cnt > 0 {\n\t\t\tes = append(es, Entry{p, cnt})\n\t\t}\n\t}\n\tif n > 1 {\n\t\tes = append(es, Entry{n, 1})\n\t}\n\n\treturn es\n}\n\nfunc listPrimes(limit int64) []int64 {\n\tns := make([]int64, limit-1)\n\tfor i := int64(2); i <= limit; i++ {\n\t\tns[i-2] = i\n\t}\n\n\tdivided := make([]bool, limit+1)\n\n\tps := make([]int64, 0)\n\tfor _, n := range ns {\n\t\tif divided[n] {\n\t\t\tcontinue\n\t\t}\n\t\tps = append(ps, n)\n\t\tfor i := n; i < int64(len(divided)); i += n {\n\t\t\tdivided[i] = true\n\t\t}\n\t}\n\n\treturn ps\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "sample_input": "3 24\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03194", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 27, "memory_kb": 13312}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s224236055", "group_id": "codeNet:p03194", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar memo map[int][]int\n\nfunc main() {\n\tmemo = make(map[int][]int)\n\n\tvar n int\n\tfmt.Scan(&n)\n\tvar p int\n\tfmt.Scan(&p)\n\n\tmp := make(map[int]int)\n\tfor _, a := range fact(p) {\n\t\tmp[a] = mp[a] + 1\n\t}\n\n\tdirect := 1\n\tfor k, v := range mp {\n\t\tif v >= n {\n\t\t\tdirect = direct * k\n\t\t}\n\t}\n\tfmt.Println(direct)\n\n}\n\nfunc fact(n int) []int {\n\t_, exist := memo[n]\n\tif exist {\n\t\treturn memo[n]\n\t}\n\n\tret := make([]int, 0)\n\tflag := false\n\tfor i := 2; i <= int(math.Floor(float64(n)/2)); i++ {\n\t\tif (n % i) == 0 {\n\t\t\tret = append(ret, i)\n\t\t\tret = append(ret, fact(n/i)...)\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\tret = append(ret, n)\n\t}\n\treturn ret\n}\n\n/*\nfunc isPrime(n int) bool {\n\tfor i := 2; i <= int(math.Floor(float64(n)/2)); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn n > 1\n}\n*/\n", "language": "Go", "metadata": {"date": 1545535257, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03194.html", "problem_id": "p03194", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03194/input.txt", "sample_output_relpath": "derived/input_output/data/p03194/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03194/Go/s224236055.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s224236055", "user_id": "u381572327"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar memo map[int][]int\n\nfunc main() {\n\tmemo = make(map[int][]int)\n\n\tvar n int\n\tfmt.Scan(&n)\n\tvar p int\n\tfmt.Scan(&p)\n\n\tmp := make(map[int]int)\n\tfor _, a := range fact(p) {\n\t\tmp[a] = mp[a] + 1\n\t}\n\n\tdirect := 1\n\tfor k, v := range mp {\n\t\tif v >= n {\n\t\t\tdirect = direct * k\n\t\t}\n\t}\n\tfmt.Println(direct)\n\n}\n\nfunc fact(n int) []int {\n\t_, exist := memo[n]\n\tif exist {\n\t\treturn memo[n]\n\t}\n\n\tret := make([]int, 0)\n\tflag := false\n\tfor i := 2; i <= int(math.Floor(float64(n)/2)); i++ {\n\t\tif (n % i) == 0 {\n\t\t\tret = append(ret, i)\n\t\t\tret = append(ret, fact(n/i)...)\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\tret = append(ret, n)\n\t}\n\treturn ret\n}\n\n/*\nfunc isPrime(n int) bool {\n\tfor i := 2; i <= int(math.Floor(float64(n)/2)); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn n > 1\n}\n*/\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "sample_input": "3 24\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03194", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 821, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s971817589", "group_id": "codeNet:p03196", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, P := ReadInt(), ReadInt()\n\tfactors := Factorization(P)\n\tans := 1\n\tfor i := 0; i < len(factors); i++ {\n\t\tfactor, cnt := factors[i][0], factors[i][1]\n\t\tans *= Pow(factor, cnt/N)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc Pow(a, b int) int {\n\tx := 1\n\tfor b > 0 {\n\t\tif b&1 == 1 {\n\t\t\tx *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn x\n}\n\nfunc Factorization(n int) [][]int {\n\tres := [][]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt := 0\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tcnt++\n\t\t}\n\t\tres = append(res, []int{i, cnt})\n\t}\n\tif n != 1 {\n\t\tres = append(res, []int{n, 1})\n\t}\n\treturn res\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": 1597714061, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03196.html", "problem_id": "p03196", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03196/input.txt", "sample_output_relpath": "derived/input_output/data/p03196/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03196/Go/s971817589.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s971817589", "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\tN, P := ReadInt(), ReadInt()\n\tfactors := Factorization(P)\n\tans := 1\n\tfor i := 0; i < len(factors); i++ {\n\t\tfactor, cnt := factors[i][0], factors[i][1]\n\t\tans *= Pow(factor, cnt/N)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc Pow(a, b int) int {\n\tx := 1\n\tfor b > 0 {\n\t\tif b&1 == 1 {\n\t\t\tx *= a\n\t\t}\n\t\ta *= a\n\t\tb >>= 1\n\t}\n\treturn x\n}\n\nfunc Factorization(n int) [][]int {\n\tres := [][]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt := 0\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tcnt++\n\t\t}\n\t\tres = append(res, []int{i, cnt})\n\t}\n\tif n != 1 {\n\t\tres = append(res, []int{n, 1})\n\t}\n\treturn res\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\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "sample_input": "3 24\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03196", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 17, "memory_kb": 1856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s429003850", "group_id": "codeNet:p03196", "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 swap(a int64, b int64) (int64, int64) {\n\treturn b, a\n}\n\nfunc GCD(a int64, b int64) int64 {\n\tif b > a {\n\t\ta, b = swap(a, b)\n\t}\n\tif b == 0 {\n\t\treturn a\n\t} else {\n\t\treturn GCD(a%b, b)\n\t}\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 nextLong() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(),10,64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc CheckniconiLevel(s []rune) int {\n\tn := len(s)\n\tmx := 0\n\ttmp := 0\n\tfmt.Printf(\"%d\\n\", n)\n\tfor i := 0; i < n-1; i++ {\n\t\tif s[i] == '2' && s[i+1] == '5' {\n\t\t\ttmp += 2\n\t\t\ti += 1\n\t\t\tmx = int(math.Max(float64(tmp), float64(mx)))\n\t\t} else {\n\t\t\ttmp = 0\n\t\t}\n\t}\n\treturn int(mx)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tans := 1\n\tN := nextLong()\n\tP := nextLong()\n\tvar times int64\n\ttimes=1\n\tif N==1{\n\t\tfmt.Printf(\"%d\\n\", P)\n\t\treturn\n\t}\n\tfor i:=2; i<=int(math.Sqrt(float64(P)));i++{\n\t\tvar tmp int64\n\t\ttmp=1\n\t\ttimes=0\n\t\tfor{\n\t\t\ttimes++\n\t\t\ttmp*=int64(i)\n\t\t\tif tmp*times>=P || times==N-1{\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif(times<=N && P%tmp==0){\n\t\tans = int(math.Max(float64(ans),math.Min(float64(i), float64(GCD(P/tmp,int64(i))))))\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1586896023, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03196.html", "problem_id": "p03196", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03196/input.txt", "sample_output_relpath": "derived/input_output/data/p03196/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03196/Go/s429003850.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s429003850", "user_id": "u945017646"}, "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc swap(a int64, b int64) (int64, int64) {\n\treturn b, a\n}\n\nfunc GCD(a int64, b int64) int64 {\n\tif b > a {\n\t\ta, b = swap(a, b)\n\t}\n\tif b == 0 {\n\t\treturn a\n\t} else {\n\t\treturn GCD(a%b, b)\n\t}\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 nextLong() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(),10,64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc CheckniconiLevel(s []rune) int {\n\tn := len(s)\n\tmx := 0\n\ttmp := 0\n\tfmt.Printf(\"%d\\n\", n)\n\tfor i := 0; i < n-1; i++ {\n\t\tif s[i] == '2' && s[i+1] == '5' {\n\t\t\ttmp += 2\n\t\t\ti += 1\n\t\t\tmx = int(math.Max(float64(tmp), float64(mx)))\n\t\t} else {\n\t\t\ttmp = 0\n\t\t}\n\t}\n\treturn int(mx)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tans := 1\n\tN := nextLong()\n\tP := nextLong()\n\tvar times int64\n\ttimes=1\n\tif N==1{\n\t\tfmt.Printf(\"%d\\n\", P)\n\t\treturn\n\t}\n\tfor i:=2; i<=int(math.Sqrt(float64(P)));i++{\n\t\tvar tmp int64\n\t\ttmp=1\n\t\ttimes=0\n\t\tfor{\n\t\t\ttimes++\n\t\t\ttmp*=int64(i)\n\t\t\tif tmp*times>=P || times==N-1{\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif(times<=N && P%tmp==0){\n\t\tans = int(math.Max(float64(ans),math.Min(float64(i), float64(GCD(P/tmp,int64(i))))))\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "sample_input": "3 24\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03196", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers a_1, a_2, ..., a_N not less than 1.\nThe values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \\times a_2 \\times ... \\times a_N = P.\n\nFind the maximum possible greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\n1 \\leq N \\leq 10^{12}\n\n1 \\leq P \\leq 10^{12}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN P\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 24\n\nSample Output 1\n\n2\n\nThe greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.\n\nSample Input 2\n\n5 1\n\nSample Output 2\n\n1\n\nAs a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.\n\nSample Input 3\n\n1 111\n\nSample Output 3\n\n111\n\nSample Input 4\n\n4 972439611840\n\nSample Output 4\n\n206", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1340, "cpu_time_ms": 17, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s549181136", "group_id": "codeNet:p03200", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tvar total, wtotal int\n\tfmt.Scanf(\"%s\\n\", &s)\n\n\tfor i := 0; i < len(s); i++ {\n\n\t\tif string(s[i]) == \"W\" {\n\t\t\ttotal += i - wtotal\n\t\t\twtotal++\n\t\t}\n\t}\n\tfmt.Println(total)\n\n}\n", "language": "Go", "metadata": {"date": 1598656642, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s549181136.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s549181136", "user_id": "u154777379"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tvar total, wtotal int\n\tfmt.Scanf(\"%s\\n\", &s)\n\n\tfor i := 0; i < len(s); i++ {\n\n\t\tif string(s[i]) == \"W\" {\n\t\t\ttotal += i - wtotal\n\t\t\twtotal++\n\t\t}\n\t}\n\tfmt.Println(total)\n\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 227, "cpu_time_ms": 172, "memory_kb": 3272}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272419786", "group_id": "codeNet:p03200", "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 rdr = bufio.NewReaderSize(os.Stdin, 100000)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\ts := readLine()\n\n\tans := int64(0)\n\tcnt := 0\n\tfor i, ch := range s {\n\t\tif ch == 'W' {\n\t\t\tans += int64(i - cnt)\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100000)\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 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 nextI64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(a int, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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 anser(b bool, y string, n string) string {\n\tif b {\n\t\treturn y\n\t}\n\treturn n\n}", "language": "Go", "metadata": {"date": 1560826384, "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/s272419786.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272419786", "user_id": "u217010036"}, "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)\nvar rdr = bufio.NewReaderSize(os.Stdin, 100000)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\ts := readLine()\n\n\tans := int64(0)\n\tcnt := 0\n\tfor i, ch := range s {\n\t\tif ch == 'W' {\n\t\t\tans += int64(i - cnt)\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100000)\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 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 nextI64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(a int, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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 anser(b bool, y string, n string) string {\n\tif b {\n\t\treturn y\n\t}\n\treturn n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1052, "cpu_time_ms": 3, "memory_kb": 1280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s658511965", "group_id": "codeNet:p03201", "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\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 1\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\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\taa := make([]int, n)\n\tim := IntMap{}\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t\tim.increment(aa[i])\n\t}\n\n\tsort.Ints(aa)\n\n\tans := 0\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif im.get(aa[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tim[aa[i]] = im.get(aa[i]) - 1\n\t\tfor j := 30; j >= 0; j-- {\n\t\t\tp := 1<= 0; i-- {\n\t\tif im.get(aa[i]) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tim[aa[i]] = im.get(aa[i]) - 1\n\t\tfor j := 30; j >= 0; j-- {\n\t\t\tp := 1< max {\n\t\t\tmax = p\n\t\t}\n\t}\n\tans -= max / 2\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1566762821, "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/s041208134.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s041208134", "user_id": "u942915776"}, "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)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc maxScanTokenSize(size int) {\n\tbuf := make([]byte, 0, size)\n\tsc.Buffer(buf, size)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextBytes() []byte {\n\tsc.Scan()\n\treturn sc.Bytes()\n}\n\nfunc nextInt() int {\n\ts := nextString()\n\ti, _ := strconv.Atoi(s)\n\treturn i\n}\n\nfunc scanTwoInts() (int, int) {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\treturn a, b\n}\n\nfunc scanThreeInts() (int, int, int) {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\treturn a, b, c\n}\n\nfunc main() {\n\t// maxScanTokenSize(100000)\n\t// sc.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\n\tmax := 0\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tp := nextInt()\n\t\tans += p\n\t\tif p > max {\n\t\t\tmax = p\n\t\t}\n\t}\n\tans -= max / 2\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s802202491", "group_id": "codeNet:p03208", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar N, K int\nvar hist map[int]int\nvar low, high int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &N, &K)\n\n\thist = make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tvar v int\n\t\tscanner.Scan()\n\t\tfmt.Sscanf(scanner.Text(), \"%d\", &v)\n\t\thist[v] = hist[v] + 1\n\t\tlow = min(low, v)\n\t\thigh = max(high, v)\n\t}\n\n\tindex := sort.Search(N, func(i int) bool {\n\t\treturn check(i)\n\t})\n\tfmt.Println(index)\n}\n\nfunc check(width int) bool {\n\tfor i := low; i <= high-width; i++ {\n\t\tsum := 0\n\t\tfor j := 0; j <= width; j++ {\n\t\t\tsum = sum + hist[i+j]\n\t\t}\n\t\tif sum >= K {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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": 1546661269, "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/s802202491.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s802202491", "user_id": "u381572327"}, "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)\n\nvar N, K int\nvar hist map[int]int\nvar low, high int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &N, &K)\n\n\thist = make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tvar v int\n\t\tscanner.Scan()\n\t\tfmt.Sscanf(scanner.Text(), \"%d\", &v)\n\t\thist[v] = hist[v] + 1\n\t\tlow = min(low, v)\n\t\thigh = max(high, v)\n\t}\n\n\tindex := sort.Search(N, func(i int) bool {\n\t\treturn check(i)\n\t})\n\tfmt.Println(index)\n}\n\nfunc check(width int) bool {\n\tfor i := low; i <= high-width; i++ {\n\t\tsum := 0\n\t\tfor j := 0; j <= width; j++ {\n\t\t\tsum = sum + hist[i+j]\n\t\t}\n\t\tif sum >= K {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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 : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 825, "cpu_time_ms": 2108, "memory_kb": 7936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s157070111", "group_id": "codeNet:p03208", "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 Calc(i []int, n, k int) int {\n\tmn := math.MaxInt32\n\tfor j := 0; j < n-k+1; j++ {\n\t\tdiff := i[j+k-1] - i[j]\n\t\tif diff < mn {\n\t\t\tmn = diff\n\t\t}\n\t\tfmt.Println(j+k-1, j)\n\t}\n\treturn mn\n}\nfunc HeightInput(num int) []int {\n\tvar mat = make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\tmat[i] = nextInt()\n\t}\n\t// sort.Sort(sort.IntSlice(mat))\n\tsort.Ints(mat)\n\treturn mat\n}\nfunc nextInt() int {\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Split(bufio.ScanWords)\n\n\t_ = stdin.Scan()\n\tline, _ := strconv.Atoi(stdin.Text())\n\treturn line\n}\nfunc main() {\n\tn := nextInt()\n\tk := nextInt()\n\n\thei := HeightInput(n)\n\tans := Calc(hei, n, k)\n\tfmt.Println(hei)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1544735416, "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/s157070111.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s157070111", "user_id": "u947859707"}, "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\nfunc Calc(i []int, n, k int) int {\n\tmn := math.MaxInt32\n\tfor j := 0; j < n-k+1; j++ {\n\t\tdiff := i[j+k-1] - i[j]\n\t\tif diff < mn {\n\t\t\tmn = diff\n\t\t}\n\t\tfmt.Println(j+k-1, j)\n\t}\n\treturn mn\n}\nfunc HeightInput(num int) []int {\n\tvar mat = make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\tmat[i] = nextInt()\n\t}\n\t// sort.Sort(sort.IntSlice(mat))\n\tsort.Ints(mat)\n\treturn mat\n}\nfunc nextInt() int {\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Split(bufio.ScanWords)\n\n\t_ = stdin.Scan()\n\tline, _ := strconv.Atoi(stdin.Text())\n\treturn line\n}\nfunc main() {\n\tn := nextInt()\n\tk := nextInt()\n\n\thei := HeightInput(n)\n\tans := Calc(hei, n, k)\n\tfmt.Println(hei)\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 735, "cpu_time_ms": 429, "memory_kb": 7808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s194234296", "group_id": "codeNet:p03209", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N, X uint\n\tfmt.Scan(&N, &X)\n\n\tdebug(\"X=%d\\n\", X)\n\t//時間がかかるので文字列を直接求めるのはダメ\n\t/*\n\t\tbarger := makeBarger(N)\n\t\tdebug(\"level:%d -> %s\\n\", N, barger)\n\t*/\n\tdebug(\"length->%d\\n\", bargerLength(N))\n\tdebug(\"all p num -> %d\\n\", countP(N))\n\tfmt.Printf(\"%d\\n\", eatP(N, X))\n}\n\nvar bargers = make(map[uint]string)\n\n//levelのハンバーガをしたからx枚食べた時のPの枚数\nfunc eatP(level uint, x uint) uint {\n\tif level == 0 && x >= 1 {\n\t\treturn 1\n\t}\n\tif x <= 1 {\n\t\treturn 0\n\t}\n\n\tbargerLen := bargerLength(level)\n\tif x > bargerLen {\n\t\treturn countP(level)\n\t}\n\tnextLen := bargerLength(level - 1)\n\tif x <= nextLen+1 {\n\t\treturn eatP(level-1, x-1)\n\t} else if x == nextLen+2 {\n\t\treturn eatP(level-1, x-1) + 1\n\t} else if x <= 2*nextLen+2 {\n\t\treturn eatP(level-1, x-2-nextLen) + 1 + countP(level-1)\n\t} else {\n\t\treturn 2*countP(level-1) + 1\n\t}\n\n}\n\nfunc bargerLength(level uint) uint {\n\treturn 1<<(level+2) - 3\n}\n\nfunc countP(level uint) uint {\n\treturn 1<<(level+1) - 1\n}\n\nfunc makeBarger(level uint) string {\n\tif barger, ok := bargers[level]; ok {\n\t\treturn barger\n\t}\n\tif level == 0 {\n\t\tbargers[0] = \"P\"\n\t\treturn bargers[0]\n\t} else {\n\t\ttmp := make([]string, 0)\n\t\tpBarger := makeBarger(level - 1)\n\t\ttmp = append(tmp, \"B\")\n\t\ttmp = append(tmp, pBarger)\n\t\ttmp = append(tmp, \"P\")\n\t\ttmp = append(tmp, pBarger)\n\t\ttmp = append(tmp, \"B\")\n\t\tbargers[level] = strings.Join(tmp, \"\")\n\t\treturn bargers[level]\n\t}\n}\n\n//** DEBUG **/\nconst DEBUG_ENABLE = false\n\nfunc debug(format string, a ...interface{}) (n int, err error) {\n\tif DEBUG_ENABLE {\n\t\treturn fmt.Fprintf(os.Stdout, format, a...)\n\t} else {\n\t\treturn 0, nil\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544329458, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03209.html", "problem_id": "p03209", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03209/input.txt", "sample_output_relpath": "derived/input_output/data/p03209/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03209/Go/s194234296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s194234296", "user_id": "u092549278"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar N, X uint\n\tfmt.Scan(&N, &X)\n\n\tdebug(\"X=%d\\n\", X)\n\t//時間がかかるので文字列を直接求めるのはダメ\n\t/*\n\t\tbarger := makeBarger(N)\n\t\tdebug(\"level:%d -> %s\\n\", N, barger)\n\t*/\n\tdebug(\"length->%d\\n\", bargerLength(N))\n\tdebug(\"all p num -> %d\\n\", countP(N))\n\tfmt.Printf(\"%d\\n\", eatP(N, X))\n}\n\nvar bargers = make(map[uint]string)\n\n//levelのハンバーガをしたからx枚食べた時のPの枚数\nfunc eatP(level uint, x uint) uint {\n\tif level == 0 && x >= 1 {\n\t\treturn 1\n\t}\n\tif x <= 1 {\n\t\treturn 0\n\t}\n\n\tbargerLen := bargerLength(level)\n\tif x > bargerLen {\n\t\treturn countP(level)\n\t}\n\tnextLen := bargerLength(level - 1)\n\tif x <= nextLen+1 {\n\t\treturn eatP(level-1, x-1)\n\t} else if x == nextLen+2 {\n\t\treturn eatP(level-1, x-1) + 1\n\t} else if x <= 2*nextLen+2 {\n\t\treturn eatP(level-1, x-2-nextLen) + 1 + countP(level-1)\n\t} else {\n\t\treturn 2*countP(level-1) + 1\n\t}\n\n}\n\nfunc bargerLength(level uint) uint {\n\treturn 1<<(level+2) - 3\n}\n\nfunc countP(level uint) uint {\n\treturn 1<<(level+1) - 1\n}\n\nfunc makeBarger(level uint) string {\n\tif barger, ok := bargers[level]; ok {\n\t\treturn barger\n\t}\n\tif level == 0 {\n\t\tbargers[0] = \"P\"\n\t\treturn bargers[0]\n\t} else {\n\t\ttmp := make([]string, 0)\n\t\tpBarger := makeBarger(level - 1)\n\t\ttmp = append(tmp, \"B\")\n\t\ttmp = append(tmp, pBarger)\n\t\ttmp = append(tmp, \"P\")\n\t\ttmp = append(tmp, pBarger)\n\t\ttmp = append(tmp, \"B\")\n\t\tbargers[level] = strings.Join(tmp, \"\")\n\t\treturn bargers[level]\n\t}\n}\n\n//** DEBUG **/\nconst DEBUG_ENABLE = false\n\nfunc debug(format string, a ...interface{}) (n int, err error) {\n\tif DEBUG_ENABLE {\n\t\treturn fmt.Fprintf(os.Stdout, format, a...)\n\t} else {\n\t\treturn 0, nil\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "sample_input": "2 7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03209", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1701, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s093042074", "group_id": "codeNet:p03209", "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, x int\n\n//var burgers [51]string\nvar totalLen, bLen, pLen [51]int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, x = tmp[0], tmp[1]\n\n\t//\tburgers[0] = \"P\"\n\ttotalLen[0] = 1\n\tbLen[0] = 0\n\tpLen[0] = 1\n\tfor i := 1; i <= 50; i++ {\n\t\t//\t\tburgers[i] = \"B\" + burgers[i-1] + \"P\" + burgers[i-1] + \"B\"\n\t\ttotalLen[i] = 2*totalLen[i-1] + 3\n\t\tbLen[i] = 2*bLen[i-1] + 2\n\t\tpLen[i] = 2*pLen[i-1] + 1\n\t}\n\n\tans := 0\n\t//\tfor i := 0; i <= n; i++ {\n\t//\t\t// トータルよりたくさん食べるときは、それまでのすべてのパティを食べることになる\n\t//\t\tif x >= totalLen[i] {\n\t//\t\t\tans = pLen[i]\n\t//\t\t\tcontinue\n\t//\t\t}\n\t//\t}\n\n\t//\tfor i := 0; i <= 2; i++ {\n\t//\t\tfmt.Println(totalLen[i], bLen[i], pLen[i])\n\t//\t}\n\n\tfor i := n; i >= 1; i-- {\n\t\tif x <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif x > totalLen[i]/2 {\n\t\t\t// 中央のパティまで食べる\n\t\t\tans += pLen[i-1] + 1\n\t\t\tx -= totalLen[i]/2 - 1\n\t\t} else {\n\t\t\t// 最初のバンを食べる\n\t\t\t//x--\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1544327175, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03209.html", "problem_id": "p03209", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03209/input.txt", "sample_output_relpath": "derived/input_output/data/p03209/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03209/Go/s093042074.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s093042074", "user_id": "u103600314"}, "prompt_components": {"gold_output": "4\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, x int\n\n//var burgers [51]string\nvar totalLen, bLen, pLen [51]int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, x = tmp[0], tmp[1]\n\n\t//\tburgers[0] = \"P\"\n\ttotalLen[0] = 1\n\tbLen[0] = 0\n\tpLen[0] = 1\n\tfor i := 1; i <= 50; i++ {\n\t\t//\t\tburgers[i] = \"B\" + burgers[i-1] + \"P\" + burgers[i-1] + \"B\"\n\t\ttotalLen[i] = 2*totalLen[i-1] + 3\n\t\tbLen[i] = 2*bLen[i-1] + 2\n\t\tpLen[i] = 2*pLen[i-1] + 1\n\t}\n\n\tans := 0\n\t//\tfor i := 0; i <= n; i++ {\n\t//\t\t// トータルよりたくさん食べるときは、それまでのすべてのパティを食べることになる\n\t//\t\tif x >= totalLen[i] {\n\t//\t\t\tans = pLen[i]\n\t//\t\t\tcontinue\n\t//\t\t}\n\t//\t}\n\n\t//\tfor i := 0; i <= 2; i++ {\n\t//\t\tfmt.Println(totalLen[i], bLen[i], pLen[i])\n\t//\t}\n\n\tfor i := n; i >= 1; i-- {\n\t\tif x <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif x > totalLen[i]/2 {\n\t\t\t// 中央のパティまで食べる\n\t\t\tans += pLen[i-1] + 1\n\t\t\tx -= totalLen[i]/2 - 1\n\t\t} else {\n\t\t\t// 最初のバンを食べる\n\t\t\t//x--\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "sample_input": "2 7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03209", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5487, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s306065250", "group_id": "codeNet:p03210", "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\t\n\tif X == 3 || X == 5 || X == 7 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\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": 1587232581, "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/s306065250.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s306065250", "user_id": "u964273035"}, "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\"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\t\n\tif X == 3 || X == 5 || X == 7 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\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\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5117, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188316959", "group_id": "codeNet:p03213", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype divisor struct{ list [100]int }\n\nfunc (d *divisor) add(num int) {\n\ti := 2\n\tfor i < 11 {\n\t\tif num%i == 0 {\n\t\t\td.list[i]++\n\t\t\tnum /= i\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\tif num > 1 {\n\t\td.list[num]++\n\t}\n}\n\nfunc (d *divisor) count() [6]int {\n\tvar res [6]int\n\tth := [6]int{1, 2, 4, 14, 24, 74}\n\tfor i := 1; i < 100; i++ {\n\t\tfor j := 0; j < 6; j++ {\n\t\t\tif d.list[i] >= th[j] {\n\t\t\t\tres[j]++\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar num int\n\tans := 0\n\tfmt.Scan(&num)\n\tdivisors := divisor{[100]int{}}\n\tfor n := num; 0 < n; n-- {\n\t\tdivisors.add(n)\n\t}\n\tres := divisors.count()\n\tans += res[5]\n\tans += res[4] * (res[0] - 1)\n\tans += res[3] * (res[2] - 1)\n\tans += res[2] * (res[2] - 1) * (res[1] - 2) / 2\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1545859130, "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/s188316959.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s188316959", "user_id": "u439176910"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype divisor struct{ list [100]int }\n\nfunc (d *divisor) add(num int) {\n\ti := 2\n\tfor i < 11 {\n\t\tif num%i == 0 {\n\t\t\td.list[i]++\n\t\t\tnum /= i\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\tif num > 1 {\n\t\td.list[num]++\n\t}\n}\n\nfunc (d *divisor) count() [6]int {\n\tvar res [6]int\n\tth := [6]int{1, 2, 4, 14, 24, 74}\n\tfor i := 1; i < 100; i++ {\n\t\tfor j := 0; j < 6; j++ {\n\t\t\tif d.list[i] >= th[j] {\n\t\t\t\tres[j]++\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar num int\n\tans := 0\n\tfmt.Scan(&num)\n\tdivisors := divisor{[100]int{}}\n\tfor n := num; 0 < n; n-- {\n\t\tdivisors.add(n)\n\t}\n\tres := divisors.count()\n\tans += res[5]\n\tans += res[4] * (res[0] - 1)\n\tans += res[3] * (res[2] - 1)\n\tans += res[2] * (res[2] - 1) * (res[1] - 2) / 2\n\tfmt.Println(ans)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 743, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s033193916", "group_id": "codeNet:p03219", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n b = b/2\n totalPrice := a + b\n fmt.Println(totalPrice)\n}", "language": "Go", "metadata": {"date": 1578531121, "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/s033193916.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s033193916", "user_id": "u721951903"}, "prompt_components": {"gold_output": "110\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 b = b/2\n totalPrice := a + b\n fmt.Println(totalPrice)\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 147, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s190123008", "group_id": "codeNet:p03220", "input_text": "// https://atcoder.jp/contests/abc113/tasks/abc113_b\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 abs(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\nfunc diff(a, b float64) float64 {\n\treturn abs(a - b)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tT := io.NextInt()\n\tA := io.NextInt()\n\ths := io.NextInts(N)\n\n\tfA := float64(A)\n\n\tminDiff := 1e18\n\tminI := -1\n\n\tfor i, h := range hs {\n\t\tt := float64(T) - float64(h)*0.006\n\t\tdiff := diff(t, fA)\n\n\t\tif diff < minDiff {\n\t\t\tminDiff = diff\n\t\t\tminI = i\n\t\t}\n\t}\n\n\tio.Println(minI + 1)\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// 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/* 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": 1565810252, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Go/s190123008.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s190123008", "user_id": "u751468134"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc113/tasks/abc113_b\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 abs(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\nfunc diff(a, b float64) float64 {\n\treturn abs(a - b)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tT := io.NextInt()\n\tA := io.NextInt()\n\ths := io.NextInts(N)\n\n\tfA := float64(A)\n\n\tminDiff := 1e18\n\tminI := -1\n\n\tfor i, h := range hs {\n\t\tt := float64(T) - float64(h)*0.006\n\t\tdiff := diff(t, fA)\n\n\t\tif diff < minDiff {\n\t\t\tminDiff = diff\n\t\t\tminI = i\n\t\t}\n\t}\n\n\tio.Println(minI + 1)\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// 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/* 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: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5929, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s379221901", "group_id": "codeNet:p03220", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar t, a int\n\tfmt.Scan(&n, &t, &a)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tx := a - t\n\tdiff := 1000000000\n\tvar ans int\n\tfor i, v := range h {\n\t\tif y := abs(x*500 + v*3); y < diff {\n\t\t\tdiff = y\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans + 1)\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", "language": "Go", "metadata": {"date": 1549435967, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Go/s379221901.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s379221901", "user_id": "u554269352"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar t, a int\n\tfmt.Scan(&n, &t, &a)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tx := a - t\n\tdiff := 1000000000\n\tvar ans int\n\tfor i, v := range h {\n\t\tif y := abs(x*500 + v*3); y < diff {\n\t\t\tdiff = y\n\t\t\tans = i\n\t\t}\n\t}\n\tfmt.Println(ans + 1)\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", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 6, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s625155080", "group_id": "codeNet:p03220", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, t, a int\n\t)\n\tfmt.Scanf(\"%d\\n%d %d\\n\", &n, &t, &a)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\n\tpoint := 0\n\tnearestDiff := 1000000\n\tfor idx, x := range h {\n\t\tdiff := int(math.Abs(float64(a) - (float64(t) - float64(x) * 0.006)))\n\t\tif diff < nearestDiff {\n\t\t\tpoint = idx + 1\n\t\t\tnearestDiff = diff\n\t\t}\n\t}\n\tfmt.Println(point)\n}\n", "language": "Go", "metadata": {"date": 1546495773, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Go/s625155080.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s625155080", "user_id": "u534481484"}, "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\t\tn, t, a int\n\t)\n\tfmt.Scanf(\"%d\\n%d %d\\n\", &n, &t, &a)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\n\tpoint := 0\n\tnearestDiff := 1000000\n\tfor idx, x := range h {\n\t\tdiff := int(math.Abs(float64(a) - (float64(t) - float64(x) * 0.006)))\n\t\tif diff < nearestDiff {\n\t\t\tpoint = idx + 1\n\t\t\tnearestDiff = diff\n\t\t}\n\t}\n\tfmt.Println(point)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 416, "cpu_time_ms": 6, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s336149541", "group_id": "codeNet:p03220", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, t, a int\n\tfmt.Scan(&n, &t, &a)\n\n\tvar hs []int\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scan(&v)\n\t\ths = append(hs, v)\n\t}\n\n\tmin_i := 0\n\tmin := diff(a, t, hs[min_i])\n\tfor i, h := range hs {\n\t\tdiff := diff(a, t, h)\n\t\tif min > diff {\n\t\t\tmin = diff\n\t\t\tmin_i = i\n\t\t}\n\t}\n\n\tfmt.Println(min_i + 1)\n}\n\nfunc diff(a, t, h int) int {\n\treturn abs(t*1000 + h*6 - a*1000)\n}\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": 1545793169, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/Go/s336149541.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s336149541", "user_id": "u113872560"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, t, a int\n\tfmt.Scan(&n, &t, &a)\n\n\tvar hs []int\n\tfor i := 0; i < n; i++ {\n\t\tvar v int\n\t\tfmt.Scan(&v)\n\t\ths = append(hs, v)\n\t}\n\n\tmin_i := 0\n\tmin := diff(a, t, hs[min_i])\n\tfor i, h := range hs {\n\t\tdiff := diff(a, t, h)\n\t\tif min > diff {\n\t\t\tmin = diff\n\t\t\tmin_i = i\n\t\t}\n\t}\n\n\tfmt.Println(min_i + 1)\n}\n\nfunc diff(a, t, h int) int {\n\treturn abs(t*1000 + h*6 - a*1000)\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 472, "cpu_time_ms": 6, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s987632565", "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\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 C - ID\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tvar P, Y int\n\tans := make(map[int]int, M)\n\tyear := make([]int, M)\n\tyear1 := make([]int, M)\n\n\tcity := make([]int, M)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < M; i++ {\n\t\tP = nextInt()\n\t\tY = nextInt()\n\t\tans[Y] = P\n\t\tyear[i] = Y\n\t\tyear1[i] = Y\n\t\tcity[i] = P\n\t}\n\n\tans1 := make(map[int]int, M)\n\ttemp := make(map[int]int, M)\n\tsort.Sort(sort.IntSlice(year))\n\tfor i := 0; i < M; i++ {\n\t\ttemp[ans[year[i]]]++\n\n\t\t//fmt.Println(year[i], ans[year[i]], temp[ans[year[i]]])\n\t\tans1[year[i]] = temp[ans[year[i]]]\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Printf(\"%06d%06d\\n\", city[i], ans1[year1[i]])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1599892684, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s987632565.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s987632565", "user_id": "u128015095"}, "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\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 C - ID\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tvar P, Y int\n\tans := make(map[int]int, M)\n\tyear := make([]int, M)\n\tyear1 := make([]int, M)\n\n\tcity := make([]int, M)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < M; i++ {\n\t\tP = nextInt()\n\t\tY = nextInt()\n\t\tans[Y] = P\n\t\tyear[i] = Y\n\t\tyear1[i] = Y\n\t\tcity[i] = P\n\t}\n\n\tans1 := make(map[int]int, M)\n\ttemp := make(map[int]int, M)\n\tsort.Sort(sort.IntSlice(year))\n\tfor i := 0; i < M; i++ {\n\t\ttemp[ans[year[i]]]++\n\n\t\t//fmt.Println(year[i], ans[year[i]], temp[ans[year[i]]])\n\t\tans1[year[i]] = temp[ans[year[i]]]\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Printf(\"%06d%06d\\n\", city[i], ans1[year1[i]])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 865, "cpu_time_ms": 275, "memory_kb": 14680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s082994585", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport \"fmt\"\n\ntype City struct {\n\tPrefecture int\n\tYear int\n}\n\nfunc main() {\n\tvar N, M int\n\tvar p, y int\n\tvar cityID int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\tcities := []City{}\n\tcity := City{}\n\n\tfor k := 0; k < M; k++ {\n\t\tfmt.Scanf(\"%d %d\", &p, &y)\n\t\tcity.Prefecture = p\n\t\tcity.Year = y\n\t\tcities = append(cities, city)\n\t\t// 一旦全部なめる。\n\n\t}\n\tfor k := 0; k < M; k++ {\n\t\tcityID = 1\n\t\tfor kk := 0; kk < M; kk++ {\n\t\t\t// k市がkk県に属する場合、自分より若い市があれば追番を加算する。\n\t\t\tif cities[k].Prefecture == cities[kk].Prefecture {\n\t\t\t\tif cities[k].Year > cities[kk].Year {\n\t\t\t\t\tcityID++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%06d%06d\\n\", cities[k].Prefecture, cityID)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566269467, "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/s082994585.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s082994585", "user_id": "u474502175"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype City struct {\n\tPrefecture int\n\tYear int\n}\n\nfunc main() {\n\tvar N, M int\n\tvar p, y int\n\tvar cityID int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\tcities := []City{}\n\tcity := City{}\n\n\tfor k := 0; k < M; k++ {\n\t\tfmt.Scanf(\"%d %d\", &p, &y)\n\t\tcity.Prefecture = p\n\t\tcity.Year = y\n\t\tcities = append(cities, city)\n\t\t// 一旦全部なめる。\n\n\t}\n\tfor k := 0; k < M; k++ {\n\t\tcityID = 1\n\t\tfor kk := 0; kk < M; kk++ {\n\t\t\t// k市がkk県に属する場合、自分より若い市があれば追番を加算する。\n\t\t\tif cities[k].Prefecture == cities[kk].Prefecture {\n\t\t\t\tif cities[k].Year > cities[kk].Year {\n\t\t\t\t\tcityID++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%06d%06d\\n\", cities[k].Prefecture, cityID)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 717, "cpu_time_ms": 2108, "memory_kb": 9088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s193927325", "group_id": "codeNet:p03221", "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\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\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// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\tm := readInt()\n\tc := make([]city, m)\n\tfor i := range c {\n\t\tc[i].id = i\n\t\tc[i].p = readInt()\n\t\tc[i].y = readInt()\n\t}\n\n\tx := make([]int, n+1)\n\tfor i := range x {\n\t\tx[i] = 1\n\t}\n\n\tsort.Sort(sortByYear(c))\n\tfor i := range c {\n\t\tp := c[i].p\n\t\tc[i].z = x[p]\n\t\tx[p]++\n\t}\n\n\tsort.Sort(sortById(c))\n\tfor i := range c {\n\t\tprintf(\"%06d%06d\\n\", c[i].p, c[i].z)\n\t}\n\n}\n\n// -----------------------------------------------------------------------------\n\ntype city struct {\n\tid, p, y, z int\n}\n\ntype sortByYear []city\n\nfunc (s sortByYear) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortByYear) Less(i, j int) bool {\n\treturn s[i].y < s[j].y\n}\n\nfunc (s sortByYear) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\ntype sortById []city\n\nfunc (s sortById) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortById) Less(i, j int) bool {\n\treturn s[i].id < s[j].id\n}\n\nfunc (s sortById) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n", "language": "Go", "metadata": {"date": 1555785496, "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/s193927325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s193927325", "user_id": "u705974985"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\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\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\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// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\tm := readInt()\n\tc := make([]city, m)\n\tfor i := range c {\n\t\tc[i].id = i\n\t\tc[i].p = readInt()\n\t\tc[i].y = readInt()\n\t}\n\n\tx := make([]int, n+1)\n\tfor i := range x {\n\t\tx[i] = 1\n\t}\n\n\tsort.Sort(sortByYear(c))\n\tfor i := range c {\n\t\tp := c[i].p\n\t\tc[i].z = x[p]\n\t\tx[p]++\n\t}\n\n\tsort.Sort(sortById(c))\n\tfor i := range c {\n\t\tprintf(\"%06d%06d\\n\", c[i].p, c[i].z)\n\t}\n\n}\n\n// -----------------------------------------------------------------------------\n\ntype city struct {\n\tid, p, y, z int\n}\n\ntype sortByYear []city\n\nfunc (s sortByYear) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortByYear) Less(i, j int) bool {\n\treturn s[i].y < s[j].y\n}\n\nfunc (s sortByYear) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\n}\n\ntype sortById []city\n\nfunc (s sortById) Len() int {\n\treturn len(s)\n}\n\nfunc (s sortById) Less(i, j int) bool {\n\treturn s[i].id < s[j].id\n}\n\nfunc (s sortById) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2354, "cpu_time_ms": 146, "memory_kb": 8192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s088546771", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\n// }}}\n\ntype City struct {\n\tY int\n\tN int\n}\n\ntype Answer struct {\n\tID string\n\tN int\n}\n\ntype CityList []City\ntype AnswerList []Answer\n\nfunc (f CityList) Len() int {\n\treturn len(f)\n}\n\nfunc (f CityList) Less(i, j int) bool {\n\treturn f[i].Y < f[j].Y\n}\n\nfunc (f CityList) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\nfunc (f AnswerList) Len() int {\n\treturn len(f)\n}\n\nfunc (f AnswerList) Less(i, j int) bool {\n\treturn f[i].N < f[j].N\n}\n\nfunc (f AnswerList) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tpref := make(map[int]CityList)\n\tfor i := 0; i < m; i++ {\n\t\tvar p, y int\n\t\tfmt.Scan(&p, &y)\n\t\tcity := City{y, i}\n\t\tif pref[p] == nil {\n\t\t\tpref[p] = CityList{city}\n\t\t} else {\n\t\t\tpref[p] = append(pref[p], city)\n\t\t}\n\t}\n\n\tvar ansList AnswerList\n\tfor p, cityList := range pref {\n\t\tsort.Sort(cityList)\n\t\tfor i, city := range cityList {\n\t\t\tid := fmt.Sprintf(\"%06d%06d\", p, i+1)\n\t\t\tans := Answer{id, city.N}\n\t\t\tansList = append(ansList, ans)\n\t\t}\n\t}\n\n\tsort.Sort(ansList)\n\tfor _, ans := range ansList {\n\t\tfmt.Println(ans.ID)\n\t}\n}", "language": "Go", "metadata": {"date": 1552446877, "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/s088546771.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s088546771", "user_id": "u700477434"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\n// }}}\n\ntype City struct {\n\tY int\n\tN int\n}\n\ntype Answer struct {\n\tID string\n\tN int\n}\n\ntype CityList []City\ntype AnswerList []Answer\n\nfunc (f CityList) Len() int {\n\treturn len(f)\n}\n\nfunc (f CityList) Less(i, j int) bool {\n\treturn f[i].Y < f[j].Y\n}\n\nfunc (f CityList) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\nfunc (f AnswerList) Len() int {\n\treturn len(f)\n}\n\nfunc (f AnswerList) Less(i, j int) bool {\n\treturn f[i].N < f[j].N\n}\n\nfunc (f AnswerList) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tpref := make(map[int]CityList)\n\tfor i := 0; i < m; i++ {\n\t\tvar p, y int\n\t\tfmt.Scan(&p, &y)\n\t\tcity := City{y, i}\n\t\tif pref[p] == nil {\n\t\t\tpref[p] = CityList{city}\n\t\t} else {\n\t\t\tpref[p] = append(pref[p], city)\n\t\t}\n\t}\n\n\tvar ansList AnswerList\n\tfor p, cityList := range pref {\n\t\tsort.Sort(cityList)\n\t\tfor i, city := range cityList {\n\t\t\tid := fmt.Sprintf(\"%06d%06d\", p, i+1)\n\t\t\tans := Answer{id, city.N}\n\t\t\tansList = append(ansList, ans)\n\t\t}\n\t}\n\n\tsort.Sort(ansList)\n\tfor _, ans := range ansList {\n\t\tfmt.Println(ans.ID)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4086, "cpu_time_ms": 1554, "memory_kb": 25088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s596830761", "group_id": "codeNet:p03221", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\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\nfunc bitCount(n uint) int {\n\n x := uint64(n)\n\n const m = 1<<64 - 1\n const m0 = 0x5555555555555555\n const m1 = 0x3333333333333333\n const m2 = 0x0f0f0f0f0f0f0f0f\n\n x = x>>1&(m0&m) + x&(m0&m)\n x = x>>2&(m1&m) + x&(m1&m)\n x = (x>>4 + x) & (m2 & m)\n x += x >> 8\n x += x >> 16\n x += x >> 32\n\n return int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n return ((n >> uint(i)) & 1) == 1\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\ntype Pair struct {\n p, y int\n}\n\nfunc main() {\n line := nextLine()\n\n spl := strSprit(line)\n N := parseInt(spl[0])\n M := parseInt(spl[1])\n\n indexes := make(map[Pair]int, M)\n years := make([][]int, N+1)\n for i := 0; i <= N; i++ {\n years[i] = []int{}\n }\n\n for i := 1; i <= M; i++ {\n s := intSprit(nextLine())\n years[s[0]] = append(years[s[0]], s[1])\n p := Pair{s[0], s[1]}\n indexes[p] = i\n }\n\n for i := 0; i < N; i++ {\n sort.Ints(years[i])\n }\n\n ans := make([]string, M+1)\n\n for i := 1; i <= N; i++ {\n y := years[i]\n for idx, val := range y {\n tp := Pair{i, val}\n ai := indexes[tp]\n ans[ai] = fmt.Sprintf(\"%06d%06d\", i, idx+1)\n }\n }\n for i := 1; i <= M; i++ {\n fmt.Println(ans[i])\n }\n\n}", "language": "Go", "metadata": {"date": 1550955449, "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/s596830761.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s596830761", "user_id": "u925392563"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\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\nfunc bitCount(n uint) int {\n\n x := uint64(n)\n\n const m = 1<<64 - 1\n const m0 = 0x5555555555555555\n const m1 = 0x3333333333333333\n const m2 = 0x0f0f0f0f0f0f0f0f\n\n x = x>>1&(m0&m) + x&(m0&m)\n x = x>>2&(m1&m) + x&(m1&m)\n x = (x>>4 + x) & (m2 & m)\n x += x >> 8\n x += x >> 16\n x += x >> 32\n\n return int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n return ((n >> uint(i)) & 1) == 1\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\ntype Pair struct {\n p, y int\n}\n\nfunc main() {\n line := nextLine()\n\n spl := strSprit(line)\n N := parseInt(spl[0])\n M := parseInt(spl[1])\n\n indexes := make(map[Pair]int, M)\n years := make([][]int, N+1)\n for i := 0; i <= N; i++ {\n years[i] = []int{}\n }\n\n for i := 1; i <= M; i++ {\n s := intSprit(nextLine())\n years[s[0]] = append(years[s[0]], s[1])\n p := Pair{s[0], s[1]}\n indexes[p] = i\n }\n\n for i := 0; i < N; i++ {\n sort.Ints(years[i])\n }\n\n ans := make([]string, M+1)\n\n for i := 1; i <= N; i++ {\n y := years[i]\n for idx, val := range y {\n tp := Pair{i, val}\n ai := indexes[tp]\n ans[ai] = fmt.Sprintf(\"%06d%06d\", i, idx+1)\n }\n }\n for i := 1; i <= M; i++ {\n fmt.Println(ans[i])\n }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2777, "cpu_time_ms": 358, "memory_kb": 17664}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s879213702", "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\ntype Tuple struct {\n\tvalue int\n\tindex int\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, M := sc.NextInt(), sc.NextInt()\n\n\tQ := make([]SortInterFace, N+1)\n\tfor i := 0; i < N+1; i++ {\n\t\tQ[i] = make(SortInterFace, 0)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tp, y := sc.NextInt(), sc.NextInt()\n\t\tQ[p] = append(Q[p], Tuple{y, i})\n\t}\n\n\tans := make([]string, M)\n\n\tfor i := 1; i <= N; i++ {\n\t\tsort.Sort(Q[i])\n\t\tfor j := 0; j < len(Q[i]); j++ {\n\t\t\tans[Q[i][j].index] = fmt.Sprintf(\"%06d%06d\", i, j+1)\n\t\t}\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n\n}\n\ntype SortInterFace []Tuple\n\nfunc (s SortInterFace) Len() int {\n\treturn len(s)\n}\nfunc (s SortInterFace) Less(i, j int) bool {\n\treturn s[i].value < s[j].value\n}\nfunc (s SortInterFace) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\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": 1541384681, "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/s879213702.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s879213702", "user_id": "u504669764"}, "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\ntype Tuple struct {\n\tvalue int\n\tindex int\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tN, M := sc.NextInt(), sc.NextInt()\n\n\tQ := make([]SortInterFace, N+1)\n\tfor i := 0; i < N+1; i++ {\n\t\tQ[i] = make(SortInterFace, 0)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\tp, y := sc.NextInt(), sc.NextInt()\n\t\tQ[p] = append(Q[p], Tuple{y, i})\n\t}\n\n\tans := make([]string, M)\n\n\tfor i := 1; i <= N; i++ {\n\t\tsort.Sort(Q[i])\n\t\tfor j := 0; j < len(Q[i]); j++ {\n\t\t\tans[Q[i][j].index] = fmt.Sprintf(\"%06d%06d\", i, j+1)\n\t\t}\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n\n}\n\ntype SortInterFace []Tuple\n\nfunc (s SortInterFace) Len() int {\n\treturn len(s)\n}\nfunc (s SortInterFace) Less(i, j int) bool {\n\treturn s[i].value < s[j].value\n}\nfunc (s SortInterFace) Swap(i, j int) {\n\ts[i], s[j] = s[j], s[i]\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\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2660, "cpu_time_ms": 344, "memory_kb": 14244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034262235", "group_id": "codeNet:p03222", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tMOD := int(math.Pow10(9) + 7)\n\tvar H, W, K int\n\tfmt.Scan(&H, &W, &K)\n\n\tDP := make([][]int, H+1)\n\tfor i := 0; i <= H; i++ {\n\t\tDP[i] = make([]int, W)\n\t}\n\tDP[0][0] = 1\n\n\tfor i := 1; i <= H; i++ {\n\t\t// jはW-1桁(0~W-2桁目まで)\n\t\tfor j := 0; j < (1 << (W - 1)); j++ {\n\t\t\tflg := true\n\t\t\tfor k := 0; k < (W - 2); k++ {\n\t\t\t\tif (j&(1< 0 {\n\t\t\t\t\tflg = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !flg {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\tif k == 0 {\n\t\t\t\t\tif j&(1< 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k+1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t} else if k == W-1 {\n\t\t\t\t\tif j&(1<<(k-1)) > 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k-1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif j&(1< 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k+1]\n\t\t\t\t\t} else if j&(1<<(k-1)) > 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k-1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDP[i][k] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(DP[H][K-1])\n}\n", "language": "Go", "metadata": {"date": 1593462252, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s034262235.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s034262235", "user_id": "u941434715"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tMOD := int(math.Pow10(9) + 7)\n\tvar H, W, K int\n\tfmt.Scan(&H, &W, &K)\n\n\tDP := make([][]int, H+1)\n\tfor i := 0; i <= H; i++ {\n\t\tDP[i] = make([]int, W)\n\t}\n\tDP[0][0] = 1\n\n\tfor i := 1; i <= H; i++ {\n\t\t// jはW-1桁(0~W-2桁目まで)\n\t\tfor j := 0; j < (1 << (W - 1)); j++ {\n\t\t\tflg := true\n\t\t\tfor k := 0; k < (W - 2); k++ {\n\t\t\t\tif (j&(1< 0 {\n\t\t\t\t\tflg = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif !flg {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor k := 0; k < W; k++ {\n\t\t\t\tif k == 0 {\n\t\t\t\t\tif j&(1< 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k+1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t} else if k == W-1 {\n\t\t\t\t\tif j&(1<<(k-1)) > 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k-1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif j&(1< 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k+1]\n\t\t\t\t\t} else if j&(1<<(k-1)) > 0 {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k-1]\n\t\t\t\t\t} else {\n\t\t\t\t\t\tDP[i][k] += DP[i-1][k]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tDP[i][k] %= MOD\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(DP[H][K-1])\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1848}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s585565098", "group_id": "codeNet:p03222", "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 := scanInt()\n\tw := scanInt()\n\tk := scanInt() - 1\n\n\tcnt := make([]int, w+1)\n\tfor i := 1; i <= w; i++ {\n\t\tbitExhaustiveSearch(i, func(arr []bool) {\n\t\t\tf := true\n\t\t\tfor j := 0; j < i-1; j++ {\n\t\t\t\tif arr[j] && arr[j+1] {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif f {\n\t\t\t\tcnt[i]++\n\t\t\t}\n\t\t})\n\t}\n\n\tcnt[0] = 1\n\n\tmemo := make([][]int, h+1)\n\tfor i := 0; i < h+1; i++ {\n\t\tmemo[i] = make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tmemo[i][j] = -1\n\t\t}\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tmemo[h][i] = 0\n\t}\n\tmemo[h][k] = 1\n\n\tvar dfs func(y, x int) int\n\tdfs = func(y, x int) int {\n\t\tif memo[y][x] != -1 {\n\t\t\treturn memo[y][x]\n\t\t}\n\t\tres := 0\n\t\tres += dfs(y+1, x) * (cnt[max(0, x-1)] * cnt[max(0, w-2-x)] % mod) % mod\n\t\tif x > 0 {\n\t\t\tres += dfs(y+1, x-1) * (cnt[max(0, x-2)] * cnt[max(0, w-2-x)] % mod) % mod\n\t\t}\n\t\tif x < w-1 {\n\t\t\tres += dfs(y+1, x+1) * (cnt[max(0, x-1)] * cnt[max(0, w-3-x)] % mod) % mod\n\t\t}\n\t\tres %= mod\n\t\tmemo[y][x] = res\n\t\treturn res\n\t}\n\n\tfmt.Fprintln(wr, dfs(0, 0))\n}\n\nconst mod = 1000000007\n\nfunc bitExhaustiveSearch(n int, fn func(a []bool)) {\n\tall := 1 << uint(n)\n\ta := make([]bool, n)\n\tfor i := 0; i < all; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i>>uint(j)&1 == 1 {\n\t\t\t\ta[j] = true\n\t\t\t} else {\n\t\t\t\ta[j] = false\n\t\t\t}\n\t\t}\n\t\tfn(a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590553850, "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/s585565098.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s585565098", "user_id": "u548992197"}, "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, 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 := scanInt()\n\tw := scanInt()\n\tk := scanInt() - 1\n\n\tcnt := make([]int, w+1)\n\tfor i := 1; i <= w; i++ {\n\t\tbitExhaustiveSearch(i, func(arr []bool) {\n\t\t\tf := true\n\t\t\tfor j := 0; j < i-1; j++ {\n\t\t\t\tif arr[j] && arr[j+1] {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif f {\n\t\t\t\tcnt[i]++\n\t\t\t}\n\t\t})\n\t}\n\n\tcnt[0] = 1\n\n\tmemo := make([][]int, h+1)\n\tfor i := 0; i < h+1; i++ {\n\t\tmemo[i] = make([]int, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tmemo[i][j] = -1\n\t\t}\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tmemo[h][i] = 0\n\t}\n\tmemo[h][k] = 1\n\n\tvar dfs func(y, x int) int\n\tdfs = func(y, x int) int {\n\t\tif memo[y][x] != -1 {\n\t\t\treturn memo[y][x]\n\t\t}\n\t\tres := 0\n\t\tres += dfs(y+1, x) * (cnt[max(0, x-1)] * cnt[max(0, w-2-x)] % mod) % mod\n\t\tif x > 0 {\n\t\t\tres += dfs(y+1, x-1) * (cnt[max(0, x-2)] * cnt[max(0, w-2-x)] % mod) % mod\n\t\t}\n\t\tif x < w-1 {\n\t\t\tres += dfs(y+1, x+1) * (cnt[max(0, x-1)] * cnt[max(0, w-3-x)] % mod) % mod\n\t\t}\n\t\tres %= mod\n\t\tmemo[y][x] = res\n\t\treturn res\n\t}\n\n\tfmt.Fprintln(wr, dfs(0, 0))\n}\n\nconst mod = 1000000007\n\nfunc bitExhaustiveSearch(n int, fn func(a []bool)) {\n\tall := 1 << uint(n)\n\ta := make([]bool, n)\n\tfor i := 0; i < all; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i>>uint(j)&1 == 1 {\n\t\t\t\ta[j] = true\n\t\t\t} else {\n\t\t\t\ta[j] = false\n\t\t\t}\n\t\t}\n\t\tfn(a)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2265, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s572963934", "group_id": "codeNet:p03229", "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 nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc convertToInt(s []string, len int) []int {\n\tret := make([]int, len)\n\tfor i := 0; i < len; i++ {\n\t\tret[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tN, _ := strconv.Atoi(nextLine())\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(nextLine())\n\t}\n\tsort.Ints(a)\n\ta2 := a\n\tmid := N / 2\n\tb := make([]int, N)\n\tb[mid] = a[0]\n\ta = a[1:]\n\tmaxTurn := true\n\tfor i := 1; i <= N/2; i++ {\n\t\tif maxTurn {\n\t\t\tif mid-i >= 0 {\n\t\t\t\tb[mid-i] = a[len(a)-1]\n\t\t\t\ta = a[:len(a)-1]\n\t\t\t}\n\t\t\tif mid+i < N {\n\t\t\t\tb[mid+i] = a[len(a)-1]\n\t\t\t\ta = a[:len(a)-1]\n\t\t\t}\n\t\t\tmaxTurn = false\n\t\t} else {\n\t\t\tif mid-i >= 0 {\n\t\t\t\tb[mid-i] = a[0]\n\t\t\t\ta = a[1:]\n\t\t\t}\n\t\t\tif mid+i < N {\n\t\t\t\tb[mid+i] = a[0]\n\t\t\t\ta = a[1:]\n\t\t\t}\n\t\t\tmaxTurn = true\n\t\t}\n\t}\n\n\tsum1 := 0.0\n\tfor i := 0; i < N-1; i++ {\n\t\tsum1 += math.Abs(float64(b[i] - b[i+1]))\n\t}\n\n\t//fmt.Println(a2)\n\tb2 := make([]int, N)\n\tb2[mid] = a2[len(a2) - 1]\n\ta2 = a2[:len(a2) - 1]\n\tminTurn := true\n\tfor i := 1; i <= N /2; i++ {\n\t\tif minTurn {\n\t\t\tb2[mid-i] = a2[0]\n\t\t\ta2 = a2[1:]\n\n\t\t\tif mid + i < N {\n\t\t\t\tb2[mid+i] = a2[0]\n\t\t\t\ta2 = a2[1:]\n\t\t\t}\n\t\t\tminTurn = false\n\t\t} else {\n\t\t\tb2[mid-i] = a2[len(a2)-1]\n\t\t\ta2 = a2[:len(a2)-1]\n\t\t\tif mid + i < N {\n\t\t\t\tb2[mid+i] = a2[len(a2)-1]\n\t\t\t\ta2=a2[:len(a2)-1]\n\t\t\t}\n\t\t\tminTurn = true\n\t\t}\n\t}\n\n\tsum2 := 0.0\n\tfor i := 0; i < N-1; i++ {\n\t\tsum2 += math.Abs(float64(b2[i] - b2[i+1]))\n\t}\n\n\tif sum1 > sum2 {\n\t\tfmt.Println(sum1)\n\t} else {\n\t\tfmt.Println(sum2)\n\t}\n\n}", "language": "Go", "metadata": {"date": 1540692707, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03229.html", "problem_id": "p03229", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03229/input.txt", "sample_output_relpath": "derived/input_output/data/p03229/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03229/Go/s572963934.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s572963934", "user_id": "u040390320"}, "prompt_components": {"gold_output": "21\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 nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc convertToInt(s []string, len int) []int {\n\tret := make([]int, len)\n\tfor i := 0; i < len; i++ {\n\t\tret[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tN, _ := strconv.Atoi(nextLine())\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(nextLine())\n\t}\n\tsort.Ints(a)\n\ta2 := a\n\tmid := N / 2\n\tb := make([]int, N)\n\tb[mid] = a[0]\n\ta = a[1:]\n\tmaxTurn := true\n\tfor i := 1; i <= N/2; i++ {\n\t\tif maxTurn {\n\t\t\tif mid-i >= 0 {\n\t\t\t\tb[mid-i] = a[len(a)-1]\n\t\t\t\ta = a[:len(a)-1]\n\t\t\t}\n\t\t\tif mid+i < N {\n\t\t\t\tb[mid+i] = a[len(a)-1]\n\t\t\t\ta = a[:len(a)-1]\n\t\t\t}\n\t\t\tmaxTurn = false\n\t\t} else {\n\t\t\tif mid-i >= 0 {\n\t\t\t\tb[mid-i] = a[0]\n\t\t\t\ta = a[1:]\n\t\t\t}\n\t\t\tif mid+i < N {\n\t\t\t\tb[mid+i] = a[0]\n\t\t\t\ta = a[1:]\n\t\t\t}\n\t\t\tmaxTurn = true\n\t\t}\n\t}\n\n\tsum1 := 0.0\n\tfor i := 0; i < N-1; i++ {\n\t\tsum1 += math.Abs(float64(b[i] - b[i+1]))\n\t}\n\n\t//fmt.Println(a2)\n\tb2 := make([]int, N)\n\tb2[mid] = a2[len(a2) - 1]\n\ta2 = a2[:len(a2) - 1]\n\tminTurn := true\n\tfor i := 1; i <= N /2; i++ {\n\t\tif minTurn {\n\t\t\tb2[mid-i] = a2[0]\n\t\t\ta2 = a2[1:]\n\n\t\t\tif mid + i < N {\n\t\t\t\tb2[mid+i] = a2[0]\n\t\t\t\ta2 = a2[1:]\n\t\t\t}\n\t\t\tminTurn = false\n\t\t} else {\n\t\t\tb2[mid-i] = a2[len(a2)-1]\n\t\t\ta2 = a2[:len(a2)-1]\n\t\t\tif mid + i < N {\n\t\t\t\tb2[mid+i] = a2[len(a2)-1]\n\t\t\t\ta2=a2[:len(a2)-1]\n\t\t\t}\n\t\t\tminTurn = true\n\t\t}\n\t}\n\n\tsum2 := 0.0\n\tfor i := 0; i < N-1; i++ {\n\t\tsum2 += math.Abs(float64(b2[i] - b2[i+1]))\n\t}\n\n\tif sum1 > sum2 {\n\t\tfmt.Println(sum1)\n\t} else {\n\t\tfmt.Println(sum2)\n\t}\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": "p03229", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1616, "cpu_time_ms": 42, "memory_kb": 4608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s263611795", "group_id": "codeNet:p03231", "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\tm := getNextInt(scanner)\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\tg := gcd(n, m)\n\n\tfor i := 0; i < g; i++ {\n\t\tif s[n/g*i] != t[m/g*i] {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(int64(n/g) * int64(m))\n\n\twriter.Flush()\n}\n\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t}\n\treturn gcd(m, n%m)\n}\n", "language": "Go", "metadata": {"date": 1577485754, "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/s263611795.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s263611795", "user_id": "u150542210"}, "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 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\tm := getNextInt(scanner)\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\tg := gcd(n, m)\n\n\tfor i := 0; i < g; i++ {\n\t\tif s[n/g*i] != t[m/g*i] {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(int64(n/g) * int64(m))\n\n\twriter.Flush()\n}\n\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t}\n\treturn gcd(m, n%m)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1469, "cpu_time_ms": 3, "memory_kb": 1024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s385980437", "group_id": "codeNet:p03231", "input_text": "package main\n\nimport \"fmt\"\n\nfunc Lcm(i, j int) int {\n\tfor k := 2; ; k++ {\n\t\tif k%i == 0 && k%j == 0 {\n\t\t\treturn k\n\t\t}\n\t}\n}\nfunc main() {\n\tvar n, m int\n\tvar s, t string\n\tfmt.Scan(&n, &m, &s, &t)\n\n\tlcm := Lcm(n, m)\n\tcount := 1\n\tif s[0] != t[0] {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor {\n\t\tL := lcm * count\n\t\tnum1 := L / n\n\t\tnum2 := L / m\n\t\tlcm2 := Lcm(num1, num2)\n\n\t\tfor i := 1; i*lcm2+1 <= L; i++ {\n\t\t\tif s[(i*lcm2-1)/num1+1] == t[(i*lcm2-1)/num2+1] {\n\t\t\t\tif i == (L-1)/lcm2 {\n\t\t\t\t\tfmt.Println(L)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tcount++\n\t}\n}", "language": "Go", "metadata": {"date": 1549924654, "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/s385980437.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s385980437", "user_id": "u370270364"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc Lcm(i, j int) int {\n\tfor k := 2; ; k++ {\n\t\tif k%i == 0 && k%j == 0 {\n\t\t\treturn k\n\t\t}\n\t}\n}\nfunc main() {\n\tvar n, m int\n\tvar s, t string\n\tfmt.Scan(&n, &m, &s, &t)\n\n\tlcm := Lcm(n, m)\n\tcount := 1\n\tif s[0] != t[0] {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor {\n\t\tL := lcm * count\n\t\tnum1 := L / n\n\t\tnum2 := L / m\n\t\tlcm2 := Lcm(num1, num2)\n\n\t\tfor i := 1; i*lcm2+1 <= L; i++ {\n\t\t\tif s[(i*lcm2-1)/num1+1] == t[(i*lcm2-1)/num2+1] {\n\t\t\t\tif i == (L-1)/lcm2 {\n\t\t\t\t\tfmt.Println(L)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tcount++\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 589, "cpu_time_ms": 2107, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s190516112", "group_id": "codeNet:p03239", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var i, n, x int\n ans:=1000\n flag:=0\n fmt.Scan(&n,&x)\n c:=make([]int, n)\n t:=make([]int, n)\n for i=0;i= 1; g-- {\n\t\tif m%g != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tputs(g)\n\t\tbreak\n\t}\n\n\t// puts(ans)\n}\n", "language": "Go", "metadata": {"date": 1586555126, "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/s479572641.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s479572641", "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 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, m := nextInt(), nextInt()\n\n\t// ans := 1\n\tgMax := m / n\n\tfor g := gMax; g >= 1; g-- {\n\t\tif m%g != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tputs(g)\n\t\tbreak\n\t}\n\n\t// puts(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 643, "cpu_time_ms": 211, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s551418817", "group_id": "codeNet:p03241", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc112/tasks/abc112_d\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: argument slice length must not be zero\")\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: 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) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\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: 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 intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(ints *[]int, x int) { *ints = append(*ints, x) }\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 intsAppendSentinelHead(a []int, sentinel int) []int {\n\treturn append([]int{sentinel}, a...)\n}\nfunc intsAppendSentinelTail(a []int, sentinel int) []int {\n\treturn append(a, sentinel)\n}\nfunc intsAppendSentinel(a []int, sentinel int) []int {\n\treturn append(append([]int{sentinel}, a[:len(a):len(a)+2]...), sentinel)\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 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 swap(a, b *int) { *a, *b = *b, *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 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\treturn\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\treturn\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) }\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 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\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, m := ri(), ri()\n\n\tans := -1\n\tfor i := 1; i*i <= m; i++ {\n\t\tif m%i != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif i*n <= m {\n\t\t\tchmax(&ans, i)\n\t\t}\n\t\tj := m / i\n\t\tif j*n <= m {\n\t\t\tchmax(&ans, j)\n\t\t}\n\t}\n\tpln(ans)\n}\n", "language": "Go", "metadata": {"date": 1572276558, "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/s551418817.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s551418817", "user_id": "u554269352"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc112/tasks/abc112_d\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: argument slice length must not be zero\")\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: 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) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\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: 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 intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(ints *[]int, x int) { *ints = append(*ints, x) }\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 intsAppendSentinelHead(a []int, sentinel int) []int {\n\treturn append([]int{sentinel}, a...)\n}\nfunc intsAppendSentinelTail(a []int, sentinel int) []int {\n\treturn append(a, sentinel)\n}\nfunc intsAppendSentinel(a []int, sentinel int) []int {\n\treturn append(append([]int{sentinel}, a[:len(a):len(a)+2]...), sentinel)\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 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 swap(a, b *int) { *a, *b = *b, *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 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\treturn\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\treturn\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) }\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 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\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, m := ri(), ri()\n\n\tans := -1\n\tfor i := 1; i*i <= m; i++ {\n\t\tif m%i != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tif i*n <= m {\n\t\t\tchmax(&ans, i)\n\t\t}\n\t\tj := m / i\n\t\tif j*n <= m {\n\t\t\tchmax(&ans, j)\n\t\t}\n\t}\n\tpln(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9036, "cpu_time_ms": 16, "memory_kb": 1024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s531190610", "group_id": "codeNet:p03241", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\nfunc BinComb(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\n// }}}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tans := 1\n\tfor a := 1; a*a <= m; a++ {\n\t\tif m%a != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tb := m / a\n\n\t\tif a*n <= m {\n\t\t\tif a > ans {\n\t\t\t\tans = a\n\t\t\t}\n\t\t}\n\t\tif b*n <= m {\n\t\t\tif b > ans {\n\t\t\t\tans = b\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1553376696, "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/s531190610.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s531190610", "user_id": "u700477434"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc ReadInt(f *os.File) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(f *os.File, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ScanInts(f *os.File, vars ...*int) {\n\tfor i := 0; i < len(vars); i++ {\n\t\tfmt.Fscanf(f, \"%d\", vars[i])\n\t}\n}\n\nfunc ReadLine(f *os.File) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\n\treturn str\n}\n\nfunc ReadLines(f *os.File, n int) []string {\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &lines[i])\n\t}\n\n\treturn lines\n}\n\nfunc ReadWords(f *os.File, n int) []string {\n\tstrs := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%s\", &strs[i])\n\t}\n\treturn strs\n}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn n\n}\n\nfunc BinComb(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\n// }}}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tans := 1\n\tfor a := 1; a*a <= m; a++ {\n\t\tif m%a != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tb := m / a\n\n\t\tif a*n <= m {\n\t\t\tif a > ans {\n\t\t\t\tans = a\n\t\t\t}\n\t\t}\n\t\tif b*n <= m {\n\t\t\tif b > ans {\n\t\t\t\tans = b\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3488, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s207728080", "group_id": "codeNet:p03241", "input_text": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 1 14:35:30 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar n, m int\n\nfunc main() {\n\tfmt.Scan(&n, &m)\n\n\tfor i := n; i <= m/2; i++ {\n\t\tif m%i == 0 {\n\t\t\tfmt.Println(m / i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(1)\n}\n", "language": "Go", "metadata": {"date": 1543695813, "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/s207728080.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s207728080", "user_id": "u842030412"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Sat Dec 1 14:35:30 2018\n//\npackage main\n\nimport \"fmt\"\n\nvar n, m int\n\nfunc main() {\n\tfmt.Scan(&n, &m)\n\n\tfor i := n; i <= m/2; i++ {\n\t\tif m%i == 0 {\n\t\t\tfmt.Println(m / i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s928185153", "group_id": "codeNet:p03241", "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)\n\nfunc nextString() string {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan string\")\n\t}\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan int\")\n\t}\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\tm := nextInt()\n\n\tif m > 10000 {\n\t\tvar result int\n\n\t\tfor i := 1; i <= 100; i ++ {\n\t\t\tif m%i == 0 {\n\t\t\t\tresult = i\n\t\t\t}\n\t\t}\n\n\t\tfor ; n <= m/99; n++ {\n\t\t\tif m%n == 0 {\n\t\t\t\tfmt.Println(m / n)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(result)\n\t\treturn\n\t} else {\n\t\tfor ; n <= m; n++ {\n\t\t\tif m%n == 0 {\n\t\t\t\tfmt.Println(m / n)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1538876368, "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/s928185153.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s928185153", "user_id": "u775862898"}, "prompt_components": {"gold_output": "2\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)\n\nfunc nextString() string {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan string\")\n\t}\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan int\")\n\t}\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\tm := nextInt()\n\n\tif m > 10000 {\n\t\tvar result int\n\n\t\tfor i := 1; i <= 100; i ++ {\n\t\t\tif m%i == 0 {\n\t\t\t\tresult = i\n\t\t\t}\n\t\t}\n\n\t\tfor ; n <= m/99; n++ {\n\t\t\tif m%n == 0 {\n\t\t\t\tfmt.Println(m / n)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(result)\n\t\treturn\n\t} else {\n\t\tfor ; n <= m; n++ {\n\t\t\tif m%n == 0 {\n\t\t\t\tfmt.Println(m / n)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 101, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s030947713", "group_id": "codeNet:p03242", "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\n\tvar b [3]rune\n\n\tfor i, v := range n {\n\t\tif v == '1' {\n\t\t\tb[i] = '9'\n\t\t} else {\n\t\t\tb[i] = '1'\n\t\t}\n\t}\n\n\tans, _ := strconv.Atoi(string(b[:]))\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1597288600, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s030947713.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s030947713", "user_id": "u061804469"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tvar b [3]rune\n\n\tfor i, v := range n {\n\t\tif v == '1' {\n\t\t\tb[i] = '9'\n\t\t} else {\n\t\t\tb[i] = '1'\n\t\t}\n\t}\n\n\tans, _ := strconv.Atoi(string(b[:]))\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s687361843", "group_id": "codeNet:p03244", "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 = 10000000000\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\n\tnumMap1 := make(map[int]int)\n\tnumMap2 := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tv := getInt()\n\t\tif i % 2 == 1 {\n\t\t\tnumMap1[v]++\n\t\t} else {\n\t\t\tnumMap2[v]++\n\t\t}\n\t}\n\n\tif len(numMap1) == 1 && len(numMap2) == 1 {\n\t\tnum1 := 0\n\t\tfor num := range numMap1 {\n\t\t\tnum1 = num\n\t\t}\n\n\t\tnum2 := 0\n\t\tfor num := range numMap2 {\n\t\t\tnum1 = num\n\t\t}\n\n\t\tif num1 == num2 {\n\t\t\tfmt.Println(n / 2)\n\t\t\treturn\n\t\t}\n\t}\n\n\tmaxNum1 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap1 {\n\t\tif maxNum1[0][1] < cnt {\n\t\t\tmaxNum1[0][0] = num\n\t\t\tmaxNum1[0][1] = cnt\n\t\t} else if maxNum1[1][1] < cnt {\n\t\t\tmaxNum1[1][0] = num\n\t\t\tmaxNum1[1][1] = cnt\n\t\t}\n\t}\n\n\tmaxNum2 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap2 {\n\t\tif maxNum2[0][1] < cnt {\n\t\t\tmaxNum2[0][0] = num\n\t\t\tmaxNum2[0][1] = cnt\n\t\t} else if maxNum2[1][1] < cnt {\n\t\t\tmaxNum2[1][0] = num\n\t\t\tmaxNum2[1][1] = cnt\n\t\t}\n\t}\n\n\tvar changeCnt1, changeCnt2 int\n\n\tif maxNum1[0][0] != maxNum2[0][0] {\n\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t} else {\n\t\tif maxNum1[0][1] + maxNum2[1][1] >= maxNum1[1][1] + maxNum2[0][1] {\n\t\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[1][1]\n\t\t} else {\n\t\t\tchangeCnt1 = n/2 - maxNum1[1][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t\t}\n\t}\n\n\tfmt.Println(changeCnt1 + changeCnt2)\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", "language": "Go", "metadata": {"date": 1587250623, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/Go/s687361843.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s687361843", "user_id": "u964273035"}, "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 = 10000000000\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\n\tnumMap1 := make(map[int]int)\n\tnumMap2 := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tv := getInt()\n\t\tif i % 2 == 1 {\n\t\t\tnumMap1[v]++\n\t\t} else {\n\t\t\tnumMap2[v]++\n\t\t}\n\t}\n\n\tif len(numMap1) == 1 && len(numMap2) == 1 {\n\t\tnum1 := 0\n\t\tfor num := range numMap1 {\n\t\t\tnum1 = num\n\t\t}\n\n\t\tnum2 := 0\n\t\tfor num := range numMap2 {\n\t\t\tnum1 = num\n\t\t}\n\n\t\tif num1 == num2 {\n\t\t\tfmt.Println(n / 2)\n\t\t\treturn\n\t\t}\n\t}\n\n\tmaxNum1 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap1 {\n\t\tif maxNum1[0][1] < cnt {\n\t\t\tmaxNum1[0][0] = num\n\t\t\tmaxNum1[0][1] = cnt\n\t\t} else if maxNum1[1][1] < cnt {\n\t\t\tmaxNum1[1][0] = num\n\t\t\tmaxNum1[1][1] = cnt\n\t\t}\n\t}\n\n\tmaxNum2 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap2 {\n\t\tif maxNum2[0][1] < cnt {\n\t\t\tmaxNum2[0][0] = num\n\t\t\tmaxNum2[0][1] = cnt\n\t\t} else if maxNum2[1][1] < cnt {\n\t\t\tmaxNum2[1][0] = num\n\t\t\tmaxNum2[1][1] = cnt\n\t\t}\n\t}\n\n\tvar changeCnt1, changeCnt2 int\n\n\tif maxNum1[0][0] != maxNum2[0][0] {\n\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t} else {\n\t\tif maxNum1[0][1] + maxNum2[1][1] >= maxNum1[1][1] + maxNum2[0][1] {\n\t\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[1][1]\n\t\t} else {\n\t\t\tchangeCnt1 = n/2 - maxNum1[1][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t\t}\n\t}\n\n\tfmt.Println(changeCnt1 + changeCnt2)\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1742, "cpu_time_ms": 42, "memory_kb": 6784}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s096066135", "group_id": "codeNet:p03244", "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\tv := getIntArray(n)\n\n\tnumMap := make(map[int]int)\n\tnumMap1 := make(map[int]int)\n\tnumMap2 := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tnumMap[v[i]]++\n\n\t\tif i % 2 == 1 {\n\t\t\tnumMap1[v[i]]++\n\t\t} else {\n\t\t\tnumMap2[v[i]]++\n\t\t}\n\t}\n\n\tif len(numMap) == 1 {\n\t\tfmt.Println(n/2)\n\t\treturn\n\t}\n\n\tmaxNum1 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap1 {\n\t\tif maxNum1[0][1] < cnt {\n\t\t\tmaxNum1[0][0] = num\n\t\t\tmaxNum1[0][1] = cnt\n\t\t} else if maxNum1[1][1] < cnt {\n\t\t\tmaxNum1[1][0] = num\n\t\t\tmaxNum1[1][1] = cnt\n\t\t}\n\t}\n\n\tmaxNum2 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap2 {\n\t\tif maxNum2[0][1] < cnt {\n\t\t\tmaxNum2[0][0] = num\n\t\t\tmaxNum2[0][1] = cnt\n\t\t} else if maxNum2[1][1] < cnt {\n\t\t\tmaxNum2[1][0] = num\n\t\t\tmaxNum2[1][1] = cnt\n\t\t}\n\t}\n\n\tvar changeCnt1, changeCnt2 int\n\n\tif maxNum1[0][0] != maxNum2[0][0] {\n\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t} else {\n\t\tif maxNum1[0][1] + maxNum2[1][1] <= maxNum1[1][1] + maxNum2[0][1] {\n\t\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[1][1]\n\t\t} else {\n\t\t\tchangeCnt1 = n/2 - maxNum1[1][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t\t}\n\t}\n\n\tfmt.Println(changeCnt1 + changeCnt2)\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": 1587249500, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/Go/s096066135.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s096066135", "user_id": "u964273035"}, "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\"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\tv := getIntArray(n)\n\n\tnumMap := make(map[int]int)\n\tnumMap1 := make(map[int]int)\n\tnumMap2 := make(map[int]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tnumMap[v[i]]++\n\n\t\tif i % 2 == 1 {\n\t\t\tnumMap1[v[i]]++\n\t\t} else {\n\t\t\tnumMap2[v[i]]++\n\t\t}\n\t}\n\n\tif len(numMap) == 1 {\n\t\tfmt.Println(n/2)\n\t\treturn\n\t}\n\n\tmaxNum1 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap1 {\n\t\tif maxNum1[0][1] < cnt {\n\t\t\tmaxNum1[0][0] = num\n\t\t\tmaxNum1[0][1] = cnt\n\t\t} else if maxNum1[1][1] < cnt {\n\t\t\tmaxNum1[1][0] = num\n\t\t\tmaxNum1[1][1] = cnt\n\t\t}\n\t}\n\n\tmaxNum2 := [][]int{{0, 0}, {0, 0}}\n\tfor num, cnt := range numMap2 {\n\t\tif maxNum2[0][1] < cnt {\n\t\t\tmaxNum2[0][0] = num\n\t\t\tmaxNum2[0][1] = cnt\n\t\t} else if maxNum2[1][1] < cnt {\n\t\t\tmaxNum2[1][0] = num\n\t\t\tmaxNum2[1][1] = cnt\n\t\t}\n\t}\n\n\tvar changeCnt1, changeCnt2 int\n\n\tif maxNum1[0][0] != maxNum2[0][0] {\n\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t} else {\n\t\tif maxNum1[0][1] + maxNum2[1][1] <= maxNum1[1][1] + maxNum2[0][1] {\n\t\t\tchangeCnt1 = n/2 - maxNum1[0][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[1][1]\n\t\t} else {\n\t\t\tchangeCnt1 = n/2 - maxNum1[1][1]\n\t\t\tchangeCnt2 = n/2 - maxNum2[0][1]\n\t\t}\n\t}\n\n\tfmt.Println(changeCnt1 + changeCnt2)\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 : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6195, "cpu_time_ms": 58, "memory_kb": 10240}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s548850432", "group_id": "codeNet:p03244", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\teven := make(map[int]int, n/2)\n\todd := make(map[int]int, n/2)\n\tfor i := 0; i < n/2; i++ {\n\t\tvar x, y int\n\t\tfmt.Scan(&x, &y)\n\t\teven[x]++\n\t\todd[y]++\n\t}\n\tmin := n / 2\n\tfor k, v := range even {\n\t\tfor l, w := range odd {\n\t\t\tif k == l {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif x := n - v - w; x < min {\n\t\t\t\t\tmin = x\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1556638774, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/Go/s548850432.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s548850432", "user_id": "u004288099"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\teven := make(map[int]int, n/2)\n\todd := make(map[int]int, n/2)\n\tfor i := 0; i < n/2; i++ {\n\t\tvar x, y int\n\t\tfmt.Scan(&x, &y)\n\t\teven[x]++\n\t\todd[y]++\n\t}\n\tmin := n / 2\n\tfor k, v := range even {\n\t\tfor l, w := range odd {\n\t\t\tif k == l {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif x := n - v - w; x < min {\n\t\t\t\t\tmin = x\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 413, "cpu_time_ms": 2111, "memory_kb": 5760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s345652789", "group_id": "codeNet:p03244", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"os\"\n\t\"bufio\"\n\t\"strings\"\n)\n\n// template start\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc input2int() int{\n\tsc.Scan()\n\tnum , _ := strconv.Atoi(sc.Text())\n\treturn num\n}\n\nfunc input2intarr(n int) []int{\n\tsc.Scan()\n\tin := strings.Split(sc.Text(), \" \")\n\tout := make([]int, n)\n\tfor i:=0; i e_max{\n\t\t\te_k, e_max = k, v\n\t\t}\n\t}\n\tfor k, v := range(odd){\n\t\tif v > o_max{\n\t\t\to_k, o_max = k, v\n\t\t}\n\t}\n\tif e_k == o_k{\n\t\tif e_max == o_max{\n\t\t\t// fmt.Println(n/2)\n\t\t\to_max = 0\n\t\t} else if e_max > o_max{\n\t\t\to_max = 0\n\t\t\todd[o_k] = 0\n\t\t\tfor k, v := range(odd){\n\t\t\t\tif v > o_max{\n\t\t\t\t\to_k, o_max = k, v\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\te_max = 0\n\t\t\teven[e_k] = 0\n\t\t\tfor k, v := range(even){\n\t\t\t\tif v > o_max{\n\t\t\t\t\te_k, e_max = k, v\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(n - (e_max + o_max))\n}", "language": "Go", "metadata": {"date": 1538271344, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/Go/s345652789.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s345652789", "user_id": "u211127867"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"os\"\n\t\"bufio\"\n\t\"strings\"\n)\n\n// template start\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc input2int() int{\n\tsc.Scan()\n\tnum , _ := strconv.Atoi(sc.Text())\n\treturn num\n}\n\nfunc input2intarr(n int) []int{\n\tsc.Scan()\n\tin := strings.Split(sc.Text(), \" \")\n\tout := make([]int, n)\n\tfor i:=0; i e_max{\n\t\t\te_k, e_max = k, v\n\t\t}\n\t}\n\tfor k, v := range(odd){\n\t\tif v > o_max{\n\t\t\to_k, o_max = k, v\n\t\t}\n\t}\n\tif e_k == o_k{\n\t\tif e_max == o_max{\n\t\t\t// fmt.Println(n/2)\n\t\t\to_max = 0\n\t\t} else if e_max > o_max{\n\t\t\to_max = 0\n\t\t\todd[o_k] = 0\n\t\t\tfor k, v := range(odd){\n\t\t\t\tif v > o_max{\n\t\t\t\t\to_k, o_max = k, v\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\te_max = 0\n\t\t\teven[e_k] = 0\n\t\t\tfor k, v := range(even){\n\t\t\t\tif v > o_max{\n\t\t\t\t\te_k, e_max = k, v\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(n - (e_max + o_max))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1162, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867299217", "group_id": "codeNet:p03252", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc110/tasks/abc110_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\"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\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tS, T []rune\n)\n\nfunc main() {\n\tS, T = ReadRuneSlice(), ReadRuneSlice()\n\n\tstart, goal := [30]rune{}, [30]rune{}\n\tfor i := 'a'; i <= 'z'; i++ {\n\t\tstart[i-'a'] = -1\n\t\tgoal[i-'a'] = -1\n\t}\n\n\tfor i := 0; i < len(S); i++ {\n\t\tsi, ti := S[i]-'a', T[i]-'a'\n\n\t\tif start[si] == -1 && goal[ti] == -1 {\n\t\t\tstart[si] = ti\n\t\t\tgoal[ti] = si\n\t\t} else {\n\t\t\tif start[si] != ti || goal[ti] != si {\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(\"Yes\")\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": 1587934415, "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/s867299217.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s867299217", "user_id": "u103600314"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc110/tasks/abc110_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\"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\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tS, T []rune\n)\n\nfunc main() {\n\tS, T = ReadRuneSlice(), ReadRuneSlice()\n\n\tstart, goal := [30]rune{}, [30]rune{}\n\tfor i := 'a'; i <= 'z'; i++ {\n\t\tstart[i-'a'] = -1\n\t\tgoal[i-'a'] = -1\n\t}\n\n\tfor i := 0; i < len(S); i++ {\n\t\tsi, ti := S[i]-'a', T[i]-'a'\n\n\t\tif start[si] == -1 && goal[ti] == -1 {\n\t\t\tstart[si] = ti\n\t\t\tgoal[ti] = si\n\t\t} else {\n\t\t\tif start[si] != ti || goal[ti] != si {\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(\"Yes\")\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5375, "cpu_time_ms": 17, "memory_kb": 3200}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s344208699", "group_id": "codeNet:p03252", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\tsm := map[string][]string{}\n\ttm := map[string][]string{}\n\tfor i := 0; i < len(S); i++ {\n\t\tsm[S[i:i+1]] = append(sm[S[i:i+1]], T[i:i+1])\n\t\ttm[T[i:i+1]] = append(tm[T[i:i+1]], S[i:i+1])\n\t}\n\tfor _, v := range sm {\n\t\tif len(v) > 1 {\n\t\t\tw := v[0]\n\t\t\tfor i := 1; i < len(v); i++ {\n\t\t\t\tif w != v[i] {\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range tm {\n\t\tif len(v) > 1 {\n\t\t\tw := v[0]\n\t\t\tfor i := 1; i < len(v); i++ {\n\t\t\t\tif w != v[i] {\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1557578445, "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/s344208699.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s344208699", "user_id": "u298152049"}, "prompt_components": {"gold_output": "Yes\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\tsm := map[string][]string{}\n\ttm := map[string][]string{}\n\tfor i := 0; i < len(S); i++ {\n\t\tsm[S[i:i+1]] = append(sm[S[i:i+1]], T[i:i+1])\n\t\ttm[T[i:i+1]] = append(tm[T[i:i+1]], S[i:i+1])\n\t}\n\tfor _, v := range sm {\n\t\tif len(v) > 1 {\n\t\t\tw := v[0]\n\t\t\tfor i := 1; i < len(v); i++ {\n\t\t\t\tif w != v[i] {\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range tm {\n\t\tif len(v) > 1 {\n\t\t\tw := v[0]\n\t\t\tfor i := 1; i < len(v); i++ {\n\t\t\t\tif w != v[i] {\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 611, "cpu_time_ms": 361, "memory_kb": 20096}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s754211065", "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\n\tsc.Scan()\n\ts := sc.Text()\n\tsc.Scan()\n\tt := sc.Text()\n\n\tif len(s) != len(t) {\n\t\tpanic(\"ERRR\")\n\t}\n\n\tfmt.Println(\"\")\n}\n", "language": "Go", "metadata": {"date": 1539140946, "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/s754211065.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s754211065", "user_id": "u307252896"}, "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\n\tsc.Scan()\n\ts := sc.Text()\n\tsc.Scan()\n\tt := sc.Text()\n\n\tif len(s) != len(t) {\n\t\tpanic(\"ERRR\")\n\t}\n\n\tfmt.Println(\"\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s197122759", "group_id": "codeNet:p03252", "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 in = newIo(bufio.NewScanner(os.Stdin))\n\nfunc main() {\n\tin.setSplit(bufio.ScanLines)\n\tvar s = in.next()\n\tvar t = in.next()\n\tprint(solve(s, t) && solve(t, s))\n}\n\nfunc print(result bool) {\n\tvar r = \"No\"\n\tif result {\n\t\tr = \"Yes\"\n\t}\n\tfmt.Println(r)\n}\n\nfunc solve(s string, t string) bool {\n\tr := map[string]string{}\n\tfor i, c := range s {\n\t\tv, ok := r[string(c)]\n\t\tif ok {\n\t\t\tif v != string(t[i]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tr[string(c)] = string(t[i])\n\t\t}\n\t}\n\treturn true\n}\n\ntype io struct {\n\tsc *bufio.Scanner\n}\n\nfunc newIo(sc *bufio.Scanner) *io {\n\ti := new(io)\n\ti.sc = sc\n\ti.sc.Buffer([]byte{}, math.MaxInt64)\n\ti.sc.Split(bufio.ScanWords)\n\treturn i\n}\n\nfunc (i *io) setSplit(f bufio.SplitFunc) {\n\ti.sc.Split(f)\n}\n\nfunc (i *io) nextIntSlice(y int, delim string) [][]int {\n\tresult := make([][]int, y)\n\tfor j := 0; j < y; j++ {\n\t\tline := i.next()\n\t\tresult[j] = perseIntSlice(strings.Split(line, delim))\n\t}\n\treturn result\n}\n\nfunc (i *io) next() string {\n\ti.sc.Scan()\n\treturn i.sc.Text()\n}\n\nfunc (i *io) nextInt() int {\n\treturn perseInt(i.next())\n}\n\nfunc (i *io) nextLong() int64 {\n\treturn perseLong(i.next())\n}\n\nfunc perseInt(s string) int {\n\tin, _ := strconv.Atoi(s)\n\treturn in\n}\n\nfunc perseLong(s string) int64 {\n\tin, _ := strconv.ParseInt(s, 10, 64)\n\treturn in\n}\n\nfunc perseIntSlice(s []string) []int {\n\tvar r = make([]int, len(s))\n\tfor i := 0; i < len(s); i++ {\n\t\tr[i] = perseInt(s[i])\n\t}\n\treturn r\n}\n", "language": "Go", "metadata": {"date": 1537974400, "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/s197122759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s197122759", "user_id": "u504602473"}, "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\"strconv\"\n\t\"strings\"\n)\n\nvar in = newIo(bufio.NewScanner(os.Stdin))\n\nfunc main() {\n\tin.setSplit(bufio.ScanLines)\n\tvar s = in.next()\n\tvar t = in.next()\n\tprint(solve(s, t) && solve(t, s))\n}\n\nfunc print(result bool) {\n\tvar r = \"No\"\n\tif result {\n\t\tr = \"Yes\"\n\t}\n\tfmt.Println(r)\n}\n\nfunc solve(s string, t string) bool {\n\tr := map[string]string{}\n\tfor i, c := range s {\n\t\tv, ok := r[string(c)]\n\t\tif ok {\n\t\t\tif v != string(t[i]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t} else {\n\t\t\tr[string(c)] = string(t[i])\n\t\t}\n\t}\n\treturn true\n}\n\ntype io struct {\n\tsc *bufio.Scanner\n}\n\nfunc newIo(sc *bufio.Scanner) *io {\n\ti := new(io)\n\ti.sc = sc\n\ti.sc.Buffer([]byte{}, math.MaxInt64)\n\ti.sc.Split(bufio.ScanWords)\n\treturn i\n}\n\nfunc (i *io) setSplit(f bufio.SplitFunc) {\n\ti.sc.Split(f)\n}\n\nfunc (i *io) nextIntSlice(y int, delim string) [][]int {\n\tresult := make([][]int, y)\n\tfor j := 0; j < y; j++ {\n\t\tline := i.next()\n\t\tresult[j] = perseIntSlice(strings.Split(line, delim))\n\t}\n\treturn result\n}\n\nfunc (i *io) next() string {\n\ti.sc.Scan()\n\treturn i.sc.Text()\n}\n\nfunc (i *io) nextInt() int {\n\treturn perseInt(i.next())\n}\n\nfunc (i *io) nextLong() int64 {\n\treturn perseLong(i.next())\n}\n\nfunc perseInt(s string) int {\n\tin, _ := strconv.Atoi(s)\n\treturn in\n}\n\nfunc perseLong(s string) int64 {\n\tin, _ := strconv.ParseInt(s, 10, 64)\n\treturn in\n}\n\nfunc perseIntSlice(s []string) []int {\n\tvar r = make([]int, len(s))\n\tfor i := 0; i < len(s); i++ {\n\t\tr[i] = perseInt(s[i])\n\t}\n\treturn r\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1491, "cpu_time_ms": 30, "memory_kb": 1536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s965288982", "group_id": "codeNet:p03253", "input_text": "// https://atcoder.jp/contests/abc110/tasks/abc110_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\nvar MAX = int(1e6)\n\n// i! % MOD M\nvar fact []int\n\n// (i!)^(-1) MOD M\nvar finv []int\n\n// i^(-1) MOD M\nvar inv []int\n\n// ref: http://drken1215.hatenablog.com/entry/2018/06/08/210000\nfunc prepareCombination() {\n\tfact = make([]int, MAX)\n\tfinv = make([]int, MAX)\n\tinv = make([]int, MAX)\n\n\tfact[0] = 1\n\tfact[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\n\tfor i := 2; i < MAX; i++ {\n\t\tfact[i] = fact[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD // a^(-1) ≡ -(p % a)^(-1) * (p/a) MOD p\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\nfunc combinationM(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\n\treturn fact[n] * (finv[k] * finv[n-k] % MOD) % MOD\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\t// [1, .., 1] の配列を考え、 M の各素因数を割り振る重複組み合わせをかけ合わせていけば良い\n\t// 素因数の個数 k について、 k 個の珠を n-1 個の仕切りで区切る通りを考えればよく、仕切りの間の球が 0 個であってもよいので C(k + n-1, k)\n\tprepareCombination()\n\n\tfactMap := map[int]int{}\n\tcur := M\n\n\tfor i := 2; i <= cur; i++ {\n\t\tfor cur%i == 0 {\n\t\t\tcur /= i\n\t\t\tfactMap[i]++\n\t\t}\n\t}\n\n\tres := 1\n\n\tfor _, ct := range factMap {\n\t\tres *= combinationM(ct+N-1, ct)\n\t\tres %= MOD\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// 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": 1565846757, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03253.html", "problem_id": "p03253", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03253/input.txt", "sample_output_relpath": "derived/input_output/data/p03253/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03253/Go/s965288982.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s965288982", "user_id": "u751468134"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc110/tasks/abc110_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\nvar MAX = int(1e6)\n\n// i! % MOD M\nvar fact []int\n\n// (i!)^(-1) MOD M\nvar finv []int\n\n// i^(-1) MOD M\nvar inv []int\n\n// ref: http://drken1215.hatenablog.com/entry/2018/06/08/210000\nfunc prepareCombination() {\n\tfact = make([]int, MAX)\n\tfinv = make([]int, MAX)\n\tinv = make([]int, MAX)\n\n\tfact[0] = 1\n\tfact[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\n\tfor i := 2; i < MAX; i++ {\n\t\tfact[i] = fact[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD // a^(-1) ≡ -(p % a)^(-1) * (p/a) MOD p\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n}\n\nfunc combinationM(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\n\treturn fact[n] * (finv[k] * finv[n-k] % MOD) % MOD\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\t// [1, .., 1] の配列を考え、 M の各素因数を割り振る重複組み合わせをかけ合わせていけば良い\n\t// 素因数の個数 k について、 k ��の珠を n-1 個の仕切りで区切る通りを考えればよく、仕切りの間の球が 0 個であってもよいので C(k + n-1, k)\n\tprepareCombination()\n\n\tfactMap := map[int]int{}\n\tcur := M\n\n\tfor i := 2; i <= cur; i++ {\n\t\tfor cur%i == 0 {\n\t\t\tcur /= i\n\t\t\tfactMap[i]++\n\t\t}\n\t}\n\n\tres := 1\n\n\tfor _, ct := range factMap {\n\t\tres *= combinationM(ct+N-1, ct)\n\t\tres %= MOD\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// 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 : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "sample_input": "2 6\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03253", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7151, "cpu_time_ms": 475, "memory_kb": 25472}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s944766997", "group_id": "codeNet:p03254", "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, x := getInt(), getInt()\n\ta := getInts(N)\n\tsort.Ints(a)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] <= x {\n\t\t\tans++\n\t\t\tx -= a[i]\n\t\t} else {\n\t\t\tx = max(0, x-a[i])\n\t\t}\n\t}\n\tif x > 0 {\n\t\tans--\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1594688302, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/Go/s944766997.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s944766997", "user_id": "u814575783"}, "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 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, x := getInt(), getInt()\n\ta := getInts(N)\n\tsort.Ints(a)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] <= x {\n\t\t\tans++\n\t\t\tx -= a[i]\n\t\t} else {\n\t\t\tx = max(0, x-a[i])\n\t\t}\n\t}\n\tif x > 0 {\n\t\tans--\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1234, "cpu_time_ms": 6, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497279944", "group_id": "codeNet:p03254", "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//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 N, x int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t//X: 最初のマス\n\tN, x = nextInt(), nextInt()\n\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsort.Ints(a)\n\tans := 0\n\tj := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] <= x {\n\t\t\tans++\n\t\t\tx -= a[i]\n\t\t\tj = i\n\t\t\tcontinue\n\t\t}\n\t\tj = i\n\t\tbreak\n\t}\n\tif x > 0 && j == N-1 {\n\t\tans--\n\t}\n\n\tfmt.Println(maxInt(0, ans))\n}\n", "language": "Go", "metadata": {"date": 1591488959, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/Go/s497279944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s497279944", "user_id": "u432333240"}, "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//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 N, x int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t//X: 最初のマス\n\tN, x = nextInt(), nextInt()\n\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsort.Ints(a)\n\tans := 0\n\tj := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[i] <= x {\n\t\t\tans++\n\t\t\tx -= a[i]\n\t\t\tj = i\n\t\t\tcontinue\n\t\t}\n\t\tj = i\n\t\tbreak\n\t}\n\tif x > 0 && j == N-1 {\n\t\tans--\n\t}\n\n\tfmt.Println(maxInt(0, ans))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2472, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s400207509", "group_id": "codeNet:p03254", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tlist := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tsort.Ints(list)\n\n\tcount := 0\n\tfor i := 0; i < a; i++ {\n\t\tif b < list[i] {\n\t\t\tcount = i\n\t\t\tbreak\n\t\t}\n\t\tb -= list[i]\n\t\tif b <= 0 {\n\t\t\tcount = i + 1\n\t\t\tbreak\n\t\t}\n\t\tcount = i\n\t}\n\n\tfmt.Println(count)\n\n}\n", "language": "Go", "metadata": {"date": 1575661438, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/Go/s400207509.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s400207509", "user_id": "u346986631"}, "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 a, b int\n\tfmt.Scan(&a, &b)\n\tlist := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&list[i])\n\t}\n\n\tsort.Ints(list)\n\n\tcount := 0\n\tfor i := 0; i < a; i++ {\n\t\tif b < list[i] {\n\t\t\tcount = i\n\t\t\tbreak\n\t\t}\n\t\tb -= list[i]\n\t\tif b <= 0 {\n\t\t\tcount = i + 1\n\t\t\tbreak\n\t\t}\n\t\tcount = i\n\t}\n\n\tfmt.Println(count)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 361, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s368199602", "group_id": "codeNet:p03254", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n)\n\nfunc main() {\n\tdefer writer.Flush() // Use printf, scanf\n\n\t// CODE\n\tvar N, x int\n\tscanf(\"%d %d\\n\", &N, &x)\n\ta := make([]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\tscanf(\"%d \", &a[i])\n\t}\n\tscanf(\"%d\\n\", &a[N-1])\n\tsort.Stable(IntSlice(a))\n\n\tvar i, ans int\n\tfor x >= a[i] && i < N-1 {\n\t\tx -= a[i]\n\t\tans++\n\t\ti++\n\t}\n\t// last child\n\tif i == N-1 && x == a[N-1] {\n\t\tans++\n\t}\n\tprintf(\"%d\\n\", ans)\n}\n\n// I/O {{{\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n// }}}\n// Math {{{\nfunc maxInt(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc minInt(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// }}}\n// {{{ dummy\nfunc dummy() {\n\tfmt.Printf(\"Hello, World\\n\")\n\tfmt.Printf(\"%v\", reflect.TypeOf(0))\n\n\tarr := []int{10, 9, 8, 7, 1}\n\tsort.Ints(arr)\n\tfmt.Println(arr)\n}\n\n// }}}\n// PriorityQueue {{{\n// Usage:\n// type Person struct {\n// \tname string\n// \tage int\n// }\n//\n// func (p1 Person) Less(p2 interface{}) bool {\n// \treturn p1.age < p2.(Person).age\n// }\n//\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n// \tdefer out.Flush() // Use printf\n//\n// \t// CODE\n// \tq := NewPriorityQueue()\n// \tq.Push(Person{name: \"B\", age: 11})\n// \tq.Push(Person{name: \"A\", age: 10})\n// \tq.Push(Person{name: \"C\", age: 12})\n//\n// \tfor q.Len() > 0 {\n// \t\tp := q.Pop().(Person)\n// \t\tprintf(\"%s %d\\n\", p.name, p.age)\n// \t}\n// }\nfunc NewPriorityQueue() *PriorityQueue {\n\tq := &PriorityQueue{s: new(sorter)}\n\theap.Init(q.s)\n\treturn q\n}\n\nfunc (q *PriorityQueue) Pop() Comparable {\n\treturn heap.Pop(q.s).(Comparable)\n}\n\nfunc (q *PriorityQueue) Top() Comparable {\n\tif len(*q.s) > 0 {\n\t\treturn (*q.s)[0].(Comparable)\n\t}\n\treturn nil\n}\n\nfunc (q *PriorityQueue) Fix(x Comparable, i int) {\n\t(*q.s)[i] = x\n\theap.Fix(q.s, i)\n}\n\nfunc (q *PriorityQueue) Remove(i int) Comparable {\n\treturn heap.Remove(q.s, i).(Comparable)\n}\n\nfunc (q *PriorityQueue) Len() int {\n\treturn q.s.Len()\n}\n\ntype Comparable interface {\n\tLess(other interface{}) bool\n}\n\ntype sorter []Comparable\n\nfunc (s *sorter) Push(x interface{}) {\n\t*s = append(*s, x.(Comparable))\n}\n\nfunc (s *sorter) Pop() interface{} {\n\tn := len(*s)\n\tif n > 0 {\n\t\tx := (*s)[n-1]\n\t\t*s = (*s)[0 : n-1]\n\t\treturn x\n\t}\n\treturn nil\n}\n\nfunc (s *sorter) Len() int {\n\treturn len(*s)\n}\n\nfunc (s *sorter) Less(i, j int) bool {\n\treturn (*s)[i].Less((*s)[j])\n}\n\nfunc (s *sorter) Swap(i, j int) {\n\t(*s)[i], (*s)[j] = (*s)[j], (*s)[i]\n}\n\n// Define priority queue struct\ntype PriorityQueue struct {\n\ts *sorter\n}\n\nfunc (q *PriorityQueue) Push(x Comparable) {\n\theap.Push(q.s, x)\n}\n\n// }}}\n// Sort {{{\n// sort.Stable(IntSlice(a))\ntype IntSlice []int\n\nfunc (a IntSlice) Len() int {\n\treturn len(a)\n}\nfunc (a IntSlice) Less(i, j int) bool {\n\treturn a[i] < a[j]\n}\nfunc (a IntSlice) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\n// }}}\n", "language": "Go", "metadata": {"date": 1554352632, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/Go/s368199602.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s368199602", "user_id": "u702996070"}, "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\"reflect\"\n\t\"sort\"\n)\n\nfunc main() {\n\tdefer writer.Flush() // Use printf, scanf\n\n\t// CODE\n\tvar N, x int\n\tscanf(\"%d %d\\n\", &N, &x)\n\ta := make([]int, N)\n\tfor i := 0; i < N-1; i++ {\n\t\tscanf(\"%d \", &a[i])\n\t}\n\tscanf(\"%d\\n\", &a[N-1])\n\tsort.Stable(IntSlice(a))\n\n\tvar i, ans int\n\tfor x >= a[i] && i < N-1 {\n\t\tx -= a[i]\n\t\tans++\n\t\ti++\n\t}\n\t// last child\n\tif i == N-1 && x == a[N-1] {\n\t\tans++\n\t}\n\tprintf(\"%d\\n\", ans)\n}\n\n// I/O {{{\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n// }}}\n// Math {{{\nfunc maxInt(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc minInt(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// }}}\n// {{{ dummy\nfunc dummy() {\n\tfmt.Printf(\"Hello, World\\n\")\n\tfmt.Printf(\"%v\", reflect.TypeOf(0))\n\n\tarr := []int{10, 9, 8, 7, 1}\n\tsort.Ints(arr)\n\tfmt.Println(arr)\n}\n\n// }}}\n// PriorityQueue {{{\n// Usage:\n// type Person struct {\n// \tname string\n// \tage int\n// }\n//\n// func (p1 Person) Less(p2 interface{}) bool {\n// \treturn p1.age < p2.(Person).age\n// }\n//\n// func main() {\n// \tsc.Split(bufio.ScanWords)\n// \tdefer out.Flush() // Use printf\n//\n// \t// CODE\n// \tq := NewPriorityQueue()\n// \tq.Push(Person{name: \"B\", age: 11})\n// \tq.Push(Person{name: \"A\", age: 10})\n// \tq.Push(Person{name: \"C\", age: 12})\n//\n// \tfor q.Len() > 0 {\n// \t\tp := q.Pop().(Person)\n// \t\tprintf(\"%s %d\\n\", p.name, p.age)\n// \t}\n// }\nfunc NewPriorityQueue() *PriorityQueue {\n\tq := &PriorityQueue{s: new(sorter)}\n\theap.Init(q.s)\n\treturn q\n}\n\nfunc (q *PriorityQueue) Pop() Comparable {\n\treturn heap.Pop(q.s).(Comparable)\n}\n\nfunc (q *PriorityQueue) Top() Comparable {\n\tif len(*q.s) > 0 {\n\t\treturn (*q.s)[0].(Comparable)\n\t}\n\treturn nil\n}\n\nfunc (q *PriorityQueue) Fix(x Comparable, i int) {\n\t(*q.s)[i] = x\n\theap.Fix(q.s, i)\n}\n\nfunc (q *PriorityQueue) Remove(i int) Comparable {\n\treturn heap.Remove(q.s, i).(Comparable)\n}\n\nfunc (q *PriorityQueue) Len() int {\n\treturn q.s.Len()\n}\n\ntype Comparable interface {\n\tLess(other interface{}) bool\n}\n\ntype sorter []Comparable\n\nfunc (s *sorter) Push(x interface{}) {\n\t*s = append(*s, x.(Comparable))\n}\n\nfunc (s *sorter) Pop() interface{} {\n\tn := len(*s)\n\tif n > 0 {\n\t\tx := (*s)[n-1]\n\t\t*s = (*s)[0 : n-1]\n\t\treturn x\n\t}\n\treturn nil\n}\n\nfunc (s *sorter) Len() int {\n\treturn len(*s)\n}\n\nfunc (s *sorter) Less(i, j int) bool {\n\treturn (*s)[i].Less((*s)[j])\n}\n\nfunc (s *sorter) Swap(i, j int) {\n\t(*s)[i], (*s)[j] = (*s)[j], (*s)[i]\n}\n\n// Define priority queue struct\ntype PriorityQueue struct {\n\ts *sorter\n}\n\nfunc (q *PriorityQueue) Push(x Comparable) {\n\theap.Push(q.s, x)\n}\n\n// }}}\n// Sort {{{\n// sort.Stable(IntSlice(a))\ntype IntSlice []int\n\nfunc (a IntSlice) Len() int {\n\treturn len(a)\n}\nfunc (a IntSlice) Less(i, j int) bool {\n\treturn a[i] < a[j]\n}\nfunc (a IntSlice) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\n// }}}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3015, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s038680126", "group_id": "codeNet:p03263", "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 main() {\n\tdefer stdout.Flush()\n\th := readInt()\n\tw := readInt()\n\ta := make([][]int, h)\n\tfor i := range a {\n\t\ta[i] = make([]int, w)\n\t\tfor j := range a[i] {\n\t\t\ta[i][j] = readInt() % 2\n\t\t}\n\t}\n\tpi := 0\n\tpj := 0\n\tans := make([][]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif i == 0 && j == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[pi][pj] == 1 {\n\t\t\t\tans = append(ans, []int{pi + 1, pj + 1, i + 1, j + 1})\n\t\t\t\ta[i][j] = (a[i][j] + a[pi][pj]) % 2\n\t\t\t}\n\t\t\tpi = i\n\t\t\tpj = j\n\t\t}\n\t\ti++\n\t\tif h <= i {\n\t\t\tbreak\n\t\t}\n\t\tfor j := w - 1; j >= 0; j-- {\n\t\t\tif a[pi][pj] == 1 {\n\t\t\t\tans = append(ans, []int{pi + 1, pj + 1, i + 1, j + 1})\n\t\t\t\ta[i][j] = (a[i][j] + a[pi][pj]) % 2\n\t\t\t}\n\t\t\tpi = i\n\t\t\tpj = j\n\t\t}\n\t}\n\tprintln(len(ans))\n\tfor i := range ans {\n\t\tprintln(ans[i][0], ans[i][1], ans[i][2], ans[i][3])\n\t}\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1540436415, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03263.html", "problem_id": "p03263", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03263/input.txt", "sample_output_relpath": "derived/input_output/data/p03263/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03263/Go/s038680126.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s038680126", "user_id": "u705974985"}, "prompt_components": {"gold_output": "3\n2 2 2 3\n1 1 1 2\n1 3 1 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, []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 main() {\n\tdefer stdout.Flush()\n\th := readInt()\n\tw := readInt()\n\ta := make([][]int, h)\n\tfor i := range a {\n\t\ta[i] = make([]int, w)\n\t\tfor j := range a[i] {\n\t\t\ta[i][j] = readInt() % 2\n\t\t}\n\t}\n\tpi := 0\n\tpj := 0\n\tans := make([][]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif i == 0 && j == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[pi][pj] == 1 {\n\t\t\t\tans = append(ans, []int{pi + 1, pj + 1, i + 1, j + 1})\n\t\t\t\ta[i][j] = (a[i][j] + a[pi][pj]) % 2\n\t\t\t}\n\t\t\tpi = i\n\t\t\tpj = j\n\t\t}\n\t\ti++\n\t\tif h <= i {\n\t\t\tbreak\n\t\t}\n\t\tfor j := w - 1; j >= 0; j-- {\n\t\t\tif a[pi][pj] == 1 {\n\t\t\t\tans = append(ans, []int{pi + 1, pj + 1, i + 1, j + 1})\n\t\t\t\ta[i][j] = (a[i][j] + a[pi][pj]) % 2\n\t\t\t}\n\t\t\tpi = i\n\t\t\tpj = j\n\t\t}\n\t}\n\tprintln(len(ans))\n\tfor i := range ans {\n\t\tprintln(ans[i][0], ans[i][1], ans[i][2], ans[i][3])\n\t}\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere is a grid of square cells with H horizontal rows and W vertical columns. The cell at the i-th row and the j-th column will be denoted as Cell (i, j).\n\nIn Cell (i, j), a_{ij} coins are placed.\n\nYou can perform the following operation any number of times:\n\nOperation: Choose a cell that was not chosen before and contains one or more coins, then move one of those coins to a vertically or horizontally adjacent cell.\n\nMaximize the number of cells containing an even number of coins.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 500\n\n0 \\leq a_{ij} \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} a_{12} ... a_{1W}\na_{21} a_{22} ... a_{2W}\n:\na_{H1} a_{H2} ... a_{HW}\n\nOutput\n\nPrint a sequence of operations that maximizes the number of cells containing an even number of coins, in the following format:\n\nN\ny_1 x_1 y_1' x_1'\ny_2 x_2 y_2' x_2'\n:\ny_N x_N y_N' x_N'\n\nThat is, in the first line, print an integer N between 0 and H \\times W (inclusive), representing the number of operations.\n\nIn the (i+1)-th line (1 \\leq i \\leq N), print four integers y_i, x_i, y_i' and x_i' (1 \\leq y_i, y_i' \\leq H and 1 \\leq x_i, x_i' \\leq W), representing the i-th operation. These four integers represents the operation of moving one of the coins placed in Cell (y_i, x_i) to a vertically or horizontally adjacent cell, (y_i', x_i').\n\nNote that if the specified operation violates the specification in the problem statement or the output format is invalid, it will result in Wrong Answer.\n\nSample Input 1\n\n2 3\n1 2 3\n0 1 1\n\nSample Output 1\n\n3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n\nEvery cell contains an even number of coins after the following sequence of operations:\n\nMove the coin in Cell (2, 2) to Cell (2, 3).\n\nMove the coin in Cell (1, 1) to Cell (1, 2).\n\nMove one of the coins in Cell (1, 3) to Cell (1, 2).\n\nSample Input 2\n\n3 2\n1 0\n2 1\n1 0\n\nSample Output 2\n\n3\n1 1 1 2\n1 2 2 2\n3 1 3 2\n\nSample Input 3\n\n1 5\n9 9 9 9 9\n\nSample Output 3\n\n2\n1 1 1 2\n1 3 1 4", "sample_input": "2 3\n1 2 3\n0 1 1\n"}, "reference_outputs": ["3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n"], "source_document_id": "p03263", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere is a grid of square cells with H horizontal rows and W vertical columns. The cell at the i-th row and the j-th column will be denoted as Cell (i, j).\n\nIn Cell (i, j), a_{ij} coins are placed.\n\nYou can perform the following operation any number of times:\n\nOperation: Choose a cell that was not chosen before and contains one or more coins, then move one of those coins to a vertically or horizontally adjacent cell.\n\nMaximize the number of cells containing an even number of coins.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 500\n\n0 \\leq a_{ij} \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{11} a_{12} ... a_{1W}\na_{21} a_{22} ... a_{2W}\n:\na_{H1} a_{H2} ... a_{HW}\n\nOutput\n\nPrint a sequence of operations that maximizes the number of cells containing an even number of coins, in the following format:\n\nN\ny_1 x_1 y_1' x_1'\ny_2 x_2 y_2' x_2'\n:\ny_N x_N y_N' x_N'\n\nThat is, in the first line, print an integer N between 0 and H \\times W (inclusive), representing the number of operations.\n\nIn the (i+1)-th line (1 \\leq i \\leq N), print four integers y_i, x_i, y_i' and x_i' (1 \\leq y_i, y_i' \\leq H and 1 \\leq x_i, x_i' \\leq W), representing the i-th operation. These four integers represents the operation of moving one of the coins placed in Cell (y_i, x_i) to a vertically or horizontally adjacent cell, (y_i', x_i').\n\nNote that if the specified operation violates the specification in the problem statement or the output format is invalid, it will result in Wrong Answer.\n\nSample Input 1\n\n2 3\n1 2 3\n0 1 1\n\nSample Output 1\n\n3\n2 2 2 3\n1 1 1 2\n1 3 1 2\n\nEvery cell contains an even number of coins after the following sequence of operations:\n\nMove the coin in Cell (2, 2) to Cell (2, 3).\n\nMove the coin in Cell (1, 1) to Cell (1, 2).\n\nMove one of the coins in Cell (1, 3) to Cell (1, 2).\n\nSample Input 2\n\n3 2\n1 0\n2 1\n1 0\n\nSample Output 2\n\n3\n1 1 1 2\n1 2 2 2\n3 1 3 2\n\nSample Input 3\n\n1 5\n9 9 9 9 9\n\nSample Output 3\n\n2\n1 1 1 2\n1 3 1 4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2188, "cpu_time_ms": 164, "memory_kb": 21248}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s118013793", "group_id": "codeNet:p03264", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K int\n\tfmt.Scan(&K)\n\tfmt.Println((K / 2) * ((K / 2) + (K % 2)))\n}\n", "language": "Go", "metadata": {"date": 1573667695, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03264.html", "problem_id": "p03264", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03264/input.txt", "sample_output_relpath": "derived/input_output/data/p03264/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03264/Go/s118013793.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s118013793", "user_id": "u902409225"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K int\n\tfmt.Scan(&K)\n\tfmt.Println((K / 2) * ((K / 2) + (K % 2)))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nFind the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.\n\nConstraints\n\n2\\leq K\\leq 100\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive).\n\nSample Input 1\n\n3\n\nSample Output 1\n\n2\n\nTwo pairs can be chosen: (2,1) and (2,3).\n\nSample Input 2\n\n6\n\nSample Output 2\n\n9\n\nSample Input 3\n\n11\n\nSample Output 3\n\n30\n\nSample Input 4\n\n50\n\nSample Output 4\n\n625", "sample_input": "3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03264", "source_text": "Score : 100 points\n\nProblem Statement\n\nFind the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter.\n\nConstraints\n\n2\\leq K\\leq 100\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive).\n\nSample Input 1\n\n3\n\nSample Output 1\n\n2\n\nTwo pairs can be chosen: (2,1) and (2,3).\n\nSample Input 2\n\n6\n\nSample Output 2\n\n9\n\nSample Input 3\n\n11\n\nSample Output 3\n\n30\n\nSample Input 4\n\n50\n\nSample Output 4\n\n625", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 113, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s691891699", "group_id": "codeNet:p03266", "input_text": "// https://atcoder.jp/contests/abc108/tasks/arc102_a\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\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tK := io.NextInt()\n\n\t// a + b ≡ b + c ≡ c + a ≡ 0 mod K (1)\n\t// a ≡ b ≡ c (2) が (1) の必要条件として得られる\n\t// (1) (2) より a + a ≡ 2a ≡ 0 mod K (3) が得られる\n\t// i) K % 2 == 1の時\n\t// (3) で a ≡ 0 mod K となり、 a ≡ b ≡ c ≡ 0 mod K (4) が (1) の必要十分条件\n\t// これを満たす a, b, c の個数は N 以下の 0 mod K の個数 ** 3\n\t// ii) K % 2 == 0 の時\n\t// K' = K/2 とすると (2) で 2a = 2lK' より a = lK' となり a ≡ 0 mod K'\n\t// 同様にして b ≡ 0 mod K', c ≡ 0 mod K'\n\t// これと (4) より a ≡ b ≡ c ≡ 0 or K/2 mod K\n\t// これを満たす a, b, c の個数は N 以下の 0, K/2 mod K それぞれの **3 の和\n\n\tif K%2 == 1 {\n\t\tres := Pow(N/K, 3)\n\t\tio.Println(res)\n\t\treturn\n\t}\n\n\tres := Pow(N/K, 3)\n\t// a ≡ K/2 mod K\n\t// ⇔ a - K/2 ≡ 0 mod K\n\t// ⇔ a + K/2 ≡ 0 mod K\n\tres += Pow((N+K/2)/K, 3)\n\n\tio.Println(res)\n}\n\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tK := io.NextInt()\n\n\t// a, b, c の余りしか重要ではない\n\t// a の余りが決まると b, c が決定されるため、 b + c が条件を満たすかどうかを見ることとすれば a の余りの全探索で十分\n\n\trestCts := make([]int, K)\n\n\tfor i := 1; i <= N; i++ {\n\t\tr := i % K\n\t\trestCts[r]++\n\t}\n\n\tres := 0\n\n\tfor aR := 0; aR < K; aR++ {\n\t\tbR := (K - aR) % K\n\t\tcR := (K - aR) % K\n\n\t\tif (bR+cR)%K == 0 {\n\t\t\tres += restCts[aR] * restCts[bR] * restCts[cR]\n\t\t}\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// 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": 1565911591, "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/s691891699.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s691891699", "user_id": "u751468134"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc108/tasks/arc102_a\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\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tK := io.NextInt()\n\n\t// a + b ≡ b + c ≡ c + a ≡ 0 mod K (1)\n\t// a ≡ b ≡ c (2) が (1) の必要条件として得られる\n\t// (1) (2) より a + a ≡ 2a ≡ 0 mod K (3) が得られる\n\t// i) K % 2 == 1の時\n\t// (3) で a ≡ 0 mod K となり、 a ≡ b ≡ c ≡ 0 mod K (4) が (1) の必要十分条件\n\t// これを満たす a, b, c の個数は N 以下の 0 mod K の個数 ** 3\n\t// ii) K % 2 == 0 の時\n\t// K' = K/2 とすると (2) で 2a = 2lK' より a = lK' となり a ≡ 0 mod K'\n\t// 同様にして b ≡ 0 mod K', c ≡ 0 mod K'\n\t// これと (4) より a ≡ b ≡ c ≡ 0 or K/2 mod K\n\t// これを満たす a, b, c の個数は N 以下の 0, K/2 mod K それぞれの **3 の和\n\n\tif K%2 == 1 {\n\t\tres := Pow(N/K, 3)\n\t\tio.Println(res)\n\t\treturn\n\t}\n\n\tres := Pow(N/K, 3)\n\t// a ≡ K/2 mod K\n\t// ⇔ a - K/2 ≡ 0 mod K\n\t// ⇔ a + K/2 ≡ 0 mod K\n\tres += Pow((N+K/2)/K, 3)\n\n\tio.Println(res)\n}\n\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tK := io.NextInt()\n\n\t// a, b, c の余りしか重要ではない\n\t// a の余りが決まると b, c が決定されるため、 b + c が条件を満たすかどうかを見ることとすれば a の余りの全探索で十分\n\n\trestCts := make([]int, K)\n\n\tfor i := 1; i <= N; i++ {\n\t\tr := i % K\n\t\trestCts[r]++\n\t}\n\n\tres := 0\n\n\tfor aR := 0; aR < K; aR++ {\n\t\tbR := (K - aR) % K\n\t\tcR := (K - aR) % K\n\n\t\tif (bR+cR)%K == 0 {\n\t\t\tres += restCts[aR] * restCts[bR] * restCts[cR]\n\t\t}\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// 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 : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "sample_input": "3 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03266", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7349, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272675761", "group_id": "codeNet:p03266", "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\n\tn := scanInt(sc)\n\tk := scanInt(sc)\n\n\tsteps := int64(n / k)\n\tcount := steps * steps * steps\n\n\tif k%2 == 0 {\n\t\thalf := k / 2\n\t\tif n >= half {\n\t\t\tsteps := int64((n-half)/k) + 1\n\t\t\tcount += steps * steps * steps\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1539605167, "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/s272675761.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272675761", "user_id": "u307252896"}, "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 main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tn := scanInt(sc)\n\tk := scanInt(sc)\n\n\tsteps := int64(n / k)\n\tcount := steps * steps * steps\n\n\tif k%2 == 0 {\n\t\thalf := k / 2\n\t\tif n >= half {\n\t\t\tsteps := int64((n-half)/k) + 1\n\t\t\tcount += steps * steps * steps\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s635916621", "group_id": "codeNet:p03267", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar L int\n\tfmt.Scanf(\"%d\", &L)\n\tN := -1\n\tfor K := 1; K <= L; K <<= 1 {\n\t\tN++\n\t}\n\te := 0\n\tfor i := 0; i < N; i++ {\n\t\te += L >> uint(i) & 1\n\t}\n\tif e == N {\n\t\tfmt.Printf(\"%d %d\\n\", N+2, 2*(N+1))\n\t\tfor i := 0; i <= N; i++ {\n\t\t\tfmt.Printf(\"%d %d 0\\n\", i+1, i+2)\n\t\t\tfmt.Printf(\"%d %d %d\\n\", i+1, i+2, 1<>uint(N-i-1)&1 == 1 {\n\t\t\tfmt.Printf(\"%d %d %d\\n\", 0, i+2, L&^(1<> uint(i) & 1\n\t}\n\tif e == N {\n\t\tfmt.Printf(\"%d %d\\n\", N+2, 2*(N+1))\n\t\tfor i := 0; i <= N; i++ {\n\t\t\tfmt.Printf(\"%d %d 0\\n\", i+1, i+2)\n\t\t\tfmt.Printf(\"%d %d %d\\n\", i+1, i+2, 1<>uint(N-i-1)&1 == 1 {\n\t\t\tfmt.Printf(\"%d %d %d\\n\", 0, i+2, L&^(1< 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 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\nfunc printInts(out []int, str string) {\n\tvar bb bytes.Buffer\n\tfor i := range out {\n\t\tbb.WriteString(strconv.Itoa(out[i]))\n\t\tbb.WriteString(str)\n\t}\n\tfmt.Println(bb.String())\n}\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 nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1535860314, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03268.html", "problem_id": "p03268", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03268/input.txt", "sample_output_relpath": "derived/input_output/data/p03268/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03268/Go/s330040707.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s330040707", "user_id": "u696272993"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nvar dr = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}\nvar dc = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnextReader = NewScanner()\n\tN := nextInt()\n\tK := nextInt()\n\tcnt := 0\n\tfor a := 1; a <= N; a++ {\n\t\tle := a % K\n\t\tless := (K - le) % K\n\t\tsz := (N + less) / K\n\t\tif (less+less)%K == 0 {\n\t\t\tcnt += sz * sz\n\t\t}\n\t}\n\tfmt.Println(cnt)\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}\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 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\nfunc printInts(out []int, str string) {\n\tvar bb bytes.Buffer\n\tfor i := range out {\n\t\tbb.WriteString(strconv.Itoa(out[i]))\n\t\tbb.WriteString(str)\n\t}\n\tfmt.Println(bb.String())\n}\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 nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\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": "p03268", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1779, "cpu_time_ms": 10, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s741519583", "group_id": "codeNet:p03272", "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\ti := getInt()\n\n\tfmt.Println(N-i+1)\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": 1587331789, "filename_ext": "go", "original_language": "Go (1.6)", "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/s741519583.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s741519583", "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\ti := getInt()\n\n\tfmt.Println(N-i+1)\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\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "sample_input": "4 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03272", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5064, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s056862850", "group_id": "codeNet:p03273", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\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 main() {\n\tdefer out.Flush()\n\n\th := nextInt()\n\tw := nextInt()\n\tas := make([]string, h)\n\tfor i := int64(0); i < h; i ++ {\n\t\tas[i] = next()\n\t}\n\n\taas := make([]string, 0, h)\n\tws := make([]bool, w)\n\tfor _, a := range(as) {\n\t\tif !strings.Contains(a, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\taas = append(aas, a)\n\t\tfor x, c := range(a) {\n\t\t\tws[x] = ws[x] || c == '#'\n\t\t}\n\t}\n\n\tfor _, a := range(aas) {\n\t\tfor x, c := range(a) {\n\t\t\tif ! ws[x] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Fprintf(out, \"%c\", c)\n\t\t}\n\t\tfmt.Fprintln(out)\n\t}\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": 1595788532, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03273.html", "problem_id": "p03273", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03273/input.txt", "sample_output_relpath": "derived/input_output/data/p03273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03273/Go/s056862850.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s056862850", "user_id": "u478530879"}, "prompt_components": {"gold_output": "###\n###\n.##\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\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 main() {\n\tdefer out.Flush()\n\n\th := nextInt()\n\tw := nextInt()\n\tas := make([]string, h)\n\tfor i := int64(0); i < h; i ++ {\n\t\tas[i] = next()\n\t}\n\n\taas := make([]string, 0, h)\n\tws := make([]bool, w)\n\tfor _, a := range(as) {\n\t\tif !strings.Contains(a, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\taas = append(aas, a)\n\t\tfor x, c := range(a) {\n\t\t\tws[x] = ws[x] || c == '#'\n\t\t}\n\t}\n\n\tfor _, a := range(aas) {\n\t\tfor x, c := range(a) {\n\t\t\tif ! ws[x] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Fprintf(out, \"%c\", c)\n\t\t}\n\t\tfmt.Fprintln(out)\n\t}\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\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "sample_input": "4 4\n##.#\n....\n##.#\n.#.#\n"}, "reference_outputs": ["###\n###\n.##\n"], "source_document_id": "p03273", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2357, "cpu_time_ms": 9, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s019884682", "group_id": "codeNet:p03273", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var h, w int \n fmt.Scan(&h, &w)\n res := make([]string, 0)\n for i := 0; i < h; i++ {\n var s string \n fmt.Scan(&s)\n for j := 0; j < w; j++ {\n if s[j] == '#' {\n res = append(res, s)\n break\n }\n }\n }\n h = len(res)\n res2 := make([]string, 0)\n for j := 0; j < w; j++ {\n s := \"\"\n for i := 0; i < h; i++ {\n s += string(res[i][j])\n }\n for i := 0; i < h; i++ {\n if s[i] == '#' {\n res2 = append(res2, s)\n break\n }\n }\n }\n w = len(res2)\n for j := 0; j < h; j++ {\n for i := 0; i < w; i++ {\n fmt.Print(string(res2[i][j]))\n }\n fmt.Print(\"\\n\")\n }\n}", "language": "Go", "metadata": {"date": 1588045840, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03273.html", "problem_id": "p03273", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03273/input.txt", "sample_output_relpath": "derived/input_output/data/p03273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03273/Go/s019884682.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s019884682", "user_id": "u254871849"}, "prompt_components": {"gold_output": "###\n###\n.##\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var h, w int \n fmt.Scan(&h, &w)\n res := make([]string, 0)\n for i := 0; i < h; i++ {\n var s string \n fmt.Scan(&s)\n for j := 0; j < w; j++ {\n if s[j] == '#' {\n res = append(res, s)\n break\n }\n }\n }\n h = len(res)\n res2 := make([]string, 0)\n for j := 0; j < w; j++ {\n s := \"\"\n for i := 0; i < h; i++ {\n s += string(res[i][j])\n }\n for i := 0; i < h; i++ {\n if s[i] == '#' {\n res2 = append(res2, s)\n break\n }\n }\n }\n w = len(res2)\n for j := 0; j < h; j++ {\n for i := 0; i < w; i++ {\n fmt.Print(string(res2[i][j]))\n }\n fmt.Print(\"\\n\")\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "sample_input": "4 4\n##.#\n....\n##.#\n.#.#\n"}, "reference_outputs": ["###\n###\n.##\n"], "source_document_id": "p03273", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 685, "cpu_time_ms": 31, "memory_kb": 1408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s542048429", "group_id": "codeNet:p03273", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt() int {\n\tvar n int\n\tfmt.Scan(&n)\n\treturn n\n}\n\nfunc ReadIntF(f io.Reader) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadIntsF(f io.Reader, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadWord(f io.Reader) string {\n\tvar str string\n\tfmt.Scan(&str)\n\treturn str\n}\n\nfunc ReadWordF(f io.Reader) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\treturn str\n}\n\nfunc ReadLine() string {\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLineF(f io.Reader) string {\n\tr := bufio.NewReader(f)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLines(n int) []string {\n\tr := bufio.NewReader(os.Stdin)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\n\nfunc ReadLinesF(f io.Reader, n int) []string {\n\tr := bufio.NewReader(f)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\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}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc AllComb(n int) [][]int {\n\tn2 := 1 << uint(n)\n\tret := make([][]int, n2)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tret[i] = pat\n\t}\n\treturn ret\n}\n\nfunc AllCombChan(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\nfunc PermuteInts(nums []int) [][]int {\n\tn := Factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermuteInts(nums, &ret)\n\treturn ret\n}\n\nfunc permuteInts(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\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}\n\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n\n// }}}\n\nfunc main() {\n\th, w := ReadInt(), ReadInt()\n\n\tg := make([][]string, h)\n\tvar s string\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&s)\n\t\tg[i] = make([]string, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tg[i][j] = string(s[j])\n\t\t}\n\t}\n\n\tvar r, c []int\n\tfor i := 0; i < h; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif g[i][j] != \".\" {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tr = append(r, i)\n\t\t}\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif g[j][i] != \".\" {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tc = append(c, i)\n\t\t}\n\t}\n\n\tfor _, i := range r {\n\t\tfor _, j := range c {\n\t\t\tfmt.Print(g[i][j])\n\t\t}\n\t\tfmt.Println(\"\")\n\t}\n}", "language": "Go", "metadata": {"date": 1555035500, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03273.html", "problem_id": "p03273", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03273/input.txt", "sample_output_relpath": "derived/input_output/data/p03273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03273/Go/s542048429.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s542048429", "user_id": "u700477434"}, "prompt_components": {"gold_output": "###\n###\n.##\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\"strings\"\n)\n\n// {{{\n// source: https://github.com/raahii/algo\nfunc MaxInts(nums ...int) int {\n\tvar maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal\n}\n\nfunc MaxIntsWithIdx(nums ...int) (int, int) {\n\tvar maxIdx, maxVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e > maxVal {\n\t\t\tmaxIdx = i\n\t\t\tmaxVal = e\n\t\t}\n\t}\n\treturn maxVal, maxIdx\n}\n\nfunc MinInts(nums ...int) int {\n\tvar minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal\n}\n\nfunc MinIntsWithIdx(nums ...int) (int, int) {\n\tvar minIdx, minVal int\n\tfor i, e := range nums {\n\t\tif i == 0 || e < minVal {\n\t\t\tminIdx = i\n\t\t\tminVal = e\n\t\t}\n\t}\n\treturn minVal, minIdx\n}\n\nfunc SumInts(nums []int) int {\n\ts := 0\n\tfor _, v := range nums {\n\t\ts += v\n\t}\n\treturn s\n}\n\nfunc SumInts2d(mat [][]int) int {\n\ts := 0\n\tfor _, nums := range mat {\n\t\tfor _, v := range nums {\n\t\t\ts += v\n\t\t}\n\t}\n\treturn s\n}\n\nfunc ReverseInts(nums []int) []int {\n\trnums := make([]int, len(nums))\n\tfor i := 0; i < len(nums); i++ {\n\t\trnums[len(nums)-1-i] = nums[i]\n\t}\n\treturn rnums\n}\n\nfunc ExtendInts(nums1 []int, nums2 []int) []int {\n\tfor _, v := range nums2 {\n\t\tnums1 = append(nums1, v)\n\t}\n\treturn nums1\n}\n\nfunc Ints2d(n_rows, n_cols int) [][]int {\n\tints := make([][]int, n_rows)\n\tfor i := 0; i < n_rows; i++ {\n\t\tints[i] = make([]int, n_cols)\n\t}\n\treturn ints\n}\n\nfunc StrInts2d(mat [][]int) string {\n\tstr := \"\"\n\tfor i := 0; i < len(mat); i++ {\n\t\tstr += fmt.Sprintf(\"[%d\", mat[i][0])\n\t\tfor j := 1; j < len(mat[0]); j++ {\n\t\t\tstr += fmt.Sprintf(\" %d\", mat[i][j])\n\t\t}\n\t\tstr += \"]\"\n\t\tif i != len(mat)-1 {\n\t\t\tstr += \"\\n\"\n\t\t}\n\t}\n\treturn str\n}\n\nfunc MemsetInts1d(nums []int, val int) {\n\tfor i := range nums {\n\t\tnums[i] = val\n\t}\n}\n\nfunc MemsetInts2d(nums [][]int, val int) {\n\tfor i := range nums {\n\t\tfor j := range nums[i] {\n\t\t\tnums[i][j] = val\n\t\t}\n\t}\n}\n\nfunc ContainsInt(nums []int, num int) bool {\n\tsort.Ints(nums)\n\n\ts, e := 0, len(nums)\n\tfor {\n\t\tif s >= e {\n\t\t\tbreak\n\t\t}\n\n\t\tm := (e + s) / 2\n\t\tif nums[m] == num {\n\t\t\treturn true\n\t\t} else if num > nums[m] {\n\t\t\ts = m + 1\n\t\t} else {\n\t\t\te = m\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc UniqInts(nums []int) []int {\n\tm := make(map[int]struct{}, len(nums))\n\tfor _, n := range nums {\n\t\tm[n] = struct{}{}\n\t}\n\n\tunums := make([]int, 0, len(nums))\n\tfor k, _ := range m {\n\t\tunums = append(unums, k)\n\t}\n\n\treturn unums\n}\n\nfunc ReadInt() int {\n\tvar n int\n\tfmt.Scan(&n)\n\treturn n\n}\n\nfunc ReadIntF(f io.Reader) int {\n\tvar n int\n\tfmt.Fscanf(f, \"%d\", &n)\n\treturn n\n}\n\nfunc ReadInts(n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadIntsF(f io.Reader, n int) []int {\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(f, \"%d\", &nums[i])\n\t}\n\treturn nums\n}\n\nfunc ReadWord(f io.Reader) string {\n\tvar str string\n\tfmt.Scan(&str)\n\treturn str\n}\n\nfunc ReadWordF(f io.Reader) string {\n\tvar str string\n\tfmt.Fscanf(f, \"%s\", &str)\n\treturn str\n}\n\nfunc ReadLine() string {\n\tr := bufio.NewReader(os.Stdin)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLineF(f io.Reader) string {\n\tr := bufio.NewReader(f)\n\tstr, _ := r.ReadString('\\n')\n\tstr = strings.Trim(str, \"\\n\")\n\treturn str\n}\n\nfunc ReadLines(n int) []string {\n\tr := bufio.NewReader(os.Stdin)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\n\nfunc ReadLinesF(f io.Reader, n int) []string {\n\tr := bufio.NewReader(f)\n\tlines := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tlines[i], _ = r.ReadString('\\n')\n\t\tlines[i] = strings.Trim(lines[i], \"\\n\")\n\t}\n\treturn lines\n}\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}\n\nfunc Pow(a, n int) int {\n\tc := 1\n\tfor i := 0; i < n; i++ {\n\t\tc *= a\n\t}\n\treturn c\n}\n\nfunc Abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\n\treturn 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\nfunc AllComb(n int) [][]int {\n\tn2 := 1 << uint(n)\n\tret := make([][]int, n2)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tret[i] = pat\n\t}\n\treturn ret\n}\n\nfunc AllCombChan(n int, c chan []int) {\n\tn2 := 1 << uint(n)\n\n\tfor i := 0; i < n2; i++ {\n\t\tpat := make([]int, n)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tpat[j] = i >> uint(j) & 1\n\t\t}\n\t\tc <- pat\n\t}\n\tclose(c)\n}\n\nfunc PermuteInts(nums []int) [][]int {\n\tn := Factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermuteInts(nums, &ret)\n\treturn ret\n}\n\nfunc permuteInts(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\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}\n\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\n\n// }}}\n\nfunc main() {\n\th, w := ReadInt(), ReadInt()\n\n\tg := make([][]string, h)\n\tvar s string\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&s)\n\t\tg[i] = make([]string, w)\n\t\tfor j := 0; j < w; j++ {\n\t\t\tg[i][j] = string(s[j])\n\t\t}\n\t}\n\n\tvar r, c []int\n\tfor i := 0; i < h; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif g[i][j] != \".\" {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tr = append(r, i)\n\t\t}\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif g[j][i] != \".\" {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\tc = append(c, i)\n\t\t}\n\t}\n\n\tfor _, i := range r {\n\t\tfor _, j := range c {\n\t\t\tfmt.Print(g[i][j])\n\t\t}\n\t\tfmt.Println(\"\")\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "sample_input": "4 4\n##.#\n....\n##.#\n.#.#\n"}, "reference_outputs": ["###\n###\n.##\n"], "source_document_id": "p03273", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a grid of squares with H horizontal rows and W vertical columns.\nThe square at the i-th row from the top and the j-th column from the left is represented as (i, j).\nEach square is black or white.\nThe color of the square is given as an H-by-W matrix (a_{i, j}).\nIf a_{i, j} is ., the square (i, j) is white; if a_{i, j} is #, the square (i, j) is black.\n\nSnuke is compressing this grid.\nHe will do so by repeatedly performing the following operation while there is a row or column that consists only of white squares:\n\nOperation: choose any one row or column that consists only of white squares, remove it and delete the space between the rows or columns.\n\nIt can be shown that the final state of the grid is uniquely determined regardless of what row or column is chosen in each operation.\nFind the final state of the grid.\n\nConstraints\n\n1 \\leq H, W \\leq 100\n\na_{i, j} is . or #.\n\nThere is at least one black square in the whole grid.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\na_{1, 1}...a_{1, W}\n:\na_{H, 1}...a_{H, W}\n\nOutput\n\nPrint the final state of the grid in the same format as input (without the numbers of rows and columns); see the samples for clarity.\n\nSample Input 1\n\n4 4\n##.#\n....\n##.#\n.#.#\n\nSample Output 1\n\n###\n###\n.##\n\nThe second row and the third column in the original grid will be removed.\n\nSample Input 2\n\n3 3\n#..\n.#.\n..#\n\nSample Output 2\n\n#..\n.#.\n..#\n\nAs there is no row or column that consists only of white squares, no operation will be performed.\n\nSample Input 3\n\n4 5\n.....\n.....\n..#..\n.....\n\nSample Output 3\n\n#\n\nSample Input 4\n\n7 6\n......\n....#.\n.#....\n..#...\n..#...\n......\n.#..#.\n\nSample Output 4\n\n..#\n#..\n.#.\n.#.\n#.#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5667, "cpu_time_ms": 28, "memory_kb": 1024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427002895", "group_id": "codeNet:p03274", "input_text": "// きりみんちゃんの配信からきました\n// 左右をとる+-1のしゃくとり、左がマイナスかつ右がプラスの場合には「左に行った後折り返す」vs「右に行ったあと折り返す」が発生する\n// ゼロを含む場合がshit\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tincludeZero := false\n\tfor i := 0; i < n; i++ {\n\t\tvar j int\n\t\tfmt.Scan(&j)\n\t\ta[i] = j\n\t\tif j == 0 {\n\t\t\tincludeZero = true\n\t\t}\n\t}\n\t// あーもうめちゃくちゃだよ\n\tif includeZero {\n\t\tif k > 1 {\n\t\t\tk -= 1\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tans := 10000000000000000\n\tr := 0\n\ttmp := 0\n\tfor l := 0; l <= n-k; l++ {\n\t\tfor r < n && r-l < k {\n\t\t\ttmp += a[r]\n\t\t\tr += 1\n\t\t}\n\t\tif a[l] < 0 {\n\t\t\ttmp = a[l] * -2\n\t\t\ttmp += a[r-1]\n\t\t} else if a[l] > 0 {\n\t\t\ttmp = a[r-1]\n\t\t}\n\t\t// fmt.Println(a[l:r], tmp)\n\t\tans = min(ans, tmp)\n\t\ttmp -= a[l]\n\t}\n\tfmt.Println(ans)\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": 1586665169, "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/s427002895.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s427002895", "user_id": "u445624660"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "// きりみんちゃんの配信からきました\n// 左右をとる+-1のしゃくとり、左がマイナスかつ右がプラスの場合には「左に行った後折り返す」vs「右に行ったあと折り返す」が発生する\n// ゼロを含む場合がshit\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tincludeZero := false\n\tfor i := 0; i < n; i++ {\n\t\tvar j int\n\t\tfmt.Scan(&j)\n\t\ta[i] = j\n\t\tif j == 0 {\n\t\t\tincludeZero = true\n\t\t}\n\t}\n\t// あーもうめちゃくちゃだよ\n\tif includeZero {\n\t\tif k > 1 {\n\t\t\tk -= 1\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tans := 10000000000000000\n\tr := 0\n\ttmp := 0\n\tfor l := 0; l <= n-k; l++ {\n\t\tfor r < n && r-l < k {\n\t\t\ttmp += a[r]\n\t\t\tr += 1\n\t\t}\n\t\tif a[l] < 0 {\n\t\t\ttmp = a[l] * -2\n\t\t\ttmp += a[r-1]\n\t\t} else if a[l] > 0 {\n\t\t\ttmp = a[r-1]\n\t\t}\n\t\t// fmt.Println(a[l:r], tmp)\n\t\tans = min(ans, tmp)\n\t\ttmp -= a[l]\n\t}\n\tfmt.Println(ans)\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\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03274", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 999, "cpu_time_ms": 664, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s265457121", "group_id": "codeNet:p03275", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\ta := []int{}\n\n\tfmt.Scan(&N)\n\tfor i := 0; i < N; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\ta = append(a, tmp)\n\t}\n\n\tfor i := range a {\n\t\tif count(a, a[i]) <= 0 {\n\t\t\tfmt.Println(a[i])\n\t\t\treturn\n\t\t}\n\t}\n}\n\ntype BIT []int\n\nfunc (b BIT) Sum(i int) int {\n\tif i == 0 {\n\t\treturn 0\n\t}\n\treturn b[i] + b.Sum(i-(i&-i))\n}\n\nfunc (b BIT) Add(i, x int) {\n\tif i >= len(b) {\n\t\treturn\n\t}\n\tb[i] += x\n\tb.Add(i+(i&-i), x)\n}\n\nfunc count(a []int, X int) int {\n\tb := BIT(make([]int, len(a)+1, len(a)+1))\n\tfor i, v := range a {\n\t\tif v > X {\n\t\t\tb.Add(i+1, 1)\n\t\t} else {\n\t\t\tb.Add(i+1, -1)\n\t\t}\n\t}\n\n\tret := 0\n\tfor i := range a {\n\t\tif b.Sum(i+1) > 0 {\n\t\t\tret++\n\t\t}\n\t}\n\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1586595141, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03275.html", "problem_id": "p03275", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03275/input.txt", "sample_output_relpath": "derived/input_output/data/p03275/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03275/Go/s265457121.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s265457121", "user_id": "u213575739"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\ta := []int{}\n\n\tfmt.Scan(&N)\n\tfor i := 0; i < N; i++ {\n\t\tvar tmp int\n\t\tfmt.Scan(&tmp)\n\t\ta = append(a, tmp)\n\t}\n\n\tfor i := range a {\n\t\tif count(a, a[i]) <= 0 {\n\t\t\tfmt.Println(a[i])\n\t\t\treturn\n\t\t}\n\t}\n}\n\ntype BIT []int\n\nfunc (b BIT) Sum(i int) int {\n\tif i == 0 {\n\t\treturn 0\n\t}\n\treturn b[i] + b.Sum(i-(i&-i))\n}\n\nfunc (b BIT) Add(i, x int) {\n\tif i >= len(b) {\n\t\treturn\n\t}\n\tb[i] += x\n\tb.Add(i+(i&-i), x)\n}\n\nfunc count(a []int, X int) int {\n\tb := BIT(make([]int, len(a)+1, len(a)+1))\n\tfor i, v := range a {\n\t\tif v > X {\n\t\t\tb.Add(i+1, 1)\n\t\t} else {\n\t\t\tb.Add(i+1, -1)\n\t\t}\n\t}\n\n\tret := 0\n\tfor i := range a {\n\t\tif b.Sum(i+1) > 0 {\n\t\t\tret++\n\t\t}\n\t}\n\n\treturn ret\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "sample_input": "3\n10 30 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03275", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 706, "cpu_time_ms": 2108, "memory_kb": 5888}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s919366578", "group_id": "codeNet:p03276", "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\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() 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 strSprit(str string) []string {\n\tcols := strings.Split(str, \" \")\n\treturn cols\n}\n\nfunc parseInt(str string) int {\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc intSprit(str string) []int {\n\tstrs := strSprit(str)\n\tcols := make([]int, len(strs))\n\tfor i, v := range strs {\n\t\tcols[i] = parseInt(v)\n\t}\n\treturn cols\n}\n\nfunc bitCount(n uint) int {\n\n\tx := uint64(n)\n\n\tconst m = 1<<64 - 1\n\tconst m0 = 0x5555555555555555\n\tconst m1 = 0x3333333333333333\n\tconst m2 = 0x0f0f0f0f0f0f0f0f\n\n\tx = x>>1&(m0&m) + x&(m0&m)\n\tx = x>>2&(m1&m) + x&(m1&m)\n\tx = (x>>4 + x) & (m2 & m)\n\tx += x >> 8\n\tx += x >> 16\n\tx += x >> 32\n\n\treturn int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n\treturn ((n >> uint(i)) & 1) == 1\n}\n\nfunc setBit(d, n int) int {\n\tt := 1 << uint(n)\n\treturn d | t\n}\n\nfunc intAbs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc main() {\n\tline := readBigLine()\n\tspl := intSprit(line)\n\n\tN := spl[0]\n\tK := spl[1]\n\n\tx := intSprit(readBigLine())\n\n\tres := 1 << 30\n\tfor i := 0; i < N-K+1; i++ {\n\t\tl := x[i]\n\t\tr := x[i+K-1]\n\n\t\tlr := intAbs(l) + intAbs(l-r)\n\t\trl := intAbs(r) + intAbs(r-l)\n\n\t\tif res > lr {\n\t\t\tres = lr\n\t\t}\n\t\tif res > rl {\n\t\t\tres = rl\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1551737511, "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/s919366578.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s919366578", "user_id": "u925392563"}, "prompt_components": {"gold_output": "40\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\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() 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 strSprit(str string) []string {\n\tcols := strings.Split(str, \" \")\n\treturn cols\n}\n\nfunc parseInt(str string) int {\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc intSprit(str string) []int {\n\tstrs := strSprit(str)\n\tcols := make([]int, len(strs))\n\tfor i, v := range strs {\n\t\tcols[i] = parseInt(v)\n\t}\n\treturn cols\n}\n\nfunc bitCount(n uint) int {\n\n\tx := uint64(n)\n\n\tconst m = 1<<64 - 1\n\tconst m0 = 0x5555555555555555\n\tconst m1 = 0x3333333333333333\n\tconst m2 = 0x0f0f0f0f0f0f0f0f\n\n\tx = x>>1&(m0&m) + x&(m0&m)\n\tx = x>>2&(m1&m) + x&(m1&m)\n\tx = (x>>4 + x) & (m2 & m)\n\tx += x >> 8\n\tx += x >> 16\n\tx += x >> 32\n\n\treturn int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n\treturn ((n >> uint(i)) & 1) == 1\n}\n\nfunc setBit(d, n int) int {\n\tt := 1 << uint(n)\n\treturn d | t\n}\n\nfunc intAbs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc main() {\n\tline := readBigLine()\n\tspl := intSprit(line)\n\n\tN := spl[0]\n\tK := spl[1]\n\n\tx := intSprit(readBigLine())\n\n\tres := 1 << 30\n\tfor i := 0; i < N-K+1; i++ {\n\t\tl := x[i]\n\t\tr := x[i+K-1]\n\n\t\tlr := intAbs(l) + intAbs(l-r)\n\t\trl := intAbs(r) + intAbs(r-l)\n\n\t\tif res > lr {\n\t\t\tres = lr\n\t\t}\n\t\tif res > rl {\n\t\t\tres = rl\n\t\t}\n\t}\n\tfmt.Println(res)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1846, "cpu_time_ms": 25, "memory_kb": 6400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s051394166", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tfmt.Printf(\"%d\\n\", find(n))\n}\n\nfunc find(n int) int {\n\tvar num int\n\tfor i := 1; i <= n; i++ {\n\t\tif i%2 == 1 && divisorNumIs(i, 8) {\n\t\t\tnum++\n\t\t}\n\t}\n\treturn num\n}\n\nfunc divisorNumIs(n, divisor int) bool {\n\tlife := divisor - 2\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tif n/i == i {\n\t\t\t\tlife--\n\t\t\t} else {\n\t\t\t\tlife -= 2\n\t\t\t}\n\t\t}\n\t\tif life < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn life == 0\n}\n", "language": "Go", "metadata": {"date": 1591151692, "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/s051394166.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s051394166", "user_id": "u623007471"}, "prompt_components": {"gold_output": "1\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\tfmt.Printf(\"%d\\n\", find(n))\n}\n\nfunc find(n int) int {\n\tvar num int\n\tfor i := 1; i <= n; i++ {\n\t\tif i%2 == 1 && divisorNumIs(i, 8) {\n\t\t\tnum++\n\t\t}\n\t}\n\treturn num\n}\n\nfunc divisorNumIs(n, divisor int) bool {\n\tlife := divisor - 2\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tif n/i == i {\n\t\t\t\tlife--\n\t\t\t} else {\n\t\t\t\tlife -= 2\n\t\t\t}\n\t\t}\n\t\tif life < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn life == 0\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s976933532", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tans := 0\n\tfor i := 1; i <= N; i += 2 {\n\t\tc := 0\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tif i%j == 0 {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tif c == 8 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1572336647, "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/s976933532.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976933532", "user_id": "u902409225"}, "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\tans := 0\n\tfor i := 1; i <= N; i += 2 {\n\t\tc := 0\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tif i%j == 0 {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tif c == 8 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s880981840", "group_id": "codeNet:p03281", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n < 104 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tr := 1\n\tfor i := 107; i <= n; i += 2 {\n\t\ty := 1\n\t\tfor j := 3; j <= n; j += 2 {\n\t\t\tif i%j == 0 {\n\t\t\t\ty++\n\t\t\t}\n\t\t}\n\t\tif y == 8 {\n\t\t\tr++\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1534641340, "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/s880981840.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s880981840", "user_id": "u875592584"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n < 104 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tr := 1\n\tfor i := 107; i <= n; i += 2 {\n\t\ty := 1\n\t\tfor j := 3; j <= n; j += 2 {\n\t\t\tif i%j == 0 {\n\t\t\t\ty++\n\t\t\t}\n\t\t}\n\t\tif y == 8 {\n\t\t\tr++\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s911229847", "group_id": "codeNet:p03282", "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\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\ts := scanString(sc)\n\tk := scanInt(sc)\n\tfor i := range s {\n\t\tc := int(s[i] - '0')\n\t\tif c > 1 {\n\t\t\treturn c\n\t\t}\n\t\tif k-1 == i {\n\t\t\treturn c\n\t\t}\n\t}\n\treturn -1\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1593522106, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s911229847.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s911229847", "user_id": "u623007471"}, "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\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\ts := scanString(sc)\n\tk := scanInt(sc)\n\tfor i := range s {\n\t\tc := int(s[i] - '0')\n\t\tif c > 1 {\n\t\t\treturn c\n\t\t}\n\t\tif k-1 == i {\n\t\t\treturn c\n\t\t}\n\t}\n\treturn -1\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1784}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390495490", "group_id": "codeNet:p03283", "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 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, _ := strconv.ParseInt(readString(), 0, 64)\n\t// if 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 eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// ---------------------------------------------------------\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\nfunc main() {\n\tN := readInt()\n\tM := readInt()\n\tQ := readInt()\n\tvar data [510][510]int\n\tfor i := 0; i < M; i++ {\n\t\tl, r := readInt(), readInt()\n\t\tdata[l][r]++\n\t}\n\n\tfor i := N; i >= 1; i-- {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tdata[i][j] += data[i+1][j]\n\t\t\tdata[i][j] += data[i][j-1]\n\t\t\tdata[i][j] -= data[i+1][j-1]\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tp, q := readInt(), readInt()\n\t\tprintln(data[p][q])\n\t}\n\tstdout.Flush()\n}", "language": "Go", "metadata": {"date": 1534667108, "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/s390495490.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390495490", "user_id": "u696272993"}, "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\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\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, _ := strconv.ParseInt(readString(), 0, 64)\n\t// if 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 eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// ---------------------------------------------------------\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\nfunc main() {\n\tN := readInt()\n\tM := readInt()\n\tQ := readInt()\n\tvar data [510][510]int\n\tfor i := 0; i < M; i++ {\n\t\tl, r := readInt(), readInt()\n\t\tdata[l][r]++\n\t}\n\n\tfor i := N; i >= 1; i-- {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tdata[i][j] += data[i+1][j]\n\t\t\tdata[i][j] += data[i][j-1]\n\t\t\tdata[i][j] -= data[i+1][j-1]\n\t\t}\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tp, q := readInt(), readInt()\n\t\tprintln(data[p][q])\n\t}\n\tstdout.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1596, "cpu_time_ms": 110, "memory_kb": 6272}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s423201245", "group_id": "codeNet:p03284", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K, ans int\n\tfmt.Scan(&N, &K)\n\n\tif N%K != 0 {\n\t\tans = 1\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1560273243, "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/s423201245.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s423201245", "user_id": "u879870653"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K, ans int\n\tfmt.Scan(&N, &K)\n\n\tif N%K != 0 {\n\t\tans = 1\n\t}\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s136823227", "group_id": "codeNet:p03286", "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 N int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d\", &N)\n\tfmt.Println(rec(N))\n}\n\nfunc rec(n int) string {\n\tvar str string\n\n\tif n == 0 {\n\t\treturn \"0\"\n\t}\n\tif n == 1 {\n\t\treturn \"1\"\n\t}\n\n\tif n%2 == 0 {\n\t\t// even\n\t\tstr = rec(n/(-2)) + \"0\"\n\t} else {\n\t\t// odd\n\t\tstr = rec((n-1)/(-2)) + \"1\"\n\t}\n\n\treturn str\n}\n", "language": "Go", "metadata": {"date": 1547614291, "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/s136823227.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s136823227", "user_id": "u381572327"}, "prompt_components": {"gold_output": "1011\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 N int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d\", &N)\n\tfmt.Println(rec(N))\n}\n\nfunc rec(n int) string {\n\tvar str string\n\n\tif n == 0 {\n\t\treturn \"0\"\n\t}\n\tif n == 1 {\n\t\treturn \"1\"\n\t}\n\n\tif n%2 == 0 {\n\t\t// even\n\t\tstr = rec(n/(-2)) + \"0\"\n\t} else {\n\t\t// odd\n\t\tstr = rec((n-1)/(-2)) + \"1\"\n\t}\n\n\treturn str\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 409, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s599971651", "group_id": "codeNet:p03289", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tresult := \"WA\"\n\tnowC := 0\n\tif string(s[0]) == \"A\" {\n\t\tcount := 0\n\t\tfor i := 2; i < len(s)-1; i++ {\n\t\t\tif string(s[i]) == \"C\" {\n\t\t\t\tcount++\n\t\t\t\tnowC = i\n\t\t\t}\n\t\t}\n\t\tif count != 1 {\n\t\t\tfmt.Println(\"WA\")\n\t\t\treturn\n\n\t\t}\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[i] > 123 && i != nowC {\n\t\t\t\tresult = \"WA\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tresult = \"AC\"\n\n\t} else {\n\t\tresult = \"WA\"\n\t}\n\tfmt.Println(result)\n\n}\n", "language": "Go", "metadata": {"date": 1589737871, "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/s599971651.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s599971651", "user_id": "u346986631"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tresult := \"WA\"\n\tnowC := 0\n\tif string(s[0]) == \"A\" {\n\t\tcount := 0\n\t\tfor i := 2; i < len(s)-1; i++ {\n\t\t\tif string(s[i]) == \"C\" {\n\t\t\t\tcount++\n\t\t\t\tnowC = i\n\t\t\t}\n\t\t}\n\t\tif count != 1 {\n\t\t\tfmt.Println(\"WA\")\n\t\t\treturn\n\n\t\t}\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[i] > 123 && i != nowC {\n\t\t\t\tresult = \"WA\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tresult = \"AC\"\n\n\t} else {\n\t\tresult = \"WA\"\n\t}\n\tfmt.Println(result)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 463, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s930488362", "group_id": "codeNet:p03289", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\tS := readString()\n\tres := check(S)\n\tif res {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n\nfunc check(S string) (res bool) {\n\tif S[0] != 'A' {\n\t\treturn\n\t}\n\n\tcount := 0\n\tindex := 0\n\tfor i := 2; i <= len(S)-2; i++ {\n\t\tif S[i] == 'C' {\n\t\t\tcount++\n\t\t\tindex = i\n\t\t}\n\t}\n\tif count != 1 {\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(S); i++ {\n\t\tif i == 0 || i == index {\n\t\t\tcontinue\n\t\t}\n\t\tif S[i] >= 65 && S[i] <= 90 {\n\t\t\treturn\n\t\t}\n\t}\n\n\tres = true\n\treturn\n}\n\n/*==========================================\n * Library\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 int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\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) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\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 sum(i []int) int {\n\tsum := 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) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(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 []int) []int {\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 initalize(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": 1583956482, "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/s930488362.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s930488362", "user_id": "u967669872"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\tS := readString()\n\tres := check(S)\n\tif res {\n\t\tfmt.Println(\"AC\")\n\t} else {\n\t\tfmt.Println(\"WA\")\n\t}\n}\n\nfunc check(S string) (res bool) {\n\tif S[0] != 'A' {\n\t\treturn\n\t}\n\n\tcount := 0\n\tindex := 0\n\tfor i := 2; i <= len(S)-2; i++ {\n\t\tif S[i] == 'C' {\n\t\t\tcount++\n\t\t\tindex = i\n\t\t}\n\t}\n\tif count != 1 {\n\t\treturn\n\t}\n\n\tfor i := 0; i < len(S); i++ {\n\t\tif i == 0 || i == index {\n\t\t\tcontinue\n\t\t}\n\t\tif S[i] >= 65 && S[i] <= 90 {\n\t\t\treturn\n\t\t}\n\t}\n\n\tres = true\n\treturn\n}\n\n/*==========================================\n * Library\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 int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\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) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\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 sum(i []int) int {\n\tsum := 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) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(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 []int) []int {\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 initalize(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\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "sample_input": "AtCoder\n"}, "reference_outputs": ["AC\n"], "source_document_id": "p03289", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3928, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013747453", "group_id": "codeNet:p03289", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var s string\n var i int\n fmt.Scan(&s)\n n:=len(s)\n flag:=0\n temp:=0\n for i=0;i=2 && i<=n-2{\n if s[i]=='C'{\n temp++\n flag++\n }else if s[i]>='a' && s[i]<='z'{\n flag++\n }\n }else if s[i]>='a' && s[i]<='z'{\n flag ++\n }\n }\n if flag==n && temp==1{\n fmt.Println(\"AC\")\n }else{\n fmt.Println(\"WA\")\n }\n}\n", "language": "Go", "metadata": {"date": 1576077609, "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/s013747453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013747453", "user_id": "u379136995"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var s string\n var i int\n fmt.Scan(&s)\n n:=len(s)\n flag:=0\n temp:=0\n for i=0;i=2 && i<=n-2{\n if s[i]=='C'{\n temp++\n flag++\n }else if s[i]>='a' && s[i]<='z'{\n flag++\n }\n }else if s[i]>='a' && s[i]<='z'{\n flag ++\n }\n }\n if flag==n && temp==1{\n fmt.Println(\"AC\")\n }else{\n fmt.Println(\"WA\")\n }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s481108366", "group_id": "codeNet:p03289", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var s string\n fmt.Scan(&s)\n if solve(s) {\n fmt.Println(\"AC\")\n } else {\n fmt.Println(\"WA\")\n }\n}\nfunc solve(s string) bool{\n var c byte\n var i,n int\n n = len(s)\n f := false\n for i = 0; i < n; i++ {\n c = s[i]\n if i == 0 && c != 'A' {\n return false;\n }\n if c == 'C' {\n if 2 <= i && i < n-1 {\n if f {\n return false;\n }\n f = true\n } else {\n return false;\n }\n } else if 'A' < c && c <= 'Z'{\n return false;\n }\n }\n return f;\n}\n", "language": "Go", "metadata": {"date": 1576076800, "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/s481108366.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s481108366", "user_id": "u379136995"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var s string\n fmt.Scan(&s)\n if solve(s) {\n fmt.Println(\"AC\")\n } else {\n fmt.Println(\"WA\")\n }\n}\nfunc solve(s string) bool{\n var c byte\n var i,n int\n n = len(s)\n f := false\n for i = 0; i < n; i++ {\n c = s[i]\n if i == 0 && c != 'A' {\n return false;\n }\n if c == 'C' {\n if 2 <= i && i < n-1 {\n if f {\n return false;\n }\n f = true\n } else {\n return false;\n }\n } else if 'A' < c && c <= 'Z'{\n return false;\n }\n }\n return f;\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s838364011", "group_id": "codeNet:p03290", "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\tl := nextLine()\n\ti, e := strconv.Atoi(l)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tD, G, p, c := nextInt(), nextInt(), []int{}, []int{}\n\tfor i := 0; i < D; i++ {\n\t\tp = append(p, nextInt())\n\t\tc = append(c, nextInt())\n\t}\n\n\tfmt.Printf(\"%d\\n\", ABC104C(G, p, c))\n}\n\n// ABC104C ...\nfunc ABC104C(G int, p, c []int) (res int) {\n\tres = 1000\n\tfor bit := 0; bit < (1 << uint(len(c))); bit++ {\n\t\tans, score, solved := 0, 0, map[int]bool{}\n\t\tfor i := 0; i < len(c); i++ {\n\t\t\tif bit>>uint(i)&1 == 1 {\n\t\t\t\tans += p[i]\n\t\t\t\tscore += c[i] + (i+1)*100*p[i]\n\t\t\t\tsolved[i] = true\n\t\t\t}\n\t\t}\n\n\t\tif score < G {\n\t\t\tfor i := len(p) - 1; i >= 0; i-- {\n\t\t\t\t_, ok := solved[i]\n\t\t\t\tif !ok {\n\t\t\t\t\trest := G - score\n\t\t\t\t\tif rest > (i+1)*100*(p[i]-1) {\n\t\t\t\t\t\tans += p[i] - 1\n\t\t\t\t\t\tscore += (i + 1) * 100 * (p[i] - 1)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsolvedhrere := rest / ((i + 1) * 100)\n\t\t\t\t\t\tans += solvedhrere\n\t\t\t\t\t\tscore += (i + 1) * 100 * solvedhrere\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif score >= G && ans < res {\n\t\t\tres = ans\n\t\t}\n\t}\n \n \treturn\n}\n", "language": "Go", "metadata": {"date": 1600736982, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03290/input.txt", "sample_output_relpath": "derived/input_output/data/p03290/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03290/Go/s838364011.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s838364011", "user_id": "u101449855"}, "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 nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tl := nextLine()\n\ti, e := strconv.Atoi(l)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tD, G, p, c := nextInt(), nextInt(), []int{}, []int{}\n\tfor i := 0; i < D; i++ {\n\t\tp = append(p, nextInt())\n\t\tc = append(c, nextInt())\n\t}\n\n\tfmt.Printf(\"%d\\n\", ABC104C(G, p, c))\n}\n\n// ABC104C ...\nfunc ABC104C(G int, p, c []int) (res int) {\n\tres = 1000\n\tfor bit := 0; bit < (1 << uint(len(c))); bit++ {\n\t\tans, score, solved := 0, 0, map[int]bool{}\n\t\tfor i := 0; i < len(c); i++ {\n\t\t\tif bit>>uint(i)&1 == 1 {\n\t\t\t\tans += p[i]\n\t\t\t\tscore += c[i] + (i+1)*100*p[i]\n\t\t\t\tsolved[i] = true\n\t\t\t}\n\t\t}\n\n\t\tif score < G {\n\t\t\tfor i := len(p) - 1; i >= 0; i-- {\n\t\t\t\t_, ok := solved[i]\n\t\t\t\tif !ok {\n\t\t\t\t\trest := G - score\n\t\t\t\t\tif rest > (i+1)*100*(p[i]-1) {\n\t\t\t\t\t\tans += p[i] - 1\n\t\t\t\t\t\tscore += (i + 1) * 100 * (p[i] - 1)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsolvedhrere := rest / ((i + 1) * 100)\n\t\t\t\t\t\tans += solvedhrere\n\t\t\t\t\t\tscore += (i + 1) * 100 * solvedhrere\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif score >= G && ans < res {\n\t\t\tres = ans\n\t\t}\n\t}\n \n \treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "sample_input": "2 700\n3 500\n5 800\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03290", "source_text": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1217, "cpu_time_ms": 6, "memory_kb": 1784}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s636967852", "group_id": "codeNet:p03290", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\tD, G int\n\t\tans = math.MaxInt32\n\t)\n\tfmt.Scan(&D, &G)\n\tp := make([]int, D+10)\n\tc := make([]int, D+10)\n\n\tfor i := 0; i < D; i++ {\n\t\tfmt.Scan(&p[i], &c[i])\n\t}\n\n\tfor bit := 0; bit < (1 << D); bit++ {\n\t\ts, num, max := 0, 0, 0\n\t\tfor i := 0; i < D; i++ {\n\t\t\tif (bit >> i) & 1 == 1 {\n\t\t\t\ts += 100 * (i+1) * p[i] + c[i]\n\t\t\t\tnum += p[i]\n\t\t\t} else {\n\t\t\t\tmax = i\n\t\t\t}\n\t\t}\n\t\tif s < G {\n\t\t\ts1 := 100 * (max + 1)\n\t\t\tneed := (G - s + s1 - 1) / s1\n\t\t\tif need >= p[max] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnum += need\n\t\t}\n\t\tans = int(math.Min(float64(ans), float64(num)))\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593445480, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03290/input.txt", "sample_output_relpath": "derived/input_output/data/p03290/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03290/Go/s636967852.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s636967852", "user_id": "u323255029"}, "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 (\n\t\tD, G int\n\t\tans = math.MaxInt32\n\t)\n\tfmt.Scan(&D, &G)\n\tp := make([]int, D+10)\n\tc := make([]int, D+10)\n\n\tfor i := 0; i < D; i++ {\n\t\tfmt.Scan(&p[i], &c[i])\n\t}\n\n\tfor bit := 0; bit < (1 << D); bit++ {\n\t\ts, num, max := 0, 0, 0\n\t\tfor i := 0; i < D; i++ {\n\t\t\tif (bit >> i) & 1 == 1 {\n\t\t\t\ts += 100 * (i+1) * p[i] + c[i]\n\t\t\t\tnum += p[i]\n\t\t\t} else {\n\t\t\t\tmax = i\n\t\t\t}\n\t\t}\n\t\tif s < G {\n\t\t\ts1 := 100 * (max + 1)\n\t\t\tneed := (G - s + s1 - 1) / s1\n\t\t\tif need >= p[max] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnum += need\n\t\t}\n\t\tans = int(math.Min(float64(ans), float64(num)))\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "sample_input": "2 700\n3 500\n5 800\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03290", "source_text": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 628, "cpu_time_ms": 8, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s596831511", "group_id": "codeNet:p03290", "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 d, g int\nvar P, C []int\n\nfunc main() {\n\td, g = ReadInt(), ReadInt()\n\tfor i := 0; i < d; i++ {\n\t\tp, c := ReadInt(), ReadInt()\n\t\tP = append(P, p)\n\t\tC = append(C, c)\n\t}\n\n\tans := 1001\n\tmaximum := PowInt(2, d)\n\tfor i := 0; i < maximum; i++ {\n\t\tans = Min(ans, sub(i))\n\t}\n\n\tfmt.Println(ans)\n}\n\n// 立っているビットの問題を全問解き、残っている問題で1問あたりの得点が最大のものに手を付けたときのGを超える最小問題数を返す\nfunc sub(bits int) int {\n\tnum := 0\n\tscore := 0\n\tfor i := 0; i < d; i++ {\n\t\tif bits>>uint(i)&1 == 1 {\n\t\t\tnum += P[i]\n\t\t\tscore += P[i]*100*(i+1) + C[i]\n\t\t}\n\t}\n\n\tresidualMaxProblemId := d\n\tfor i := d - 1; i >= 0; i-- {\n\t\tif bits>>uint(i)&1 == 0 {\n\t\t\tresidualMaxProblemId = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif score >= g {\n\t\treturn num\n\t}\n\n\tif residualMaxProblemId == d {\n\t\treturn 1001\n\t}\n\n\tfor i := 1; i <= P[residualMaxProblemId]-1; i++ {\n\t\tscore += (residualMaxProblemId + 1) * 100\n\t\tnum++\n\t\tif score >= g {\n\t\t\treturn num\n\t\t}\n\t}\n\n\treturn 1001\n}\n", "language": "Go", "metadata": {"date": 1547002903, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03290.html", "problem_id": "p03290", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03290/input.txt", "sample_output_relpath": "derived/input_output/data/p03290/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03290/Go/s596831511.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s596831511", "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\"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 d, g int\nvar P, C []int\n\nfunc main() {\n\td, g = ReadInt(), ReadInt()\n\tfor i := 0; i < d; i++ {\n\t\tp, c := ReadInt(), ReadInt()\n\t\tP = append(P, p)\n\t\tC = append(C, c)\n\t}\n\n\tans := 1001\n\tmaximum := PowInt(2, d)\n\tfor i := 0; i < maximum; i++ {\n\t\tans = Min(ans, sub(i))\n\t}\n\n\tfmt.Println(ans)\n}\n\n// 立っているビットの問題を全問解き、残っている問題で1問あたりの得点が最大のものに手を付けたときのGを超える最小問題数を返す\nfunc sub(bits int) int {\n\tnum := 0\n\tscore := 0\n\tfor i := 0; i < d; i++ {\n\t\tif bits>>uint(i)&1 == 1 {\n\t\t\tnum += P[i]\n\t\t\tscore += P[i]*100*(i+1) + C[i]\n\t\t}\n\t}\n\n\tresidualMaxProblemId := d\n\tfor i := d - 1; i >= 0; i-- {\n\t\tif bits>>uint(i)&1 == 0 {\n\t\t\tresidualMaxProblemId = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif score >= g {\n\t\treturn num\n\t}\n\n\tif residualMaxProblemId == d {\n\t\treturn 1001\n\t}\n\n\tfor i := 1; i <= P[residualMaxProblemId]-1; i++ {\n\t\tscore += (residualMaxProblemId + 1) * 100\n\t\tnum++\n\t\tif score >= g {\n\t\t\treturn num\n\t\t}\n\t}\n\n\treturn 1001\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "sample_input": "2 700\n3 500\n5 800\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03290", "source_text": "Score : 300 points\n\nProblem Statement\n\nA programming competition site AtCode provides algorithmic problems.\nEach problem is allocated a score based on its difficulty.\nCurrently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.\nThese p_1 + … + p_D problems are all of the problems available on AtCode.\n\nA user of AtCode has a value called total score.\nThe total score of a user is the sum of the following two elements:\n\nBase score: the sum of the scores of all problems solved by the user.\n\nPerfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).\n\nTakahashi, who is the new user of AtCode, has not solved any problem.\nHis objective is to have a total score of G or more points.\nAt least how many problems does he need to solve for this objective?\n\nConstraints\n\n1 ≤ D ≤ 10\n\n1 ≤ p_i ≤ 100\n\n100 ≤ c_i ≤ 10^6\n\n100 ≤ G\n\nAll values in input are integers.\n\nc_i and G are all multiples of 100.\n\nIt is possible to have a total score of G or more points.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD G\np_1 c_1\n:\np_D c_D\n\nOutput\n\nPrint the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).\n\nSample Input 1\n\n2 700\n3 500\n5 800\n\nSample Output 1\n\n3\n\nIn this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.\n\nOne way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.\n\nSample Input 2\n\n2 2000\n3 500\n5 800\n\nSample Output 2\n\n7\n\nThis case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.\n\nSample Input 3\n\n2 400\n3 500\n5 800\n\nSample Output 3\n\n2\n\nThis case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.\n\nSample Input 4\n\n5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 1000\n\nSample Output 4\n\n66\n\nThere is only one 500-point problem, but the perfect bonus can be earned even in such a case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7204, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s120294381", "group_id": "codeNet:p03293", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype i64 int64\ntype pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\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\tt := S\n\tiscor := false\n\tfor i := 0; i < len(t); i++ {\n\t\tt = string(t[len(S)-1]) + string(t[0:len(S)-1])\n\t\tif T == t {\n\t\t\tiscor = true\n\t\t}\n\t}\n\tif iscor {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\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 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": 1584367666, "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/s120294381.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s120294381", "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\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype i64 int64\ntype pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\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\tt := S\n\tiscor := false\n\tfor i := 0; i < len(t); i++ {\n\t\tt = string(t[len(S)-1]) + string(t[0:len(S)-1])\n\t\tif T == t {\n\t\t\tiscor = true\n\t\t}\n\t}\n\tif iscor {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\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 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\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "sample_input": "kyoto\ntokyo\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03293", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4153, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717379733", "group_id": "codeNet:p03293", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scanln(&s)\n\tfmt.Scanln(&t)\n\ts = strings.Repeat(s, 2)\n\tif strings.Contains(s, t) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1563908225, "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/s717379733.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s717379733", "user_id": "u726630158"}, "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, t string\n\tfmt.Scanln(&s)\n\tfmt.Scanln(&t)\n\ts = strings.Repeat(s, 2)\n\tif strings.Contains(s, t) {\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\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "sample_input": "kyoto\ntokyo\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03293", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 218, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s436887899", "group_id": "codeNet:p03295", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan string\")\n\t}\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan int\")\n\t}\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\tstart int\n\tend int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\t// start -> id map\n\tstartMap := make(map[int]map[int]struct{})\n\t// end -> id map\n\tendMap := make(map[int]map[int]struct{})\n\tidMap := make(map[int]pair)\n\n\t_ = nextInt()\n\tm := nextInt()\n\n\tfor i := 0; i < m; i ++ {\n\t\tstart := nextInt()\n\t\tend := nextInt() - 1\n\t\tif _, ok := startMap[start]; ok {\n\t\t\tstartMap[start][i] = struct{}{}\n\t\t} else {\n\t\t\tstartMap[start] = map[int]struct{}{i: {}}\n\t\t}\n\n\t\tif _, ok := endMap[end]; ok {\n\t\t\tendMap[end][i] = struct{}{}\n\t\t} else {\n\t\t\tendMap[end] = map[int]struct{}{i: {}}\n\t\t}\n\n\t\tidMap[i] = pair{start: start, end: end}\n\t}\n\n\tstartList := make([]int, len(startMap))\n\tvar i int\n\tfor start, _ := range startMap {\n\t\tstartList[i] = start\n\t\ti++\n\t}\n\tsort.Ints(startList)\n\n\tendList := make([]int, len(endMap))\n\ti = 0\n\tfor end, _ := range endMap {\n\t\tendList[i] = end\n\t\ti++\n\t}\n\tsort.Ints(endList)\n\n\tvar count int\n\tvar currentEnd int\n\tfor _, start := range startList {\n\t\tif start <= currentEnd {\n\t\t\tids := startMap[start]\n\t\t\tfor id, _ := range ids {\n\t\t\t\tdelete(idMap, id)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tvar found bool\n\tendloop:\n\t\tfor ; len(endList) > 0; {\n\t\t\tend := endList[0]\n\t\t\tendList = endList[1:]\n\t\t\tids := endMap[end]\n\t\t\tfor id, _ := range ids {\n\t\t\t\tif _, ok := idMap[id]; ok {\n\t\t\t\t\tfound = true\n\t\t\t\t\tcurrentEnd = end\n\t\t\t\t\tbreak endloop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tbreak\n\t\t}\n\n\t\tids := startMap[start]\n\t\tfor id, _ := range ids {\n\t\t\tdelete(idMap, id)\n\t\t}\n\t\tcount++\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1532225903, "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/s436887899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436887899", "user_id": "u775862898"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan string\")\n\t}\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tif !sc.Scan() {\n\t\tpanic(\"failed scan int\")\n\t}\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\tstart int\n\tend int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\t// start -> id map\n\tstartMap := make(map[int]map[int]struct{})\n\t// end -> id map\n\tendMap := make(map[int]map[int]struct{})\n\tidMap := make(map[int]pair)\n\n\t_ = nextInt()\n\tm := nextInt()\n\n\tfor i := 0; i < m; i ++ {\n\t\tstart := nextInt()\n\t\tend := nextInt() - 1\n\t\tif _, ok := startMap[start]; ok {\n\t\t\tstartMap[start][i] = struct{}{}\n\t\t} else {\n\t\t\tstartMap[start] = map[int]struct{}{i: {}}\n\t\t}\n\n\t\tif _, ok := endMap[end]; ok {\n\t\t\tendMap[end][i] = struct{}{}\n\t\t} else {\n\t\t\tendMap[end] = map[int]struct{}{i: {}}\n\t\t}\n\n\t\tidMap[i] = pair{start: start, end: end}\n\t}\n\n\tstartList := make([]int, len(startMap))\n\tvar i int\n\tfor start, _ := range startMap {\n\t\tstartList[i] = start\n\t\ti++\n\t}\n\tsort.Ints(startList)\n\n\tendList := make([]int, len(endMap))\n\ti = 0\n\tfor end, _ := range endMap {\n\t\tendList[i] = end\n\t\ti++\n\t}\n\tsort.Ints(endList)\n\n\tvar count int\n\tvar currentEnd int\n\tfor _, start := range startList {\n\t\tif start <= currentEnd {\n\t\t\tids := startMap[start]\n\t\t\tfor id, _ := range ids {\n\t\t\t\tdelete(idMap, id)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tvar found bool\n\tendloop:\n\t\tfor ; len(endList) > 0; {\n\t\t\tend := endList[0]\n\t\t\tendList = endList[1:]\n\t\t\tids := endMap[end]\n\t\t\tfor id, _ := range ids {\n\t\t\t\tif _, ok := idMap[id]; ok {\n\t\t\t\t\tfound = true\n\t\t\t\t\tcurrentEnd = end\n\t\t\t\t\tbreak endloop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tbreak\n\t\t}\n\n\t\tids := startMap[start]\n\t\tfor id, _ := range ids {\n\t\t\tdelete(idMap, id)\n\t\t}\n\t\tcount++\n\t}\n\n\tfmt.Println(count)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1843, "cpu_time_ms": 395, "memory_kb": 51072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s971051067", "group_id": "codeNet:p03296", "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\tc := 0\n\tans := 0\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt(scanner)\n\t\tc++\n\t\tif i == n-1 || prev != a {\n\t\t\tans += c >> 1\n\t\t\tc = 1\n\t\t}\n\t\tprev = a\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577486708, "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/s971051067.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s971051067", "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\"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\tc := 0\n\tans := 0\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt(scanner)\n\t\tc++\n\t\tif i == n-1 || prev != a {\n\t\t\tans += c >> 1\n\t\t\tc = 1\n\t\t}\n\t\tprev = a\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1355, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s435063159", "group_id": "codeNet:p03302", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b int\n\tfmt.Scan(&a,&b)\n\tif a+b == 15 {\n\t\tfmt.Println(\"+\")\n\t} else if a*b == 15 {\n\t\tfmt.Println(\"*\")\n\t} else {\n\t\tfmt.Println(\"×\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1531248735, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03302.html", "problem_id": "p03302", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03302/input.txt", "sample_output_relpath": "derived/input_output/data/p03302/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03302/Go/s435063159.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s435063159", "user_id": "u066549434"}, "prompt_components": {"gold_output": "+\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 == 15 {\n\t\tfmt.Println(\"+\")\n\t} else if a*b == 15 {\n\t\tfmt.Println(\"*\")\n\t} else {\n\t\tfmt.Println(\"×\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers a and b.\nDetermine if a+b=15 or a\\times b=15 or neither holds.\n\nNote that a+b=15 and a\\times b=15 do not hold at the same time.\n\nConstraints\n\n1 \\leq a,b \\leq 15\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\nIf a+b=15, print +;\nif a\\times b=15, print *;\nif neither holds, print x.\n\nSample Input 1\n\n4 11\n\nSample Output 1\n\n+\n\n4+11=15.\n\nSample Input 2\n\n3 5\n\nSample Output 2\n\n*\n\n3\\times 5=15.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nx\n\n1+1=2 and 1\\times 1=1, neither of which is 15.", "sample_input": "4 11\n"}, "reference_outputs": ["+\n"], "source_document_id": "p03302", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given two integers a and b.\nDetermine if a+b=15 or a\\times b=15 or neither holds.\n\nNote that a+b=15 and a\\times b=15 do not hold at the same time.\n\nConstraints\n\n1 \\leq a,b \\leq 15\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\nIf a+b=15, print +;\nif a\\times b=15, print *;\nif neither holds, print x.\n\nSample Input 1\n\n4 11\n\nSample Output 1\n\n+\n\n4+11=15.\n\nSample Input 2\n\n3 5\n\nSample Output 2\n\n*\n\n3\\times 5=15.\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\nx\n\n1+1=2 and 1\\times 1=1, neither of which is 15.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 184, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s027687308", "group_id": "codeNet:p03306", "input_text": "package main\n\nimport (\n \"bufio\"\n \"container/list\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar g Graph\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,100)}\n n,m := input.Next2Ints()\n g = NewGraph(n)\n for i:=0;i 0 {\n stat,_ := queue.Remove(queue.Front()).(int)\n node := nodes[stat]\n for _,e := range g[stat] {\n other := node.Other(e.s)\n old := nodes[e.to]\n if old.sig == 0 {\n nodes[e.to] = other\n queue.PushBack(e.to)\n continue\n }\n if node.sig == old.sig {\n tmp := node.sig*(e.s-node.x-old.x)\n if tmp <= 0 || tmp%2 != 0 { tmp = -2 }\n tmp /= 2\n if tmp == -1 { fmt.Println(0);return }\n if fix == -1 { fix = tmp;continue }\n if tmp != fix { fmt.Println(0);return }\n } else {\n if other != old { fmt.Println(0);return }\n }\n }\n }\n if fix != -1 {\n for _,node := range nodes {\n if !node.IsOk(fix) { fmt.Println(0);return }\n }\n fmt.Println(1)\n } else {\n min := int64(1)\n max := int64(10000000000000000)\n for _,node := range nodes {\n if node.sig > 0 {\n if min < -node.x+1 { min = -node.x+1 }\n } else {\n if max > node.x-1 { max = node.x-1 }\n }\n }\n if max-min+1 > 0 {\n fmt.Println(max-min+1)\n } else {\n fmt.Println(0)\n }\n }\n}\n\ntype Node struct { x,sig int64 }\nfunc(n Node) IsOk(y int64) bool { return n.x+n.sig*y > 0 }\nfunc(n Node) Other(s int64) Node { return Node{s-n.x,-n.sig} }\n\ntype Edge struct { to int;s int64 }\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 int,s int64) { g.AddEdge(from,Edge{to,s}) }\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) Next2Ints() (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) Next3Ints() (int,int,int64) {\n s := strings.Split(i.NextLine(),\" \")\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.ParseInt(s[2],10,64)\n return x,y,z\n}", "language": "Go", "metadata": {"date": 1562112936, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03306.html", "problem_id": "p03306", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03306/input.txt", "sample_output_relpath": "derived/input_output/data/p03306/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03306/Go/s027687308.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s027687308", "user_id": "u506403362"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"container/list\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar g Graph\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,100)}\n n,m := input.Next2Ints()\n g = NewGraph(n)\n for i:=0;i 0 {\n stat,_ := queue.Remove(queue.Front()).(int)\n node := nodes[stat]\n for _,e := range g[stat] {\n other := node.Other(e.s)\n old := nodes[e.to]\n if old.sig == 0 {\n nodes[e.to] = other\n queue.PushBack(e.to)\n continue\n }\n if node.sig == old.sig {\n tmp := node.sig*(e.s-node.x-old.x)\n if tmp <= 0 || tmp%2 != 0 { tmp = -2 }\n tmp /= 2\n if tmp == -1 { fmt.Println(0);return }\n if fix == -1 { fix = tmp;continue }\n if tmp != fix { fmt.Println(0);return }\n } else {\n if other != old { fmt.Println(0);return }\n }\n }\n }\n if fix != -1 {\n for _,node := range nodes {\n if !node.IsOk(fix) { fmt.Println(0);return }\n }\n fmt.Println(1)\n } else {\n min := int64(1)\n max := int64(10000000000000000)\n for _,node := range nodes {\n if node.sig > 0 {\n if min < -node.x+1 { min = -node.x+1 }\n } else {\n if max > node.x-1 { max = node.x-1 }\n }\n }\n if max-min+1 > 0 {\n fmt.Println(max-min+1)\n } else {\n fmt.Println(0)\n }\n }\n}\n\ntype Node struct { x,sig int64 }\nfunc(n Node) IsOk(y int64) bool { return n.x+n.sig*y > 0 }\nfunc(n Node) Other(s int64) Node { return Node{s-n.x,-n.sig} }\n\ntype Edge struct { to int;s int64 }\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 int,s int64) { g.AddEdge(from,Edge{to,s}) }\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) Next2Ints() (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) Next3Ints() (int,int,int64) {\n s := strings.Split(i.NextLine(),\" \")\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.ParseInt(s[2],10,64)\n return x,y,z\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nKenkoooo found a simple connected graph.\nThe vertices are numbered 1 through n.\nThe i-th edge connects Vertex u_i and v_i, and has a fixed integer s_i.\n\nKenkoooo is trying to write a positive integer in each vertex so that the following condition is satisfied:\n\nFor every edge i, the sum of the positive integers written in Vertex u_i and v_i is equal to s_i.\n\nFind the number of such ways to write positive integers in the vertices.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n1 \\leq m \\leq 10^5\n\n1 \\leq u_i < v_i \\leq n\n\n2 \\leq s_i \\leq 10^9\n\nIf i\\neq j, then u_i \\neq u_j or v_i \\neq v_j.\n\nThe graph is connected.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\nu_1 v_1 s_1\n:\nu_m v_m s_m\n\nOutput\n\nPrint the number of ways to write positive integers in the vertices so that the condition is satisfied.\n\nSample Input 1\n\n3 3\n1 2 3\n2 3 5\n1 3 4\n\nSample Output 1\n\n1\n\nThe condition will be satisfied if we write 1,2 and 3 in vertices 1,2 and 3, respectively.\nThere is no other way to satisfy the condition, so the answer is 1.\n\nSample Input 2\n\n4 3\n1 2 6\n2 3 7\n3 4 5\n\nSample Output 2\n\n3\n\nLet a,b,c and d be the numbers to write in vertices 1,2,3 and 4, respectively.\nThere are three quadruples (a,b,c,d) that satisfy the condition:\n\n(a,b,c,d)=(1,5,2,3)\n\n(a,b,c,d)=(2,4,3,2)\n\n(a,b,c,d)=(3,3,4,1)\n\nSample Input 3\n\n8 7\n1 2 1000000000\n2 3 2\n3 4 1000000000\n4 5 2\n5 6 1000000000\n6 7 2\n7 8 1000000000\n\nSample Output 3\n\n0", "sample_input": "3 3\n1 2 3\n2 3 5\n1 3 4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03306", "source_text": "Score : 600 points\n\nProblem Statement\n\nKenkoooo found a simple connected graph.\nThe vertices are numbered 1 through n.\nThe i-th edge connects Vertex u_i and v_i, and has a fixed integer s_i.\n\nKenkoooo is trying to write a positive integer in each vertex so that the following condition is satisfied:\n\nFor every edge i, the sum of the positive integers written in Vertex u_i and v_i is equal to s_i.\n\nFind the number of such ways to write positive integers in the vertices.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\n1 \\leq m \\leq 10^5\n\n1 \\leq u_i < v_i \\leq n\n\n2 \\leq s_i \\leq 10^9\n\nIf i\\neq j, then u_i \\neq u_j or v_i \\neq v_j.\n\nThe graph is connected.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn m\nu_1 v_1 s_1\n:\nu_m v_m s_m\n\nOutput\n\nPrint the number of ways to write positive integers in the vertices so that the condition is satisfied.\n\nSample Input 1\n\n3 3\n1 2 3\n2 3 5\n1 3 4\n\nSample Output 1\n\n1\n\nThe condition will be satisfied if we write 1,2 and 3 in vertices 1,2 and 3, respectively.\nThere is no other way to satisfy the condition, so the answer is 1.\n\nSample Input 2\n\n4 3\n1 2 6\n2 3 7\n3 4 5\n\nSample Output 2\n\n3\n\nLet a,b,c and d be the numbers to write in vertices 1,2,3 and 4, respectively.\nThere are three quadruples (a,b,c,d) that satisfy the condition:\n\n(a,b,c,d)=(1,5,2,3)\n\n(a,b,c,d)=(2,4,3,2)\n\n(a,b,c,d)=(3,3,4,1)\n\nSample Input 3\n\n8 7\n1 2 1000000000\n2 3 2\n3 4 1000000000\n4 5 2\n5 6 1000000000\n6 7 2\n7 8 1000000000\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2582, "cpu_time_ms": 155, "memory_kb": 15616}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s940236655", "group_id": "codeNet:p03307", "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\tif n%2 == 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tfmt.Println(2 * n)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1546839243, "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/s940236655.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s940236655", "user_id": "u103600314"}, "prompt_components": {"gold_output": "6\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\tif n%2 == 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tfmt.Println(2 * n)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6307, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s880016429", "group_id": "codeNet:p03308", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc newLine() 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 main() {\n var N int \n var A []int \n\n sc.Split(bufio.ScanWords)\n\n // n枚を変数にする\n fmt.Scanf(\"%d\", &N)\n // カードをarrayに落とし込む\n for i := 1; i <= N; i++ {\n A = append(A, newLine())\n }\n\n // sort\n //sort.Ints(a)\n sort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n fmt.Println(A[0] - A[N-1])\n}", "language": "Go", "metadata": {"date": 1589235590, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03308.html", "problem_id": "p03308", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03308/input.txt", "sample_output_relpath": "derived/input_output/data/p03308/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03308/Go/s880016429.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s880016429", "user_id": "u006371663"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc newLine() 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 main() {\n var N int \n var A []int \n\n sc.Split(bufio.ScanWords)\n\n // n枚を変数にする\n fmt.Scanf(\"%d\", &N)\n // カードをarrayに落とし込む\n for i := 1; i <= N; i++ {\n A = append(A, newLine())\n }\n\n // sort\n //sort.Ints(a)\n sort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n fmt.Println(A[0] - A[N-1])\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "sample_input": "4\n1 4 6 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03308", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 550, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614419324", "group_id": "codeNet:p03309", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc median(vs []int) int {\n\tsort.Ints(vs)\n\treturn vs[len(vs)/2]\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc score(vs []int, b int) int {\n\tsum := 0\n\tfor i, v := range vs {\n\t\tsum += abs(v - (b + i + 1))\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tas := make([]int, N)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t}\n\n\tbs := make([]int, N)\n\tfor i := range bs {\n\t\tbs[i] = as[i] - i - 1\n\t}\n\tb := median(bs)\n\n\tfmt.Println(score(as, b))\n}\n", "language": "Go", "metadata": {"date": 1549232990, "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/s614419324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614419324", "user_id": "u113872560"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc median(vs []int) int {\n\tsort.Ints(vs)\n\treturn vs[len(vs)/2]\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc score(vs []int, b int) int {\n\tsum := 0\n\tfor i, v := range vs {\n\t\tsum += abs(v - (b + i + 1))\n\t}\n\treturn sum\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tas := make([]int, N)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t}\n\n\tbs := make([]int, N)\n\tfor i := range bs {\n\t\tbs[i] = as[i] - i - 1\n\t}\n\tb := median(bs)\n\n\tfmt.Println(score(as, b))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 509, "cpu_time_ms": 1395, "memory_kb": 6656}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750245038", "group_id": "codeNet:p03309", "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}\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\n\nfunc getSum(a []int64, start, end int) int64 {\n\tans := a[end-1]\n\tif start != 0 {\n\t\tans -= a[start-1]\n\t}\n\treturn ans\n}\n\nfunc renew(a []int64, start, prev, end int) int {\n\ti := prev\n\tfor i < len(a) {\n\t\tlv := getSum(a, start, i)\n\t\trv := getSum(a, i, end)\n\t\tj := i + 1\n\t\tnlv := getSum(a, start, j)\n\t\tnrv := getSum(a, j, end)\n\t\tif absInt64(lv-rv) < absInt64(nlv-nrv) {\n\t\t\tbreak\n\t\t}\n\t\ti = j\n\t}\n\treturn i\n}\n\nfunc calc(a []int64, b, c, d, e int) int64 {\n\tvar min, max int64\n\tmin = getSum(a, b, c)\n\tmax = min\n\tfor _, v := range []int64{getSum(a, c, d), getSum(a, d, e), getSum(a, e, len(a))} {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max - min\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\ta := make([]int64, n)\n\ta[0] = readInt64()\n\tfor i := 1; i < n; i++ {\n\t\ta[i] = readInt64() + a[i-1]\n\t}\n\n\tb := 0\n\tc := 1\n\td := 2\n\te := renew(a, 2, 3, n)\n\tmin := calc(a, b, c, d, e)\n\tfor d < n-1 {\n\t\td++\n\t\tc := renew(a, b, c, d)\n\t\te := renew(a, d, e, n)\n\t\tmin = minInt64(min, calc(a, b, c, d, e))\n\t}\n\tprintln(min)\n}\n", "language": "Go", "metadata": {"date": 1530637076, "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/s750245038.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s750245038", "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}\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\n\nfunc getSum(a []int64, start, end int) int64 {\n\tans := a[end-1]\n\tif start != 0 {\n\t\tans -= a[start-1]\n\t}\n\treturn ans\n}\n\nfunc renew(a []int64, start, prev, end int) int {\n\ti := prev\n\tfor i < len(a) {\n\t\tlv := getSum(a, start, i)\n\t\trv := getSum(a, i, end)\n\t\tj := i + 1\n\t\tnlv := getSum(a, start, j)\n\t\tnrv := getSum(a, j, end)\n\t\tif absInt64(lv-rv) < absInt64(nlv-nrv) {\n\t\t\tbreak\n\t\t}\n\t\ti = j\n\t}\n\treturn i\n}\n\nfunc calc(a []int64, b, c, d, e int) int64 {\n\tvar min, max int64\n\tmin = getSum(a, b, c)\n\tmax = min\n\tfor _, v := range []int64{getSum(a, c, d), getSum(a, d, e), getSum(a, e, len(a))} {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max - min\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tn := readInt()\n\ta := make([]int64, n)\n\ta[0] = readInt64()\n\tfor i := 1; i < n; i++ {\n\t\ta[i] = readInt64() + a[i-1]\n\t}\n\n\tb := 0\n\tc := 1\n\td := 2\n\te := renew(a, 2, 3, n)\n\tmin := calc(a, b, c, d, e)\n\tfor d < n-1 {\n\t\td++\n\t\tc := renew(a, b, c, d)\n\t\te := renew(a, d, e, n)\n\t\tmin = minInt64(min, calc(a, b, c, d, e))\n\t}\n\tprintln(min)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2860, "cpu_time_ms": 2107, "memory_kb": 4864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s807184014", "group_id": "codeNet:p03309", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc qs(A []int, n int, k int) int {\n\ti, j, l, pivot := 0, 0, 0, A[k/2]\n\tfor ; i+l < n; i++ {\n\t\tif A[i] < pivot {\n\t\t\tA[j], A[i] = A[i], A[j]\n\t\t\tj++\n\t\t} else if A[i] > pivot {\n\t\t\tA[n-l-1], A[i] = A[i], A[n-l-1]\n\t\t\ti--\n\t\t\tl++\n\t\t}\n\t}\n\n\tif k < j {\n\t\treturn qs(A, j, k)\n\t} else if n-l <= k {\n\t\treturn qs(A[n-l:], l, k-n+l)\n\t} else {\n\t\treturn pivot\n\t}\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\tmid := qs(A, N, (N+1)/2)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tsub := A[i] - mid\n\t\tif sub >= 0 {\n\t\t\tans += sub\n\t\t} else {\n\t\t\tans -= sub\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1530496556, "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/s807184014.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s807184014", "user_id": "u014272610"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc qs(A []int, n int, k int) int {\n\ti, j, l, pivot := 0, 0, 0, A[k/2]\n\tfor ; i+l < n; i++ {\n\t\tif A[i] < pivot {\n\t\t\tA[j], A[i] = A[i], A[j]\n\t\t\tj++\n\t\t} else if A[i] > pivot {\n\t\t\tA[n-l-1], A[i] = A[i], A[n-l-1]\n\t\t\ti--\n\t\t\tl++\n\t\t}\n\t}\n\n\tif k < j {\n\t\treturn qs(A, j, k)\n\t} else if n-l <= k {\n\t\treturn qs(A[n-l:], l, k-n+l)\n\t} else {\n\t\treturn pivot\n\t}\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\tmid := qs(A, N, (N+1)/2)\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tsub := A[i] - mid\n\t\tif sub >= 0 {\n\t\t\tans += sub\n\t\t} else {\n\t\t\tans -= sub\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n\treturn\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 683, "cpu_time_ms": 2108, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497130296", "group_id": "codeNet:p03309", "input_text": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t} else {\n\t\treturn n\n\t}\n}\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\t\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tA := strings.Split(sc.Text(), \" \")\n\n\tmin := 1000000000\n\tfor b := N - 1000; b < N + 1000; b++ {\n\t\tsum := 0\n\t\tfor i, str := range A {\n\t\t\ttmp, _ := strconv.Atoi(str)\n\t\t\tsum += abs(tmp - (b + (i + 1)))\n\t\t}\n\t\tif min > sum {\n\t\t\tmin = sum\n\t\t}\n\t}\n\tfmt.Println(min)\n}", "language": "Go", "metadata": {"date": 1530496133, "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/s497130296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s497130296", "user_id": "u888275483"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t} else {\n\t\treturn n\n\t}\n}\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\t\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tA := strings.Split(sc.Text(), \" \")\n\n\tmin := 1000000000\n\tfor b := N - 1000; b < N + 1000; b++ {\n\t\tsum := 0\n\t\tfor i, str := range A {\n\t\t\ttmp, _ := strconv.Atoi(str)\n\t\t\tsum += abs(tmp - (b + (i + 1)))\n\t\t}\n\t\tif min > sum {\n\t\t\tmin = sum\n\t\t}\n\t}\n\tfmt.Println(min)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "sample_input": "5\n2 2 3 5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03309", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 509, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s888957660", "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 int64 = math.MaxInt64\n\tfor i := int64(avg - 100); i < int64(avg+100); i++ {\n\t\tsum := int64(0)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tsum += abs(a[j] - i)\n\t\t}\n\t\tif sum < ans {\n\t\t\tans = sum\n\t\t}\n\t}\n\n\tprintln(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1530493071, "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/s888957660.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s888957660", "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 int64 = math.MaxInt64\n\tfor i := int64(avg - 100); i < int64(avg+100); i++ {\n\t\tsum := int64(0)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tsum += abs(a[j] - i)\n\t\t}\n\t\tif sum < ans {\n\t\t\tans = sum\n\t\t}\n\t}\n\n\tprintln(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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2147, "cpu_time_ms": 244, "memory_kb": 5376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117440030", "group_id": "codeNet:p03311", "input_text": "// サンプル4がなければ解けなかった\n// b=0としたら順に(1-1)+(1-2)+(1-3)+(1-4)+(2-5)+(3-6)+(4-7)で\n// 0 -1 -2 -3 -3 -3 -3 となりこの最も多い-3をbで潰せばいけるのでは? -> いけました\n// -> なんか実装がうまくいかない感じで8WA\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype KV struct {\n\tKey, Value int\n}\n\ntype KVS []KV\n\nfunc (kvs KVS) Len() int {\n\treturn len(kvs)\n}\n\nfunc (kvs KVS) Swap(i, j int) {\n\tkvs[i], kvs[j] = kvs[j], kvs[i]\n}\n\nfunc (kvs KVS) Less(i, j int) bool {\n\tif kvs[i].Value == kvs[j].Value {\n\t\treturn kvs[i].Key < kvs[j].Key\n\t}\n\treturn kvs[i].Value > kvs[j].Value\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tT := make(map[int]int)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tx := V - (i + 1)\n\t\tT[x]++\n\t\tA[i] = V\n\t}\n\tkvss := make(KVS, len(T))\n\tidx := 0\n\tfor k, v := range T {\n\t\tkvss[idx] = KV{Key: k, Value: v}\n\t\tidx++\n\t}\n\tsort.Sort(kvss)\n\tmaxK := kvss[0].Key\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans += abs(A[i] - (maxK + i + 1))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx *= -1\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1590007965, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03311.html", "problem_id": "p03311", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03311/input.txt", "sample_output_relpath": "derived/input_output/data/p03311/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03311/Go/s117440030.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117440030", "user_id": "u445624660"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// サンプル4がなければ解けなかった\n// b=0としたら順に(1-1)+(1-2)+(1-3)+(1-4)+(2-5)+(3-6)+(4-7)で\n// 0 -1 -2 -3 -3 -3 -3 となりこの最も多い-3をbで潰せばいけるのでは? -> いけました\n// -> なんか実装がうまくいかない感じで8WA\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype KV struct {\n\tKey, Value int\n}\n\ntype KVS []KV\n\nfunc (kvs KVS) Len() int {\n\treturn len(kvs)\n}\n\nfunc (kvs KVS) Swap(i, j int) {\n\tkvs[i], kvs[j] = kvs[j], kvs[i]\n}\n\nfunc (kvs KVS) Less(i, j int) bool {\n\tif kvs[i].Value == kvs[j].Value {\n\t\treturn kvs[i].Key < kvs[j].Key\n\t}\n\treturn kvs[i].Value > kvs[j].Value\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tT := make(map[int]int)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tx := V - (i + 1)\n\t\tT[x]++\n\t\tA[i] = V\n\t}\n\tkvss := make(KVS, len(T))\n\tidx := 0\n\tfor k, v := range T {\n\t\tkvss[idx] = KV{Key: k, Value: v}\n\t\tidx++\n\t}\n\tsort.Sort(kvss)\n\tmaxK := kvss[0].Key\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans += abs(A[i] - (maxK + i + 1))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx *= -1\n\t}\n\treturn x\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": "p03311", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1117, "cpu_time_ms": 1538, "memory_kb": 20864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s866313012", "group_id": "codeNet:p03315", "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\tsymbols := strings.Split(s, \"\")\n\n\tnum := 0\n\tfor _, v := range symbols {\n\t\tif v == \"+\" {\n\t\t\tnum++\n\t\t} else {\n\t\t\tnum--\n\t\t}\n\t}\n\tfmt.Println(num)\n}\n", "language": "Go", "metadata": {"date": 1587473198, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03315.html", "problem_id": "p03315", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03315/input.txt", "sample_output_relpath": "derived/input_output/data/p03315/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03315/Go/s866313012.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s866313012", "user_id": "u620351704"}, "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 s string\n\tfmt.Scan(&s)\n\tsymbols := strings.Split(s, \"\")\n\n\tnum := 0\n\tfor _, v := range symbols {\n\t\tif v == \"+\" {\n\t\t\tnum++\n\t\t} else {\n\t\t\tnum--\n\t\t}\n\t}\n\tfmt.Println(num)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "sample_input": "+-++\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03315", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 231, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063523683", "group_id": "codeNet:p03315", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\nvar s string\n var n int =0\n fmt.Scanf(\"%s\",&s)\n for _,v :=range s{\n if string(v)==\"+\" {\n n=n+1\n } else {\n n=n-1\n }\n }\n fmt.Println(n)\n \n}", "language": "Go", "metadata": {"date": 1576604799, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03315.html", "problem_id": "p03315", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03315/input.txt", "sample_output_relpath": "derived/input_output/data/p03315/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03315/Go/s063523683.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s063523683", "user_id": "u075155299"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\nvar s string\n var n int =0\n fmt.Scanf(\"%s\",&s)\n for _,v :=range s{\n if string(v)==\"+\" {\n n=n+1\n } else {\n n=n-1\n }\n }\n fmt.Println(n)\n \n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "sample_input": "+-++\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03315", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is always an integer in Takahashi's mind.\n\nInitially, the integer in Takahashi's mind is 0. Takahashi is now going to eat four symbols, each of which is + or -. When he eats +, the integer in his mind increases by 1; when he eats -, the integer in his mind decreases by 1.\n\nThe symbols Takahashi is going to eat are given to you as a string S. The i-th character in S is the i-th symbol for him to eat.\n\nFind the integer in Takahashi's mind after he eats all the symbols.\n\nConstraints\n\nThe length of S is 4.\n\nEach character in S is + or -.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the integer in Takahashi's mind after he eats all the symbols.\n\nSample Input 1\n\n+-++\n\nSample Output 1\n\n2\n\nInitially, the integer in Takahashi's mind is 0.\n\nThe first integer for him to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe second integer to eat is -. After eating it, the integer in his mind becomes 0.\n\nThe third integer to eat is +. After eating it, the integer in his mind becomes 1.\n\nThe fourth integer to eat is +. After eating it, the integer in his mind becomes 2.\n\nThus, the integer in Takahashi's mind after he eats all the symbols is 2.\n\nSample Input 2\n\n-+--\n\nSample Output 2\n\n-2\n\nSample Input 3\n\n----\n\nSample Output 3\n\n-4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 199, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110367697", "group_id": "codeNet:p03316", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nfunc main(){\n\tvar s string\n\tlen := utf8.RuneCountInString(s)\n\tfmt.Scanf(\"%s\",&s)\n\tsl := make([]string,len)\n\tsl = strings.Split(s,\"\")\n\tsum := 0\n\tinput, _ := strconv.Atoi(s)\n\tfor i := range sl {\n\t\ta, _ := strconv.Atoi(sl[i])\n\t\tsum = sum + a\n\t}\n\tvar ans string\n\tif (input % sum) == 0 {\n\t\tans = \"Yes\"\n\t\t} else {\n\t\tans = \"No\"\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1529804790, "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/s110367697.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s110367697", "user_id": "u066549434"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nfunc main(){\n\tvar s string\n\tlen := utf8.RuneCountInString(s)\n\tfmt.Scanf(\"%s\",&s)\n\tsl := make([]string,len)\n\tsl = strings.Split(s,\"\")\n\tsum := 0\n\tinput, _ := strconv.Atoi(s)\n\tfor i := range sl {\n\t\ta, _ := strconv.Atoi(sl[i])\n\t\tsum = sum + a\n\t}\n\tvar ans string\n\tif (input % sum) == 0 {\n\t\tans = \"Yes\"\n\t\t} else {\n\t\tans = \"No\"\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 414, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s347450419", "group_id": "codeNet:p03317", "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\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 solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, k := r.nextInt(), r.nextInt()\n\n\tcnt := 0\n\tif n > 0 {\n\t\tcnt++\n\t\tn -= k\n\t}\n\tfor n > 0 {\n\t\tcnt++\n\t\tn -= k - 1\n\t}\n\n\tfmt.Fprintln(stdout, cnt)\n\n}\n\n", "language": "Go", "metadata": {"date": 1565841484, "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/s347450419.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s347450419", "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\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 solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, k := r.nextInt(), r.nextInt()\n\n\tcnt := 0\n\tif n > 0 {\n\t\tcnt++\n\t\tn -= k\n\t}\n\tfor n > 0 {\n\t\tcnt++\n\t\tn -= k - 1\n\t}\n\n\tfmt.Fprintln(stdout, cnt)\n\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2877, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276479869", "group_id": "codeNet:p03317", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := ri(), ri()\n\n\ta := make([]int, n)\n\tmn := inf\n\tvar mnIdx int\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = ri()\n\t\tif a[i] < mn {\n\t\t\tmn = a[i]\n\t\t\tmnIdx = i\n\t\t}\n\t}\n\n\tcost := 0\n\tl := mnIdx - 1\n\tif l > 0 {\n\t\tcost += l/(k-1) + l%(k-1)\n\t}\n\tr := (n - 1) - mnIdx\n\tif r > 0 {\n\t\tcost += r/(k-1) + r%(k-1)\n\t}\n\n\tfmt.Println(cost)\n}\n", "language": "Go", "metadata": {"date": 1559358614, "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/s276479869.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s276479869", "user_id": "u554269352"}, "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := ri(), ri()\n\n\ta := make([]int, n)\n\tmn := inf\n\tvar mnIdx int\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = ri()\n\t\tif a[i] < mn {\n\t\t\tmn = a[i]\n\t\t\tmnIdx = i\n\t\t}\n\t}\n\n\tcost := 0\n\tl := mnIdx - 1\n\tif l > 0 {\n\t\tcost += l/(k-1) + l%(k-1)\n\t}\n\tr := (n - 1) - mnIdx\n\tif r > 0 {\n\t\tcost += r/(k-1) + r%(k-1)\n\t}\n\n\tfmt.Println(cost)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 587, "cpu_time_ms": 11, "memory_kb": 1408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s802367560", "group_id": "codeNet:p03317", "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 := newIo()\n\tdefer io.Flush()\n\n\tn := io.NextInt()\n\tk := io.NextInt()\n\n\tvar b int\n\tfor i := range make([]struct{}, n) {\n\t\tif io.NextInt() == 1 {\n\t\t\tb = i\n\t\t}\n\t}\n\tans := 0\n\tans += 1 + (b-1)/k\n\tif n != k {\n\t\tans += 1 + (n-b)/k\n\t}\n\tio.Println(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\t_ = io.writer.Flush()\n}\n\nfunc (io *io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, _ := io.reader.ReadLine()\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) NextWord() 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, _ := strconv.Atoi(io.NextWord())\n\treturn i\n}\n\nfunc (io *io) Print(a ...interface{}) {\n\tfmt.Fprint(io.writer, a...)\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", "language": "Go", "metadata": {"date": 1549833234, "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/s802367560.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s802367560", "user_id": "u323680411"}, "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\tio := newIo()\n\tdefer io.Flush()\n\n\tn := io.NextInt()\n\tk := io.NextInt()\n\n\tvar b int\n\tfor i := range make([]struct{}, n) {\n\t\tif io.NextInt() == 1 {\n\t\t\tb = i\n\t\t}\n\t}\n\tans := 0\n\tans += 1 + (b-1)/k\n\tif n != k {\n\t\tans += 1 + (n-b)/k\n\t}\n\tio.Println(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\t_ = io.writer.Flush()\n}\n\nfunc (io *io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, _ := io.reader.ReadLine()\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) NextWord() 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, _ := strconv.Atoi(io.NextWord())\n\treturn i\n}\n\nfunc (io *io) Print(a ...interface{}) {\n\tfmt.Fprint(io.writer, a...)\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 23, "memory_kb": 5760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s706686808", "group_id": "codeNet:p03317", "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 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 main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\tk := readInt()\n\ta := make([]int, n)\n\toi := -1\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tif a[i] == 1 {\n\t\t\toi = i\n\t\t}\n\t}\n\n\tif n == k {\n\t\tprintln(1)\n\t\treturn\n\t}\n\tif k >= n/2+1 {\n\t\tprintln(2)\n\t\treturn\n\t}\n\tif oi >= n/2 {\n\t\toi = n - oi - 1\n\t}\n\n\tx := k - 1\n\tln := oi/x + 1\n\tright := n - (ln*x + 1)\n\trn := right / x\n\tif right > rn*x {\n\t\trn++\n\t}\n\tprintln(ln + rn)\n}\n", "language": "Go", "metadata": {"date": 1529804836, "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/s706686808.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s706686808", "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 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 main() {\n\tdefer stdout.Flush()\n\tn := readInt()\n\tk := readInt()\n\ta := make([]int, n)\n\toi := -1\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tif a[i] == 1 {\n\t\t\toi = i\n\t\t}\n\t}\n\n\tif n == k {\n\t\tprintln(1)\n\t\treturn\n\t}\n\tif k >= n/2+1 {\n\t\tprintln(2)\n\t\treturn\n\t}\n\tif oi >= n/2 {\n\t\toi = n - oi - 1\n\t}\n\n\tx := k - 1\n\tln := oi/x + 1\n\tright := n - (ln*x + 1)\n\trn := right / x\n\tif right > rn*x {\n\t\trn++\n\t}\n\tprintln(ln + rn)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1947, "cpu_time_ms": 20, "memory_kb": 2048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s294303935", "group_id": "codeNet:p03318", "input_text": "package main\n\nimport \"fmt\"\n\nfunc pow(n,m int) int{\n\tif m == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * pow(n,m-1)\n\t}\n}\n\nfunc calc(k int) int{\n\ta := k / 9\n\tb := k % 9\n\tans := 0\n\tfor i:=0; i 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 360, "cpu_time_ms": 9, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s125659945", "group_id": "codeNet:p03319", "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\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, k := scanInt(sc), scanInt(sc)\n\tfor i := 0; i < n; i++ {\n\t\t_ = scanInt(sc)\n\t}\n\treturn (n-k+k-2)/(k-1) + 1\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1594569576, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03319.html", "problem_id": "p03319", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03319/input.txt", "sample_output_relpath": "derived/input_output/data/p03319/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03319/Go/s125659945.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s125659945", "user_id": "u623007471"}, "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\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, k := scanInt(sc), scanInt(sc)\n\tfor i := 0; i < n; i++ {\n\t\t_ = scanInt(sc)\n\t}\n\treturn (n-k+k-2)/(k-1) + 1\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}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\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": "p03319", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 18, "memory_kb": 2416}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s245163755", "group_id": "codeNet:p03323", "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 <= 8 && b <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588384761, "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/s245163755.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s245163755", "user_id": "u214033538"}, "prompt_components": {"gold_output": "Yay!\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 <= 8 && b <= 8 {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 160, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s585535690", "group_id": "codeNet:p03323", "input_text": "// Package main provides\n//\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Mon Dec 24 16:15:34 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\n\tif A <= 8 || B <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1545686206, "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/s585535690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s585535690", "user_id": "u802614675"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "// Package main provides\n//\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Mon Dec 24 16:15:34 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scan(&A, &B)\n\n\tif A <= 8 || B <= 8 {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s966029612", "group_id": "codeNet:p03323", "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\ta := next.Int()\n\tb := next.Int()\n\tif a <= 8 && b <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\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": 1529197403, "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/s966029612.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s966029612", "user_id": "u696272993"}, "prompt_components": {"gold_output": "Yay!\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\ta := next.Int()\n\tb := next.Int()\n\tif a <= 8 && b <= 8 {\n\t\tfmt.Println(\"Yay!\")\n\t} else {\n\t\tfmt.Println(\":(\")\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3912, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s740319082", "group_id": "codeNet:p03325", "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor a := ri(); a&1 == 0; a >>= 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1556962860, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03325.html", "problem_id": "p03325", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03325/input.txt", "sample_output_relpath": "derived/input_output/data/p03325/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03325/Go/s740319082.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s740319082", "user_id": "u554269352"}, "prompt_components": {"gold_output": "3\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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn := ri()\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor a := ri(); a&1 == 0; a >>= 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAs AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.\n\nSnuke, an employee, would like to play with this sequence.\n\nSpecifically, he would like to repeat the following operation as many times as possible:\n\nFor every i satisfying 1 \\leq i \\leq N, perform one of the following: \"divide a_i by 2\" and \"multiply a_i by 3\".\nHere, choosing \"multiply a_i by 3\" for every i is not allowed, and the value of a_i after the operation must be an integer.\n\nAt most how many operations can be performed?\n\nConstraints\n\nN is an integer between 1 and 10 \\ 000 (inclusive).\n\na_i is an integer between 1 and 1 \\ 000 \\ 000 \\ 000 (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 the maximum number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n5 2 4\n\nSample Output 1\n\n3\n\nThe sequence is initially {5, 2, 4}. Three operations can be performed as follows:\n\nFirst, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.\n\nNext, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.\n\nFinally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.\n\nSample Input 2\n\n4\n631 577 243 199\n\nSample Output 2\n\n0\n\nNo operation can be performed since all the elements are odd. Thus, the answer is 0.\n\nSample Input 3\n\n10\n2184 2126 1721 1800 1024 2528 3360 1945 1280 1776\n\nSample Output 3\n\n39", "sample_input": "3\n5 2 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03325", "source_text": "Score: 300 points\n\nProblem Statement\n\nAs AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N, a = {a_1, a_2, a_3, ..., a_N}.\n\nSnuke, an employee, would like to play with this sequence.\n\nSpecifically, he would like to repeat the following operation as many times as possible:\n\nFor every i satisfying 1 \\leq i \\leq N, perform one of the following: \"divide a_i by 2\" and \"multiply a_i by 3\".\nHere, choosing \"multiply a_i by 3\" for every i is not allowed, and the value of a_i after the operation must be an integer.\n\nAt most how many operations can be performed?\n\nConstraints\n\nN is an integer between 1 and 10 \\ 000 (inclusive).\n\na_i is an integer between 1 and 1 \\ 000 \\ 000 \\ 000 (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 the maximum number of operations that Snuke can perform.\n\nSample Input 1\n\n3\n5 2 4\n\nSample Output 1\n\n3\n\nThe sequence is initially {5, 2, 4}. Three operations can be performed as follows:\n\nFirst, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {15, 6, 2}.\n\nNext, multiply a_1 by 3, divide a_2 by 2 and multiply a_3 by 3. The sequence is now {45, 3, 6}.\n\nFinally, multiply a_1 by 3, multiply a_2 by 3 and divide a_3 by 2. The sequence is now {135, 9, 3}.\n\nSample Input 2\n\n4\n631 577 243 199\n\nSample Output 2\n\n0\n\nNo operation can be performed since all the elements are odd. Thus, the answer is 0.\n\nSample Input 3\n\n10\n2184 2126 1721 1800 1024 2528 3360 1945 1280 1776\n\nSample Output 3\n\n39", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s899599786", "group_id": "codeNet:p03326", "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 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, m int\n\tvar ans, max int64\n\tfmt.Sscan(getNextLine(scanner), &n, &m)\n\txyz := make([][]int, n)\n\tsums := make(SortBy, n)\n\tfor i := 0; i < n; i++ {\n\t\txyz[i] = getIntList(scanner)\n\t}\n\tfor x := -1; x <= 1; x += 2 {\n\t\tfor y := -1; y <= 1; y += 2 {\n\t\t\tfor z := -1; z <= 1; z += 2 {\n\t\t\t\tans = 0\n\t\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\t\tsums[i] = int64(xyz[i][0]*x + xyz[i][1]*y + xyz[i][2]*z)\n\t\t\t\t}\n\t\t\t\tsort.Sort(sums)\n\t\t\t\tfor i := 0; i < m; i++ {\n\t\t\t\t\tans += sums[i]\n\t\t\t\t}\n\t\t\t\tif max < ans {\n\t\t\t\t\tmax = ans\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n\ntype SortBy []int64\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", "language": "Go", "metadata": {"date": 1558586354, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03326.html", "problem_id": "p03326", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03326/input.txt", "sample_output_relpath": "derived/input_output/data/p03326/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03326/Go/s899599786.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s899599786", "user_id": "u150542210"}, "prompt_components": {"gold_output": "56\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 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, m int\n\tvar ans, max int64\n\tfmt.Sscan(getNextLine(scanner), &n, &m)\n\txyz := make([][]int, n)\n\tsums := make(SortBy, n)\n\tfor i := 0; i < n; i++ {\n\t\txyz[i] = getIntList(scanner)\n\t}\n\tfor x := -1; x <= 1; x += 2 {\n\t\tfor y := -1; y <= 1; y += 2 {\n\t\t\tfor z := -1; z <= 1; z += 2 {\n\t\t\t\tans = 0\n\t\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\t\tsums[i] = int64(xyz[i][0]*x + xyz[i][1]*y + xyz[i][2]*z)\n\t\t\t\t}\n\t\t\t\tsort.Sort(sums)\n\t\t\t\tfor i := 0; i < m; i++ {\n\t\t\t\t\tans += sums[i]\n\t\t\t\t}\n\t\t\t\tif max < ans {\n\t\t\t\t\tmax = ans\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n\ntype SortBy []int64\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", "problem_context": "Score: 400 points\n\nProblem Statement\n\nTakahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100.\n\nThe shop sells N kinds of cakes.\n\nEach kind of cake has three parameters \"beauty\", \"tastiness\" and \"popularity\". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i.\n\nThese values may be zero or negative.\n\nRingo has decided to have M pieces of cakes here. He will choose the set of cakes as follows:\n\nDo not have two or more pieces of the same kind of cake.\n\nUnder the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity).\n\nFind the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.\n\nConstraints\n\nN is an integer between 1 and 1 \\ 000 (inclusive).\n\nM is an integer between 0 and N (inclusive).\n\nx_i, y_i, z_i \\ (1 \\leq i \\leq N) are integers between -10 \\ 000 \\ 000 \\ 000 and 10 \\ 000 \\ 000 \\ 000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1 z_1\nx_2 y_2 z_2\n: :\nx_N y_N z_N\n\nOutput\n\nPrint the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.\n\nSample Input 1\n\n5 3\n3 1 4\n1 5 9\n2 6 5\n3 5 8\n9 7 9\n\nSample Output 1\n\n56\n\nConsider having the 2-nd, 4-th and 5-th kinds of cakes. The total beauty, tastiness and popularity will be as follows:\n\nBeauty: 1 + 3 + 9 = 13\n\nTastiness: 5 + 5 + 7 = 17\n\nPopularity: 9 + 8 + 9 = 26\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 13 + 17 + 26 = 56. This is the maximum value.\n\nSample Input 2\n\n5 3\n1 -2 3\n-4 5 -6\n7 -8 -9\n-10 11 -12\n13 -14 15\n\nSample Output 2\n\n54\n\nConsider having the 1-st, 3-rd and 5-th kinds of cakes. The total beauty, tastiness and popularity will be as follows:\n\nBeauty: 1 + 7 + 13 = 21\n\nTastiness: (-2) + (-8) + (-14) = -24\n\nPopularity: 3 + (-9) + 15 = 9\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 21 + 24 + 9 = 54. This is the maximum value.\n\nSample Input 3\n\n10 5\n10 -80 21\n23 8 38\n-94 28 11\n-26 -2 18\n-69 72 79\n-26 -86 -54\n-72 -50 59\n21 65 -32\n40 -94 87\n-62 18 82\n\nSample Output 3\n\n638\n\nIf we have the 3-rd, 4-th, 5-th, 7-th and 10-th kinds of cakes, the total beauty, tastiness and popularity will be -323, 66 and 249, respectively.\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 323 + 66 + 249 = 638. This is the maximum value.\n\nSample Input 4\n\n3 2\n2000000000 -9000000000 4000000000\n7000000000 -5000000000 3000000000\n6000000000 -1000000000 8000000000\n\nSample Output 4\n\n30000000000\n\nThe values of the beauty, tastiness and popularity of the cakes and the value to be printed may not fit into 32-bit integers.", "sample_input": "5 3\n3 1 4\n1 5 9\n2 6 5\n3 5 8\n9 7 9\n"}, "reference_outputs": ["56\n"], "source_document_id": "p03326", "source_text": "Score: 400 points\n\nProblem Statement\n\nTakahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100.\n\nThe shop sells N kinds of cakes.\n\nEach kind of cake has three parameters \"beauty\", \"tastiness\" and \"popularity\". The i-th kind of cake has the beauty of x_i, the tastiness of y_i and the popularity of z_i.\n\nThese values may be zero or negative.\n\nRingo has decided to have M pieces of cakes here. He will choose the set of cakes as follows:\n\nDo not have two or more pieces of the same kind of cake.\n\nUnder the condition above, choose the set of cakes to maximize (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity).\n\nFind the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.\n\nConstraints\n\nN is an integer between 1 and 1 \\ 000 (inclusive).\n\nM is an integer between 0 and N (inclusive).\n\nx_i, y_i, z_i \\ (1 \\leq i \\leq N) are integers between -10 \\ 000 \\ 000 \\ 000 and 10 \\ 000 \\ 000 \\ 000 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1 z_1\nx_2 y_2 z_2\n: :\nx_N y_N z_N\n\nOutput\n\nPrint the maximum possible value of (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) for the set of cakes that Ringo chooses.\n\nSample Input 1\n\n5 3\n3 1 4\n1 5 9\n2 6 5\n3 5 8\n9 7 9\n\nSample Output 1\n\n56\n\nConsider having the 2-nd, 4-th and 5-th kinds of cakes. The total beauty, tastiness and popularity will be as follows:\n\nBeauty: 1 + 3 + 9 = 13\n\nTastiness: 5 + 5 + 7 = 17\n\nPopularity: 9 + 8 + 9 = 26\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 13 + 17 + 26 = 56. This is the maximum value.\n\nSample Input 2\n\n5 3\n1 -2 3\n-4 5 -6\n7 -8 -9\n-10 11 -12\n13 -14 15\n\nSample Output 2\n\n54\n\nConsider having the 1-st, 3-rd and 5-th kinds of cakes. The total beauty, tastiness and popularity will be as follows:\n\nBeauty: 1 + 7 + 13 = 21\n\nTastiness: (-2) + (-8) + (-14) = -24\n\nPopularity: 3 + (-9) + 15 = 9\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 21 + 24 + 9 = 54. This is the maximum value.\n\nSample Input 3\n\n10 5\n10 -80 21\n23 8 38\n-94 28 11\n-26 -2 18\n-69 72 79\n-26 -86 -54\n-72 -50 59\n21 65 -32\n40 -94 87\n-62 18 82\n\nSample Output 3\n\n638\n\nIf we have the 3-rd, 4-th, 5-th, 7-th and 10-th kinds of cakes, the total beauty, tastiness and popularity will be -323, 66 and 249, respectively.\n\nThe value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is 323 + 66 + 249 = 638. This is the maximum value.\n\nSample Input 4\n\n3 2\n2000000000 -9000000000 4000000000\n7000000000 -5000000000 3000000000\n6000000000 -1000000000 8000000000\n\nSample Output 4\n\n30000000000\n\nThe values of the beauty, tastiness and popularity of the cakes and the value to be printed may not fit into 32-bit integers.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1360, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s152239842", "group_id": "codeNet:p03327", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\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\n\nfunc numToPrefix(num int) string {\n\tab := \"AB\"\n\tcandidates := \"CDEFGHIJKLMNOPQRSTUVWXYZ\"\n\ta := int(math.Floor((float64(num) - 1) / 999))\n\treturn ab + string(candidates[a])\n}\n\nfunc main() {\n\ta,_ := strconv.Atoi(readLine())\n\tfmt.Println(numToPrefix(a)) \n}\n", "language": "Go", "metadata": {"date": 1528742155, "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/s152239842.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s152239842", "user_id": "u087789049"}, "prompt_components": {"gold_output": "ABC\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 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\n\nfunc numToPrefix(num int) string {\n\tab := \"AB\"\n\tcandidates := \"CDEFGHIJKLMNOPQRSTUVWXYZ\"\n\ta := int(math.Floor((float64(num) - 1) / 999))\n\treturn ab + string(candidates[a])\n}\n\nfunc main() {\n\ta,_ := strconv.Atoi(readLine())\n\tfmt.Println(numToPrefix(a)) \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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s014177295", "group_id": "codeNet:p03329", "input_text": "package main\n\nimport (\n\t. \"fmt\"\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\tvar n int\n\tScan(&n)\n\tdp := make([]int, n + 1)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i + 1] = 1000000000\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; i + j <= n; j *= 6 {\n\t\t\tdp[i + j] = Min(dp[i + j], dp[i] + 1)\n\t\t}\n\n\t\tfor j := 1; i + j <= n; j *= 9 {\n\t\t\tdp[i + j] = Min(dp[i + j], dp[i] + 1)\n\t\t}\n\t}\n\n\tPrintln(dp[n])\n}", "language": "Go", "metadata": {"date": 1529461862, "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/s014177295.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s014177295", "user_id": "u424655672"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t. \"fmt\"\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\tvar n int\n\tScan(&n)\n\tdp := make([]int, n + 1)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i + 1] = 1000000000\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; i + j <= n; j *= 6 {\n\t\t\tdp[i + j] = Min(dp[i + j], dp[i] + 1)\n\t\t}\n\n\t\tfor j := 1; i + j <= n; j *= 9 {\n\t\t\tdp[i + j] = Min(dp[i + j], dp[i] + 1)\n\t\t}\n\t}\n\n\tPrintln(dp[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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s181804747", "group_id": "codeNet:p03332", "input_text": "package main\nimport \"fmt\"\nconst mod int64 = 998244353\nconst size int = 50\nvar f []int64\nvar finv []int64\nfunc main() {\n var n,a,b,k int64\n fmt.Scan(&n,&a,&b,&k)\n if a > b { a,b = b,a }\n if k == 0 {\n fmt.Println(1)\n return\n }\n if k < a || n*(a+b) < k {\n fmt.Println(0)\n return\n }\n g := gcd(b,a)\n if k%g != 0 {\n fmt.Println(0)\n return\n }\n a,b,k = a/g,b/g,k/g\n f = make([]int64,n+1)\n finv = make([]int64,n+1)\n f[0] = 1\n finv[0] = 1\n for i:=int64(1);i-1;i-- {\n if (k-i*b)%a != 0 || (k-i*b)/a > n { continue }\n j := (k-i*b)/a\n for l:=min(i,j);l>-1;l-- {\n m = (m+comb(n,i-l,j-l,l))%mod\n }\n }\n fmt.Println(m)\n}\nfunc min(x,y int64) int64 {\n if x < y { return x }\n return y\n}\nfunc gcd(x,y int64) int64 {\n if x%y == 0 { return y }\n return gcd(y,x%y)\n}\nfunc comb(n,a,b,c int64) int64 {\n if a < 0 || a > n { return 0 }\n if b < 0 || b > n-a { return 0 }\n if c < 0 || c > n-a-b { return 0 }\n if n == 0 && a == 0 && b == 0 && c == 0 { return 1 }\n if n == 0 { return 0 }\n return (f[n]*((((finv[a]*finv[b])%mod)*((finv[c]*finv[n-a-b-c])%mod))%mod))%mod\n}\nfunc inv(n int64) int64 {\n if n == 1 { return 1 }\n k := make([]int64,size)\n a,b,u := mod,n,size\n for i:=0;i b { a,b = b,a }\n if k == 0 {\n fmt.Println(1)\n return\n }\n if k < a || n*(a+b) < k {\n fmt.Println(0)\n return\n }\n g := gcd(b,a)\n if k%g != 0 {\n fmt.Println(0)\n return\n }\n a,b,k = a/g,b/g,k/g\n f = make([]int64,n+1)\n finv = make([]int64,n+1)\n f[0] = 1\n finv[0] = 1\n for i:=int64(1);i-1;i-- {\n if (k-i*b)%a != 0 || (k-i*b)/a > n { continue }\n j := (k-i*b)/a\n for l:=min(i,j);l>-1;l-- {\n m = (m+comb(n,i-l,j-l,l))%mod\n }\n }\n fmt.Println(m)\n}\nfunc min(x,y int64) int64 {\n if x < y { return x }\n return y\n}\nfunc gcd(x,y int64) int64 {\n if x%y == 0 { return y }\n return gcd(y,x%y)\n}\nfunc comb(n,a,b,c int64) int64 {\n if a < 0 || a > n { return 0 }\n if b < 0 || b > n-a { return 0 }\n if c < 0 || c > n-a-b { return 0 }\n if n == 0 && a == 0 && b == 0 && c == 0 { return 1 }\n if n == 0 { return 0 }\n return (f[n]*((((finv[a]*finv[b])%mod)*((finv[c]*finv[n-a-b-c])%mod))%mod))%mod\n}\nfunc inv(n int64) int64 {\n if n == 1 { return 1 }\n k := make([]int64,size)\n a,b,u := mod,n,size\n for i:=0;i= a --> Prepare (n!), (a!)^-1\n\tfac := make([]int, N+1)\n\tfInv := make([]int, N+1)\n\tinv := make([]int, N+1)\n\tprepare(fac, fInv, inv, N)\n\n\t// xA + yB = K\n\tfor x := 0; x <= N; x++ {\n\t\tr := K - x*A\n\t\tif r%B != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ty := r / B\n\t\tif y > N {\n\t\t\tcontinue\n\t\t}\n\t\tans += (calcCombination(fac, fInv, N, x) * calcCombination(fac, fInv, N, y) % MOD) % MOD\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1555685032, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03332.html", "problem_id": "p03332", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03332/input.txt", "sample_output_relpath": "derived/input_output/data/p03332/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03332/Go/s301722695.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s301722695", "user_id": "u764050215"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar MOD = 998244353\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 exGcd(a, b int) (int, int, int) {\n\tr0 := a\n\tx0 := 1\n\ty0 := 0\n\tr1 := b\n\tx1 := 0\n\ty1 := 1\n\tfor r1 != 0 {\n\t\t// Calc\n\t\tr2 := r0 % r1\n\t\tq := r0 / r1 // quotient\n\t\tx2 := x0 - q*x1\n\t\ty2 := y0 - q*y1\n\n\t\t// Update\n\t\tr0 = r1\n\t\tr1 = r2\n\t\tx0 = x1\n\t\tx1 = x2\n\t\ty0 = y1\n\t\ty1 = y2\n\t}\n\n\treturn r0, x0, y0\n}\n\nfunc prepare(fac []int, fInv []int, inv []int, upper int) {\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 <= upper; 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 calcCombination(fac []int, fInv []int, n, a int) int {\n\treturn fac[n] * (fInv[a] * fInv[n-a] % MOD) % MOD\n}\n\nfunc main() {\n\tvar N, A, B, K int\n\tfmt.Scanf(\"%d %d %d %d\", &N, &A, &B, &K)\n\n\tans := 0\n\n\t// Calc NCx * NCy\n\t// nCa = (n)!/(n-a)!(a)! = (n!)(a!)^-1((n-a)!)^-1\n\t// n >= a --> Prepare (n!), (a!)^-1\n\tfac := make([]int, N+1)\n\tfInv := make([]int, N+1)\n\tinv := make([]int, N+1)\n\tprepare(fac, fInv, inv, N)\n\n\t// xA + yB = K\n\tfor x := 0; x <= N; x++ {\n\t\tr := K - x*A\n\t\tif r%B != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ty := r / B\n\t\tif y > N {\n\t\t\tcontinue\n\t\t}\n\t\tans += (calcCombination(fac, fInv, N, x) * calcCombination(fac, fInv, N, y) % MOD) % MOD\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTakahashi has a tower which is divided into N layers.\nInitially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower.\nHe defines the beauty of the tower as follows:\n\nThe beauty of the tower is the sum of the scores of the N layers, where the score of a layer is A if the layer is painted red, A+B if the layer is painted green, B if the layer is painted blue, and 0 if the layer is uncolored.\n\nHere, A and B are positive integer constants given beforehand. Also note that a layer may not be painted in two or more colors.\n\nTakahashi is planning to paint the tower so that the beauty of the tower becomes exactly K.\nHow many such ways are there to paint the tower? Find the count modulo 998244353.\nTwo ways to paint the tower are considered different when there exists a layer that is painted in different colors, or a layer that is painted in some color in one of the ways and not in the other.\n\nConstraints\n\n1 ≤ N ≤ 3×10^5\n\n1 ≤ A,B ≤ 3×10^5\n\n0 ≤ K ≤ 18×10^{10}\n\nAll values in the input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B K\n\nOutput\n\nPrint the number of the ways to paint tiles, modulo 998244353.\n\nSample Input 1\n\n4 1 2 5\n\nSample Output 1\n\n40\n\nIn this case, a red layer worth 1 points, a green layer worth 3 points and the blue layer worth 2 points. The beauty of the tower is 5 when we have one of the following sets of painted layers:\n\n1 green, 1 blue\n\n1 red, 2 blues\n\n2 reds, 1 green\n\n3 reds, 1 blue\n\nThe total number of the ways to produce them is 40.\n\nSample Input 2\n\n2 5 6 0\n\nSample Output 2\n\n1\n\nThe beauty of the tower is 0 only when all the layers are uncolored. Thus, the answer is 1.\n\nSample Input 3\n\n90081 33447 90629 6391049189\n\nSample Output 3\n\n577742975", "sample_input": "4 1 2 5\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03332", "source_text": "Score : 700 points\n\nProblem Statement\n\nTakahashi has a tower which is divided into N layers.\nInitially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower.\nHe defines the beauty of the tower as follows:\n\nThe beauty of the tower is the sum of the scores of the N layers, where the score of a layer is A if the layer is painted red, A+B if the layer is painted green, B if the layer is painted blue, and 0 if the layer is uncolored.\n\nHere, A and B are positive integer constants given beforehand. Also note that a layer may not be painted in two or more colors.\n\nTakahashi is planning to paint the tower so that the beauty of the tower becomes exactly K.\nHow many such ways are there to paint the tower? Find the count modulo 998244353.\nTwo ways to paint the tower are considered different when there exists a layer that is painted in different colors, or a layer that is painted in some color in one of the ways and not in the other.\n\nConstraints\n\n1 ≤ N ≤ 3×10^5\n\n1 ≤ A,B ≤ 3×10^5\n\n0 ≤ K ≤ 18×10^{10}\n\nAll values in the input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B K\n\nOutput\n\nPrint the number of the ways to paint tiles, modulo 998244353.\n\nSample Input 1\n\n4 1 2 5\n\nSample Output 1\n\n40\n\nIn this case, a red layer worth 1 points, a green layer worth 3 points and the blue layer worth 2 points. The beauty of the tower is 5 when we have one of the following sets of painted layers:\n\n1 green, 1 blue\n\n1 red, 2 blues\n\n2 reds, 1 green\n\n3 reds, 1 blue\n\nThe total number of the ways to produce them is 40.\n\nSample Input 2\n\n2 5 6 0\n\nSample Output 2\n\n1\n\nThe beauty of the tower is 0 only when all the layers are uncolored. Thus, the answer is 1.\n\nSample Input 3\n\n90081 33447 90629 6391049189\n\nSample Output 3\n\n577742975", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1351, "cpu_time_ms": 64, "memory_kb": 7808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s160286536", "group_id": "codeNet:p03337", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t)\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\tmx := max(max(a - b, a + b), a * b)\n\tfmt.Println(mx)\n}\n", "language": "Go", "metadata": {"date": 1533897836, "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/s160286536.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s160286536", "user_id": "u430478288"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t)\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\tmx := max(max(a - b, a + b), a * b)\n\tfmt.Println(mx)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s339225061", "group_id": "codeNet:p03337", "input_text": "package main\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta, _ := strconv.Atoi(os.Args[0])\n\tb, _ := strconv.Atoi(os.Args[1])\n\tadd := a + b\n\tsub := a - b\n\tmul := a * b\n\tret := add\n\tif ret < sub {\n\t\tret = sub\n\t\tif ret < mul {\n\t\t\tret = mul\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1528522519, "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/s339225061.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s339225061", "user_id": "u982036481"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta, _ := strconv.Atoi(os.Args[0])\n\tb, _ := strconv.Atoi(os.Args[1])\n\tadd := a + b\n\tsub := a - b\n\tmul := a * b\n\tret := add\n\tif ret < sub {\n\t\tret = sub\n\t\tif ret < mul {\n\t\t\tret = mul\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 246, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001905088", "group_id": "codeNet:p03338", "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\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tcnt := 0\n\t\tfor c := 'a'; c <= 'z'; c++ {\n\t\t\tleft, right := false, false\n\t\t\tif strings.Index(s[:i+1], string(c)) > -1 {\n\t\t\t\tleft = true\n\t\t\t}\n\t\t\tif strings.Index(s[i+1:], string(c)) > -1 {\n\t\t\t\tright = true\n\t\t\t}\n\t\t\tif left && right {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t\tif ans < cnt {\n\t\t\tans = cnt\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1549002941, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03338.html", "problem_id": "p03338", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03338/input.txt", "sample_output_relpath": "derived/input_output/data/p03338/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03338/Go/s001905088.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s001905088", "user_id": "u150922405"}, "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\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tcnt := 0\n\t\tfor c := 'a'; c <= 'z'; c++ {\n\t\t\tleft, right := false, false\n\t\t\tif strings.Index(s[:i+1], string(c)) > -1 {\n\t\t\t\tleft = true\n\t\t\t}\n\t\t\tif strings.Index(s[i+1:], string(c)) > -1 {\n\t\t\t\tright = true\n\t\t\t}\n\t\t\tif left && right {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t\tif ans < cnt {\n\t\t\tans = cnt\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "sample_input": "6\naabbca\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03338", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters.\nWe will cut this string at one position into two strings X and Y.\nHere, we would like to maximize the number of different letters contained in both X and Y.\nFind the largest possible number of different letters contained in both X and Y when we cut the string at the optimal position.\n\nConstraints\n\n2 \\leq N \\leq 100\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 largest possible number of different letters contained in both X and Y.\n\nSample Input 1\n\n6\naabbca\n\nSample Output 1\n\n2\n\nIf we cut the string between the third and fourth letters into X = aab and Y = bca, the letters contained in both X and Y are a and b.\nThere will never be three or more different letters contained in both X and Y, so the answer is 2.\n\nSample Input 2\n\n10\naaaaaaaaaa\n\nSample Output 2\n\n1\n\nHowever we divide S, only a will be contained in both X and Y.\n\nSample Input 3\n\n45\ntgxgdqkyjzhyputjjtllptdfxocrylqfqjynmfbfucbir\n\nSample Output 3\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 456, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s646021898", "group_id": "codeNet:p03341", "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\tS := nextLine()\n\tnumW := make([]int, N+1)\n\tnumE := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == 'W' {\n\t\t\tnumW[i+1] = numW[i] + 1\n\t\t\tnumE[i+1] = numE[i]\n\t\t} else {\n\t\t\tnumW[i+1] = numW[i]\n\t\t\tnumE[i+1] = numE[i] + 1\n\t\t}\n\t}\n\tans := numE[N] - numE[1]\n\tfor i := 1; i < N; i++ {\n\t\tvar peoples int\n\t\tpeoples = numW[i-1] - numW[0] + numE[N] - numE[i+1]\n\t\tif ans > peoples {\n\t\t\tans = peoples\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", "language": "Go", "metadata": {"date": 1587101491, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03341.html", "problem_id": "p03341", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03341/input.txt", "sample_output_relpath": "derived/input_output/data/p03341/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03341/Go/s646021898.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s646021898", "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\"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\tS := nextLine()\n\tnumW := make([]int, N+1)\n\tnumE := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tif S[i] == 'W' {\n\t\t\tnumW[i+1] = numW[i] + 1\n\t\t\tnumE[i+1] = numE[i]\n\t\t} else {\n\t\t\tnumW[i+1] = numW[i]\n\t\t\tnumE[i+1] = numE[i] + 1\n\t\t}\n\t}\n\tans := numE[N] - numE[1]\n\tfor i := 1; i < N; i++ {\n\t\tvar peoples int\n\t\tpeoples = numW[i-1] - numW[0] + numE[N] - numE[i+1]\n\t\tif ans > peoples {\n\t\t\tans = peoples\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", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "sample_input": "5\nWEEWW\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03341", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people standing in a row from west to east.\nEach person is facing east or west.\nThe directions of the people is given as a string S of length N.\nThe i-th person from the west is facing east if S_i = E, and west if S_i = W.\n\nYou will appoint one of the N people as the leader, then command the rest of them to face in the direction of the leader.\nHere, we do not care which direction the leader is facing.\n\nThe people in the row hate to change their directions, so you would like to select the leader so that the number of people who have to change their directions is minimized.\nFind the minimum number of people who have to change their directions.\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n|S| = N\n\nS_i is E or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of people who have to change their directions.\n\nSample Input 1\n\n5\nWEEWW\n\nSample Output 1\n\n1\n\nAssume that we appoint the third person from the west as the leader.\nThen, the first person from the west needs to face east and has to turn around.\nThe other people do not need to change their directions, so the number of people who have to change their directions is 1 in this case.\nIt is not possible to have 0 people who have to change their directions, so the answer is 1.\n\nSample Input 2\n\n12\nWEWEWEEEWWWE\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8\nWWWWWEEE\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 884, "cpu_time_ms": 18, "memory_kb": 6144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s631322404", "group_id": "codeNet:p03345", "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/*********** 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// GetNthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc GetNthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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\nfunc GeneralLowerBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\n}\n\nfunc GeneralUpperBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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, GeneralUpperBound(test, 5)-GeneralLowerBound(test, 5))\n//assert.Equal(t, 0, GeneralUpperBound(test, 15)-GeneralLowerBound(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.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** heap package (Integer Priority Queue) **********/\n\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// h := &IntHeap{3, 6, 1, 2}\n// heap.Init(h)\n// heap.Push(h, followers[i])\n// poppedD := heap.Pop(h).(int)\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 a, b, c, k int\n\nfunc main() {\n\ta, b, c, k = ReadInt(), ReadInt(), ReadInt(), ReadInt()\n\tans := 0\n\tif k%2 == 1 {\n\t\tans = -a + b\n\t} else {\n\t\tans = a - b\n\t}\n\n\t// fmt.Println(ans)\n\tif AbsInt(ans) >= PowInt(10, 18) {\n\t\tfmt.Println(\"Unfair\")\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1551585970, "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/s631322404.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631322404", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\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/*********** 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// GetNthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc GetNthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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\nfunc GeneralLowerBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\n}\n\nfunc GeneralUpperBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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, GeneralUpperBound(test, 5)-GeneralLowerBound(test, 5))\n//assert.Equal(t, 0, GeneralUpperBound(test, 15)-GeneralLowerBound(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.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** heap package (Integer Priority Queue) **********/\n\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// h := &IntHeap{3, 6, 1, 2}\n// heap.Init(h)\n// heap.Push(h, followers[i])\n// poppedD := heap.Pop(h).(int)\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 a, b, c, k int\n\nfunc main() {\n\ta, b, c, k = ReadInt(), ReadInt(), ReadInt(), ReadInt()\n\tans := 0\n\tif k%2 == 1 {\n\t\tans = -a + b\n\t} else {\n\t\tans = a - b\n\t}\n\n\t// fmt.Println(ans)\n\tif AbsInt(ans) >= PowInt(10, 18) {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12732, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s602601615", "group_id": "codeNet:p03345", "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/*********** 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// GetNthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc GetNthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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\nfunc GeneralLowerBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\n}\n\nfunc GeneralUpperBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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, GeneralUpperBound(test, 5)-GeneralLowerBound(test, 5))\n//assert.Equal(t, 0, GeneralUpperBound(test, 15)-GeneralLowerBound(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.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** heap package (Integer Priority Queue) **********/\n\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// h := &IntHeap{3, 6, 1, 2}\n// heap.Init(h)\n// heap.Push(h, followers[i])\n// poppedD := heap.Pop(h).(int)\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 a, b, c, k int\n\nfunc main() {\n\ta, b, c, k = ReadInt(), ReadInt(), ReadInt(), ReadInt()\n\tans := 0\n\tif k%2 == 1 {\n\t\tans = -a + b\n\t} else {\n\t\tans = a - b\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1551585606, "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/s602601615.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s602601615", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\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/*********** 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// GetNthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc GetNthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\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\nfunc GeneralLowerBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\n}\n\nfunc GeneralUpperBound(s []int, key int) int {\n\tisOK := 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\tng, ok := -1, len(s)\n\tfor int(math.Abs(float64(ok-ng))) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif isOK(mid, key) {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\n\treturn ok\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, GeneralUpperBound(test, 5)-GeneralLowerBound(test, 5))\n//assert.Equal(t, 0, GeneralUpperBound(test, 15)-GeneralLowerBound(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.\n// O(1), but C is nearly equal to 30 (when m is 1000000000+7).\nfunc CalcModInv(a, m int) int {\n\treturn modpow(a, m-2, m)\n}\n\n/********** heap package (Integer Priority Queue) **********/\n\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// h := &IntHeap{3, 6, 1, 2}\n// heap.Init(h)\n// heap.Push(h, followers[i])\n// poppedD := heap.Pop(h).(int)\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 a, b, c, k int\n\nfunc main() {\n\ta, b, c, k = ReadInt(), ReadInt(), ReadInt(), ReadInt()\n\tans := 0\n\tif k%2 == 1 {\n\t\tans = -a + b\n\t} else {\n\t\tans = a - b\n\t}\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 12637, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s204763662", "group_id": "codeNet:p03351", "input_text": "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\n\tif a-b <= d && b-c <= d || a-c <= d {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1588383664, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03351/input.txt", "sample_output_relpath": "derived/input_output/data/p03351/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03351/Go/s204763662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s204763662", "user_id": "u214033538"}, "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, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tif a-b <= d && b-c <= d || a-c <= d {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "sample_input": "4 7 9 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03351", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 187, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s877299832", "group_id": "codeNet:p03351", "input_text": "package main\n\nimport \"fmt\"\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tif abs(a-c) <= d || (abs(a-b) <= d && abs(b-c) <= d) {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1564234408, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03351/input.txt", "sample_output_relpath": "derived/input_output/data/p03351/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03351/Go/s877299832.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s877299832", "user_id": "u461993794"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tif abs(a-c) <= d || (abs(a-b) <= d && abs(b-c) <= d) {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "sample_input": "4 7 9 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03351", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s914816406", "group_id": "codeNet:p03351", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tans := \"No\"\n\tif c-a <= d || (b-a <= d && c-b <= d) {\n\t\tans = \"Yes\"\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1554931367, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03351.html", "problem_id": "p03351", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03351/input.txt", "sample_output_relpath": "derived/input_output/data/p03351/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03351/Go/s914816406.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s914816406", "user_id": "u543933043"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tans := \"No\"\n\tif c-a <= d || (b-a <= d && c-b <= d) {\n\t\tans = \"Yes\"\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "sample_input": "4 7 9 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03351", "source_text": "Score : 100 points\n\nProblem Statement\n\nThree people, A, B and C, are trying to communicate using transceivers.\nThey are standing along a number line, and the coordinates of A, B and C are a, b and c (in meters), respectively.\nTwo people can directly communicate when the distance between them is at most d meters.\nDetermine if A and C can communicate, either directly or indirectly.\nHere, A and C can indirectly communicate when A and B can directly communicate and also B and C can directly communicate.\n\nConstraints\n\n1 ≤ a,b,c ≤ 100\n\n1 ≤ d ≤ 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nIf A and C can communicate, print Yes; if they cannot, print No.\n\nSample Input 1\n\n4 7 9 3\n\nSample Output 1\n\nYes\n\nA and B can directly communicate, and also B and C can directly communicate, so we should print Yes.\n\nSample Input 2\n\n100 10 1 2\n\nSample Output 2\n\nNo\n\nThey cannot communicate in this case.\n\nSample Input 3\n\n10 10 10 1\n\nSample Output 3\n\nYes\n\nThere can be multiple people at the same position.\n\nSample Input 4\n\n1 100 2 10\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s462218790", "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\tmax := 0\n\tfor i := 1; i <= x; i++ {\n\t\tif i*i > x {\n\t\t\tbreak\n\t\t}\n\t\tmax = i * i\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1576847342, "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/s462218790.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s462218790", "user_id": "u390374229"}, "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\tmax := 0\n\tfor i := 1; i <= x; i++ {\n\t\tif i*i > x {\n\t\t\tbreak\n\t\t}\n\t\tmax = i * i\n\t}\n\tfmt.Println(max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s234379397", "group_id": "codeNet:p03352", "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\tmax := float64(1)\n\tbp := float64(0)\n\tfor b := float64(1); b <= x; b++ {\n\t\tfor p := float64(2); p <= x; p++ {\n\t\t\tbp = math.Pow(b, p)\n\t\t\tif x < bp {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tmax = math.Max(max, bp)\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1535413049, "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/s234379397.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s234379397", "user_id": "u875592584"}, "prompt_components": {"gold_output": "9\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\tmax := float64(1)\n\tbp := float64(0)\n\tfor b := float64(1); b <= x; b++ {\n\t\tfor p := float64(2); p <= x; p++ {\n\t\t\tbp = math.Pow(b, p)\n\t\t\tif x < bp {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tmax = math.Max(max, bp)\n\t\t}\n\t}\n\tfmt.Println(max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 302, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065551501", "group_id": "codeNet:p03352", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc (p *problem) solve() {\n\tX := p.NextInt()\n\n\tif X == 1 {\n\t\tp.PrintInt(1)\n\t\treturn\n\t}\n\n\tans := 1\n\tfor p := 2; ; p++ {\n\t\tv := p * p\n\t\tif v > X {\n\t\t\tbreak\n\t\t}\n\t\tfor v <= X {\n\t\t\tans = max(v, ans)\n\t\t\tv *= p\n\t\t}\n\t}\n\tp.PrintInt(ans)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nvar (\n\tdebug bool\n\toutput string\n)\n\nfunc main() {\n\tflag.BoolVar(&debug, \"debug\", false, \"Print debug logs\")\n\tflag.BoolVar(&debug, \"d\", false, \"Print debug logs\")\n\tflag.StringVar(&output, \"output\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.StringVar(&output, \"o\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.Parse()\n\n\tif debug {\n\t\tout := os.Stdout\n\t\tif output != \"stdout\" {\n\t\t\tlogfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer logfile.Close()\n\t\t\tout = logfile\n\t\t}\n\t\tlog.SetOutput(out)\n\t} else {\n\t\tlog.SetOutput(ioutil.Discard)\n\t}\n\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tp.solve()\n\n\tif err := p.out.Flush(); err != nil {\n\t\tpanic(err)\n\t}\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\\n\", 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) Printfln(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, fmt.Sprintf(\"%v\\n\", 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}\n", "language": "Go", "metadata": {"date": 1526307694, "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/s065551501.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s065551501", "user_id": "u683292750"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc (p *problem) solve() {\n\tX := p.NextInt()\n\n\tif X == 1 {\n\t\tp.PrintInt(1)\n\t\treturn\n\t}\n\n\tans := 1\n\tfor p := 2; ; p++ {\n\t\tv := p * p\n\t\tif v > X {\n\t\t\tbreak\n\t\t}\n\t\tfor v <= X {\n\t\t\tans = max(v, ans)\n\t\t\tv *= p\n\t\t}\n\t}\n\tp.PrintInt(ans)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nvar (\n\tdebug bool\n\toutput string\n)\n\nfunc main() {\n\tflag.BoolVar(&debug, \"debug\", false, \"Print debug logs\")\n\tflag.BoolVar(&debug, \"d\", false, \"Print debug logs\")\n\tflag.StringVar(&output, \"output\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.StringVar(&output, \"o\", \"stdout\", \"Specify output target (Default: stdout)\")\n\tflag.Parse()\n\n\tif debug {\n\t\tout := os.Stdout\n\t\tif output != \"stdout\" {\n\t\t\tlogfile, err := os.OpenFile(output, os.O_CREATE|os.O_WRONLY, 0666)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tdefer logfile.Close()\n\t\t\tout = logfile\n\t\t}\n\t\tlog.SetOutput(out)\n\t} else {\n\t\tlog.SetOutput(ioutil.Discard)\n\t}\n\n\tp := problem{\n\t\tin: bufio.NewReader(os.Stdin),\n\t\tout: bufio.NewWriter(os.Stdout),\n\t}\n\tp.solve()\n\n\tif err := p.out.Flush(); err != nil {\n\t\tpanic(err)\n\t}\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\\n\", 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) Printfln(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(p.out, fmt.Sprintf(\"%v\\n\", 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}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s996214777", "group_id": "codeNet:p03353", "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\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 main() {\n\tdefer stdout.Flush()\n\ts := readString()\n\tk := readInt()\n\tm := make(map[string]bool)\n\tfor i := 1; i <= k; i++ {\n\t\tfor j := 0; j+i <= len(s); j++ {\n\t\t\tm[s[j:j+i]] = true\n\t\t}\n\t}\n\n\ta := make([]string, 0, len(m))\n\tfor w := range m {\n\t\ta = append(a, w)\n\t}\n\tsort.Strings(a)\n\tprintln(a[k-1])\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1541297629, "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/s996214777.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s996214777", "user_id": "u705974985"}, "prompt_components": {"gold_output": "b\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\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 main() {\n\tdefer stdout.Flush()\n\ts := readString()\n\tk := readInt()\n\tm := make(map[string]bool)\n\tfor i := 1; i <= k; i++ {\n\t\tfor j := 0; j+i <= len(s); j++ {\n\t\t\tm[s[j:j+i]] = true\n\t\t}\n\t}\n\n\ta := make([]string, 0, len(m))\n\tfor w := range m {\n\t\ta = append(a, w)\n\t}\n\tsort.Strings(a)\n\tprintln(a[k-1])\n}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 12, "memory_kb": 2304}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s206659310", "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\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\tsc.Buffer([]byte{}, 1000000)\n\n\ts := getString()\n\tK := getInt()\n\tsub := make([]string, 0)\n\tfor i := 0; i < len(s); i++ {\n\t\tn := min(i+7, len(s))\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tsub = append(sub, s[i:j])\n\t\t}\n\t}\n\n\tsort.Strings(sub)\n\tprev := \"\"\n\tcnt := 0\n\tfor _, v := range sub {\n\t\tif v == prev {\n\t\t\tcontinue\n\t\t}\n\t\tprev = v\n\t\tcnt++\n\t\tif cnt == K {\n\t\t\tbreak\n\t\t}\n\t}\n\tout(prev)\n}\n", "language": "Go", "metadata": {"date": 1584888494, "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/s206659310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s206659310", "user_id": "u814575783"}, "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\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\tsc.Buffer([]byte{}, 1000000)\n\n\ts := getString()\n\tK := getInt()\n\tsub := make([]string, 0)\n\tfor i := 0; i < len(s); i++ {\n\t\tn := min(i+7, len(s))\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tsub = append(sub, s[i:j])\n\t\t}\n\t}\n\n\tsort.Strings(sub)\n\tprev := \"\"\n\tcnt := 0\n\tfor _, v := range sub {\n\t\tif v == prev {\n\t\t\tcontinue\n\t\t}\n\t\tprev = v\n\t\tcnt++\n\t\tif cnt == K {\n\t\t\tbreak\n\t\t}\n\t}\n\tout(prev)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 15, "memory_kb": 3456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s144713384", "group_id": "codeNet:p03359", "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 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 = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\ta, b := intScanner(), intScanner()\n\tif b < a {\n\t\tfmt.Println(a - 1)\n\t} else {\n\t\tfmt.Println(a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1594266283, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s144713384.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s144713384", "user_id": "u843722521"}, "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 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 = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\ta, b := intScanner(), intScanner()\n\tif b < a {\n\t\tfmt.Println(a - 1)\n\t} else {\n\t\tfmt.Println(a)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1276, "cpu_time_ms": 9, "memory_kb": 1768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s726630457", "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 a > b {\n\t\tfmt.Println(a - 1)\n\t} else {\n\t\tfmt.Println(a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1580788920, "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/s726630457.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s726630457", "user_id": "u363118893"}, "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 a > b {\n\t\tfmt.Println(a - 1)\n\t} else {\n\t\tfmt.Println(a)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s152062883", "group_id": "codeNet:p03361", "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 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 rs() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\th, w := ri(), ri()\n\n\ts := make([]string, h+2)\n\ts[0] = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\tfor i := 1; i <= h; i++ {\n\t\ts[i] = \"x\" + rs() + \"x\"\n\t}\n\ts[h+1] = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n\tfor i := 1; i <= h; i++ {\n\t\tfor j := 1; j <= w; j++ {\n\t\t\tif s[i][j] == '#' && s[i][j-1] != '#' && s[i][j+1] != '#' && s[i-1][j] != '#' && s[i+1][j] != '#' {\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", "language": "Go", "metadata": {"date": 1552984471, "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/s152062883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s152062883", "user_id": "u554269352"}, "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 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 rs() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\th, w := ri(), ri()\n\n\ts := make([]string, h+2)\n\ts[0] = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\tfor i := 1; i <= h; i++ {\n\t\ts[i] = \"x\" + rs() + \"x\"\n\t}\n\ts[h+1] = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n\n\tfor i := 1; i <= h; i++ {\n\t\tfor j := 1; j <= w; j++ {\n\t\t\tif s[i][j] == '#' && s[i][j-1] != '#' && s[i][j+1] != '#' && s[i-1][j] != '#' && s[i+1][j] != '#' {\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 730, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s798972692", "group_id": "codeNet:p03361", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main(){\n\tvar H, W int\n\tvar S string\n\tfmt.Scan(&H, &W)\n\tg := [][]string{}\n\ti := 0\n\n\tfor i < H {\n\t\ti++\n\t\tfmt.Scan(&S)\n\t\trow := strings.Split(S,\"\")\n\t\tg = append(g, row)\n\t}\n\tres := true\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif g[i][j] == \"#\" {\n\t\t\t\tch := false\n\t\t\t\tif i-1 >= 0 {\n\t\t\t\t\tif g[i-1][j] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif i+1 < H {\n\t\t\t\t\tif g[i+1][j] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif j-1 >= 0 {\n\t\t\t\t\tif g[i][j-1] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif j+1 < W {\n\t\t\t\t\tif g[i][j+1] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif !ch {\n\t\t\t\t\tres = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !res {\n\t\t\tbreak\n\t\t}\n\t}\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1529529585, "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/s798972692.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s798972692", "user_id": "u781152930"}, "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 H, W int\n\tvar S string\n\tfmt.Scan(&H, &W)\n\tg := [][]string{}\n\ti := 0\n\n\tfor i < H {\n\t\ti++\n\t\tfmt.Scan(&S)\n\t\trow := strings.Split(S,\"\")\n\t\tg = append(g, row)\n\t}\n\tres := true\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif g[i][j] == \"#\" {\n\t\t\t\tch := false\n\t\t\t\tif i-1 >= 0 {\n\t\t\t\t\tif g[i-1][j] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif i+1 < H {\n\t\t\t\t\tif g[i+1][j] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif j-1 >= 0 {\n\t\t\t\t\tif g[i][j-1] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif j+1 < W {\n\t\t\t\t\tif g[i][j+1] == \"#\" {ch = true}\n\t\t\t\t}\n\t\t\t\tif !ch {\n\t\t\t\t\tres = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif !res {\n\t\t\tbreak\n\t\t}\n\t}\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 712, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s383296182", "group_id": "codeNet:p03362", "input_text": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sun Jan 27 17:52:26 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc isPrime(n int) bool {\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 main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tans := make([]int, 0)\n\tfor i := 5; i <= 55555; i += 5 {\n\t\tif isPrime(i + 1) {\n\t\t\tans = append(ans, i+1)\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif i != 0 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Print(ans[i])\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1548629808, "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/s383296182.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s383296182", "user_id": "u802614675"}, "prompt_components": {"gold_output": "3 5 7 11 31\n", "input_to_evaluate": "// Package main provides\n//\n// File: main.go\n// Author: ymiyamoto\n//\n// Created on Sun Jan 27 17:52:26 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc isPrime(n int) bool {\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 main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tans := make([]int, 0)\n\tfor i := 5; i <= 55555; i += 5 {\n\t\tif isPrime(i + 1) {\n\t\t\tans = append(ans, i+1)\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif i != 0 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Print(ans[i])\n\t}\n\tfmt.Println()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s050153437", "group_id": "codeNet:p03362", "input_text": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nvar primes []int\n\nfunc init() {\ngenloop:\n\tfor i := 2; i < 55555+1; i++ {\n\t\tfor _, p := range primes {\n\t\t\tif i%p == 0 {\n\t\t\t\tcontinue genloop\n\t\t\t}\n\t\t}\n\t\tprimes = append(primes, i)\n\t}\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tf(0, 0, make([]int, N))\n}\n\nfunc f(start int, depth int, selection []int) {\n\tn := len(selection)\n\tif depth == n {\n\t\tif !isPrime(sum(selection)) {\n\t\t\td := \"\"\n\t\t\tfor _, s := range selection {\n\t\t\t\tfmt.Printf(\"%s%v\", d, s)\n\t\t\t\td = \" \"\n\t\t\t}\n\t\t\tfmt.Print(\"\\n\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\treturn\n\t}\n\tfor i := start; i < len(primes); i++ {\n\t\tnews := make([]int, n)\n\t\tcopy(news, selection)\n\t\tnews[depth] = primes[i]\n\t\tf(i+1, depth+1, news)\n\t}\n}\n\nfunc sum(sl []int) int {\n\ttotal := 0\n\tfor _, s := range sl {\n\t\ttotal += s\n\t}\n\treturn total\n}\n\nfunc isPrime(n int) bool {\n\tfor _, p := range primes {\n\t\tif n == p {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1526620334, "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/s050153437.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s050153437", "user_id": "u609014603"}, "prompt_components": {"gold_output": "3 5 7 11 31\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"os\"\n\nvar primes []int\n\nfunc init() {\ngenloop:\n\tfor i := 2; i < 55555+1; i++ {\n\t\tfor _, p := range primes {\n\t\t\tif i%p == 0 {\n\t\t\t\tcontinue genloop\n\t\t\t}\n\t\t}\n\t\tprimes = append(primes, i)\n\t}\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tf(0, 0, make([]int, N))\n}\n\nfunc f(start int, depth int, selection []int) {\n\tn := len(selection)\n\tif depth == n {\n\t\tif !isPrime(sum(selection)) {\n\t\t\td := \"\"\n\t\t\tfor _, s := range selection {\n\t\t\t\tfmt.Printf(\"%s%v\", d, s)\n\t\t\t\td = \" \"\n\t\t\t}\n\t\t\tfmt.Print(\"\\n\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\treturn\n\t}\n\tfor i := start; i < len(primes); i++ {\n\t\tnews := make([]int, n)\n\t\tcopy(news, selection)\n\t\tnews[depth] = primes[i]\n\t\tf(i+1, depth+1, news)\n\t}\n}\n\nfunc sum(sl []int) int {\n\ttotal := 0\n\tfor _, s := range sl {\n\t\ttotal += s\n\t}\n\treturn total\n}\n\nfunc isPrime(n int) bool {\n\tfor _, p := range primes {\n\t\tif n == p {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 894, "cpu_time_ms": 174, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s108078701", "group_id": "codeNet:p03369", "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\tS := sc.nextStr()\n\tans := 700\n\tfor _, r := range S {\n\t\tif r == 'o' {\n\t\t\tans += 100\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1576294527, "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/s108078701.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s108078701", "user_id": "u924691798"}, "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\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\tS := sc.nextStr()\n\tans := 700\n\tfor _, r := range S {\n\t\tif r == 'o' {\n\t\t\tans += 100\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1763, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s751622514", "group_id": "codeNet:p03370", "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, _ := 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 sum(a []int) int {\n\tret := 0\n\tfor _, v := range a {\n\t\tret += v\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, x := nextInt(), nextInt()\n\tm := make([]int, n)\n\tmin := 1001\n\tfor i := range m {\n\t\tm[i] = nextInt()\n\t\tif m[i] < min {\n\t\t\tmin = m[i]\n\t\t}\n\t}\n\n\tans := n + (x-sum(m))/min\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1579196477, "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/s751622514.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s751622514", "user_id": "u502813058"}, "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 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 sum(a []int) int {\n\tret := 0\n\tfor _, v := range a {\n\t\tret += v\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, x := nextInt(), nextInt()\n\tm := make([]int, n)\n\tmin := 1001\n\tfor i := range m {\n\t\tm[i] = nextInt()\n\t\tif m[i] < min {\n\t\t\tmin = m[i]\n\t\t}\n\t}\n\n\tans := n + (x-sum(m))/min\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 749, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s985104495", "group_id": "codeNet:p03370", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\tm := make([]int, n)\n\tl := 1001\n\tfor i := range m {\n\t\tfmt.Scan(&m[i])\n\t\tx -= m[i]\n\t\tif m[i] < l {\n\t\t\tl = m[i]\n\t\t}\n\t}\n\tfmt.Println(x/l + n)\n}\n", "language": "Go", "metadata": {"date": 1568677306, "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/s985104495.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s985104495", "user_id": "u937220467"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\tm := make([]int, n)\n\tl := 1001\n\tfor i := range m {\n\t\tfmt.Scan(&m[i])\n\t\tx -= m[i]\n\t\tif m[i] < l {\n\t\t\tl = m[i]\n\t\t}\n\t}\n\tfmt.Println(x/l + n)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 215, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s258996197", "group_id": "codeNet:p03371", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var a, b, c, x, y, z, l int\n ans:=0\n fmt.Scan(&a, &b, &c, &x, &y)\n if xc*2{\n ans+=c*z*2\n if l==x{\n if ac*2{\n ans+=c*z*2\n if l==x{\n if a c{\n fmt.Println(\"NO\")\n }else{\n if c - a <= b{\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n }\n}\n", "language": "Go", "metadata": {"date": 1556337084, "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/s292959474.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s292959474", "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 a > c{\n fmt.Println(\"NO\")\n }else{\n if c - a <= 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s799079774", "group_id": "codeNet:p03377", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar A, B, X int\n\tfmt.Scan(&A,&B,&X)\n\tif A + B < X || A > X {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}", "language": "Go", "metadata": {"date": 1549658182, "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/s799079774.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799079774", "user_id": "u201188078"}, "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\tfmt.Scan(&A,&B,&X)\n\tif A + B < X || A > X {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s728543227", "group_id": "codeNet:p03377", "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// 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// 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 a, b, x int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\ta, b, x = tmp[0], tmp[1], tmp[2]\n\n\tif a+b >= x && a <= x {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1545524253, "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/s728543227.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s728543227", "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\"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// 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// 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 a, b, x int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\ta, b, x = tmp[0], tmp[1], tmp[2]\n\n\tif a+b >= x && a <= x {\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5538, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s831115993", "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\t\"strings\"\n)\n\nfunc main() {\n\tn := readInt()\n\tvec := readIntLine()\n\n\t// copy\n\tcpVec := make([]int, len(vec))\n\tcopy(cpVec, vec)\n\tsort.Ints(cpVec)\n\n\tleft := cpVec[n/2-1]\n\tright := cpVec[n/2]\n\n\tfor _, v := range vec {\n\t\tif v <= left {\n\t\t\tfmt.Println(right)\n\t\t} else if v >= right {\n\t\t\tfmt.Println(left)\n\t\t} else {\n\t\t\tfmt.Println(\"ERR\")\n\t\t}\n\t}\n\n\t// fmt.Println(n)\n\t// fmt.Println(vec)\n\t// fmt.Println(cpVec)\n}\n\nfunc readInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readIntLine() []int {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tline := sc.Text()\n\tvals := strings.Split(line, \" \")\n\tvec := make([]int, 0)\n\tfor _, v := range vals {\n\t\t// n, err := strconv.ParseInt(v, 10, 64)\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvec = append(vec, n)\n\t}\n\treturn vec\n}\n", "language": "Go", "metadata": {"date": 1523974870, "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/s831115993.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s831115993", "user_id": "u767817447"}, "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\t\"strings\"\n)\n\nfunc main() {\n\tn := readInt()\n\tvec := readIntLine()\n\n\t// copy\n\tcpVec := make([]int, len(vec))\n\tcopy(cpVec, vec)\n\tsort.Ints(cpVec)\n\n\tleft := cpVec[n/2-1]\n\tright := cpVec[n/2]\n\n\tfor _, v := range vec {\n\t\tif v <= left {\n\t\t\tfmt.Println(right)\n\t\t} else if v >= right {\n\t\t\tfmt.Println(left)\n\t\t} else {\n\t\t\tfmt.Println(\"ERR\")\n\t\t}\n\t}\n\n\t// fmt.Println(n)\n\t// fmt.Println(vec)\n\t// fmt.Println(cpVec)\n}\n\nfunc readInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readIntLine() []int {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tline := sc.Text()\n\tvals := strings.Split(line, \" \")\n\tvec := make([]int, 0)\n\tfor _, v := range vals {\n\t\t// n, err := strconv.ParseInt(v, 10, 64)\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvec = append(vec, n)\n\t}\n\treturn vec\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 853, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228163426", "group_id": "codeNet:p03380", "input_text": "// 最大値がnで中央値に一番近いやつがmっぽい lower_boundとupper_boundで見つける\npackage 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\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tif N == 2 {\n\t\tfmt.Println(A[1], A[0])\n\t}\n\tP := A[N-1]\n\tQ1 := A[sort.Search(N, func(j int) bool {\n\t\treturn P/2 <= A[j]\n\t})]\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tQ2 := A[sort.Search(N, func(j int) bool {\n\t\treturn P/2 >= A[j]\n\t})]\n\n\tif float64(P)/2.0-float64(Q1) < float64(P)/2.0-float64(Q2) {\n\t\tfmt.Println(P, Q1)\n\t} else {\n\t\tfmt.Println(P, Q2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591798664, "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/s228163426.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s228163426", "user_id": "u445624660"}, "prompt_components": {"gold_output": "11 6\n", "input_to_evaluate": "// 最大値がnで中央値に一番近いやつがmっぽい lower_boundとupper_boundで見つける\npackage 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\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\tsort.Ints(A)\n\tif N == 2 {\n\t\tfmt.Println(A[1], A[0])\n\t}\n\tP := A[N-1]\n\tQ1 := A[sort.Search(N, func(j int) bool {\n\t\treturn P/2 <= A[j]\n\t})]\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tQ2 := A[sort.Search(N, func(j int) bool {\n\t\treturn P/2 >= A[j]\n\t})]\n\n\tif float64(P)/2.0-float64(Q1) < float64(P)/2.0-float64(Q2) {\n\t\tfmt.Println(P, Q1)\n\t} else {\n\t\tfmt.Println(P, Q2)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 622, "cpu_time_ms": 713, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s249594211", "group_id": "codeNet:p03380", "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\tas := make([]int, n)\n\tmx := -1\n\tmxIndex := -1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\n\t\tif mx < as[i] {\n\t\t\tmx = as[i]\n\t\t\tmxIndex = i\n\t\t}\n\t}\n\n\thalf := mx / 2\n\thalf2 := mx/2 + 1\n\n\tt := 0\n\tfor i := 0; i < n; i++ {\n\t\tif i == mxIndex {\n\t\t\tcontinue\n\t\t}\n\t\tif abs(half-t) > abs(half-as[i]) {\n\t\t\tt = as[i]\n\t\t}\n\t\tif abs(half2-t) > abs(half2-as[i]) {\n\t\t\tt = as[i]\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", mx, t)\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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1584031846, "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/s249594211.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s249594211", "user_id": "u433254839"}, "prompt_components": {"gold_output": "11 6\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\tas := make([]int, n)\n\tmx := -1\n\tmxIndex := -1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\n\t\tif mx < as[i] {\n\t\t\tmx = as[i]\n\t\t\tmxIndex = i\n\t\t}\n\t}\n\n\thalf := mx / 2\n\thalf2 := mx/2 + 1\n\n\tt := 0\n\tfor i := 0; i < n; i++ {\n\t\tif i == mxIndex {\n\t\t\tcontinue\n\t\t}\n\t\tif abs(half-t) > abs(half-as[i]) {\n\t\t\tt = as[i]\n\t\t}\n\t\tif abs(half2-t) > abs(half2-as[i]) {\n\t\t\tt = as[i]\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\", mx, t)\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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 136, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s291871872", "group_id": "codeNet:p03380", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tvar n int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d\", &n)\n\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\tfmt.Sscanf(scanner.Text(), \"%d\", &as[i])\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tm := as[len(as)-1]\n\tas = as[0 : len(as)-1]\n\tindex := sort.SearchInts(as, m/2)\n\n\tif index == len(as) {\n\t\tfmt.Println(m, as[index-1])\n\t\treturn\n\t}\n\tif index == 0 {\n\t\tfmt.Println(m, as[index])\n\t\treturn\n\t}\n\tif combination(m, as[index]) > combination(m, as[index-1]) {\n\t\tfmt.Println(m, as[index])\n\t} else {\n\t\tfmt.Println(m, as[index-1])\n\t}\n}\n\nfunc max(ns ...int) int {\n\tret := math.MinInt64\n\tfor _, n := range ns {\n\t\tif n > ret {\n\t\t\tret = n\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc combination(a, b int) int {\n\tif a-b < b {\n\t\treturn combination(a, a-b)\n\t}\n\tprod := 1\n\tfor i := 0; i < b; i++ {\n\t\tprod = prod * (a - i) //% MOD\n\t}\n\tf := factorial(b)\n\t//return prod * inverse(f) % MOD\n\treturn prod / f\n}\n\nfunc power(a, pow int) int {\n\tif pow == 0 {\n\t\treturn 1\n\t} else if pow == 1 {\n\t\treturn a\n\t} else if pow%2 == 0 {\n\t\trt := power(a, pow/2)\n\t\treturn rt * rt //% MOD\n\t} else {\n\t\treturn a * power(a, pow-1) //% MOD\n\t}\n}\n\nfunc factorial(n int) int {\n\tret := 1\n\tfor n >= 1 {\n\t\tret = ret * n\n\t\tn--\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1549162599, "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/s291871872.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s291871872", "user_id": "u381572327"}, "prompt_components": {"gold_output": "11 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tvar n int\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d\", &n)\n\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\tfmt.Sscanf(scanner.Text(), \"%d\", &as[i])\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tm := as[len(as)-1]\n\tas = as[0 : len(as)-1]\n\tindex := sort.SearchInts(as, m/2)\n\n\tif index == len(as) {\n\t\tfmt.Println(m, as[index-1])\n\t\treturn\n\t}\n\tif index == 0 {\n\t\tfmt.Println(m, as[index])\n\t\treturn\n\t}\n\tif combination(m, as[index]) > combination(m, as[index-1]) {\n\t\tfmt.Println(m, as[index])\n\t} else {\n\t\tfmt.Println(m, as[index-1])\n\t}\n}\n\nfunc max(ns ...int) int {\n\tret := math.MinInt64\n\tfor _, n := range ns {\n\t\tif n > ret {\n\t\t\tret = n\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc combination(a, b int) int {\n\tif a-b < b {\n\t\treturn combination(a, a-b)\n\t}\n\tprod := 1\n\tfor i := 0; i < b; i++ {\n\t\tprod = prod * (a - i) //% MOD\n\t}\n\tf := factorial(b)\n\t//return prod * inverse(f) % MOD\n\treturn prod / f\n}\n\nfunc power(a, pow int) int {\n\tif pow == 0 {\n\t\treturn 1\n\t} else if pow == 1 {\n\t\treturn a\n\t} else if pow%2 == 0 {\n\t\trt := power(a, pow/2)\n\t\treturn rt * rt //% MOD\n\t} else {\n\t\treturn a * power(a, pow-1) //% MOD\n\t}\n}\n\nfunc factorial(n int) int {\n\tret := 1\n\tfor n >= 1 {\n\t\tret = ret * n\n\t\tn--\n\t}\n\treturn ret\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1343, "cpu_time_ms": 1237, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s128544971", "group_id": "codeNet:p03385", "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\tfor _, v := range []string{\"a\", \"b\", \"c\"} {\n\t\tif !strings.Contains(S, v) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1571743548, "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/s128544971.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s128544971", "user_id": "u298152049"}, "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\tfor _, v := range []string{\"a\", \"b\", \"c\"} {\n\t\tif !strings.Contains(S, v) {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 222, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s798779163", "group_id": "codeNet:p03386", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b, &k)\n\n\tmax := a\n\tfor i := a; i < a+k; i++ {\n\t\tif i <= b {\n\t\t\tfmt.Println(i)\n\t\t\tmax = i\n\t\t}\n\t}\n\n\tfor i := max; i <= b; i++ {\n\t\tif i >= b-k+1 {\n\t\t\tfmt.Println(i)\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1589823807, "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/s798779163.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s798779163", "user_id": "u346986631"}, "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, k int\n\tfmt.Scan(&a, &b, &k)\n\n\tmax := a\n\tfor i := a; i < a+k; i++ {\n\t\tif i <= b {\n\t\t\tfmt.Println(i)\n\t\t\tmax = i\n\t\t}\n\t}\n\n\tfor i := max; i <= b; i++ {\n\t\tif i >= b-k+1 {\n\t\t\tfmt.Println(i)\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 251, "cpu_time_ms": 973, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s095927587", "group_id": "codeNet:p03386", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, K int\n\tfmt.Scan(&A, &B, &K)\n\tpo := false\n\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Println(A + i)\n\t\tif A+i == B {\n\t\t\tpo = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif po {\n\t\treturn\n\t}\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Println(B - K + i)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1526333380, "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/s095927587.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s095927587", "user_id": "u061935128"}, "prompt_components": {"gold_output": "3\n4\n7\n8\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\tpo := false\n\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Println(A + i)\n\t\tif A+i == B {\n\t\t\tpo = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif po {\n\t\treturn\n\t}\n\tfor i := 0; i < K; i++ {\n\t\tfmt.Println(B - K + i)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s577364690", "group_id": "codeNet:p03387", "input_text": "package main\n\nimport \"fmt\"\n\nfunc getInput() (int, int, int) {\n\ta, b, c := 0, 0, 0\n\tfmt.Scan(&a, &b, &c)\n\treturn a, b, c\n}\n\nfunc sort(c []int) []int {\n\tif c[0] > c[1] {\n\t\tc[0], c[1] = c[1], c[0]\n\t}\n\tif c[1] > c[2] {\n\t\tc[1], c[2] = c[2], c[1]\n\t}\n\tif c[0] > c[1] {\n\t\tc[0], c[1] = c[1], c[0]\n\t}\n\treturn c\n}\n\nfunc C() {\n\tc := []int{0, 0, 0}\n\tc[0], c[1], c[2] = getInput()\n\tc = sort(c)\n\n\tdiff1 := c[2] - c[1]\n\tdiff2 := c[1] - c[0]\n\n\tif diff1%2 == 0 && diff2%2 == 0 {\n\t\tcount := (diff1*2 + diff2) / 2\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 1 && diff2%2 == 0 {\n\t\tcount := diff1 + diff2/2\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 0 && diff2%2 == 1 {\n\t\tcount := diff1/2 + (c[2]-c[0]+1)/2 + 1\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 1 && diff2%2 == 1 {\n\t\tcount := (diff1+1)/2 + (diff1+diff2)/2 + 1\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n}\n\nfunc main() {\n C()\n}\n", "language": "Go", "metadata": {"date": 1564364771, "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/s577364690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s577364690", "user_id": "u911419846"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc getInput() (int, int, int) {\n\ta, b, c := 0, 0, 0\n\tfmt.Scan(&a, &b, &c)\n\treturn a, b, c\n}\n\nfunc sort(c []int) []int {\n\tif c[0] > c[1] {\n\t\tc[0], c[1] = c[1], c[0]\n\t}\n\tif c[1] > c[2] {\n\t\tc[1], c[2] = c[2], c[1]\n\t}\n\tif c[0] > c[1] {\n\t\tc[0], c[1] = c[1], c[0]\n\t}\n\treturn c\n}\n\nfunc C() {\n\tc := []int{0, 0, 0}\n\tc[0], c[1], c[2] = getInput()\n\tc = sort(c)\n\n\tdiff1 := c[2] - c[1]\n\tdiff2 := c[1] - c[0]\n\n\tif diff1%2 == 0 && diff2%2 == 0 {\n\t\tcount := (diff1*2 + diff2) / 2\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 1 && diff2%2 == 0 {\n\t\tcount := diff1 + diff2/2\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 0 && diff2%2 == 1 {\n\t\tcount := diff1/2 + (c[2]-c[0]+1)/2 + 1\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n\n\tif diff1%2 == 1 && diff2%2 == 1 {\n\t\tcount := (diff1+1)/2 + (diff1+diff2)/2 + 1\n\t\tfmt.Println(count)\n\t\treturn\n\t}\n}\n\nfunc main() {\n C()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 872, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409243864", "group_id": "codeNet:p03387", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tns := make([]int, 3)\n\tfmt.Scan(&ns[0], &ns[1], &ns[2])\n\tsort.Ints(ns)\n\n\tswitch {\n\tcase ns[0]%2 == ns[1]%2 && ns[0]%2 == ns[2]%2:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2)\n\tcase ns[2]%2 != ns[0]%2 && ns[2]%2 != ns[1]%2:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2 + 1)\n\tdefault:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2 + 2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560527765, "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/s409243864.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s409243864", "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\tns := make([]int, 3)\n\tfmt.Scan(&ns[0], &ns[1], &ns[2])\n\tsort.Ints(ns)\n\n\tswitch {\n\tcase ns[0]%2 == ns[1]%2 && ns[0]%2 == ns[2]%2:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2)\n\tcase ns[2]%2 != ns[0]%2 && ns[2]%2 != ns[1]%2:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2 + 1)\n\tdefault:\n\t\tfmt.Println((ns[2]-ns[0])/2 + (ns[2]-ns[1])/2 + 2)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s099635946", "group_id": "codeNet:p03393", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s == \"zyxwvutsrqponmlkjihgfedcba\" {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\tif len(s) < 26 {\n\t\talp := make([]int, 'z'-'a'+1)\n\t\tfor _, ss := range s {\n\t\t\talp[ss-'a']++\n\t\t}\n\t\tfor i, v := range alp {\n\t\t\tif v == 0 {\n\t\t\t\tfmt.Println(s + string('a'+i))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sl, sr string\n\tfor i := len(s) - 1; i >= 1; i-- {\n\t\tif s[i-1] > s[i] {\n\t\t\tsl = s[:i]\n\t\t\tsr = s[i+1:]\n\t\t\tbreak\n\t\t}\n\t}\n\tsmallest := 'z'\n\tfor _, v := range sr {\n\t\tif v < smallest {\n\t\t\tsmallest = v\n\t\t}\n\t}\n\tfmt.Println(sl + string(smallest))\n}\n", "language": "Go", "metadata": {"date": 1559249454, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03393.html", "problem_id": "p03393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03393/input.txt", "sample_output_relpath": "derived/input_output/data/p03393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03393/Go/s099635946.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s099635946", "user_id": "u554269352"}, "prompt_components": {"gold_output": "atcoderb\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s == \"zyxwvutsrqponmlkjihgfedcba\" {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\tif len(s) < 26 {\n\t\talp := make([]int, 'z'-'a'+1)\n\t\tfor _, ss := range s {\n\t\t\talp[ss-'a']++\n\t\t}\n\t\tfor i, v := range alp {\n\t\t\tif v == 0 {\n\t\t\t\tfmt.Println(s + string('a'+i))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sl, sr string\n\tfor i := len(s) - 1; i >= 1; i-- {\n\t\tif s[i-1] > s[i] {\n\t\t\tsl = s[:i]\n\t\t\tsr = s[i+1:]\n\t\t\tbreak\n\t\t}\n\t}\n\tsmallest := 'z'\n\tfor _, v := range sr {\n\t\tif v < smallest {\n\t\t\tsmallest = v\n\t\t}\n\t}\n\tfmt.Println(sl + string(smallest))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "sample_input": "atcoder\n"}, "reference_outputs": ["atcoderb\n"], "source_document_id": "p03393", "source_text": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 584, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s576099218", "group_id": "codeNet:p03393", "input_text": "package main\n\nimport (\n \"fmt\"\n // \"sort\"\n)\n\nfunc main() {\n // var n int\n // fmt.Scan(&n, &x)\n // nums := make([]int,n);\n // m := make(map[int]int)\n\n var s string\n fmt.Scan(&s)\n a := make([]int ,26)\n\n for i := 0; i < len(s); i++ {\n \ta[s[i]-'a']=i+1\n }\n b := \"abcdefghijklmnopqrstuvwxyz\"\n\n for i := 0; i < len(a); i++ {\n \tif a[i]==0 {\n\t\t\tfmt.Println(s+b[i:i+1])\n\t\t\treturn\n \t}\n\t}\n\n for i := 0; i < len(s); i++ {\n \ta[i]=0\n }\n\ta[s[25]-'a'] = 1\n for i := 24; 0 <= i; i-- {\n \tif s[i]0 {\n\t\t\t\t\tfmt.Println(s[0:i]+b[t:t+1]) \t\t\t\t\n\t\t\t\t\treturn\n \t\t\t}\n \t\t}\n \t} else {\n \t\ta[s[i]-'a'] = 1\n \t} \t\n\t}\n\t\n\n\tfmt.Println(-1)\n}", "language": "Go", "metadata": {"date": 1546732541, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03393.html", "problem_id": "p03393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03393/input.txt", "sample_output_relpath": "derived/input_output/data/p03393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03393/Go/s576099218.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576099218", "user_id": "u238640707"}, "prompt_components": {"gold_output": "atcoderb\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n // \"sort\"\n)\n\nfunc main() {\n // var n int\n // fmt.Scan(&n, &x)\n // nums := make([]int,n);\n // m := make(map[int]int)\n\n var s string\n fmt.Scan(&s)\n a := make([]int ,26)\n\n for i := 0; i < len(s); i++ {\n \ta[s[i]-'a']=i+1\n }\n b := \"abcdefghijklmnopqrstuvwxyz\"\n\n for i := 0; i < len(a); i++ {\n \tif a[i]==0 {\n\t\t\tfmt.Println(s+b[i:i+1])\n\t\t\treturn\n \t}\n\t}\n\n for i := 0; i < len(s); i++ {\n \ta[i]=0\n }\n\ta[s[25]-'a'] = 1\n for i := 24; 0 <= i; i-- {\n \tif s[i]0 {\n\t\t\t\t\tfmt.Println(s[0:i]+b[t:t+1]) \t\t\t\t\n\t\t\t\t\treturn\n \t\t\t}\n \t\t}\n \t} else {\n \t\ta[s[i]-'a'] = 1\n \t} \t\n\t}\n\t\n\n\tfmt.Println(-1)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "sample_input": "atcoder\n"}, "reference_outputs": ["atcoderb\n"], "source_document_id": "p03393", "source_text": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s145657017", "group_id": "codeNet:p03393", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar dic = []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\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tsar := strings.Split(S, \"\")\n\n\tif len(sar) == 26 {\n\t\tfor i := len(sar) - 1; i >= 0; i-- {\n\t\t\tlw := sar[i]\n\t\t\tdi := indexpath(dic, lw)\n\t\t\tnx := di - 1\n\t\t\tif nx < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsi := indexpath(sar, dic[nx])\n\n\t\t\tif si > i {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar restr string\n\t\t\tfor j := 0; j < si; j++ {\n\t\t\t\trestr += sar[j]\n\t\t\t}\n\t\t\tfmt.Println(restr + lw)\n\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(-1)\n\t} else {\n\t\tres := removes(dic, sar)\n\t\ts := S + res[0]\n\t\tfmt.Print(s)\n\t}\n\n}\nfunc index(slice []string, item []string) int {\n\tn := -1\n\tfor i := 0; i < len(slice); i++ {\n\t\tfor k := 0; k < len(item); k++ {\n\t\t\tif slice[i] == item[k] {\n\t\t\t\tif i > n {\n\t\t\t\t\tn = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn n\n}\n\nfunc indexpath(slice []string, item string) int {\n\tfor i := 0; i < len(slice); i++ {\n\t\tif slice[i] == item {\n\t\t\treturn i\n\t\t}\n\n\t}\n\treturn -1\n}\n\nfunc removes(ss []string, search []string) []string {\n\tresult := []string{}\n\tvar res bool\n\tfor i := 0; i < len(ss); i++ {\n\t\tres = true\n\t\tfor k := 0; k < len(search); k++ {\n\t\t\tif ss[i] == search[k] {\n\t\t\t\tres = false\n\t\t\t}\n\t\t}\n\t\tif res {\n\t\t\tresult = append(result, ss[i])\n\t\t}\n\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1522571954, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03393.html", "problem_id": "p03393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03393/input.txt", "sample_output_relpath": "derived/input_output/data/p03393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03393/Go/s145657017.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s145657017", "user_id": "u914114463"}, "prompt_components": {"gold_output": "atcoderb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar dic = []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\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\tsar := strings.Split(S, \"\")\n\n\tif len(sar) == 26 {\n\t\tfor i := len(sar) - 1; i >= 0; i-- {\n\t\t\tlw := sar[i]\n\t\t\tdi := indexpath(dic, lw)\n\t\t\tnx := di - 1\n\t\t\tif nx < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsi := indexpath(sar, dic[nx])\n\n\t\t\tif si > i {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar restr string\n\t\t\tfor j := 0; j < si; j++ {\n\t\t\t\trestr += sar[j]\n\t\t\t}\n\t\t\tfmt.Println(restr + lw)\n\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(-1)\n\t} else {\n\t\tres := removes(dic, sar)\n\t\ts := S + res[0]\n\t\tfmt.Print(s)\n\t}\n\n}\nfunc index(slice []string, item []string) int {\n\tn := -1\n\tfor i := 0; i < len(slice); i++ {\n\t\tfor k := 0; k < len(item); k++ {\n\t\t\tif slice[i] == item[k] {\n\t\t\t\tif i > n {\n\t\t\t\t\tn = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn n\n}\n\nfunc indexpath(slice []string, item string) int {\n\tfor i := 0; i < len(slice); i++ {\n\t\tif slice[i] == item {\n\t\t\treturn i\n\t\t}\n\n\t}\n\treturn -1\n}\n\nfunc removes(ss []string, search []string) []string {\n\tresult := []string{}\n\tvar res bool\n\tfor i := 0; i < len(ss); i++ {\n\t\tres = true\n\t\tfor k := 0; k < len(search); k++ {\n\t\t\tif ss[i] == search[k] {\n\t\t\t\tres = false\n\t\t\t}\n\t\t}\n\t\tif res {\n\t\t\tresult = append(result, ss[i])\n\t\t}\n\n\t}\n\treturn result\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "sample_input": "atcoder\n"}, "reference_outputs": ["atcoderb\n"], "source_document_id": "p03393", "source_text": "Score : 300 points\n\nProblem Statement\n\nGotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order.\n\nA word is called diverse if and only if it is a nonempty string of English lowercase letters and all letters in the word are distinct. For example, atcoder, zscoder and agc are diverse words while gotou and connect aren't diverse words.\n\nGiven a diverse word S, determine the next word that appears after S in the dictionary, i.e. the lexicographically smallest diverse word that is lexicographically larger than S, or determine that it doesn't exist.\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 \\leq |S| \\leq 26\n\nS is a diverse word.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the next word that appears after S in the dictionary, or -1 if it doesn't exist.\n\nSample Input 1\n\natcoder\n\nSample Output 1\n\natcoderb\n\natcoderb is the lexicographically smallest diverse word that is lexicographically larger than atcoder. Note that atcoderb is lexicographically smaller than b.\n\nSample Input 2\n\nabc\n\nSample Output 2\n\nabcd\n\nSample Input 3\n\nzyxwvutsrqponmlkjihgfedcba\n\nSample Output 3\n\n-1\n\nThis is the lexicographically largest diverse word, so the answer is -1.\n\nSample Input 4\n\nabcdefghijklmnopqrstuvwzyx\n\nSample Output 4\n\nabcdefghijklmnopqrstuvx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1345, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s897248783", "group_id": "codeNet:p03399", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d float64\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tfmt.Println(math.Min(a, b) + math.Min(c, d))\n}\n", "language": "Go", "metadata": {"date": 1546789276, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03399.html", "problem_id": "p03399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03399/input.txt", "sample_output_relpath": "derived/input_output/data/p03399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03399/Go/s897248783.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s897248783", "user_id": "u645859552"}, "prompt_components": {"gold_output": "520\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d float64\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tfmt.Println(math.Min(a, b) + math.Min(c, d))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "sample_input": "600\n300\n220\n420\n"}, "reference_outputs": ["520\n"], "source_document_id": "p03399", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou planned a trip using trains and buses.\nThe train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket.\nSimilarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy an unlimited ticket.\n\nFind the minimum total fare when the optimal choices are made for trains and buses.\n\nConstraints\n\n1 \\leq A \\leq 1 000\n\n1 \\leq B \\leq 1 000\n\n1 \\leq C \\leq 1 000\n\n1 \\leq D \\leq 1 000\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\n\nOutput\n\nPrint the minimum total fare.\n\nSample Input 1\n\n600\n300\n220\n420\n\nSample Output 1\n\n520\n\nThe train fare will be 600 yen if you buy ordinary tickets, and 300 yen if you buy an unlimited ticket.\nThus, the optimal choice for trains is to buy an unlimited ticket for 300 yen.\nOn the other hand, the optimal choice for buses is to buy ordinary tickets for 220 yen.\n\nTherefore, the minimum total fare is 300 + 220 = 520 yen.\n\nSample Input 2\n\n555\n555\n400\n200\n\nSample Output 2\n\n755\n\nSample Input 3\n\n549\n817\n715\n603\n\nSample Output 3\n\n1152", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s059518728", "group_id": "codeNet:p03401", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"math\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tN := inputLineAsNumArray(1)[0]\n\tspots := inputLineAsNumArray(N)\n\n spots = append([]int{0}, spots...)\n spots = append(spots, 0)\n var dirs []bool\n base := int(math.Abs(float64(spots[0])))\n\tfor i:=0; i spots[i+1] {\n dirs = append(dirs, false)\n } else {\n dirs = append(dirs, dirs[i-1])\n }\n base += int(math.Abs(float64(spots[i]-spots[i+1])))\n\t}\n\n\tfor i:=1; i spots[i+1] {\n dirs = append(dirs, false)\n } else {\n dirs = append(dirs, dirs[i-1])\n }\n base += int(math.Abs(float64(spots[i]-spots[i+1])))\n\t}\n\n\tfor i:=1; i inner.x && outer.y > inner.y\n}\n\nfunc wordScanner() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\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": 1563037315, "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/s034920659.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s034920659", "user_id": "u889640107"}, "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 Point struct {\n\tx int\n\ty int\n\tin int\n}\n\ntype Points []Point\n\nfunc (l Points) Len() int {\n\treturn len(l)\n}\n\nfunc (l Points) Less(i, j int) bool {\n\treturn l[i].in < l[j].in || l[i].x*l[i].y < l[j].x*l[j].y\n}\n\nfunc (l Points) Swap(i, j int) {\n\tl[i], l[j] = l[j], l[i]\n}\n\nfunc main() {\n\ts := wordScanner()\n\n\tvar n int\n\tscanInts(s, &n)\n\n\treds := make(Points, n)\n\tfor i := range reds {\n\t\tscanInts(s, &reds[i].x, &reds[i].y)\n\t}\n\n\tblues := make(Points, n)\n\tfor i := range blues {\n\t\tscanInts(s, &blues[i].x, &blues[i].y)\n\t}\n\n\tsort.Sort(reds)\n\n\tfor i, b := range blues {\n\t\tfor _, r := range reds {\n\t\t\tif isInner(r, b) {\n\t\t\t\tblues[i].in++\n\t\t\t}\n\t\t}\n\t}\n\tsort.Sort(blues)\n\n\tc := 0\n\tfor _, r := range reds {\n\t\tfor j, b := range blues {\n\t\t\tif isInner(r, b) {\n\t\t\t\tblues = append(blues[:j], blues[j+1:]...)\n\t\t\t\tc++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n\nfunc isInner(inner, outer Point) bool {\n\treturn outer.x > inner.x && outer.y > inner.y\n}\n\nfunc wordScanner() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s494088732", "group_id": "codeNet:p03415", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tc := make([]string, 3)\n\tfor i := range c {\n\t\tfmt.Scan(&c[i])\n\t}\n\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Print(string(c[i][i]))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1555357956, "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/s494088732.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s494088732", "user_id": "u102310764"}, "prompt_components": {"gold_output": "abc\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tc := make([]string, 3)\n\tfor i := range c {\n\t\tfmt.Scan(&c[i])\n\t}\n\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Print(string(c[i][i]))\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s815985170", "group_id": "codeNet:p03416", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tsum := 0\n\tfor i := a; i <= b; i++ {\n\t\tif i/10000 == i%10 && i/1000%10 == i/10%10 {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1558753356, "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/s815985170.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s815985170", "user_id": "u375977529"}, "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\tsum := 0\n\tfor i := a; i <= b; i++ {\n\t\tif i/10000 == i%10 && i/1000%10 == i/10%10 {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s808542370", "group_id": "codeNet:p03416", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, count int\n fmt.Scan(&a, &b)\n for i := a; i <= b; i++ {\n if palindromic(i) {\n count++\n }\n }\n fmt.Printf(\"%d\\n\", count)\n}\n\nfunc palindromic(input int) bool {\n tmp := input\n digits := []int{}\n for tmp != 0 {\n digits = append(digits, tmp%10)\n tmp /= 10\n }\n for i := 0; i < len(digits)/2; i++ {\n if digits[i] != digits[len(digits)-1-i] {\n return false\n }\n }\n return true\n}", "language": "Go", "metadata": {"date": 1553622670, "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/s808542370.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s808542370", "user_id": "u623007471"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, count int\n fmt.Scan(&a, &b)\n for i := a; i <= b; i++ {\n if palindromic(i) {\n count++\n }\n }\n fmt.Printf(\"%d\\n\", count)\n}\n\nfunc palindromic(input int) bool {\n tmp := input\n digits := []int{}\n for tmp != 0 {\n digits = append(digits, tmp%10)\n tmp /= 10\n }\n for i := 0; i < len(digits)/2; i++ {\n if digits[i] != digits[len(digits)-1-i] {\n return false\n }\n }\n return true\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 640, "cpu_time_ms": 33, "memory_kb": 6400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s454195040", "group_id": "codeNet:p03417", "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\tif N == 2 || M == 2 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tN -= 2\n\tM -= 2\n\n\tif N <= 0 {\n\t\tN = 1\n\t}\n\tif M <= 0 {\n\t\tM = 1\n\t}\n\n\tfmt.Println(N * M)\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": 1587619126, "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/s454195040.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s454195040", "user_id": "u964273035"}, "prompt_components": {"gold_output": "0\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\tif N == 2 || M == 2 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tN -= 2\n\tM -= 2\n\n\tif N <= 0 {\n\t\tN = 1\n\t}\n\tif M <= 0 {\n\t\tM = 1\n\t}\n\n\tfmt.Println(N * M)\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s654552559", "group_id": "codeNet:p03417", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 30 18:56:23 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\tif N == 1 || M == 1 {\n\t\tfmt.Println(N*M - 2)\n\t} else if N == 2 {\n\t\tfmt.Println(N*M - 2*M)\n\t} else if M == 2 {\n\t\tfmt.Println(N*M - 2*N)\n\t} else {\n\t\tfmt.Println((N - 2) * (M - 2))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1546214875, "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/s654552559.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s654552559", "user_id": "u802614675"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 30 18:56:23 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\tif N == 1 || M == 1 {\n\t\tfmt.Println(N*M - 2)\n\t} else if N == 2 {\n\t\tfmt.Println(N*M - 2*M)\n\t} else if M == 2 {\n\t\tfmt.Println(N*M - 2*N)\n\t} else {\n\t\tfmt.Println((N - 2) * (M - 2))\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s521051011", "group_id": "codeNet:p03417", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var N, M int\n fmt.Scan(&N, &M)\n defer fmt.Println((N-2)*(M-2))\n \n if N == 1 {\n N++\n }\n if M == 1 {\n M++\n }\n}", "language": "Go", "metadata": {"date": 1524855296, "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/s521051011.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s521051011", "user_id": "u985217887"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var N, M int\n fmt.Scan(&N, &M)\n defer fmt.Println((N-2)*(M-2))\n \n if N == 1 {\n N++\n }\n if M == 1 {\n M++\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s057500301", "group_id": "codeNet:p03418", "input_text": "package main\n\nimport \"fmt\"\n\nvar N, K int\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tif K == 0 {\n\t\tfmt.Println(N * N)\n\t\treturn\n\t}\n\n\t// (a, b)\n\t// 0 < a,b <= N\n\t// K <= a%b < N\n\t// K < a <= N\n\t// K < b <= N\n\n\tans := 0\n\tfor c := K; c < N; c++ {\n\t\tfor b := c + 1; b <= N; b++ {\n\t\t\tans += (N-c)/b + 1\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1520821730, "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/s057500301.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s057500301", "user_id": "u434572230"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar N, K int\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\n\tif K == 0 {\n\t\tfmt.Println(N * N)\n\t\treturn\n\t}\n\n\t// (a, b)\n\t// 0 < a,b <= N\n\t// K <= a%b < N\n\t// K < a <= N\n\t// K < b <= N\n\n\tans := 0\n\tfor c := K; c < N; c++ {\n\t\tfor b := c + 1; b <= N; b++ {\n\t\t\tans += (N-c)/b + 1\n\t\t}\n\t}\n\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 326, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s469804724", "group_id": "codeNet:p03419", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tfmt.Println(solve(ReadInt(), ReadInt()))\n}\n\nfunc solve(n, m int) int {\n\tn, m = MinMax(n, m)\n\n\tif n == 1 && m == 1 {\n\t\treturn 1\n\t}\n\n\tif n == 1 {\n\t\treturn m - 2\n\t}\n\n\tif n == 2 {\n\t\treturn 0\n\t}\n\n\treturn (n - 2) * (m - 2)\n}\n\nfunc MinMax(slice ...int) (int, int) {\n\tmin, max := slice[0], slice[0]\n\tfor _, v := range slice[1:] {\n\t\tif min > v {\n\t\t\tmin = v\n\t\t} else if max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn min, max\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", "language": "Go", "metadata": {"date": 1593048731, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s469804724.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469804724", "user_id": "u328656362"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tfmt.Println(solve(ReadInt(), ReadInt()))\n}\n\nfunc solve(n, m int) int {\n\tn, m = MinMax(n, m)\n\n\tif n == 1 && m == 1 {\n\t\treturn 1\n\t}\n\n\tif n == 1 {\n\t\treturn m - 2\n\t}\n\n\tif n == 2 {\n\t\treturn 0\n\t}\n\n\treturn (n - 2) * (m - 2)\n}\n\nfunc MinMax(slice ...int) (int, int) {\n\tmin, max := slice[0], slice[0]\n\tfor _, v := range slice[1:] {\n\t\tif min > v {\n\t\t\tmin = v\n\t\t} else if max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn min, max\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s839171187", "group_id": "codeNet:p03419", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tif n == 1 {\n\t\tif m == 1 {\n\t\t\tfmt.Print(1)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Print(m - 2)\n\t\t\treturn\n\t\t}\n\t}\n\n\tcal := (n - 2) * (m - 2)\n\tfmt.Print(cal)\n}\n", "language": "Go", "metadata": {"date": 1579492879, "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/s839171187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s839171187", "user_id": "u303616227"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\n\tif n == 1 {\n\t\tif m == 1 {\n\t\t\tfmt.Print(1)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Print(m - 2)\n\t\t\treturn\n\t\t}\n\t}\n\n\tcal := (n - 2) * (m - 2)\n\tfmt.Print(cal)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228834294", "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 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\tn := getNextInt(scanner)\n\tk := getNextInt(scanner)\n\ts := newSegment(n)\n\tfor i := 1; i < n+1; i++ {\n\t\ts.update(0, i, n/i, s.add)\n\t\ts.update(1, n%i+1, 1, s.add)\n\t}\n\tvar ans int64\n\tfor i := k; i < n; i++ {\n\t\tans += int64(s.query(i, 0, s.add))\n\t}\n\n\tfmt.Fprintln(writer, ans)\n}\n\ntype segment [][]int\n\nfunc newSegment(n int) segment {\n\tseg := make(segment, 0)\n\tfor n > 1 {\n\t\tseg = append(seg, make([]int, n))\n\t\tn = (n + 1) >> 1\n\t}\n\tseg = append(seg, make([]int, 1))\n\treturn seg\n}\nfunc (seg segment) update(l, r int, v int, f func(int, int) int) {\n\tfor h := 0; h < len(seg) && l < r; h++ {\n\t\tif l&1 == 1 {\n\t\t\tseg[h][l] = f(v, seg[h][l])\n\t\t\tl++\n\t\t}\n\t\tl >>= 1\n\t\tif r&1 == 1 {\n\t\t\tseg[h][r-1] = f(v, seg[h][r-1])\n\t\t}\n\t\tr >>= 1\n\t}\n}\nfunc (seg segment) query(i int, s int, f func(int, int) int) int {\n\tfor h := 0; h < len(seg); h++ {\n\t\ts = f(s, seg[h][i>>uint(h)])\n\t}\n\treturn s\n}\nfunc (seg segment) add(x, y int) int {\n\treturn x + y\n}\n", "language": "Go", "metadata": {"date": 1595306599, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s228834294.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s228834294", "user_id": "u150542210"}, "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 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\tn := getNextInt(scanner)\n\tk := getNextInt(scanner)\n\ts := newSegment(n)\n\tfor i := 1; i < n+1; i++ {\n\t\ts.update(0, i, n/i, s.add)\n\t\ts.update(1, n%i+1, 1, s.add)\n\t}\n\tvar ans int64\n\tfor i := k; i < n; i++ {\n\t\tans += int64(s.query(i, 0, s.add))\n\t}\n\n\tfmt.Fprintln(writer, ans)\n}\n\ntype segment [][]int\n\nfunc newSegment(n int) segment {\n\tseg := make(segment, 0)\n\tfor n > 1 {\n\t\tseg = append(seg, make([]int, n))\n\t\tn = (n + 1) >> 1\n\t}\n\tseg = append(seg, make([]int, 1))\n\treturn seg\n}\nfunc (seg segment) update(l, r int, v int, f func(int, int) int) {\n\tfor h := 0; h < len(seg) && l < r; h++ {\n\t\tif l&1 == 1 {\n\t\t\tseg[h][l] = f(v, seg[h][l])\n\t\t\tl++\n\t\t}\n\t\tl >>= 1\n\t\tif r&1 == 1 {\n\t\t\tseg[h][r-1] = f(v, seg[h][r-1])\n\t\t}\n\t\tr >>= 1\n\t}\n}\nfunc (seg segment) query(i int, s int, f func(int, int) int) int {\n\tfor h := 0; h < len(seg); h++ {\n\t\ts = f(s, seg[h][i>>uint(h)])\n\t}\n\treturn s\n}\nfunc (seg segment) add(x, y int) int {\n\treturn x + y\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2140, "cpu_time_ms": 50, "memory_kb": 3520}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s646700381", "group_id": "codeNet:p03423", "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 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 = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := intScanner()\n\tfmt.Println(n / 3)\n}\n", "language": "Go", "metadata": {"date": 1594266790, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s646700381.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s646700381", "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 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 = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := intScanner()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1216, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s485009051", "group_id": "codeNet:p03423", "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.nextInt()\n\n\tfmt.Fprintln(wtr, N/3)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1576460654, "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/s485009051.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s485009051", "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\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\n\tfmt.Fprintln(wtr, N/3)\n\twtr.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1691, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s852703085", "group_id": "codeNet:p03424", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar S []string\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &N)\n\n\tS = make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%s\", &S[i])\n\t}\n\n\tm := make(map[string]bool)\n\tfor i := 0; i < len(S); i++ {\n\t\tm[S[i]] = true\n\t}\n\n\tans := 0\n\tfor _, v := range m {\n\t\tif v {\n\t\t\tans++\n\t\t}\n\t}\n\n\tif ans == 4 {\n\t\tfmt.Println(\"Four\")\n\t} else if ans == 3 {\n\t\tfmt.Println(\"Three\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1520215673, "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/s852703085.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s852703085", "user_id": "u434572230"}, "prompt_components": {"gold_output": "Four\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar N int\nvar S []string\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &N)\n\n\tS = make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%s\", &S[i])\n\t}\n\n\tm := make(map[string]bool)\n\tfor i := 0; i < len(S); i++ {\n\t\tm[S[i]] = true\n\t}\n\n\tans := 0\n\tfor _, v := range m {\n\t\tif v {\n\t\t\tans++\n\t\t}\n\t}\n\n\tif ans == 4 {\n\t\tfmt.Println(\"Four\")\n\t} else if ans == 3 {\n\t\tfmt.Println(\"Three\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 399, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s826520315", "group_id": "codeNet:p03425", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\n\tm := map[rune]int{'M': 0, 'A': 1, 'R': 2, 'C': 3, 'H': 4}\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ts := next()\n\t\tv[m[rune(s[0])]]++\n\t}\n\n\tsum := 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\tsum += v[i] * v[j] * v[k]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n}", "language": "Go", "metadata": {"date": 1560557394, "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/s826520315.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s826520315", "user_id": "u703739962"}, "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 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\n\tm := map[rune]int{'M': 0, 'A': 1, 'R': 2, 'C': 3, 'H': 4}\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ts := next()\n\t\tv[m[rune(s[0])]]++\n\t}\n\n\tsum := 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\tsum += v[i] * v[j] * v[k]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 21, "memory_kb": 1536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s725283632", "group_id": "codeNet:p03425", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 30 22:53:11 2018\n//\npackage main\n\nimport \"fmt\"\n\nfunc bits(b int) int {\n\tret := 0\n\tfor i := byte(0); i < 32; i++ {\n\t\tif b&(1<= 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": 1520216576, "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/s736547234.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s736547234", "user_id": "u504669764"}, "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 := NewScanner()\n\tN := sc.NextInt()\n\tmp := map[byte]int{}\n\tfor i := 0; i < N; i++ {\n\t\tl := sc.NextLine()\n\t\tswitch l[0] {\n\t\tcase 'M', 'A', 'R', 'C', 'H':\n\t\t\tmp[l[0]]++\n\t\t}\n\t}\n\ttup := make([]int, 5)\n\ti := 0\n\tfor _, v := range mp {\n\t\ttup[i] = v\n\t\ti++\n\t}\n\n\tans := 0\n\tfor i := 0; i < 5; i++ {\n\t\tfor j := i + 1; j < 5; j++ {\n\t\t\tfor k := j + 1; k < 5; k++ {\n\t\t\t\tans += tup[i] * tup[j] * tup[k]\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2323, "cpu_time_ms": 33, "memory_kb": 2688}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s207263222", "group_id": "codeNet:p03428", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Dist(mode int, A ...*[]float64) float64 {\n if len(A) < 1 { return 0.0 }\n if len(A) < 2 { A = append(A, &[]float64{0.0, 0.0}) }\n D := 0.0\n for i := range (*A[0]) {\n x := (*A[0])[i] - (*A[1])[i]\n D += x * x\n }\n if mode == 1 { D = math.Sqrt(D) }\n return D\n}\nfunc InnerProduct(A, B *[]float64) float64 {\n IP := 0.0\n for i, a := range (*A) {\n IP += a * (*B)[i]\n }\n return IP\n}\nfunc Angle(A ...*[]float64) float64 {\n if len(A) < 2 { return 0.0 }\n if len(A) < 3 {\n a := make([]float64, len((*A[0])))\n A = append(A, &a)\n }\n _A := make([]float64, len((*A[0])))\n _B := make([]float64, len((*A[0])))\n for i := range (*A[0]) {\n _A[i] = (*A[0])[i] - (*A[2])[i]\n _B[i] = (*A[1])[i] - (*A[2])[i]\n }\n acos := math.Acos(InnerProduct(&_A, &_B) / Dist(1, &_A) / Dist(1, &_B))\n theta := acos / math.Pi * 180.0\n _A_ := []float64{-_A[1], _A[0]}\n if InnerProduct(&_A_, &_B) < 0 { theta = 360 - theta }\n return theta\n}\nfunc TriangleArea(mode int, A ...*[]float64) float64 {\n if len(A) < 2 { return 0.0 }\n if len(A) < 3 {\n _A := make([]*[]float64, 0)\n a := make([]float64, len((*A[0])))\n _A = append(_A, &a)\n A = append(_A, A...)\n }\n AB := []float64{(*A[1])[0] - (*A[0])[0], (*A[1])[1] - (*A[0])[1]}\n AC := []float64{(*A[2])[0] - (*A[0])[0], (*A[2])[1] - (*A[0])[1]}\n S := math.Abs(AB[0] * AC[1] - AB[1] * AC[0])\n if mode == 1 { S /= 2.0 }\n return S\n}\nfunc OuterCircle(A, B, C *[]float64) (X, Y, R float64) {\n AB := []float64{(*B)[0] - (*A)[0], (*B)[1] - (*A)[1]}\n AC := []float64{(*C)[0] - (*A)[0], (*C)[1] - (*A)[1]}\n AB2 := Dist(2, &AB)\n AC2 := Dist(2, &AC)\n IP := InnerProduct(&AB, &AC)\n b := AC2 * (IP - AB2) / (2 * (IP * IP - AB2 * AC2))\n c := AB2 * (IP - AC2) / (2 * (IP * IP - AB2 * AC2))\n X = (*A)[0] + AB[0] * b + AC[0] * c\n Y = (*A)[1] + AB[1] * b + AC[1] * c\n S := TriangleArea(1, A, B, C)\n ab := math.Sqrt(AB2)\n bc := Dist(1, B, C)\n ca := math.Sqrt(AC2)\n R = ab * bc * ca / (4 * S)\n return\n}\nfunc Less(A *[][]float64, i, j int) bool {\n if (*A)[i][0] == (*A)[j][0] { return (*A)[i][1] < (*A)[j][1] }\n return (*A)[i][0] < (*A)[j][0]\n}\nfunc Convex(A *[][]float64) []int {\n C := make([]int, 0)\n h := 0\n for i := range (*A) {\n if Less(A, h, i) { h = i }\n }\n next := h\n for len(C) == 0 || next != h {\n C = append(C, next)\n p := (*A)[next]\n for i, a := range (*A) {\n if i == next { continue }\n _A := []float64{a[0] - p[0], a[1] - p[1]}\n D1 := Dist(2, &a, &p)\n convex := true\n for j, b := range (*A) {\n if j == next || j == i { continue }\n _B := []float64{b[0] - p[0], b[1] - p[1]}\n D2 := Dist(2, &b, &p)\n OP := _A[0] * _B[1] - _A[1] * _B[0]\n if math.Abs(OP) < 1e-5 {\n if D2 < D1 { continue }\n } else if 0.0 < OP {\n continue\n }\n convex = false\n break\n }\n if !convex { continue }\n next = i\n break\n }\n }\n return C\n}\n\nfunc Solve() {\n N := NextInt()\n A := make([][]float64, N)\n for i := range A {\n A[i] = NextFloatVec()\n }\n C := Convex(&A)\n C = append(C, C...)\n R := make([]float64, N)\n for i := 0; i < len(C) / 2; i++ {\n if C[i] == C[i + 2] {\n R[C[i + 1]] = 180.0\n continue\n }\n x, y, _ := OuterCircle(&A[C[i]], &A[C[i + 1]], &A[C[i + 2]])\n _A := []float64{A[C[i + 2]][0] - x, A[C[i + 2]][1] - y}\n _B := []float64{A[C[i]][0] - x, A[C[i]][1] - y}\n theta := Angle(&_A, &_B)\n R[C[i + 1]] = theta / 2.0\n }\n for _, r := range R {\n Write(r / 360.0)\n }\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1580365376, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03428.html", "problem_id": "p03428", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03428/input.txt", "sample_output_relpath": "derived/input_output/data/p03428/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03428/Go/s207263222.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s207263222", "user_id": "u415905784"}, "prompt_components": {"gold_output": "0.5\n0.5\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"math\"\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 NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc Dist(mode int, A ...*[]float64) float64 {\n if len(A) < 1 { return 0.0 }\n if len(A) < 2 { A = append(A, &[]float64{0.0, 0.0}) }\n D := 0.0\n for i := range (*A[0]) {\n x := (*A[0])[i] - (*A[1])[i]\n D += x * x\n }\n if mode == 1 { D = math.Sqrt(D) }\n return D\n}\nfunc InnerProduct(A, B *[]float64) float64 {\n IP := 0.0\n for i, a := range (*A) {\n IP += a * (*B)[i]\n }\n return IP\n}\nfunc Angle(A ...*[]float64) float64 {\n if len(A) < 2 { return 0.0 }\n if len(A) < 3 {\n a := make([]float64, len((*A[0])))\n A = append(A, &a)\n }\n _A := make([]float64, len((*A[0])))\n _B := make([]float64, len((*A[0])))\n for i := range (*A[0]) {\n _A[i] = (*A[0])[i] - (*A[2])[i]\n _B[i] = (*A[1])[i] - (*A[2])[i]\n }\n acos := math.Acos(InnerProduct(&_A, &_B) / Dist(1, &_A) / Dist(1, &_B))\n theta := acos / math.Pi * 180.0\n _A_ := []float64{-_A[1], _A[0]}\n if InnerProduct(&_A_, &_B) < 0 { theta = 360 - theta }\n return theta\n}\nfunc TriangleArea(mode int, A ...*[]float64) float64 {\n if len(A) < 2 { return 0.0 }\n if len(A) < 3 {\n _A := make([]*[]float64, 0)\n a := make([]float64, len((*A[0])))\n _A = append(_A, &a)\n A = append(_A, A...)\n }\n AB := []float64{(*A[1])[0] - (*A[0])[0], (*A[1])[1] - (*A[0])[1]}\n AC := []float64{(*A[2])[0] - (*A[0])[0], (*A[2])[1] - (*A[0])[1]}\n S := math.Abs(AB[0] * AC[1] - AB[1] * AC[0])\n if mode == 1 { S /= 2.0 }\n return S\n}\nfunc OuterCircle(A, B, C *[]float64) (X, Y, R float64) {\n AB := []float64{(*B)[0] - (*A)[0], (*B)[1] - (*A)[1]}\n AC := []float64{(*C)[0] - (*A)[0], (*C)[1] - (*A)[1]}\n AB2 := Dist(2, &AB)\n AC2 := Dist(2, &AC)\n IP := InnerProduct(&AB, &AC)\n b := AC2 * (IP - AB2) / (2 * (IP * IP - AB2 * AC2))\n c := AB2 * (IP - AC2) / (2 * (IP * IP - AB2 * AC2))\n X = (*A)[0] + AB[0] * b + AC[0] * c\n Y = (*A)[1] + AB[1] * b + AC[1] * c\n S := TriangleArea(1, A, B, C)\n ab := math.Sqrt(AB2)\n bc := Dist(1, B, C)\n ca := math.Sqrt(AC2)\n R = ab * bc * ca / (4 * S)\n return\n}\nfunc Less(A *[][]float64, i, j int) bool {\n if (*A)[i][0] == (*A)[j][0] { return (*A)[i][1] < (*A)[j][1] }\n return (*A)[i][0] < (*A)[j][0]\n}\nfunc Convex(A *[][]float64) []int {\n C := make([]int, 0)\n h := 0\n for i := range (*A) {\n if Less(A, h, i) { h = i }\n }\n next := h\n for len(C) == 0 || next != h {\n C = append(C, next)\n p := (*A)[next]\n for i, a := range (*A) {\n if i == next { continue }\n _A := []float64{a[0] - p[0], a[1] - p[1]}\n D1 := Dist(2, &a, &p)\n convex := true\n for j, b := range (*A) {\n if j == next || j == i { continue }\n _B := []float64{b[0] - p[0], b[1] - p[1]}\n D2 := Dist(2, &b, &p)\n OP := _A[0] * _B[1] - _A[1] * _B[0]\n if math.Abs(OP) < 1e-5 {\n if D2 < D1 { continue }\n } else if 0.0 < OP {\n continue\n }\n convex = false\n break\n }\n if !convex { continue }\n next = i\n break\n }\n }\n return C\n}\n\nfunc Solve() {\n N := NextInt()\n A := make([][]float64, N)\n for i := range A {\n A[i] = NextFloatVec()\n }\n C := Convex(&A)\n C = append(C, C...)\n R := make([]float64, N)\n for i := 0; i < len(C) / 2; i++ {\n if C[i] == C[i + 2] {\n R[C[i + 1]] = 180.0\n continue\n }\n x, y, _ := OuterCircle(&A[C[i]], &A[C[i + 1]], &A[C[i + 2]])\n _A := []float64{A[C[i + 2]][0] - x, A[C[i + 2]][1] - y}\n _B := []float64{A[C[i]][0] - x, A[C[i]][1] - y}\n theta := Angle(&_A, &_B)\n R[C[i + 1]] = theta / 2.0\n }\n for _, r := range R {\n Write(r / 360.0)\n }\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "sample_input": "2\n0 0\n1 1\n"}, "reference_outputs": ["0.5\n0.5\n"], "source_document_id": "p03428", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere are N holes in a two-dimensional plane. The coordinates of the i-th hole are (x_i,y_i).\n\nLet R=10^{10^{10^{10}}}. Ringo performs the following operation:\n\nRandomly choose a point from the interior of a circle of radius R centered at the origin, and put Snuke there. Snuke will move to the hole with the smallest Euclidean distance from the point, and fall into that hole. If there are multiple such holes, the hole with the smallest index will be chosen.\n\nFor every i (1 \\leq i \\leq N), find the probability that Snuke falls into the i-th hole.\n\nHere, the operation of randomly choosing a point from the interior of a circle of radius R is defined as follows:\n\nPick two real numbers x and y independently according to uniform distribution on [-R,R].\n\nIf x^2+y^2\\leq R^2, the point (x,y) is chosen. Otherwise, repeat picking the real numbers x,y until the condition is met.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n|x_i|,|y_i| \\leq 10^6(1\\leq i\\leq N)\n\nAll given points are pairwise distinct.\n\nAll input values 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 N real numbers. The i-th real number must represent the probability that Snuke falls into the i-th hole.\n\nThe output will be judged correct when, for all output values, the absolute or relative error is at most 10^{-5}.\n\nSample Input 1\n\n2\n0 0\n1 1\n\nSample Output 1\n\n0.5\n0.5\n\nIf Ringo put Snuke in the region x+y\\leq 1, Snuke will fall into the first hole. The probability of this happening is very close to 0.5.\nOtherwise, Snuke will fall into the second hole, the probability of which happening is also very close to 0.5.\n\nSample Input 2\n\n5\n0 0\n2 8\n4 5\n2 6\n3 10\n\nSample Output 2\n\n0.43160120892732328768\n0.03480224363653196956\n0.13880483535586193855\n0.00000000000000000000\n0.39479171208028279727", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4314, "cpu_time_ms": 3, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s889943347", "group_id": "codeNet:p03430", "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 NextFloat() float64 {\n n, _ := strconv.ParseFloat(NextLine(), 64)\n return n\n}\nfunc NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\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 MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\n\nfunc Solve() {\n S := NextLine()\n N := len(S)\n K := NextInt()\n M := make([][]int, 26)\n for i := range M {\n M[i] = make([]int, N)\n }\n for i, s := range S {\n m := int(s) - int('a')\n M[m][i] = i + 1\n }\n for i := range M {\n for j := N - 1; 0 < j; j-- {\n if 0 < M[i][j - 1] { continue }\n M[i][j - 1] = M[i][j]\n }\n }\n DP := make([][][]int, K + 1)\n for i := range DP {\n DP[i] = make([][]int, N)\n for j := range DP[i] {\n DP[i][j] = make([]int, N)\n for k := 0; k < i + 1; k++ {\n if N <= j + k { continue }\n DP[i][j][j + k] = k + 1\n }\n }\n }\n for i := range DP {\n for j := N - 1; 0 <= j; j-- {\n for k := j + 1; k < N; k++ {\n DP[i][j][k] = MaxInt(DP[i][j][k - 1], DP[i][j][k])\n l := M[int(S[k]) - int('a')][j]\n if l <= k {\n DP[i][j][k] = MaxInt(DP[i][l][k - 1] + 2, DP[i][j][k])\n }\n if j < N - 1 {\n DP[i][j][k] = MaxInt(DP[i][j + 1][k], DP[i][j][k])\n }\n if 0 < i {\n DP[i][j][k] = MaxInt(DP[i - 1][j][k], DP[i][j][k])\n DP[i][j][k] = MaxInt(DP[i - 1][j + 1][k - 1] + 2, DP[i][j][k])\n }\n }\n }\n }\n Write(DP[K][0][N - 1])\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581740506, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03430.html", "problem_id": "p03430", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03430/input.txt", "sample_output_relpath": "derived/input_output/data/p03430/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03430/Go/s889943347.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Memory Limit Exceeded", "submission_id": "s889943347", "user_id": "u415905784"}, "prompt_components": {"gold_output": "7\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 NextFloat() float64 {\n n, _ := strconv.ParseFloat(NextLine(), 64)\n return n\n}\nfunc NextFloatVec() []float64 {\n L := strings.Split(NextLine(), \" \")\n N := make([]float64, len(L))\n for i := range N {\n N[i], _ = strconv.ParseFloat(L[i], 64)\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 MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\n\nfunc Solve() {\n S := NextLine()\n N := len(S)\n K := NextInt()\n M := make([][]int, 26)\n for i := range M {\n M[i] = make([]int, N)\n }\n for i, s := range S {\n m := int(s) - int('a')\n M[m][i] = i + 1\n }\n for i := range M {\n for j := N - 1; 0 < j; j-- {\n if 0 < M[i][j - 1] { continue }\n M[i][j - 1] = M[i][j]\n }\n }\n DP := make([][][]int, K + 1)\n for i := range DP {\n DP[i] = make([][]int, N)\n for j := range DP[i] {\n DP[i][j] = make([]int, N)\n for k := 0; k < i + 1; k++ {\n if N <= j + k { continue }\n DP[i][j][j + k] = k + 1\n }\n }\n }\n for i := range DP {\n for j := N - 1; 0 <= j; j-- {\n for k := j + 1; k < N; k++ {\n DP[i][j][k] = MaxInt(DP[i][j][k - 1], DP[i][j][k])\n l := M[int(S[k]) - int('a')][j]\n if l <= k {\n DP[i][j][k] = MaxInt(DP[i][l][k - 1] + 2, DP[i][j][k])\n }\n if j < N - 1 {\n DP[i][j][k] = MaxInt(DP[i][j + 1][k], DP[i][j][k])\n }\n if 0 < i {\n DP[i][j][k] = MaxInt(DP[i - 1][j][k], DP[i][j][k])\n DP[i][j][k] = MaxInt(DP[i - 1][j + 1][k - 1] + 2, DP[i][j][k])\n }\n }\n }\n }\n Write(DP[K][0][N - 1])\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score : 900 points\n\nProblem Statement\n\nTakahashi has decided to give a string to his mother.\n\nThe value of a string T is the length of the longest common subsequence of T and T', where T' is the string obtained by reversing T.\nThat is, the value is the longest length of the following two strings that are equal: a subsequence of T (possibly non-contiguous), and a subsequence of T' (possibly non-contiguous).\n\nTakahashi has a string S. He wants to give her mother a string of the highest possible value, so he would like to change at most K characters in S to any other characters in order to obtain a string of the highest possible value.\nFind the highest possible value achievable.\n\nConstraints\n\n1 \\leq |S| \\leq 300\n\n0 \\leq K \\leq |S|\n\nS consists of lowercase English letters.\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the highest possible value achievable.\n\nSample Input 1\n\nabcabcabc\n1\n\nSample Output 1\n\n7\n\nChanging the first character to c results in cbcabcabc.\nLet this tring be T, then one longest common subsequence of T and T' is cbabcbc, whose length is 7.\n\nSample Input 2\n\natcodergrandcontest\n3\n\nSample Output 2\n\n15", "sample_input": "abcabcabc\n1\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03430", "source_text": "Score : 900 points\n\nProblem Statement\n\nTakahashi has decided to give a string to his mother.\n\nThe value of a string T is the length of the longest common subsequence of T and T', where T' is the string obtained by reversing T.\nThat is, the value is the longest length of the following two strings that are equal: a subsequence of T (possibly non-contiguous), and a subsequence of T' (possibly non-contiguous).\n\nTakahashi has a string S. He wants to give her mother a string of the highest possible value, so he would like to change at most K characters in S to any other characters in order to obtain a string of the highest possible value.\nFind the highest possible value achievable.\n\nConstraints\n\n1 \\leq |S| \\leq 300\n\n0 \\leq K \\leq |S|\n\nS consists of lowercase English letters.\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the highest possible value achievable.\n\nSample Input 1\n\nabcabcabc\n1\n\nSample Output 1\n\n7\n\nChanging the first character to c results in cbcabcabc.\nLet this tring be T, then one longest common subsequence of T and T' is cbabcbc, whose length is 7.\n\nSample Input 2\n\natcodergrandcontest\n3\n\nSample Output 2\n\n15", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2496, "cpu_time_ms": 1056, "memory_kb": 255836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s803431191", "group_id": "codeNet:p03433", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc088/tasks/abc088_a\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 ceilDiv(x, y int) int { return (x + y - 1) / 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 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 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\treturn\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\treturn\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{ 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 := ri()\n\ta := ri()\n\trest := n % 500\n\tpln(YesOrNo(rest <= a))\n}\n", "language": "Go", "metadata": {"date": 1572248775, "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/s803431191.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s803431191", "user_id": "u554269352"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc088/tasks/abc088_a\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 ceilDiv(x, y int) int { return (x + y - 1) / 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 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 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\treturn\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\treturn\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{ 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 := ri()\n\ta := ri()\n\trest := n % 500\n\tpln(YesOrNo(rest <= a))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7536, "cpu_time_ms": 15, "memory_kb": 1024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s496279950", "group_id": "codeNet:p03435", "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\tc := nextIntMat(3, 3)\n\n\ta0tri := c[0][0] + c[0][1] + c[0][2]\n\ta1tri := c[1][0] + c[1][1] + c[1][2]\n\ta2tri := c[2][0] + c[2][1] + c[2][2]\n\tfor b0i := 0; b0i <= 300; b0i++ {\n\t\tfor b1i := 0; b1i <= 300; b1i++ {\n\t\t\tfor b2i := 0; b2i <= 300; b2i++ {\n\t\t\t\tbsum := b1i + b1i + b2i\n\t\t\t\ta0 := a0tri - bsum\n\t\t\t\ta1 := a1tri - bsum\n\t\t\t\ta2 := a2tri - bsum\n\t\t\t\tif a0%3 != 0 || a1%3 != 0 || a2%3 != 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n\treturn\n\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 nextIntMat(a int, b int) [][]int {\n\tmat := make([][]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tmat[i] = make([]int, b)\n\t\tfor j := 0; j < b; j++ {\n\t\t\tmat[i][j] = nextInt()\n\t\t}\n\t}\n\treturn mat\n}\n", "language": "Go", "metadata": {"date": 1598021410, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Go/s496279950.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496279950", "user_id": "u756000295"}, "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 main() {\n\tscanInit()\n\n\tc := nextIntMat(3, 3)\n\n\ta0tri := c[0][0] + c[0][1] + c[0][2]\n\ta1tri := c[1][0] + c[1][1] + c[1][2]\n\ta2tri := c[2][0] + c[2][1] + c[2][2]\n\tfor b0i := 0; b0i <= 300; b0i++ {\n\t\tfor b1i := 0; b1i <= 300; b1i++ {\n\t\t\tfor b2i := 0; b2i <= 300; b2i++ {\n\t\t\t\tbsum := b1i + b1i + b2i\n\t\t\t\ta0 := a0tri - bsum\n\t\t\t\ta1 := a1tri - bsum\n\t\t\t\ta2 := a2tri - bsum\n\t\t\t\tif a0%3 != 0 || a1%3 != 0 || a2%3 != 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n\treturn\n\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 nextIntMat(a int, b int) [][]int {\n\tmat := make([][]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tmat[i] = make([]int, b)\n\t\tfor j := 0; j < b; j++ {\n\t\t\tmat[i][j] = nextInt()\n\t\t}\n\t}\n\treturn mat\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1070, "cpu_time_ms": 106, "memory_kb": 1800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s968140260", "group_id": "codeNet:p03435", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tgrid := make([][3]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tgrid[i] = [3]int{}\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfmt.Scan(&grid[i][j])\n\t\t}\n\t}\n\t// fmt.Println(grid)\n\n\tvar a1, a2, a3, b1, b2, b3 int\n\tb1 = grid[0][0] - a1\n\tb2 = grid[1][0] - a1\n\tb3 = grid[2][0] - a1\n\ta2 = grid[0][1] - b1\n\ta3 = grid[0][2] - b1\n\n\tflag := true\n\tif grid[1][1] != a2 + b2 {\n\t\tflag = false\n\t}\n\tif grid[1][2] != a3 + b2 {\n\t\tflag = false\n\t}\n\tif grid[2][1] != a2 + b3 {\n\t\tflag = false\n\t}\n\tif grid[2][2] != a3 + b3 {\n\t\tflag = false\n\t}\n\n\tif flag == true {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1525872520, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Go/s968140260.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s968140260", "user_id": "u761894926"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tgrid := make([][3]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tgrid[i] = [3]int{}\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tfmt.Scan(&grid[i][j])\n\t\t}\n\t}\n\t// fmt.Println(grid)\n\n\tvar a1, a2, a3, b1, b2, b3 int\n\tb1 = grid[0][0] - a1\n\tb2 = grid[1][0] - a1\n\tb3 = grid[2][0] - a1\n\ta2 = grid[0][1] - b1\n\ta3 = grid[0][2] - b1\n\n\tflag := true\n\tif grid[1][1] != a2 + b2 {\n\t\tflag = false\n\t}\n\tif grid[1][2] != a3 + b2 {\n\t\tflag = false\n\t}\n\tif grid[2][1] != a2 + b3 {\n\t\tflag = false\n\t}\n\tif grid[2][2] != a3 + b3 {\n\t\tflag = false\n\t}\n\n\tif flag == true {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 616, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s229922655", "group_id": "codeNet:p03435", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tn = 3\n\tm = 3\n)\n\ntype C [][]int\n\nfunc newC() C {\n\tvar c C\n\tc = make([][]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tc[i] = make([]int, n)\n\t}\n\n\treturn c\n}\n\nfunc (c C) check(a, b []int) bool {\n\tfor i := 0; i < m; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i]+b[j] != c[i][j] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc main() {\n\tvar input []string\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\tinput = append(input, sc.Text())\n\t}\n\n\tc := newC()\n\n\tfor i := 0; i < m; i++ {\n\t\tline := strings.Split(input[i], \" \")\n\t\tfor j := 0; j < n; j++ {\n\t\t\tvInt, _ := strconv.Atoi(line[j])\n\t\t\tc[i][j] = vInt\n\t\t}\n\t}\n\n\tmMax := make([]int, m)\n\tnMax := make([]int, n)\n\n\tfor i := 0; i < m; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif mMax[i] < c[i][j] {\n\t\t\t\tmMax[i] = c[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tif nMax[i] < c[i][j] {\n\t\t\t\tnMax[i] = c[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\ta := make([]int, m)\n\tb := make([]int, n)\n\n\tfor i := 0; i <= mMax[0]; i++ {\n\t\ta[0] = i\n\t\tfor j := 0; j <= mMax[1]; j++ {\n\t\t\ta[1] = j\n\t\t\tfor k := 0; k <= mMax[2]; k++ {\n\t\t\t\ta[2] = k\n\t\t\t\tfor l := 0; l <= nMax[0]; l++ {\n\t\t\t\t\tb[0] = l\n\t\t\t\t\tfor m := 0; m <= nMax[1]; m++ {\n\t\t\t\t\t\tb[1] = m\n\t\t\t\t\t\tfor n := 0; n <= nMax[2]; n++ {\n\t\t\t\t\t\t\tb[2] = n\n\n\t\t\t\t\t\t\tif c.check(a, b) {\n\t\t\t\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\t\t\t\treturn\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}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1519011310, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03435.html", "problem_id": "p03435", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03435/input.txt", "sample_output_relpath": "derived/input_output/data/p03435/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03435/Go/s229922655.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s229922655", "user_id": "u266311819"}, "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\nconst (\n\tn = 3\n\tm = 3\n)\n\ntype C [][]int\n\nfunc newC() C {\n\tvar c C\n\tc = make([][]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tc[i] = make([]int, n)\n\t}\n\n\treturn c\n}\n\nfunc (c C) check(a, b []int) bool {\n\tfor i := 0; i < m; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif a[i]+b[j] != c[i][j] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc main() {\n\tvar input []string\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\tinput = append(input, sc.Text())\n\t}\n\n\tc := newC()\n\n\tfor i := 0; i < m; i++ {\n\t\tline := strings.Split(input[i], \" \")\n\t\tfor j := 0; j < n; j++ {\n\t\t\tvInt, _ := strconv.Atoi(line[j])\n\t\t\tc[i][j] = vInt\n\t\t}\n\t}\n\n\tmMax := make([]int, m)\n\tnMax := make([]int, n)\n\n\tfor i := 0; i < m; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif mMax[i] < c[i][j] {\n\t\t\t\tmMax[i] = c[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < m; j++ {\n\t\t\tif nMax[i] < c[i][j] {\n\t\t\t\tnMax[i] = c[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\ta := make([]int, m)\n\tb := make([]int, n)\n\n\tfor i := 0; i <= mMax[0]; i++ {\n\t\ta[0] = i\n\t\tfor j := 0; j <= mMax[1]; j++ {\n\t\t\ta[1] = j\n\t\t\tfor k := 0; k <= mMax[2]; k++ {\n\t\t\t\ta[2] = k\n\t\t\t\tfor l := 0; l <= nMax[0]; l++ {\n\t\t\t\t\tb[0] = l\n\t\t\t\t\tfor m := 0; m <= nMax[1]; m++ {\n\t\t\t\t\t\tb[1] = m\n\t\t\t\t\t\tfor n := 0; n <= nMax[2]; n++ {\n\t\t\t\t\t\t\tb[2] = n\n\n\t\t\t\t\t\t\tif c.check(a, b) {\n\t\t\t\t\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\t\t\t\t\treturn\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}\n\t\t}\n\t}\n\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "sample_input": "1 0 1\n2 1 2\n1 0 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03435", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have a 3 \\times 3 grid. A number c_{i, j} is written in the square (i, j), where (i, j) denotes the square at the i-th row from the top and the j-th column from the left.\n\nAccording to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the number written in the square (i, j) is equal to a_i + b_j.\n\nDetermine if he is correct.\n\nConstraints\n\nc_{i, j} \\ (1 \\leq i \\leq 3, 1 \\leq j \\leq 3) is an integer between 0 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nc_{1,1} c_{1,2} c_{1,3}\nc_{2,1} c_{2,2} c_{2,3}\nc_{3,1} c_{3,2} c_{3,3}\n\nOutput\n\nIf Takahashi's statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 0 1\n2 1 2\n1 0 1\n\nSample Output 1\n\nYes\n\nTakahashi is correct, since there are possible sets of integers such as: a_1=0,a_2=1,a_3=0,b_1=1,b_2=0,b_3=1.\n\nSample Input 2\n\n2 2 2\n2 1 2\n2 2 2\n\nSample Output 2\n\nNo\n\nTakahashi is incorrect in this case.\n\nSample Input 3\n\n0 8 8\n0 8 8\n0 8 8\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1 8 6\n2 9 7\n0 7 7\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1429, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s258983289", "group_id": "codeNet:p03436", "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 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// Priority Queue\ntype Item struct {\n\tpriority, value, index int\n}\n\ntype PQ []*Item\n\nfunc (pq PQ) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PQ) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\n\nfunc (pq PQ) 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 *PQ) 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 *PQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\titem.index = -1\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// End Priority Queue\n// Path\ntype Edge struct {\n\tto, cost int\n}\n\ntype Path struct {\n\tedges []Edge\n}\n\n// Dijkstra\ntype Route struct {\n\tpath []int\n}\n\nfunc Dijkstra(N, S int, path []Path) ([]int, []Route) {\n\tpq := make(PQ, 0)\n\theap.Init(&pq)\n\td := make([]int, N+1)\n\tr := make([]Route, N+1)\n\t// init\n\tfor i := 0; i <= N; i++ {\n\t\td[i] = math.MaxInt32\n\t}\n\td[S] = 0\n\tr[S].path = []int{S}\n\theap.Push(&pq, &Item{0, S, 0})\n\tfor pq.Len() > 0 {\n\t\titem := heap.Pop(&pq).(*Item)\n\t\tv := item.value\n\t\tif d[v] < item.priority {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range path[v].edges {\n\t\t\tif d[e.to] > d[v]+e.cost {\n\t\t\t\td[e.to] = d[v] + e.cost\n\t\t\t\tr[e.to].path = append(r[v].path, e.to)\n\t\t\t\theap.Push(&pq, &Item{d[e.to], e.to, 0})\n\t\t\t}\n\t\t}\n\t}\n\treturn d, r\n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tH, W := getInt(), getInt()\n\ts := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\ts[i] = getString()\n\t}\n\n\tpath := make([]Path, W*H)\n\tcnt := 0\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\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf := y*W + x\n\t\t\tif x != 0 && s[y][x-1] != '#' {\n\t\t\t\tt := f - 1\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif x != W-1 && s[y][x+1] != '#' {\n\t\t\t\tt := f + 1\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif y != 0 && s[y-1][x] != '#' {\n\t\t\t\tt := f - W\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif y != H-1 && s[y+1][x] != '#' {\n\t\t\t\tt := f + W\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t}\n\t}\n\td, _ := Dijkstra(W*H, 0, path)\n\tpos := W*H - 1\n\n\tif d[pos] == math.MaxInt32 {\n\t\tout(-1)\n\t} else {\n\t\tout(W*H - cnt - d[pos] - 1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583708842, "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/s258983289.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s258983289", "user_id": "u814575783"}, "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\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// Priority Queue\ntype Item struct {\n\tpriority, value, index int\n}\n\ntype PQ []*Item\n\nfunc (pq PQ) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq PQ) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\n\nfunc (pq PQ) 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 *PQ) 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 *PQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\titem.index = -1\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// End Priority Queue\n// Path\ntype Edge struct {\n\tto, cost int\n}\n\ntype Path struct {\n\tedges []Edge\n}\n\n// Dijkstra\ntype Route struct {\n\tpath []int\n}\n\nfunc Dijkstra(N, S int, path []Path) ([]int, []Route) {\n\tpq := make(PQ, 0)\n\theap.Init(&pq)\n\td := make([]int, N+1)\n\tr := make([]Route, N+1)\n\t// init\n\tfor i := 0; i <= N; i++ {\n\t\td[i] = math.MaxInt32\n\t}\n\td[S] = 0\n\tr[S].path = []int{S}\n\theap.Push(&pq, &Item{0, S, 0})\n\tfor pq.Len() > 0 {\n\t\titem := heap.Pop(&pq).(*Item)\n\t\tv := item.value\n\t\tif d[v] < item.priority {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range path[v].edges {\n\t\t\tif d[e.to] > d[v]+e.cost {\n\t\t\t\td[e.to] = d[v] + e.cost\n\t\t\t\tr[e.to].path = append(r[v].path, e.to)\n\t\t\t\theap.Push(&pq, &Item{d[e.to], e.to, 0})\n\t\t\t}\n\t\t}\n\t}\n\treturn d, r\n\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tH, W := getInt(), getInt()\n\ts := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\ts[i] = getString()\n\t}\n\n\tpath := make([]Path, W*H)\n\tcnt := 0\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\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf := y*W + x\n\t\t\tif x != 0 && s[y][x-1] != '#' {\n\t\t\t\tt := f - 1\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif x != W-1 && s[y][x+1] != '#' {\n\t\t\t\tt := f + 1\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif y != 0 && s[y-1][x] != '#' {\n\t\t\t\tt := f - W\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t\tif y != H-1 && s[y+1][x] != '#' {\n\t\t\t\tt := f + W\n\t\t\t\tpath[f].edges = append(path[f].edges, Edge{t, 1})\n\t\t\t}\n\t\t}\n\t}\n\td, _ := Dijkstra(W*H, 0, path)\n\tpos := W*H - 1\n\n\tif d[pos] == math.MaxInt32 {\n\t\tout(-1)\n\t} else {\n\t\tout(W*H - cnt - d[pos] - 1)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2507, "cpu_time_ms": 3, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s055557454", "group_id": "codeNet:p03437", "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 gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tx := readInt()\n\ty := readInt()\n\n\tif x == y {\n\t\tprintln(-1)\n\t\treturn\n\t}\n\n\tg := gcd(x, y)\n\tif g == x {\n\t\tx, y = y, x\n\t}\n\n\tyg := y / g\n\ti := 2\n\tfor ; i < yg; i++ {\n\t\tif yg%i != 0 {\n\t\t\tprintln(int64(x) * int64(i))\n\t\t\treturn\n\t\t}\n\t}\n\tfor {\n\t\tif i%yg != 0 {\n\t\t\tprintln(int64(x) * int64(i))\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n", "language": "Go", "metadata": {"date": 1533583626, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03437.html", "problem_id": "p03437", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03437/input.txt", "sample_output_relpath": "derived/input_output/data/p03437/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03437/Go/s055557454.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s055557454", "user_id": "u705974985"}, "prompt_components": {"gold_output": "16\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 gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\n\tx := readInt()\n\ty := readInt()\n\n\tif x == y {\n\t\tprintln(-1)\n\t\treturn\n\t}\n\n\tg := gcd(x, y)\n\tif g == x {\n\t\tx, y = y, x\n\t}\n\n\tyg := y / g\n\ti := 2\n\tfor ; i < yg; i++ {\n\t\tif yg%i != 0 {\n\t\t\tprintln(int64(x) * int64(i))\n\t\t\treturn\n\t\t}\n\t}\n\tfor {\n\t\tif i%yg != 0 {\n\t\t\tprintln(int64(x) * int64(i))\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "sample_input": "8 6\n"}, "reference_outputs": ["16\n"], "source_document_id": "p03437", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2245, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s862667567", "group_id": "codeNet:p03437", "input_text": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sat Feb 3 23:01:46 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X, Y int\n\n\tif X%Y == 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tfor i := 0; ; i++ {\n\t\tif X*i%Y != 0 {\n\t\t\tfmt.Println(X)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1517716991, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03437.html", "problem_id": "p03437", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03437/input.txt", "sample_output_relpath": "derived/input_output/data/p03437/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03437/Go/s862667567.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s862667567", "user_id": "u802614675"}, "prompt_components": {"gold_output": "16\n", "input_to_evaluate": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sat Feb 3 23:01:46 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X, Y int\n\n\tif X%Y == 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tfor i := 0; ; i++ {\n\t\tif X*i%Y != 0 {\n\t\t\tfmt.Println(X)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "sample_input": "8 6\n"}, "reference_outputs": ["16\n"], "source_document_id": "p03437", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given positive integers X and Y.\nIf there exists a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, choose one such integer and print it.\nIf it does not exist, print -1.\n\nConstraints\n\n1 ≤ X,Y ≤ 10^9\n\nX and Y are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nPrint a positive integer not greater than 10^{18} that is a multiple of X but not a multiple of Y, or print -1 if it does not exist.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\n16\n\nFor example, 16 is a multiple of 8 but not a multiple of 6.\n\nSample Input 2\n\n3 3\n\nSample Output 2\n\n-1\n\nA multiple of 3 is a multiple of 3.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 269, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s149800687", "group_id": "codeNet:p03438", "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 = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\ta, b := make([]int, N), make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tb[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := 0; i < N-1; i++ {\n\t\tif a[i] < b[i] {\n\t\t\tif (b[i]-a[i])%2 == 0 {\n\t\t\t\tb[i+1] += (b[i] - a[i]) / 2\n\t\t\t\ta[i] = b[i]\n\t\t\t} else {\n\t\t\t\tb[i+1] += (b[i] - a[i] + 2 - 1) / 2\n\t\t\t\ta[i+1] += 2\n\t\t\t\tb[i]++\n\t\t\t\ta[i] = b[i]\n\t\t\t}\n\t\t}\n\t\tif a[i] > b[i] {\n\t\t\ta[i+1] += (a[i] - b[i]) * 2\n\t\t\tb[i] = a[i]\n\t\t}\n\t}\n\n\tif a[N-1] <= b[N-1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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": 1568173786, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03438.html", "problem_id": "p03438", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03438/input.txt", "sample_output_relpath": "derived/input_output/data/p03438/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03438/Go/s149800687.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s149800687", "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\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\ta, b := make([]int, N), make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tb[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := 0; i < N-1; i++ {\n\t\tif a[i] < b[i] {\n\t\t\tif (b[i]-a[i])%2 == 0 {\n\t\t\t\tb[i+1] += (b[i] - a[i]) / 2\n\t\t\t\ta[i] = b[i]\n\t\t\t} else {\n\t\t\t\tb[i+1] += (b[i] - a[i] + 2 - 1) / 2\n\t\t\t\ta[i+1] += 2\n\t\t\t\tb[i]++\n\t\t\t\ta[i] = b[i]\n\t\t\t}\n\t\t}\n\t\tif a[i] > b[i] {\n\t\t\ta[i+1] += (a[i] - b[i]) * 2\n\t\t\tb[i] = a[i]\n\t\t}\n\t}\n\n\tif a[N-1] <= b[N-1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\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 : 300 points\n\nProblem Statement\n\nYou are given two integer sequences of length N: a_1,a_2,..,a_N and b_1,b_2,..,b_N.\nDetermine if we can repeat the following operation zero or more times so that the sequences a and b become equal.\n\nOperation: Choose two integers i and j (possibly the same) between 1 and N (inclusive), then perform the following two actions simultaneously:\n\nAdd 2 to a_i.\n\nAdd 1 to b_j.\n\nConstraints\n\n1 ≤ N ≤ 10 000\n\n0 ≤ a_i,b_i ≤ 10^9 (1 ≤ i ≤ 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\nb_1 b_2 .. b_N\n\nOutput\n\nIf we can repeat the operation zero or more times so that the sequences a and b become equal, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 2 3\n5 2 2\n\nSample Output 1\n\nYes\n\nFor example, we can perform three operations as follows to do our job:\n\nFirst operation: i=1 and j=2. Now we have a = \\{3,2,3\\}, b = \\{5,3,2\\}.\n\nSecond operation: i=1 and j=2. Now we have a = \\{5,2,3\\}, b = \\{5,4,2\\}.\n\nThird operation: i=2 and j=3. Now we have a = \\{5,4,3\\}, b = \\{5,4,3\\}.\n\nSample Input 2\n\n5\n3 1 4 1 5\n2 7 1 8 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n2 7 1 8 2\n3 1 4 1 5\n\nSample Output 3\n\nNo", "sample_input": "3\n1 2 3\n5 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03438", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two integer sequences of length N: a_1,a_2,..,a_N and b_1,b_2,..,b_N.\nDetermine if we can repeat the following operation zero or more times so that the sequences a and b become equal.\n\nOperation: Choose two integers i and j (possibly the same) between 1 and N (inclusive), then perform the following two actions simultaneously:\n\nAdd 2 to a_i.\n\nAdd 1 to b_j.\n\nConstraints\n\n1 ≤ N ≤ 10 000\n\n0 ≤ a_i,b_i ≤ 10^9 (1 ≤ i ≤ 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\nb_1 b_2 .. b_N\n\nOutput\n\nIf we can repeat the operation zero or more times so that the sequences a and b become equal, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 2 3\n5 2 2\n\nSample Output 1\n\nYes\n\nFor example, we can perform three operations as follows to do our job:\n\nFirst operation: i=1 and j=2. Now we have a = \\{3,2,3\\}, b = \\{5,3,2\\}.\n\nSecond operation: i=1 and j=2. Now we have a = \\{5,2,3\\}, b = \\{5,4,2\\}.\n\nThird operation: i=2 and j=3. Now we have a = \\{5,4,3\\}, b = \\{5,4,3\\}.\n\nSample Input 2\n\n5\n3 1 4 1 5\n2 7 1 8 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n2 7 1 8 2\n3 1 4 1 5\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3179, "cpu_time_ms": 7, "memory_kb": 1152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s204098322", "group_id": "codeNet:p03447", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tbody, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tscanner := bufio.NewScanner(strings.NewReader(string(body)))\n\tscanner.Split(bufio.ScanWords)\n\tif err := scanner.Err(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"reading input:\", err)\n\t}\n\tinputs := make([]int, 0)\n\tfor scanner.Scan() {\n\t\tword, _ := strconv.Atoi(scanner.Text())\n\t\tinputs = append(inputs, word)\n\t}\n\n\talice := make([]int, 0, 100)\n\tbob := make([]int, 0, 100)\n\n\tcards := inputs[1:]\n\tsort.Sort(sort.Reverse(sort.IntSlice(cards)))\n\tturn := 1\n\tfor i := 0; i < len(cards); i++ {\n\t\tif turn%2 == 1 {\n\t\t\talice = append(alice, cards[i])\n\t\t} else {\n\t\t\tbob = append(bob, cards[i])\n\t\t}\n\t\tturn++\n\t}\n\n\taliceSum := 0\n\tfor _, i := range alice {\n\t\taliceSum = aliceSum + i\n\t}\n\tbobSum := 0\n\tfor _, i := range bob {\n\t\tbobSum = bobSum + i\n\t}\n\n\tfmt.Println(aliceSum - bobSum)\n}\n", "language": "Go", "metadata": {"date": 1562774845, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03447/input.txt", "sample_output_relpath": "derived/input_output/data/p03447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03447/Go/s204098322.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s204098322", "user_id": "u950580836"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tbody, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tscanner := bufio.NewScanner(strings.NewReader(string(body)))\n\tscanner.Split(bufio.ScanWords)\n\tif err := scanner.Err(); err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"reading input:\", err)\n\t}\n\tinputs := make([]int, 0)\n\tfor scanner.Scan() {\n\t\tword, _ := strconv.Atoi(scanner.Text())\n\t\tinputs = append(inputs, word)\n\t}\n\n\talice := make([]int, 0, 100)\n\tbob := make([]int, 0, 100)\n\n\tcards := inputs[1:]\n\tsort.Sort(sort.Reverse(sort.IntSlice(cards)))\n\tturn := 1\n\tfor i := 0; i < len(cards); i++ {\n\t\tif turn%2 == 1 {\n\t\t\talice = append(alice, cards[i])\n\t\t} else {\n\t\t\tbob = append(bob, cards[i])\n\t\t}\n\t\tturn++\n\t}\n\n\taliceSum := 0\n\tfor _, i := range alice {\n\t\taliceSum = aliceSum + i\n\t}\n\tbobSum := 0\n\tfor _, i := range bob {\n\t\tbobSum = bobSum + i\n\t}\n\n\tfmt.Println(aliceSum - bobSum)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "sample_input": "1234\n150\n100\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03447", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 957, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s819367636", "group_id": "codeNet:p03447", "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, a, b int\n\nfunc main() {\n\tx = NextIntsLine()[0]\n\ta = NextIntsLine()[0]\n\tb = NextIntsLine()[0]\n\tfmt.Println((x - a) % b)\n}\n", "language": "Go", "metadata": {"date": 1544753633, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03447/input.txt", "sample_output_relpath": "derived/input_output/data/p03447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03447/Go/s819367636.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s819367636", "user_id": "u103600314"}, "prompt_components": {"gold_output": "84\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, a, b int\n\nfunc main() {\n\tx = NextIntsLine()[0]\n\ta = NextIntsLine()[0]\n\tb = NextIntsLine()[0]\n\tfmt.Println((x - a) % b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "sample_input": "1234\n150\n100\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03447", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4652, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s387120357", "group_id": "codeNet:p03447", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, A, B int\n\n\tfmt.Scan(&X, &A, &B)\n\tfmt.Println((X - A) % B)\n}\n", "language": "Go", "metadata": {"date": 1520371346, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03447.html", "problem_id": "p03447", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03447/input.txt", "sample_output_relpath": "derived/input_output/data/p03447/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03447/Go/s387120357.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s387120357", "user_id": "u061935128"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, A, B int\n\n\tfmt.Scan(&X, &A, &B)\n\tfmt.Println((X - A) % B)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "sample_input": "1234\n150\n100\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03447", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou went shopping to buy cakes and donuts with X yen (the currency of Japan).\n\nFirst, you bought one cake for A yen at a cake shop.\nThen, you bought as many donuts as possible for B yen each, at a donut shop.\n\nHow much do you have left after shopping?\n\nConstraints\n\n1 \\leq A, B \\leq 1 000\n\nA + B \\leq X \\leq 10 000\n\nX, A and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\nA\nB\n\nOutput\n\nPrint the amount you have left after shopping.\n\nSample Input 1\n\n1234\n150\n100\n\nSample Output 1\n\n84\n\nYou have 1234 - 150 = 1084 yen left after buying a cake.\nWith this amount, you can buy 10 donuts, after which you have 84 yen left.\n\nSample Input 2\n\n1000\n108\n108\n\nSample Output 2\n\n28\n\nSample Input 3\n\n579\n123\n456\n\nSample Output 3\n\n0\n\nSample Input 4\n\n7477\n549\n593\n\nSample Output 4\n\n405", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 110, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s357846387", "group_id": "codeNet:p03453", "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\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\ts := getNextInt(scanner) - 1\n\tt := getNextInt(scanner) - 1\n\tg := newGraph(n)\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\t\td := getNextInt64(scanner)\n\t\tg.appendEdge(u, v, i, d)\n\t\tg.appendEdge(v, u, i, d)\n\t}\n\tdd := &daikes{}\n\theap.Push(dd, newDaike(s, 0, 1))\n\tfor i := 0; i < n; i++ {\n\t\tg.v[i].d = math.MaxInt64\n\t}\n\tfor dd.Len() > 0 {\n\t\tp := heap.Pop(dd).(daike)\n\t\tif g.v[p.i].d < p.d {\n\t\t\tcontinue\n\t\t}\n\t\tif g.v[p.i].d == p.d {\n\t\t\tg.v[p.i].c.addAs(p.c)\n\t\t\tcontinue\n\t\t}\n\t\tg.v[p.i].c = p.c\n\t\tg.v[p.i].d = p.d\n\t\tfor _, e := range g.e[p.i] {\n\t\t\theap.Push(dd, newDaike(e.to, p.d+e.d, g.v[p.i].c))\n\t\t}\n\t}\n\tfmt.Fprintln(writer, g.v[t].c.mul(g.v[t].c.sub(1)))\n}\n\nfunc newDaike(i int, d int64, c mint) daike {\n\treturn daike{i: i, d: d, c: c}\n}\n\ntype daike struct {\n\ti int\n\td int64\n\tc mint\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].d < h[j].d\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 vertex struct {\n\td int64\n\tc mint\n}\ntype edge struct {\n\tto, id int\n\td int64\n}\ntype graph struct {\n\tv []vertex\n\te [][]edge\n}\n\nfunc newGraph(n int) graph {\n\treturn graph{\n\t\tv: make([]vertex, n),\n\t\te: make([][]edge, n),\n\t}\n}\nfunc (g *graph) appendEdge(from, to, id int, d int64) {\n\tg.e[from] = append(g.e[from], edge{\n\t\tto: to,\n\t\tid: id,\n\t\td: d,\n\t})\n}\n\ntype mint int64\n\nfunc (mt mint) mod() mint {\n\tm := mint(1e9 + 7)\n\tmt %= m\n\tif mt < 0 {\n\t\treturn mt + m\n\t}\n\treturn mt\n}\nfunc (mt mint) inv() mint {\n\treturn mt.pow(mint(0).sub(2))\n}\nfunc (mt mint) pow(n mint) mint {\n\tp := mint(1)\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tp.mulAs(mt)\n\t\t}\n\t\tmt.mulAs(mt)\n\t\tn >>= 1\n\t}\n\treturn p\n}\nfunc (mt mint) add(x mint) mint {\n\treturn (mt + x).mod()\n}\nfunc (mt mint) sub(x mint) mint {\n\treturn (mt - x).mod()\n}\nfunc (mt mint) mul(x mint) mint {\n\treturn (mt * x).mod()\n}\nfunc (mt mint) div(x mint) mint {\n\treturn mt.mul(x.inv())\n}\nfunc (mt *mint) addAs(x mint) *mint {\n\t*mt = mt.add(x)\n\treturn mt\n}\nfunc (mt *mint) subAs(x mint) *mint {\n\t*mt = mt.sub(x)\n\treturn mt\n}\nfunc (mt *mint) mulAs(x mint) *mint {\n\t*mt = mt.mul(x)\n\treturn mt\n}\nfunc (mt *mint) divAs(x mint) *mint {\n\t*mt = mt.div(x)\n\treturn mt\n}\n", "language": "Go", "metadata": {"date": 1595347390, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03453.html", "problem_id": "p03453", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03453/input.txt", "sample_output_relpath": "derived/input_output/data/p03453/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03453/Go/s357846387.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s357846387", "user_id": "u150542210"}, "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\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\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\ts := getNextInt(scanner) - 1\n\tt := getNextInt(scanner) - 1\n\tg := newGraph(n)\n\tfor i := 0; i < m; i++ {\n\t\tu := getNextInt(scanner) - 1\n\t\tv := getNextInt(scanner) - 1\n\t\td := getNextInt64(scanner)\n\t\tg.appendEdge(u, v, i, d)\n\t\tg.appendEdge(v, u, i, d)\n\t}\n\tdd := &daikes{}\n\theap.Push(dd, newDaike(s, 0, 1))\n\tfor i := 0; i < n; i++ {\n\t\tg.v[i].d = math.MaxInt64\n\t}\n\tfor dd.Len() > 0 {\n\t\tp := heap.Pop(dd).(daike)\n\t\tif g.v[p.i].d < p.d {\n\t\t\tcontinue\n\t\t}\n\t\tif g.v[p.i].d == p.d {\n\t\t\tg.v[p.i].c.addAs(p.c)\n\t\t\tcontinue\n\t\t}\n\t\tg.v[p.i].c = p.c\n\t\tg.v[p.i].d = p.d\n\t\tfor _, e := range g.e[p.i] {\n\t\t\theap.Push(dd, newDaike(e.to, p.d+e.d, g.v[p.i].c))\n\t\t}\n\t}\n\tfmt.Fprintln(writer, g.v[t].c.mul(g.v[t].c.sub(1)))\n}\n\nfunc newDaike(i int, d int64, c mint) daike {\n\treturn daike{i: i, d: d, c: c}\n}\n\ntype daike struct {\n\ti int\n\td int64\n\tc mint\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].d < h[j].d\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 vertex struct {\n\td int64\n\tc mint\n}\ntype edge struct {\n\tto, id int\n\td int64\n}\ntype graph struct {\n\tv []vertex\n\te [][]edge\n}\n\nfunc newGraph(n int) graph {\n\treturn graph{\n\t\tv: make([]vertex, n),\n\t\te: make([][]edge, n),\n\t}\n}\nfunc (g *graph) appendEdge(from, to, id int, d int64) {\n\tg.e[from] = append(g.e[from], edge{\n\t\tto: to,\n\t\tid: id,\n\t\td: d,\n\t})\n}\n\ntype mint int64\n\nfunc (mt mint) mod() mint {\n\tm := mint(1e9 + 7)\n\tmt %= m\n\tif mt < 0 {\n\t\treturn mt + m\n\t}\n\treturn mt\n}\nfunc (mt mint) inv() mint {\n\treturn mt.pow(mint(0).sub(2))\n}\nfunc (mt mint) pow(n mint) mint {\n\tp := mint(1)\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tp.mulAs(mt)\n\t\t}\n\t\tmt.mulAs(mt)\n\t\tn >>= 1\n\t}\n\treturn p\n}\nfunc (mt mint) add(x mint) mint {\n\treturn (mt + x).mod()\n}\nfunc (mt mint) sub(x mint) mint {\n\treturn (mt - x).mod()\n}\nfunc (mt mint) mul(x mint) mint {\n\treturn (mt * x).mod()\n}\nfunc (mt mint) div(x mint) mint {\n\treturn mt.mul(x.inv())\n}\nfunc (mt *mint) addAs(x mint) *mint {\n\t*mt = mt.add(x)\n\treturn mt\n}\nfunc (mt *mint) subAs(x mint) *mint {\n\t*mt = mt.sub(x)\n\treturn mt\n}\nfunc (mt *mint) mulAs(x mint) *mint {\n\t*mt = mt.mul(x)\n\treturn mt\n}\nfunc (mt *mint) divAs(x mint) *mint {\n\t*mt = mt.div(x)\n\treturn mt\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "sample_input": "4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03453", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki.\n\nThe i-th edge connects Vertex U_i and Vertex V_i.\nThe time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).\n\nTakahashi departs Vertex S and Aoki departs Vertex T at the same time. Takahashi travels to Vertex T and Aoki travels to Vertex S, both in the shortest time possible.\nFind the number of the pairs of ways for Takahashi and Aoki to choose their shortest paths such that they never meet (at a vertex or on an edge) during the travel, modulo 10^9 + 7.\n\nConstraints\n\n1 \\leq N \\leq 100 000\n\n1 \\leq M \\leq 200 000\n\n1 \\leq S, T \\leq N\n\nS \\neq T\n\n1 \\leq U_i, V_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq D_i \\leq 10^9 (1 \\leq i \\leq M)\n\nIf i \\neq j, then (U_i, V_i) \\neq (U_j, V_j) and (U_i, V_i) \\neq (V_j, U_j).\n\nU_i \\neq V_i (1 \\leq i \\leq M)\n\nD_i are integers.\n\nThe given graph is connected.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nS T\nU_1 V_1 D_1\nU_2 V_2 D_2\n:\nU_M V_M D_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 4\n1 3\n1 2 1\n2 3 1\n3 4 1\n4 1 1\n\nSample Output 1\n\n2\n\nThere are two ways to choose shortest paths that satisfies the condition:\n\nTakahashi chooses the path 1 \\rightarrow 2 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 4 \\rightarrow 1.\n\nTakahashi chooses the path 1 \\rightarrow 4 \\rightarrow 3, and Aoki chooses the path 3 \\rightarrow 2 \\rightarrow 1.\n\nSample Input 2\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3\n1 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 3\n\n2\n\nSample Input 4\n\n8 13\n4 2\n7 3 9\n6 2 3\n1 6 4\n7 6 9\n3 8 9\n1 2 2\n2 8 12\n8 6 9\n2 5 5\n4 2 18\n5 3 7\n5 1 515371567\n4 8 6\n\nSample Output 4\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3674, "cpu_time_ms": 333, "memory_kb": 50888}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s982347826", "group_id": "codeNet:p03456", "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 main() {\n\tvar (\n\t\tIn = strings.Split(ReadLine(), \" \")\n\t\tab, _ = strconv.ParseFloat(In[0]+In[1], 64)\n\t)\n\n\tsq := math.Sqrt(ab)\n\n\t//整数か判定\n\tif float64(int(sq)) != sq {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar BufReader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc ReadLine() string {\n\ta, _, _ := BufReader.ReadLine()\n\treturn string(a)\n}\n\nfunc ReadLineInt() (result []int) {\n\tin := strings.Split(ReadLine(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1587981602, "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/s982347826.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s982347826", "user_id": "u121595121"}, "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\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\tIn = strings.Split(ReadLine(), \" \")\n\t\tab, _ = strconv.ParseFloat(In[0]+In[1], 64)\n\t)\n\n\tsq := math.Sqrt(ab)\n\n\t//整数か判定\n\tif float64(int(sq)) != sq {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar BufReader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc ReadLine() string {\n\ta, _, _ := BufReader.ReadLine()\n\treturn string(a)\n}\n\nfunc ReadLineInt() (result []int) {\n\tin := strings.Split(ReadLine(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s507286990", "group_id": "codeNet:p03456", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := next()\n\tb := next()\n\n\tp, _ := strconv.Atoi(a + b)\n\n\tfor i := 0; i < 1000; i++ {\n\t\tif i * i == p {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}", "language": "Go", "metadata": {"date": 1560383496, "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/s507286990.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s507286990", "user_id": "u703739962"}, "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 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\ta := next()\n\tb := next()\n\n\tp, _ := strconv.Atoi(a + b)\n\n\tfor i := 0; i < 1000; i++ {\n\t\tif i * i == p {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 461, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s092226380", "group_id": "codeNet:p03457", "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 debug = false\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar n int\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\tvar targets []string\n\tfor i := 0; i < n; i++ {\n\t\tif sc.Scan() {\n\t\t\ttargets = append(targets, sc.Text())\n\t\t}\n\t}\n\n\tres := GetAnswer(n, targets)\n\tfmt.Printf(\"%v\\n\", res)\n}\n\n// GetAnswer ...\nfunc GetAnswer(n int, targets []string) string {\n\tprt(\"inputs: n:%v targets:%#v\", n, targets)\n\tresult := \"Yes\"\n\n\ttargetArray := [][]int{}\n\ttargetArray = append(targetArray, []int{0, 0, 0})\n\tfor _, t := range targets {\n\t\tarr := getIntArray(t)\n\t\ttargetArray = append(targetArray, arr)\n\t}\n\tprt(\"targetArr: %v\", targetArray)\n\n\tfor i := 0; i < n; i++ {\n\t\tpos := math.Abs(float64(targetArray[i+1][1]-targetArray[i][1])) + math.Abs(float64(targetArray[i+1][2]-targetArray[i][2]))\n\t\tntime := targetArray[i+1][0] - targetArray[i][0]\n\t\tprt(\"pos: %d, ntime:%d\", int(pos), ntime)\n\t\tif int(pos) > ntime {\n\t\t\tresult = \"No\"\n\t\t\tbreak\n\t\t}\n\t\tif int(pos)%2 != ntime%2 {\n\t\t\tresult = \"No\"\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc getIntArray(str string) []int {\n\tstrarr := strings.Split(str, \" \")\n\tintarr := []int{}\n\tfor _, st := range strarr {\n\t\tti, _ := strconv.Atoi(st)\n\t\tintarr = append(intarr, ti)\n\t}\n\treturn intarr\n}\n\nfunc prt(format string, inputs ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(format+\"\\n\", inputs...)\n\t}\n}", "language": "Go", "metadata": {"date": 1577379815, "filename_ext": "go", "original_language": "Go (1.6)", "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/s092226380.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s092226380", "user_id": "u966615637"}, "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\"strconv\"\n\t\"strings\"\n)\n\nvar debug = false\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar n int\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\tvar targets []string\n\tfor i := 0; i < n; i++ {\n\t\tif sc.Scan() {\n\t\t\ttargets = append(targets, sc.Text())\n\t\t}\n\t}\n\n\tres := GetAnswer(n, targets)\n\tfmt.Printf(\"%v\\n\", res)\n}\n\n// GetAnswer ...\nfunc GetAnswer(n int, targets []string) string {\n\tprt(\"inputs: n:%v targets:%#v\", n, targets)\n\tresult := \"Yes\"\n\n\ttargetArray := [][]int{}\n\ttargetArray = append(targetArray, []int{0, 0, 0})\n\tfor _, t := range targets {\n\t\tarr := getIntArray(t)\n\t\ttargetArray = append(targetArray, arr)\n\t}\n\tprt(\"targetArr: %v\", targetArray)\n\n\tfor i := 0; i < n; i++ {\n\t\tpos := math.Abs(float64(targetArray[i+1][1]-targetArray[i][1])) + math.Abs(float64(targetArray[i+1][2]-targetArray[i][2]))\n\t\tntime := targetArray[i+1][0] - targetArray[i][0]\n\t\tprt(\"pos: %d, ntime:%d\", int(pos), ntime)\n\t\tif int(pos) > ntime {\n\t\t\tresult = \"No\"\n\t\t\tbreak\n\t\t}\n\t\tif int(pos)%2 != ntime%2 {\n\t\t\tresult = \"No\"\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc getIntArray(str string) []int {\n\tstrarr := strings.Split(str, \" \")\n\tintarr := []int{}\n\tfor _, st := range strarr {\n\t\tti, _ := strconv.Atoi(st)\n\t\tintarr = append(intarr, ti)\n\t}\n\treturn intarr\n}\n\nfunc prt(format string, inputs ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(format+\"\\n\", inputs...)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1403, "cpu_time_ms": 171, "memory_kb": 18688}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s362289757", "group_id": "codeNet:p03457", "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 debug = false\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%s\", &n)\n\tvar targets []string\n\tfor i := 0; i < n; i++ {\n\t\tif sc.Scan() {\n\t\t\ttargets = append(targets, sc.Text())\n\t\t}\n\t}\n\n\tres := GetAnswer(n, targets)\n\tfmt.Printf(\"%v\\n\", res)\n}\n\n// GetAnswer ...\nfunc GetAnswer(n int, targets []string) string {\n\tprt(\"inputs: n:%v targets:%#v\", n, targets)\n\tresult := \"No\"\n\tstx := 0\n\tsty := 0\n\tcount := 0\n\tpasttime := 0\n\tfor _, t := range targets {\n\t\tprt(\"target: %v\", t)\n\t\ttarr := getIntArray(t)\n\t\t// pos := math.Abs(float64((tarr[1] - stx) + (tarr[2] - sty)))\n\t\tpos := math.Abs(float64((tarr[1] - stx)) + math.Abs(float64((tarr[2] - sty))))\n\t\tprt(\"pos: %d, past:%d\", int(pos), pasttime)\n\t\tif (tarr[0]-pasttime)%2 == int(pos)%2 && int(pos) <= (tarr[0]-pasttime) {\n\t\t\tcount++\n\t\t\tstx = tarr[1]\n\t\t\tsty = tarr[2]\n\t\t\tpasttime += (tarr[0] - pasttime)\n\t\t}\n\t\tprt(\"count: %d\", count)\n\t}\n\tif n == count {\n\t\tresult = \"Yes\"\n\t}\n\treturn result\n}\n\nfunc getIntArray(str string) []int {\n\tstrarr := strings.Split(str, \" \")\n\tintarr := []int{}\n\tfor _, st := range strarr {\n\t\tti, _ := strconv.Atoi(st)\n\t\tintarr = append(intarr, ti)\n\t}\n\treturn intarr\n}\n\nfunc prt(format string, inputs ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(format+\"\\n\", inputs...)\n\t}\n}", "language": "Go", "metadata": {"date": 1577196305, "filename_ext": "go", "original_language": "Go (1.6)", "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/s362289757.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s362289757", "user_id": "u966615637"}, "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\"strconv\"\n\t\"strings\"\n)\n\nvar debug = false\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%s\", &n)\n\tvar targets []string\n\tfor i := 0; i < n; i++ {\n\t\tif sc.Scan() {\n\t\t\ttargets = append(targets, sc.Text())\n\t\t}\n\t}\n\n\tres := GetAnswer(n, targets)\n\tfmt.Printf(\"%v\\n\", res)\n}\n\n// GetAnswer ...\nfunc GetAnswer(n int, targets []string) string {\n\tprt(\"inputs: n:%v targets:%#v\", n, targets)\n\tresult := \"No\"\n\tstx := 0\n\tsty := 0\n\tcount := 0\n\tpasttime := 0\n\tfor _, t := range targets {\n\t\tprt(\"target: %v\", t)\n\t\ttarr := getIntArray(t)\n\t\t// pos := math.Abs(float64((tarr[1] - stx) + (tarr[2] - sty)))\n\t\tpos := math.Abs(float64((tarr[1] - stx)) + math.Abs(float64((tarr[2] - sty))))\n\t\tprt(\"pos: %d, past:%d\", int(pos), pasttime)\n\t\tif (tarr[0]-pasttime)%2 == int(pos)%2 && int(pos) <= (tarr[0]-pasttime) {\n\t\t\tcount++\n\t\t\tstx = tarr[1]\n\t\t\tsty = tarr[2]\n\t\t\tpasttime += (tarr[0] - pasttime)\n\t\t}\n\t\tprt(\"count: %d\", count)\n\t}\n\tif n == count {\n\t\tresult = \"Yes\"\n\t}\n\treturn result\n}\n\nfunc getIntArray(str string) []int {\n\tstrarr := strings.Split(str, \" \")\n\tintarr := []int{}\n\tfor _, st := range strarr {\n\t\tti, _ := strconv.Atoi(st)\n\t\tintarr = append(intarr, ti)\n\t}\n\treturn intarr\n}\n\nfunc prt(format string, inputs ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(format+\"\\n\", inputs...)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1340, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s468676775", "group_id": "codeNet:p03457", "input_text": "package main\n\nimport (\n\t\"fmt\"\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\tvar n int\n\tfmt.Scan(&n)\n\n\tvar t, x, y int\n\tvar ny, nx, nt int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&t, &x, &y)\n\t\tdt, dx, dy := t-nt, abs(nx-x), abs(ny-y)\n\t\tif dt-(dx+dy) < 0 || (dt-(dx+dy))%2 != 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tnx, ny, nt = x, y, t\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1553223664, "filename_ext": "go", "original_language": "Go (1.6)", "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/s468676775.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s468676775", "user_id": "u700477434"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\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\tvar n int\n\tfmt.Scan(&n)\n\n\tvar t, x, y int\n\tvar ny, nx, nt int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&t, &x, &y)\n\t\tdt, dx, dy := t-nt, abs(nx-x), abs(ny-y)\n\t\tif dt-(dx+dy) < 0 || (dt-(dx+dy))%2 != 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tnx, ny, nt = x, y, t\n\t}\n\tfmt.Println(\"Yes\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 981, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013516573", "group_id": "codeNet:p03457", "input_text": "package main\n\nimport \"fmt\"\n\nfunc nextInt() int {\n\tvar x int\n\tfmt.Scan(&x)\n\treturn x\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\tN := nextInt()\n\n\ttype whenWhere struct {\n\t\tt, x, y int\n\t}\n\tflgNG := false\n\tpre := whenWhere{0, 0, 0}\n\tfor range make([]struct{}, N) {\n\t\tnow := whenWhere{nextInt(), nextInt(), nextInt()}\n\t\tt := now.t - pre.t\n\t\th := abs((now.x + now.y) - (pre.x + pre.y))\n\n\t\tif h > t || t%2 != h%2 {\n\t\t\tflgNG = true\n\t\t}\n\t\tpre = now\n\t}\n\tif !flgNG {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1549976056, "filename_ext": "go", "original_language": "Go (1.6)", "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/s013516573.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013516573", "user_id": "u323680411"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc nextInt() int {\n\tvar x int\n\tfmt.Scan(&x)\n\treturn x\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\tN := nextInt()\n\n\ttype whenWhere struct {\n\t\tt, x, y int\n\t}\n\tflgNG := false\n\tpre := whenWhere{0, 0, 0}\n\tfor range make([]struct{}, N) {\n\t\tnow := whenWhere{nextInt(), nextInt(), nextInt()}\n\t\tt := now.t - pre.t\n\t\th := abs((now.x + now.y) - (pre.x + pre.y))\n\n\t\tif h > t || t%2 != h%2 {\n\t\t\tflgNG = true\n\t\t}\n\t\tpre = now\n\t}\n\tif !flgNG {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1102, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493365407", "group_id": "codeNet:p03469", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\n var N, Y int\n fmt.Fscanf(os.Stdin, \"%d %d\", &N, &Y)\n\n for a := 0; a <= N; a++ {\n for b := 0; b <= N; b++ {\n if a+b > N {\n break\n }\n remain := Y - a*10000 - b*5000\n if remain < 0 {\n break\n }\n c := remain / 1000\n if a+b+c != N {\n continue\n }\n fmt.Printf(\"%d %d %d\\n\", a, b, c)\n return\n }\n }\n fmt.Printf(\"-1 -1 -1\\n\")\n}", "language": "Go", "metadata": {"date": 1579647851, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03469.html", "problem_id": "p03469", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03469/input.txt", "sample_output_relpath": "derived/input_output/data/p03469/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03469/Go/s493365407.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s493365407", "user_id": "u004477916"}, "prompt_components": {"gold_output": "2018/01/07\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\n var N, Y int\n fmt.Fscanf(os.Stdin, \"%d %d\", &N, &Y)\n\n for a := 0; a <= N; a++ {\n for b := 0; b <= N; b++ {\n if a+b > N {\n break\n }\n remain := Y - a*10000 - b*5000\n if remain < 0 {\n break\n }\n c := remain / 1000\n if a+b+c != N {\n continue\n }\n fmt.Printf(\"%d %d %d\\n\", a, b, c)\n return\n }\n }\n fmt.Printf(\"-1 -1 -1\\n\")\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "sample_input": "2017/01/07\n"}, "reference_outputs": ["2018/01/07\n"], "source_document_id": "p03469", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn some day in January 2018, Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23, 2018 should be written as 2018/01/23.\n\nAfter finishing the document, she noticed that she had mistakenly wrote 2017 at the beginning of the date column. Write a program that, when the string that Takaki wrote in the date column, S, is given as input, modifies the first four characters in S to 2018 and prints it.\n\nConstraints\n\nS is a string of length 10.\n\nThe first eight characters in S are 2017/01/.\n\nThe last two characters in S are digits and represent an integer between 1 and 31 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace the first four characters in S with 2018 and print it.\n\nSample Input 1\n\n2017/01/07\n\nSample Output 1\n\n2018/01/07\n\nSample Input 2\n\n2017/01/31\n\nSample Output 2\n\n2018/01/31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s387425133", "group_id": "codeNet:p03470", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tfmt.Scan(&d)\n\t\tm[d]++\n\t}\n\tfmt.Println(len(m))\n}\n", "language": "Go", "metadata": {"date": 1576009260, "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/s387425133.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s387425133", "user_id": "u902409225"}, "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\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tvar d int\n\t\tfmt.Scan(&d)\n\t\tm[d]++\n\t}\n\tfmt.Println(len(m))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 179, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s410935062", "group_id": "codeNet:p03470", "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 := nextInt()\n\tD := make([]int, N)\n\t\n\tfor i := 0; i < N; i++ {\n D = append(D, nextInt())\n\t}\n\tm := map[int]int{}\n\n\t//sort.Sort(sort.IntSlice(D))\n\n\tfor _, key := range D {\n\t\tif _, ok := m[key]; !ok {\n\t\t\tm[key] = 1\n\t\t} else {\n\t\t\tm[key] += 1\n\t\t}\n\t}\n\t\n\n\tfmt.Print(len(m))\n\n}\n", "language": "Go", "metadata": {"date": 1559160946, "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/s410935062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s410935062", "user_id": "u710190793"}, "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 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\tD := make([]int, N)\n\t\n\tfor i := 0; i < N; i++ {\n D = append(D, nextInt())\n\t}\n\tm := map[int]int{}\n\n\t//sort.Sort(sort.IntSlice(D))\n\n\tfor _, key := range D {\n\t\tif _, ok := m[key]; !ok {\n\t\t\tm[key] = 1\n\t\t} else {\n\t\t\tm[key] += 1\n\t\t}\n\t}\n\t\n\n\tfmt.Print(len(m))\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s702317542", "group_id": "codeNet:p03474", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc are_digits(s string) bool {\n\tfor _, r := range s {\n\t\tif !unicode.IsDigit(r) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar a, b int\n\tvar s string\n\tfmt.Scan(&a, &b)\n\tfmt.Scan(&s)\n\n\tif are_digits(s[:a]) && are_digits(s[a+1:]) && s[a] == '-' {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1548645041, "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/s702317542.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s702317542", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"unicode\"\n)\n\nfunc are_digits(s string) bool {\n\tfor _, r := range s {\n\t\tif !unicode.IsDigit(r) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar a, b int\n\tvar s string\n\tfmt.Scan(&a, &b)\n\tfmt.Scan(&s)\n\n\tif are_digits(s[:a]) && are_digits(s[a+1:]) && s[a] == '-' {\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 359, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s752156760", "group_id": "codeNet:p03476", "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\tQ := readInt()\n\tdata := PrimeNumbers(int64(10e5))\n\tS := make([]int64, int64(10e5+1))\n\tS[0] = 0\n\tfor i := 3; i < len(S); i += 2 {\n\t\tif data[i] == 1 && data[(i+1)/2] == 1 {\n\t\t\tS[i]++\n\t\t}\n\t}\n\tfor i := 3; i < len(S); i++ {\n\t\tS[i] += S[i-1]\n\t}\n\tfor i := int64(0); i < Q; i++ {\n\t\tl, r := readInt(), readInt()\n\t\tfmt.Println(S[r] - S[l-1])\n\t}\n}\n\n/** エラトステネスの篩より素数を求める。 計算量: O(n) */\nfunc PrimeNumbers(N int64) []int64 {\n\tdata := make([]int64, N+1)\n\tm := int64(2)\n\tfor i := int64(0); i <= N; i++ {\n\t\tdata[i] = 1\n\t}\n\tdata[0], data[1] = 0, 0\n\n\t// logic\n\tfor m <= N {\n\t\tfor i := 2 * m; i <= N; i += m {\n\t\t\tdata[i] = 0\n\t\t}\n\t\tm++\n\t}\n\treturn data\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": 1588681034, "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/s752156760.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s752156760", "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\tQ := readInt()\n\tdata := PrimeNumbers(int64(10e5))\n\tS := make([]int64, int64(10e5+1))\n\tS[0] = 0\n\tfor i := 3; i < len(S); i += 2 {\n\t\tif data[i] == 1 && data[(i+1)/2] == 1 {\n\t\t\tS[i]++\n\t\t}\n\t}\n\tfor i := 3; i < len(S); i++ {\n\t\tS[i] += S[i-1]\n\t}\n\tfor i := int64(0); i < Q; i++ {\n\t\tl, r := readInt(), readInt()\n\t\tfmt.Println(S[r] - S[l-1])\n\t}\n}\n\n/** エラトステネスの篩より素数を求める。 計算量: O(n) */\nfunc PrimeNumbers(N int64) []int64 {\n\tdata := make([]int64, N+1)\n\tm := int64(2)\n\tfor i := int64(0); i <= N; i++ {\n\t\tdata[i] = 1\n\t}\n\tdata[0], data[1] = 0, 0\n\n\t// logic\n\tfor m <= N {\n\t\tfor i := 2 * m; i <= N; i += m {\n\t\t\tdata[i] = 0\n\t\t}\n\t\tm++\n\t}\n\treturn data\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6237, "cpu_time_ms": 312, "memory_kb": 17792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s314110670", "group_id": "codeNet:p03476", "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 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\nfunc main() {\n\tdefer stdout.Flush()\n\tN := 100010\n\tp := NewPrimes(N)\n\tsum := make([]int, N)\n\tfor i := 1; i < N; i++ {\n\t\tif i%2 != 0 {\n\t\t\tsum[i] = sum[i-1]\n\t\t\tcontinue\n\t\t}\n\t\tvar v int\n\t\tn := i - 1\n\t\tif p[n] && p[(n+1)/2] {\n\t\t\tv = 1\n\t\t}\n\t\tsum[i] = sum[i-1] + v\n\t}\n\tQ := readInt()\n\tfor i := 0; i < Q; i++ {\n\t\tl := readInt()\n\t\tr := readInt()\n\t\tprintln(sum[r+1] - sum[l])\n\t}\n}\n\nfunc NewPrimes(n int) []bool {\n\tm := n + 1\n\tp := make([]bool, m)\n\tfor i := 3; i < m; i += 2 {\n\t\tp[i] = true\n\t}\n\tp[2] = true\n\tfor i := 3; i*i < m; i += 2 {\n\t\tif !p[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + i; j < m; j += i {\n\t\t\tp[j] = false\n\t\t}\n\t}\n\n\treturn p\n}\n", "language": "Go", "metadata": {"date": 1534905402, "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/s314110670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s314110670", "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 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\nfunc main() {\n\tdefer stdout.Flush()\n\tN := 100010\n\tp := NewPrimes(N)\n\tsum := make([]int, N)\n\tfor i := 1; i < N; i++ {\n\t\tif i%2 != 0 {\n\t\t\tsum[i] = sum[i-1]\n\t\t\tcontinue\n\t\t}\n\t\tvar v int\n\t\tn := i - 1\n\t\tif p[n] && p[(n+1)/2] {\n\t\t\tv = 1\n\t\t}\n\t\tsum[i] = sum[i-1] + v\n\t}\n\tQ := readInt()\n\tfor i := 0; i < Q; i++ {\n\t\tl := readInt()\n\t\tr := readInt()\n\t\tprintln(sum[r+1] - sum[l])\n\t}\n}\n\nfunc NewPrimes(n int) []bool {\n\tm := n + 1\n\tp := make([]bool, m)\n\tfor i := 3; i < m; i += 2 {\n\t\tp[i] = true\n\t}\n\tp[2] = true\n\tfor i := 3; i*i < m; i += 2 {\n\t\tif !p[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + i; j < m; j += i {\n\t\t\tp[j] = false\n\t\t}\n\t}\n\n\treturn p\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1837, "cpu_time_ms": 60, "memory_kb": 4352}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254338912", "group_id": "codeNet:p03477", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, D int\n\tvar ans string\n\tfmt.Scan(&A, &B, &C, &D)\n\n\tif A+B > C+D {\n\t\tans = \"Left\"\n\t} else if A+B < C+D {\n\t\tans = \"Right\"\n\t} else {\n\t\tans = \"Balanced\"\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1560283767, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03477.html", "problem_id": "p03477", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03477/input.txt", "sample_output_relpath": "derived/input_output/data/p03477/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03477/Go/s254338912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s254338912", "user_id": "u879870653"}, "prompt_components": {"gold_output": "Left\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, D int\n\tvar ans string\n\tfmt.Scan(&A, &B, &C, &D)\n\n\tif A+B > C+D {\n\t\tans = \"Left\"\n\t} else if A+B < C+D {\n\t\tans = \"Right\"\n\t} else {\n\t\tans = \"Balanced\"\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "sample_input": "3 8 7 1\n"}, "reference_outputs": ["Left\n"], "source_document_id": "p03477", "source_text": "Score : 100 points\n\nProblem Statement\n\nA balance scale tips to the left if L>R, where L is the total weight of the masses on the left pan and R is the total weight of the masses on the right pan. Similarly, it balances if L=R, and tips to the right if L8, we should print Left.\n\nSample Input 2\n\n3 4 5 2\n\nSample Output 2\n\nBalanced\n\nThe total weight of the masses on the left pan is 7, and the total weight of the masses on the right pan is 7. Since 7=7, we should print Balanced.\n\nSample Input 3\n\n1 7 6 4\n\nSample Output 3\n\nRight\n\nThe total weight of the masses on the left pan is 8, and the total weight of the masses on the right pan is 10. Since 8<10, we should print Right.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s079126396", "group_id": "codeNet:p03479", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, Y int\n\tfmt.Scan(&X, &Y)\n\tvar ans, mul int\n\tmul = X\n\tif X == Y || 2*X > Y {\n\t\tans = 0\n\t} else {\n\t\tans = 1\n\t\tfor {\n\t\t\tif mul*2 <= Y {\n\t\t\t\tmul *= 2\n\t\t\t\tans++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1568487306, "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/s079126396.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s079126396", "user_id": "u196030116"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar X, Y int\n\tfmt.Scan(&X, &Y)\n\tvar ans, mul int\n\tmul = X\n\tif X == Y || 2*X > Y {\n\t\tans = 0\n\t} else {\n\t\tans = 1\n\t\tfor {\n\t\t\tif mul*2 <= Y {\n\t\t\t\tmul *= 2\n\t\t\t\tans++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s136726342", "group_id": "codeNet:p03479", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n\tvar start,end int\n\tfmt.Scanf(\"%d %d\",&start,&end)\n\tfmt.Println(1+int(math.Log2(float64(end/start))))\n}", "language": "Go", "metadata": {"date": 1562965528, "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/s136726342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s136726342", "user_id": "u156931988"}, "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 start,end int\n\tfmt.Scanf(\"%d %d\",&start,&end)\n\tfmt.Println(1+int(math.Log2(float64(end/start))))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s117370626", "group_id": "codeNet:p03480", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int = 1e9, 0\n\nfunc main() {\n\tvar flag bool\n\tvar S string\n\tfmt.Scan(&S)\n\n\tfor i := 0; i < len(S)-1; i++ {\n\t\tif string(S[i]) != string(S[i+1]) {\n\t\t\tcnt = max(i+1, len(S)-1-i)\n\t\t\tans = min(ans, cnt)\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag == false {\n\t\tans = len(S)\n\t}\n\n\tfmt.Println(ans)\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 []struct {\n\tb, c int\n}\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].c > a[j].c }\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": 1563492128, "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/s117370626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s117370626", "user_id": "u266742706"}, "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\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt int = 1e9, 0\n\nfunc main() {\n\tvar flag bool\n\tvar S string\n\tfmt.Scan(&S)\n\n\tfor i := 0; i < len(S)-1; i++ {\n\t\tif string(S[i]) != string(S[i+1]) {\n\t\t\tcnt = max(i+1, len(S)-1-i)\n\t\t\tans = min(ans, cnt)\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag == false {\n\t\tans = len(S)\n\t}\n\n\tfmt.Println(ans)\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 []struct {\n\tb, c int\n}\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].c > a[j].c }\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2829, "cpu_time_ms": 59, "memory_kb": 1280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001966274", "group_id": "codeNet:p03481", "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\tA, B := sc.NextInt(), sc.NextInt()\n\ti := 0\n\tfor A <= B {\n\t\ti++\n\t\tA *= 2\n\t}\n\tfmt.Println(i)\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": 1514081179, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03481.html", "problem_id": "p03481", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03481/input.txt", "sample_output_relpath": "derived/input_output/data/p03481/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03481/Go/s001966274.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s001966274", "user_id": "u504669764"}, "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\tsc := NewScanner()\n\tA, B := sc.NextInt(), sc.NextInt()\n\ti := 0\n\tfor A <= B {\n\t\ti++\n\t\tA *= 2\n\t}\n\tfmt.Println(i)\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\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": "p03481", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2014, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s014900681", "group_id": "codeNet:p03486", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\ts, t := []byte(ReadString()), []byte(ReadString())\n\tsort.Slice(s, func(i, j int) bool {\n\t\treturn s[i] > s[j]\n\t})\n\tsort.Slice(t, func(i, j int) bool {\n\t\treturn t[i] > t[j]\n\t})\n\ta, b := string(s), string(t)\n\tif a < b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\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": 1599700828, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s014900681.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s014900681", "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\t\"sort\"\n)\n\nfunc main() {\n\ts, t := []byte(ReadString()), []byte(ReadString())\n\tsort.Slice(s, func(i, j int) bool {\n\t\treturn s[i] > s[j]\n\t})\n\tsort.Slice(t, func(i, j int) bool {\n\t\treturn t[i] > t[j]\n\t})\n\ta, b := string(s), string(t)\n\tif a < b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 690, "cpu_time_ms": 6, "memory_kb": 1844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s876715179", "group_id": "codeNet:p03486", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sortRune(list []rune, desc bool) {\n\teNum := len(list)\n\tfor i := eNum; i > 0; i-- {\n\t\tfor j := 0; j < i-1; j++ {\n\t\t\tif desc {\n\t\t\t\tif list[j] < list[j+1] {\n\t\t\t\t\tlist[j], list[j+1] = list[j+1], list[j]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif list[j] > list[j+1] {\n\t\t\t\t\tlist[j], list[j+1] = list[j+1], list[j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nfunc sort(s string, desc bool) string {\n\tr := []rune(s)\n\tsortRune(r, desc)\n\treturn string(r)\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tss := sort(s, false)\n\ttt := sort(t, true)\n\n\tif ss < tt {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1567026400, "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/s876715179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s876715179", "user_id": "u536614266"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sortRune(list []rune, desc bool) {\n\teNum := len(list)\n\tfor i := eNum; i > 0; i-- {\n\t\tfor j := 0; j < i-1; j++ {\n\t\t\tif desc {\n\t\t\t\tif list[j] < list[j+1] {\n\t\t\t\t\tlist[j], list[j+1] = list[j+1], list[j]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif list[j] > list[j+1] {\n\t\t\t\t\tlist[j], list[j+1] = list[j+1], list[j]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n\nfunc sort(s string, desc bool) string {\n\tr := []rune(s)\n\tsortRune(r, desc)\n\treturn string(r)\n}\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tss := sort(s, false)\n\ttt := sort(t, true)\n\n\tif ss < tt {\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 611, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s439118213", "group_id": "codeNet:p03488", "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\"sort\"\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\ts := next.String()\n\tx := next.Int()\n\ty := next.Int()\n\tvx := make([]int, 0)\n\tvy := make([]int, 0)\n\tvar cntF, cntT int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 'F' {\n\t\t\tcntF++\n\t\t} else {\n\t\t\tif cntT%2 == 0 {\n\t\t\t\tvx = append(vx, cntF)\n\t\t\t} else {\n\t\t\t\tvy = append(vy, cntF)\n\t\t\t}\n\t\t\tcntT++\n\t\t\tcntF = 0\n\t\t}\n\t}\n\tif cntF > 0 {\n\t\tif cntT%2 == 0 {\n\t\t\tvx = append(vx, cntF)\n\t\t} else {\n\t\t\tvy = append(vy, cntF)\n\t\t}\n\t}\n\tlog.Println(vx, vy)\n\tvar sumx, sumy int\n\tsumx = vx[0]\n\tvx[0] = 0\n\tsort.Ints(vx)\n\tsort.Ints(vy)\n\tlog.Println(vx, vy)\n\tfor i := 1; i < len(vx); i++ {\n\t\tif sumx <= x {\n\t\t\tsumx += vx[i]\n\t\t} else {\n\t\t\tsumx -= vx[i]\n\t\t}\n\t}\n\tfor i := 0; i < len(vy); i++ {\n\t\tif sumy <= y {\n\t\t\tsumy += vy[i]\n\t\t} else {\n\t\t\tsumy -= vy[i]\n\t\t}\n\t}\n\tif sumx == x && sumy == y {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\tlog.Println(cntF, cntT)\n\tlog.Println(x, y)\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": 1532204421, "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/s439118213.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s439118213", "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\"math/rand\"\n\t\"os\"\n\t\"sort\"\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\ts := next.String()\n\tx := next.Int()\n\ty := next.Int()\n\tvx := make([]int, 0)\n\tvy := make([]int, 0)\n\tvar cntF, cntT int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 'F' {\n\t\t\tcntF++\n\t\t} else {\n\t\t\tif cntT%2 == 0 {\n\t\t\t\tvx = append(vx, cntF)\n\t\t\t} else {\n\t\t\t\tvy = append(vy, cntF)\n\t\t\t}\n\t\t\tcntT++\n\t\t\tcntF = 0\n\t\t}\n\t}\n\tif cntF > 0 {\n\t\tif cntT%2 == 0 {\n\t\t\tvx = append(vx, cntF)\n\t\t} else {\n\t\t\tvy = append(vy, cntF)\n\t\t}\n\t}\n\tlog.Println(vx, vy)\n\tvar sumx, sumy int\n\tsumx = vx[0]\n\tvx[0] = 0\n\tsort.Ints(vx)\n\tsort.Ints(vy)\n\tlog.Println(vx, vy)\n\tfor i := 1; i < len(vx); i++ {\n\t\tif sumx <= x {\n\t\t\tsumx += vx[i]\n\t\t} else {\n\t\t\tsumx -= vx[i]\n\t\t}\n\t}\n\tfor i := 0; i < len(vy); i++ {\n\t\tif sumy <= y {\n\t\t\tsumy += vy[i]\n\t\t} else {\n\t\t\tsumy -= vy[i]\n\t\t}\n\t}\n\tif sumx == x && sumy == y {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\tlog.Println(cntF, cntT)\n\tlog.Println(x, y)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4663, "cpu_time_ms": 5, "memory_kb": 1280}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s209899086", "group_id": "codeNet:p03490", "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\tS := sc.NextLine()\n\tx, y := sc.NextInt(), sc.NextInt()\n\n\ttypes := make([][]int, 2)\n\ttypes[0] = make([]int, 0)\n\ttypes[1] = make([]int, 0)\n\n\tmode := 0\n\tcount := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == 'T' {\n\t\t\tif count > 0 || i == 0 {\n\t\t\t\ttypes[mode] = append(types[mode], count)\n\t\t\t}\n\t\t\tmode = 1 - mode\n\t\t\tcount = 0\n\t\t} else {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count > 0 || len(S) == 1 {\n\t\ttypes[mode] = append(types[mode], count)\n\t}\n\t//fmt.Printf(\"%+v\\n\", types)\n\tgeta := 8000\n\n\tfor p := 0; p < 2; p++ {\n\t\tdp := make([]bool, 16000+1)\n\n\t\tv := x\n\t\tif p == 1 {\n\t\t\tv = y\n\t\t}\n\n\t\tif len(types[p]) == 0 {\n\t\t\tif v != 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tstart := 0\n\t\t\tif p == 0 {\n\t\t\t\tdp[types[p][0]+geta] = true\n\t\t\t\tstart = 1\n\t\t\t} else {\n\t\t\t\tdp[geta] = true\n\t\t\t}\n\n\t\t\tfor i := start; i < len(types[p]); i++ {\n\t\t\t\tndp := make([]bool, 16000+1)\n\n\t\t\t\tfor l := 0; l < len(dp); l++ {\n\t\t\t\t\tif !dp[l] {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tif l+types[p][i] < len(dp) {\n\t\t\t\t\t\tndp[l+types[p][i]] = true\n\t\t\t\t\t}\n\t\t\t\t\tif l-types[p][i] >= 0 {\n\t\t\t\t\t\tndp[l-types[p][i]] = true\n\t\t\t\t\t}\n\t\t\t\t\tdp[l] = false\n\t\t\t\t}\n\t\t\t\tdp = ndp\n\t\t\t}\n\n\t\t\tif !dp[v+geta] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\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}\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": 1513481081, "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/s209899086.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s209899086", "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\tS := sc.NextLine()\n\tx, y := sc.NextInt(), sc.NextInt()\n\n\ttypes := make([][]int, 2)\n\ttypes[0] = make([]int, 0)\n\ttypes[1] = make([]int, 0)\n\n\tmode := 0\n\tcount := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == 'T' {\n\t\t\tif count > 0 || i == 0 {\n\t\t\t\ttypes[mode] = append(types[mode], count)\n\t\t\t}\n\t\t\tmode = 1 - mode\n\t\t\tcount = 0\n\t\t} else {\n\t\t\tcount++\n\t\t}\n\t}\n\tif count > 0 || len(S) == 1 {\n\t\ttypes[mode] = append(types[mode], count)\n\t}\n\t//fmt.Printf(\"%+v\\n\", types)\n\tgeta := 8000\n\n\tfor p := 0; p < 2; p++ {\n\t\tdp := make([]bool, 16000+1)\n\n\t\tv := x\n\t\tif p == 1 {\n\t\t\tv = y\n\t\t}\n\n\t\tif len(types[p]) == 0 {\n\t\t\tif v != 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\tstart := 0\n\t\t\tif p == 0 {\n\t\t\t\tdp[types[p][0]+geta] = true\n\t\t\t\tstart = 1\n\t\t\t} else {\n\t\t\t\tdp[geta] = true\n\t\t\t}\n\n\t\t\tfor i := start; i < len(types[p]); i++ {\n\t\t\t\tndp := make([]bool, 16000+1)\n\n\t\t\t\tfor l := 0; l < len(dp); l++ {\n\t\t\t\t\tif !dp[l] {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tif l+types[p][i] < len(dp) {\n\t\t\t\t\t\tndp[l+types[p][i]] = true\n\t\t\t\t\t}\n\t\t\t\t\tif l-types[p][i] >= 0 {\n\t\t\t\t\t\tndp[l-types[p][i]] = true\n\t\t\t\t\t}\n\t\t\t\t\tdp[l] = false\n\t\t\t\t}\n\t\t\t\tdp = ndp\n\t\t\t}\n\n\t\t\tif !dp[v+geta] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\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}\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3116, "cpu_time_ms": 105, "memory_kb": 7424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s148373248", "group_id": "codeNet:p03494", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, i int\n\n\tfmt.Scan(&n)\n\tarry := make([]int, n)\n\tfor i = 0; i < n; i++ {\n\t\tfmt.Scan(&arry[i])\n\t}\n\n\tans := 0\n\tfor {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif arry[j]%2 == 0 {\n\t\t\t\tarry[j] = arry[j] / 2\n\t\t\t} else {\n\t\t\t\tgoto finish\n\t\t\t}\n\t\t}\n\t\tans++\n\t}\nfinish:\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1590343592, "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/s148373248.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s148373248", "user_id": "u333428317"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, i int\n\n\tfmt.Scan(&n)\n\tarry := make([]int, n)\n\tfor i = 0; i < n; i++ {\n\t\tfmt.Scan(&arry[i])\n\t}\n\n\tans := 0\n\tfor {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif arry[j]%2 == 0 {\n\t\t\t\tarry[j] = arry[j] / 2\n\t\t\t} else {\n\t\t\t\tgoto finish\n\t\t\t}\n\t\t}\n\t\tans++\n\t}\nfinish:\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s225329912", "group_id": "codeNet:p03494", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n 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\n\tvar cnt int\n\tfor evenAll(s) {\n\t\tfor i, _ := range s {\n\t\t\ts[i] /= 2\n\t\t}\n\t\tcnt++\n\t}\n\tfmt.Println(cnt)\n}\n\nfunc evenAll(s []int) bool {\n\tfor _, a := range s {\n\t\tif a%2 != 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1584537183, "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/s225329912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s225329912", "user_id": "u367908963"}, "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\ts := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&s[i])\n\t}\n\n\tvar cnt int\n\tfor evenAll(s) {\n\t\tfor i, _ := range s {\n\t\t\ts[i] /= 2\n\t\t}\n\t\tcnt++\n\t}\n\tfmt.Println(cnt)\n}\n\nfunc evenAll(s []int) bool {\n\tfor _, a := range s {\n\t\tif a%2 != 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s121956673", "group_id": "codeNet:p03494", "input_text": "package main\n\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var N,A,B int\n var count int\n var res int = 500000000\n\n fmt.Scan(&N)\n\n for i := 0; i < N; i++ {\n fmt.Scan( &A )\n B = A\n count = 0\n\n for j := 1; j < 500000000; j++ {\n if B % 2 == 0 {\n B /= 2\n count ++\n } else {\n break\n }\n }\n\n if count < res {\n res = count\n }\n\n }\n\n fmt.Println(res)\n\n}\n", "language": "Go", "metadata": {"date": 1579374262, "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/s121956673.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s121956673", "user_id": "u522257437"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var N,A,B int\n var count int\n var res int = 500000000\n\n fmt.Scan(&N)\n\n for i := 0; i < N; i++ {\n fmt.Scan( &A )\n B = A\n count = 0\n\n for j := 1; j < 500000000; j++ {\n if B % 2 == 0 {\n B /= 2\n count ++\n } else {\n break\n }\n }\n\n if count < res {\n res = count\n }\n\n }\n\n fmt.Println(res)\n\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s266561593", "group_id": "codeNet:p03494", "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 getInput() ([]int, bool) {\n\tsc.Split(bufio.ScanWords)\n\n\t// read num of input.\n\tN := 0\n\tif sc.Scan() {\n\t\tn, err := strconv.Atoi(sc.Text())\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tN = n\n\t}\n\n\tA := make([]int, N)\n\tfor i := range A {\n\t\tif !sc.Scan() {\n\t\t\treturn nil, false\n\t\t}\n\t\ta, err := strconv.Atoi(sc.Text())\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tA[i] = a\n\t}\n\treturn A, true\n}\n\nfunc main() {\n\n\tA, b := getInput()\n\tif !b {\n\t\treturn\n\t}\n\n\tnum := 0\n\tfor {\n\t\tisAllEnv := true\n\t\tfor i := range A {\n\t\t\t// 奇数\n\t\t\tif A[i]&0x00000001 == 1 {\n\t\t\t\tisAllEnv = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tA[i] = A[i] >> 1\n\t\t}\n\t\tif !isAllEnv {\n\t\t\tbreak\n\t\t}\n\t\tnum++\n\t}\n\n\tfmt.Println(num)\n}\n", "language": "Go", "metadata": {"date": 1563938626, "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/s266561593.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s266561593", "user_id": "u911419846"}, "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 getInput() ([]int, bool) {\n\tsc.Split(bufio.ScanWords)\n\n\t// read num of input.\n\tN := 0\n\tif sc.Scan() {\n\t\tn, err := strconv.Atoi(sc.Text())\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tN = n\n\t}\n\n\tA := make([]int, N)\n\tfor i := range A {\n\t\tif !sc.Scan() {\n\t\t\treturn nil, false\n\t\t}\n\t\ta, err := strconv.Atoi(sc.Text())\n\t\tif err != nil {\n\t\t\treturn nil, false\n\t\t}\n\t\tA[i] = a\n\t}\n\treturn A, true\n}\n\nfunc main() {\n\n\tA, b := getInput()\n\tif !b {\n\t\treturn\n\t}\n\n\tnum := 0\n\tfor {\n\t\tisAllEnv := true\n\t\tfor i := range A {\n\t\t\t// 奇数\n\t\t\tif A[i]&0x00000001 == 1 {\n\t\t\t\tisAllEnv = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tA[i] = A[i] >> 1\n\t\t}\n\t\tif !isAllEnv {\n\t\t\tbreak\n\t\t}\n\t\tnum++\n\t}\n\n\tfmt.Println(num)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 768, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s921515388", "group_id": "codeNet:p03494", "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\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}\n\nfunc main() {\n\tn := ReadInt()\n\ta := ReadIntSlice(n)\n\n\tvar c int\n\tfor {\n\t\tfor i, v := range a {\n\t\t\tif v%2 == 1 {\n\t\t\t\tfmt.Println(c)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ta[i] = v / 2\n\t\t}\n\t\tc += 1\n\t}\n\tfmt.Println(c)\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\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": 1563161230, "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/s921515388.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s921515388", "user_id": "u657610454"}, "prompt_components": {"gold_output": "2\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\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}\n\nfunc main() {\n\tn := ReadInt()\n\ta := ReadIntSlice(n)\n\n\tvar c int\n\tfor {\n\t\tfor i, v := range a {\n\t\t\tif v%2 == 1 {\n\t\t\t\tfmt.Println(c)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ta[i] = v / 2\n\t\t}\n\t\tc += 1\n\t}\n\tfmt.Println(c)\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2081, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s690902203", "group_id": "codeNet:p03494", "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\tcount := 0\n\tfor {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i]%2 != 0 {\n\t\t\t\tfmt.Println(count)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ta[i] /= 2\n\t\t}\n\t\tcount++\n\t}\n}\n", "language": "Go", "metadata": {"date": 1556051170, "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/s690902203.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s690902203", "user_id": "u102310764"}, "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\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tcount := 0\n\tfor {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i]%2 != 0 {\n\t\t\t\tfmt.Println(count)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ta[i] /= 2\n\t\t}\n\t\tcount++\n\t}\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 279, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s068807317", "group_id": "codeNet:p03497", "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, _ := strconv.Atoi(sc.Text())\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\ntype Count []int\n\nfunc (c Count) Len() int {\n\treturn len(c)\n}\n\nfunc (c Count) Less(i, j int) bool {\n\treturn c[i] < c[j]\n}\n\nfunc (c Count) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := nextInt(), nextInt()\n\t// balls[i] = i+1が書かれたボールの個数\n\tballs := make(Count, n)\n\tkind := 0\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tif balls[a-1] == 0 {\n\t\t\tkind++\n\t\t}\n\t\tballs[a-1]++\n\t}\n\tsort.Sort(balls)\n\n\tans := 0\n\tfor i := 0; kind > k; i++ {\n\t\tif balls[i] > 0 {\n\t\t\tans += balls[i]\n\t\t\tkind--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1577555548, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03497.html", "problem_id": "p03497", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03497/input.txt", "sample_output_relpath": "derived/input_output/data/p03497/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03497/Go/s068807317.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s068807317", "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\"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 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\ntype Count []int\n\nfunc (c Count) Len() int {\n\treturn len(c)\n}\n\nfunc (c Count) Less(i, j int) bool {\n\treturn c[i] < c[j]\n}\n\nfunc (c Count) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := nextInt(), nextInt()\n\t// balls[i] = i+1が書かれたボールの個数\n\tballs := make(Count, n)\n\tkind := 0\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tif balls[a-1] == 0 {\n\t\t\tkind++\n\t\t}\n\t\tballs[a-1]++\n\t}\n\tsort.Sort(balls)\n\n\tans := 0\n\tfor i := 0; kind > k; i++ {\n\t\tif balls[i] > 0 {\n\t\t\tans += balls[i]\n\t\t\tkind--\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "p03497", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 932, "cpu_time_ms": 45, "memory_kb": 3584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s674222729", "group_id": "codeNet:p03502", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tf := 0\n\tfor i := n; i > 0; i /= 10 {\n\t\tf += i % 10\n\t}\n\tif n%f == 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1533757562, "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/s674222729.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s674222729", "user_id": "u428442702"}, "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\tf := 0\n\tfor i := n; i > 0; i /= 10 {\n\t\tf += i % 10\n\t}\n\tif n%f == 0 {\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 197, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s985374907", "group_id": "codeNet:p03504", "input_text": "// Cについて全探索できそうな雰囲気(最大でCなので)\n// いやでもC*Nでもたかが知れてるのでは?\n// -> 2WAくらう\npackage main\nimport \"fmt\"\n\ntype ST struct{\n\ts, t int\n}\n\nfunc main(){\n\tvar N, C int\n\tfmt.Scan(&N, &C)\n\tans := 0\n\tT := make([][]int, C)\n\tfor i:=0; i= 2{\n\t\t\t\tpanic(\"あわわわわ\")\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tfor j:=0; j<=2*int(1e5); j++{\n\t\ttmp := 0\n\t\tfor i:=0; i 2WAくらう\npackage main\nimport \"fmt\"\n\ntype ST struct{\n\ts, t int\n}\n\nfunc main(){\n\tvar N, C int\n\tfmt.Scan(&N, &C)\n\tans := 0\n\tT := make([][]int, C)\n\tfor i:=0; i= 2{\n\t\t\t\tpanic(\"あわわわわ\")\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\tfor j:=0; j<=2*int(1e5); j++{\n\t\ttmp := 0\n\t\tfor i:=0; i 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := bufio.NewReader(fp)\n\n\ts := getNextLine(scanner)\n\tfor op1 := -1; op1 <= 1; op1 += 2 {\n\t\tfor op2 := -1; op2 <= 1; op2 += 2 {\n\t\t\tfor op3 := -1; op3 <= 1; op3 += 2 {\n\t\t\t\tsum := int(s[0] - '0')\n\t\t\t\tsum += op1 * int(s[1]-'0')\n\t\t\t\tsum += op2 * int(s[2]-'0')\n\t\t\t\tsum += op3 * int(s[3]-'0')\n\t\t\t\tif sum == 7 {\n\t\t\t\t\top := [3]rune{'+', '+', '+'}\n\t\t\t\t\tif op1 == -1 {\n\t\t\t\t\t\top[0] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tif op2 == -1 {\n\t\t\t\t\t\top[1] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tif op3 == -1 {\n\t\t\t\t\t\top[2] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tfmt.Printf(\"%c%c%c%c%c%c%c\", s[0], op[0], s[1], op[1], s[2], op[2], s[3])\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558294801, "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/s634360600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s634360600", "user_id": "u150542210"}, "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\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\ts := getNextLine(scanner)\n\tfor op1 := -1; op1 <= 1; op1 += 2 {\n\t\tfor op2 := -1; op2 <= 1; op2 += 2 {\n\t\t\tfor op3 := -1; op3 <= 1; op3 += 2 {\n\t\t\t\tsum := int(s[0] - '0')\n\t\t\t\tsum += op1 * int(s[1]-'0')\n\t\t\t\tsum += op2 * int(s[2]-'0')\n\t\t\t\tsum += op3 * int(s[3]-'0')\n\t\t\t\tif sum == 7 {\n\t\t\t\t\top := [3]rune{'+', '+', '+'}\n\t\t\t\t\tif op1 == -1 {\n\t\t\t\t\t\top[0] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tif op2 == -1 {\n\t\t\t\t\t\top[1] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tif op3 == -1 {\n\t\t\t\t\t\top[2] = '-'\n\t\t\t\t\t}\n\t\t\t\t\tfmt.Printf(\"%c%c%c%c%c%c%c\", s[0], op[0], s[1], op[1], s[2], op[2], s[3])\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1175, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s227424550", "group_id": "codeNet:p03545", "input_text": "package main\n\nimport \"fmt\"\n\nconst n = 7\n\nvar (\n\tseq = []int{}\n\tflg bool\n)\n\nfunc dfs(left, i int, str string) {\n\tif i == len(seq) {\n\t\tif left == 0 && !flg {\n\t\t\tfmt.Printf(\"%s=%d\\n\", str, n)\n\t\t\tflg = true\n\t\t}\n\t\treturn\n\t}\n\tfor j := range make([]struct{}, 2) {\n\t\tif j == 1 || i != 0 {\n\t\t\ttmp := \"\"\n\t\t\tif i != 0 {\n\t\t\t\ttmp = []string{\"-\", \"+\"}[j]\n\t\t\t}\n\t\t\ttmp += string(seq[i] + '0')\n\t\t\tdfs(left-seq[i]*[]int{-1, 1}[j], i+1, str+tmp)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar abcd string\n\tfmt.Scan(&abcd)\n\n\tfor _, c := range abcd {\n\t\tseq = append(seq, int(c)-'0')\n\t}\n\tdfs(n, 0, \"\")\n}\n", "language": "Go", "metadata": {"date": 1550039451, "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/s227424550.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227424550", "user_id": "u323680411"}, "prompt_components": {"gold_output": "1+2+2+2=7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nconst n = 7\n\nvar (\n\tseq = []int{}\n\tflg bool\n)\n\nfunc dfs(left, i int, str string) {\n\tif i == len(seq) {\n\t\tif left == 0 && !flg {\n\t\t\tfmt.Printf(\"%s=%d\\n\", str, n)\n\t\t\tflg = true\n\t\t}\n\t\treturn\n\t}\n\tfor j := range make([]struct{}, 2) {\n\t\tif j == 1 || i != 0 {\n\t\t\ttmp := \"\"\n\t\t\tif i != 0 {\n\t\t\t\ttmp = []string{\"-\", \"+\"}[j]\n\t\t\t}\n\t\t\ttmp += string(seq[i] + '0')\n\t\t\tdfs(left-seq[i]*[]int{-1, 1}[j], i+1, str+tmp)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar abcd string\n\tfmt.Scan(&abcd)\n\n\tfor _, c := range abcd {\n\t\tseq = append(seq, int(c)-'0')\n\t}\n\tdfs(n, 0, \"\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 564, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s894147200", "group_id": "codeNet:p03546", "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\tH, W := scanInt(), scanInt()\n\n\tC := [10][10]int{}\n\tMap := [10][10]int{}\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tC[i][j] = scanInt()\n\t\t\tMap[i][j] = C[i][j]\n\t\t}\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tfor k := 0; k < 10; k++ {\n\t\t\t\tMap[i][j] = intMin(C[i][j], C[i][k]+C[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tA := [10]int{}\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\ta := scanInt()\n\t\t\tif a != -1 {\n\t\t\t\tA[a]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < 10; i++ {\n\t\tans += A[i] * Map[i][1]\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598413247, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s894147200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s894147200", "user_id": "u941434715"}, "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\"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\tH, W := scanInt(), scanInt()\n\n\tC := [10][10]int{}\n\tMap := [10][10]int{}\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tC[i][j] = scanInt()\n\t\t\tMap[i][j] = C[i][j]\n\t\t}\n\t}\n\n\tfor i := 0; i < 10; i++ {\n\t\tfor j := 0; j < 10; j++ {\n\t\t\tfor k := 0; k < 10; k++ {\n\t\t\t\tMap[i][j] = intMin(C[i][j], C[i][k]+C[k][j])\n\t\t\t}\n\t\t}\n\t}\n\n\tA := [10]int{}\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\ta := scanInt()\n\t\t\tif a != -1 {\n\t\t\t\tA[a]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < 10; i++ {\n\t\tans += A[i] * Map[i][1]\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992711337", "group_id": "codeNet:p03546", "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//RBNodeDir is\ntype RBNodeDir int\n\nconst (\n\n\t//RBNodeLeft is\n\tRBNodeLeft RBNodeDir = iota\n\n\t//RBNodeRight is\n\tRBNodeRight\n\n\t//RBNodeHere is\n\tRBNodeHere\n)\n\n//RBNode is\ntype RBNode struct {\n\tisRed bool\n\tIndex int\n\tparent *RBNode\n\tchildren [2]*RBNode\n}\n\n//RBTree is\ntype RBTree struct {\n\tNode *RBNode\n\tless func(i int, j int) bool\n}\n\n//RBCursor is\ntype RBCursor RBTree\n\n//NewTree is\nfunc NewTree(less func(i int, j int) bool) *RBTree {\n\ttree := &RBTree{less: less}\n\treturn tree\n}\n\n//Cursor is\nfunc (cur *RBTree) Cursor() *RBCursor {\n\twrk := RBCursor(*cur)\n\treturn &wrk\n}\n\nfunc (cur *RBTree) root() *RBTree {\n\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.parent != nil; cur.Node = cur.Node.parent {\n\n\t\t}\n\t}\n\treturn cur\n}\n\n//Move is\nfunc (cur *RBCursor) Move(dir RBNodeDir) *RBCursor {\n\trev := dir ^ 1\n\tif next := cur.Node.children[dir]; next != nil {\n\t\tfor next.children[rev] != nil {\n\t\t\tnext = next.children[rev]\n\t\t}\n\t\tcur.Node = next\n\t} else {\n\t\tfind := false\n\t\tfor cur.Node.parent != nil {\n\t\t\tnow := cur.Node\n\t\t\tcur.Node = cur.Node.parent\n\t\t\tif cur.Node.children[rev] == now {\n\t\t\t\tfind = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !find {\n\t\t\tcur.Node = nil\n\t\t}\n\t}\n\treturn cur\n}\n\n//Find is\nfunc (cur *RBTree) Find(Index int) (*RBTree, RBNodeDir) {\n\tdir := RBNodeLeft\n\tif cur.Node == nil {\n\t\treturn cur, dir\n\t}\n\tcur.root()\n\tfor {\n\t\tif cur.less(Index, cur.Node.Index) {\n\t\t\tdir = RBNodeLeft\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\n\t\t} else if cur.less(cur.Node.Index, Index) {\n\t\t\tdir = RBNodeRight\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\t\t} else {\n\t\t\tdir = RBNodeHere\n\t\t\tbreak\n\t\t}\n\t}\n\treturn cur, dir\n}\n\n//Add is\nfunc (cur *RBTree) Add(Index int) *RBTree {\n\tnewNode := &RBNode{Index: Index, isRed: true}\n\tcur.root()\n\tif cur.Node != nil {\n\t\tpnode, dir := cur.Find(newNode.Index)\n\t\tif dir != RBNodeHere {\n\t\t\tnewNode.parent = pnode.Node\n\t\t\tnewNode.parent.children[dir] = newNode\n\t\t\tnewNode.opt()\n\t\t} else {\n\t\t\tpnode.Node.Index = newNode.Index\n\t\t\tnewNode = pnode.Node\n\t\t}\n\t}\n\tcur.Node = newNode\n\treturn cur\n}\n\nfunc (Node *RBNode) flip(dir RBNodeDir) {\n\tcurGranPa := Node.parent\n\tnewParent := Node.children[dir]\n\tif curGranPa != nil {\n\t\tcurGranPa.children[Node.dir()] = newParent\n\t}\n\tnewParent.parent, Node.parent = Node.parent, newParent\n\n\tNode.children[dir] = newParent.children[dir^1]\n\tif Node.children[dir] != nil {\n\t\tNode.children[dir].parent = Node\n\t}\n\tnewParent.children[dir^1] = Node\n\n}\nfunc (Node *RBNode) dir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.parent.children[dir] != Node {\n\t\tdir = RBNodeRight\n\t}\n\treturn dir\n}\nfunc (Node *RBNode) opt() {\n\tfor Node != nil && Node.isRed {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t} else if !parent.isRed {\n\t\t\tbreak\n\t\t} else if parent.parent == nil {\n\t\t\tparent.isRed = false\n\t\t} else {\n\t\t\tgrandparent := parent.parent\n\t\t\tparentsibling := grandparent.children[parent.dir()^1]\n\t\t\tif parentsibling != nil && parentsibling.isRed {\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tparent.isRed = false\n\t\t\t\tparentsibling.isRed = false\n\t\t\t\tNode = grandparent\n\t\t\t} else {\n\t\t\t\tdir := parent.dir()\n\n\t\t\t\tif parent.children[dir] != Node {\n\t\t\t\t\tparent.flip(dir ^ 1)\n\t\t\t\t}\n\n\t\t\t\tgrandparent.flip(dir)\n\t\t\t\tgrandparent.parent.isRed = false\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n//End is\nfunc (cur *RBTree) End(dir RBNodeDir) *RBCursor {\n\tcur.root()\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.children[dir] != nil; cur.Node = cur.Node.children[dir] {\n\n\t\t}\n\t}\n\treturn cur.Cursor()\n}\n\nfunc (Node *RBNode) cut() {\n\tif Node.parent != nil {\n\t\tNode.parent.children[Node.dir()] = nil\n\t}\n}\n\nfunc (Node *RBNode) hasDir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.children[dir] == nil {\n\t\tdir = RBNodeRight\n\t\tif Node.children[dir] == nil {\n\t\t\tdir = RBNodeHere\n\t\t}\n\t}\n\treturn dir\n}\n\n//Delete is\nfunc (cur *RBTree) Delete(Index int) (ret bool) {\n\twcur, dir := cur.Find(Index)\n\tif dir != RBNodeHere {\n\t\treturn\n\t}\n\tdelNode := wcur.Node\n\tret = true\n\n\tdir = delNode.hasDir()\n\n\tif delNode.children[RBNodeLeft] != nil &&\n\t\tdelNode.children[RBNodeRight] != nil {\n\t\tvar wrk *RBCursor\n\t\tif dir != RBNodeHere {\n\t\t\twrk = wcur.Cursor().Move(dir)\n\t\t\tdelNode.Index = wrk.Node.Index\n\t\t\tdelNode = wrk.Node\n\t\t\tdir = delNode.hasDir()\n\t\t}\n\t}\n\n\tif dir == RBNodeHere {\n\t\tif delNode.isRed {\n\t\t\tdelNode.cut()\n\t\t\tcur.Node = delNode.parent\n\t\t\treturn\n\t\t}\n\t} else {\n\t\twrk := delNode.children[dir]\n\t\tdelNode.Index = wrk.Index\n\t\twrk.cut()\n\t\treturn\n\t}\n\n\tNode := delNode\n\tfor {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tdir := Node.dir()\n\t\tdirOther := dir ^ 1\n\t\tsibling := parent.children[dirOther]\n\n\t\tif sibling.isRed {\n\t\t\t//sibling is Red\n\t\t\tparent.flip(dirOther)\n\t\t\tsibling.isRed = false\n\t\t\tparent.isRed = true\n\t\t\tsibling = parent.children[dirOther]\n\t\t}\n\t\t//sibling is Black\n\n\t\tnephew := sibling.children[dirOther]\n\t\tif nephew == nil || !nephew.isRed {\n\t\t\t//far nephew is Black\n\t\t\tnephew = sibling.children[dir]\n\t\t\tif nephew == nil || !nephew.isRed {\n\t\t\t\t//near nephew is Black\n\t\t\t\tsibling.isRed = true\n\t\t\t\tif parent.isRed {\n\t\t\t\t\tparent.isRed = false\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tNode = parent\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t//near nephew is Red and far nephew is Black\n\t\t\tsibling.flip(dir)\n\t\t\tsibling, nephew = nephew, sibling\n\t\t\tsibling.isRed = false\n\t\t\tnephew.isRed = true\n\t\t}\n\t\t//sibling is Black && far nephew is Red\n\n\t\tparent.flip(dirOther)\n\t\tsibling.isRed = parent.isRed\n\t\tparent.isRed = false\n\t\tnephew.isRed = false\n\t\tbreak\n\t}\n\tdelNode.cut()\n\tcur.Node = delNode.parent\n\treturn\n}\n\ntype line struct {\n\tto, from int\n\tcost int\n}\n\ntype lineSort []line\n\nfunc (a lineSort) Len() int { return len(a) }\nfunc (a lineSort) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a lineSort) Less(i, j int) bool { return a[i].cost < a[j].cost }\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\th, _ := r.nextInt(), r.nextInt()\n\n\tc := make([][]line, 10)\n\tfor i := range c {\n\t\tc[i] = make([]line, 0, 10)\n\t}\n\tfor i := range c {\n\t\tr.Scan(true)\n\n\t\tfor j, v := range r.nextStringArray().toInts() {\n\t\t\tif i != j {\n\t\t\t\tc[j] = append(c[j], line{from: i, to: j, cost: v})\n\t\t\t}\n\t\t}\n\t}\n\n\ttype pack struct {\n\t\tptr *line\n\t\tcost int\n\t\tidx int\n\t}\n\tlist := make([]*pack, 0, 10*10)\n\n\ttree := NewTree(func(i, j int) bool {\n\t\tleft, right := list[i], list[j]\n\t\tswitch {\n\t\tcase left.cost != right.cost:\n\t\t\treturn left.cost < right.cost\n\t\tdefault:\n\t\t\treturn left.idx < right.idx\n\t\t}\n\t})\n\n\ttreeAdd := func(lp *pack) {\n\t\ti := len(list)\n\t\tlist = append(list, lp)\n\t\ttree.Add(i)\n\t}\n\n\ttreeAdd(&pack{ptr: &line{from: 1, to: 1, cost: 0}})\n\tgoal := make([]int, 10)\n\tfor i := range goal {\n\t\tgoal[i] = -1\n\t}\n\tgoalcnt := 10\n\n\tfor {\n\t\tl := tree.End(RBNodeLeft)\n\t\tlt := list[l.Node.Index]\n\t\ttree.Delete(l.Node.Index)\n\t\tif goal[lt.ptr.from] >= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tgoal[lt.ptr.from] = lt.cost\n\t\tgoalcnt--\n\t\tif goalcnt <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := range c[lt.ptr.from] {\n\t\t\tnext := &pack{ptr: &c[lt.ptr.from][i]}\n\t\t\tnext.cost = next.ptr.cost + lt.cost\n\t\t\tnext.idx = len(list)\n\t\t\ttreeAdd(next)\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < h; i++ {\n\t\tr.Scan(true)\n\t\tw := r.nextStringArray().toInts()\n\t\tfor _, v := range w {\n\t\t\tif v > 0 {\n\t\t\t\tans += goal[v]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(stdout, ans)\n}\n", "language": "Go", "metadata": {"date": 1570925451, "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/s992711337.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992711337", "user_id": "u463655976"}, "prompt_components": {"gold_output": "12\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//RBNodeDir is\ntype RBNodeDir int\n\nconst (\n\n\t//RBNodeLeft is\n\tRBNodeLeft RBNodeDir = iota\n\n\t//RBNodeRight is\n\tRBNodeRight\n\n\t//RBNodeHere is\n\tRBNodeHere\n)\n\n//RBNode is\ntype RBNode struct {\n\tisRed bool\n\tIndex int\n\tparent *RBNode\n\tchildren [2]*RBNode\n}\n\n//RBTree is\ntype RBTree struct {\n\tNode *RBNode\n\tless func(i int, j int) bool\n}\n\n//RBCursor is\ntype RBCursor RBTree\n\n//NewTree is\nfunc NewTree(less func(i int, j int) bool) *RBTree {\n\ttree := &RBTree{less: less}\n\treturn tree\n}\n\n//Cursor is\nfunc (cur *RBTree) Cursor() *RBCursor {\n\twrk := RBCursor(*cur)\n\treturn &wrk\n}\n\nfunc (cur *RBTree) root() *RBTree {\n\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.parent != nil; cur.Node = cur.Node.parent {\n\n\t\t}\n\t}\n\treturn cur\n}\n\n//Move is\nfunc (cur *RBCursor) Move(dir RBNodeDir) *RBCursor {\n\trev := dir ^ 1\n\tif next := cur.Node.children[dir]; next != nil {\n\t\tfor next.children[rev] != nil {\n\t\t\tnext = next.children[rev]\n\t\t}\n\t\tcur.Node = next\n\t} else {\n\t\tfind := false\n\t\tfor cur.Node.parent != nil {\n\t\t\tnow := cur.Node\n\t\t\tcur.Node = cur.Node.parent\n\t\t\tif cur.Node.children[rev] == now {\n\t\t\t\tfind = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !find {\n\t\t\tcur.Node = nil\n\t\t}\n\t}\n\treturn cur\n}\n\n//Find is\nfunc (cur *RBTree) Find(Index int) (*RBTree, RBNodeDir) {\n\tdir := RBNodeLeft\n\tif cur.Node == nil {\n\t\treturn cur, dir\n\t}\n\tcur.root()\n\tfor {\n\t\tif cur.less(Index, cur.Node.Index) {\n\t\t\tdir = RBNodeLeft\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\n\t\t} else if cur.less(cur.Node.Index, Index) {\n\t\t\tdir = RBNodeRight\n\t\t\tnext := cur.Node.children[dir]\n\t\t\tif next == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcur.Node = next\n\t\t} else {\n\t\t\tdir = RBNodeHere\n\t\t\tbreak\n\t\t}\n\t}\n\treturn cur, dir\n}\n\n//Add is\nfunc (cur *RBTree) Add(Index int) *RBTree {\n\tnewNode := &RBNode{Index: Index, isRed: true}\n\tcur.root()\n\tif cur.Node != nil {\n\t\tpnode, dir := cur.Find(newNode.Index)\n\t\tif dir != RBNodeHere {\n\t\t\tnewNode.parent = pnode.Node\n\t\t\tnewNode.parent.children[dir] = newNode\n\t\t\tnewNode.opt()\n\t\t} else {\n\t\t\tpnode.Node.Index = newNode.Index\n\t\t\tnewNode = pnode.Node\n\t\t}\n\t}\n\tcur.Node = newNode\n\treturn cur\n}\n\nfunc (Node *RBNode) flip(dir RBNodeDir) {\n\tcurGranPa := Node.parent\n\tnewParent := Node.children[dir]\n\tif curGranPa != nil {\n\t\tcurGranPa.children[Node.dir()] = newParent\n\t}\n\tnewParent.parent, Node.parent = Node.parent, newParent\n\n\tNode.children[dir] = newParent.children[dir^1]\n\tif Node.children[dir] != nil {\n\t\tNode.children[dir].parent = Node\n\t}\n\tnewParent.children[dir^1] = Node\n\n}\nfunc (Node *RBNode) dir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.parent.children[dir] != Node {\n\t\tdir = RBNodeRight\n\t}\n\treturn dir\n}\nfunc (Node *RBNode) opt() {\n\tfor Node != nil && Node.isRed {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t} else if !parent.isRed {\n\t\t\tbreak\n\t\t} else if parent.parent == nil {\n\t\t\tparent.isRed = false\n\t\t} else {\n\t\t\tgrandparent := parent.parent\n\t\t\tparentsibling := grandparent.children[parent.dir()^1]\n\t\t\tif parentsibling != nil && parentsibling.isRed {\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tparent.isRed = false\n\t\t\t\tparentsibling.isRed = false\n\t\t\t\tNode = grandparent\n\t\t\t} else {\n\t\t\t\tdir := parent.dir()\n\n\t\t\t\tif parent.children[dir] != Node {\n\t\t\t\t\tparent.flip(dir ^ 1)\n\t\t\t\t}\n\n\t\t\t\tgrandparent.flip(dir)\n\t\t\t\tgrandparent.parent.isRed = false\n\t\t\t\tgrandparent.isRed = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n//End is\nfunc (cur *RBTree) End(dir RBNodeDir) *RBCursor {\n\tcur.root()\n\tif cur.Node != nil {\n\t\tfor ; cur.Node.children[dir] != nil; cur.Node = cur.Node.children[dir] {\n\n\t\t}\n\t}\n\treturn cur.Cursor()\n}\n\nfunc (Node *RBNode) cut() {\n\tif Node.parent != nil {\n\t\tNode.parent.children[Node.dir()] = nil\n\t}\n}\n\nfunc (Node *RBNode) hasDir() RBNodeDir {\n\tdir := RBNodeLeft\n\tif Node.children[dir] == nil {\n\t\tdir = RBNodeRight\n\t\tif Node.children[dir] == nil {\n\t\t\tdir = RBNodeHere\n\t\t}\n\t}\n\treturn dir\n}\n\n//Delete is\nfunc (cur *RBTree) Delete(Index int) (ret bool) {\n\twcur, dir := cur.Find(Index)\n\tif dir != RBNodeHere {\n\t\treturn\n\t}\n\tdelNode := wcur.Node\n\tret = true\n\n\tdir = delNode.hasDir()\n\n\tif delNode.children[RBNodeLeft] != nil &&\n\t\tdelNode.children[RBNodeRight] != nil {\n\t\tvar wrk *RBCursor\n\t\tif dir != RBNodeHere {\n\t\t\twrk = wcur.Cursor().Move(dir)\n\t\t\tdelNode.Index = wrk.Node.Index\n\t\t\tdelNode = wrk.Node\n\t\t\tdir = delNode.hasDir()\n\t\t}\n\t}\n\n\tif dir == RBNodeHere {\n\t\tif delNode.isRed {\n\t\t\tdelNode.cut()\n\t\t\tcur.Node = delNode.parent\n\t\t\treturn\n\t\t}\n\t} else {\n\t\twrk := delNode.children[dir]\n\t\tdelNode.Index = wrk.Index\n\t\twrk.cut()\n\t\treturn\n\t}\n\n\tNode := delNode\n\tfor {\n\t\tparent := Node.parent\n\t\tif parent == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tdir := Node.dir()\n\t\tdirOther := dir ^ 1\n\t\tsibling := parent.children[dirOther]\n\n\t\tif sibling.isRed {\n\t\t\t//sibling is Red\n\t\t\tparent.flip(dirOther)\n\t\t\tsibling.isRed = false\n\t\t\tparent.isRed = true\n\t\t\tsibling = parent.children[dirOther]\n\t\t}\n\t\t//sibling is Black\n\n\t\tnephew := sibling.children[dirOther]\n\t\tif nephew == nil || !nephew.isRed {\n\t\t\t//far nephew is Black\n\t\t\tnephew = sibling.children[dir]\n\t\t\tif nephew == nil || !nephew.isRed {\n\t\t\t\t//near nephew is Black\n\t\t\t\tsibling.isRed = true\n\t\t\t\tif parent.isRed {\n\t\t\t\t\tparent.isRed = false\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tNode = parent\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\t//near nephew is Red and far nephew is Black\n\t\t\tsibling.flip(dir)\n\t\t\tsibling, nephew = nephew, sibling\n\t\t\tsibling.isRed = false\n\t\t\tnephew.isRed = true\n\t\t}\n\t\t//sibling is Black && far nephew is Red\n\n\t\tparent.flip(dirOther)\n\t\tsibling.isRed = parent.isRed\n\t\tparent.isRed = false\n\t\tnephew.isRed = false\n\t\tbreak\n\t}\n\tdelNode.cut()\n\tcur.Node = delNode.parent\n\treturn\n}\n\ntype line struct {\n\tto, from int\n\tcost int\n}\n\ntype lineSort []line\n\nfunc (a lineSort) Len() int { return len(a) }\nfunc (a lineSort) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a lineSort) Less(i, j int) bool { return a[i].cost < a[j].cost }\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\th, _ := r.nextInt(), r.nextInt()\n\n\tc := make([][]line, 10)\n\tfor i := range c {\n\t\tc[i] = make([]line, 0, 10)\n\t}\n\tfor i := range c {\n\t\tr.Scan(true)\n\n\t\tfor j, v := range r.nextStringArray().toInts() {\n\t\t\tif i != j {\n\t\t\t\tc[j] = append(c[j], line{from: i, to: j, cost: v})\n\t\t\t}\n\t\t}\n\t}\n\n\ttype pack struct {\n\t\tptr *line\n\t\tcost int\n\t\tidx int\n\t}\n\tlist := make([]*pack, 0, 10*10)\n\n\ttree := NewTree(func(i, j int) bool {\n\t\tleft, right := list[i], list[j]\n\t\tswitch {\n\t\tcase left.cost != right.cost:\n\t\t\treturn left.cost < right.cost\n\t\tdefault:\n\t\t\treturn left.idx < right.idx\n\t\t}\n\t})\n\n\ttreeAdd := func(lp *pack) {\n\t\ti := len(list)\n\t\tlist = append(list, lp)\n\t\ttree.Add(i)\n\t}\n\n\ttreeAdd(&pack{ptr: &line{from: 1, to: 1, cost: 0}})\n\tgoal := make([]int, 10)\n\tfor i := range goal {\n\t\tgoal[i] = -1\n\t}\n\tgoalcnt := 10\n\n\tfor {\n\t\tl := tree.End(RBNodeLeft)\n\t\tlt := list[l.Node.Index]\n\t\ttree.Delete(l.Node.Index)\n\t\tif goal[lt.ptr.from] >= 0 {\n\t\t\tcontinue\n\t\t}\n\t\tgoal[lt.ptr.from] = lt.cost\n\t\tgoalcnt--\n\t\tif goalcnt <= 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tfor i := range c[lt.ptr.from] {\n\t\t\tnext := &pack{ptr: &c[lt.ptr.from][i]}\n\t\t\tnext.cost = next.ptr.cost + lt.cost\n\t\t\tnext.idx = len(list)\n\t\t\ttreeAdd(next)\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := 0; i < h; i++ {\n\t\tr.Scan(true)\n\t\tw := r.nextStringArray().toInts()\n\t\tfor _, v := range w {\n\t\t\tif v > 0 {\n\t\t\t\tans += goal[v]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(stdout, 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9764, "cpu_time_ms": 5, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s286012645", "group_id": "codeNet:p03547", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X string\n\tvar Y string\n\tfmt.Scan(&X)\n\tfmt.Scan(&Y)\n\n\tvar x int\n\tvar y int\n\n\tif X == \"A\" {\n\t\tx = 10\n\t}\n\tif X == \"B\" {\n\t\tx = 11\n\t}\n\tif X == \"C\" {\n\t\tx = 12\n\t}\n\tif X == \"D\" {\n\t\tx = 13\n\t}\n\tif X == \"E\" {\n\t\tx = 14\n\t}\n\tif X == \"F\" {\n\t\tx = 15\n\t}\n\tif Y == \"A\" {\n\t\ty = 10\n\t}\n\tif Y == \"B\" {\n\t\ty = 11\n\t}\n\tif Y == \"C\" {\n\t\ty = 12\n\t}\n\tif Y == \"D\" {\n\t\ty = 13\n\t}\n\tif Y == \"E\" {\n\t\ty = 14\n\t}\n\tif Y == \"F\" {\n\t\ty = 15\n\t}\n\tif x < y {\n\t\tfmt.Println(\"<\")\n\t}\n\tif x > y {\n\t\tfmt.Println(\">\")\n\t}\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1573847654, "filename_ext": "go", "original_language": "Go (1.6)", "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/s286012645.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s286012645", "user_id": "u565516813"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar X string\n\tvar Y string\n\tfmt.Scan(&X)\n\tfmt.Scan(&Y)\n\n\tvar x int\n\tvar y int\n\n\tif X == \"A\" {\n\t\tx = 10\n\t}\n\tif X == \"B\" {\n\t\tx = 11\n\t}\n\tif X == \"C\" {\n\t\tx = 12\n\t}\n\tif X == \"D\" {\n\t\tx = 13\n\t}\n\tif X == \"E\" {\n\t\tx = 14\n\t}\n\tif X == \"F\" {\n\t\tx = 15\n\t}\n\tif Y == \"A\" {\n\t\ty = 10\n\t}\n\tif Y == \"B\" {\n\t\ty = 11\n\t}\n\tif Y == \"C\" {\n\t\ty = 12\n\t}\n\tif Y == \"D\" {\n\t\ty = 13\n\t}\n\tif Y == \"E\" {\n\t\ty = 14\n\t}\n\tif Y == \"F\" {\n\t\ty = 15\n\t}\n\tif x < y {\n\t\tfmt.Println(\"<\")\n\t}\n\tif x > y {\n\t\tfmt.Println(\">\")\n\t}\n\tif x == y {\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 556, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913531883", "group_id": "codeNet:p03547", "input_text": "package main\n\nimport \"fmt\"\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": 1546704440, "filename_ext": "go", "original_language": "Go (1.6)", "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/s913531883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913531883", "user_id": "u645859552"}, "prompt_components": {"gold_output": "<\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s393934623", "group_id": "codeNet:p03550", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, z, w int\n\tfmt.Scan(&n, &z, &w)\n\tarrA := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&arrA[i])\n\t}\n\tans := math.Abs(float64(arrA[n-1] - w))\n\tif n > 1 {\n\t\tif math.Abs(float64(arrA[n-2]-arrA[n-1])) > ans {\n\t\t\tans = math.Abs(float64(arrA[n-2] - arrA[n-1]))\n\t\t}\n\t}\n\n\tfmt.Println(int(ans))\n}\n", "language": "Go", "metadata": {"date": 1555021895, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03550.html", "problem_id": "p03550", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03550/input.txt", "sample_output_relpath": "derived/input_output/data/p03550/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03550/Go/s393934623.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s393934623", "user_id": "u712822150"}, "prompt_components": {"gold_output": "900\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, z, w int\n\tfmt.Scan(&n, &z, &w)\n\tarrA := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&arrA[i])\n\t}\n\tans := math.Abs(float64(arrA[n-1] - w))\n\tif n > 1 {\n\t\tif math.Abs(float64(arrA[n-2]-arrA[n-1])) > ans {\n\t\t\tans = math.Abs(float64(arrA[n-2] - arrA[n-1]))\n\t\t}\n\t}\n\n\tfmt.Println(int(ans))\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": "p03550", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 356, "cpu_time_ms": 15, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s665871447", "group_id": "codeNet:p03555", "input_text": "package main\nimport (\n \"fmt\"\n // \"math\"\n)\n\nfunc main() {\n var (\n A string\n B string\n )\n fmt.Scan(&A)\n fmt.Scan(&B)\n\n if A[0] == B[2] && A[1] == B[1] && A[2] == B[0] {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n\n}\n", "language": "Go", "metadata": {"date": 1541475118, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03555.html", "problem_id": "p03555", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03555/input.txt", "sample_output_relpath": "derived/input_output/data/p03555/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03555/Go/s665871447.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s665871447", "user_id": "u539371709"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n // \"math\"\n)\n\nfunc main() {\n var (\n A string\n B string\n )\n fmt.Scan(&A)\n fmt.Scan(&B)\n\n if A[0] == B[2] && A[1] == B[1] && A[2] == B[0] {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a grid with 2 rows and 3 columns of squares.\nThe color of the square at the i-th row and j-th column is represented by the character C_{ij}.\n\nWrite a program that prints YES if this grid remains the same when rotated 180 degrees, and prints NO otherwise.\n\nConstraints\n\nC_{i,j}(1 \\leq i \\leq 2, 1 \\leq j \\leq 3) is a lowercase English letter.\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}\n\nOutput\n\nPrint YES if this grid remains the same when rotated 180 degrees; print NO otherwise.\n\nSample Input 1\n\npot\ntop\n\nSample Output 1\n\nYES\n\nThis grid remains the same when rotated 180 degrees.\n\nSample Input 2\n\ntab\nbet\n\nSample Output 2\n\nNO\n\nThis grid does not remain the same when rotated 180 degrees.\n\nSample Input 3\n\neye\neel\n\nSample Output 3\n\nNO", "sample_input": "pot\ntop\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03555", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a grid with 2 rows and 3 columns of squares.\nThe color of the square at the i-th row and j-th column is represented by the character C_{ij}.\n\nWrite a program that prints YES if this grid remains the same when rotated 180 degrees, and prints NO otherwise.\n\nConstraints\n\nC_{i,j}(1 \\leq i \\leq 2, 1 \\leq j \\leq 3) is a lowercase English letter.\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}\n\nOutput\n\nPrint YES if this grid remains the same when rotated 180 degrees; print NO otherwise.\n\nSample Input 1\n\npot\ntop\n\nSample Output 1\n\nYES\n\nThis grid remains the same when rotated 180 degrees.\n\nSample Input 2\n\ntab\nbet\n\nSample Output 2\n\nNO\n\nThis grid does not remain the same when rotated 180 degrees.\n\nSample Input 3\n\neye\neel\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 243, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750068932", "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc main() {\n\tn := readFloat64()\n\tv := math.Floor(math.Sqrt(n))\n\tfmt.Println(v * v)\n}\n", "language": "Go", "metadata": {"date": 1582064020, "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/s750068932.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s750068932", "user_id": "u363118893"}, "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 sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readFloat64() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc main() {\n\tn := readFloat64()\n\tv := math.Floor(math.Sqrt(n))\n\tfmt.Println(v * v)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s308489095", "group_id": "codeNet:p03557", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"strconv\"\n \"strings\"\n \"bufio\"\n \"os\"\n )\n \nfunc lower_bound(ary []int, n int) int {\n size := len(ary)\n if ary[size-1] < n { return size }\n u := size\n l := 0\n for u>l {\n s := (u+l)/2\n if (ary[s] < n) { l = s+1 } else { u = s }\n }\n return l\n}\n\nfunc upper_bound(ary []int, n int) int {\n size := len(ary)\n if ary[size-1] <= n { return size }\n u := size\n l := 0\n for u>l {\n s := (u+l)/2\n if (ary[s] <= n) { l = s+1 } else { u = s }\n }\n return l\n}\n\nfunc s2i(s string) []int {\n ss := strings.Fields(s)\n tmp := make([]int, len(ss))\n for i, v := range ss {\n tmp[i], _ = strconv.Atoi(v)\n }\n return tmp\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n n := 0\n fmt.Scan(&n)\n //\n sc.Scan();\n a := s2i(sc.Text())\n //\n sc.Scan();\n b := s2i(sc.Text())\n //\n sc.Scan();\n c := s2i(sc.Text())\n \n sort.Ints(a)\n sort.Ints(c)\n \n sum := 0\n for _, v := range b {\n sml := lower_bound(a, v)\n big := upper_bound(c, v)\n sum += sml * (n-big)\n } \n \n fmt.Println(sum)\n\n}", "language": "Go", "metadata": {"date": 1510006730, "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/s308489095.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s308489095", "user_id": "u945659667"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"strconv\"\n \"strings\"\n \"bufio\"\n \"os\"\n )\n \nfunc lower_bound(ary []int, n int) int {\n size := len(ary)\n if ary[size-1] < n { return size }\n u := size\n l := 0\n for u>l {\n s := (u+l)/2\n if (ary[s] < n) { l = s+1 } else { u = s }\n }\n return l\n}\n\nfunc upper_bound(ary []int, n int) int {\n size := len(ary)\n if ary[size-1] <= n { return size }\n u := size\n l := 0\n for u>l {\n s := (u+l)/2\n if (ary[s] <= n) { l = s+1 } else { u = s }\n }\n return l\n}\n\nfunc s2i(s string) []int {\n ss := strings.Fields(s)\n tmp := make([]int, len(ss))\n for i, v := range ss {\n tmp[i], _ = strconv.Atoi(v)\n }\n return tmp\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n n := 0\n fmt.Scan(&n)\n //\n sc.Scan();\n a := s2i(sc.Text())\n //\n sc.Scan();\n b := s2i(sc.Text())\n //\n sc.Scan();\n c := s2i(sc.Text())\n \n sort.Ints(a)\n sort.Ints(c)\n \n sum := 0\n for _, v := range b {\n sml := lower_bound(a, v)\n big := upper_bound(c, v)\n sum += sml * (n-big)\n } \n \n fmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1052, "cpu_time_ms": 6, "memory_kb": 1664}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s524610133", "group_id": "codeNet:p03558", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\ntype State struct {\n Value int\n Ret int\n}\n\nvar K int\n\nfunc bfs(visited []bool) int {\n quu := make([]State, 0)\n quu = append(quu, State{1, 1})\n\n for len(quu) > 0 {\n cur := quu[0]\n quu = quu[1:]\n // fmt.Printf(\"cur.Value is %d\\n\", cur.Value)\n // fmt.Printf(\"cur.Ret is %d\\n\", cur.Ret)\n\n if cur.Value % K == 0 {\n return cur.Ret\n }\n\n {\n nextValue := cur.Value * 10\n nextValue %= K\n nextRet := cur.Ret\n if !visited[nextValue] {\n quu = append(quu, State{nextValue, nextRet})\n visited[nextValue] = true\n }\n }\n {\n nextValue := cur.Value + 1\n nextValue %= K\n nextRet := cur.Ret + 1\n if !visited[nextValue] {\n quu = append([]State{State{nextValue, nextRet}}, quu...)\n visited[nextValue] = true\n }\n }\n }\n\n return -1\n}\n\n\nfunc main() {\n fmt.Scanf(\"%d\", &K)\n visited := make([]bool, K + 1)\n fmt.Println(bfs(visited))\n\n}\n", "language": "Go", "metadata": {"date": 1540996603, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03558.html", "problem_id": "p03558", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03558/input.txt", "sample_output_relpath": "derived/input_output/data/p03558/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03558/Go/s524610133.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s524610133", "user_id": "u285118720"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\ntype State struct {\n Value int\n Ret int\n}\n\nvar K int\n\nfunc bfs(visited []bool) int {\n quu := make([]State, 0)\n quu = append(quu, State{1, 1})\n\n for len(quu) > 0 {\n cur := quu[0]\n quu = quu[1:]\n // fmt.Printf(\"cur.Value is %d\\n\", cur.Value)\n // fmt.Printf(\"cur.Ret is %d\\n\", cur.Ret)\n\n if cur.Value % K == 0 {\n return cur.Ret\n }\n\n {\n nextValue := cur.Value * 10\n nextValue %= K\n nextRet := cur.Ret\n if !visited[nextValue] {\n quu = append(quu, State{nextValue, nextRet})\n visited[nextValue] = true\n }\n }\n {\n nextValue := cur.Value + 1\n nextValue %= K\n nextRet := cur.Ret + 1\n if !visited[nextValue] {\n quu = append([]State{State{nextValue, nextRet}}, quu...)\n visited[nextValue] = true\n }\n }\n }\n\n return -1\n}\n\n\nfunc main() {\n fmt.Scanf(\"%d\", &K)\n visited := make([]bool, K + 1)\n fmt.Println(bfs(visited))\n\n}\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nFind the smallest possible sum of the digits in the decimal notation of a positive multiple of K.\n\nConstraints\n\n2 \\leq K \\leq 10^5\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the smallest possible sum of the digits in the decimal notation of a positive multiple of K.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\n12=6×2 yields the smallest sum.\n\nSample Input 2\n\n41\n\nSample Output 2\n\n5\n\n11111=41×271 yields the smallest sum.\n\nSample Input 3\n\n79992\n\nSample Output 3\n\n36", "sample_input": "6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03558", "source_text": "Score : 700 points\n\nProblem Statement\n\nFind the smallest possible sum of the digits in the decimal notation of a positive multiple of K.\n\nConstraints\n\n2 \\leq K \\leq 10^5\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the smallest possible sum of the digits in the decimal notation of a positive multiple of K.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n3\n\n12=6×2 yields the smallest sum.\n\nSample Input 2\n\n41\n\nSample Output 2\n\n5\n\n11111=41×271 yields the smallest sum.\n\nSample Input 3\n\n79992\n\nSample Output 3\n\n36", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 961, "cpu_time_ms": 2112, "memory_kb": 19072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s526873912", "group_id": "codeNet:p03559", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, r 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\tsort.Ints(a)\n\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tsort.Ints(b)\n\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&c[i])\n\t}\n\tsort.Ints(c)\n\n\tfor _, i := range c {\n\t\tfor _, j := range b {\n\t\t\tif i <= j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, k := range a {\n\t\t\t\tif j <= k {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tr++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1540251650, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03559.html", "problem_id": "p03559", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03559/input.txt", "sample_output_relpath": "derived/input_output/data/p03559/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03559/Go/s526873912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s526873912", "user_id": "u875592584"}, "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, r 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\tsort.Ints(a)\n\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&b[i])\n\t}\n\tsort.Ints(b)\n\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&c[i])\n\t}\n\tsort.Ints(c)\n\n\tfor _, i := range c {\n\t\tfor _, j := range b {\n\t\t\tif i <= j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, k := range a {\n\t\t\t\tif j <= k {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tr++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\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": "p03559", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 511, "cpu_time_ms": 2108, "memory_kb": 7552}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s197162859", "group_id": "codeNet:p03563", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r, g int\n\tfmt.Scan(&r, &g)\n\n\tfmt.Println(2*g - r)\n}\n", "language": "Go", "metadata": {"date": 1587348250, "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/s197162859.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s197162859", "user_id": "u214033538"}, "prompt_components": {"gold_output": "2032\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar r, g int\n\tfmt.Scan(&r, &g)\n\n\tfmt.Println(2*g - r)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s160900182", "group_id": "codeNet:p03564", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tfmt.Scan(&n,&k)\n\tans := 1\n\tfor i:= 0; i 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\tab := make([][2]int, n+2)\n\tfor i := 1; i <= n; i++ {\n\t\tab[i] = [2]int{iScan(), iScan()}\n\t}\n\tab[0] = [2]int{0, mod}\n\tab[n+1] = [2]int{mod, -1}\n\tsort.Slice(ab, func(i, j int) bool { return ab[i][0] < ab[j][0] })\n\tfmt.Println(ab)\n\tans := -1\n\tfor i := 0; i < n+1; i++ {\n\t\tans += smaller(ab[i+1][0]-ab[i][0], ab[i][1]-ab[i+1][1])\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1596493292, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03588.html", "problem_id": "p03588", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03588/input.txt", "sample_output_relpath": "derived/input_output/data/p03588/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03588/Go/s197429697.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s197429697", "user_id": "u843722521"}, "prompt_components": {"gold_output": "8\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}\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\tab := make([][2]int, n+2)\n\tfor i := 1; i <= n; i++ {\n\t\tab[i] = [2]int{iScan(), iScan()}\n\t}\n\tab[0] = [2]int{0, mod}\n\tab[n+1] = [2]int{mod, -1}\n\tsort.Slice(ab, func(i, j int) bool { return ab[i][0] < ab[j][0] })\n\tfmt.Println(ab)\n\tans := -1\n\tfor i := 0; i < n+1; i++ {\n\t\tans += smaller(ab[i+1][0]-ab[i][0], ab[i][1]-ab[i+1][1])\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA group of people played a game. All players had distinct scores, which are positive integers.\n\nTakahashi knows N facts on the players' scores. The i-th fact is as follows: the A_i-th highest score among the players is B_i.\n\nFind the maximum possible number of players in the game.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n0 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nIf i ≠ j, A_i ≠ A_j.\n\nThere exists a possible outcome of the game that are consistent with the facts.\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible number of players in the game.\n\nSample Input 1\n\n3\n4 7\n2 9\n6 2\n\nSample Output 1\n\n8\n\nThe maximum possible number of players is achieved when, for example, the players have the following scores: 12,9,8,7,5,2,1,0.\n\nSample Input 2\n\n5\n1 10\n3 6\n5 2\n4 4\n2 8\n\nSample Output 2\n\n7\n\nSample Input 3\n\n2\n1 1000000000\n1000000000 1\n\nSample Output 3\n\n1000000001", "sample_input": "3\n4 7\n2 9\n6 2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03588", "source_text": "Score : 200 points\n\nProblem Statement\n\nA group of people played a game. All players had distinct scores, which are positive integers.\n\nTakahashi knows N facts on the players' scores. The i-th fact is as follows: the A_i-th highest score among the players is B_i.\n\nFind the maximum possible number of players in the game.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)\n\n0 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nIf i ≠ j, A_i ≠ A_j.\n\nThere exists a possible outcome of the game that are consistent with the facts.\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible number of players in the game.\n\nSample Input 1\n\n3\n4 7\n2 9\n6 2\n\nSample Output 1\n\n8\n\nThe maximum possible number of players is achieved when, for example, the players have the following scores: 12,9,8,7,5,2,1,0.\n\nSample Input 2\n\n5\n1 10\n3 6\n5 2\n4 4\n2 8\n\nSample Output 2\n\n7\n\nSample Input 3\n\n2\n1 1000000000\n1000000000 1\n\nSample Output 3\n\n1000000001", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1572, "cpu_time_ms": 105, "memory_kb": 16084}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s266857721", "group_id": "codeNet:p03590", "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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := ri(), ri()\n\tors := make([]int, 0, 31)\n\tors = append(ors, k)\n\tfor i := 0; i <= 30; i++ {\n\t\tm := 1 << uint(i)\n\t\tif k&(m) != 0 {\n\t\t\tors = append(ors, (k^m)|(m-1))\n\t\t}\n\t}\n\tsums := make([]int, len(ors))\n\tfor i := 0; i < n; i++ {\n\t\ta, b := ri(), ri()\n\t\tfor j, w := range ors {\n\t\t\tif w|a == w {\n\t\t\t\tsums[j] += b\n\t\t\t}\n\t\t}\n\t}\n\tmax := sums[0]\n\tfor _, v := range sums {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1555767946, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03590.html", "problem_id": "p03590", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03590/input.txt", "sample_output_relpath": "derived/input_output/data/p03590/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03590/Go/s266857721.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s266857721", "user_id": "u554269352"}, "prompt_components": {"gold_output": "8\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 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 main() {\n\tsc.Split(bufio.ScanWords)\n\tn, k := ri(), ri()\n\tors := make([]int, 0, 31)\n\tors = append(ors, k)\n\tfor i := 0; i <= 30; i++ {\n\t\tm := 1 << uint(i)\n\t\tif k&(m) != 0 {\n\t\t\tors = append(ors, (k^m)|(m-1))\n\t\t}\n\t}\n\tsums := make([]int, len(ors))\n\tfor i := 0; i < n; i++ {\n\t\ta, b := ri(), ri()\n\t\tfor j, w := range ors {\n\t\t\tif w|a == w {\n\t\t\t\tsums[j] += b\n\t\t\t}\n\t\t}\n\t}\n\tmax := sums[0]\n\tfor _, v := range sums {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "sample_input": "3 5\n3 3\n4 4\n2 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03590", "source_text": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 647, "cpu_time_ms": 47, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787255283", "group_id": "codeNet:p03590", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype ins []in\n\ntype in struct {\n\ta int\n\tb int\n\tcp float64\n}\n\nfunc (ii ins) Len() int {\n\treturn len(ii)\n}\n\nfunc (ii ins) Swap(i, j int) {\n\tii[i], ii[j] = ii[j], ii[i]\n}\n\nfunc (ii ins) Less(i, j int) bool {\n\tif ii[i].cp == ii[j].cp {\n\t\treturn ii[i].b > ii[j].b\n\t}\n\treturn ii[i].cp > ii[j].cp\n}\n\nfunc main() {\n\tvar n, k, ta, tb int\n\tfmt.Scan(&n, &k)\n\ts := make(ins, n)\n\tfor key := range s {\n\t\tfmt.Scan(&s[key].a, &s[key].b)\n\t\ts[key].cp = float64(s[key].b) / float64(s[key].a)\n\t}\n\tsort.Sort(s)\n\n\tfor _, value := range s {\n\t\tif ta == k {\n\t\t\tbreak\n\t\t}\n\t\tif ta | value.a <= k {\n\t\t\tta = ta | value.a\n\t\t\ttb += value.b\n\t\t}\n\t}\n\tfmt.Print(tb)\n}", "language": "Go", "metadata": {"date": 1506822371, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03590.html", "problem_id": "p03590", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03590/input.txt", "sample_output_relpath": "derived/input_output/data/p03590/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03590/Go/s787255283.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s787255283", "user_id": "u111798014"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype ins []in\n\ntype in struct {\n\ta int\n\tb int\n\tcp float64\n}\n\nfunc (ii ins) Len() int {\n\treturn len(ii)\n}\n\nfunc (ii ins) Swap(i, j int) {\n\tii[i], ii[j] = ii[j], ii[i]\n}\n\nfunc (ii ins) Less(i, j int) bool {\n\tif ii[i].cp == ii[j].cp {\n\t\treturn ii[i].b > ii[j].b\n\t}\n\treturn ii[i].cp > ii[j].cp\n}\n\nfunc main() {\n\tvar n, k, ta, tb int\n\tfmt.Scan(&n, &k)\n\ts := make(ins, n)\n\tfor key := range s {\n\t\tfmt.Scan(&s[key].a, &s[key].b)\n\t\ts[key].cp = float64(s[key].b) / float64(s[key].a)\n\t}\n\tsort.Sort(s)\n\n\tfor _, value := range s {\n\t\tif ta == k {\n\t\t\tbreak\n\t\t}\n\t\tif ta | value.a <= k {\n\t\t\tta = ta | value.a\n\t\t\ttb += value.b\n\t\t}\n\t}\n\tfmt.Print(tb)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "sample_input": "3 5\n3 3\n4 4\n2 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p03590", "source_text": "Score : 500 points\n\nProblem Statement\n\nSeisu-ya, a store specializing in non-negative integers, sells N non-negative integers. The i-th integer is A_i and has a utility of B_i.\nThere may be multiple equal integers with different utilities.\n\nTakahashi will buy some integers in this store. He can buy a combination of integers whose bitwise OR is less than or equal to K. He wants the sum of utilities of purchased integers to be as large as possible.\n\nFind the maximum possible sum of utilities of purchased integers.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq K < 2^{30}\n\n0 \\leq A_i < 2^{30}(1\\leq i\\leq N)\n\n1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 B_1\n:\nA_N B_N\n\nOutputs\n\nPrint the maximum possible sum of utilities of purchased integers.\n\nSample Input 1\n\n3 5\n3 3\n4 4\n2 5\n\nSample Output 1\n\n8\n\nBuy 2 and 3 to achieve the maximum possible total utility, 8.\n\nSample Input 2\n\n3 6\n3 3\n4 4\n2 5\n\nSample Output 2\n\n9\n\nBuy 2 and 4 to achieve the maximum possible total utility, 9.\n\nSample Input 3\n\n7 14\n10 5\n7 4\n11 4\n9 8\n3 6\n6 2\n8 9\n\nSample Output 3\n\n32", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 673, "cpu_time_ms": 1422, "memory_kb": 6272}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s311489167", "group_id": "codeNet:p03591", "input_text": "// ProblemURL : https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_a\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif len(s) >= 4 && s[:4] == \"YAKI\" {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1568239054, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03591.html", "problem_id": "p03591", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03591/input.txt", "sample_output_relpath": "derived/input_output/data/p03591/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03591/Go/s311489167.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s311489167", "user_id": "u554269352"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/code-festival-2016-qualb/tasks/codefestival_2016_qualB_a\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif len(s) >= 4 && s[:4] == \"YAKI\" {\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\nRingo is giving a present to Snuke.\n\nRingo has found out that Snuke loves yakiniku (a Japanese term meaning grilled meat. yaki: grilled, niku: meat). He supposes that Snuke likes grilled things starting with YAKI in Japanese, and does not like other things.\n\nYou are given a string S representing the Japanese name of Ringo's present to Snuke. Determine whether S starts with YAKI.\n\nConstraints\n\n1 \\leq |S| \\leq 10\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 starts with YAKI, print Yes; otherwise, print No.\n\nSample Input 1\n\nYAKINIKU\n\nSample Output 1\n\nYes\n\nYAKINIKU starts with YAKI.\n\nSample Input 2\n\nTAKOYAKI\n\nSample Output 2\n\nNo\n\nTAKOYAKI (a Japanese snack. tako: octopus) does not start with YAKI.\n\nSample Input 3\n\nYAK\n\nSample Output 3\n\nNo", "sample_input": "YAKINIKU\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03591", "source_text": "Score : 100 points\n\nProblem Statement\n\nRingo is giving a present to Snuke.\n\nRingo has found out that Snuke loves yakiniku (a Japanese term meaning grilled meat. yaki: grilled, niku: meat). He supposes that Snuke likes grilled things starting with YAKI in Japanese, and does not like other things.\n\nYou are given a string S representing the Japanese name of Ringo's present to Snuke. Determine whether S starts with YAKI.\n\nConstraints\n\n1 \\leq |S| \\leq 10\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 starts with YAKI, print Yes; otherwise, print No.\n\nSample Input 1\n\nYAKINIKU\n\nSample Output 1\n\nYes\n\nYAKINIKU starts with YAKI.\n\nSample Input 2\n\nTAKOYAKI\n\nSample Output 2\n\nNo\n\nTAKOYAKI (a Japanese snack. tako: octopus) does not start with YAKI.\n\nSample Input 3\n\nYAK\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 313, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s592596241", "group_id": "codeNet:p03593", "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\th, w := scanInt(), scanInt()\n\txm := make(map[rune]int)\n\tfor i := 0; i < h; i++ {\n\t\ta := scanString()\n\t\tfor _, v := range a {\n\t\t\txm[v]++\n\t\t}\n\t}\n\n\tvar g1, g2, g4 int\n\tif h%2 == 1 && w%2 == 1 {\n\t\tg1 = 1\n\t}\n\tif h%2 == 1 {\n\t\tg2 += w / 2\n\t}\n\tif w%2 == 1 {\n\t\tg2 += h / 2\n\t}\n\tg4 = (h / 2) * (w / 2)\n\n\tfor i := 0; i < g4; i++ {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 4 {\n\t\t\t\txm[j] -= 4\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 0; i < g2; i++ {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 2 {\n\t\t\t\txm[j] -= 2\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif g1 == 1 {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 1 {\n\t\t\t\txm[j]--\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1590851063, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03593.html", "problem_id": "p03593", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03593/input.txt", "sample_output_relpath": "derived/input_output/data/p03593/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03593/Go/s592596241.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s592596241", "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\th, w := scanInt(), scanInt()\n\txm := make(map[rune]int)\n\tfor i := 0; i < h; i++ {\n\t\ta := scanString()\n\t\tfor _, v := range a {\n\t\t\txm[v]++\n\t\t}\n\t}\n\n\tvar g1, g2, g4 int\n\tif h%2 == 1 && w%2 == 1 {\n\t\tg1 = 1\n\t}\n\tif h%2 == 1 {\n\t\tg2 += w / 2\n\t}\n\tif w%2 == 1 {\n\t\tg2 += h / 2\n\t}\n\tg4 = (h / 2) * (w / 2)\n\n\tfor i := 0; i < g4; i++ {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 4 {\n\t\t\t\txm[j] -= 4\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 0; i < g2; i++ {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 2 {\n\t\t\t\txm[j] -= 2\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif g1 == 1 {\n\t\tfound := false\n\t\tfor j := range xm {\n\t\t\tif xm[j] >= 1 {\n\t\t\t\txm[j]--\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have an H-by-W matrix.\nLet a_{ij} be the element at the i-th row from the top and j-th column from the left.\nIn this matrix, each a_{ij} is a lowercase English letter.\n\nSnuke is creating another H-by-W matrix, A', by freely rearranging the elements in A.\nHere, he wants to satisfy the following condition:\n\nEvery row and column in A' can be read as a palindrome.\n\nDetermine whether he can create a matrix satisfying the condition.\n\nNote\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are all palindromes, while ab, abab and abcda are not.\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_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf Snuke can create a matrix satisfying the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 4\naabb\naabb\naacc\n\nSample Output 1\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nabba\nacca\nabba\n\nSample Input 2\n\n2 2\naa\nbb\n\nSample Output 2\n\nNo\n\nIt is not possible to create a matrix satisfying the condition, no matter how we rearrange the elements in A.\n\nSample Input 3\n\n5 1\nt\nw\ne\ne\nt\n\nSample Output 3\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nt\ne\nw\ne\nt\n\nSample Input 4\n\n2 5\nabxba\nabyba\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n1 1\nz\n\nSample Output 5\n\nYes", "sample_input": "3 4\naabb\naabb\naacc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03593", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have an H-by-W matrix.\nLet a_{ij} be the element at the i-th row from the top and j-th column from the left.\nIn this matrix, each a_{ij} is a lowercase English letter.\n\nSnuke is creating another H-by-W matrix, A', by freely rearranging the elements in A.\nHere, he wants to satisfy the following condition:\n\nEvery row and column in A' can be read as a palindrome.\n\nDetermine whether he can create a matrix satisfying the condition.\n\nNote\n\nA palindrome is a string that reads the same forward and backward.\nFor example, a, aa, abba and abcba are all palindromes, while ab, abab and abcda are not.\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_{12}...a_{1W}\n:\na_{H1}a_{H2}...a_{HW}\n\nOutput\n\nIf Snuke can create a matrix satisfying the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 4\naabb\naabb\naacc\n\nSample Output 1\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nabba\nacca\nabba\n\nSample Input 2\n\n2 2\naa\nbb\n\nSample Output 2\n\nNo\n\nIt is not possible to create a matrix satisfying the condition, no matter how we rearrange the elements in A.\n\nSample Input 3\n\n5 1\nt\nw\ne\ne\nt\n\nSample Output 3\n\nYes\n\nFor example, the following matrix satisfies the condition.\n\nt\ne\nw\ne\nt\n\nSample Input 4\n\n2 5\nabxba\nabyba\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n1 1\nz\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1193, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s673554003", "group_id": "codeNet:p03598", "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 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\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 N, K int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K = nextInt(), nextInt()\n\n\tans := 0\n\tvar tmp int\n\tfor i := 0; i < N; i++ {\n\t\ttmp = nextInt()\n\t\tans += 2 * minInt(K-tmp, tmp)\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1591416022, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03598.html", "problem_id": "p03598", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03598/input.txt", "sample_output_relpath": "derived/input_output/data/p03598/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03598/Go/s673554003.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s673554003", "user_id": "u432333240"}, "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\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\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 N, K int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, K = nextInt(), nextInt()\n\n\tans := 0\n\tvar tmp int\n\tfor i := 0; i < N; i++ {\n\t\ttmp = nextInt()\n\t\tans += 2 * minInt(K-tmp, tmp)\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i).\nThus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N.\n\nIn order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B.\nThen, he placed the i-th type-A robot at coordinates (0, i), and the i-th type-B robot at coordinates (K, i).\nThus, now we have one type-A robot and one type-B robot on each of the N lines y = 1, y = 2, ..., y = N.\n\nWhen activated, each type of robot will operate as follows.\n\nWhen a type-A robot is activated at coordinates (0, a), it will move to the position of the ball on the line y = a, collect the ball, move back to its original position (0, a) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nWhen a type-B robot is activated at coordinates (K, b), it will move to the position of the ball on the line y = b, collect the ball, move back to its original position (K, b) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nSnuke will activate some of the 2N robots to collect all of the balls. Find the minimum possible total distance covered by robots.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n0 < x_i < K\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nK\nx_1 x_2 ... x_N\n\nOutputs\n\nPrint the minimum possible total distance covered by robots.\n\nSample Input 1\n\n1\n10\n2\n\nSample Output 1\n\n4\n\nThere are just one ball, one type-A robot and one type-B robot.\n\nIf the type-A robot is used to collect the ball, the distance from the robot to the ball is 2, and the distance from the ball to the original position of the robot is also 2, for a total distance of 4.\n\nSimilarly, if the type-B robot is used, the total distance covered will be 16.\n\nThus, the total distance covered will be minimized when the type-A robot is used. The output should be 4.\n\nSample Input 2\n\n2\n9\n3 6\n\nSample Output 2\n\n12\n\nThe total distance covered will be minimized when the first ball is collected by the type-A robot, and the second ball by the type-B robot.\n\nSample Input 3\n\n5\n20\n11 12 9 17 12\n\nSample Output 3\n\n74", "sample_input": "1\n10\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03598", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N balls in the xy-plane. The coordinates of the i-th of them is (x_i, i).\nThus, we have one ball on each of the N lines y = 1, y = 2, ..., y = N.\n\nIn order to collect these balls, Snuke prepared 2N robots, N of type A and N of type B.\nThen, he placed the i-th type-A robot at coordinates (0, i), and the i-th type-B robot at coordinates (K, i).\nThus, now we have one type-A robot and one type-B robot on each of the N lines y = 1, y = 2, ..., y = N.\n\nWhen activated, each type of robot will operate as follows.\n\nWhen a type-A robot is activated at coordinates (0, a), it will move to the position of the ball on the line y = a, collect the ball, move back to its original position (0, a) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nWhen a type-B robot is activated at coordinates (K, b), it will move to the position of the ball on the line y = b, collect the ball, move back to its original position (K, b) and deactivate itself. If there is no such ball, it will just deactivate itself without doing anything.\n\nSnuke will activate some of the 2N robots to collect all of the balls. Find the minimum possible total distance covered by robots.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n0 < x_i < K\n\nAll input values are integers.\n\nInputs\n\nInput is given from Standard Input in the following format:\n\nN\nK\nx_1 x_2 ... x_N\n\nOutputs\n\nPrint the minimum possible total distance covered by robots.\n\nSample Input 1\n\n1\n10\n2\n\nSample Output 1\n\n4\n\nThere are just one ball, one type-A robot and one type-B robot.\n\nIf the type-A robot is used to collect the ball, the distance from the robot to the ball is 2, and the distance from the ball to the original position of the robot is also 2, for a total distance of 4.\n\nSimilarly, if the type-B robot is used, the total distance covered will be 16.\n\nThus, the total distance covered will be minimized when the type-A robot is used. The output should be 4.\n\nSample Input 2\n\n2\n9\n3 6\n\nSample Output 2\n\n12\n\nThe total distance covered will be minimized when the first ball is collected by the type-A robot, and the second ball by the type-B robot.\n\nSample Input 3\n\n5\n20\n11 12 9 17 12\n\nSample Output 3\n\n74", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1795, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s266961591", "group_id": "codeNet:p03600", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tconst inf = 1 << 60\n\n\tn := nextInt()\n\ta := make([][]int, n)\n\tfor i := range a {\n\t\ta[i] = nextInts(n)\n\t\ta[i][i] = inf\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\t// 経路i-k-j\n\t\t\t// 直通の道がなくても事足りるか\n\t\t\teq := false\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif a[i][j] > a[i][k]+a[k][j] {\n\t\t\t\t\tputs(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\teq = eq || (a[i][j] == a[i][k]+a[k][j])\n\t\t\t}\n\t\t\tif !eq {\n\t\t\t\tsum += a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tputs(sum)\n}\n", "language": "Go", "metadata": {"date": 1591056707, "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/s266961591.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s266961591", "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\"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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tconst inf = 1 << 60\n\n\tn := nextInt()\n\ta := make([][]int, n)\n\tfor i := range a {\n\t\ta[i] = nextInts(n)\n\t\ta[i][i] = inf\n\t}\n\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\t// 経路i-k-j\n\t\t\t// 直通の道がなくても事足りるか\n\t\t\teq := false\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif a[i][j] > a[i][k]+a[k][j] {\n\t\t\t\t\tputs(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\teq = eq || (a[i][j] == a[i][k]+a[k][j])\n\t\t\t}\n\t\t\tif !eq {\n\t\t\t\tsum += a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tputs(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 158, "memory_kb": 2944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s460781821", "group_id": "codeNet:p03600", "input_text": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Mon Jan 7 17:54:40 2019\n//\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype graph [][]int\n\nfunc warshalFloyd(g graph) (int, error) {\n\tg2 := make(graph, len(g))\n\tfor i := range g2 {\n\t\tg2[i] = make([]int, len(g[i]))\n\t\tcopy(g2[i], g[i])\n\t}\n\n\tfor k := range g {\n\t\tfor i := range g {\n\t\t\tfor j := range g {\n\t\t\t\tif g[i][k]+g[k][j] < g[i][j] {\n\t\t\t\t\treturn 0, errors.New(\"error\")\n\t\t\t\t} else if i != k && k != j && g[i][k]+g[k][j] == g[i][j] {\n\t\t\t\t\tg2[i][j] = 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := range g2 {\n\t\tfor j := range g2[i] {\n\t\t\tsum += g2[i][j]\n\t\t}\n\t}\n\n\treturn sum / 2, nil\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\troutes := make(graph, N)\n\tfor i := range routes {\n\t\troutes[i] = make([]int, N)\n\t\tfor j := range routes[i] {\n\t\t\tfmt.Scan(&routes[i][j])\n\t\t}\n\t}\n\n\tif n, err := warshalFloyd(routes); err != nil {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(n)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1547009214, "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/s460781821.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s460781821", "user_id": "u802614675"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// Package main provides\n//\n// File: d.go\n// Author: ymiyamoto\n//\n// Created on Mon Jan 7 17:54:40 2019\n//\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype graph [][]int\n\nfunc warshalFloyd(g graph) (int, error) {\n\tg2 := make(graph, len(g))\n\tfor i := range g2 {\n\t\tg2[i] = make([]int, len(g[i]))\n\t\tcopy(g2[i], g[i])\n\t}\n\n\tfor k := range g {\n\t\tfor i := range g {\n\t\t\tfor j := range g {\n\t\t\t\tif g[i][k]+g[k][j] < g[i][j] {\n\t\t\t\t\treturn 0, errors.New(\"error\")\n\t\t\t\t} else if i != k && k != j && g[i][k]+g[k][j] == g[i][j] {\n\t\t\t\t\tg2[i][j] = 0\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := range g2 {\n\t\tfor j := range g2[i] {\n\t\t\tsum += g2[i][j]\n\t\t}\n\t}\n\n\treturn sum / 2, nil\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\troutes := make(graph, N)\n\tfor i := range routes {\n\t\troutes[i] = make([]int, N)\n\t\tfor j := range routes[i] {\n\t\t\tfmt.Scan(&routes[i][j])\n\t\t}\n\t}\n\n\tif n, err := warshalFloyd(routes); err != nil {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(n)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 833, "memory_kb": 4736}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s654020275", "group_id": "codeNet:p03605", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var n string\n fmt.Scan(&n)\n i := strings.Index(n, \"9\")\n ans := \"Yes\"; if i == -1 {ans = \"No\"}\n fmt.Println(ans)\n\n}", "language": "Go", "metadata": {"date": 1587513555, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03605.html", "problem_id": "p03605", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03605/input.txt", "sample_output_relpath": "derived/input_output/data/p03605/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03605/Go/s654020275.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s654020275", "user_id": "u254871849"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var n string\n fmt.Scan(&n)\n i := strings.Index(n, \"9\")\n ans := \"Yes\"; if i == -1 {ans = \"No\"}\n fmt.Println(ans)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is September 9 in Japan now.\n\nYou are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?\n\nConstraints\n\n10≤N≤99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf 9 is contained in the decimal notation of N, print Yes; if not, print No.\n\nSample Input 1\n\n29\n\nSample Output 1\n\nYes\n\nThe one's digit of 29 is 9.\n\nSample Input 2\n\n72\n\nSample Output 2\n\nNo\n\n72 does not contain 9.\n\nSample Input 3\n\n91\n\nSample Output 3\n\nYes", "sample_input": "29\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03605", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is September 9 in Japan now.\n\nYou are given a two-digit integer N. Answer the question: Is 9 contained in the decimal notation of N?\n\nConstraints\n\n10≤N≤99\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf 9 is contained in the decimal notation of N, print Yes; if not, print No.\n\nSample Input 1\n\n29\n\nSample Output 1\n\nYes\n\nThe one's digit of 29 is 9.\n\nSample Input 2\n\n72\n\nSample Output 2\n\nNo\n\n72 does not contain 9.\n\nSample Input 3\n\n91\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963762742", "group_id": "codeNet:p03607", "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\td := make(map[int]struct{})\n\tfor i := 0; i < n; i++ {\n\t\ta := iScan()\n\t\tif _, ok := d[a]; ok {\n\t\t\tdelete(d, a)\n\t\t} else {\n\t\t\td[a] = struct{}{}\n\t\t}\n\t}\n\tfmt.Println(len(d))\n}\n", "language": "Go", "metadata": {"date": 1594925469, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s963762742.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s963762742", "user_id": "u843722521"}, "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 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\td := make(map[int]struct{})\n\tfor i := 0; i < n; i++ {\n\t\ta := iScan()\n\t\tif _, ok := d[a]; ok {\n\t\t\tdelete(d, a)\n\t\t} else {\n\t\t\td[a] = struct{}{}\n\t\t}\n\t}\n\tfmt.Println(len(d))\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1388, "cpu_time_ms": 44, "memory_kb": 5968}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s500592042", "group_id": "codeNet:p03607", "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 inputIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tfor i := range slice {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nvar written [1000000000]bool\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt() - 1\n\t\tif a > max {\n\t\t\tmax = a\n\t\t}\n\t\twritten[a] = !written[a]\n\t}\n\n\tans := 0\n\tfor i := 0; i <= max; i++ {\n\t\tif written[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1577518193, "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/s500592042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Memory Limit Exceeded", "submission_id": "s500592042", "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\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 inputIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tfor i := range slice {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nvar written [1000000000]bool\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt() - 1\n\t\tif a > max {\n\t\t\tmax = a\n\t\t}\n\t\twritten[a] = !written[a]\n\t}\n\n\tans := 0\n\tfor i := 0; i <= max; i++ {\n\t\tif written[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 604, "cpu_time_ms": 1299, "memory_kb": 752896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s162187179", "group_id": "codeNet:p03609", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, t int\n\tfmt.Scan(&x, &t)\n\n\tif v := x - t; v > 0 {\n\t\tfmt.Println(v)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587345960, "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/s162187179.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s162187179", "user_id": "u214033538"}, "prompt_components": {"gold_output": "83\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, t int\n\tfmt.Scan(&x, &t)\n\n\tif v := x - t; v > 0 {\n\t\tfmt.Println(v)\n\t} else {\n\t\tfmt.Println(0)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s815373108", "group_id": "codeNet:p03612", "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, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\nfunc main() {\n\tN := nextInt()\n\tvar cnt, serial int\n\tserial++\n\tvar prev bool\n\tfor i := 0; i < N; i++ {\n\t\tp := nextInt() - 1\n\t\tif i == p {\n\t\t\tcnt++\n\t\t\tif prev {\n\t\t\t\tserial++\n\t\t\t} else {\n\t\t\t\tprev = true\n\t\t\t}\n\t\t}\n\t\tif i != p || (i == N-1 && prev) {\n\t\t\tprev = false\n\t\t\tcnt -= serial / 2\n\t\t\tserial = 1\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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 ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n", "language": "Go", "metadata": {"date": 1599797431, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s815373108.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s815373108", "user_id": "u605443479"}, "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\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\nfunc main() {\n\tN := nextInt()\n\tvar cnt, serial int\n\tserial++\n\tvar prev bool\n\tfor i := 0; i < N; i++ {\n\t\tp := nextInt() - 1\n\t\tif i == p {\n\t\t\tcnt++\n\t\t\tif prev {\n\t\t\t\tserial++\n\t\t\t} else {\n\t\t\t\tprev = true\n\t\t\t}\n\t\t}\n\t\tif i != p || (i == N-1 && prev) {\n\t\t\tprev = false\n\t\t\tcnt -= serial / 2\n\t\t\tserial = 1\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\n// Position として迷路問題での現在地を表す構造体を定義\ntype Position struct {\n\tH int\n\tW int\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 ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\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\n// NextPermutation はsortインターフェース(要はソート済みスライス)から次の順列にスライスを並べ替える\n// https://play.golang.org/p/ljft9xhOEn\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// PrimeFactorize 素因数分解したmapを返す\nfunc PrimeFactorize(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// FastPrimeFactorize osa_k法を使った高速素因数分解\n// sieveを作るところのjはi*2スタートでもよい?\n// https://qiita.com/rsk0315_h4x/items/ff3b542a4468679fb409\nfunc FastPrimeFactorize(n int, sieve []int) map[int]int {\n\tpf := make(map[int]int)\n\tfor n > 1 {\n\t\tpf[sieve[n]]++\n\t\tn /= sieve[n]\n\t}\n\treturn pf\n}\n\n// MakeSieve は高速素数判定に使う篩を作る。\n// Sieve[i] < i なら合成数なので、Sieveは素数判定にも使える\nfunc MakeSieve(max int) []int {\n\tsieve := make([]int, max)\n\tfor i := range sieve {\n\t\tsieve[i] = i\n\t}\n\tfor i := 2; i*i <= max; i++ {\n\t\tif sieve[i] == i {\n\t\t\tfor j := i; j < max; j += i {\n\t\t\t\tif sieve[j] == j {\n\t\t\t\t\tsieve[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sieve\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) 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// 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\n// UnionFind の定義\n// 下記を参考\n// https://youtu.be/TdR816rqc3s?t=6822\n// https://github.com/atcoder/live_library/blob/master/uf.cpp\n// https://qiita.com/haru1843/items/2295d0ec1f5002bd5c33#%E5%AE%9F%E8%A3%85\ntype UnionFind struct {\n\tparent []int\n\tmaxlen int\n}\n\n// UnionFind のスライス初期化\nfunc newUnionFind(N int) *UnionFind {\n\tu := new(UnionFind)\n\tu.parent = make([]int, N)\n\tu.maxlen = 1\n\tfor i := range u.parent {\n\t\tu.parent[i] = -1\n\t}\n\treturn u\n}\n\n// xの根を見つける\nfunc (u *UnionFind) find(x int) int {\n\tif u.parent[x] < 0 {\n\t\treturn x\n\t}\n\tu.parent[x] = u.find(u.parent[x])\n\treturn u.parent[x]\n}\n\n// xとyのグループを結合する\nfunc (u *UnionFind) unite(x, y int) {\n\txf := u.find(x)\n\tyf := u.find(y)\n\tif xf == yf {\n\t\treturn\n\t}\n\t// 常に大きい方に小さい木をくっつける\n\tif xf > yf {\n\t\txf, yf = yf, xf\n\t}\n\tu.parent[xf] += u.parent[yf]\n\tu.parent[yf] = xf\n\tif u.parent[xf] < 0 {\n\t\tu.maxlen = MaxOf(u.maxlen, abs(u.parent[xf]))\n\t}\n}\n\n// xとyが同じグループに所属するかどうかを返す\nfunc (u *UnionFind) same(x, y int) bool {\n\tif u.find(x) == u.find(y) {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// xの所属するグループの木の大きさを返す\nfunc (u *UnionFind) size(x int) int {\n\treturn -u.parent[u.find(x)]\n}\n\n// 根の数を返す\nfunc (u UnionFind) rootcnt() int {\n\tvar cnt int\n\tfor _, v := range u.parent {\n\t\tif v < 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6885, "cpu_time_ms": 23, "memory_kb": 2304}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s520808569", "group_id": "codeNet:p03617", "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\tq, h, s, d := nextInt(), nextInt(), nextInt(), nextInt()\n\tn := nextInt()\n\tputs(min(n*4*q, n*2*h, n*s, (n/2)*d+(n%2)*min(4*q, 2*h, s)))\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": 1579830413, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03617.html", "problem_id": "p03617", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03617/input.txt", "sample_output_relpath": "derived/input_output/data/p03617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03617/Go/s520808569.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s520808569", "user_id": "u502813058"}, "prompt_components": {"gold_output": "150\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\tq, h, s, d := nextInt(), nextInt(), nextInt(), nextInt()\n\tn := nextInt()\n\tputs(min(n*4*q, n*2*h, n*s, (n/2)*d+(n%2)*min(4*q, 2*h, s)))\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\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "sample_input": "20 30 70 90\n3\n"}, "reference_outputs": ["150\n"], "source_document_id": "p03617", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou've come to your favorite store Infinitesco to buy some ice tea.\n\nThe store sells ice tea in bottles of different volumes at different costs.\nSpecifically, a 0.25-liter bottle costs Q yen, a 0.5-liter bottle costs H yen, a 1-liter bottle costs S yen, and a 2-liter bottle costs D yen.\nThe store has an infinite supply of bottles of each type.\n\nYou want to buy exactly N liters of ice tea. How many yen do you have to spend?\n\nConstraints\n\n1 \\leq Q, H, S, D \\leq 10^8\n\n1 \\leq N \\leq 10^9\n\nAll input values are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ H S D\nN\n\nOutput\n\nPrint the smallest number of yen you have to spend to buy exactly N liters of ice tea.\n\nSample Input 1\n\n20 30 70 90\n3\n\nSample Output 1\n\n150\n\nBuy one 2-liter bottle and two 0.5-liter bottles. You'll get 3 liters for 90 + 30 + 30 = 150 yen.\n\nSample Input 2\n\n10000 1000 100 10\n1\n\nSample Output 2\n\n100\n\nEven though a 2-liter bottle costs just 10 yen, you need only 1 liter.\nThus, you have to buy a 1-liter bottle for 100 yen.\n\nSample Input 3\n\n10 100 1000 10000\n1\n\nSample Output 3\n\n40\n\nNow it's better to buy four 0.25-liter bottles for 10 + 10 + 10 + 10 = 40 yen.\n\nSample Input 4\n\n12345678 87654321 12345678 87654321\n123456789\n\nSample Output 4\n\n1524157763907942", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1256, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s941234035", "group_id": "codeNet:p03627", "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\tset := make(map[int]int, 0)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tt, _ := strconv.Atoi(sc.Text())\n\t\tset[t]++\n\t}\n\tks := make([]int, 0)\n\tfor k := range set {\n\t\tks = append(ks, k)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ks)))\n\tm1, m2 := 0, 0\n\tfor i := range ks {\n\t\tv := set[ks[i]]\n\t\tif v >= 2 {\n\t\t\tif v > m1 {\n\t\t\t\tm1 = ks[i]\n\t\t\t} else if v > m2 {\n\t\t\t\tm2 = ks[i]\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tif set[m1] >= 4 {\n\t\tans = m1 * m1\n\t} else {\n\t\tans = m1 * m2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1569515775, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03627.html", "problem_id": "p03627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03627/input.txt", "sample_output_relpath": "derived/input_output/data/p03627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03627/Go/s941234035.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s941234035", "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 int\n\tfmt.Scan(&N)\n\tset := make(map[int]int, 0)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\tt, _ := strconv.Atoi(sc.Text())\n\t\tset[t]++\n\t}\n\tks := make([]int, 0)\n\tfor k := range set {\n\t\tks = append(ks, k)\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ks)))\n\tm1, m2 := 0, 0\n\tfor i := range ks {\n\t\tv := set[ks[i]]\n\t\tif v >= 2 {\n\t\t\tif v > m1 {\n\t\t\t\tm1 = ks[i]\n\t\t\t} else if v > m2 {\n\t\t\t\tm2 = ks[i]\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tif set[m1] >= 4 {\n\t\tans = m1 * m1\n\t} else {\n\t\tans = m1 * m2\n\t}\n\tfmt.Println(ans)\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": "p03627", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 91, "memory_kb": 8832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s359158728", "group_id": "codeNet:p03631", "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\n\ts := strconv.Itoa(n)\n\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i] != s[len(s)-1-i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1597201164, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03631.html", "problem_id": "p03631", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03631/input.txt", "sample_output_relpath": "derived/input_output/data/p03631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03631/Go/s359158728.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s359158728", "user_id": "u061804469"}, "prompt_components": {"gold_output": "Yes\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\n\ts := strconv.Itoa(n)\n\n\tfor i := 0; i < len(s)/2; i++ {\n\t\tif s[i] != s[len(s)-1-i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "sample_input": "575\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03631", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 230, "cpu_time_ms": 4, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s327455467", "group_id": "codeNet:p03631", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tif n[0] == n[2] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1582572409, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03631.html", "problem_id": "p03631", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03631/input.txt", "sample_output_relpath": "derived/input_output/data/p03631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03631/Go/s327455467.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s327455467", "user_id": "u461993794"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tif n[0] == n[2] {\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\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "sample_input": "575\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03631", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 146, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s640658315", "group_id": "codeNet:p03631", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tif n[0] == n[2] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1555365588, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03631.html", "problem_id": "p03631", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03631/input.txt", "sample_output_relpath": "derived/input_output/data/p03631/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03631/Go/s640658315.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640658315", "user_id": "u102310764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n string\n\tfmt.Scan(&n)\n\n\tif n[0] == n[2] {\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\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "sample_input": "575\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03631", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a three-digit positive integer N.\n\nDetermine whether N is a palindromic number.\n\nHere, a palindromic number is an integer that reads the same backward as forward in decimal notation.\n\nConstraints\n\n100≤N≤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 N is a palindromic number, print Yes; otherwise, print No.\n\nSample Input 1\n\n575\n\nSample Output 1\n\nYes\n\nN=575 is also 575 when read backward, so it is a palindromic number. You should print Yes.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\nN=123 becomes 321 when read backward, so it is not a palindromic number. You should print No.\n\nSample Input 3\n\n812\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 151, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s873290758", "group_id": "codeNet:p03634", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc070/tasks/abc070_d\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: argument slice length must not be zero\")\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: 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) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\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: 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 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 intsCopySorted(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 {\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 intsAppendSentinel(a *[]int, sentinel int) {\n\tintsPushFront(a, sentinel)\n\tintsPushBack(a, sentinel)\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 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 swap(a, b *int) { *a, *b = *b, *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 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\treturn\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\treturn\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) }\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 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 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\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 := ri()\n\ttype edge struct{ t, c int }\n\tg := make([][]edge, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b, c := ri()-1, ri()-1, ri()\n\t\tg[a] = append(g[a], edge{t: b, c: c})\n\t\tg[b] = append(g[b], edge{t: a, c: c})\n\t}\n\tq, k := ri(), ri()-1\n\ta := make([]int, n)\n\tvar dfs func(int, int, int)\n\tdfs = func(v, p, d int) {\n\t\ta[v] = d\n\t\tfor _, nv := range g[v] {\n\t\t\tif nv.t == p {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdfs(nv.t, v, d+nv.c)\n\t\t}\n\t}\n\tdfs(k, -1, 0)\n\tfor i := 0; i < q; i++ {\n\t\tx, y := ri()-1, ri()-1\n\t\tpln(a[x] + a[y])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572833938, "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/s873290758.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s873290758", "user_id": "u554269352"}, "prompt_components": {"gold_output": "3\n2\n4\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc070/tasks/abc070_d\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: argument slice length must not be zero\")\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: 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) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\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: 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 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 intsCopySorted(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 {\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 intsAppendSentinel(a *[]int, sentinel int) {\n\tintsPushFront(a, sentinel)\n\tintsPushBack(a, sentinel)\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 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 swap(a, b *int) { *a, *b = *b, *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 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\treturn\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\treturn\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) }\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 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 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\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 := ri()\n\ttype edge struct{ t, c int }\n\tg := make([][]edge, n)\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b, c := ri()-1, ri()-1, ri()\n\t\tg[a] = append(g[a], edge{t: b, c: c})\n\t\tg[b] = append(g[b], edge{t: a, c: c})\n\t}\n\tq, k := ri(), ri()-1\n\ta := make([]int, n)\n\tvar dfs func(int, int, int)\n\tdfs = func(v, p, d int) {\n\t\ta[v] = d\n\t\tfor _, nv := range g[v] {\n\t\t\tif nv.t == p {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdfs(nv.t, v, d+nv.c)\n\t\t}\n\t}\n\tdfs(k, -1, 0)\n\tfor i := 0; i < q; i++ {\n\t\tx, y := ri()-1, ri()-1\n\t\tpln(a[x] + a[y])\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9493, "cpu_time_ms": 158, "memory_kb": 66048}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s146745896", "group_id": "codeNet:p03637", "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 main() {\n\tdefer stdout.Flush()\n\t_, a := readLengthAndSlice()\n\n\tc := make([]int, 4)\n\tfor i := range a {\n\t\tc[a[i]%4]++\n\t}\n\tc1 := c[1] + c[3]\n\tc2 := c[2]\n\tc4 := c[0]\n\tif c2 == 0 {\n\t\tif c1 <= c4+1 {\n\t\t\tprintln(\"Yes\")\n\t\t} else {\n\t\t\tprintln(\"No\")\n\t\t}\n\t} else {\n\t\tif c2 == 1 && c4 == 0 {\n\t\t\tprintln(\"No\")\n\t\t} else if c1 <= c4 {\n\t\t\tprintln(\"Yes\")\n\t\t} else {\n\t\t\tprintln(\"No\")\n\t\t}\n\t}\n}\n\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", "language": "Go", "metadata": {"date": 1536118056, "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/s146745896.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s146745896", "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 main() {\n\tdefer stdout.Flush()\n\t_, a := readLengthAndSlice()\n\n\tc := make([]int, 4)\n\tfor i := range a {\n\t\tc[a[i]%4]++\n\t}\n\tc1 := c[1] + c[3]\n\tc2 := c[2]\n\tc4 := c[0]\n\tif c2 == 0 {\n\t\tif c1 <= c4+1 {\n\t\t\tprintln(\"Yes\")\n\t\t} else {\n\t\t\tprintln(\"No\")\n\t\t}\n\t} else {\n\t\tif c2 == 1 && c4 == 0 {\n\t\t\tprintln(\"No\")\n\t\t} else if c1 <= c4 {\n\t\t\tprintln(\"Yes\")\n\t\t} else {\n\t\t\tprintln(\"No\")\n\t\t}\n\t}\n}\n\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2474, "cpu_time_ms": 27, "memory_kb": 2944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992470220", "group_id": "codeNet:p03638", "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\tsc.Split(bufio.ScanWords)\n\th, _ := strconv.Atoi(stringLineScan())\n\tw, _ := strconv.Atoi(stringLineScan())\n\tn, _ := strconv.Atoi(stringLineScan())\n\tc := 0\n\tans := make([][]int, n)\n\tfor i := 0; i < h; i++ {\n\t\tt := make([]int, w)\n\t\tans[i] = t\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tt, _ := strconv.Atoi(stringLineScan())\n\t\tfor j := 0; j < t; j++ {\n\t\t\tans[c/w][c%w] = i\n\t\t\tc++\n\t\t}\n\t}\n\tfor i := 0; i < h; i++ {\n\t\tif i%2 == 0 {\n\t\t\tfmt.Println(strings.Trim(fmt.Sprint(ans[i]), \"[]\"))\n\t\t} else {\n\t\t\tt := make([]int, w)\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tt[w-j-1] = ans[i][j]\n\t\t\t}\n\t\t\tfmt.Println(strings.Trim(fmt.Sprint(t), \"[]\"))\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581839658, "filename_ext": "go", "original_language": "Go (1.6)", "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/s992470220.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s992470220", "user_id": "u843722521"}, "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\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\tsc.Split(bufio.ScanWords)\n\th, _ := strconv.Atoi(stringLineScan())\n\tw, _ := strconv.Atoi(stringLineScan())\n\tn, _ := strconv.Atoi(stringLineScan())\n\tc := 0\n\tans := make([][]int, n)\n\tfor i := 0; i < h; i++ {\n\t\tt := make([]int, w)\n\t\tans[i] = t\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tt, _ := strconv.Atoi(stringLineScan())\n\t\tfor j := 0; j < t; j++ {\n\t\t\tans[c/w][c%w] = i\n\t\t\tc++\n\t\t}\n\t}\n\tfor i := 0; i < h; i++ {\n\t\tif i%2 == 0 {\n\t\t\tfmt.Println(strings.Trim(fmt.Sprint(ans[i]), \"[]\"))\n\t\t} else {\n\t\t\tt := make([]int, w)\n\t\t\tfor j := 0; j < w; j++ {\n\t\t\t\tt[w-j-1] = ans[i][j]\n\t\t\t}\n\t\t\tfmt.Println(strings.Trim(fmt.Sprint(t), \"[]\"))\n\t\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s573840409", "group_id": "codeNet:p03638", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Thu Jan 10 09:47:06 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H, W, N int\n\tfmt.Scan(&H, &W, &N)\n\tarr := make([]int, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t}\n\n\tboard := make([][]int, H)\n\tfor i := range board {\n\t\tboard[i] = make([]int, W)\n\t}\n\n\th, w := 0, 0\n\tfor i := range arr {\n\t\tfor arr[i] > 0 {\n\t\t\tboard[h][w] = i + 1\n\t\t\tw++\n\t\t\tif w == W {\n\t\t\t\th++\n\t\t\t\tw = 0\n\t\t\t}\n\t\t\tarr[i]--\n\t\t}\n\t}\n\n\tfor i := range board {\n\t\tif i%2 == 0 {\n\t\t\tfor j := range board[i] {\n\t\t\t\tif j != 0 {\n\t\t\t\t\tfmt.Print(\" \")\n\t\t\t\t}\n\t\t\t\tfmt.Print(board[i][j])\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := len(board[i]) - 1; j >= 0; j-- {\n\t\t\t\tif j != len(board[i])-1 {\n\t\t\t\t\tfmt.Print(\" \")\n\t\t\t\t}\n\t\t\t\tfmt.Print(board[i][j])\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1547141770, "filename_ext": "go", "original_language": "Go (1.6)", "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/s573840409.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s573840409", "user_id": "u802614675"}, "prompt_components": {"gold_output": "1 1\n2 3\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Thu Jan 10 09:47:06 2019\n//\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H, W, N int\n\tfmt.Scan(&H, &W, &N)\n\tarr := make([]int, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i])\n\t}\n\n\tboard := make([][]int, H)\n\tfor i := range board {\n\t\tboard[i] = make([]int, W)\n\t}\n\n\th, w := 0, 0\n\tfor i := range arr {\n\t\tfor arr[i] > 0 {\n\t\t\tboard[h][w] = i + 1\n\t\t\tw++\n\t\t\tif w == W {\n\t\t\t\th++\n\t\t\t\tw = 0\n\t\t\t}\n\t\t\tarr[i]--\n\t\t}\n\t}\n\n\tfor i := range board {\n\t\tif i%2 == 0 {\n\t\t\tfor j := range board[i] {\n\t\t\t\tif j != 0 {\n\t\t\t\t\tfmt.Print(\" \")\n\t\t\t\t}\n\t\t\t\tfmt.Print(board[i][j])\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := len(board[i]) - 1; j >= 0; j-- {\n\t\t\t\tif j != len(board[i])-1 {\n\t\t\t\t\tfmt.Print(\" \")\n\t\t\t\t}\n\t\t\t\tfmt.Print(board[i][j])\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 797, "cpu_time_ms": 64, "memory_kb": 1536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s784510627", "group_id": "codeNet:p03646", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tK := ReadInt()\n\tN := 50\n\tr := K % N\n\tA := (K + (N - 1)) / N\n\tB := K / N\n\tv := make([]int, N)\n\tfor i := 0; i < r; i++ {\n\t\tv[i] = (N - 1) - (K - B - 1) + A*N\n\t}\n\tfor i := r; i < N; i++ {\n\t\tv[i] = (N - 1) - (K - B) + B*N\n\t}\n\tfmt.Println(len(v))\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Printf(\"%d \", v[i])\n\t}\n\tfmt.Println()\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": 1595990496, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03646.html", "problem_id": "p03646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03646/input.txt", "sample_output_relpath": "derived/input_output/data/p03646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03646/Go/s784510627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s784510627", "user_id": "u328656362"}, "prompt_components": {"gold_output": "4\n3 3 3 3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tK := ReadInt()\n\tN := 50\n\tr := K % N\n\tA := (K + (N - 1)) / N\n\tB := K / N\n\tv := make([]int, N)\n\tfor i := 0; i < r; i++ {\n\t\tv[i] = (N - 1) - (K - B - 1) + A*N\n\t}\n\tfor i := r; i < N; i++ {\n\t\tv[i] = (N - 1) - (K - B) + B*N\n\t}\n\tfmt.Println(len(v))\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Printf(\"%d \", v[i])\n\t}\n\tfmt.Println()\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 : 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.\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 an integer K. Find an integer sequence a_i such that the number of times we will perform the above operation is exactly K. It can be shown that there is always such a sequence under the constraints on input and output in this problem.\n\nConstraints\n\n0 ≤ K ≤ 50 \\times 10^{16}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint a solution in the following format:\n\nN\na_1 a_2 ... a_N\n\nHere, 2 ≤ N ≤ 50 and 0 ≤ a_i ≤ 10^{16} + 1000 must hold.\n\nSample Input 1\n\n0\n\nSample Output 1\n\n4\n3 3 3 3\n\nSample Input 2\n\n1\n\nSample Output 2\n\n3\n1 0 3\n\nSample Input 3\n\n2\n\nSample Output 3\n\n2\n2 2\n\nThe operation will be performed twice: [2, 2] -> [0, 3] -> [1, 1].\n\nSample Input 4\n\n3\n\nSample Output 4\n\n7\n27 0 0 0 0 0 0\n\nSample Input 5\n\n1234567894848\n\nSample Output 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425", "sample_input": "0\n"}, "reference_outputs": ["4\n3 3 3 3\n"], "source_document_id": "p03646", "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.\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 an integer K. Find an integer sequence a_i such that the number of times we will perform the above operation is exactly K. It can be shown that there is always such a sequence under the constraints on input and output in this problem.\n\nConstraints\n\n0 ≤ K ≤ 50 \\times 10^{16}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint a solution in the following format:\n\nN\na_1 a_2 ... a_N\n\nHere, 2 ≤ N ≤ 50 and 0 ≤ a_i ≤ 10^{16} + 1000 must hold.\n\nSample Input 1\n\n0\n\nSample Output 1\n\n4\n3 3 3 3\n\nSample Input 2\n\n1\n\nSample Output 2\n\n3\n1 0 3\n\nSample Input 3\n\n2\n\nSample Output 3\n\n2\n2 2\n\nThe operation will be performed twice: [2, 2] -> [0, 3] -> [1, 1].\n\nSample Input 4\n\n3\n\nSample Output 4\n\n7\n27 0 0 0 0 0 0\n\nSample Input 5\n\n1234567894848\n\nSample Output 5\n\n10\n1000 193 256 777 0 1 1192 1234567891011 48 425", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s121529162", "group_id": "codeNet:p03647", "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\ntype edge struct {\n\ts, t int64\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\tedges := make(map[edge]int64, N+1)\n\tfor i := int64(0); i < M; i++ {\n\t\ta, b := readInt()-1, readInt()-1\n\t\tedges[edge{a, b}]++\n\t\tedges[edge{b, a}]++\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tif edges[edge{0, i}] > 0 && edges[edge{i, N - 1}] > 0 {\n\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\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": 1588896739, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03647.html", "problem_id": "p03647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03647/input.txt", "sample_output_relpath": "derived/input_output/data/p03647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03647/Go/s121529162.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s121529162", "user_id": "u967669872"}, "prompt_components": {"gold_output": "POSSIBLE\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\ntype edge struct {\n\ts, t int64\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\tedges := make(map[edge]int64, N+1)\n\tfor i := int64(0); i < M; i++ {\n\t\ta, b := readInt()-1, readInt()-1\n\t\tedges[edge{a, b}]++\n\t\tedges[edge{b, a}]++\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tif edges[edge{0, i}] > 0 && edges[edge{i, N - 1}] > 0 {\n\t\t\tfmt.Println(\"POSSIBLE\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\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\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": "p03647", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5940, "cpu_time_ms": 178, "memory_kb": 25856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256992962", "group_id": "codeNet:p03651", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscn := newScanner()\n\tN := scn.nextInt()\n\tK := scn.nextInt()\n\tA := make([]int, N)\n\tmaxA := 0\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = scn.nextInt()\n\t\tmaxA = max(maxA, A[i])\n\t}\n\tflag := false\n\tfor i := 0; i < N-1; i++ {\n\t\tg := gcd(A[i], A[i+1])\n\t\tif K%g == 0 {\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag && maxA > K {\n\t\tfmt.Println(\"POSSIBLE\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\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\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\ta, b = b, a%b\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, 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) 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}\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": 1507339493, "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/s256992962.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s256992962", "user_id": "u696272993"}, "prompt_components": {"gold_output": "POSSIBLE\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\tscn := newScanner()\n\tN := scn.nextInt()\n\tK := scn.nextInt()\n\tA := make([]int, N)\n\tmaxA := 0\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = scn.nextInt()\n\t\tmaxA = max(maxA, A[i])\n\t}\n\tflag := false\n\tfor i := 0; i < N-1; i++ {\n\t\tg := gcd(A[i], A[i+1])\n\t\tif K%g == 0 {\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag && maxA > K {\n\t\tfmt.Println(\"POSSIBLE\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\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\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\ta, b = b, a%b\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, 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) 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}\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 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1529, "cpu_time_ms": 47, "memory_kb": 6528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s405661992", "group_id": "codeNet:p03658", "input_text": "package main \n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main () {\n var n, k, l, an int\n f := []int{}\n fmt.Scan(&n,&k)\n for i := 0 ; i < n ; i++ {\n fmt.Scan(&l)\n f = append (f, l)\n }\n sort.Sort(sort.IntSlice(f))\n sort.Sort(sort.Reverse(sort.IntSlice(f)))\n for i := 0 ; i < k ; i++{\n an += f[i]\n }\n fmt.Println(an)\n}\n", "language": "Go", "metadata": {"date": 1544578352, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03658.html", "problem_id": "p03658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03658/input.txt", "sample_output_relpath": "derived/input_output/data/p03658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03658/Go/s405661992.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s405661992", "user_id": "u545203108"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main \n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main () {\n var n, k, l, an int\n f := []int{}\n fmt.Scan(&n,&k)\n for i := 0 ; i < n ; i++ {\n fmt.Scan(&l)\n f = append (f, l)\n }\n sort.Sort(sort.IntSlice(f))\n sort.Sort(sort.Reverse(sort.IntSlice(f)))\n for i := 0 ; i < k ; i++{\n an += f[i]\n }\n fmt.Println(an)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "sample_input": "5 3\n1 2 3 4 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03658", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N sticks.\nThe length of the i-th stick is l_i.\n\nSnuke is making a snake toy by joining K of the sticks together.\n\nThe length of the toy is represented by the sum of the individual sticks that compose it.\nFind the maximum possible length of the toy.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 50\n\n1 \\leq l_i \\leq 50\n\nl_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nl_1 l_2 l_3 ... l_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2 3 4 5\n\nSample Output 1\n\n12\n\nYou can make a toy of length 12 by joining the sticks of lengths 3, 4 and 5, which is the maximum possible length.\n\nSample Input 2\n\n15 14\n50 26 27 21 41 7 42 35 7 5 5 36 39 1 45\n\nSample Output 2\n\n386", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 443, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s746954802", "group_id": "codeNet:p03665", "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 PrimeFactorsMap(n int) map[int]int {\n\tpfs := map[int]int{}\n\t// Get the number of 2s that divide 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\t//pfs = 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\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\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\tif _, ok := pfs[n]; ok {\n\t\t\tpfs[n]++\n\t\t} else {\n\t\t\tpfs[n] = 1\n\t\t}\n\t}\n\n\treturn pfs\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\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(x, y int) int {\n\n\treturn x * y / gcd(x, y)\n\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\tN, P := nextInt(), nextInt()\n\todd := 0\n\teven := 0\n\tfor i := 0; i < N; i++ {\n\t\tA := nextInt()\n\t\tif A%2 == 0 {\n\t\t\teven++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tcnb := make([]int, maxInt(odd+1, 2))\n\tcnb[0] = 1\n\tcnb[1] = odd\n\tfor i := 2; i <= odd; i++ {\n\t\tcnb[i] = (cnb[i-1] * (odd - i + 1)) / i\n\t}\n\n\tif P == 0 {\n\t\tans := 0\n\t\te := powInt(2, even)\n\t\tfor i := 0; i <= odd; i += 2 {\n\t\t\tans += e * cnb[i]\n\t\t}\n\t\tfmt.Println(ans)\n\t} else {\n\t\tans := 0\n\t\te := powInt(2, even)\n\t\tfor i := 1; i < odd; i += 2 {\n\t\t\tans += e * cnb[i]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n\n\t//fmt.Println(cnb, len(cnb), odd, even)\n\n}\n", "language": "Go", "metadata": {"date": 1594501617, "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/s746954802.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s746954802", "user_id": "u432333240"}, "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\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 PrimeFactorsMap(n int) map[int]int {\n\tpfs := map[int]int{}\n\t// Get the number of 2s that divide 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\t//pfs = 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\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\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\tif _, ok := pfs[n]; ok {\n\t\t\tpfs[n]++\n\t\t} else {\n\t\t\tpfs[n] = 1\n\t\t}\n\t}\n\n\treturn pfs\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\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(x, y int) int {\n\n\treturn x * y / gcd(x, y)\n\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\tN, P := nextInt(), nextInt()\n\todd := 0\n\teven := 0\n\tfor i := 0; i < N; i++ {\n\t\tA := nextInt()\n\t\tif A%2 == 0 {\n\t\t\teven++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tcnb := make([]int, maxInt(odd+1, 2))\n\tcnb[0] = 1\n\tcnb[1] = odd\n\tfor i := 2; i <= odd; i++ {\n\t\tcnb[i] = (cnb[i-1] * (odd - i + 1)) / i\n\t}\n\n\tif P == 0 {\n\t\tans := 0\n\t\te := powInt(2, even)\n\t\tfor i := 0; i <= odd; i += 2 {\n\t\t\tans += e * cnb[i]\n\t\t}\n\t\tfmt.Println(ans)\n\t} else {\n\t\tans := 0\n\t\te := powInt(2, even)\n\t\tfor i := 1; i < odd; i += 2 {\n\t\t\tans += e * cnb[i]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n\n\t//fmt.Println(cnb, len(cnb), odd, even)\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3617, "cpu_time_ms": 8, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s843871993", "group_id": "codeNet:p03665", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, p, a, odd, even int\n\tfmt.Scan(&n, &p)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\todd += a % 2\n\t\teven += (a % 2) ^ 1\n\t}\n\tif odd == 0 {\n\t\tfmt.Println(pow(2, even) * toInt(p == 0))\n\t} else {\n\t\tfmt.Println(pow(2, odd-1) * pow(2, even))\n\t}\n}\n\nfunc pow(a, b int) int {\n\tresult := 1\n\tfor i := 0; i < b; i++ {\n\t\tresult *= a\n\t}\n\treturn result\n}\n\nfunc toInt(ok bool) int {\n\tif ok {\n\t\treturn 1\n\t}\n\treturn 0\n}\n", "language": "Go", "metadata": {"date": 1543629936, "filename_ext": "go", "original_language": "Go (1.6)", "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/s843871993.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s843871993", "user_id": "u323680411"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, p, a, odd, even int\n\tfmt.Scan(&n, &p)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\todd += a % 2\n\t\teven += (a % 2) ^ 1\n\t}\n\tif odd == 0 {\n\t\tfmt.Println(pow(2, even) * toInt(p == 0))\n\t} else {\n\t\tfmt.Println(pow(2, odd-1) * pow(2, even))\n\t}\n}\n\nfunc pow(a, b int) int {\n\tresult := 1\n\tfor i := 0; i < b; i++ {\n\t\tresult *= a\n\t}\n\treturn result\n}\n\nfunc toInt(ok bool) int {\n\tif ok {\n\t\treturn 1\n\t}\n\treturn 0\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250427859", "group_id": "codeNet:p03671", "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)\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 := []int{}\n\tvar max = 0\n\tvar sum = 0\n\tfor i := 0; i < 3; i++ {\n\t\tx = append(x, nextInt())\n\t\tsum += x[i]\n\t\tif (x[i] > max) {\n\t\t\tmax = x[i]\n\t\t}\n\t}\n\tfmt.Println(sum - max)\n}", "language": "Go", "metadata": {"date": 1503063219, "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/s250427859.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s250427859", "user_id": "u848516734"}, "prompt_components": {"gold_output": "1300\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)\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 := []int{}\n\tvar max = 0\n\tvar sum = 0\n\tfor i := 0; i < 3; i++ {\n\t\tx = append(x, nextInt())\n\t\tsum += x[i]\n\t\tif (x[i] > max) {\n\t\t\tmax = x[i]\n\t\t}\n\t}\n\tfmt.Println(sum - max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s650497145", "group_id": "codeNet:p03672", "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\n// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}\n// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}\n\n// var dx = [...]int{0, 1, 0, -1}\n// var dy = [...]int{1, 0, -1, 0}\n\nvar inf int = 1e13\nvar mod = 1000000007\n\n// ---------------------------------------------------------\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnext := newScanner()\n\ts := next.next()\n\tans := 0\n\tfor i := len(s); i >= 0; i-- {\n\t\tif check(s[:i]) {\n\t\t\tans = len(s[:i]) / 2\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc check(s string) bool {\n\tif len(s)%2 != 0 {\n\t\treturn false\n\t}\n\tfor i := 0; i >= len(s)/2; i++ {\n\t\tif s[i] != s[len(s)-i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// ---------------------------------------------------------\n\n// Pair is liked C++ pair\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\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// -------------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\n\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\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\nfunc sum(a ...int) int {\n\tr := a[0]\n\tif len(a) > 1 {\n\t\tfor i := 1; i < len(a); i++ {\n\t\t\tr += a[i]\n\t\t}\n\t}\n\treturn r\n}\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}\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// ---------- 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) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\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\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": 1508711251, "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/s650497145.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s650497145", "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\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}\n// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}\n\n// var dx = [...]int{0, 1, 0, -1}\n// var dy = [...]int{1, 0, -1, 0}\n\nvar inf int = 1e13\nvar mod = 1000000007\n\n// ---------------------------------------------------------\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnext := newScanner()\n\ts := next.next()\n\tans := 0\n\tfor i := len(s); i >= 0; i-- {\n\t\tif check(s[:i]) {\n\t\t\tans = len(s[:i]) / 2\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc check(s string) bool {\n\tif len(s)%2 != 0 {\n\t\treturn false\n\t}\n\tfor i := 0; i >= len(s)/2; i++ {\n\t\tif s[i] != s[len(s)-i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// ---------------------------------------------------------\n\n// Pair is liked C++ pair\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\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// -------------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\n\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\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\nfunc sum(a ...int) int {\n\tr := a[0]\n\tif len(a) > 1 {\n\t\tfor i := 1; i < len(a); i++ {\n\t\t\tr += a[i]\n\t\t}\n\t}\n\treturn r\n}\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}\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// ---------- 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) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\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\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2898, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s847134539", "group_id": "codeNet:p03673", "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\tsc.Scan()\n\tns := sc.Text()\n\tsc.Scan()\n\tline := strings.Split(sc.Text(), \" \")\n\tn, _ := strconv.Atoi(ns)\n\tad := n % 2\n\tl, r := make([]string, n / 2), make([]string, (n / 2) + ad)\n\tfor i, v := range line {\n\t\tif i % 2 == 0 {\n\t\t\tr[i / 2] = v\n\t\t} else {\n\t\t\tl[i / 2] = v\n\t\t}\n\t}\n\tif n % 2 == 0 {\n\t\tfor i := len(l) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(l[i])\n\t\t\tif i != 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < len(r); i++ {\n\t\t\tfmt.Print(\" \")\n\t\t\tfmt.Print(r[i])\n\t\t}\n\t} else {\n\t\tfor i := len(r) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(r[i])\n\t\t\tif i != 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < len(l); i++ {\n\t\t\tfmt.Print(\" \")\n\t\t\tfmt.Print(l[i])\n\t\t}\n\t}\n\tfmt.Println()\n}", "language": "Go", "metadata": {"date": 1556830874, "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/s847134539.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s847134539", "user_id": "u857510905"}, "prompt_components": {"gold_output": "4 2 1 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 main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tns := sc.Text()\n\tsc.Scan()\n\tline := strings.Split(sc.Text(), \" \")\n\tn, _ := strconv.Atoi(ns)\n\tad := n % 2\n\tl, r := make([]string, n / 2), make([]string, (n / 2) + ad)\n\tfor i, v := range line {\n\t\tif i % 2 == 0 {\n\t\t\tr[i / 2] = v\n\t\t} else {\n\t\t\tl[i / 2] = v\n\t\t}\n\t}\n\tif n % 2 == 0 {\n\t\tfor i := len(l) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(l[i])\n\t\t\tif i != 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < len(r); i++ {\n\t\t\tfmt.Print(\" \")\n\t\t\tfmt.Print(r[i])\n\t\t}\n\t} else {\n\t\tfor i := len(r) - 1; i >= 0; i-- {\n\t\t\tfmt.Print(r[i])\n\t\t\tif i != 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < len(l); i++ {\n\t\t\tfmt.Print(\" \")\n\t\t\tfmt.Print(l[i])\n\t\t}\n\t}\n\tfmt.Println()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 780, "cpu_time_ms": 557, "memory_kb": 6400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s891239408", "group_id": "codeNet:p03674", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"fmt\"\n)\n\nconst MOD = 1000000007\n\n/* input */\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n return n\n}\n\n/* fact */\nfunc fact(x int, factMem map[int]int) int {\n if x == 0 {\n return 1\n }\n value, ok := factMem[x]\n if ok {\n return value\n }\n factMem[x] = x * fact(x - 1, factMem) % MOD\n return factMem[x]\n}\n\n/* inverse */\nfunc inverse(x int, factMem map[int]int, inverseMem map[int]int) int {\n value, ok := inverseMem[x]\n if ok {\n return value\n }\n inverseMem[x] = power(fact(x, factMem), MOD - 2, MOD)\n return inverseMem[x]\n}\n\n/* power */\nfunc power(x, y, z int) int {\n if y == 0 {\n return 1\n }\n if y % 2 == 0 {\n return power(x * x % z, y / 2, z)\n } else {\n return x * power(x, y - 1, z) % z\n }\n return 0\n}\n\n/* comb */\nfunc comb(x int, y int, factMem map[int]int, inverseMem map[int]int) int {\n if x < y || y < 0 {\n return 0\n }\n return fact(x, factMem) * inverse(y, factMem, inverseMem) % MOD * inverse(x - y, factMem, inverseMem) % MOD\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := readInt()\n dic := make(map[int]int)\n left, right := 0, 0\n for i := 0; i < n + 1; i++ {\n a := readInt()\n index, ok := dic[a]\n if ok {\n left = index\n right = i\n break\n } else {\n dic[a] = i\n }\n\n }\n\n rem := n - right + left\n factMem := make(map[int]int)\n inverseMem := make(map[int]int)\n for i := 0; i < n + 1; i++ {\n fact(i, factMem)\n }\n wrt := bufio.NewWriter(os.Stdout)\n for i := 0; i < n + 1; i++ {\n fmt.Fprintln(wrt, (MOD + comb(n + 1, i + 1, factMem, inverseMem) - comb(rem, i, factMem, inverseMem)) % MOD)\n wrt.Flush()\n }\n}", "language": "Go", "metadata": {"date": 1548572425, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03674.html", "problem_id": "p03674", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03674/input.txt", "sample_output_relpath": "derived/input_output/data/p03674/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03674/Go/s891239408.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s891239408", "user_id": "u145035045"}, "prompt_components": {"gold_output": "3\n5\n4\n1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"fmt\"\n)\n\nconst MOD = 1000000007\n\n/* input */\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n return n\n}\n\n/* fact */\nfunc fact(x int, factMem map[int]int) int {\n if x == 0 {\n return 1\n }\n value, ok := factMem[x]\n if ok {\n return value\n }\n factMem[x] = x * fact(x - 1, factMem) % MOD\n return factMem[x]\n}\n\n/* inverse */\nfunc inverse(x int, factMem map[int]int, inverseMem map[int]int) int {\n value, ok := inverseMem[x]\n if ok {\n return value\n }\n inverseMem[x] = power(fact(x, factMem), MOD - 2, MOD)\n return inverseMem[x]\n}\n\n/* power */\nfunc power(x, y, z int) int {\n if y == 0 {\n return 1\n }\n if y % 2 == 0 {\n return power(x * x % z, y / 2, z)\n } else {\n return x * power(x, y - 1, z) % z\n }\n return 0\n}\n\n/* comb */\nfunc comb(x int, y int, factMem map[int]int, inverseMem map[int]int) int {\n if x < y || y < 0 {\n return 0\n }\n return fact(x, factMem) * inverse(y, factMem, inverseMem) % MOD * inverse(x - y, factMem, inverseMem) % MOD\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := readInt()\n dic := make(map[int]int)\n left, right := 0, 0\n for i := 0; i < n + 1; i++ {\n a := readInt()\n index, ok := dic[a]\n if ok {\n left = index\n right = i\n break\n } else {\n dic[a] = i\n }\n\n }\n\n rem := n - right + left\n factMem := make(map[int]int)\n inverseMem := make(map[int]int)\n for i := 0; i < n + 1; i++ {\n fact(i, factMem)\n }\n wrt := bufio.NewWriter(os.Stdout)\n for i := 0; i < n + 1; i++ {\n fmt.Fprintln(wrt, (MOD + comb(n + 1, i + 1, factMem, inverseMem) - comb(rem, i, factMem, inverseMem)) % MOD)\n wrt.Flush()\n }\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given an integer sequence of length n+1, a_1,a_2,...,a_{n+1}, which consists of the n integers 1,...,n.\nIt is known that each of the n integers 1,...,n appears at least once in this sequence.\n\nFor each integer k=1,...,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 10^9+7.\n\nNotes\n\nIf the contents of two subsequences are the same, they are not separately counted even if they originate from different positions in the original sequence.\n\nA subsequence of a sequence a with length k is a sequence obtained by selecting k of the elements of a and arranging them without changing their relative order. For example, the sequences 1,3,5 and 1,2,3 are subsequences of 1,2,3,4,5, while 3,1,2 and 1,10,100 are not.\n\nConstraints\n\n1 \\leq n \\leq 10^5\n\n1 \\leq a_i \\leq n\n\nEach of the integers 1,...,n appears in the sequence.\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+1}\n\nOutput\n\nPrint n+1 lines.\nThe k-th line should contain the number of the different subsequences of the given sequence with length k, modulo 10^9+7.\n\nSample Input 1\n\n3\n1 2 1 3\n\nSample Output 1\n\n3\n5\n4\n1\n\nThere are three subsequences with length 1: 1 and 2 and 3.\n\nThere are five subsequences with length 2: 1,1 and 1,2 and 1,3 and 2,1 and 2,3.\n\nThere are four subsequences with length 3: 1,1,3 and 1,2,1 and 1,2,3 and 2,1,3.\n\nThere is one subsequence with length 4: 1,2,1,3.\n\nSample Input 2\n\n1\n1 1\n\nSample Output 2\n\n1\n1\n\nThere is one subsequence with length 1: 1.\n\nThere is one subsequence with length 2: 1,1.\n\nSample Input 3\n\n32\n29 19 7 10 26 32 27 4 11 20 2 8 16 23 5 14 6 12 17 22 18 30 28 24 15 1 25 3 13 21 19 31 9\n\nSample Output 3\n\n32\n525\n5453\n40919\n237336\n1107568\n4272048\n13884156\n38567100\n92561040\n193536720\n354817320\n573166440\n818809200\n37158313\n166803103\n166803103\n37158313\n818809200\n573166440\n354817320\n193536720\n92561040\n38567100\n13884156\n4272048\n1107568\n237336\n40920\n5456\n528\n33\n1\n\nBe sure to print the numbers modulo 10^9+7.", "sample_input": "3\n1 2 1 3\n"}, "reference_outputs": ["3\n5\n4\n1\n"], "source_document_id": "p03674", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given an integer sequence of length n+1, a_1,a_2,...,a_{n+1}, which consists of the n integers 1,...,n.\nIt is known that each of the n integers 1,...,n appears at least once in this sequence.\n\nFor each integer k=1,...,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with length k, modulo 10^9+7.\n\nNotes\n\nIf the contents of two subsequences are the same, they are not separately counted even if they originate from different positions in the original sequence.\n\nA subsequence of a sequence a with length k is a sequence obtained by selecting k of the elements of a and arranging them without changing their relative order. For example, the sequences 1,3,5 and 1,2,3 are subsequences of 1,2,3,4,5, while 3,1,2 and 1,10,100 are not.\n\nConstraints\n\n1 \\leq n \\leq 10^5\n\n1 \\leq a_i \\leq n\n\nEach of the integers 1,...,n appears in the sequence.\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+1}\n\nOutput\n\nPrint n+1 lines.\nThe k-th line should contain the number of the different subsequences of the given sequence with length k, modulo 10^9+7.\n\nSample Input 1\n\n3\n1 2 1 3\n\nSample Output 1\n\n3\n5\n4\n1\n\nThere are three subsequences with length 1: 1 and 2 and 3.\n\nThere are five subsequences with length 2: 1,1 and 1,2 and 1,3 and 2,1 and 2,3.\n\nThere are four subsequences with length 3: 1,1,3 and 1,2,1 and 1,2,3 and 2,1,3.\n\nThere is one subsequence with length 4: 1,2,1,3.\n\nSample Input 2\n\n1\n1 1\n\nSample Output 2\n\n1\n1\n\nThere is one subsequence with length 1: 1.\n\nThere is one subsequence with length 2: 1,1.\n\nSample Input 3\n\n32\n29 19 7 10 26 32 27 4 11 20 2 8 16 23 5 14 6 12 17 22 18 30 28 24 15 1 25 3 13 21 19 31 9\n\nSample Output 3\n\n32\n525\n5453\n40919\n237336\n1107568\n4272048\n13884156\n38567100\n92561040\n193536720\n354817320\n573166440\n818809200\n37158313\n166803103\n166803103\n37158313\n818809200\n573166440\n354817320\n193536720\n92561040\n38567100\n13884156\n4272048\n1107568\n237336\n40920\n5456\n528\n33\n1\n\nBe sure to print the numbers modulo 10^9+7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1889, "cpu_time_ms": 404, "memory_kb": 14976}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s679621417", "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 A-B >= 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": 1498352868, "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/s679621417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s679621417", "user_id": "u696272993"}, "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 A-B >= 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s304287083", "group_id": "codeNet:p03681", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif AbsDiff(n, m) > 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif n != m {\n\t\tfmt.Println(Factorial(n) * Factorial(m) % Mod)\n\t} else {\n\t\tfmt.Println(Factorial(n) * Factorial(m) * 2 % Mod)\n\t}\n}\n\nconst Mod = 1000000007\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 Factorial(n int) int {\n\tif n == 0 {\n\t\treturn 0\n\t}\n\tnum := 1\n\tfor i := 2; i <= n; i++ {\n\t\tnum = num * i % Mod\n\t}\n\treturn num\n}\n\nfunc AbsDiff(n1 int, n2 int) int {\n\treturn int(math.Abs(float64(n1 - n2)))\n}\n", "language": "Go", "metadata": {"date": 1595808445, "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/s304287083.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304287083", "user_id": "u717943620"}, "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, m int\n\tfmt.Scan(&n, &m)\n\tif AbsDiff(n, m) > 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif n != m {\n\t\tfmt.Println(Factorial(n) * Factorial(m) % Mod)\n\t} else {\n\t\tfmt.Println(Factorial(n) * Factorial(m) * 2 % Mod)\n\t}\n}\n\nconst Mod = 1000000007\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 Factorial(n int) int {\n\tif n == 0 {\n\t\treturn 0\n\t}\n\tnum := 1\n\tfor i := 2; i <= n; i++ {\n\t\tnum = num * i % Mod\n\t}\n\treturn num\n}\n\nfunc AbsDiff(n1 int, n2 int) int {\n\treturn int(math.Abs(float64(n1 - n2)))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 632, "cpu_time_ms": 2, "memory_kb": 1836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s058976811", "group_id": "codeNet:p03681", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nconst MOD = int64(1e9 + 7)\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scan(&n, &m)\n\n\tif math.Abs(float64(n-m)) > 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := (fac(n) * fac(m)) % MOD\n\tif n == m {\n\t\tans = (ans * 2) % MOD\n\t}\n\tfmt.Println(ans)\n}\n\nfunc fac(num int64) int64 {\n\tif num == 1 {\n\t\treturn 1\n\t}\n\treturn (num * fac(num-1)) % MOD\n}\n", "language": "Go", "metadata": {"date": 1589073380, "filename_ext": "go", "original_language": "Go (1.6)", "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/s058976811.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058976811", "user_id": "u290750807"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nconst MOD = int64(1e9 + 7)\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scan(&n, &m)\n\n\tif math.Abs(float64(n-m)) > 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := (fac(n) * fac(m)) % MOD\n\tif n == m {\n\t\tans = (ans * 2) % MOD\n\t}\n\tfmt.Println(ans)\n}\n\nfunc fac(num int64) int64 {\n\tif num == 1 {\n\t\treturn 1\n\t}\n\treturn (num * fac(num-1)) % MOD\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 365, "cpu_time_ms": 33, "memory_kb": 7040}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s462737713", "group_id": "codeNet:p03688", "input_text": "package main\n\nimport (\n\t\"strconv\"\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n);\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tmin, max := n, 0\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ta[i], _ = strconv.Atoi(scanner.Text())\n\t\tif a[i] < min {\n\t\t\tmin = a[i]\n\t\t}\n\t\tif a[i] > max {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\t\n\tif max - min == 0 {\n\t\tif max == n - 1 || 2 * max <= n {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if max - min == 1 {\n\t\tk := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i] == max - 1 {\n\t\t\t\tk++\n\t\t\t}\n\t\t}\n\t\tif max > k && 2 * (max - k) <= n - k {\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": 1543030474, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03688.html", "problem_id": "p03688", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03688/input.txt", "sample_output_relpath": "derived/input_output/data/p03688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03688/Go/s462737713.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s462737713", "user_id": "u253759478"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"strconv\"\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n);\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tmin, max := n, 0\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ta[i], _ = strconv.Atoi(scanner.Text())\n\t\tif a[i] < min {\n\t\t\tmin = a[i]\n\t\t}\n\t\tif a[i] > max {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\t\n\tif max - min == 0 {\n\t\tif max == n - 1 || 2 * max <= n {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t} else if max - min == 1 {\n\t\tk := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i] == max - 1 {\n\t\t\t\tk++\n\t\t\t}\n\t\t}\n\t\tif max > k && 2 * (max - k) <= n - k {\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 : 700 points\n\nProblem Statement\n\nThere are N cats.\nWe number them from 1 through N.\n\nEach of the cats wears a hat.\nCat i says: \"there are exactly a_i different colors among the N - 1 hats worn by the cats except me.\"\n\nDetermine whether there exists a sequence of colors of the hats that is consistent with the remarks of the cats.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N-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\nPrint Yes if there exists a sequence of colors of the hats that is consistent with the remarks of the cats; print No otherwise.\n\nSample Input 1\n\n3\n1 2 2\n\nSample Output 1\n\nYes\n\nFor example, if cat 1, 2 and 3 wears red, blue and blue hats, respectively, it is consistent with the remarks of the cats.\n\nSample Input 2\n\n3\n1 1 2\n\nSample Output 2\n\nNo\n\nFrom the remark of cat 1, we can see that cat 2 and 3 wear hats of the same color.\nAlso, from the remark of cat 2, we can see that cat 1 and 3 wear hats of the same color.\nTherefore, cat 1 and 2 wear hats of the same color, which contradicts the remark of cat 3.\n\nSample Input 3\n\n5\n4 3 4 3 4\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\n2 2 2\n\nSample Output 4\n\nYes\n\nSample Input 5\n\n4\n2 2 2 2\n\nSample Output 5\n\nYes\n\nSample Input 6\n\n5\n3 3 3 3 3\n\nSample Output 6\n\nNo", "sample_input": "3\n1 2 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03688", "source_text": "Score : 700 points\n\nProblem Statement\n\nThere are N cats.\nWe number them from 1 through N.\n\nEach of the cats wears a hat.\nCat i says: \"there are exactly a_i different colors among the N - 1 hats worn by the cats except me.\"\n\nDetermine whether there exists a sequence of colors of the hats that is consistent with the remarks of the cats.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\n1 ≤ a_i ≤ N-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\nPrint Yes if there exists a sequence of colors of the hats that is consistent with the remarks of the cats; print No otherwise.\n\nSample Input 1\n\n3\n1 2 2\n\nSample Output 1\n\nYes\n\nFor example, if cat 1, 2 and 3 wears red, blue and blue hats, respectively, it is consistent with the remarks of the cats.\n\nSample Input 2\n\n3\n1 1 2\n\nSample Output 2\n\nNo\n\nFrom the remark of cat 1, we can see that cat 2 and 3 wear hats of the same color.\nAlso, from the remark of cat 2, we can see that cat 1 and 3 wear hats of the same color.\nTherefore, cat 1 and 2 wear hats of the same color, which contradicts the remark of cat 3.\n\nSample Input 3\n\n5\n4 3 4 3 4\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\n2 2 2\n\nSample Output 4\n\nYes\n\nSample Input 5\n\n4\n2 2 2 2\n\nSample Output 5\n\nYes\n\nSample Input 6\n\n5\n3 3 3 3 3\n\nSample Output 6\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 724, "cpu_time_ms": 19, "memory_kb": 1920}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s099834283", "group_id": "codeNet:p03690", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype IOTp struct {\n\tiBuffer []byte\n\tiPos int\n}\nfunc (this *IOTp) GetChar() byte {\n\tres:=this.iBuffer[this.iPos]\n\tthis.iPos++\n\treturn res\n}\nfunc (this *IOTp) ReadInt() int {\n\tres:=0\n\tk:=1\n\tfor ch:=this.iBuffer[this.iPos]; !(ch>='0' && ch<='9'); ch=this.iBuffer[this.iPos]{\n\t\tif ch=='-' {\n\t\t\tk=-1\n\t\t}\n\t\tthis.iPos++\n\t}\n\tfor ch:=this.iBuffer[this.iPos]; ch>='0' && ch<='9'; ch=this.iBuffer[this.iPos]{\n\t\tres=res*10+int(ch-'0')\n\t\tthis.iPos++\n\t}\n\tres*=k\n\treturn res\n}\nfunc NewIOTp() *IOTp {\n\tnow:=new(IOTp)\n\t//inputFile,_:=os.Open(\"in.txt\")\n\tinputFile:=os.Stdin\n\tnow.iBuffer,_=ioutil.ReadAll(inputFile)\n\tnow.iBuffer=append(now.iBuffer, '\\n')\n\tnow.iPos=0\n\treturn now\n}\nvar cin *bufio.Reader\nvar cout *bufio.Writer\nconst MAXN=100000\nfunc main() {\n\tIO:=NewIOTp()\n\tcout=bufio.NewWriter(os.Stdout)\n\tn:=IO.ReadInt()\n\tvar a,b [MAXN+10]int\n\tfor i:=1; i<=n; i++ {\n\t\ta[i]=IO.ReadInt()\n\t}\n\tfor i:=1; i<=n; i++ {\n\t\tb[i]=IO.ReadInt()\n\t}\n\tfor _,v:=range a[1:n+1] {\n\t\ta[n+1]^=v\n\t}\n\tfor _,v:=range b[1:n+1] {\n\t\tb[n+1]^=v\n\t}\n\tm:=make(map[int]int)\n\tfor _,v:=range a[1:n+2] {\n\t\tm[v]++\n\t}\n\tfor _,v:=range b[1:n+2] {\n\t\tm[v]--\n\t}\n\tfor _,v:=range m {\n\t\tif v!=0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn;\n\t\t}\n\t}\n\tans:=0\n\tflag:=true\n\tfor i:=range a[1:n+2] {\n\t\tif a[i]!=b[i] {\n\t\t\tif b[i]==a[n+1] {\n\t\t\t\tflag=false\n\t\t\t}\n\t\t\tans++\n\t\t}\n\t}\n\tif a[n+1]==b[n+1] && ans!=0 && flag {\n\t\tans++\n\t}\n\tfmt.Println(ans)\n\tcout.Flush()\n}\n", "language": "Go", "metadata": {"date": 1536178062, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03690.html", "problem_id": "p03690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03690/input.txt", "sample_output_relpath": "derived/input_output/data/p03690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03690/Go/s099834283.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s099834283", "user_id": "u275407061"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype IOTp struct {\n\tiBuffer []byte\n\tiPos int\n}\nfunc (this *IOTp) GetChar() byte {\n\tres:=this.iBuffer[this.iPos]\n\tthis.iPos++\n\treturn res\n}\nfunc (this *IOTp) ReadInt() int {\n\tres:=0\n\tk:=1\n\tfor ch:=this.iBuffer[this.iPos]; !(ch>='0' && ch<='9'); ch=this.iBuffer[this.iPos]{\n\t\tif ch=='-' {\n\t\t\tk=-1\n\t\t}\n\t\tthis.iPos++\n\t}\n\tfor ch:=this.iBuffer[this.iPos]; ch>='0' && ch<='9'; ch=this.iBuffer[this.iPos]{\n\t\tres=res*10+int(ch-'0')\n\t\tthis.iPos++\n\t}\n\tres*=k\n\treturn res\n}\nfunc NewIOTp() *IOTp {\n\tnow:=new(IOTp)\n\t//inputFile,_:=os.Open(\"in.txt\")\n\tinputFile:=os.Stdin\n\tnow.iBuffer,_=ioutil.ReadAll(inputFile)\n\tnow.iBuffer=append(now.iBuffer, '\\n')\n\tnow.iPos=0\n\treturn now\n}\nvar cin *bufio.Reader\nvar cout *bufio.Writer\nconst MAXN=100000\nfunc main() {\n\tIO:=NewIOTp()\n\tcout=bufio.NewWriter(os.Stdout)\n\tn:=IO.ReadInt()\n\tvar a,b [MAXN+10]int\n\tfor i:=1; i<=n; i++ {\n\t\ta[i]=IO.ReadInt()\n\t}\n\tfor i:=1; i<=n; i++ {\n\t\tb[i]=IO.ReadInt()\n\t}\n\tfor _,v:=range a[1:n+1] {\n\t\ta[n+1]^=v\n\t}\n\tfor _,v:=range b[1:n+1] {\n\t\tb[n+1]^=v\n\t}\n\tm:=make(map[int]int)\n\tfor _,v:=range a[1:n+2] {\n\t\tm[v]++\n\t}\n\tfor _,v:=range b[1:n+2] {\n\t\tm[v]--\n\t}\n\tfor _,v:=range m {\n\t\tif v!=0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn;\n\t\t}\n\t}\n\tans:=0\n\tflag:=true\n\tfor i:=range a[1:n+2] {\n\t\tif a[i]!=b[i] {\n\t\t\tif b[i]==a[n+1] {\n\t\t\t\tflag=false\n\t\t\t}\n\t\t\tans++\n\t\t}\n\t}\n\tif a[n+1]==b[n+1] && ans!=0 && flag {\n\t\tans++\n\t}\n\tfmt.Println(ans)\n\tcout.Flush()\n}\n", "problem_context": "Score : 1000 points\n\nProblem Statement\n\nThere is a sequence of length N: a = (a_1, a_2, ..., a_N).\nHere, each a_i is a non-negative integer.\n\nSnuke can repeatedly perform the following operation:\n\nLet the XOR of all the elements in a be x. Select an integer i (1 ≤ i ≤ N) and replace a_i with x.\n\nSnuke's objective is to match a with another sequence b = (b_1, b_2, ..., b_N).\nHere, each b_i is a non-negative integer.\n\nDetermine whether the objective is achievable, and find the minimum necessary number of operations if the answer is positive.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i and b_i are integers.\n\n0 ≤ a_i, b_i < 2^{30}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\nb_1 b_2 ... b_N\n\nOutput\n\nIf the objective is achievable, print the minimum necessary number of operations.\nOtherwise, print -1 instead.\n\nSample Input 1\n\n3\n0 1 2\n3 1 0\n\nSample Output 1\n\n2\n\nAt first, the XOR of all the elements of a is 3.\nIf we replace a_1 with 3, a becomes (3, 1, 2).\n\nNow, the XOR of all the elements of a is 0.\nIf we replace a_3 with 0, a becomes (3, 1, 0), which matches b.\n\nSample Input 2\n\n3\n0 1 2\n0 1 2\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2\n1 1\n0 0\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n4\n0 1 2 3\n1 0 3 2\n\nSample Output 4\n\n5", "sample_input": "3\n0 1 2\n3 1 0\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03690", "source_text": "Score : 1000 points\n\nProblem Statement\n\nThere is a sequence of length N: a = (a_1, a_2, ..., a_N).\nHere, each a_i is a non-negative integer.\n\nSnuke can repeatedly perform the following operation:\n\nLet the XOR of all the elements in a be x. Select an integer i (1 ≤ i ≤ N) and replace a_i with x.\n\nSnuke's objective is to match a with another sequence b = (b_1, b_2, ..., b_N).\nHere, each b_i is a non-negative integer.\n\nDetermine whether the objective is achievable, and find the minimum necessary number of operations if the answer is positive.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i and b_i are integers.\n\n0 ≤ a_i, b_i < 2^{30}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\nb_1 b_2 ... b_N\n\nOutput\n\nIf the objective is achievable, print the minimum necessary number of operations.\nOtherwise, print -1 instead.\n\nSample Input 1\n\n3\n0 1 2\n3 1 0\n\nSample Output 1\n\n2\n\nAt first, the XOR of all the elements of a is 3.\nIf we replace a_1 with 3, a becomes (3, 1, 2).\n\nNow, the XOR of all the elements of a is 0.\nIf we replace a_3 with 0, a becomes (3, 1, 0), which matches b.\n\nSample Input 2\n\n3\n0 1 2\n0 1 2\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2\n1 1\n0 0\n\nSample Output 3\n\n-1\n\nSample Input 4\n\n4\n0 1 2 3\n1 0 3 2\n\nSample Output 4\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1436, "cpu_time_ms": 42, "memory_kb": 10496}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s713685640", "group_id": "codeNet:p03694", "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\tn := iScan()\n\ta := iSScan(n)\n\tfmt.Println(max(a) - min(a))\n}\n", "language": "Go", "metadata": {"date": 1594497671, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s713685640.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s713685640", "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\"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\tn := iScan()\n\ta := iSScan(n)\n\tfmt.Println(max(a) - min(a))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1265, "cpu_time_ms": 2, "memory_kb": 1776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s814681841", "group_id": "codeNet:p03694", "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 nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\tn := nextInt()\n\tmx := math.MinInt32\n\tmn := math.MaxInt32\n\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tmn = min(mn, a)\n\t\tmx = max(mx, a)\n\t}\n\tfmt.Println(mx - mn)\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\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": 1541254229, "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/s814681841.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s814681841", "user_id": "u323680411"}, "prompt_components": {"gold_output": "7\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 nextString func() string\n\nfunc init() {\n\tnextString = newReadString(os.Stdin)\n}\n\nfunc main() {\n\tn := nextInt()\n\tmx := math.MinInt32\n\tmn := math.MaxInt32\n\n\tfor i := 0; i < n; i++ {\n\t\ta := nextInt()\n\t\tmn = min(mn, a)\n\t\tmx = max(mx, a)\n\t}\n\tfmt.Println(mx - mn)\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\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 762, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s148921547", "group_id": "codeNet:p03698", "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\tS := readString()\n\tm := map[string]int64{}\n\tfor i := 0; i < len(S); i++ {\n\t\tm[string(S[i])]++\n\t}\n\tfor _, v := range m {\n\t\tif v > 1 {\n\t\t\tfmt.Println(\"no\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"yes\")\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": 1587662789, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03698.html", "problem_id": "p03698", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03698/input.txt", "sample_output_relpath": "derived/input_output/data/p03698/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03698/Go/s148921547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s148921547", "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\tS := readString()\n\tm := map[string]int64{}\n\tfor i := 0; i < len(S); i++ {\n\t\tm[string(S[i])]++\n\t}\n\tfor _, v := range m {\n\t\tif v > 1 {\n\t\t\tfmt.Println(\"no\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"yes\")\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\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |S| denotes the length of S.\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 all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "sample_input": "uncopyrightable\n"}, "reference_outputs": ["yes\n"], "source_document_id": "p03698", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |S| denotes the length of S.\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 all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5663, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s079891640", "group_id": "codeNet:p03698", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\ts string\n)\n\nfunc main() {\n\tfmt.Scan(&s)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif strings.Contains(s[i+1:], string(s[i])) {\n\t\t\tfmt.Println(\"no\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(\"yes\")\n}", "language": "Go", "metadata": {"date": 1521870447, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03698.html", "problem_id": "p03698", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03698/input.txt", "sample_output_relpath": "derived/input_output/data/p03698/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03698/Go/s079891640.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s079891640", "user_id": "u987869509"}, "prompt_components": {"gold_output": "yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\ts string\n)\n\nfunc main() {\n\tfmt.Scan(&s)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif strings.Contains(s[i+1:], string(s[i])) {\n\t\t\tfmt.Println(\"no\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(\"yes\")\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |S| denotes the length of S.\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 all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "sample_input": "uncopyrightable\n"}, "reference_outputs": ["yes\n"], "source_document_id": "p03698", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters. Determine whether all the characters in S are different.\n\nConstraints\n\n2 ≤ |S| ≤ 26, where |S| denotes the length of S.\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 all the characters in S are different, print yes (case-sensitive); otherwise, print no.\n\nSample Input 1\n\nuncopyrightable\n\nSample Output 1\n\nyes\n\nSample Input 2\n\ndifferent\n\nSample Output 2\n\nno\n\nSample Input 3\n\nno\n\nSample Output 3\n\nyes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s921172218", "group_id": "codeNet:p03700", "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.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\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\tn, a, b := nextInt(), nextInt(), nextInt()\n\tmonsters := make([]int, n)\n\tfor i := range monsters {\n\t\tmonsters[i] = nextInt()\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(monsters)))\n\n\tmax := 1000000000\n\tmin := 1\n\n\tfor max > min {\n\t\ttester := (max + min) / 2\n\t\trequire := 0\n\t\tfor _, m := range monsters {\n\t\t\tif m > b*tester {\n\t\t\t\trequire += ((m - (b * tester) - 1) / (a - b)) + 1\n\t\t\t}\n\t\t}\n\t\tswitch {\n\t\tcase tester < require:\n\t\t\tmin = tester + 1\n\t\tcase tester >= require:\n\t\t\tmax = tester\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1568325291, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03700.html", "problem_id": "p03700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03700/input.txt", "sample_output_relpath": "derived/input_output/data/p03700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03700/Go/s921172218.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s921172218", "user_id": "u712822150"}, "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.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\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\tn, a, b := nextInt(), nextInt(), nextInt()\n\tmonsters := make([]int, n)\n\tfor i := range monsters {\n\t\tmonsters[i] = nextInt()\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(monsters)))\n\n\tmax := 1000000000\n\tmin := 1\n\n\tfor max > min {\n\t\ttester := (max + min) / 2\n\t\trequire := 0\n\t\tfor _, m := range monsters {\n\t\t\tif m > b*tester {\n\t\t\t\trequire += ((m - (b * tester) - 1) / (a - b)) + 1\n\t\t\t}\n\t\t}\n\t\tswitch {\n\t\tcase tester < require:\n\t\t\tmin = tester + 1\n\t\tcase tester >= require:\n\t\t\tmax = tester\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "sample_input": "4 5 3\n8\n7\n4\n2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03700", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter N monsters. Each monster has a parameter called health, and the health of the i-th monster is h_i at the moment of encounter. A monster will vanish immediately when its health drops to 0 or below.\n\nFortunately, you are a skilled magician, capable of causing explosions that damage monsters. In one explosion, you can damage monsters as follows:\n\nSelect an alive monster, and cause an explosion centered at that monster. The health of the monster at the center of the explosion will decrease by A, and the health of each of the other monsters will decrease by B. Here, A and B are predetermined parameters, and A > B holds.\n\nAt least how many explosions do you need to cause in order to vanish all the monsters?\n\nConstraints\n\nAll input values are integers.\n\n1 ≤ N ≤ 10^5\n\n1 ≤ B < A ≤ 10^9\n\n1 ≤ h_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum number of explosions that needs to be caused in order to vanish all the monsters.\n\nSample Input 1\n\n4 5 3\n8\n7\n4\n2\n\nSample Output 1\n\n2\n\nYou can vanish all the monsters in two explosion, as follows:\n\nFirst, cause an explosion centered at the monster with 8 health. The healths of the four monsters become 3, 4, 1 and -1, respectively, and the last monster vanishes.\n\nSecond, cause an explosion centered at the monster with 4 health remaining. The healths of the three remaining monsters become 0, -1 and -2, respectively, and all the monsters are now vanished.\n\nSample Input 2\n\n2 10 4\n20\n20\n\nSample Output 2\n\n4\n\nYou need to cause two explosions centered at each monster, for a total of four.\n\nSample Input 3\n\n5 2 1\n900000000\n900000000\n1000000000\n1000000000\n1000000000\n\nSample Output 3\n\n800000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 878, "cpu_time_ms": 87, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s816414502", "group_id": "codeNet:p03713", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar H, W int\nvar ans int = 9999999999\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\n\tif H*W%3 == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\n\t\tfor i := 1 * H; i <= W*H; i = i + H {\n\t\t\tfor j := 1 * (W - i/H); i+j <= W*H; j = j + (W - i/H) {\n\t\t\t\tk := H*W - i - j\n\t\t\t\tif k <= 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\ts_max := max(i, j, k)\n\t\t\t\ts_min := min(i, j, k)\n\t\t\t\tans = min(ans, s_max-s_min)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\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\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}\n\nfunc pow(x, y int) uint64 { return uint64(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 si struct {\n\ts int\n\ti int\n}\n\ntype SortBy []si\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].s < a[j].s }\n", "language": "Go", "metadata": {"date": 1561213073, "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/s816414502.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s816414502", "user_id": "u266742706"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar H, W int\nvar ans int = 9999999999\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\n\tif H*W%3 == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\n\t\tfor i := 1 * H; i <= W*H; i = i + H {\n\t\t\tfor j := 1 * (W - i/H); i+j <= W*H; j = j + (W - i/H) {\n\t\t\t\tk := H*W - i - j\n\t\t\t\tif k <= 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\ts_max := max(i, j, k)\n\t\t\t\ts_min := min(i, j, k)\n\t\t\t\tans = min(ans, s_max-s_min)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\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\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}\n\nfunc pow(x, y int) uint64 { return uint64(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 si struct {\n\ts int\n\ti int\n}\n\ntype SortBy []si\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].s < a[j].s }\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1506, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s055819842", "group_id": "codeNet:p03713", "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 h, w int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\th, w = tmp[0], tmp[1]\n\n\tanswer := -1\n\n\t// 2方向に切るパターン\n\tfor i := 1; i < w; i++ {\n\t\trec1 := i * h\n\t\trec2 := (w - i) * (h / 2)\n\t\trec3 := (w - i) * (h - h/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\trec1 := i * w\n\t\trec2 := (h - i) * (w / 2)\n\t\trec3 := (h - i) * (w - w/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\t// 1方向に2回切るパターン\n\tfor i := 1; i < w; i++ {\n\t\trec1 := h * i\n\t\tww := w - i\n\t\trec2 := h * (ww / 2)\n\t\trec3 := h * (ww - ww/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\trec1 := w * i\n\t\thh := h - i\n\t\trec2 := w * (hh / 2)\n\t\trec3 := w * (hh - hh/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfmt.Println(answer)\n}\n", "language": "Go", "metadata": {"date": 1541371024, "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/s055819842.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s055819842", "user_id": "u103600314"}, "prompt_components": {"gold_output": "0\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 h, w int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\th, w = tmp[0], tmp[1]\n\n\tanswer := -1\n\n\t// 2方向に切るパターン\n\tfor i := 1; i < w; i++ {\n\t\trec1 := i * h\n\t\trec2 := (w - i) * (h / 2)\n\t\trec3 := (w - i) * (h - h/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\trec1 := i * w\n\t\trec2 := (h - i) * (w / 2)\n\t\trec3 := (h - i) * (w - w/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\t// 1方向に2回切るパターン\n\tfor i := 1; i < w; i++ {\n\t\trec1 := h * i\n\t\tww := w - i\n\t\trec2 := h * (ww / 2)\n\t\trec3 := h * (ww - ww/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfor i := 1; i < h; i++ {\n\t\trec1 := w * i\n\t\thh := h - i\n\t\trec2 := w * (hh / 2)\n\t\trec3 := w * (hh - hh/2)\n\t\tdiff := Max(rec1, rec2, rec3) - Min(rec1, rec2, rec3)\n\t\tif diff < answer || answer == -1 {\n\t\t\tanswer = diff\n\t\t}\n\t}\n\tfmt.Println(answer)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5585, "cpu_time_ms": 10, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s964391924", "group_id": "codeNet:p03715", "input_text": "package main\n\nimport \"fmt\"\n\nconst max = 10000000000\n\nconst (\n\tDirectionNone = int64(iota)\n\tDirectionRight\n\tDirectionLeft\n)\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 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, direction int64) int64 {\n\tleft, rightUp, rightDown := calcLeft(x), calcRightUp(x), calcRightDown(x)\n\n\tif direction == DirectionNone {\n\t\tif left < rightDown {\n\t\t\tdirection = DirectionRight\n\t\t} else {\n\t\t\tdirection = DirectionLeft\n\t\t}\n\t}\n\n\tif abs(rightUp-rightDown) < abs(rightDown-left) {\n\t\tdiff := abs(left - rightDown)\n\t\tif diff < min {\n\t\t\tmin = diff\n\t\t}\n\t}\n\n\tswitch direction {\n\tcase DirectionRight:\n\t\tif left > rightDown {\n\t\t\treturn min\n\t\t}\n\t\treturn calcMin(x+1, min, direction)\n\tcase DirectionLeft:\n\t\tif rightDown > left {\n\t\t\treturn min\n\t\t}\n\t\treturn calcMin(x-1, min, direction)\n\t}\n\treturn -1\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\tx := w / 3\n\n\tfmt.Println(calcMin(x, max, 0))\n}", "language": "Go", "metadata": {"date": 1542762293, "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/s964391924.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s964391924", "user_id": "u875592584"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nconst max = 10000000000\n\nconst (\n\tDirectionNone = int64(iota)\n\tDirectionRight\n\tDirectionLeft\n)\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 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, direction int64) int64 {\n\tleft, rightUp, rightDown := calcLeft(x), calcRightUp(x), calcRightDown(x)\n\n\tif direction == DirectionNone {\n\t\tif left < rightDown {\n\t\t\tdirection = DirectionRight\n\t\t} else {\n\t\t\tdirection = DirectionLeft\n\t\t}\n\t}\n\n\tif abs(rightUp-rightDown) < abs(rightDown-left) {\n\t\tdiff := abs(left - rightDown)\n\t\tif diff < min {\n\t\t\tmin = diff\n\t\t}\n\t}\n\n\tswitch direction {\n\tcase DirectionRight:\n\t\tif left > rightDown {\n\t\t\treturn min\n\t\t}\n\t\treturn calcMin(x+1, min, direction)\n\tcase DirectionLeft:\n\t\tif rightDown > left {\n\t\t\treturn min\n\t\t}\n\t\treturn calcMin(x-1, min, direction)\n\t}\n\treturn -1\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\tx := w / 3\n\n\tfmt.Println(calcMin(x, max, 0))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1193, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s553767845", "group_id": "codeNet:p03719", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C int\n\tvar ans string\n\tfmt.Scan(&A, &B, &C)\n\n\tif A <= C && C <= B {\n\t\tans = \"Yes\"\n\t} else {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1560309279, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03719.html", "problem_id": "p03719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03719/input.txt", "sample_output_relpath": "derived/input_output/data/p03719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03719/Go/s553767845.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s553767845", "user_id": "u879870653"}, "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\tvar ans string\n\tfmt.Scan(&A, &B, &C)\n\n\tif A <= C && C <= B {\n\t\tans = \"Yes\"\n\t} else {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "sample_input": "1 3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03719", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 186, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s076393843", "group_id": "codeNet:p03719", "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 <=c && c <= b {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1556384860, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03719.html", "problem_id": "p03719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03719/input.txt", "sample_output_relpath": "derived/input_output/data/p03719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03719/Go/s076393843.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s076393843", "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 a <=c && c <= b {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "sample_input": "1 3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03719", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 165, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s767990068", "group_id": "codeNet:p03719", "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\tA := nextInt()\n\tB := nextInt()\n\tC := nextInt()\n\n\tif C >= A && C <= B {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n// Input. ----------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\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\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sc.Text()\n}\n\n// ---------- Input.\n\n// Util. ----------\n\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\n\n// ---------- Util.\n", "language": "Go", "metadata": {"date": 1494723807, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03719.html", "problem_id": "p03719", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03719/input.txt", "sample_output_relpath": "derived/input_output/data/p03719/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03719/Go/s767990068.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s767990068", "user_id": "u598186038"}, "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\"strconv\"\n)\n\nfunc main() {\n\tA := nextInt()\n\tB := nextInt()\n\tC := nextInt()\n\n\tif C >= A && C <= B {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n// Input. ----------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\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\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn sc.Text()\n}\n\n// ---------- Input.\n\n// Util. ----------\n\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\n\n// ---------- Util.\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "sample_input": "1 3 2\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03719", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given three integers A, B and C.\nDetermine whether C is not less than A and not greater than B.\n\nConstraints\n\n-100≤A,B,C≤100\n\nA, B and C are all integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the condition is satisfied, print Yes; otherwise, print No.\n\nSample Input 1\n\n1 3 2\n\nSample Output 1\n\nYes\n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.\n\nSample Input 2\n\n6 5 4\n\nSample Output 2\n\nNo\n\nC=4 is less than A=6, and thus the output should be No.\n\nSample Input 3\n\n2 2 2\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 784, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s669470390", "group_id": "codeNet:p03722", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Edge struct {\n\tsource, target, cost int\n}\n\nconst Inf = 1 << 60 / 10\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tedges := make([]Edge, M)\n\tfor i := 0; i < M; i++ {\n\t\tedges[i].source = ReadInt() - 1\n\t\tedges[i].target = ReadInt() - 1\n\t\tedges[i].cost = -ReadInt()\n\t}\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\td[i] = Inf\n\t}\n\td[0] = 0\n\tfor i := 0; i < N-1; i++ {\n\t\tfor _, e := range edges {\n\t\t\tif d[e.source] == Inf {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnewD := d[e.source] + e.cost\n\t\t\tif newD < d[e.target] {\n\t\t\t\td[e.target] = newD\n\t\t\t}\n\t\t}\n\t}\n\n\tnegative := make([]bool, N)\n\tfor i := 0; i < N; i++ {\n\t\tfor _, e := range edges {\n\t\t\tif d[e.source] == Inf {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnewD := d[e.source] + e.cost\n\t\t\tif newD < d[e.target] {\n\t\t\t\td[e.target] = newD\n\t\t\t\tnegative[e.target] = true\n\t\t\t}\n\t\t\tif negative[e.source] {\n\t\t\t\tnegative[e.target] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif negative[N-1] {\n\t\tfmt.Println(\"inf\")\n\t} else {\n\t\tfmt.Println(-d[N-1])\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 }\n", "language": "Go", "metadata": {"date": 1596959529, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s669470390.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s669470390", "user_id": "u328656362"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Edge struct {\n\tsource, target, cost int\n}\n\nconst Inf = 1 << 60 / 10\n\nfunc main() {\n\tN, M := ReadInt(), ReadInt()\n\tedges := make([]Edge, M)\n\tfor i := 0; i < M; i++ {\n\t\tedges[i].source = ReadInt() - 1\n\t\tedges[i].target = ReadInt() - 1\n\t\tedges[i].cost = -ReadInt()\n\t}\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\td[i] = Inf\n\t}\n\td[0] = 0\n\tfor i := 0; i < N-1; i++ {\n\t\tfor _, e := range edges {\n\t\t\tif d[e.source] == Inf {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnewD := d[e.source] + e.cost\n\t\t\tif newD < d[e.target] {\n\t\t\t\td[e.target] = newD\n\t\t\t}\n\t\t}\n\t}\n\n\tnegative := make([]bool, N)\n\tfor i := 0; i < N; i++ {\n\t\tfor _, e := range edges {\n\t\t\tif d[e.source] == Inf {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnewD := d[e.source] + e.cost\n\t\t\tif newD < d[e.target] {\n\t\t\t\td[e.target] = newD\n\t\t\t\tnegative[e.target] = true\n\t\t\t}\n\t\t\tif negative[e.source] {\n\t\t\t\tnegative[e.target] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tif negative[N-1] {\n\t\tfmt.Println(\"inf\")\n\t} else {\n\t\tfmt.Println(-d[N-1])\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 }\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 0 {\n\t\tm, l = 1, 0\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tsum += a[i]\n\t\tif i%2 == m && sum >= 0 {\n\t\t\tcnt += sum + 1\n\t\t\tsum = -1\n\t\t}\n\t\tif i%2 == l && sum <= 0 {\n\t\t\tcnt += 1 - sum\n\t\t\tsum = 1\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1585433432, "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/s515822369.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s515822369", "user_id": "u367908963"}, "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 nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsum, cnt := a[0], 0\n\tm, l := 0, 1\n\tif a[0] > 0 {\n\t\tm, l = 1, 0\n\t}\n\n\tfor i := 1; i < n; i++ {\n\t\tsum += a[i]\n\t\tif i%2 == m && sum >= 0 {\n\t\t\tcnt += sum + 1\n\t\t\tsum = -1\n\t\t}\n\t\tif i%2 == l && sum <= 0 {\n\t\t\tcnt += 1 - sum\n\t\t\tsum = 1\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 556, "cpu_time_ms": 27, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s123001949", "group_id": "codeNet:p03745", "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 := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tvar res int\n\tfor i := 1; i < N-1; i++ {\n\t\tif (A[i+1]-A[i])*(A[i]-A[i-1]) < 0 {\n\t\t\tres++\n\t\t\ti++\n\t\t}\n\t}\n\tfmt.Println(res + 1)\n}\n", "language": "Go", "metadata": {"date": 1577420777, "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/s123001949.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s123001949", "user_id": "u166696759"}, "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\tA := make([]int, N)\n\tfor i := range A {\n\t\tfmt.Scan(&A[i])\n\t}\n\tvar res int\n\tfor i := 1; i < N-1; i++ {\n\t\tif (A[i+1]-A[i])*(A[i]-A[i-1]) < 0 {\n\t\t\tres++\n\t\t\ti++\n\t\t}\n\t}\n\tfmt.Println(res + 1)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 683, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s587327274", "group_id": "codeNet:p03745", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tnone = iota\n\tinc\n\tdec\n)\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 := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tvar ans, i int\n\tfor i+1 < len(a) {\n\t\tvar j, k int\n\t\tfor j = i; j+1 < len(a); j++ {\n\t\t\tif a[j] <= a[j+1] {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor k = i; k+1 < len(a); k++ {\n\t\t\tif a[k] >= a[k+1] {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ti += max(j-i, k-i) + 1\n\t\tans++\n\t}\n\t// fmt.Println(\"d00 - i\", i)\n\tif i < len(a) {\n\t\tans++\n\t}\n\tfmt.Println(ans)\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": 1570120545, "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/s587327274.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s587327274", "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\"strconv\"\n)\n\nconst (\n\tnone = iota\n\tinc\n\tdec\n)\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 := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tvar ans, i int\n\tfor i+1 < len(a) {\n\t\tvar j, k int\n\t\tfor j = i; j+1 < len(a); j++ {\n\t\t\tif a[j] <= a[j+1] {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor k = i; k+1 < len(a); k++ {\n\t\t\tif a[k] >= a[k+1] {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ti += max(j-i, k-i) + 1\n\t\tans++\n\t}\n\t// fmt.Println(\"d00 - i\", i)\n\tif i < len(a) {\n\t\tans++\n\t}\n\tfmt.Println(ans)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 27, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s561873369", "group_id": "codeNet:p03746", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"strings\"\n \"os\"\n \"strconv\"\n)\n\nfunc or(a []bool) bool {\n for i:=0; i 0 {\n s := i\n e := i\n reach[i] = true\n pn += 1\n result = strconv.Itoa(i+1)\n for {\n c := 0\n for j:=0; j 0 {\n s := i\n e := i\n reach[i] = true\n pn += 1\n result = strconv.Itoa(i+1)\n for {\n c := 0\n for j:=0; j= 24 {\n\t\tfmt.Println(a + b - 24)\n\t} else {\n\t\tfmt.Println(a + b)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584137172, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03773.html", "problem_id": "p03773", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03773/input.txt", "sample_output_relpath": "derived/input_output/data/p03773/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03773/Go/s085774669.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s085774669", "user_id": "u717943620"}, "prompt_components": {"gold_output": "21\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 >= 24 {\n\t\tfmt.Println(a + b - 24)\n\t} else {\n\t\tfmt.Println(a + b)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDolphin loves programming contests. Today, he will take part in a contest in AtCoder.\n\nIn this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as \"21 o'clock\".\n\nThe current time is A o'clock, and a contest will begin in exactly B hours.\nWhen will the contest begin? Answer in 24-hour time.\n\nConstraints\n\n0 \\leq A,B \\leq 23\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the hour of the starting time of the contest in 24-hour time.\n\nSample Input 1\n\n9 12\n\nSample Output 1\n\n21\n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21 o'clock in 24-hour time.\n\nSample Input 2\n\n19 0\n\nSample Output 2\n\n19\n\nThe contest has just started.\n\nSample Input 3\n\n23 2\n\nSample Output 3\n\n1\n\nThe contest will begin at 1 o'clock the next day.", "sample_input": "9 12\n"}, "reference_outputs": ["21\n"], "source_document_id": "p03773", "source_text": "Score : 100 points\n\nProblem Statement\n\nDolphin loves programming contests. Today, he will take part in a contest in AtCoder.\n\nIn this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as \"21 o'clock\".\n\nThe current time is A o'clock, and a contest will begin in exactly B hours.\nWhen will the contest begin? Answer in 24-hour time.\n\nConstraints\n\n0 \\leq A,B \\leq 23\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the hour of the starting time of the contest in 24-hour time.\n\nSample Input 1\n\n9 12\n\nSample Output 1\n\n21\n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21 o'clock in 24-hour time.\n\nSample Input 2\n\n19 0\n\nSample Output 2\n\n19\n\nThe contest has just started.\n\nSample Input 3\n\n23 2\n\nSample Output 3\n\n1\n\nThe contest will begin at 1 o'clock the next day.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s446739287", "group_id": "codeNet:p03774", "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 init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc abs(n int) int {\n\tif n > 0 {\n\t\treturn n\n\t} else {\n\t\treturn -n\n\t}\n}\n\nfunc main() {\n\tn, m := readInt(), readInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = readInt(), readInt()\n\t}\n\tc := make([]int, m)\n\td := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tc[i], d[i] = readInt(), readInt()\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tmin := -1\n\t\tchk := -1\n\t\tfor j := 0; j < m; j++ {\n\t\t\td := abs(a[i]-c[j]) + abs(b[i]-d[j])\n\t\t\tif min == -1 || d < min {\n\t\t\t\tmin = d\n\t\t\t\tchk = j + 1\n\t\t\t}\n\t\t}\n\t\tfmt.Println(chk)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581287529, "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/s446739287.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s446739287", "user_id": "u363118893"}, "prompt_components": {"gold_output": "2\n1\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 init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc abs(n int) int {\n\tif n > 0 {\n\t\treturn n\n\t} else {\n\t\treturn -n\n\t}\n}\n\nfunc main() {\n\tn, m := readInt(), readInt()\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i], b[i] = readInt(), readInt()\n\t}\n\tc := make([]int, m)\n\td := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tc[i], d[i] = readInt(), readInt()\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tmin := -1\n\t\tchk := -1\n\t\tfor j := 0; j < m; j++ {\n\t\t\td := abs(a[i]-c[j]) + abs(b[i]-d[j])\n\t\t\tif min == -1 || d < min {\n\t\t\t\tmin = d\n\t\t\t\tchk = j + 1\n\t\t\t}\n\t\t}\n\t\tfmt.Println(chk)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s408718523", "group_id": "codeNet:p03776", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc057/tasks/abc057_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\"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\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, a, b int\n\tV []int\n)\n\nfunc main() {\n\tn, a, b = ReadInt3()\n\tV = ReadIntSlice(n)\n\tsort.Sort(sort.Reverse(sort.IntSlice(V)))\n\tInitPascalTriangle(INF_BIT60)\n\n\tmemo := map[int]int{}\n\tfor _, v := range V[:a] {\n\t\tmemo[v]++\n\t}\n\tif len(memo) > 1 {\n\t\tsolve1()\n\t} else {\n\t\tval := V[0]\n\t\tfmt.Println(val)\n\n\t\tnum := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif val == V[i] {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\n\t\tupper := Min(b, num)\n\t\tans := 0\n\t\tfor i := a; i <= upper; i++ {\n\t\t\tans += Comb[num][i]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\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\nfunc solve1() {\n\tsum := Sum(V[:a]...)\n\tfmt.Println(float64(sum) / float64(a))\n\n\ttotal := 0\n\tfor _, v := range V {\n\t\tif V[a-1] == v {\n\t\t\ttotal++\n\t\t}\n\t}\n\tchoice := 0\n\tfor _, v := range V[:a] {\n\t\tif V[a-1] == v {\n\t\t\tchoice++\n\t\t}\n\t}\n\n\tfmt.Println(Comb[total][choice])\n}\n\nvar Comb [5001][5001]int\n\nfunc InitPascalTriangle(m int) {\n\tfor i := 0; i <= 5000; i++ {\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tif j == 0 || j == i {\n\t\t\t\tComb[i][j] = 1\n\t\t\t} else {\n\t\t\t\tComb[i][j] = Comb[i-1][j-1] + Comb[i-1][j]\n\t\t\t\tComb[i][j] %= m\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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": 1588527185, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03776.html", "problem_id": "p03776", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03776/input.txt", "sample_output_relpath": "derived/input_output/data/p03776/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03776/Go/s408718523.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s408718523", "user_id": "u103600314"}, "prompt_components": {"gold_output": "4.500000\n1\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc057/tasks/abc057_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\"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\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, a, b int\n\tV []int\n)\n\nfunc main() {\n\tn, a, b = ReadInt3()\n\tV = ReadIntSlice(n)\n\tsort.Sort(sort.Reverse(sort.IntSlice(V)))\n\tInitPascalTriangle(INF_BIT60)\n\n\tmemo := map[int]int{}\n\tfor _, v := range V[:a] {\n\t\tmemo[v]++\n\t}\n\tif len(memo) > 1 {\n\t\tsolve1()\n\t} else {\n\t\tval := V[0]\n\t\tfmt.Println(val)\n\n\t\tnum := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif val == V[i] {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\n\t\tupper := Min(b, num)\n\t\tans := 0\n\t\tfor i := a; i <= upper; i++ {\n\t\t\tans += Comb[num][i]\n\t\t}\n\t\tfmt.Println(ans)\n\t}\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\nfunc solve1() {\n\tsum := Sum(V[:a]...)\n\tfmt.Println(float64(sum) / float64(a))\n\n\ttotal := 0\n\tfor _, v := range V {\n\t\tif V[a-1] == v {\n\t\t\ttotal++\n\t\t}\n\t}\n\tchoice := 0\n\tfor _, v := range V[:a] {\n\t\tif V[a-1] == v {\n\t\t\tchoice++\n\t\t}\n\t}\n\n\tfmt.Println(Comb[total][choice])\n}\n\nvar Comb [5001][5001]int\n\nfunc InitPascalTriangle(m int) {\n\tfor i := 0; i <= 5000; i++ {\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tif j == 0 || j == i {\n\t\t\t\tComb[i][j] = 1\n\t\t\t} else {\n\t\t\t\tComb[i][j] = Comb[i-1][j-1] + Comb[i-1][j]\n\t\t\t\tComb[i][j] %= m\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "sample_input": "5 2 2\n1 2 3 4 5\n"}, "reference_outputs": ["4.500000\n1\n"], "source_document_id": "p03776", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given N items.\n\nThe value of the i-th item (1 \\leq i \\leq N) is v_i.\n\nYour have to select at least A and at most B of these items.\n\nUnder this condition, find the maximum possible arithmetic mean of the values of selected items.\n\nAdditionally, find the number of ways to select items so that the mean of the values of selected items is maximized.\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A,B \\leq N\n\n1 \\leq v_i \\leq 10^{15}\n\nEach v_i is an integer.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A B\nv_1\nv_2\n...\nv_N\n\nOutput\n\nPrint two lines.\n\nThe first line should contain the maximum possible arithmetic mean of the values of selected items. The output should be considered correct if the absolute or relative error is at most 10^{-6}.\n\nThe second line should contain the number of ways to select items so that the mean of the values of selected items is maximized.\n\nSample Input 1\n\n5 2 2\n1 2 3 4 5\n\nSample Output 1\n\n4.500000\n1\n\nThe mean of the values of selected items will be maximized when selecting the fourth and fifth items. Hence, the first line of the output should contain 4.5.\n\nThere is no other way to select items so that the mean of the values will be 4.5, and thus the second line of the output should contain 1.\n\nSample Input 2\n\n4 2 3\n10 20 10 10\n\nSample Output 2\n\n15.000000\n3\n\nThere can be multiple ways to select items so that the mean of the values will be maximized.\n\nSample Input 3\n\n5 1 5\n1000000000000000 999999999999999 999999999999998 999999999999997 999999999999996\n\nSample Output 3\n\n1000000000000000.000000\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6424, "cpu_time_ms": 238, "memory_kb": 195840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519511961", "group_id": "codeNet:p03780", "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\tK, _ := strconv.Atoi(read())\n\ta_f, a_r := make([]int, N+1), make([]int, N)\n\tfor i := 1; i < N+1; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\ta_f[i] = t\n\t\ta_r[i-1] = t\n\t}\n\tsort.Ints(a_f)\n\tsort.Sort(sort.Reverse(sort.IntSlice(a_r)))\n\ta_r = append(a_r[0:1], a_r[0:]...)\n\ta_r[0] = 0\n\n\tdp_f := make([][]bool, N+1)\n\tdp_r := make([][]bool, N+1)\n\tfor i := 0; i < N+1; i++ {\n\t\tdp_f[i] = make([]bool, K+1)\n\t\tdp_r[i] = make([]bool, K+1)\n\t}\n\tdp_f[0][0] = true\n\tdp_r[0][0] = true\n\t// i文字目までで,値jを作れるか動的計画法で調査\n\tfor i := 1; i < N+1; i++ {\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tif 0 <= j-a_f[i] {\n\t\t\t\tdp_f[i][j] = dp_f[i][j] || dp_f[i-1][j-a_f[i]]\n\t\t\t}\n\t\t\tdp_f[i][j] = dp_f[i][j] || dp_f[i-1][j]\n\t\t}\n\t}\n\t// N-i文字目までで,値jを作れるか動的計画法で調査\n\tfor i := 1; i < N+1; i++ {\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tif 0 <= j-a_r[i] {\n\t\t\t\tdp_r[i][j] = dp_r[i][j] || dp_r[i-1][j-a_r[i]]\n\t\t\t}\n\t\t\tdp_r[i][j] = dp_r[i][j] || dp_r[i-1][j]\n\t\t}\n\t}\n\t// dpテーブルの累積和\n\tfor i := 1; i < N+1; i++ {\n\t\tdp_ans := make([]bool, K+1)\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tdp_ans[j] = dp_f[i-1][j] || dp_r[i-1][j]\n\t\t}\n\n\t\t// K-a[i] <= X < Kが存在するか調査\n\t\tfor j := max(0, K-a_f[i]); j < K; j++ {\n\t\t\tif dp_ans[j] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == K-1 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\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": 1565290554, "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/s519511961.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s519511961", "user_id": "u266742706"}, "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\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\tK, _ := strconv.Atoi(read())\n\ta_f, a_r := make([]int, N+1), make([]int, N)\n\tfor i := 1; i < N+1; i++ {\n\t\tt, _ := strconv.Atoi(read())\n\t\ta_f[i] = t\n\t\ta_r[i-1] = t\n\t}\n\tsort.Ints(a_f)\n\tsort.Sort(sort.Reverse(sort.IntSlice(a_r)))\n\ta_r = append(a_r[0:1], a_r[0:]...)\n\ta_r[0] = 0\n\n\tdp_f := make([][]bool, N+1)\n\tdp_r := make([][]bool, N+1)\n\tfor i := 0; i < N+1; i++ {\n\t\tdp_f[i] = make([]bool, K+1)\n\t\tdp_r[i] = make([]bool, K+1)\n\t}\n\tdp_f[0][0] = true\n\tdp_r[0][0] = true\n\t// i文字目までで,値jを作れるか動的計画法で調査\n\tfor i := 1; i < N+1; i++ {\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tif 0 <= j-a_f[i] {\n\t\t\t\tdp_f[i][j] = dp_f[i][j] || dp_f[i-1][j-a_f[i]]\n\t\t\t}\n\t\t\tdp_f[i][j] = dp_f[i][j] || dp_f[i-1][j]\n\t\t}\n\t}\n\t// N-i文字目までで,値jを作れるか動的計画法で調査\n\tfor i := 1; i < N+1; i++ {\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tif 0 <= j-a_r[i] {\n\t\t\t\tdp_r[i][j] = dp_r[i][j] || dp_r[i-1][j-a_r[i]]\n\t\t\t}\n\t\t\tdp_r[i][j] = dp_r[i][j] || dp_r[i-1][j]\n\t\t}\n\t}\n\t// dpテーブルの累積和\n\tfor i := 1; i < N+1; i++ {\n\t\tdp_ans := make([]bool, K+1)\n\t\tfor j := 0; j < K+1; j++ {\n\t\t\tdp_ans[j] = dp_f[i-1][j] || dp_r[i-1][j]\n\t\t}\n\n\t\t// K-a[i] <= X < Kが存在するか調査\n\t\tfor j := max(0, K-a_f[i]); j < K; j++ {\n\t\t\tif dp_ans[j] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == K-1 {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3959, "cpu_time_ms": 521, "memory_kb": 84224}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s080294674", "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\nvar dp, dpr [5001]int\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 := getNextInt(scanner)\n\taa := make([]int, n)\n\n\tdp[0] = 1\n\tdpr[0] = 1\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\tfor i := n - 1; i > 0; i-- {\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[i] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dpr[ii-aa[i]] > 0 {\n\t\t\t\tdpr[ii]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif needed(i, n, k, aa) == false {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc needed(ai, n, k int, aa []int) bool {\n\tif ai > 0 {\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[ai-1] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dp[ii-aa[ai-1]] > 0 {\n\t\t\t\tdp[ii]++\n\t\t\t}\n\t\t}\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[ai] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dpr[ii] > 0 {\n\t\t\t\tdpr[ii]--\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sr [5001]int\n\tsr[0] = dpr[0]\n\tfor ii := 1; ii < k; ii++ {\n\t\tsr[ii] = sr[ii-1] + dpr[ii]\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tif dp[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif i+aa[ai] >= k {\n\t\t\treturn true\n\t\t}\n\t\tminr := k - aa[ai] - i - 1\n\t\tmaxr := k - i - 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 dpr[maxr]-dpr[minr] > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1564617010, "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/s080294674.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s080294674", "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\nvar dp, dpr [5001]int\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 := getNextInt(scanner)\n\taa := make([]int, n)\n\n\tdp[0] = 1\n\tdpr[0] = 1\n\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t}\n\tfor i := n - 1; i > 0; i-- {\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[i] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dpr[ii-aa[i]] > 0 {\n\t\t\t\tdpr[ii]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif needed(i, n, k, aa) == false {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc needed(ai, n, k int, aa []int) bool {\n\tif ai > 0 {\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[ai-1] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dp[ii-aa[ai-1]] > 0 {\n\t\t\t\tdp[ii]++\n\t\t\t}\n\t\t}\n\t\tfor ii := k; ii >= 0; ii-- {\n\t\t\tif ii-aa[ai] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dpr[ii] > 0 {\n\t\t\t\tdpr[ii]--\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sr [5001]int\n\tsr[0] = dpr[0]\n\tfor ii := 1; ii < k; ii++ {\n\t\tsr[ii] = sr[ii-1] + dpr[ii]\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tif dp[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif i+aa[ai] >= k {\n\t\t\treturn true\n\t\t}\n\t\tminr := k - aa[ai] - i - 1\n\t\tmaxr := k - i - 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 dpr[maxr]-dpr[minr] > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1854, "cpu_time_ms": 298, "memory_kb": 896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s868341565", "group_id": "codeNet:p03785", "input_text": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Apr 1 19:11:47 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N, C, K int\n\nfunc main() {\n\tfmt.Scan(&N, &C, &K)\n\n\tT := make([]int, N)\n\tfor i := range T {\n\t\tfmt.Scan(&T[i])\n\t}\n\tsort.Ints(T)\n\n\tcount := 0\n\tstart := 0\n\tnum := 0\n\tfor i := range T {\n\t\tt := T[i]\n\t\tif start == 0 {\n\t\t\tstart = t\n\t\t\tnum++\n\t\t\tcount++\n\t\t} else if start+K < t {\n\t\t\tstart = t\n\t\t\tnum = 1\n\t\t\tcount++\n\t\t} else {\n\t\t\tif num == C {\n\t\t\t\tstart = t\n\t\t\t\tnum = 1\n\t\t\t\tcount++\n\t\t\t} else {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1522719756, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03785.html", "problem_id": "p03785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03785/input.txt", "sample_output_relpath": "derived/input_output/data/p03785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03785/Go/s868341565.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s868341565", "user_id": "u802614675"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "///\n// File: a.go\n// Author: ymiyamoto\n//\n// Created on Sun Apr 1 19:11:47 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar N, C, K int\n\nfunc main() {\n\tfmt.Scan(&N, &C, &K)\n\n\tT := make([]int, N)\n\tfor i := range T {\n\t\tfmt.Scan(&T[i])\n\t}\n\tsort.Ints(T)\n\n\tcount := 0\n\tstart := 0\n\tnum := 0\n\tfor i := range T {\n\t\tt := T[i]\n\t\tif start == 0 {\n\t\t\tstart = t\n\t\t\tnum++\n\t\t\tcount++\n\t\t} else if start+K < t {\n\t\t\tstart = t\n\t\t\tnum = 1\n\t\t\tcount++\n\t\t} else {\n\t\t\tif num == C {\n\t\t\t\tstart = t\n\t\t\t\tnum = 1\n\t\t\t\tcount++\n\t\t\t} else {\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "sample_input": "5 3 5\n1\n2\n3\n6\n12\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03785", "source_text": "Score : 300 points\n\nProblem Statement\n\nEvery day, N passengers arrive at Takahashi Airport.\nThe i-th passenger arrives at time T_i.\n\nEvery passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers.\nNaturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport.\nAlso, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane.\nFor that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive).\n\nWhen setting the departure times for buses under this condition, find the minimum required number of buses.\nHere, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq C \\leq 10^9\n\n1 \\leq K \\leq 10^9\n\n1 \\leq T_i \\leq 10^9\n\nC, K and T_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C K\nT_1\nT_2\n:\nT_N\n\nOutput\n\nPrint the minimum required number of buses.\n\nSample Input 1\n\n5 3 5\n1\n2\n3\n6\n12\n\nSample Output 1\n\n3\n\nFor example, the following three buses are enough:\n\nA bus departing at time 4.5, that carries the passengers arriving at time 2 and 3.\n\nA bus departing at time 6, that carries the passengers arriving at time 1 and 6.\n\nA bus departing at time 12, that carries the passenger arriving at time 12.\n\nSample Input 2\n\n6 3 3\n7\n6\n2\n8\n10\n6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 558, "cpu_time_ms": 729, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s675323469", "group_id": "codeNet:p03786", "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, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\ntype Animal struct {\n\tcolor int\n\tsize int\n}\n\ntype Animals []*Animal\n\nfunc (as Animals) Len() int {\n\treturn len(as)\n}\n\nfunc (as Animals) Less(i, j int) bool {\n\treturn as[i].size < as[j].size\n}\n\nfunc (as Animals) Swap(i, j int) {\n\tas[i], as[j] = as[j], as[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tanimals := make(Animals, n)\n\tfor i := range animals {\n\t\tanimals[i] = &Animal{i + 1, nextInt()}\n\t}\n\t// 大きさの昇順にソート\n\tsort.Sort(animals)\n\n\tsums := make([]int64, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tsums[i] = sums[i-1] + int64(animals[i-1].size)\n\t}\n\n\tans := n\n\tfor i := n - 2; i >= 0; i-- {\n\t\tif sums[i+1]*2 < int64(animals[i+1].size) {\n\t\t\tans -= i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1577480915, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03786.html", "problem_id": "p03786", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03786/input.txt", "sample_output_relpath": "derived/input_output/data/p03786/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03786/Go/s675323469.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s675323469", "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\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\ntype Animal struct {\n\tcolor int\n\tsize int\n}\n\ntype Animals []*Animal\n\nfunc (as Animals) Len() int {\n\treturn len(as)\n}\n\nfunc (as Animals) Less(i, j int) bool {\n\treturn as[i].size < as[j].size\n}\n\nfunc (as Animals) Swap(i, j int) {\n\tas[i], as[j] = as[j], as[i]\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tanimals := make(Animals, n)\n\tfor i := range animals {\n\t\tanimals[i] = &Animal{i + 1, nextInt()}\n\t}\n\t// 大きさの昇順にソート\n\tsort.Sort(animals)\n\n\tsums := make([]int64, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tsums[i] = sums[i-1] + int64(animals[i-1].size)\n\t}\n\n\tans := n\n\tfor i := n - 2; i >= 0; i-- {\n\t\tif sums[i+1]*2 < int64(animals[i+1].size) {\n\t\t\tans -= i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke found N strange creatures.\nEach creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.\n\nEvery creature can absorb another creature whose size is at most twice the size of itself.\nWhen a creature of size A and color B absorbs another creature of size C and color D (C \\leq 2 \\times A), they will merge into one creature of size A+C and color B.\nHere, depending on the sizes of two creatures, it is possible that both of them can absorb the other.\n\nSnuke has been watching these creatures merge over and over and ultimately become one creature.\nFind the number of the possible colors of this creature.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\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 possible colors of the last remaining creature after the N creatures repeatedly merge and ultimately become one creature.\n\nSample Input 1\n\n3\n3 1 4\n\nSample Output 1\n\n2\n\nThe possible colors of the last remaining creature are colors 1 and 3.\nFor example, when the creature of color 3 absorbs the creature of color 2, then the creature of color 1 absorbs the creature of color 3, the color of the last remaining creature will be color 1.\n\nSample Input 2\n\n5\n1 1 1 1 1\n\nSample Output 2\n\n5\n\nThere may be multiple creatures of the same size.\n\nSample Input 3\n\n6\n40 1 30 2 7 20\n\nSample Output 3\n\n4", "sample_input": "3\n3 1 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03786", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke found N strange creatures.\nEach creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively.\n\nEvery creature can absorb another creature whose size is at most twice the size of itself.\nWhen a creature of size A and color B absorbs another creature of size C and color D (C \\leq 2 \\times A), they will merge into one creature of size A+C and color B.\nHere, depending on the sizes of two creatures, it is possible that both of them can absorb the other.\n\nSnuke has been watching these creatures merge over and over and ultimately become one creature.\nFind the number of the possible colors of this creature.\n\nConstraints\n\n2 \\leq N \\leq 100000\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\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 possible colors of the last remaining creature after the N creatures repeatedly merge and ultimately become one creature.\n\nSample Input 1\n\n3\n3 1 4\n\nSample Output 1\n\n2\n\nThe possible colors of the last remaining creature are colors 1 and 3.\nFor example, when the creature of color 3 absorbs the creature of color 2, then the creature of color 1 absorbs the creature of color 3, the color of the last remaining creature will be color 1.\n\nSample Input 2\n\n5\n1 1 1 1 1\n\nSample Output 2\n\n5\n\nThere may be multiple creatures of the same size.\n\nSample Input 3\n\n6\n40 1 30 2 7 20\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 902, "cpu_time_ms": 59, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s666660962", "group_id": "codeNet:p03787", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,100)}\n n,m := input.NextInts()\n g := make([][]int,n)\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 := sc.nextInt()\n\tS := sc.nextStr()\n\tS += S[0:2]\n\t// [before][now], SSS, SWW, WSW, WWS\n\tokMap := [][]int{[]int{0, 1}, []int{1, 0}}\n\t// [before][now], SSW, SWS, WSS, WWW\n\tngMap := [][]int{[]int{1, 0}, []int{0, 1}}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tarr := make([]int, N+2)\n\t\t\tarr[0] = i\n\t\t\tarr[1] = j\n\t\t\tfor k := 1; k < N+1; k++ {\n\t\t\t\tif S[k] == 'o' {\n\t\t\t\t\tarr[k+1] = okMap[arr[k-1]][arr[k]]\n\t\t\t\t} else {\n\t\t\t\t\tarr[k+1] = ngMap[arr[k-1]][arr[k]]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif arr[N] == i && arr[N+1] == j {\n\t\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\t\tif arr[i] == 0 {\n\t\t\t\t\t\tfmt.Fprint(wtr, \"S\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Fprint(wtr, \"W\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Fprintln(wtr)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(wtr, \"-1\")\n}\n", "language": "Go", "metadata": {"date": 1585676857, "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/s275750790.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s275750790", "user_id": "u924691798"}, "prompt_components": {"gold_output": "SSSWWS\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\tS := sc.nextStr()\n\tS += S[0:2]\n\t// [before][now], SSS, SWW, WSW, WWS\n\tokMap := [][]int{[]int{0, 1}, []int{1, 0}}\n\t// [before][now], SSW, SWS, WSS, WWW\n\tngMap := [][]int{[]int{1, 0}, []int{0, 1}}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tarr := make([]int, N+2)\n\t\t\tarr[0] = i\n\t\t\tarr[1] = j\n\t\t\tfor k := 1; k < N+1; k++ {\n\t\t\t\tif S[k] == 'o' {\n\t\t\t\t\tarr[k+1] = okMap[arr[k-1]][arr[k]]\n\t\t\t\t} else {\n\t\t\t\t\tarr[k+1] = ngMap[arr[k-1]][arr[k]]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif arr[N] == i && arr[N+1] == j {\n\t\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\t\tif arr[i] == 0 {\n\t\t\t\t\t\tfmt.Fprint(wtr, \"S\")\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Fprint(wtr, \"W\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Fprintln(wtr)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(wtr, \"-1\")\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2649, "cpu_time_ms": 32, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448507791", "group_id": "codeNet:p03798", "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\tS := sc.nextStr()\n\t// [now][next], SS, SW, WS, WW\n\tokNextMap := [][]int{[]int{0, 1}, []int{1, 0}}\n\t// [now][next], SS, SW, WS, WW\n\tngNextMap := [][]int{[]int{1, 0}, []int{0, 1}}\n\tisTrue := false\n\tvar ans []int\n\tfor last := 0; last < 2; last++ {\n\t\tfor first := 0; first < 2; first++ {\n\t\t\tvar next int\n\t\t\tif S[0] == 'o' {\n\t\t\t\tnext = okNextMap[last][first]\n\t\t\t} else {\n\t\t\t\tnext = ngNextMap[last][first]\n\t\t\t}\n\t\t\tnow := first\n\t\t\tarr := []int{now}\n\t\t\tfor i := 1; i < N; i++ {\n\t\t\t\ttmp := next\n\t\t\t\tif S[i] == 'o' {\n\t\t\t\t\tnext = okNextMap[now][next]\n\t\t\t\t} else {\n\t\t\t\t\tnext = ngNextMap[now][next]\n\t\t\t\t}\n\t\t\t\tnow = tmp\n\t\t\t\tarr = append(arr, now)\n\t\t\t}\n\t\t\tif next == first && now == last {\n\t\t\t\tisTrue = true\n\t\t\t\tans = arr\n\t\t\t}\n\t\t}\n\t}\n\tif !isTrue {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t} else {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif ans[i] == 0 {\n\t\t\t\tfmt.Fprint(wtr, \"S\")\n\t\t\t} else {\n\t\t\t\tfmt.Fprint(wtr, \"W\")\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintln(wtr)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585622018, "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/s448507791.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448507791", "user_id": "u924691798"}, "prompt_components": {"gold_output": "SSSWWS\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\tS := sc.nextStr()\n\t// [now][next], SS, SW, WS, WW\n\tokNextMap := [][]int{[]int{0, 1}, []int{1, 0}}\n\t// [now][next], SS, SW, WS, WW\n\tngNextMap := [][]int{[]int{1, 0}, []int{0, 1}}\n\tisTrue := false\n\tvar ans []int\n\tfor last := 0; last < 2; last++ {\n\t\tfor first := 0; first < 2; first++ {\n\t\t\tvar next int\n\t\t\tif S[0] == 'o' {\n\t\t\t\tnext = okNextMap[last][first]\n\t\t\t} else {\n\t\t\t\tnext = ngNextMap[last][first]\n\t\t\t}\n\t\t\tnow := first\n\t\t\tarr := []int{now}\n\t\t\tfor i := 1; i < N; i++ {\n\t\t\t\ttmp := next\n\t\t\t\tif S[i] == 'o' {\n\t\t\t\t\tnext = okNextMap[now][next]\n\t\t\t\t} else {\n\t\t\t\t\tnext = ngNextMap[now][next]\n\t\t\t\t}\n\t\t\t\tnow = tmp\n\t\t\t\tarr = append(arr, now)\n\t\t\t}\n\t\t\tif next == first && now == last {\n\t\t\t\tisTrue = true\n\t\t\t\tans = arr\n\t\t\t}\n\t\t}\n\t}\n\tif !isTrue {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t} else {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif ans[i] == 0 {\n\t\t\t\tfmt.Fprint(wtr, \"S\")\n\t\t\t} else {\n\t\t\t\tfmt.Fprint(wtr, \"W\")\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintln(wtr)\n\t}\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2862, "cpu_time_ms": 38, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069507209", "group_id": "codeNet:p03803", "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 == b {\n\t\tfmt.Println(\"Draw\")\n\t} else if a == 1 {\n\t\tfmt.Println(\"Alice\")\n\t} else if b == 1 {\n\t\tfmt.Println(\"Bob\")\n\t} else if a > b {\n\t\tfmt.Println(\"Alice\")\n\t} else if b > a {\n\t\tfmt.Println(\"Bob\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588569964, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03803.html", "problem_id": "p03803", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03803/input.txt", "sample_output_relpath": "derived/input_output/data/p03803/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03803/Go/s069507209.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069507209", "user_id": "u055687574"}, "prompt_components": {"gold_output": "Alice\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 == b {\n\t\tfmt.Println(\"Draw\")\n\t} else if a == 1 {\n\t\tfmt.Println(\"Alice\")\n\t} else if b == 1 {\n\t\tfmt.Println(\"Bob\")\n\t} else if a > b {\n\t\tfmt.Println(\"Alice\")\n\t} else if b > a {\n\t\tfmt.Println(\"Bob\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "sample_input": "8 6\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03803", "source_text": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 285, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s548807708", "group_id": "codeNet:p03803", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanln(&A, &B)\n\n\tif A == 1 {\n\t\tA = 100\n\t}\n\tif B == 1 {\n\t\tB = 100\n\t}\n\tif A > B {\n\t\tfmt.Println(\"Alice\")\n\t} else if A < B {\n\t\tfmt.Println(\"Bob\")\n\t} else {\n\t\tfmt.Println(\"Draw\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1486865112, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03803.html", "problem_id": "p03803", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03803/input.txt", "sample_output_relpath": "derived/input_output/data/p03803/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03803/Go/s548807708.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s548807708", "user_id": "u522469391"}, "prompt_components": {"gold_output": "Alice\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B int\n\tfmt.Scanln(&A, &B)\n\n\tif A == 1 {\n\t\tA = 100\n\t}\n\tif B == 1 {\n\t\tB = 100\n\t}\n\tif A > B {\n\t\tfmt.Println(\"Alice\")\n\t} else if A < B {\n\t\tfmt.Println(\"Bob\")\n\t} else {\n\t\tfmt.Println(\"Draw\")\n\t}\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "sample_input": "8 6\n"}, "reference_outputs": ["Alice\n"], "source_document_id": "p03803", "source_text": "Score : 100 points\n\nProblem Statement\n\nAlice and Bob are playing One Card Poker.\n\nOne Card Poker is a two-player game using playing cards.\n\nEach card in this game shows an integer between 1 and 13, inclusive.\n\nThe strength of a card is determined by the number written on it, as follows:\n\nWeak 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < 11 < 12 < 13 < 1 Strong\n\nOne Card Poker is played as follows:\n\nEach player picks one card from the deck. The chosen card becomes the player's hand.\n\nThe players reveal their hands to each other. The player with the stronger card wins the game.\n\nIf their cards are equally strong, the game is drawn.\n\nYou are watching Alice and Bob playing the game, and can see their hands.\n\nThe number written on Alice's card is A, and the number written on Bob's card is B.\n\nWrite a program to determine the outcome of the game.\n\nConstraints\n\n1≦A≦13\n\n1≦B≦13\n\nA and B are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint Alice if Alice will win. Print Bob if Bob will win. Print Draw if the game will be drawn.\n\nSample Input 1\n\n8 6\n\nSample Output 1\n\nAlice\n\n8 is written on Alice's card, and 6 is written on Bob's card.\nAlice has the stronger card, and thus the output should be Alice.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\nDraw\n\nSince their cards have the same number, the game will be drawn.\n\nSample Input 3\n\n13 1\n\nSample Output 3\n\nBob", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s879044516", "group_id": "codeNet:p03807", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a int\n\tfmt.Scan(&n)\n\tvar m [2]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tm[a%2]++\n\t}\n\tm[0] += m[1] / 2\n\tif m[0]%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1486261338, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03807.html", "problem_id": "p03807", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03807/input.txt", "sample_output_relpath": "derived/input_output/data/p03807/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03807/Go/s879044516.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s879044516", "user_id": "u696272993"}, "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)\n\tvar m [2]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tm[a%2]++\n\t}\n\tm[0] += m[1] / 2\n\tif m[0]%2 == 0 {\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\nThere are N integers written on a blackboard. The i-th integer is A_i.\n\nTakahashi will repeatedly perform the following operation on these numbers:\n\nSelect a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.\n\nThen, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.\n\nDetermine whether it is possible to have only one integer on the blackboard.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nA_i is an integer.\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 have only one integer on the blackboard, print YES. Otherwise, print NO.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYES\n\nIt is possible to have only one integer on the blackboard, as follows:\n\nErase 1 and 3 from the blackboard, then write 4. Now, there are two integers on the blackboard: 2 and 4.\n\nErase 2 and 4 from the blackboard, then write 6. Now, there is only one integer on the blackboard: 6.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\nNO", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03807", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers written on a blackboard. The i-th integer is A_i.\n\nTakahashi will repeatedly perform the following operation on these numbers:\n\nSelect a pair of integers, A_i and A_j, that have the same parity (that is, both are even or both are odd) and erase them.\n\nThen, write a new integer on the blackboard that is equal to the sum of those integers, A_i+A_j.\n\nDetermine whether it is possible to have only one integer on the blackboard.\n\nConstraints\n\n2 ≦ N ≦ 10^5\n\n1 ≦ A_i ≦ 10^9\n\nA_i is an integer.\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 have only one integer on the blackboard, print YES. Otherwise, print NO.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYES\n\nIt is possible to have only one integer on the blackboard, as follows:\n\nErase 1 and 3 from the blackboard, then write 4. Now, there are two integers on the blackboard: 2 and 4.\n\nErase 2 and 4 from the blackboard, then write 6. Now, there is only one integer on the blackboard: 6.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 231, "cpu_time_ms": 1911, "memory_kb": 5504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s816908006", "group_id": "codeNet:p03813", "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\tx := readInt()\n\tif x < 1200 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ARC\")\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": 1588009445, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03813.html", "problem_id": "p03813", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03813/input.txt", "sample_output_relpath": "derived/input_output/data/p03813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03813/Go/s816908006.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s816908006", "user_id": "u967669872"}, "prompt_components": {"gold_output": "ABC\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\tx := readInt()\n\tif x < 1200 {\n\t\tfmt.Println(\"ABC\")\n\t} else {\n\t\tfmt.Println(\"ARC\")\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\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\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\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "sample_input": "1000\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03813", "source_text": "Score : 100 points\n\nProblem Statement\n\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\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\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5557, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s767919443", "group_id": "codeNet:p03813", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tcontest(x)\n}\n\nfunc contest(x int) {\n\tif x < 1200 {\n\t\tfmt.Println(\"ABC\")\n\t} else if x > 1200 {\n\t\tfmt.Println(\"ARC\")\n\t} else {\n\t\treturn\n\t}\n}", "language": "Go", "metadata": {"date": 1543277734, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03813.html", "problem_id": "p03813", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03813/input.txt", "sample_output_relpath": "derived/input_output/data/p03813/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03813/Go/s767919443.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s767919443", "user_id": "u169407363"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tcontest(x)\n}\n\nfunc contest(x int) {\n\tif x < 1200 {\n\t\tfmt.Println(\"ABC\")\n\t} else if x > 1200 {\n\t\tfmt.Println(\"ARC\")\n\t} else {\n\t\treturn\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\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\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "sample_input": "1000\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03813", "source_text": "Score : 100 points\n\nProblem Statement\n\nSmeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) otherwise.\n\nYou are given Smeke's current rating, x. Print ABC if Smeke will participate in ABC, and print ARC otherwise.\n\nConstraints\n\n1 ≦ x ≦ 3{,}000\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\n1000\n\nSample Output 1\n\nABC\n\nSmeke's current rating is less than 1200, thus the output should be ABC.\n\nSample Input 2\n\n2000\n\nSample Output 2\n\nARC\n\nSmeke's current rating is not less than 1200, thus the output should be ARC.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 211, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s931929716", "group_id": "codeNet:p03815", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n fmt.Scan(&x)\n\tif x%11 == 0 {\n\t\tfmt.Println(x / 11 * 2)\n\t} else if x%11 <= 6 {\n\t\tfmt.Println(x/11*2 + 1)\n\t} else {\n\t\tfmt.Println(x/11*2 + 2)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581207183, "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/s931929716.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s931929716", "user_id": "u843722521"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n fmt.Scan(&x)\n\tif x%11 == 0 {\n\t\tfmt.Println(x / 11 * 2)\n\t} else if x%11 <= 6 {\n\t\tfmt.Println(x/11*2 + 1)\n\t} else {\n\t\tfmt.Println(x/11*2 + 2)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 207, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s341561062", "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\tfmt.Fprintln(stdout, cnt)\n\n}\n", "language": "Go", "metadata": {"date": 1566009171, "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/s341561062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s341561062", "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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2972, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s074135098", "group_id": "codeNet:p03826", "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\tC := getInt()\n\tD := getInt()\n\t\n\ts1 := A * B\n\ts2 := C * D\n\t\n\tfmt.Println(max(s1, s2))\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": 1588551962, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03826.html", "problem_id": "p03826", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03826/input.txt", "sample_output_relpath": "derived/input_output/data/p03826/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03826/Go/s074135098.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s074135098", "user_id": "u964273035"}, "prompt_components": {"gold_output": "15\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\tC := getInt()\n\tD := getInt()\n\t\n\ts1 := A * B\n\ts2 := C * D\n\t\n\tfmt.Println(max(s1, s2))\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 : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "sample_input": "3 5 2 7\n"}, "reference_outputs": ["15\n"], "source_document_id": "p03826", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two rectangles.\nThe lengths of the vertical sides of the first rectangle are A, and the lengths of the horizontal sides of the first rectangle are B.\nThe lengths of the vertical sides of the second rectangle are C, and the lengths of the horizontal sides of the second rectangle are D.\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nConstraints\n\nAll input values are integers.\n\n1≤A≤10^4\n\n1≤B≤10^4\n\n1≤C≤10^4\n\n1≤D≤10^4\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA B C D\n\nOutput\n\nPrint the area of the rectangle with the larger area.\nIf the two rectangles have equal areas, print that area.\n\nSample Input 1\n\n3 5 2 7\n\nSample Output 1\n\n15\n\nThe first rectangle has an area of 3×5=15, and the second rectangle has an area of 2×7=14.\nThus, the output should be 15, the larger area.\n\nSample Input 2\n\n100 600 200 300\n\nSample Output 2\n\n60000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5266, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s142247285", "group_id": "codeNet:p03827", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N int\n\tvar S string \n\tvar x, max int\n\n\tfmt.Scan(&N, &S)\n\n\tfor i := 0 ; i < len(S) ; i++ {\n\t\tif S[i] == 'I' {\n\t\t\tx++\n\t\t}else {\n\t\t\tx--\n\t\t}\n\t\tif max < x{\n\t\t\tmax = x\n\t\t}\n\t\t// fmt.Println(x)\n\t}\n\tfmt.Println(max)\n}", "language": "Go", "metadata": {"date": 1582049581, "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/s142247285.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142247285", "user_id": "u283295031"}, "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\tvar x, max int\n\n\tfmt.Scan(&N, &S)\n\n\tfor i := 0 ; i < len(S) ; i++ {\n\t\tif S[i] == 'I' {\n\t\t\tx++\n\t\t}else {\n\t\t\tx--\n\t\t}\n\t\tif max < x{\n\t\t\tmax = x\n\t\t}\n\t\t// fmt.Println(x)\n\t}\n\tfmt.Println(max)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 254, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s018068625", "group_id": "codeNet:p03828", "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\ntype StackData struct {\n\tdata interface{}\n\tnext *StackData\n}\n\ntype Stack struct {\n\tsp *StackData\n\ttop int\n}\n\nfunc NewStack() *Stack {\n\treturn &Stack{top: 0}\n}\n\nfunc (s *Stack) Push(data interface{}) {\n\ts.sp = &StackData{data: data, next: s.sp}\n\ts.top++\n}\n\nfunc (s *Stack) Pop() interface{} {\n\tif s.top > 0 {\n\t\titem := s.sp.data\n\t\ts.sp = s.sp.next\n\t\ts.top--\n\t\treturn item\n\t}\n\treturn nil\n}\n\nfunc (s *Stack) Peek() interface{} {\n\tif s.top > 0 {\n\t\treturn s.sp.data\n\t}\n\treturn nil\n}\n\nfunc (s *Stack) IsEmpty() bool {\n\tif s.top == 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (s *Stack) Size() int {\n\treturn s.top\n}\n\ntype Pair struct {\n\tp int64\n\tnum int64\n}\n\nfunc primeFactorize(n int64) *Stack {\n\ts := NewStack()\n\tfor p := int64(2); p*p <= n; p++ {\n\t\tif n%p != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tnum := int64(0)\n\t\tfor n%p == 0 {\n\t\t\tnum++\n\t\t\tn /= p\n\t\t}\n\t\ts.Push(Pair{p: p, num: num})\n\t}\n\tif n != 1 {\n\t\ts.Push(Pair{n, 1})\n\t}\n\treturn s\n}\n\nconst MOD = 1000000007\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := int64(nextInt())\n\tans := int64(1)\n\tm := map[int64]int64{}\n\tfor i := int64(2); i <= N; i++ {\n\t\tvec := primeFactorize(i)\n\n\t\tfor !vec.IsEmpty() {\n\t\t\tp := vec.Pop().(Pair)\n\t\t\tm[p.p] += p.num\n\t\t}\n\t}\n\n\tfor _, v := range m {\n\t\tans *= (v + 1)\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1564671844, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03828.html", "problem_id": "p03828", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03828/input.txt", "sample_output_relpath": "derived/input_output/data/p03828/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03828/Go/s018068625.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s018068625", "user_id": "u710190793"}, "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 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 StackData struct {\n\tdata interface{}\n\tnext *StackData\n}\n\ntype Stack struct {\n\tsp *StackData\n\ttop int\n}\n\nfunc NewStack() *Stack {\n\treturn &Stack{top: 0}\n}\n\nfunc (s *Stack) Push(data interface{}) {\n\ts.sp = &StackData{data: data, next: s.sp}\n\ts.top++\n}\n\nfunc (s *Stack) Pop() interface{} {\n\tif s.top > 0 {\n\t\titem := s.sp.data\n\t\ts.sp = s.sp.next\n\t\ts.top--\n\t\treturn item\n\t}\n\treturn nil\n}\n\nfunc (s *Stack) Peek() interface{} {\n\tif s.top > 0 {\n\t\treturn s.sp.data\n\t}\n\treturn nil\n}\n\nfunc (s *Stack) IsEmpty() bool {\n\tif s.top == 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (s *Stack) Size() int {\n\treturn s.top\n}\n\ntype Pair struct {\n\tp int64\n\tnum int64\n}\n\nfunc primeFactorize(n int64) *Stack {\n\ts := NewStack()\n\tfor p := int64(2); p*p <= n; p++ {\n\t\tif n%p != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tnum := int64(0)\n\t\tfor n%p == 0 {\n\t\t\tnum++\n\t\t\tn /= p\n\t\t}\n\t\ts.Push(Pair{p: p, num: num})\n\t}\n\tif n != 1 {\n\t\ts.Push(Pair{n, 1})\n\t}\n\treturn s\n}\n\nconst MOD = 1000000007\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := int64(nextInt())\n\tans := int64(1)\n\tm := map[int64]int64{}\n\tfor i := int64(2); i <= N; i++ {\n\t\tvec := primeFactorize(i)\n\n\t\tfor !vec.IsEmpty() {\n\t\t\tp := vec.Pop().(Pair)\n\t\t\tm[p.p] += p.num\n\t\t}\n\t}\n\n\tfor _, v := range m {\n\t\tans *= (v + 1)\n\t\tans %= MOD\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "sample_input": "3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03828", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given an integer N.\nFind the number of the positive divisors of N!, modulo 10^9+7.\n\nConstraints\n\n1≤N≤10^3\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the positive divisors of N!, modulo 10^9+7.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n4\n\nThere are four divisors of 3! =6: 1, 2, 3 and 6. Thus, the output should be 4.\n\nSample Input 2\n\n6\n\nSample Output 2\n\n30\n\nSample Input 3\n\n1000\n\nSample Output 3\n\n972926972", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1465, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s284437230", "group_id": "codeNet:p03829", "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\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, a, b int\nvar X []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, a, b = tmp[0], tmp[1], tmp[2]\n\tX = NextIntsLine()\n\tans := 0\n\tfor i := 1; i < len(X); i++ {\n\t\tbefore := X[i-1]\n\t\tcurrent := X[i]\n\t\tdist := current - before\n\t\twalkCost := dist * a\n\t\tif walkCost > b {\n\t\t\tans += b\n\t\t} else {\n\t\t\tans += walkCost\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1542431892, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03829.html", "problem_id": "p03829", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03829/input.txt", "sample_output_relpath": "derived/input_output/data/p03829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03829/Go/s284437230.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s284437230", "user_id": "u103600314"}, "prompt_components": {"gold_output": "11\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\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, a, b int\nvar X []int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\tn, a, b = tmp[0], tmp[1], tmp[2]\n\tX = NextIntsLine()\n\tans := 0\n\tfor i := 1; i < len(X); i++ {\n\t\tbefore := X[i-1]\n\t\tcurrent := X[i]\n\t\tdist := current - before\n\t\twalkCost := dist * a\n\t\tif walkCost > b {\n\t\t\tans += b\n\t\t} else {\n\t\t\tans += walkCost\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N towns on a line running east-west.\nThe towns are numbered 1 through N, in order from west to east.\nEach point on the line has a one-dimensional coordinate, and a point that is farther east has a greater coordinate value.\nThe coordinate of town i is X_i.\n\nYou are now at town 1, and you want to visit all the other towns.\nYou have two ways to travel:\n\nWalk on the line.\nYour fatigue level increases by A each time you travel a distance of 1, regardless of direction.\n\nTeleport to any location of your choice.\nYour fatigue level increases by B, regardless of the distance covered.\n\nFind the minimum possible total increase of your fatigue level when you visit all the towns in these two ways.\n\nConstraints\n\nAll input values are integers.\n\n2≤N≤10^5\n\n1≤X_i≤10^9\n\nFor all i(1≤i≤N-1), X_i b {\n\t\t\tresult += b\n\t\t} else {\n\t\t\tresult += a * (x[i] - x[i-1])\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", result)\n}", "language": "Go", "metadata": {"date": 1484888684, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03831.html", "problem_id": "p03831", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03831/input.txt", "sample_output_relpath": "derived/input_output/data/p03831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03831/Go/s087671857.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s087671857", "user_id": "u390348113"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, i int\n\tfmt.Scan(&n)\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tx := make([]int, n)\n\tfor i=0; i b {\n\t\t\tresult += b\n\t\t} else {\n\t\t\tresult += a * (x[i] - x[i-1])\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", result)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N towns on a line running east-west.\nThe towns are numbered 1 through N, in order from west to east.\nEach point on the line has a one-dimensional coordinate, and a point that is farther east has a greater coordinate value.\nThe coordinate of town i is X_i.\n\nYou are now at town 1, and you want to visit all the other towns.\nYou have two ways to travel:\n\nWalk on the line.\nYour fatigue level increases by A each time you travel a distance of 1, regardless of direction.\n\nTeleport to any location of your choice.\nYour fatigue level increases by B, regardless of the distance covered.\n\nFind the minimum possible total increase of your fatigue level when you visit all the towns in these two ways.\n\nConstraints\n\nAll input values are integers.\n\n2≤N≤10^5\n\n1≤X_i≤10^9\n\nFor all i(1≤i≤N-1), X_i 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\tK 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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tS := strings.ReplaceAll(getStr(), \",\", \" \")\n\n\tfmt.Println(S)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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 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": 1598657763, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s888773852.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s888773852", "user_id": "u534481484"}, "prompt_components": {"gold_output": "happy newyear enjoy\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\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tMOD := int(MOD)\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 init() {\n\tMOD := int(MOD)\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 < 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\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMAX = 510000\n)\n\nvar MOD int64 = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\tans := a * b % MOD\n\tif ans < 0 {\n\t\tans += MOD\n\t}\n\treturn ans\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\tK 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 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\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\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\tS := strings.ReplaceAll(getStr(), \",\", \" \")\n\n\tfmt.Println(S)\n}\n\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 and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\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 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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4015, "cpu_time_ms": 54, "memory_kb": 13740}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s451262106", "group_id": "codeNet:p03836", "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\tsx := getInt() + 2000\n\tsy := getInt() + 2000\n\ttx := getInt() + 2000\n\tty := getInt() + 2000\n\n\tM := make([][]int, 4000)\n\tfor i := 0; i < 4000; i++ {\n\t\tM[i] = make([]int, 4000)\n\t}\n\n\tresult := proc([]int{sx, sy}, []int{tx, ty}, M)\n\tresult += proc([]int{tx, ty}, []int{sx, sy}, M)\n\tresult += proc([]int{sx, sy}, []int{tx, ty}, M)\n\tresult += proc([]int{tx, ty}, []int{sx, sy}, M)\n\tfmt.Println(result)\n}\n\nfunc proc(start, end []int, m [][]int) string {\n\tm[start[1]][start[0]] = 1\n\tm[end[1]][end[0]] = 0\n\n\tpos := []int{start[0], start[1]}\n\tcommand := \"\"\n\tfor ; ; {\n\t\tif pos[0] == end[0] && pos[1] == end[1] {\n\t\t\tbreak\n\t\t}\n\n\t\tc := \"\"\n\n\t\tif pos[0] < end[0] && m[pos[1]][pos[0] + 1] != 1 {\n\t\t\tc = \"R\"\n\t\t} else if pos[0] > end[0] && m[pos[1]][pos[0] - 1] != 1 {\n\t\t\tc = \"L\"\n\t\t} else if pos[1] < end[1] && m[pos[1] + 1][pos[0]] != 1 {\n\t\t\tc = \"U\"\n\t\t} else if pos[1] > end[1] && m[pos[1] - 1][pos[0]] != 1 {\n\t\t\tc = \"D\"\n\t\t} else {\n\t\t\tif pos[0] == end[0] {\n\t\t\t\tif m[pos[1]][pos[0] + 1] != 1 {\n\t\t\t\t\tc = \"R\"\n\t\t\t\t} else if m[pos[1]][pos[0] - 1] != 1 {\n\t\t\t\t\tc = \"L\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif m[pos[1] + 1][pos[0]] != 1 {\n\t\t\t\t\tc = \"U\"\n\t\t\t\t} else if m[pos[1] - 1][pos[0]] != 1 {\n\t\t\t\t\tc = \"D\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcommand += c\n\t\tswitch c {\n\t\tcase \"U\":\n\t\t\tpos[1]++\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"D\":\n\t\t\tpos[1]--\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"L\":\n\t\t\tpos[0]--\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"R\":\n\t\t\tpos[0]++\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\t}\n\t}\n\n\tm[pos[1]][pos[0]] = 0\n\treturn command\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": 1588567686, "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/s451262106.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s451262106", "user_id": "u964273035"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\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\tsx := getInt() + 2000\n\tsy := getInt() + 2000\n\ttx := getInt() + 2000\n\tty := getInt() + 2000\n\n\tM := make([][]int, 4000)\n\tfor i := 0; i < 4000; i++ {\n\t\tM[i] = make([]int, 4000)\n\t}\n\n\tresult := proc([]int{sx, sy}, []int{tx, ty}, M)\n\tresult += proc([]int{tx, ty}, []int{sx, sy}, M)\n\tresult += proc([]int{sx, sy}, []int{tx, ty}, M)\n\tresult += proc([]int{tx, ty}, []int{sx, sy}, M)\n\tfmt.Println(result)\n}\n\nfunc proc(start, end []int, m [][]int) string {\n\tm[start[1]][start[0]] = 1\n\tm[end[1]][end[0]] = 0\n\n\tpos := []int{start[0], start[1]}\n\tcommand := \"\"\n\tfor ; ; {\n\t\tif pos[0] == end[0] && pos[1] == end[1] {\n\t\t\tbreak\n\t\t}\n\n\t\tc := \"\"\n\n\t\tif pos[0] < end[0] && m[pos[1]][pos[0] + 1] != 1 {\n\t\t\tc = \"R\"\n\t\t} else if pos[0] > end[0] && m[pos[1]][pos[0] - 1] != 1 {\n\t\t\tc = \"L\"\n\t\t} else if pos[1] < end[1] && m[pos[1] + 1][pos[0]] != 1 {\n\t\t\tc = \"U\"\n\t\t} else if pos[1] > end[1] && m[pos[1] - 1][pos[0]] != 1 {\n\t\t\tc = \"D\"\n\t\t} else {\n\t\t\tif pos[0] == end[0] {\n\t\t\t\tif m[pos[1]][pos[0] + 1] != 1 {\n\t\t\t\t\tc = \"R\"\n\t\t\t\t} else if m[pos[1]][pos[0] - 1] != 1 {\n\t\t\t\t\tc = \"L\"\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif m[pos[1] + 1][pos[0]] != 1 {\n\t\t\t\t\tc = \"U\"\n\t\t\t\t} else if m[pos[1] - 1][pos[0]] != 1 {\n\t\t\t\t\tc = \"D\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcommand += c\n\t\tswitch c {\n\t\tcase \"U\":\n\t\t\tpos[1]++\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"D\":\n\t\t\tpos[1]--\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"L\":\n\t\t\tpos[0]--\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\tcase \"R\":\n\t\t\tpos[0]++\n\t\t\tm[pos[1]][pos[0]] = 1\n\t\t}\n\t}\n\n\tm[pos[1]][pos[0]] = 0\n\treturn command\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6864, "cpu_time_ms": 59, "memory_kb": 73984}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s738107593", "group_id": "codeNet:p03836", "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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tsx, sy, tx, ty := sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()\n\trev := make(map[rune]string)\n\trev['R'] = \"L\"\n\trev['L'] = \"R\"\n\trev['U'] = \"D\"\n\trev['D'] = \"U\"\n\tans := \"\"\n\troute := \"\"\n\tfor i := 0; i < tx-sx; i++ {\n\t\troute += \"R\"\n\t}\n\tfor i := 0; i < ty-sy; i++ {\n\t\troute += \"U\"\n\t}\n\tans += route\n\tfor i := 0; i < len(route); i++ {\n\t\tans += rev[rune(route[i])]\n\t}\n\troute = \"\"\n\troute += \"D\"\n\tfor i := 0; i < tx-sx+1; i++ {\n\t\troute += \"R\"\n\t}\n\tfor i := 0; i < ty-sy+1; i++ {\n\t\troute += \"U\"\n\t}\n\troute += \"L\"\n\tans += route\n\tfor i := 0; i < len(route); i++ {\n\t\tans += rev[rune(route[i])]\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577819357, "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/s738107593.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s738107593", "user_id": "u924691798"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tsx, sy, tx, ty := sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()\n\trev := make(map[rune]string)\n\trev['R'] = \"L\"\n\trev['L'] = \"R\"\n\trev['U'] = \"D\"\n\trev['D'] = \"U\"\n\tans := \"\"\n\troute := \"\"\n\tfor i := 0; i < tx-sx; i++ {\n\t\troute += \"R\"\n\t}\n\tfor i := 0; i < ty-sy; i++ {\n\t\troute += \"U\"\n\t}\n\tans += route\n\tfor i := 0; i < len(route); i++ {\n\t\tans += rev[rune(route[i])]\n\t}\n\troute = \"\"\n\troute += \"D\"\n\tfor i := 0; i < tx-sx+1; i++ {\n\t\troute += \"R\"\n\t}\n\tfor i := 0; i < ty-sy+1; i++ {\n\t\troute += \"U\"\n\t}\n\troute += \"L\"\n\tans += route\n\tfor i := 0; i < len(route); i++ {\n\t\tans += rev[rune(route[i])]\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2238, "cpu_time_ms": 31, "memory_kb": 7680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s001383053", "group_id": "codeNet:p03836", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solve() {\n\tsx, sy := getInt(), getInt()\n\ttx, ty := getInt(), getInt()\n\tdx, dy := tx-sx, ty-sy\n\n\tans := \"\"\n\tans += strings.Repeat(\"R\", dx)\n\tans += strings.Repeat(\"U\", dy)\n\tans += strings.Repeat(\"L\", dx)\n\tans += strings.Repeat(\"D\", dy)\n\n\tans += \"D\" + strings.Repeat(\"R\", dx+1)\n\tans += strings.Repeat(\"U\", dy+1) + \"L\"\n\tans += \"U\" + strings.Repeat(\"L\", dx+1)\n\tans += strings.Repeat(\"D\", dy+1) + \"R\"\n\n\tfmt.Fprintln(wr, ans)\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\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\nfunc getRunes() []rune {\n\treturn []rune(getString())\n}\n", "language": "Go", "metadata": {"date": 1574829654, "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/s001383053.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s001383053", "user_id": "u543933043"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\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 solve() {\n\tsx, sy := getInt(), getInt()\n\ttx, ty := getInt(), getInt()\n\tdx, dy := tx-sx, ty-sy\n\n\tans := \"\"\n\tans += strings.Repeat(\"R\", dx)\n\tans += strings.Repeat(\"U\", dy)\n\tans += strings.Repeat(\"L\", dx)\n\tans += strings.Repeat(\"D\", dy)\n\n\tans += \"D\" + strings.Repeat(\"R\", dx+1)\n\tans += strings.Repeat(\"U\", dy+1) + \"L\"\n\tans += \"U\" + strings.Repeat(\"L\", dx+1)\n\tans += strings.Repeat(\"D\", dy+1) + \"R\"\n\n\tfmt.Fprintln(wr, ans)\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\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\nfunc getRunes() []rune {\n\treturn []rune(getString())\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1130, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s851114910", "group_id": "codeNet:p03836", "input_text": "package main\n\nimport \"fmt\"\n\ntype Queue struct {\n\tq []*point\n}\n\nfunc (q *Queue) Push(i *point) {\n\tq.q = append(q.q, i)\n}\n\nfunc (q *Queue) Shift() *point {\n\ttop := q.q[0]\n\tq.q = q.q[1:]\n\treturn top\n}\n\nfunc (q *Queue) Len() int {\n\treturn len(q.q)\n}\n\ntype Stack struct {\n\tq []pair\n}\n\nfunc (q *Stack) Push(i pair) {\n\tq.q = append(q.q, i)\n}\n\nfunc (q *Stack) Pop() pair {\n\ttop := q.q[len(q.q)-1]\n\tq.q = q.q[:len(q.q)-1]\n\treturn top\n}\n\nfunc (q *Stack) Len() int {\n\treturn len(q.q)\n}\n\nvar (\n\tq *Queue\n\tv [][]bool\n\tm [][]bool\n)\n\ntype point struct {\n\tx int\n\ty int\n\tprev *point\n}\n\ntype pair [2]int\n\nfunc (p pair) X() int {\n\treturn p[0]\n}\n\nfunc (p pair) Y() int {\n\treturn p[1]\n}\n\nvar vecs = [4]pair{\n\t{0, 1},\n\t{1, 0},\n\t{0, -1},\n\t{-1, 0},\n}\n\nvar d = map[pair]string{\n\tpair{0, 1}: \"U\",\n\tpair{1, 0}: \"R\",\n\tpair{0, -1}: \"D\",\n\tpair{-1, 0}: \"L\",\n}\n\nfunc main() {\n\tvar sx, sy, tx, ty int\n\tfmt.Scan(&sx, &sy, &tx, &ty)\n\n\tq = &Queue{}\n\n\tm = make([][]bool, 2001)\n\tfor i := 0; i < 2001; i++ {\n\t\tm[i] = make([]bool, 2001)\n\t}\n\n\tstart := &point{x: sx + 1000, y: sy + 1000}\n\tgoal := &point{x: tx + 1000, y: ty + 1000}\n\n\tfor i := 0; i < 4; i++ {\n\t\tif i%2 == 0 {\n\t\t\tBFS(start, goal)\n\t\t} else {\n\t\t\tBFS(goal, start)\n\t\t}\n\t}\n}\n\nfunc BFS(start, goal *point) {\n\tv = make([][]bool, 2001)\n\tfor i := 0; i < 2001; i++ {\n\t\tv[i] = make([]bool, 2001)\n\t}\n\tv[start.x][start.y] = true\n\tq.Push(start)\n\tfor q.Len() > 0 {\n\t\tp := q.Shift()\n\t\tif p.x == goal.x && p.y == goal.y {\n\t\t\ts := &Stack{}\n\t\t\tfor p.prev != nil {\n\t\t\t\tm[p.x][p.y] = true\n\t\t\t\ts.Push(pair{p.x - p.prev.x, p.y - p.prev.y})\n\t\t\t\tp = p.prev\n\t\t\t}\n\t\t\tfor s.Len() > 0 {\n\t\t\t\tfmt.Println(d[s.Pop()])\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tx := p.x + vecs[i].X()\n\t\t\ty := p.y + vecs[i].Y()\n\t\t\tif !v[x][y] && !m[x][y] {\n\t\t\t\tv[x][y] = true\n\t\t\t\tq.Push(&point{x: x, y: y, prev: p})\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558400523, "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/s851114910.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s851114910", "user_id": "u875592584"}, "prompt_components": {"gold_output": "UURDDLLUUURRDRDDDLLU\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype Queue struct {\n\tq []*point\n}\n\nfunc (q *Queue) Push(i *point) {\n\tq.q = append(q.q, i)\n}\n\nfunc (q *Queue) Shift() *point {\n\ttop := q.q[0]\n\tq.q = q.q[1:]\n\treturn top\n}\n\nfunc (q *Queue) Len() int {\n\treturn len(q.q)\n}\n\ntype Stack struct {\n\tq []pair\n}\n\nfunc (q *Stack) Push(i pair) {\n\tq.q = append(q.q, i)\n}\n\nfunc (q *Stack) Pop() pair {\n\ttop := q.q[len(q.q)-1]\n\tq.q = q.q[:len(q.q)-1]\n\treturn top\n}\n\nfunc (q *Stack) Len() int {\n\treturn len(q.q)\n}\n\nvar (\n\tq *Queue\n\tv [][]bool\n\tm [][]bool\n)\n\ntype point struct {\n\tx int\n\ty int\n\tprev *point\n}\n\ntype pair [2]int\n\nfunc (p pair) X() int {\n\treturn p[0]\n}\n\nfunc (p pair) Y() int {\n\treturn p[1]\n}\n\nvar vecs = [4]pair{\n\t{0, 1},\n\t{1, 0},\n\t{0, -1},\n\t{-1, 0},\n}\n\nvar d = map[pair]string{\n\tpair{0, 1}: \"U\",\n\tpair{1, 0}: \"R\",\n\tpair{0, -1}: \"D\",\n\tpair{-1, 0}: \"L\",\n}\n\nfunc main() {\n\tvar sx, sy, tx, ty int\n\tfmt.Scan(&sx, &sy, &tx, &ty)\n\n\tq = &Queue{}\n\n\tm = make([][]bool, 2001)\n\tfor i := 0; i < 2001; i++ {\n\t\tm[i] = make([]bool, 2001)\n\t}\n\n\tstart := &point{x: sx + 1000, y: sy + 1000}\n\tgoal := &point{x: tx + 1000, y: ty + 1000}\n\n\tfor i := 0; i < 4; i++ {\n\t\tif i%2 == 0 {\n\t\t\tBFS(start, goal)\n\t\t} else {\n\t\t\tBFS(goal, start)\n\t\t}\n\t}\n}\n\nfunc BFS(start, goal *point) {\n\tv = make([][]bool, 2001)\n\tfor i := 0; i < 2001; i++ {\n\t\tv[i] = make([]bool, 2001)\n\t}\n\tv[start.x][start.y] = true\n\tq.Push(start)\n\tfor q.Len() > 0 {\n\t\tp := q.Shift()\n\t\tif p.x == goal.x && p.y == goal.y {\n\t\t\ts := &Stack{}\n\t\t\tfor p.prev != nil {\n\t\t\t\tm[p.x][p.y] = true\n\t\t\t\ts.Push(pair{p.x - p.prev.x, p.y - p.prev.y})\n\t\t\t\tp = p.prev\n\t\t\t}\n\t\t\tfor s.Len() > 0 {\n\t\t\t\tfmt.Println(d[s.Pop()])\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tx := p.x + vecs[i].X()\n\t\t\ty := p.y + vecs[i].Y()\n\t\t\tif !v[x][y] && !m[x][y] {\n\t\t\t\tv[x][y] = true\n\t\t\t\tq.Push(&point{x: x, y: y, prev: p})\n\t\t\t}\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 560, "memory_kb": 92032}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s974522769", "group_id": "codeNet:p03844", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b int\n\tvar op string\n\tfmt.Scan(&a,&op,&b)\n\t\n\tif op == \"+\" {\n\t\tfmt.Println(a+b)\n\t} else {\n\t\tfmt.Println(a-b)\n\t}\n}", "language": "Go", "metadata": {"date": 1579024028, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03844.html", "problem_id": "p03844", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03844/input.txt", "sample_output_relpath": "derived/input_output/data/p03844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03844/Go/s974522769.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s974522769", "user_id": "u689167014"}, "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\tvar op string\n\tfmt.Scan(&a,&op,&b)\n\t\n\tif op == \"+\" {\n\t\tfmt.Println(a+b)\n\t} else {\n\t\tfmt.Println(a-b)\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nJoisino wants to evaluate the formula \"A op B\".\nHere, A and B are integers, and the binary operator op is either + or -.\nYour task is to evaluate the formula instead of her.\n\nConstraints\n\n1≦A,B≦10^9\n\nop is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA op B\n\nOutput\n\nEvaluate the formula and print the result.\n\nSample Input 1\n\n1 + 2\n\nSample Output 1\n\n3\n\nSince 1 + 2 = 3, the output should be 3.\n\nSample Input 2\n\n5 - 7\n\nSample Output 2\n\n-2", "sample_input": "1 + 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03844", "source_text": "Score : 100 points\n\nProblem Statement\n\nJoisino wants to evaluate the formula \"A op B\".\nHere, A and B are integers, and the binary operator op is either + or -.\nYour task is to evaluate the formula instead of her.\n\nConstraints\n\n1≦A,B≦10^9\n\nop is either + or -.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nA op B\n\nOutput\n\nEvaluate the formula and print the result.\n\nSample Input 1\n\n1 + 2\n\nSample Output 1\n\n3\n\nSince 1 + 2 = 3, the output should be 3.\n\nSample Input 2\n\n5 - 7\n\nSample Output 2\n\n-2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 166, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s828363237", "group_id": "codeNet:p03852", "input_text": "package main\n\nimport \"fmt\"\n\nfunc check(b byte) string {\n\tswitch b {\n\tcase 'a', 'e', 'i', 'o', 'u':\n\t\treturn \"vowel\"\n\t}\n\treturn \"consonant\"\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(check(s[0]))\n}\n", "language": "Go", "metadata": {"date": 1548050255, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03852.html", "problem_id": "p03852", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03852/input.txt", "sample_output_relpath": "derived/input_output/data/p03852/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03852/Go/s828363237.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s828363237", "user_id": "u113872560"}, "prompt_components": {"gold_output": "vowel\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc check(b byte) string {\n\tswitch b {\n\tcase 'a', 'e', 'i', 'o', 'u':\n\t\treturn \"vowel\"\n\t}\n\treturn \"consonant\"\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(check(s[0]))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "sample_input": "a\n"}, "reference_outputs": ["vowel\n"], "source_document_id": "p03852", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven a lowercase English letter c, determine whether it is a vowel. Here, there are five vowels in the English alphabet: a, e, i, o and u.\n\nConstraints\n\nc is a lowercase English letter.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nc\n\nOutput\n\nIf c is a vowel, print vowel. Otherwise, print consonant.\n\nSample Input 1\n\na\n\nSample Output 1\n\nvowel\n\nSince a is a vowel, print vowel.\n\nSample Input 2\n\nz\n\nSample Output 2\n\nconsonant\n\nSample Input 3\n\ns\n\nSample Output 3\n\nconsonant", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 212, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s486349087", "group_id": "codeNet:p03853", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tvar c string\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&c)\n\t\tfmt.Println(c)\n\t\tfmt.Println(c)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1577112997, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03853.html", "problem_id": "p03853", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03853/input.txt", "sample_output_relpath": "derived/input_output/data/p03853/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03853/Go/s486349087.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s486349087", "user_id": "u902409225"}, "prompt_components": {"gold_output": "*.\n*.\n.*\n.*\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tvar c string\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&c)\n\t\tfmt.Println(c)\n\t\tfmt.Println(c)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.\n\nExtend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).\n\nConstraints\n\n1≦H, W≦100\n\nC_{i,j} is either . or *.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\nC_{1,1}...C_{1,W}\n:\nC_{H,1}...C_{H,W}\n\nOutput\n\nPrint the extended image.\n\nSample Input 1\n\n2 2\n*.\n.*\n\nSample Output 1\n\n*.\n*.\n.*\n.*\n\nSample Input 2\n\n1 4\n***.\n\nSample Output 2\n\n***.\n***.\n\nSample Input 3\n\n9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*..*.*.......\n........**.*........\n.........**.........\n\nSample Output 3\n\n.....***....***.....\n.....***....***.....\n....*...*..*...*....\n....*...*..*...*....\n...*.....**.....*...\n...*.....**.....*...\n...*.....*......*...\n...*.....*......*...\n....*.....*....*....\n....*.....*....*....\n.....**..*...**.....\n.....**..*...**.....\n.......*..*.*.......\n.......*..*.*.......\n........**.*........\n........**.*........\n.........**.........\n.........**.........", "sample_input": "2 2\n*.\n.*\n"}, "reference_outputs": ["*.\n*.\n.*\n.*\n"], "source_document_id": "p03853", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or *. The character representing the pixel at the i-th row from the top and the j-th column from the left, is denoted by C_{i,j}.\n\nExtend this image vertically so that its height is doubled. That is, print a image with a height of 2H pixels and a width of W pixels where the pixel at the i-th row and j-th column is equal to C_{(i+1)/2,j} (the result of division is rounded down).\n\nConstraints\n\n1≦H, W≦100\n\nC_{i,j} is either . or *.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nH W\nC_{1,1}...C_{1,W}\n:\nC_{H,1}...C_{H,W}\n\nOutput\n\nPrint the extended image.\n\nSample Input 1\n\n2 2\n*.\n.*\n\nSample Output 1\n\n*.\n*.\n.*\n.*\n\nSample Input 2\n\n1 4\n***.\n\nSample Output 2\n\n***.\n***.\n\nSample Input 3\n\n9 20\n.....***....***.....\n....*...*..*...*....\n...*.....**.....*...\n...*.....*......*...\n....*.....*....*....\n.....**..*...**.....\n.......*..*.*.......\n........**.*........\n.........**.........\n\nSample Output 3\n\n.....***....***.....\n.....***....***.....\n....*...*..*...*....\n....*...*..*...*....\n...*.....**.....*...\n...*.....**.....*...\n...*.....*......*...\n...*.....*......*...\n....*.....*....*....\n....*.....*....*....\n.....**..*...**.....\n.....**..*...**.....\n.......*..*.*.......\n.......*..*.*.......\n........**.*........\n........**.*........\n.........**.........\n.........**.........", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 168, "cpu_time_ms": 7, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s865408092", "group_id": "codeNet:p03855", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst scBufSize = 1 * 1024 * 1024 // 1MB\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, scBufSize), scBufSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc main() {\n\tn := scani()\n\tk := scani()\n\tl := scani()\n\n\troad := con(n, k)\n\trail := con(n, l)\n\n\tfor i := 0; i < n; i++ {\n\t\tc := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif road[i][j] && rail[i][j] {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tos.Stdout.WriteString(strconv.Itoa(c))\n\t}\n}\n\nfunc con(n, k int) [][]bool {\n\troad := getmap(n)\n\tfor i := 0; i < k; i++ {\n\t\to, d := scanRoad()\n\t\troad[o][d] = true\n\t\troad[d][o] = true\n\t}\n\ts1 := 0\n\tfor {\n\t\tconnect(n, road)\n\t\tnew := sum(road)\n\t\tif s1 == new {\n\t\t\tbreak\n\t\t}\n\t\ts1 = new\n\t}\n\treturn road\n}\n\nfunc getmap(n int) [][]bool {\n\tr := make([][]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\ts := make([]bool, n)\n\t\ts[i] = true\n\t\tr[i] = s\n\t}\n\treturn r\n}\n\nfunc connect(n int, r [][]bool) [][]bool {\n\tret := getmap(n)\n\tfor i, a := range r {\n\t\tfor j, b := range a {\n\t\t\tif b {\n\t\t\t\tret[i] = add(r[i], r[j])\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc add(a, b []bool) []bool {\n\tfor i := range a {\n\t\ta[i] = a[i] || b[i]\n\t}\n\treturn a\n}\n\nfunc sum(r [][]bool) int {\n\ts := 0\n\tfor i := 0; i < len(r); i++ {\n\t\tfor _, b := range r[i] {\n\t\t\tif b {\n\t\t\t\ts++\n\t\t\t}\n\t\t}\n\t}\n\treturn s\n}\nfunc scani() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc scanRoad() (o, d int) {\n\to = scani() - 1\n\td = scani() - 1\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1566618197, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03855.html", "problem_id": "p03855", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03855/input.txt", "sample_output_relpath": "derived/input_output/data/p03855/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03855/Go/s865408092.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s865408092", "user_id": "u237917506"}, "prompt_components": {"gold_output": "1 2 2 1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst scBufSize = 1 * 1024 * 1024 // 1MB\nvar sc = func() *bufio.Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, scBufSize), scBufSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}()\n\nfunc main() {\n\tn := scani()\n\tk := scani()\n\tl := scani()\n\n\troad := con(n, k)\n\trail := con(n, l)\n\n\tfor i := 0; i < n; i++ {\n\t\tc := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif road[i][j] && rail[i][j] {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tos.Stdout.WriteString(strconv.Itoa(c))\n\t}\n}\n\nfunc con(n, k int) [][]bool {\n\troad := getmap(n)\n\tfor i := 0; i < k; i++ {\n\t\to, d := scanRoad()\n\t\troad[o][d] = true\n\t\troad[d][o] = true\n\t}\n\ts1 := 0\n\tfor {\n\t\tconnect(n, road)\n\t\tnew := sum(road)\n\t\tif s1 == new {\n\t\t\tbreak\n\t\t}\n\t\ts1 = new\n\t}\n\treturn road\n}\n\nfunc getmap(n int) [][]bool {\n\tr := make([][]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\ts := make([]bool, n)\n\t\ts[i] = true\n\t\tr[i] = s\n\t}\n\treturn r\n}\n\nfunc connect(n int, r [][]bool) [][]bool {\n\tret := getmap(n)\n\tfor i, a := range r {\n\t\tfor j, b := range a {\n\t\t\tif b {\n\t\t\t\tret[i] = add(r[i], r[j])\n\t\t\t}\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc add(a, b []bool) []bool {\n\tfor i := range a {\n\t\ta[i] = a[i] || b[i]\n\t}\n\treturn a\n}\n\nfunc sum(r [][]bool) int {\n\ts := 0\n\tfor i := 0; i < len(r); i++ {\n\t\tfor _, b := range r[i] {\n\t\t\tif b {\n\t\t\t\ts++\n\t\t\t}\n\t\t}\n\t}\n\treturn s\n}\nfunc scani() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\nfunc scanRoad() (o, d int) {\n\to = scani() - 1\n\td = scani() - 1\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "sample_input": "4 3 1\n1 2\n2 3\n3 4\n2 3\n"}, "reference_outputs": ["1 2 2 1\n"], "source_document_id": "p03855", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cities. There are also K roads and L railways, extending between the cities.\nThe i-th road bidirectionally connects the p_i-th and q_i-th cities, and the i-th railway bidirectionally connects the r_i-th and s_i-th cities.\nNo two roads connect the same pair of cities. Similarly, no two railways connect the same pair of cities.\n\nWe will say city A and B are connected by roads if city B is reachable from city A by traversing some number of roads. Here, any city is considered to be connected to itself by roads.\nWe will also define connectivity by railways similarly.\n\nFor each city, find the number of the cities connected to that city by both roads and railways.\n\nConstraints\n\n2 ≦ N ≦ 2*10^5\n\n1 ≦ K, L≦ 10^5\n\n1 ≦ p_i, q_i, r_i, s_i ≦ N\n\np_i < q_i\n\nr_i < s_i\n\nWhen i ≠ j, (p_i, q_i) ≠ (p_j, q_j)\n\nWhen i ≠ j, (r_i, s_i) ≠ (r_j, s_j)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K L\np_1 q_1\n:\np_K q_K\nr_1 s_1\n:\nr_L s_L\n\nOutput\n\nPrint N integers. The i-th of them should represent the number of the cities connected to the i-th city by both roads and railways.\n\nSample Input 1\n\n4 3 1\n1 2\n2 3\n3 4\n2 3\n\nSample Output 1\n\n1 2 2 1\n\nAll the four cities are connected to each other by roads.\n\nBy railways, only the second and third cities are connected. Thus, the answers for the cities are 1, 2, 2 and 1, respectively.\n\nSample Input 2\n\n4 2 2\n1 2\n2 3\n1 4\n2 3\n\nSample Output 2\n\n1 2 2 1\n\nSample Input 3\n\n7 4 4\n1 2\n2 3\n2 5\n6 7\n3 5\n4 5\n3 4\n6 7\n\nSample Output 3\n\n1 1 2 1 2 2 2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1448, "cpu_time_ms": 2624, "memory_kb": 20864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s080241918", "group_id": "codeNet:p03858", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,100)}\n n,a,b := input.Next3Ints()\n a,b = a-1,b-1\n x := make([]int,n)\n y := make([]int,n)\n p := make(Pairs,n)\n q := make(Pairs,n)\n for i:=0;i y { return x }\n return y\n}\nfunc abs(x int) int {\n if x < 0 { return -x }\n return x\n}\n\ntype Pair struct { f,s,i int }\nfunc(p Pair) Less(q Pair) bool {\n if p.f == q.f { return p.s < q.s }\n return p.f < q.f\n}\ntype Pairs []Pair\nfunc(p Pairs) Len() int { return len(p) }\nfunc(p Pairs) Swap(i,j int) { p[i],p[j] = p[j],p[i] }\nfunc(p Pairs) Less(i,j int) bool { return p[i].Less(p[j]) }\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) Next2Ints() (int,int) {\n s := strings.Fields(i.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(i *Input) Next3Ints() (int,int,int) {\n s := strings.Fields(i.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.Atoi(s[2])\n return x,y,z\n}", "language": "Go", "metadata": {"date": 1566939738, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03858.html", "problem_id": "p03858", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03858/input.txt", "sample_output_relpath": "derived/input_output/data/p03858/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03858/Go/s080241918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s080241918", "user_id": "u506403362"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n input := Input{bufio.NewReaderSize(os.Stdin,100)}\n n,a,b := input.Next3Ints()\n a,b = a-1,b-1\n x := make([]int,n)\n y := make([]int,n)\n p := make(Pairs,n)\n q := make(Pairs,n)\n for i:=0;i y { return x }\n return y\n}\nfunc abs(x int) int {\n if x < 0 { return -x }\n return x\n}\n\ntype Pair struct { f,s,i int }\nfunc(p Pair) Less(q Pair) bool {\n if p.f == q.f { return p.s < q.s }\n return p.f < q.f\n}\ntype Pairs []Pair\nfunc(p Pairs) Len() int { return len(p) }\nfunc(p Pairs) Swap(i,j int) { p[i],p[j] = p[j],p[i] }\nfunc(p Pairs) Less(i,j int) bool { return p[i].Less(p[j]) }\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) Next2Ints() (int,int) {\n s := strings.Fields(i.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n return x,y\n}\nfunc(i *Input) Next3Ints() (int,int,int) {\n s := strings.Fields(i.NextLine())\n x,_ := strconv.Atoi(s[0])\n y,_ := strconv.Atoi(s[1])\n z,_ := strconv.Atoi(s[2])\n return x,y,z\n}", "problem_context": "Score : 900 points\n\nProblem Statement\n\nThere are N pinholes on the xy-plane. The i-th pinhole is located at (x_i,y_i).\n\nWe will denote the Manhattan distance between the i-th and j-th pinholes as d(i,j)(=|x_i-x_j|+|y_i-y_j|).\n\nYou have a peculiar pair of compasses, called Manhattan Compass.\nThis instrument always points at two of the pinholes.\nThe two legs of the compass are indistinguishable, thus we do not distinguish the following two states: the state where the compass points at the p-th and q-th pinholes, and the state where it points at the q-th and p-th pinholes.\n\nWhen the compass points at the p-th and q-th pinholes and d(p,q)=d(p,r), one of the legs can be moved so that the compass will point at the p-th and r-th pinholes.\n\nInitially, the compass points at the a-th and b-th pinholes.\nFind the number of the pairs of pinholes that can be pointed by the compass.\n\nConstraints\n\n2≦N≦10^5\n\n1≦x_i, y_i≦10^9\n\n1≦a < b≦N\n\nWhen i ≠ j, (x_i, y_i) ≠ (x_j, y_j)\n\nx_i and y_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN a b\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the number of the pairs of pinholes that can be pointed by the compass.\n\nSample Input 1\n\n5 1 2\n1 1\n4 3\n6 1\n5 5\n4 8\n\nSample Output 1\n\n4\n\nInitially, the compass points at the first and second pinholes.\n\nSince d(1,2) = d(1,3), the compass can be moved so that it will point at the first and third pinholes.\n\nSince d(1,3) = d(3,4), the compass can also point at the third and fourth pinholes.\n\nSince d(1,2) = d(2,5), the compass can also point at the second and fifth pinholes.\n\nNo other pairs of pinholes can be pointed by the compass, thus the answer is 4.\n\nSample Input 2\n\n6 2 3\n1 3\n5 3\n3 5\n8 4\n4 7\n2 5\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8 1 2\n1 5\n4 3\n8 2\n4 7\n8 8\n3 3\n6 6\n4 8\n\nSample Output 3\n\n7", "sample_input": "5 1 2\n1 1\n4 3\n6 1\n5 5\n4 8\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03858", "source_text": "Score : 900 points\n\nProblem Statement\n\nThere are N pinholes on the xy-plane. The i-th pinhole is located at (x_i,y_i).\n\nWe will denote the Manhattan distance between the i-th and j-th pinholes as d(i,j)(=|x_i-x_j|+|y_i-y_j|).\n\nYou have a peculiar pair of compasses, called Manhattan Compass.\nThis instrument always points at two of the pinholes.\nThe two legs of the compass are indistinguishable, thus we do not distinguish the following two states: the state where the compass points at the p-th and q-th pinholes, and the state where it points at the q-th and p-th pinholes.\n\nWhen the compass points at the p-th and q-th pinholes and d(p,q)=d(p,r), one of the legs can be moved so that the compass will point at the p-th and r-th pinholes.\n\nInitially, the compass points at the a-th and b-th pinholes.\nFind the number of the pairs of pinholes that can be pointed by the compass.\n\nConstraints\n\n2≦N≦10^5\n\n1≦x_i, y_i≦10^9\n\n1≦a < b≦N\n\nWhen i ≠ j, (x_i, y_i) ≠ (x_j, y_j)\n\nx_i and y_i are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN a b\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the number of the pairs of pinholes that can be pointed by the compass.\n\nSample Input 1\n\n5 1 2\n1 1\n4 3\n6 1\n5 5\n4 8\n\nSample Output 1\n\n4\n\nInitially, the compass points at the first and second pinholes.\n\nSince d(1,2) = d(1,3), the compass can be moved so that it will point at the first and third pinholes.\n\nSince d(1,3) = d(3,4), the compass can also point at the third and fourth pinholes.\n\nSince d(1,2) = d(2,5), the compass can also point at the second and fifth pinholes.\n\nNo other pairs of pinholes can be pointed by the compass, thus the answer is 4.\n\nSample Input 2\n\n6 2 3\n1 3\n5 3\n3 5\n8 4\n4 7\n2 5\n\nSample Output 2\n\n4\n\nSample Input 3\n\n8 1 2\n1 5\n4 3\n8 2\n4 7\n8 8\n3 3\n6 6\n4 8\n\nSample Output 3\n\n7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2828, "cpu_time_ms": 3162, "memory_kb": 233396}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256567101", "group_id": "codeNet:p03861", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tfmt.Println(b/x - (a-1)/x)\n}\n", "language": "Go", "metadata": {"date": 1558404019, "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/s256567101.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s256567101", "user_id": "u330039499"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tfmt.Println(b/x - (a-1)/x)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 111, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s856285729", "group_id": "codeNet:p03861", "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\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\nfunc (io *Io) PrintfLn(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format + \"\\n\", a...)\n}\n\nfunc (io *Io) PrintIntLn(a ...int) {\n\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\nfunc (io *Io) PrintStringLn(a ...string) {\n\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\ntype Tuple2 struct {\n\tfirst, second int\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\ta, b, x := io.NextLong(), io.NextLong(), io.NextLong()\n\tdivA := (a - 1) / x\n\tdivB := b / x\n\tif a == 0 {\n\t\tfmt.Println(divB + 1)\n\t} else {\n\t\tfmt.Println(divB - divA)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1481945035, "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/s856285729.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s856285729", "user_id": "u015679112"}, "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\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\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\nfunc (io *Io) PrintfLn(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format + \"\\n\", a...)\n}\n\nfunc (io *Io) PrintIntLn(a ...int) {\n\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\nfunc (io *Io) PrintStringLn(a ...string) {\n\tfor i, v := range a {\n\t\tif i > 0 {\n\t\t\tio.writer.WriteByte(' ')\n\t\t}\n\t\tfmt.Fprint(io.writer, v)\n\t}\n\tio.writer.WriteByte('\\n')\n}\n\ntype Tuple2 struct {\n\tfirst, second int\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\ta, b, x := io.NextLong(), io.NextLong(), io.NextLong()\n\tdivA := (a - 1) / x\n\tdivB := b / x\n\tif a == 0 {\n\t\tfmt.Println(divB + 1)\n\t} else {\n\t\tfmt.Println(divB - divA)\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2056, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s593685233", "group_id": "codeNet:p03862", "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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN, x := sc.nextInt(), sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tans := 0\n\tfor i := 1; i < N; i++ {\n\t\tsum := A[i] + A[i-1]\n\t\tif sum > x {\n\t\t\tA[i] = max(A[i]-sum+x, 0)\n\t\t\tans += sum - x\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1577917035, "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/s593685233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593685233", "user_id": "u924691798"}, "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\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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN, x := sc.nextInt(), sc.nextInt()\n\tA := sc.nextIntSlice(N)\n\tans := 0\n\tfor i := 1; i < N; i++ {\n\t\tsum := A[i] + A[i-1]\n\t\tif sum > x {\n\t\t\tA[i] = max(A[i]-sum+x, 0)\n\t\t\tans += sum - x\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1837, "cpu_time_ms": 30, "memory_kb": 3072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s630129217", "group_id": "codeNet:p03921", "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\tinf = 10000000071000000\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\nfunc main() {\n\tn := goint();m := goint()\n\tuni := &UnionFind{}\n\tuni.uniInit(n+m)\n\tfor i:=0;i a[i]{\n\t\t\tans = a[i]\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} else {\n\t\treturn -n\n\t}\n}\n\nfunc max(a ...int) int {\n\tans := a[0]\n\tfor i:=1;i a[i]{\n\t\t\tans = a[i]\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} else {\n\t\treturn -n\n\t}\n}\n\nfunc max(a ...int) int {\n\tans := a[0]\n\tfor i:=1;i 0 {\n\t\tv := q[0]\n\t\tq = q[1:]\n\t\tif !seen[v] {\n\t\t\tseen[v] = true\n\t\t\tq = append(q, g[v]...)\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif !seen[i] {\n\t\t\tfmt.Fprintln(w, \"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(w, \"YES\")\n\treturn\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": 1480198111, "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/s173618292.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s173618292", "user_id": "u755406270"}, "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\"strings\"\n)\n\nfunc main() {\n\tif false {\n\t\ttest()\n\t} else {\n\t\tsolve(bufio.NewReader(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\n\tg := make(map[int][]int)\n\n\tfor i := 0; i < n; i++ {\n\t\tvar langs int\n\t\tfmt.Fscan(r, &langs)\n\t\tg[i] = make([]int, 0, 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\tlangi := n + lang - 1\n\t\t\tg[i] = append(g[i], langi)\n\t\t\tg[langi] = append(g[langi], i)\n\t\t}\n\t}\n\n\tseen := make([]bool, n+m)\n\tq := []int{0}\n\tfor len(q) > 0 {\n\t\tv := q[0]\n\t\tq = q[1:]\n\t\tif !seen[v] {\n\t\t\tseen[v] = true\n\t\t\tq = append(q, g[v]...)\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif !seen[i] {\n\t\t\tfmt.Fprintln(w, \"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(w, \"YES\")\n\treturn\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 296, "memory_kb": 17536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s047906699", "group_id": "codeNet:p03921", "input_text": "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, M := sc.NextInt(), sc.NextInt()\n\tlist := make([][]int, M)\n\thas := make([][]int, N)\n\n\tfor i := 0; i < M; i++ {\n\t\tlist[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tK := sc.NextInt()\n\t\thas[i] = make([]int, K)\n\n\t\tfor j := 0; j < K; j++ {\n\t\t\tk := sc.NextInt() - 1\n\t\t\tlist[k] = append(list[k], i)\n\t\t\thas[i][j] = k\n\t\t}\n\t}\n\n\tstart := 0\n\tcheck := make([]bool, N)\n\tqueue := make([]int, N)\n\tcheck[start] = true\n\tqueue[0] = start\n\tlast := 1\n\tfor p := 0; p < last; p++ {\n\t\tcurrent := queue[p]\n\t\tfor _, k := range has[current] {\n\t\t\tfor _, nx := range list[k] {\n\t\t\t\tif check[nx] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tprintln(last, nx)\n\n\t\t\t\tqueue[last] = nx\n\t\t\t\tlast++\n\t\t\t\tcheck[nx] = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\t}\n\tif last == N {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\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, 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}", "language": "Go", "metadata": {"date": 1480189386, "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/s047906699.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s047906699", "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, M := sc.NextInt(), sc.NextInt()\n\tlist := make([][]int, M)\n\thas := make([][]int, N)\n\n\tfor i := 0; i < M; i++ {\n\t\tlist[i] = make([]int, 0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tK := sc.NextInt()\n\t\thas[i] = make([]int, K)\n\n\t\tfor j := 0; j < K; j++ {\n\t\t\tk := sc.NextInt() - 1\n\t\t\tlist[k] = append(list[k], i)\n\t\t\thas[i][j] = k\n\t\t}\n\t}\n\n\tstart := 0\n\tcheck := make([]bool, N)\n\tqueue := make([]int, N)\n\tcheck[start] = true\n\tqueue[0] = start\n\tlast := 1\n\tfor p := 0; p < last; p++ {\n\t\tcurrent := queue[p]\n\t\tfor _, k := range has[current] {\n\t\t\tfor _, nx := range list[k] {\n\t\t\t\tif check[nx] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tprintln(last, nx)\n\n\t\t\t\tqueue[last] = nx\n\t\t\t\tlast++\n\t\t\t\tcheck[nx] = true\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\t}\n\tif last == N {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\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, 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}", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2103, "memory_kb": 12416}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s488304781", "group_id": "codeNet:p03937", "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\ntype queue struct {\n\tdata [][]int\n\tfrom int\n\tto int\n}\n\nfunc (q *queue) push(d []int) {\n\tq.data[q.to] = d\n\tq.to++\n}\n\nfunc (q *queue) pop() []int {\n\td := q.data[q.from]\n\tq.from++\n\treturn d\n}\n\nvar dh = []int{0, 1}\nvar dw = []int{1, 0}\n\nfunc solve() {\n\tH, W := nextInt(), nextInt()\n\tA := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextLine()\n\t}\n\n\tq := queue{make([][]int, H*W), 0, 0}\n\n\tif A[0][0] == '#' {\n\t\tq.push([]int{0, 0})\n\t}\n\n\tn := 0\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tn++\n\t\t\t}\n\t\t}\n\t}\n\n\treached := false\n\n\tfor q.from != q.to {\n\t\td := q.pop()\n\t\tn--\n\t\tif d[0] == H-1 && d[1] == W-1 {\n\t\t\treached = true\n\t\t\tbreak\n\t\t}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tnh := d[0] + dh[i]\n\t\t\tnw := d[1] + dw[i]\n\t\t\tif nh >= H || nw >= W {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[nh][nw] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq.push([]int{nh, nw, d[0], d[1]})\n\t\t}\n\t}\n\n\tif n == 0 && reached {\n\t\tout(\"Possible\")\n\t} else {\n\t\tout(\"Impossible\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1479625612, "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/s488304781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s488304781", "user_id": "u518732500"}, "prompt_components": {"gold_output": "Possible\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\ntype queue struct {\n\tdata [][]int\n\tfrom int\n\tto int\n}\n\nfunc (q *queue) push(d []int) {\n\tq.data[q.to] = d\n\tq.to++\n}\n\nfunc (q *queue) pop() []int {\n\td := q.data[q.from]\n\tq.from++\n\treturn d\n}\n\nvar dh = []int{0, 1}\nvar dw = []int{1, 0}\n\nfunc solve() {\n\tH, W := nextInt(), nextInt()\n\tA := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextLine()\n\t}\n\n\tq := queue{make([][]int, H*W), 0, 0}\n\n\tif A[0][0] == '#' {\n\t\tq.push([]int{0, 0})\n\t}\n\n\tn := 0\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tn++\n\t\t\t}\n\t\t}\n\t}\n\n\treached := false\n\n\tfor q.from != q.to {\n\t\td := q.pop()\n\t\tn--\n\t\tif d[0] == H-1 && d[1] == W-1 {\n\t\t\treached = true\n\t\t\tbreak\n\t\t}\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tnh := d[0] + dh[i]\n\t\t\tnw := d[1] + dw[i]\n\t\t\tif nh >= H || nw >= W {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[nh][nw] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tq.push([]int{nh, nw, d[0], d[1]})\n\t\t}\n\t}\n\n\tif n == 0 && reached {\n\t\tout(\"Possible\")\n\t} else {\n\t\tout(\"Impossible\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3445, "cpu_time_ms": 5, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s827773692", "group_id": "codeNet:p03943", "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/*********** 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\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/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar a, b, c int\n\nfunc main() {\n\ta, b, c = ReadInt(), ReadInt(), ReadInt()\n\tif a+b == c || b+c == a || c+a == b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1548526191, "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/s827773692.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s827773692", "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\"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\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/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\n\nvar a, b, c int\n\nfunc main() {\n\ta, b, c = ReadInt(), ReadInt(), ReadInt()\n\tif a+b == c || b+c == a || c+a == 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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11271, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s129289769", "group_id": "codeNet:p03944", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tW, H, N := ReadInt(), ReadInt(), ReadInt()\n\n\tsx, sy := 0, 0\n\ttx, ty := W, H\n\n\tfor i := 0; i < N; i++ {\n\t\tx, y, a := ReadInt(), ReadInt(), ReadInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tsx = Max(sx, x)\n\t\tcase 2:\n\t\t\ttx = Min(tx, x)\n\t\tcase 3:\n\t\t\tsy = Max(sy, y)\n\t\tcase 4:\n\t\t\tty = Min(ty, y)\n\t\t}\n\n\t\tif tx <= sx || ty <= sy {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println((tx - sx) * (ty - sy))\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}\nfunc Max(xs ...int) int {\n\tmax := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif max < x {\n\t\t\tmax = x\n\t\t}\n\t}\n\treturn max\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() { sc.Buffer(make([]byte, 256), 1e9); sc.Split(bufio.ScanWords) }\nfunc Read() string { sc.Scan(); return sc.Text() }\n\nfunc ReadInt() int {\n\tv, e := strconv.Atoi(Read())\n\tif e != nil {\n\t\tpanic(e.Error())\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1592529884, "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/s129289769.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s129289769", "user_id": "u328656362"}, "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 main() {\n\tW, H, N := ReadInt(), ReadInt(), ReadInt()\n\n\tsx, sy := 0, 0\n\ttx, ty := W, H\n\n\tfor i := 0; i < N; i++ {\n\t\tx, y, a := ReadInt(), ReadInt(), ReadInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\tsx = Max(sx, x)\n\t\tcase 2:\n\t\t\ttx = Min(tx, x)\n\t\tcase 3:\n\t\t\tsy = Max(sy, y)\n\t\tcase 4:\n\t\t\tty = Min(ty, y)\n\t\t}\n\n\t\tif tx <= sx || ty <= sy {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println((tx - sx) * (ty - sy))\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}\nfunc Max(xs ...int) int {\n\tmax := xs[0]\n\tfor _, x := range xs[1:] {\n\t\tif max < x {\n\t\t\tmax = x\n\t\t}\n\t}\n\treturn max\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() { sc.Buffer(make([]byte, 256), 1e9); sc.Split(bufio.ScanWords) }\nfunc Read() string { sc.Scan(); return sc.Text() }\n\nfunc ReadInt() int {\n\tv, e := strconv.Atoi(Read())\n\tif e != nil {\n\t\tpanic(e.Error())\n\t}\n\treturn v\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s374795622", "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 scanInt() 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 max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tw, h, n := scanInt(), scanInt(), scanInt()\n\n\txl, xr := 0, w\n\tyl, yr := 0, h\n\tfor i := 0; i < n; i++ {\n\t\tx, y, a := scanInt(), scanInt(), scanInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\txl = x\n\t\tcase 2:\n\t\t\txr = x\n\t\tcase 3:\n\t\t\tyl = y\n\t\tcase 4:\n\t\t\tyr = y\n\t\t}\n\t}\n\tfmt.Println(max((xr-xl)*(yr-yl), 0))\n}\n", "language": "Go", "metadata": {"date": 1583046471, "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/s374795622.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s374795622", "user_id": "u461993794"}, "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 scanInt() 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 max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tw, h, n := scanInt(), scanInt(), scanInt()\n\n\txl, xr := 0, w\n\tyl, yr := 0, h\n\tfor i := 0; i < n; i++ {\n\t\tx, y, a := scanInt(), scanInt(), scanInt()\n\t\tswitch a {\n\t\tcase 1:\n\t\t\txl = x\n\t\tcase 2:\n\t\t\txr = x\n\t\tcase 3:\n\t\t\tyl = y\n\t\tcase 4:\n\t\t\tyr = y\n\t\t}\n\t}\n\tfmt.Println(max((xr-xl)*(yr-yl), 0))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 586, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s226994056", "group_id": "codeNet:p03951", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s, t string\n\tfmt.Scan(&n, &s, &t)\n\n\tans := \"\"\n\tfor i := 0; i <= n; i++ {\n\t\ttmp := s + t[i:]\n\t\tif tmp[len(tmp)-n:] == t {\n\t\t\tans = tmp\n\t\t}\n\t}\n\n\tfmt.Println(len(ans))\n}\n", "language": "Go", "metadata": {"date": 1559161745, "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/s226994056.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s226994056", "user_id": "u554269352"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s, t string\n\tfmt.Scan(&n, &s, &t)\n\n\tans := \"\"\n\tfor i := 0; i <= n; i++ {\n\t\ttmp := s + t[i:]\n\t\tif tmp[len(tmp)-n:] == t {\n\t\t\tans = tmp\n\t\t}\n\t}\n\n\tfmt.Println(len(ans))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 225, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s697179547", "group_id": "codeNet:p03962", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif a == b && b == c {\n\t\tfmt.Println(\"1\")\n\t} else if a != b && b!= c && a != c {\n\t\tfmt.Println(\"3\")\n\t} else {\n\t\tfmt.Println(\"2\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1600377746, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s697179547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697179547", "user_id": "u061663154"}, "prompt_components": {"gold_output": "3\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 a == b && b == c {\n\t\tfmt.Println(\"1\")\n\t} else if a != b && b!= c && a != c {\n\t\tfmt.Println(\"3\")\n\t} else {\n\t\tfmt.Println(\"2\")\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 215, "cpu_time_ms": 7, "memory_kb": 1828}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s304683999", "group_id": "codeNet:p03963", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\n\tpatterns := K\n\tfor i := 1; i < N; i++ {\n\t\tpatterns *= K - 1\n\t}\n\n\tfmt.Println(patterns)\n}\n", "language": "Go", "metadata": {"date": 1562952366, "filename_ext": "go", "original_language": "Go (1.6)", "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/s304683999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304683999", "user_id": "u764750862"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scan(&N, &K)\n\n\tpatterns := K\n\tfor i := 1; i < N; i++ {\n\t\tpatterns *= K - 1\n\t}\n\n\tfmt.Println(patterns)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s635308121", "group_id": "codeNet:p03963", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar N, K int\nvar ans int = 1\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tans *= K\n\tfor i := 1; i < N; i++ {\n\t\tans *= (K - 1)\n\t}\n\tfmt.Println(ans)\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\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\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}\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 {\n\treturn a[i][1] < a[j][1]\n}\n", "language": "Go", "metadata": {"date": 1561414563, "filename_ext": "go", "original_language": "Go (1.6)", "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/s635308121.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s635308121", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar N, K int\nvar ans int = 1\n\nfunc main() {\n\tfmt.Scan(&N, &K)\n\n\tans *= K\n\tfor i := 1; i < N; i++ {\n\t\tans *= (K - 1)\n\t}\n\tfmt.Println(ans)\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\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\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}\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 {\n\treturn a[i][1] < a[j][1]\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1240, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s579884771", "group_id": "codeNet:p03964", "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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tt, a := sc.nextInt(), sc.nextInt()\n\tfor i := 1; i < N; i++ {\n\t\tnt, na := sc.nextInt(), sc.nextInt()\n\t\tm := max(ceil(t, nt), ceil(a, na))\n\t\tt = nt * m\n\t\ta = na * m\n\t}\n\n\tfmt.Fprintln(wtr, t+a)\n\twtr.Flush()\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", "language": "Go", "metadata": {"date": 1577989566, "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/s579884771.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s579884771", "user_id": "u924691798"}, "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\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 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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tt, a := sc.nextInt(), sc.nextInt()\n\tfor i := 1; i < N; i++ {\n\t\tnt, na := sc.nextInt(), sc.nextInt()\n\t\tm := max(ceil(t, nt), ceil(a, na))\n\t\tt = nt * m\n\t\ta = na * m\n\t}\n\n\tfmt.Fprintln(wtr, t+a)\n\twtr.Flush()\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s273258851", "group_id": "codeNet:p03976", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\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\tN := sc.NextInt()\n\tK := sc.NextInt()\n\tP := make([]byte, 26)\n\tfor i := 0; i < N; i++ {\n\t\tP[sc.NextLine()[0] - 'A']++\n\t}\n\tcount := 0\n\tfor {\n\t\tchoice := 0\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tif P[i] > 0 {\n\t\t\t\tchoice++\n\t\t\t\tP[i]--\n\t\t\t\tif choice == K {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif choice < K {\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\n", "language": "Go", "metadata": {"date": 1475439139, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03976.html", "problem_id": "p03976", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03976/input.txt", "sample_output_relpath": "derived/input_output/data/p03976/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03976/Go/s273258851.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s273258851", "user_id": "u504669764"}, "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\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\tN := sc.NextInt()\n\tK := sc.NextInt()\n\tP := make([]byte, 26)\n\tfor i := 0; i < N; i++ {\n\t\tP[sc.NextLine()[0] - 'A']++\n\t}\n\tcount := 0\n\tfor {\n\t\tchoice := 0\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tif P[i] > 0 {\n\t\t\t\tchoice++\n\t\t\t\tP[i]--\n\t\t\t\tif choice == K {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif choice < K {\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nKyoto University Programming Contest is a programming contest voluntarily held by some Kyoto University students.\nThis contest is abbreviated as Kyoto University Programming Contest and called KUPC.\n\nsource: Kyoto University Programming Contest Information\n\nThe problem-preparing committee met to hold this year's KUPC and N problems were proposed there.\nThe problems are numbered from 1 to N and the name of i-th problem is P_i.\nHowever, since they proposed too many problems, they decided to divide them into some sets for several contests.\n\nThey decided to divide this year's KUPC into several KUPCs by dividing problems under the following conditions.\n\nOne KUPC provides K problems.\n\nEach problem appears at most once among all the KUPCs.\n\nAll the first letters of the problem names in one KUPC must be different.\n\nYou, one of the committee members, want to hold as many KUPCs as possible.\nWrite a program to find the maximum number of KUPCs that can be held this year.\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq K \\leq 26\n\n1 \\leq |P_i| \\leq 10\n\nAll characters in P_i are capital letters.\n\nNote that, for each i and j (1 \\leq i < j \\leq N),\nP_i \\neq P_j are not necessarily satisfied.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nP_1\n:\nP_N\n\nOutput\n\nPrint the maximum number of KUPCs that can be held on one line.\n\nSample Input 1\n\n9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n\nFor example, three KUPCs can be held by dividing the problems as follows.\n\nFirst: APPLE, BLOCK, CAT\n\nSecond: ANT, BULL, DOG\n\nThird: ATCODER, BOSS, EGG\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3 2\nKU\nKYOUDAI\nKYOTOUNIV\n\nSample Output 2\n\n0\n\nNo KUPC can be held.", "sample_input": "9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03976", "source_text": "Score : 100 points\n\nProblem Statement\n\nKyoto University Programming Contest is a programming contest voluntarily held by some Kyoto University students.\nThis contest is abbreviated as Kyoto University Programming Contest and called KUPC.\n\nsource: Kyoto University Programming Contest Information\n\nThe problem-preparing committee met to hold this year's KUPC and N problems were proposed there.\nThe problems are numbered from 1 to N and the name of i-th problem is P_i.\nHowever, since they proposed too many problems, they decided to divide them into some sets for several contests.\n\nThey decided to divide this year's KUPC into several KUPCs by dividing problems under the following conditions.\n\nOne KUPC provides K problems.\n\nEach problem appears at most once among all the KUPCs.\n\nAll the first letters of the problem names in one KUPC must be different.\n\nYou, one of the committee members, want to hold as many KUPCs as possible.\nWrite a program to find the maximum number of KUPCs that can be held this year.\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq K \\leq 26\n\n1 \\leq |P_i| \\leq 10\n\nAll characters in P_i are capital letters.\n\nNote that, for each i and j (1 \\leq i < j \\leq N),\nP_i \\neq P_j are not necessarily satisfied.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN K\nP_1\n:\nP_N\n\nOutput\n\nPrint the maximum number of KUPCs that can be held on one line.\n\nSample Input 1\n\n9 3\nAPPLE\nANT\nATCODER\nBLOCK\nBULL\nBOSS\nCAT\nDOG\nEGG\n\nFor example, three KUPCs can be held by dividing the problems as follows.\n\nFirst: APPLE, BLOCK, CAT\n\nSecond: ANT, BULL, DOG\n\nThird: ATCODER, BOSS, EGG\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3 2\nKU\nKYOUDAI\nKYOTOUNIV\n\nSample Output 2\n\n0\n\nNo KUPC can be held.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1893, "cpu_time_ms": 5, "memory_kb": 1024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927656830", "group_id": "codeNet:p03986", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/list\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc scanBytes(scanner *bufio.Scanner) (bs []byte) {\n\tif scanner.Scan() {\n\t\treturn scanner.Bytes()\n\t}\n\treturn\n}\n\nfunc main() {\n\tbuf := make([]byte, 262144)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(buf, cap(buf))\n\tscanner.Split(bufio.ScanWords)\n\n\tx := scanBytes(scanner) // 2 <= |x| <= 200,000\n\tlist := list.New()\n\tfor _, b := range x {\n\t\tif b == 'S' || list.Len() == 0 {\n\t\t\tlist.PushBack(b) // 'S' or 'T'\n\t\t\tcontinue\n\t\t}\n\t\t// b == 'T':\n\t\tif back := list.Back(); back.Value.(byte) == 'S' {\n\t\t\tlist.Remove(back)\n\t\t\tcontinue\n\t\t}\n\t\tlist.PushBack(b)\n\t}\n\tfmt.Println(list.Len())\n}\n", "language": "Go", "metadata": {"date": 1475373206, "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/s927656830.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s927656830", "user_id": "u543954059"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/list\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc scanBytes(scanner *bufio.Scanner) (bs []byte) {\n\tif scanner.Scan() {\n\t\treturn scanner.Bytes()\n\t}\n\treturn\n}\n\nfunc main() {\n\tbuf := make([]byte, 262144)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(buf, cap(buf))\n\tscanner.Split(bufio.ScanWords)\n\n\tx := scanBytes(scanner) // 2 <= |x| <= 200,000\n\tlist := list.New()\n\tfor _, b := range x {\n\t\tif b == 'S' || list.Len() == 0 {\n\t\t\tlist.PushBack(b) // 'S' or 'T'\n\t\t\tcontinue\n\t\t}\n\t\t// b == 'T':\n\t\tif back := list.Back(); back.Value.(byte) == 'S' {\n\t\t\tlist.Remove(back)\n\t\t\tcontinue\n\t\t}\n\t\tlist.PushBack(b)\n\t}\n\tfmt.Println(list.Len())\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 656, "cpu_time_ms": 75, "memory_kb": 10880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s210752948", "group_id": "codeNet:p03993", "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 N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[a[i]-1] == i+1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\n}\n", "language": "Go", "metadata": {"date": 1592693920, "filename_ext": "go", "original_language": "Go (1.14.1)", "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/s210752948.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s210752948", "user_id": "u432333240"}, "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\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 N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif a[a[i]-1] == i+1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2418, "cpu_time_ms": 28, "memory_kb": 3148}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s520097912", "group_id": "codeNet:p03994", "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{}, 100100)\n\n\ts := []byte(getString())\n\tK := getInt()\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 'a' {\n\t\t\tcontinue\n\t\t}\n\t\tv := s[i]\n\t\td := int(1 + 'z' - v)\n\t\t//out(d)\n\t\tif K >= d {\n\t\t\tK -= d\n\t\t\ts[i] = 'a'\n\t\t}\n\t}\n\t//out(K)\n\tK %= 26\n\tl := len(s) - 1\n\ts[l] += byte(K)\n\tif s[l] > 'z' {\n\t\ts[l] = 'a'\n\t}\n\tout(string(s))\n\n}\n", "language": "Go", "metadata": {"date": 1583795074, "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/s520097912.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s520097912", "user_id": "u814575783"}, "prompt_components": {"gold_output": "aya\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{}, 100100)\n\n\ts := []byte(getString())\n\tK := getInt()\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == 'a' {\n\t\t\tcontinue\n\t\t}\n\t\tv := s[i]\n\t\td := int(1 + 'z' - v)\n\t\t//out(d)\n\t\tif K >= d {\n\t\t\tK -= d\n\t\t\ts[i] = 'a'\n\t\t}\n\t}\n\t//out(K)\n\tK %= 26\n\tl := len(s) - 1\n\ts[l] += byte(K)\n\tif s[l] > 'z' {\n\t\ts[l] = 'a'\n\t}\n\tout(string(s))\n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 687, "cpu_time_ms": 6, "memory_kb": 1408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s105743757", "group_id": "codeNet:p03998", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sa, sb, sc string\n\tfmt.Scan(&sa, &sb, &sc)\n\n\tt := sa[0]\n\tfor {\n\t\tswitch t {\n\t\tcase 'a':\n\t\t\tif len(sa) == 0 {\n\t\t\t\tfmt.Println(\"A\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sa[0]\n\t\t\tsa = sa[1:]\n\t\tcase 'b':\n\t\t\tif len(sb) == 0 {\n\t\t\t\tfmt.Println(\"B\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sb[0]\n\t\t\tsb = sb[1:]\n\t\tcase 'c':\n\t\t\tif len(sc) == 0 {\n\t\t\t\tfmt.Println(\"C\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sc[0]\n\t\t\tsc = sc[1:]\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1597722772, "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/s105743757.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s105743757", "user_id": "u367908963"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sa, sb, sc string\n\tfmt.Scan(&sa, &sb, &sc)\n\n\tt := sa[0]\n\tfor {\n\t\tswitch t {\n\t\tcase 'a':\n\t\t\tif len(sa) == 0 {\n\t\t\t\tfmt.Println(\"A\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sa[0]\n\t\t\tsa = sa[1:]\n\t\tcase 'b':\n\t\t\tif len(sb) == 0 {\n\t\t\t\tfmt.Println(\"B\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sb[0]\n\t\t\tsb = sb[1:]\n\t\tcase 'c':\n\t\t\tif len(sc) == 0 {\n\t\t\t\tfmt.Println(\"C\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tt = sc[0]\n\t\t\tsc = sc[1:]\n\t\t}\n\t}\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1844}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s193234485", "group_id": "codeNet:p04001", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar S string\n\tfmt.Scan(&S)\n\n\tnum := make([]int, len(S))\n\tfor i, r := range S {\n\t\tnum[i] = int(r - '0')\n\t}\n\n\tarr := make([]int, 0, (1 << uint(len(S))))\n\tfor bit := 0; bit < (1 << uint(len(S)-1)); bit++ {\n\t\ts := 0\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif bit&(1< 0 {\n\t\tcs := heap.Pop(pq).(*Station)\n\n\t\tfor _, e := range edges[cs.id] {\n\t\t\tcost := 0\n\t\t\tif cs.befComp != e.comp {\n\t\t\t\tcost++\n\t\t\t}\n\n\t\t\tif dp[e.tid] > cs.priority+cost {\n\t\t\t\tdp[e.tid] = cs.priority + cost\n\t\t\t\theap.Push(pq, &Station{priority: dp[e.tid], befComp: e.comp, id: e.tid})\n\t\t\t}\n\t\t}\n\t}\n\n\tif dp[n-1] != INF_BIT60 {\n\t\tfmt.Println(dp[n-1])\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\ntype Station struct {\n\tpriority int\n\tid int\n\tbefComp int\n}\ntype StationPQ []*Station\n\nfunc (pq StationPQ) Len() int { return len(pq) }\nfunc (pq StationPQ) Less(i, j int) bool { return pq[i].priority < pq[j].priority } // <: ASC, >: DESC\nfunc (pq StationPQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *StationPQ) Push(x interface{}) {\n\titem := x.(*Station)\n\t*pq = append(*pq, item)\n}\nfunc (pq *StationPQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// how to use\n// temp := make(StationPQ, 0, 100000+1)\n// pq := &temp\n// heap.Init(pq)\n// heap.Push(pq, &Station{priority: intValue})\n// popped := heap.Pop(pq).(*Station)\n\n// MODはとったか?\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 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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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", "language": "Go", "metadata": {"date": 1562124420, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04003.html", "problem_id": "p04003", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04003/input.txt", "sample_output_relpath": "derived/input_output/data/p04003/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04003/Go/s891935688.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s891935688", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\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 MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n, m int\nvar P, Q, C []int\n\ntype Edge struct {\n\ttid, comp int\n}\n\nvar edges [100000 + 5][]Edge\nvar dp [100000 + 5]int\n\nfunc main() {\n\tn, m = ReadInt(), ReadInt()\n\tP, Q, C = make([]int, m), make([]int, m), make([]int, m)\n\tfor i := 0; i < n; i++ {\n\t\tedges[i] = []Edge{}\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tp, q, c := ReadInt()-1, ReadInt()-1, ReadInt()\n\t\tP[i], Q[i], C[i] = p, q, c\n\t\tedges[p] = append(edges[p], Edge{tid: q, comp: c})\n\t\tedges[q] = append(edges[q], Edge{tid: p, comp: c})\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = INF_BIT60\n\t}\n\n\ttemp := make(StationPQ, 0, 100000+1)\n\tpq := &temp\n\theap.Init(pq)\n\n\tdp[0] = 0\n\theap.Push(pq, &Station{priority: 0, befComp: 0, id: 0})\n\tfor pq.Len() > 0 {\n\t\tcs := heap.Pop(pq).(*Station)\n\n\t\tfor _, e := range edges[cs.id] {\n\t\t\tcost := 0\n\t\t\tif cs.befComp != e.comp {\n\t\t\t\tcost++\n\t\t\t}\n\n\t\t\tif dp[e.tid] > cs.priority+cost {\n\t\t\t\tdp[e.tid] = cs.priority + cost\n\t\t\t\theap.Push(pq, &Station{priority: dp[e.tid], befComp: e.comp, id: e.tid})\n\t\t\t}\n\t\t}\n\t}\n\n\tif dp[n-1] != INF_BIT60 {\n\t\tfmt.Println(dp[n-1])\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\ntype Station struct {\n\tpriority int\n\tid int\n\tbefComp int\n}\ntype StationPQ []*Station\n\nfunc (pq StationPQ) Len() int { return len(pq) }\nfunc (pq StationPQ) Less(i, j int) bool { return pq[i].priority < pq[j].priority } // <: ASC, >: DESC\nfunc (pq StationPQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *StationPQ) Push(x interface{}) {\n\titem := x.(*Station)\n\t*pq = append(*pq, item)\n}\nfunc (pq *StationPQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// how to use\n// temp := make(StationPQ, 0, 100000+1)\n// pq := &temp\n// heap.Init(pq)\n// heap.Push(pq, &Station{priority: intValue})\n// popped := heap.Pop(pq).(*Station)\n\n// MODはとったか?\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 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// 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/*********** 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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\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// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\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 returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\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// 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", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke's town has a subway system, consisting of N stations and M railway lines. The stations are numbered 1 through N. Each line is operated by a company. Each company has an identification number.\n\nThe i-th ( 1 \\leq i \\leq M ) line connects station p_i and q_i bidirectionally. There is no intermediate station. This line is operated by company c_i.\n\nYou can change trains at a station where multiple lines are available.\n\nThe fare system used in this subway system is a bit strange. When a passenger only uses lines that are operated by the same company, the fare is 1 yen (the currency of Japan). Whenever a passenger changes to a line that is operated by a different company from the current line, the passenger is charged an additional fare of 1 yen. In a case where a passenger who changed from some company A's line to another company's line changes to company A's line again, the additional fare is incurred again.\n\nSnuke is now at station 1 and wants to travel to station N by subway. Find the minimum required fare.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 2×10^5\n\n1 \\leq p_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq q_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq c_i \\leq 10^6 (1 \\leq i \\leq M)\n\np_i \\neq q_i (1 \\leq i \\leq M)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\np_1 q_1 c_1\n:\np_M q_M c_M\n\nOutput\n\nPrint the minimum required fare. If it is impossible to get to station N by subway, print -1 instead.\n\nSample Input 1\n\n3 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 1\n\n1\n\nUse company 1's lines: 1 → 2 → 3. The fare is 1 yen.\n\nSample Input 2\n\n8 11\n1 3 1\n1 4 2\n2 3 1\n2 5 1\n3 4 3\n3 6 3\n3 7 3\n4 8 4\n5 6 1\n6 7 5\n7 8 5\n\nSample Output 2\n\n2\n\nFirst, use company 1's lines: 1 → 3 → 2 → 5 → 6. Then, use company 5's lines: 6 → 7 → 8. The fare is 2 yen.\n\nSample Input 3\n\n2 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 2 1\n2 3 1\n3 1 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p04003", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke's town has a subway system, consisting of N stations and M railway lines. The stations are numbered 1 through N. Each line is operated by a company. Each company has an identification number.\n\nThe i-th ( 1 \\leq i \\leq M ) line connects station p_i and q_i bidirectionally. There is no intermediate station. This line is operated by company c_i.\n\nYou can change trains at a station where multiple lines are available.\n\nThe fare system used in this subway system is a bit strange. When a passenger only uses lines that are operated by the same company, the fare is 1 yen (the currency of Japan). Whenever a passenger changes to a line that is operated by a different company from the current line, the passenger is charged an additional fare of 1 yen. In a case where a passenger who changed from some company A's line to another company's line changes to company A's line again, the additional fare is incurred again.\n\nSnuke is now at station 1 and wants to travel to station N by subway. Find the minimum required fare.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 2×10^5\n\n1 \\leq p_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq q_i \\leq N (1 \\leq i \\leq M)\n\n1 \\leq c_i \\leq 10^6 (1 \\leq i \\leq M)\n\np_i \\neq q_i (1 \\leq i \\leq M)\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\np_1 q_1 c_1\n:\np_M q_M c_M\n\nOutput\n\nPrint the minimum required fare. If it is impossible to get to station N by subway, print -1 instead.\n\nSample Input 1\n\n3 3\n1 2 1\n2 3 1\n3 1 2\n\nSample Output 1\n\n1\n\nUse company 1's lines: 1 → 2 → 3. The fare is 1 yen.\n\nSample Input 2\n\n8 11\n1 3 1\n1 4 2\n2 3 1\n2 5 1\n3 4 3\n3 6 3\n3 7 3\n4 8 4\n5 6 1\n6 7 5\n7 8 5\n\nSample Output 2\n\n2\n\nFirst, use company 1's lines: 1 → 3 → 2 → 5 → 6. Then, use company 5's lines: 6 → 7 → 8. The fare is 2 yen.\n\nSample Input 3\n\n2 0\n\nSample Output 3\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9222, "cpu_time_ms": 231, "memory_kb": 25472}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s771944261", "group_id": "codeNet:p04011", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, x, y int\n\tfmt.Scan(&n, &k, &x, &y)\n\n\tif n <= k {\n\t\tfmt.Println(x * n)\n\t} else {\n\t\tfmt.Println(x*k + y*(n-k))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583048385, "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/s771944261.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s771944261", "user_id": "u461993794"}, "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.Scan(&n, &k, &x, &y)\n\n\tif n <= k {\n\t\tfmt.Println(x * n)\n\t} else {\n\t\tfmt.Println(x*k + y*(n-k))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s615127557", "group_id": "codeNet:p04011", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\n\n\nfunc main() {\n var n,k,x,y int\n fmt.Scan(&n,&k,&x,&y)\n fmt.Println(min32(n,k)*x + max32(n-k,0)*y)\n}\n\n\n\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": 1562435707, "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/s615127557.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s615127557", "user_id": "u480831358"}, "prompt_components": {"gold_output": "48000\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\n\n\nfunc main() {\n var n,k,x,y int\n fmt.Scan(&n,&k,&x,&y)\n fmt.Println(min32(n,k)*x + max32(n-k,0)*y)\n}\n\n\n\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\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 662, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s490070581", "group_id": "codeNet:p04011", "input_text": "package main;\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, K, X, Y int\n\tfmt.Scan(&N, &K, &X, &Y)\n\tfmt.Println(K * X + (N - K) * Y)\n\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1472432515, "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/s490070581.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s490070581", "user_id": "u504669764"}, "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.Scan(&N, &K, &X, &Y)\n\tfmt.Println(K * X + (N - K) * Y)\n\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s233163927", "group_id": "codeNet:p04012", "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\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tw := scanString()\n\n\tm := map[string]int{}\n\tfor _, c := range w {\n\t\tm[string(c)]++\n\t}\n\n\tfor _, v := range m {\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}\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(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1590464424, "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/s233163927.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s233163927", "user_id": "u367908963"}, "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\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tw := scanString()\n\n\tm := map[string]int{}\n\tfor _, c := range w {\n\t\tm[string(c)]++\n\t}\n\n\tfor _, v := range m {\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}\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(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s720432856", "group_id": "codeNet:p04012", "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/*********** 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 S []rune\n\nfunc main() {\n\tS = ReadRuneSlice()\n\n\tmemo := make(map[rune]int)\n\tfor _, r := range S {\n\t\tmemo[r]++\n\t}\n\n\tfor _, v := range memo {\n\t\tif v%2 == 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1548555310, "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/s720432856.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s720432856", "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\"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// 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 S []rune\n\nfunc main() {\n\tS = ReadRuneSlice()\n\n\tmemo := make(map[rune]int)\n\tfor _, r := range S {\n\t\tmemo[r]++\n\t}\n\n\tfor _, v := range memo {\n\t\tif v%2 == 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 11702, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s712146848", "group_id": "codeNet:p04013", "input_text": "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.NextInt()\n\tx := sc.NextIntArray()\n\tdp := make([][]int, N + 1)\n\tfor i := 0; i < N + 1; i++ {\n\t\tdp[i] = make([]int, 50 * 50 + 1)\n\t}\n\tfor j := 0; j < N; j++ {\n\t\tfor i := 50 * 50; i >= 0; i-- {\n\t\t\tif i - x[j] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := N - 1; k >= 0; k-- {\n\t\t\t\tdp[k + 1][i] += dp[k][i - x[j]]\n\t\t\t\tif k == 0 && i == x[j] {\n\t\t\t\t\tdp[k + 1][i] ++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 50 * 50; i >= 0; i-- {\n\t\tfor k := 0; k <= N; k++ {\n\t\t\tif dp[k][i] > 0 {\n\t\t\t\tif k * A == i {\n\t\t\t\t\tans += dp[k][i]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc\nNewScanner() *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": 1472434980, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04013.html", "problem_id": "p04013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04013/input.txt", "sample_output_relpath": "derived/input_output/data/p04013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04013/Go/s712146848.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712146848", "user_id": "u504669764"}, "prompt_components": {"gold_output": "5\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.NextInt()\n\tx := sc.NextIntArray()\n\tdp := make([][]int, N + 1)\n\tfor i := 0; i < N + 1; i++ {\n\t\tdp[i] = make([]int, 50 * 50 + 1)\n\t}\n\tfor j := 0; j < N; j++ {\n\t\tfor i := 50 * 50; i >= 0; i-- {\n\t\t\tif i - x[j] < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := N - 1; k >= 0; k-- {\n\t\t\t\tdp[k + 1][i] += dp[k][i - x[j]]\n\t\t\t\tif k == 0 && i == x[j] {\n\t\t\t\t\tdp[k + 1][i] ++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 50 * 50; i >= 0; i-- {\n\t\tfor k := 0; k <= N; k++ {\n\t\t\tif dp[k][i] > 0 {\n\t\t\t\tif k * A == i {\n\t\t\t\t\tans += dp[k][i]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc\nNewScanner() *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\nTak has N cards. On the i-th (1 \\leq i \\leq N) card is written an integer x_i.\nHe is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A.\nIn how many ways can he make his selection?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A \\leq 50\n\n1 \\leq x_i \\leq 50\n\nN,\\,A,\\,x_i are integers.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1 \\leq N \\leq 16.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of ways to select cards such that the average of the written integers is exactly A.\n\nSample Input 1\n\n4 8\n7 9 8 9\n\nSample Output 1\n\n5\n\nThe following are the 5 ways to select cards such that the average is 8:\n\nSelect the 3-rd card.\n\nSelect the 1-st and 2-nd cards.\n\nSelect the 1-st and 4-th cards.\n\nSelect the 1-st, 2-nd and 3-rd cards.\n\nSelect the 1-st, 3-rd and 4-th cards.\n\nSample Input 2\n\n3 8\n6 6 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n8 5\n3 6 2 8 7 6 5 9\n\nSample Output 3\n\n19\n\nSample Input 4\n\n33 3\n3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n\nSample Output 4\n\n8589934591\n\nThe answer may not fit into a 32-bit integer.", "sample_input": "4 8\n7 9 8 9\n"}, "reference_outputs": ["5\n"], "source_document_id": "p04013", "source_text": "Score : 300 points\n\nProblem Statement\n\nTak has N cards. On the i-th (1 \\leq i \\leq N) card is written an integer x_i.\nHe is selecting one or more cards from these N cards, so that the average of the integers written on the selected cards is exactly A.\nIn how many ways can he make his selection?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq A \\leq 50\n\n1 \\leq x_i \\leq 50\n\nN,\\,A,\\,x_i are integers.\n\nPartial Score\n\n200 points will be awarded for passing the test set satisfying 1 \\leq N \\leq 16.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN A\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the number of ways to select cards such that the average of the written integers is exactly A.\n\nSample Input 1\n\n4 8\n7 9 8 9\n\nSample Output 1\n\n5\n\nThe following are the 5 ways to select cards such that the average is 8:\n\nSelect the 3-rd card.\n\nSelect the 1-st and 2-nd cards.\n\nSelect the 1-st and 4-th cards.\n\nSelect the 1-st, 2-nd and 3-rd cards.\n\nSelect the 1-st, 3-rd and 4-th cards.\n\nSample Input 2\n\n3 8\n6 6 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n8 5\n3 6 2 8 7 6 5 9\n\nSample Output 3\n\n19\n\nSample Input 4\n\n33 3\n3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\n\nSample Output 4\n\n8589934591\n\nThe answer may not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2123, "cpu_time_ms": 79, "memory_kb": 1792}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444648946", "group_id": "codeNet:p04020", "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 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\tvar ans, p int64\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt64(scanner)\n\t\tans += (a + p) >> 1\n\t\tif a == 0 {\n\t\t\tp = 0\n\t\t\tcontinue\n\t\t}\n\t\tp = (a + p) % 2\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1571276784, "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/s444648946.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444648946", "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)\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\tvar ans, p int64\n\tfor i := 0; i < n; i++ {\n\t\ta := getNextInt64(scanner)\n\t\tans += (a + p) >> 1\n\t\tif a == 0 {\n\t\t\tp = 0\n\t\t\tcontinue\n\t\t}\n\t\tp = (a + p) % 2\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1256, "cpu_time_ms": 27, "memory_kb": 2816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064981236", "group_id": "codeNet:p04021", "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, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tA := make([]int, N)\n\tmark := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tA[i], _ = strconv.Atoi(read())\n\t\tif i%2 == 0 {\n\t\t\tmark[A[i]] = 0\n\t\t} else {\n\t\t\tmark[A[i]] = 1\n\t\t}\n\t}\n\tsort.Ints(A)\n\tfor i := 0; i < N; i++ {\n\t\tif mark[A[i]] != i%2 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\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": 1568157365, "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/s064981236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s064981236", "user_id": "u266742706"}, "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\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tA := make([]int, N)\n\tmark := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tA[i], _ = strconv.Atoi(read())\n\t\tif i%2 == 0 {\n\t\t\tmark[A[i]] = 0\n\t\t} else {\n\t\t\tmark[A[i]] = 1\n\t\t}\n\t}\n\tsort.Ints(A)\n\tfor i := 0; i < N; i++ {\n\t\tif mark[A[i]] != i%2 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans / 2)\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 : 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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2927, "cpu_time_ms": 73, "memory_kb": 7936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s074787410", "group_id": "codeNet:p04027", "input_text": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc max(M *[]int) (ret int) {\n ret = (*M)[0]\n for _, m := range (*M) {\n if ret < m {\n ret = m\n }\n }\n return\n}\n\nfunc main() {\n var N, C int\n fmt.Scan(&N, &C)\n A := make([]int, N)\n B := make([]int, N)\n p := int64(math.Pow(10, 9) + 7)\n var x int\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n A[i] = x\n }\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n B[i] = x\n }\n B_max := max(&B)\n X := make([][]int64, C + 2)\n for i := 0; i < C + 2; i++ {\n X[i] = make([]int64, B_max + 1)\n }\n for j := 1; j < B_max + 1; j++ {\n X[0][j] = 1\n }\n for i := 0; i < C + 1; i++ {\n for j := 1; j < B_max + 1; j++ {\n X[i + 1][j] = (X[i][j] * int64(j)) % p\n X[i][j] = (X[i][j] + X[i][j - 1]) % p\n }\n }\n DP := make([][]int64, N + 1)\n for i := 0; i < N + 1; i++ {\n DP[i] = make([]int64, C + 1)\n }\n DP[0][0] = 1\n for i := 1; i < N + 1; i++ {\n for j := 0; j < C + 1; j++ {\n for k := 0; k < j + 1; k++ {\n DP[i][j] += (DP[i - 1][j - k] * (X[k][B[i - 1]] - X[k][A[i - 1] - 1])) % p\n DP[i][j] %= p\n }\n }\n }\n fmt.Println(DP[N][C])\n}", "language": "Go", "metadata": {"date": 1568650039, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04027.html", "problem_id": "p04027", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04027/input.txt", "sample_output_relpath": "derived/input_output/data/p04027/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04027/Go/s074787410.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s074787410", "user_id": "u415905784"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc max(M *[]int) (ret int) {\n ret = (*M)[0]\n for _, m := range (*M) {\n if ret < m {\n ret = m\n }\n }\n return\n}\n\nfunc main() {\n var N, C int\n fmt.Scan(&N, &C)\n A := make([]int, N)\n B := make([]int, N)\n p := int64(math.Pow(10, 9) + 7)\n var x int\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n A[i] = x\n }\n for i := 0; i < N; i++ {\n fmt.Scan(&x)\n B[i] = x\n }\n B_max := max(&B)\n X := make([][]int64, C + 2)\n for i := 0; i < C + 2; i++ {\n X[i] = make([]int64, B_max + 1)\n }\n for j := 1; j < B_max + 1; j++ {\n X[0][j] = 1\n }\n for i := 0; i < C + 1; i++ {\n for j := 1; j < B_max + 1; j++ {\n X[i + 1][j] = (X[i][j] * int64(j)) % p\n X[i][j] = (X[i][j] + X[i][j - 1]) % p\n }\n }\n DP := make([][]int64, N + 1)\n for i := 0; i < N + 1; i++ {\n DP[i] = make([]int64, C + 1)\n }\n DP[0][0] = 1\n for i := 1; i < N + 1; i++ {\n for j := 0; j < C + 1; j++ {\n for k := 0; k < j + 1; k++ {\n DP[i][j] += (DP[i - 1][j - k] * (X[k][B[i - 1]] - X[k][A[i - 1] - 1])) % p\n DP[i][j] %= p\n }\n }\n }\n fmt.Println(DP[N][C])\n}", "problem_context": "Score : 800 points\n\nProblem Statement\n\n12:17 (UTC): The sample input 1 and 2 were swapped. The error is now fixed. We are very sorry for your inconvenience.\n\nThere are N children in AtCoder Kindergarten, conveniently numbered 1 through N. Mr. Evi will distribute C indistinguishable candies to the children.\n\nIf child i is given a candies, the child's happiness will become x_i^a, where x_i is the child's excitement level. The activity level of the kindergarten is the product of the happiness of all the N children.\n\nFor each possible way to distribute C candies to the children by giving zero or more candies to each child, calculate the activity level of the kindergarten. Then, calculate the sum over all possible way to distribute C candies. This sum can be seen as a function of the children's excitement levels x_1,..,x_N, thus we call it f(x_1,..,x_N).\n\nYou are given integers A_i,B_i (1≦i≦N). Find modulo 10^9+7.\n\nConstraints\n\n1≦N≦400\n\n1≦C≦400\n\n1≦A_i≦B_i≦400 (1≦i≦N)\n\nPartial Score\n\n400 points will be awarded for passing the test set satisfying A_i=B_i (1≦i≦N).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the value of modulo 10^9+7.\n\nSample Input 1\n\n2 3\n1 1\n1 1\n\nSample Output 1\n\n4\n\nThis case is included in the test set for the partial score, since A_i=B_i.\nWe only have to consider the sum of the activity level of the kindergarten where the excitement level of both child 1 and child 2 are 1 (f(1,1)).\n\nIf child 1 is given 0 candy, and child 2 is given 3 candies, the activity level of the kindergarten is 1^0*1^3=1.\n\nIf child 1 is given 1 candy, and child 2 is given 2 candies, the activity level of the kindergarten is 1^1*1^2=1.\n\nIf child 1 is given 2 candies, and child 2 is given 1 candy, the activity level of the kindergarten is 1^2*1^1=1.\n\nIf child 1 is given 3 candies, and child 2 is given 0 candy, the activity level of the kindergarten is 1^3*1^0=1.\n\nThus, f(1,1)=1+1+1+1=4, and the sum over all f is also 4.\n\nSample Input 2\n\n1 2\n1\n3\n\nSample Output 2\n\n14\n\nSince there is only one child, child 1's happiness itself will be the activity level of the kindergarten. Since the only possible way to distribute 2 candies is to give both candies to child 1, the activity level in this case will become the value of f.\n\nWhen the excitement level of child 1 is 1, f(1)=1^2=1.\n\nWhen the excitement level of child 1 is 2, f(2)=2^2=4.\n\nWhen the excitement level of child 1 is 3, f(3)=3^2=9.\n\nThus, the answer is 1+4+9=14.\n\nSample Input 3\n\n2 3\n1 1\n2 2\n\nSample Output 3\n\n66\n\nSince it can be seen that f(1,1)=4 , f(1,2)=15 , f(2,1)=15 , f(2,2)=32, the answer is 4+15+15+32=66.\n\nSample Input 4\n\n4 8\n3 1 4 1\n3 1 4 1\n\nSample Output 4\n\n421749\n\nThis case is included in the test set for the partial score.\n\nSample Input 5\n\n3 100\n7 6 5\n9 9 9\n\nSample Output 5\n\n139123417", "sample_input": "2 3\n1 1\n1 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p04027", "source_text": "Score : 800 points\n\nProblem Statement\n\n12:17 (UTC): The sample input 1 and 2 were swapped. The error is now fixed. We are very sorry for your inconvenience.\n\nThere are N children in AtCoder Kindergarten, conveniently numbered 1 through N. Mr. Evi will distribute C indistinguishable candies to the children.\n\nIf child i is given a candies, the child's happiness will become x_i^a, where x_i is the child's excitement level. The activity level of the kindergarten is the product of the happiness of all the N children.\n\nFor each possible way to distribute C candies to the children by giving zero or more candies to each child, calculate the activity level of the kindergarten. Then, calculate the sum over all possible way to distribute C candies. This sum can be seen as a function of the children's excitement levels x_1,..,x_N, thus we call it f(x_1,..,x_N).\n\nYou are given integers A_i,B_i (1≦i≦N). Find modulo 10^9+7.\n\nConstraints\n\n1≦N≦400\n\n1≦C≦400\n\n1≦A_i≦B_i≦400 (1≦i≦N)\n\nPartial Score\n\n400 points will be awarded for passing the test set satisfying A_i=B_i (1≦i≦N).\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN C\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the value of modulo 10^9+7.\n\nSample Input 1\n\n2 3\n1 1\n1 1\n\nSample Output 1\n\n4\n\nThis case is included in the test set for the partial score, since A_i=B_i.\nWe only have to consider the sum of the activity level of the kindergarten where the excitement level of both child 1 and child 2 are 1 (f(1,1)).\n\nIf child 1 is given 0 candy, and child 2 is given 3 candies, the activity level of the kindergarten is 1^0*1^3=1.\n\nIf child 1 is given 1 candy, and child 2 is given 2 candies, the activity level of the kindergarten is 1^1*1^2=1.\n\nIf child 1 is given 2 candies, and child 2 is given 1 candy, the activity level of the kindergarten is 1^2*1^1=1.\n\nIf child 1 is given 3 candies, and child 2 is given 0 candy, the activity level of the kindergarten is 1^3*1^0=1.\n\nThus, f(1,1)=1+1+1+1=4, and the sum over all f is also 4.\n\nSample Input 2\n\n1 2\n1\n3\n\nSample Output 2\n\n14\n\nSince there is only one child, child 1's happiness itself will be the activity level of the kindergarten. Since the only possible way to distribute 2 candies is to give both candies to child 1, the activity level in this case will become the value of f.\n\nWhen the excitement level of child 1 is 1, f(1)=1^2=1.\n\nWhen the excitement level of child 1 is 2, f(2)=2^2=4.\n\nWhen the excitement level of child 1 is 3, f(3)=3^2=9.\n\nThus, the answer is 1+4+9=14.\n\nSample Input 3\n\n2 3\n1 1\n2 2\n\nSample Output 3\n\n66\n\nSince it can be seen that f(1,1)=4 , f(1,2)=15 , f(2,1)=15 , f(2,2)=32, the answer is 4+15+15+32=66.\n\nSample Input 4\n\n4 8\n3 1 4 1\n3 1 4 1\n\nSample Output 4\n\n421749\n\nThis case is included in the test set for the partial score.\n\nSample Input 5\n\n3 100\n7 6 5\n9 9 9\n\nSample Output 5\n\n139123417", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1133, "cpu_time_ms": 1151, "memory_kb": 3456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s384966513", "group_id": "codeNet:p04029", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tsum += i\n\t}\n\tfmt.Println(sum)\n}", "language": "Go", "metadata": {"date": 1579183206, "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/s384966513.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s384966513", "user_id": "u689167014"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tsum += i\n\t}\n\tfmt.Println(sum)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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:s444636306", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tkeys := strings.Split(s, \"\")\n\n\tret := make([]string, 0, len(keys))\n\tfor _, k := range keys {\n\t\tif k == \"0\" {\n\t\t\tret = append(ret, \"0\")\n\t\t}\n\t\tif k == \"1\" {\n\t\t\tret = append(ret, \"1\")\n\t\t}\n\t\tif k == \"B\" {\n\t\t\tif len(ret) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tret = ret[0 : len(ret)-1]\n\t\t}\n\t}\n\n\tfmt.Println(strings.Join(ret, \"\"))\n}", "language": "Go", "metadata": {"date": 1591576411, "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/s444636306.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444636306", "user_id": "u760948618"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tkeys := strings.Split(s, \"\")\n\n\tret := make([]string, 0, len(keys))\n\tfor _, k := range keys {\n\t\tif k == \"0\" {\n\t\t\tret = append(ret, \"0\")\n\t\t}\n\t\tif k == \"1\" {\n\t\t\tret = append(ret, \"1\")\n\t\t}\n\t\tif k == \"B\" {\n\t\t\tif len(ret) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tret = ret[0 : len(ret)-1]\n\t\t}\n\t}\n\n\tfmt.Println(strings.Join(ret, \"\"))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 404, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s950845388", "group_id": "codeNet:p04030", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var n, ans string\n fmt.Scan(&n)\n a:=len(n)\n for i:=0;i0{\n ans=ans[0:i-1]\n }else{\n ans=\"\"\n }\n }\n fmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1572750106, "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/s950845388.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s950845388", "user_id": "u379136995"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var n, ans string\n fmt.Scan(&n)\n a:=len(n)\n for i:=0;i0{\n ans=ans[0:i-1]\n }else{\n ans=\"\"\n }\n }\n fmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 284, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s509328006", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tres := \"\"\n\tfmt.Scan(&s)\n\tfor pos, r := range s {\n\t\tif r != 'B' {\n\t\t\tres += string(r)\n\t\t} else if r == 'B' && res != \"\" {\n\t\t\tres = res[0: pos - 1]\n\t\t}\n\t}\n\tfmt.Println(res)\n}", "language": "Go", "metadata": {"date": 1551823432, "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/s509328006.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s509328006", "user_id": "u703739962"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tres := \"\"\n\tfmt.Scan(&s)\n\tfor pos, r := range s {\n\t\tif r != 'B' {\n\t\t\tres += string(r)\n\t\t} else if r == 'B' && res != \"\" {\n\t\t\tres = res[0: pos - 1]\n\t\t}\n\t}\n\tfmt.Println(res)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 234, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s455313654", "group_id": "codeNet:p04030", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var b string\n fmt.Scan(&b)\n\n var out []rune\n for _,v := range b {\n switch v {\n case 'B':\n if len(out) > 0 {\n out = out[:len(out) - 1]\n }\n default:\n out = append(out, v)\n }\n }\n fmt.Println(string(out))\n}", "language": "Go", "metadata": {"date": 1493672131, "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/s455313654.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s455313654", "user_id": "u315288101"}, "prompt_components": {"gold_output": "00\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var b string\n fmt.Scan(&b)\n\n var out []rune\n for _,v := range b {\n switch v {\n case 'B':\n if len(out) > 0 {\n out = out[:len(out) - 1]\n }\n default:\n out = append(out, v)\n }\n }\n fmt.Println(string(out))\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 294, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s119239252", "group_id": "codeNet:p04031", "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\tans := 1000000000\n\tfor i := -100; i <= 100; i++ {\n\t\ttmp := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tx := a[j] - i\n\t\t\ttmp += x * x\n\t\t}\n\t\tif tmp < ans {\n\t\t\tans = tmp\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1580590890, "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/s119239252.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s119239252", "user_id": "u843722521"}, "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\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tans := 1000000000\n\tfor i := -100; i <= 100; i++ {\n\t\ttmp := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tx := a[j] - i\n\t\t\ttmp += x * x\n\t\t}\n\t\tif tmp < ans {\n\t\t\tans = tmp\n\t\t}\n\t}\n\tfmt.Println(ans)\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s788409396", "group_id": "codeNet:p04031", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar v = make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&v[i])\n\t}\n\tmax, min := maxAndMin(v)\n\tvar lenOfCosts = max - min + 1\n\tvar costs = make([]int, lenOfCosts, lenOfCosts)\n\tvar costsIndex int = 0\n\tfor i := min; i <= max; i++ {\n\t\tvar sum int = 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tdiff := i - v[j]\n\t\t\tsum += (diff * diff)\n\t\t}\n\t\tcosts[costsIndex] = sum\n\t\tcostsIndex++\n\t}\n\t_, ans := maxAndMin(costs)\n\tfmt.Println(ans)\n}\n\nfunc maxAndMin(slice []int) (int, int) {\n\tvar max int = 0\n\tvar min int = slice[0]\n\tfor _, v := range slice {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t\tif min > v {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn max, min\n}\n", "language": "Go", "metadata": {"date": 1485570892, "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/s788409396.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s788409396", "user_id": "u473742228"}, "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\tvar v = make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&v[i])\n\t}\n\tmax, min := maxAndMin(v)\n\tvar lenOfCosts = max - min + 1\n\tvar costs = make([]int, lenOfCosts, lenOfCosts)\n\tvar costsIndex int = 0\n\tfor i := min; i <= max; i++ {\n\t\tvar sum int = 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tdiff := i - v[j]\n\t\t\tsum += (diff * diff)\n\t\t}\n\t\tcosts[costsIndex] = sum\n\t\tcostsIndex++\n\t}\n\t_, ans := maxAndMin(costs)\n\tfmt.Println(ans)\n}\n\nfunc maxAndMin(slice []int) (int, int) {\n\tvar max int = 0\n\tvar min int = slice[0]\n\tfor _, v := range slice {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t\tif min > v {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn max, min\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s671907560", "group_id": "codeNet:p04034", "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\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, m := nextInt(), nextInt()\n\t// x, y := make([]int, m), make([]int, m)\n\t// for i := 0; i < m; i++ {\n\t// \tx[i], y[i] = nextInt(), nextInt()\n\t// }\n\n\tbox := make([]int, n)\n\tfor i := range box {\n\t\tbox[i] = 1\n\t}\n\texist := make([]bool, n)\n\texist[0] = true\n\n\tfor i := 0; i < m; i++ {\n\t\tx, y := nextInt()-1, nextInt()-1\n\t\tif exist[x] {\n\t\t\texist[y] = true\n\t\t\tif box[x] == 1 {\n\t\t\t\texist[x] = false\n\t\t\t}\n\t\t}\n\t\tbox[x]--\n\t\tbox[y]++\n\t\t// puts(x, y, exist, box)\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif exist[i] && box[i] > 0 {\n\t\t\tans++\n\t\t}\n\t}\n\tputs(ans)\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", "language": "Go", "metadata": {"date": 1584849043, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04034.html", "problem_id": "p04034", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04034/input.txt", "sample_output_relpath": "derived/input_output/data/p04034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04034/Go/s671907560.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s671907560", "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 main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn, m := nextInt(), nextInt()\n\t// x, y := make([]int, m), make([]int, m)\n\t// for i := 0; i < m; i++ {\n\t// \tx[i], y[i] = nextInt(), nextInt()\n\t// }\n\n\tbox := make([]int, n)\n\tfor i := range box {\n\t\tbox[i] = 1\n\t}\n\texist := make([]bool, n)\n\texist[0] = true\n\n\tfor i := 0; i < m; i++ {\n\t\tx, y := nextInt()-1, nextInt()-1\n\t\tif exist[x] {\n\t\t\texist[y] = true\n\t\t\tif box[x] == 1 {\n\t\t\t\texist[x] = false\n\t\t\t}\n\t\t}\n\t\tbox[x]--\n\t\tbox[y]++\n\t\t// puts(x, y, exist, box)\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif exist[i] && box[i] > 0 {\n\t\t\tans++\n\t\t}\n\t}\n\tputs(ans)\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", "problem_context": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p04034", "source_text": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1155, "cpu_time_ms": 36, "memory_kb": 2688}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992281817", "group_id": "codeNet:p04034", "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\tn := nextInt()\n\tm := nextInt()\n\tx := make([]int, n)\n\ty := make([]int, n)\n\tcount := make([]int, n)\n\tred := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tcount[i] = 1\n\t\tred[i] = 0\n\t}\n\tred[0] = 1\n\n\tfor i := 0; i < m; i++ {\n\t\t_x := nextInt()\n\t\t_y := nextInt()\n\t\tx[i] = _x\n\t\ty[i] = _y\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfrom := x[i] - 1\n\t\tto := y[i] - 1\n\n\t\tif red[from] == 1 {\n\t\t\tred[to] = 1\n\t\t}\n\t\tcount[from]--\n\t\tcount[to]++\n\t\tif count[from] == 0 {\n\t\t\tred[from] = 0\n\t\t}\n\t}\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif red[i] == 1 {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n\nfunc readInput() string {\n\tsc.Scan()\n\tbuf := sc.Text()\n\treturn buf\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(readInput())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextString() string {\n\treturn readInput()\n}\n", "language": "Go", "metadata": {"date": 1470434970, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04034.html", "problem_id": "p04034", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04034/input.txt", "sample_output_relpath": "derived/input_output/data/p04034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04034/Go/s992281817.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s992281817", "user_id": "u886074758"}, "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\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tx := make([]int, n)\n\ty := make([]int, n)\n\tcount := make([]int, n)\n\tred := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tcount[i] = 1\n\t\tred[i] = 0\n\t}\n\tred[0] = 1\n\n\tfor i := 0; i < m; i++ {\n\t\t_x := nextInt()\n\t\t_y := nextInt()\n\t\tx[i] = _x\n\t\ty[i] = _y\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfrom := x[i] - 1\n\t\tto := y[i] - 1\n\n\t\tif red[from] == 1 {\n\t\t\tred[to] = 1\n\t\t}\n\t\tcount[from]--\n\t\tcount[to]++\n\t\tif count[from] == 0 {\n\t\t\tred[from] = 0\n\t\t}\n\t}\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tif red[i] == 1 {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n\nfunc readInput() string {\n\tsc.Scan()\n\tbuf := sc.Text()\n\treturn buf\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(readInput())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextString() string {\n\treturn readInput()\n}\n", "problem_context": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "sample_input": "3 2\n1 2\n2 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p04034", "source_text": "Problem Statement\n\nWe have N boxes, numbered 1 through N. At first, box 1 contains one red ball, and each of the other boxes contains one white ball.\n\nSnuke will perform the following M operations, one by one. In the i-th operation, he randomly picks one ball from box x_i, then he puts it into box y_i.\n\nFind the number of boxes that may contain the red ball after all operations are performed.\n\nConstraints\n\n2≤N≤10^5\n\n1≤M≤10^5\n\n1≤x_i,y_i≤N\n\nx_i≠y_i\n\nJust before the i-th operation is performed, box x_i contains at least 1 ball.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nN M\nx_1 y_1\n:\nx_M y_M\n\nOutput\n\nPrint the number of boxes that may contain the red ball after all operations are performed.\n\nSample Input 1\n\n3 2\n1 2\n2 3\n\nSample Output 1\n\n2\n\nJust after the first operation, box 1 is empty, box 2 contains one red ball and one white ball, and box 3 contains one white ball.\n\nNow, consider the second operation. If Snuke picks the red ball from box 2, the red ball will go into box 3. If he picks the white ball instead, the red ball will stay in box 2.\nThus, the number of boxes that may contain the red ball after all operations, is 2.\n\nSample Input 2\n\n3 3\n1 2\n2 3\n2 3\n\nSample Output 2\n\n1\n\nAll balls will go into box 3.\n\nSample Input 3\n\n4 4\n1 2\n2 3\n4 1\n3 4\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 917, "cpu_time_ms": 73, "memory_kb": 4736}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s744739411", "group_id": "codeNet:p04035", "input_text": "package main;\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tvar N, L int\n\tfmt.Scan(&N, &L)\n\ta := make([]int, N)\n\tS := readLine()\n\tl := strings.Split(S, \" \")\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(l[i])\n\t}\n\n\tmi := 0\n\tmx := 0\n\tfor i := 0; i < N; i++ {\n\t\tif mx < a[i] {\n\t\t\tmx = a[i]\n\t\t\tmi = i\n\t\t}\n\t}\n\n\tpossible := false\n\tfor l := 0; l < N - 1; l++ {\n\t\tif a[l] + a[l + 1] >= L {\n\t\t\tpossible = true\n\t\t}\n\t}\n\n\tif !possible {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\n\tif mi == 0 {\n\t\tfmt.Println(\"Possible\")\n\t\tfor l := N - 1; l >= 1; l-- {\n\t\t\tfmt.Println(l)\n\t\t}\n\n\t} else if mi == N - 1 {\n\n\t\tfmt.Println(\"Possible\")\n\t\tfor l := 1; l < N; l++ {\n\t\t\tfmt.Println(l)\n\t\t}\n\n\t} else {\n\n\t\tfmt.Println(\"Possible\")\n\t\tif a[mi - 1] < a[mi + 1] {\n\t\t\tfor l := 1; l <= mi; l++ {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t\tfor l := N - 1; l > mi; l-- {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t} else {\n\t\t\tfor l := N - 1; l >= mi; l-- {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t\tfor l := 1; l < mi; l++ {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\n\t\t}\n\t}\n\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", "language": "Go", "metadata": {"date": 1470019695, "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/s744739411.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s744739411", "user_id": "u504669764"}, "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\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tvar N, L int\n\tfmt.Scan(&N, &L)\n\ta := make([]int, N)\n\tS := readLine()\n\tl := strings.Split(S, \" \")\n\tfor i := 0; i < N; i++ {\n\t\ta[i], _ = strconv.Atoi(l[i])\n\t}\n\n\tmi := 0\n\tmx := 0\n\tfor i := 0; i < N; i++ {\n\t\tif mx < a[i] {\n\t\t\tmx = a[i]\n\t\t\tmi = i\n\t\t}\n\t}\n\n\tpossible := false\n\tfor l := 0; l < N - 1; l++ {\n\t\tif a[l] + a[l + 1] >= L {\n\t\t\tpossible = true\n\t\t}\n\t}\n\n\tif !possible {\n\t\tfmt.Println(\"Impossible\")\n\t\treturn\n\t}\n\n\tif mi == 0 {\n\t\tfmt.Println(\"Possible\")\n\t\tfor l := N - 1; l >= 1; l-- {\n\t\t\tfmt.Println(l)\n\t\t}\n\n\t} else if mi == N - 1 {\n\n\t\tfmt.Println(\"Possible\")\n\t\tfor l := 1; l < N; l++ {\n\t\t\tfmt.Println(l)\n\t\t}\n\n\t} else {\n\n\t\tfmt.Println(\"Possible\")\n\t\tif a[mi - 1] < a[mi + 1] {\n\t\t\tfor l := 1; l <= mi; l++ {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t\tfor l := N - 1; l > mi; l-- {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t} else {\n\t\t\tfor l := N - 1; l >= mi; l-- {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\t\t\tfor l := 1; l < mi; l++ {\n\t\t\t\tfmt.Println(l)\n\t\t\t}\n\n\t\t}\n\t}\n\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", "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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1255, "cpu_time_ms": 860, "memory_kb": 8704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s625285246", "group_id": "codeNet:p04043", "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\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\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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tA, B, C := sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tset := make(map[int]int)\n\tset[A]++\n\tset[B]++\n\tset[C]++\n\n\tif set[5] == 2 && set[7] == 1 {\n\t\tfmt.Fprintln(wtr, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"NO\")\n\t}\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1578112637, "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/s625285246.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625285246", "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\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\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\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tA, B, C := sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tset := make(map[int]int)\n\tset[A]++\n\tset[B]++\n\tset[C]++\n\n\tif set[5] == 2 && set[7] == 1 {\n\t\tfmt.Fprintln(wtr, \"YES\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"NO\")\n\t}\n\twtr.Flush()\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": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1929, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s352636615", "group_id": "codeNet:p04043", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n [3]int\n\tvar s = []int{5, 7, 5}\n\n\tfor i:=0; i<3; i++ {\n\t\tfmt.Scan(&n[i])\n\t}\n\n\tfor i:=0; i<3; i++ {\n\t\tfor j:=0; j