{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, cnt, prev := 0, 0, '_'\n for _, v := range s {\n if cnt == 5 {\n prev = '_'\n }\n if v == prev {\n cnt++\n } else {\n ans++\n cnt = 1\n prev = v\n }\n }\n fmt.Println(ans)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, cnt, prev := 0, 0, '_'\n for _, v := range s {\n if cnt == 5 {\n prev = '_'\n }\n if v == prev {\n cnt++\n } else {\n ans++\n cnt = 1\n prev = v\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, cnt, prev := 0, 0, '_'\n for _, v := range s {\n if cnt == 5 {\n prev = '_'\n }\n if v == prev {\n cnt++\n } else {\n ans++\n cnt = 1\n prev = v\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\n\nimport \n\"fmt\"\n\n\nfunc main() {\n \nvar s string\n \nfmt.Scan(&s)\n \nans, cnt, prev := 0, 0, '_'\n \nfor _, v := range s {\n \nif cnt == 5 {\n \nprev = '_'\n \n}\n \nif v == prev {\n \ncnt++\n \n} else {\n\nans++\n \ncnt = 1\n \nprev = v\n \n}\n \n}\n \nfmt.Println(ans)\n\n}\n"}], "negative_code": [{"source_code": "// 284B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tin := bufio.NewScanner(os.Stdin)\n\tnm := 3\n\tst := make([]int, nm)\n\tvar n int\n\tvar ln string\n\tin.Scan()\n\tn, _ = strconv.Atoi(in.Text())\n\tln = in.Text()\n\tfor i := 0; i < n; i++ {\n\t\tif ln[i] == 'F' {\n\t\t\tst[0]++\n\t\t}\n\t\tif ln[i] == 'I' {\n\t\t\tst[1]++\n\t\t}\n\t\tif ln[i] == 'A' {\n\t\t\tst[2]++\n\t\t}\n\t}\n\tvar out int\n\tout = 0\n\tif st[1] == 0 {\n\t\tout = n - (st[0])\n\t}\n\tif st[1] == 1 {\n\t\tout = 1\n\t}\n\tfmt.Println(out)\n}\n"}], "src_uid": "5257f6b50f5a610a17c35a47b3a0da11"} {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n for i := len(scanner.Text())-1; i >= 0; i-- {\n c := strings.ToUpper(string(scanner.Text()[i]))[0]\n if (c >= 'A') && (c <= 'Z') {\n if (c == 'A') || (c == 'E') || (c == 'I') || (c == 'O') || (c == 'U') || (c == 'Y') {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n break\n }\n }\n}\n", "positive_code": [{"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc main() {\n\tvar q string\n\tvar i int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanLines)\n\tr.Scan()\n\tq=r.Text()\n\ti=len(q)-2\n\tfor i>=0 {\n\t\tif q[i]==' ' {\n\t\t\ti--\n\t\t} else if q[i]=='a' || q[i]=='A' || q[i]=='e' || q[i]=='E' || q[i]=='u' || q[i]=='U' || q[i]=='y' || q[i]=='Y' || q[i]=='i' || q[i]=='I' || q[i]=='o' || q[i]=='O' {\n\t\tfmt.Println(\"YES\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tbreak\n\t\t}\n\t}\n}"}, {"source_code": "//49A\npackage main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc main() {\n\tvar q string\n\tvar i int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanLines)\n\tr.Scan()\n\tq=r.Text()\n\ti=len(q)-2\n\tfor i>=0 {\n\t\tif q[i]==' ' {\n\t\t\ti--\n\t\t} else if q[i]=='a' || q[i]=='A' || q[i]=='e' || q[i]=='E' || q[i]=='u' || q[i]=='U' || q[i]=='y' || q[i]=='Y' || q[i]=='i' || q[i]=='I' || q[i]=='o' || q[i]=='O' {\n\t\tfmt.Println(\"YES\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tbreak\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin) // variabel scanner adalah bufio yang menunjukan scanner baru\n scanner.Scan() //fungsi scanner scan\n for i := len(scanner.Text())-1; i >= 0; i-- { // lakukan selama kondisi ini\n c := strings.ToUpper(string(scanner.Text()[i]))[0] // variabel c aadlah string yang menunjuk kedalam toupper\n if (c >= 'A') && (c <= 'Z') { //lakukan selam kondisi ini\n if (c == 'A') || (c == 'E') || (c == 'I') || (c == 'O') || (c == 'U') || (c == 'Y') { // lakukan selam kondisi ini\n fmt.Println(\"YES\") // mencetak output\n } else { //\n fmt.Println(\"NO\") //mencetak output\n }\n break // berhenti\n }\n }\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n for i := len(scanner.Text())-1; i >= 0; i-- {\n c := strings.ToUpper(string(scanner.Text()[i]))[0]\n if (c >= 'A') && (c <= 'Z') {\n if (c == 'A') || (c == 'E') || (c == 'I') || (c == 'O') || (c == 'U') || (c == 'Y') {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n break\n }\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\n\nfunc check(upper string, vowel []string) bool {\n\tfor _, letter := range vowel {\n\t\tif upper == letter {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tvowel := []string{ \"A\", \"E\", \"I\", \"O\", \"U\", \"Y\" }\n\n\tscanner.Scan()\n\tfor i := len(scanner.Text()) - 1; i >= 0; {\n\t\tupper := strings.ToUpper(string(scanner.Text()[i]))\n\t\tif upper != \" \" && upper != \"?\" {\n\t\t\tcheckVowel := check(upper, vowel)\n\t\t\tif checkVowel {\n\t\t\t\tfmt.Printf(\"%s\", \"YES\")\n\t\t\t\treturn \n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"%s\", \"NO\")\n\t\t\t\treturn \n\t\t\t}\n\t\t} else {\n\t\t\ti --;\n\t\t}\n\t}\n\n\t// fmt.Println(scanner.Text())\n\t// fmt.Println(vowel)\n}\t\n\n\n\n\n"}, {"source_code": "// 49A-mic\npackage main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n)\n\nfunc main() {\n z := bufio.NewScanner(os.Stdin)\n var y bool\n var s []string\n y = false\n z.Scan()\n ss := z.Text()\n ss = strings.ToLower(ss)\n l := len(ss)\n for i := l - 1; i >= 0; i-- {\n if ss[i] == ' ' || ss[i] == '?' {\n continue\n } else {\n s = append(s, string(ss[i]))\n break\n }\n }\n if s[0] == \"a\" || s[0] == \"i\" || s[0] == \"u\" || s[0] == \"e\" || s[0] == \"o\" || s[0] == \"y\" {\n y = true\n }\n if y {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tvar question string\n\tvar vowel = map[string]bool{\n\t\t\"a\": true,\n\t\t\"e\": true,\n\t\t\"u\": true,\n\t\t\"o\": true,\n\t\t\"i\": true,\n\t\t\"y\": true,\n\t}\n\n\tscanner.Scan()\n\tquestion = scanner.Text()\n\n\tquestion = question[0 : len(question)-1]\n\tquestion = strings.TrimSpace(question)\n\n\tif _, ok := vowel[strings.ToLower(string(question[len(question)-1]))]; ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\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 println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(reader, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\ts,_ := reader.ReadString('\\n')\n\ts = strings.Replace(s, \" \", \"\", -1)\n\ts = strings.Replace(s, \"?\", \"\", -1)\n\ts = strings.ToUpper(s)\n\t\n\tflag := true\n\tfor _, a := range []byte{'A', 'E', 'I', 'O', 'U', 'Y'} {\n\t\tif a == s[len(s)-3] {\n\t\t\tflag = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n\t//\"strings\"\n)\n\nfunc main() {\n var s string\n //fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n //input.Split(bufio.ScanLines)\n var c rune\n input.Scan()\n s=input.Text()\n //fmt.Println(s)\n //s = strings.TrimSpace(s)\n c = rune(s[len(s)-2])\n c = unicode.ToLower(c)\n var cek bool\n cek = unicode.IsSpace(c)\n //fmt.Println(cek)\n for i:=3;cek==true;i++ {\n \tc = rune(s[len(s)-i])\n \tc = unicode.ToLower(c)\n \tcek = unicode.IsSpace(c)\n }\n //fmt.Println(s)\n //fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n"}], "negative_code": [{"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n\t//\"strings\"\n)\n\nfunc main() {\n var s string\n //fmt.Scan(&s)\n input:= bufio.NewScanner(os.Stdin)\n //input.Split(bufio.ScanLines)\n var c rune\n input.Scan()\n s=input.Text()\n fmt.Println(s)\n //s = strings.TrimSpace(s)\n c = rune(s[len(s)-2])\n c = unicode.ToLower(c)\n var cek bool\n cek = unicode.IsSpace(c)\n //fmt.Println(cek)\n for i:=3;cek==true;i++ {\n \tc = rune(s[len(s)-i])\n \tc = unicode.ToLower(c)\n \tcek = unicode.IsSpace(c)\n }\n //fmt.Println(s)\n //fmt.Println(string(c))\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t//\"bufio\"\n\t//\"os\"\n\t//\"strconv\"\n\t\"unicode\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n var c rune\n c = rune(s[len(s)-2])\n c = unicode.ToLower(c)\n if (c == 'a' || c == 'e' || c == 'i' || c == 'u' || c == 'o' || c == 'y') {\n \tfmt.Println(\"YES\")\n \treturn\n }\n fmt.Println(\"NO\")\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\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 println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(reader, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\ts,_ := reader.ReadString('\\n')\n\ts = strings.Replace(s, \" \", \"\", -1)\n\ts = strings.Replace(s, \"?\", \"\", -1)\n\ts = strings.ToUpper(s)\n\t\n\tflag := true\n\tfor _, a := range []byte{'A', 'E', 'I', 'O', 'U', 'Y'} {\n\t\tif a == s[len(s)-1] {\n\t\t\tflag = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\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 println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(reader, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\ts,_ := reader.ReadString('\\n')\n\ts = strings.Replace(s, \" \", \"\", -1)\n\ts = strings.Replace(s, \"?\", \"\", -1)\n\ts = strings.ToUpper(s)\n\t\n\tflag := true\n\tfor _, a := range []byte{'A', 'E', 'I', 'O', 'U', 'Y'} {\n\t\tif a == s[len(s)-2] {\n\t\t\tflag = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}], "src_uid": "dea7eb04e086a4c1b3924eff255b9648"} {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc scanInt64(scanner *bufio.Scanner) int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tax, ay := scanInt64(scanner), scanInt64(scanner)\n\tbx, by := scanInt64(scanner), scanInt64(scanner)\n\tcx, cy := scanInt64(scanner), scanInt64(scanner)\n\tx0, y0 := bx-ax, by-ay\n\tx1, y1 := cx-bx, cy-by\n\tcross := x0*y1 - x1*y0\n\tif cross == 0 {\n\t\twriter.WriteString(\"TOWARDS\\n\")\n\t} else if cross > 0 {\n\t\twriter.WriteString(\"LEFT\\n\")\n\t} else {\n\t\twriter.WriteString(\"RIGHT\\n\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc equal(x, y float64) bool {\n\tdelta := x-y\n\tif (delta < 0) {\n\t\tdelta *= -1\n\t}\n\treturn delta <= 1e-6\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tax, ay := scanInt(scanner), scanInt(scanner)\n\tbx, by := scanInt(scanner), scanInt(scanner)\n\tcx, cy := scanInt(scanner), scanInt(scanner)\n\tx0, y0 := float64(bx-ax), float64(by-ay)\n\tl0 := math.Hypot(x0, y0)\n\tx0 /= l0\n\ty0 /= l0\n\tx1, y1 := float64(cx-bx), float64(cy-by)\n\tl1 := math.Hypot(x1, y1)\n\tx1 /= l1\n\ty1 /= l1\n\tif equal(x1, x0) && equal(y1, y0) {\n\t\twriter.WriteString(\"TOWARDS\\n\")\n\t} else if equal(x1, -y0) && equal(y1, x0) {\n\t\twriter.WriteString(\"LEFT\\n\")\n\t} else {\n\t\twriter.WriteString(\"RIGHT\\n\")\n\t}\n}\n"}, {"source_code": "// 227A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a1, a2, b1, b2, c1, c2, x, y, z float64\n\tfmt.Scan(&a1, &a2)\n\tfmt.Scan(&b1, &b2)\n\tfmt.Scan(&c1, &c2)\n\tx = (b1 - a1) * (c2 - b2)\n\ty = (c1 - b1) * (b2 - a2)\n\tz = x - y\n\tif z == 0 {\n\t\tfmt.Print(\"TOWARDS\")\n\t} else if z < 0 {\n\t\tfmt.Print(\"RIGHT\")\n\t} else {\n\t\tfmt.Print(\"LEFT\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc sign(x int) int {\n\ty := x\n\tif (y == 0) {\n\t\treturn 0\n\t}\n\tif (y < 0) {\n\t\treturn -1\n\t}\n\treturn 1\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tax, ay := scanInt(scanner), scanInt(scanner)\n\tbx, by := scanInt(scanner), scanInt(scanner)\n\tcx, cy := scanInt(scanner), scanInt(scanner)\n\tx0, y0 := float64(bx-ax), float64(by-ay)\n\tl0 := math.Hypot(x0, y0)\n\tx0 /= l0\n\ty0 /= l0\n\tx1, y1 := float64(cx-bx), float64(cy-by)\n\tl1 := math.Hypot(x1, y1)\n\tx1 /= l1\n\ty1 /= l1\n\t//writer.WriteString(fmt.Sprintf(\"(%.8f, %.8f) (%.8f, %.8f), dot product = %.8f\\n\",\n\t//\t\tx0, y0, x1, y1, x0*x1 + y0*y1))\n\tif x1 == x0 && y1 == y0 {\n\t\twriter.WriteString(\"TOWARDS\\n\")\n\t} else if x1 == -y0 && y1 == x0 {\n\t\twriter.WriteString(\"LEFT\\n\")\n\t} else {\n\t\twriter.WriteString(\"RIGHT\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tax, ay := scanInt(scanner), scanInt(scanner)\n\tbx, by := scanInt(scanner), scanInt(scanner)\n\tcx, cy := scanInt(scanner), scanInt(scanner)\n\tx0, y0 := bx-ax, by-ay\n\tx1, y1 := cx-bx, cy-by\n\tcross := x0*y1 - x1*y0\n\tif cross == 0 {\n\t\twriter.WriteString(\"TOWARDS\\n\")\n\t} else if cross > 0 {\n\t\twriter.WriteString(\"LEFT\\n\")\n\t} else {\n\t\twriter.WriteString(\"RIGHT\\n\")\n\t}\n}\n"}], "src_uid": "f6e132d1969863e9f28c87e5a44c2b69"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\t_, _ = fmt.Scanf(\"%d\", &x)\n\n\tres := 1\n\n\tnumbers := map[int]bool{x: true}\n\n\tfor {\n\t\tx += 1\n\n\t\tfor x % 10 == 0 {\n\t\t\tx = x / 10\n\t\t}\n\n\t\tif _, ok := numbers[x]; ok {\n\t\t\tbreak\n\t\t}\n\n\t\tnumbers[x] = true\n\t\tres += 1\n\t}\n\n\tfmt.Println(res)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// var input, inputerr = os.Open(\"./input\")\n// var output, outputerr = os.Create(\"./output\")\n// var reader = bufio.NewReader(input)\n// var writer = bufio.NewWriter(output)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\n\nfunc min(a ...int) int {\n\tmin := -1\n\tfor _, val := range a {\n\t\tif val < min {\n\t\t\tmin = val\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(a ...int) int {\n\tmax := -1\n\tfor _, val := range a {\n\t\tif val > max {\n\t\t\tmax = val\n\t\t}\n\t}\n\treturn max\n}\n\nfunc tr(n int) int {\n\tfor n%10 == 0 {\n\t\tn = n / 10\n\t}\n\treturn n\n}\n\nfunc main() {\n\tdefer writer.Flush() // STDOUT MUST BE FLUSHED MANUALLY!!!\n\tvar n int\n\tscan(&n)\n\tcnt := 0\n\tm := map[int]bool{}\n\n\tfor {\n\t\tif m[n] == false {\n\t\t\tm[n] = true\n\t\t\tcnt++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t\tn++\n\t\tn = tr(n)\n\t}\n\tprint(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc f(i int) int {\n i += 1\n for i%10 == 0 {\n i /= 10\n }\n return i\n}\n\nfunc main() {\n var N int\n fmt.Scan(&N)\n set := make(map[int]bool)\n cnt := 1\n set[N] = true\n for {\n N = f(N)\n if set[N] {\n break\n }\n set[N] = true\n cnt+=1\n }\n fmt.Println(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Reachable_number(n int) int {\n\tcnt := 0\n\tfor n > 0 {\n\t\tcnt++\n\t\tif n < 10 {\n\t\t\tcnt += 8\n\t\t\tbreak\n\t\t} else {\n\t\t\tn++\n\t\t}\n\t\tfor n%10 == 0 {\n\t\t\tn /= 10\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Printf(\"%d\\n\", Reachable_number(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tcnt := 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfor n > 0 {\n\t\tcnt++\n\t\tif n < 10 {\n\t\t\tcnt += 8\n\t\t\tbreak\n\t\t} else {\n\t\t\tn++\n\t\t}\n\t\tfor n%10 == 0 {\n\t\t\tn /= 10\n\t\t}\n\t\t// fmt.Printf(\"%d\\n\", n)\n\t}\n\tfmt.Printf(\"%d\\n\", cnt)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar n int\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &n)\n\n\tans := 0\n\n\tfor n >= 10 {\n\t\tlast := 10 - n%10\n\n\t\tans = (ans + last)\n\t\tn = n + last\n\n\t\tfor n%10 == 0 {\n\t\t\tn = n / 10\n\t\t}\n\n\t}\n\n\tfmt.Println(ans + 9)\n}\n"}, {"source_code": "// ProblemURL : https://codeforces.com/problemset/problem/1157/A\n// ---------------------------------------------\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int64\n\tfmt.Scan(&x)\n\tm := make(map[int64]bool, 1e5)\n\tf := func(x int64) int64 {\n\t\tx++\n\t\tfor x%10 == 0 {\n\t\t\tx /= 10\n\t\t}\n\t\treturn x\n\t}\n\tm[x] = true\n\tfor {\n\t\tx = f(x)\n\t\tif _, exists := m[x]; exists {\n\t\t\tbreak\n\t\t}\n\t\tm[x] = true\n\t}\n\tfmt.Println(len(m))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(n int) int {\n\tm := map[int]bool{}\n\tm[n] = true\n\n\tfor ok := false; !ok; {\n\n\t\tn++\n\n\t\tfor n > 0 && n%10 == 0 {\n\t\t\tn /= 10\n\t\t}\n\n\t\tok = m[n]\n\t\tm[n] = true\n\t}\n\n\treturn len(m)\n}\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tans := solve(n)\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int\n\ti = n\n\tm := map[int]bool{}\n\tfor true{\n\t\tif(m[i] == false) {\n\t\tm[i] = true\n\t\ti ++\n\t\tfor i % 10 == 0{\n\t\t\ti /= 10\n\t\t}\n\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\n\t}\n\tfmt.Println(len(m))\n\n\n\n\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i int\n\tfmt.Scanf(\"%d\", &i)\n\tj := i\n\tm := make(map[int]int)\n\tfor m[1] < 2 {\n\t\ti += 1\n\t\tfor i % 10 == 0 {\n\t\t\ti /= 10\n\t\t}\n\t\tm[i] += 1\n\t\t// fmt.Println(i)\n\t}\n\tm[j] += 1\n\tfmt.Println(len(m))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int;\n\tcnt := 0\n\tfmt.Scanf ( \"%d\", &n )\n\tfor n % 10 != n {\n\t\tcnt++\n\t\tn++\n\t\tfor n % 10 == 0 {\n\t\t\tn /= 10\n\t\t}\n\t}\n\n\tcnt += 9;\n\n\tfmt.Println ( cnt )\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc f(i int) int {\n i += 1\n for i%10 == 0 {\n i /= 10\n }\n return i\n}\n\nfunc main() {\n var N int\n fmt.Scan(&N)\n set := make(map[int]bool)\n cnt := 1\n for {\n N = f(N)\n if set[N] {\n break\n }\n set[N] = true\n cnt+=1\n }\n fmt.Println(cnt)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\t_, _ = fmt.Scanf(\"%d\", &x)\n\n\tres := 1\n\n\tfor x != 1 {\n\t\tx += 1\n\n\t\tfor x % 10 == 0 {\n\t\t\tx = x / 10\n\t\t}\n\n\t\tres += 1\n\t}\n\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\t_, _ = fmt.Scanf(\"%d\", &x)\n\n\tres := 1\n\n\tif x == 1 {\n\t\tfmt.Println(9)\n\t\treturn\n\t}\n\n\tfor x != 1 {\n\t\tx += 1\n\n\t\tfor x % 10 == 0 {\n\t\t\tx = x / 10\n\t\t}\n\n\t\tres += 1\n\t}\n\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int64\n\tfmt.Scan(&x)\n\tm := make(map[int64]bool, 1e5)\n\tf := func(x int64) int64 {\n\t\tx++\n\t\tfor x%10 == 0 {\n\t\t\tx /= 10\n\t\t}\n\t\treturn x\n\t}\n\tm[x] = true\n\tfor {\n\t\tx = f(x)\n\t\tm[x] = true\n\t\tif x == 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(len(m))\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tm := map[int32]bool{}\n\tm[i] = true\n\ti ++\n\tm[1] = true\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\t\t\tfor i % 10 == 0{\n\t\t\t\ti /= 10\n\t\t\t}\n\t\t}\n\t\tm[i] = true\n\t\ti ++\n\n\t}\n\tfmt.Println(len(m))\n\n\n\n\n\n\n\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tvar ans int32\n\ti ++\n\tans += 2\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\t\t\tfor i % 10 == 0{\n\t\t\t\ti /= 10\n\t\t\t}\n\t\t}\n\t\ti ++\n\t\tans ++\n\t}\n\tfmt.Println(ans)\n\n\n\n\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tm := map[int32]bool{}\n\tm[i] = true\n\ti ++\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\n\t\t\tfor i % 10 == 0{\n\t\t\t\tm[i] = true\n\t\t\t\ti /= 10\n\n\t\t\t}\n\t\t}\n\t\tm[i] = true\n\t\ti ++\n\n\t}\n\tfmt.Println(len(m))\n\n\n\n\n\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvar i int32\n\ti = n\n\tm := map[int32]bool{}\n\tm[i] = true\n\ti ++\n\tfor true{\n\t\tif(i == 10){\n\t\t\tbreak\n\t\t}\n\t\tif i % 10 == 0 {\n\n\t\t\tfor i % 10 == 0{\n\t\t\t\ti /= 10\n\t\t\t}\n\t\t}\n\t\tm[i] = true\n\t\ti ++\n\n\t}\n\tfmt.Println(len(m) + 1)\n\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i int\n\tfmt.Scanf(\"%d\", &i)\n\tj := i\n\tm := make(map[int]int)\n\tfor m[1] == 0 || i == 1 {\n\t\ti += 1\n\t\tfor i % 10 == 0 {\n\t\t\ti /= 10\n\t\t}\n\t\tm[i] += 1\n\t}\n\tm[j] += 1\n\tfmt.Println(len(m))\n}\n"}], "src_uid": "055fbbde4b9ffd4473e6e716da6da899"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tvar s []byte\n\tFscan(in, &n, &s)\n\n\tif n == 1 {\n\t\tFprintln(out, 0)\n\t\treturn\n\t}\n\ts = append([]byte{0}, s...)\n\ts = append(s, 0)\n\n\tans := 0\n\t//s2 := []byte{}\n\t//for i := byte('z'); i >= 'a'; i-- {\n\t//\tlp := 0\n\t//\tfor j, b := range s {\n\t//\t\t//if j > 0 && lc == 0 {\n\t//\t\t//\tlc = s[j-1]\n\t//\t\t//}\n\t//\t\tif b == i && (s[j]-1 == s[lp] || s[j]-1 == s[j+1]) {\n\t//\t\t\tans++\n\t//\n\t//\t\t} else {\n\t//\t\t\ts2 = append(s2, b)\n\t//\t\t\tlp = j\n\t//\t\t}\n\t//\t}\n\t//\ts = s2\n\t//\ts2 = []byte{}\n\t//}\n\n\tfor curB := byte('z'); curB >= 'a'; curB-- {\n\t\tfor {\n\t\t\tdel := false\n\t\t\tfor i, b := range s {\n\t\t\t\tif b == curB && (s[i]-1 == s[i-1] || s[i]-1 == s[i+1]) {\n\t\t\t\t\tans++\n\t\t\t\t\tdel = true\n\t\t\t\t\ts = append(s[:i], s[i+1:]...)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !del {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tFprintln(out, ans)\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "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 CF1321C(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, ans int\n\tvar s []byte\n\tFscan(in, &n, &s)\n\ts = append([]byte{0}, s...)\n\ts = append(s, 0)\n\tfor curB := byte('z'); curB >= 'a'; curB-- {\n\touter:\n\t\tfor {\n\t\t\tfor i, b := range s {\n\t\t\t\tif b == curB && (b-1 == s[i-1] || b-1 == s[i+1]) {\n\t\t\t\t\tans++\n\t\t\t\t\ts = append(s[:i], s[i+1:]...)\n\t\t\t\t\tcontinue outer\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF1321C(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\trls := solve(n, s)\n\tfmt.Println(rls)\n}\n\nfunc solve(n int, s string) int {\n\tchs := []rune(s)\n\tfor ch := 'z'; ch > 'a'; ch-- {\n\t\tfor i := 1; i < len(chs); i++ {\n\t\t\tfor i < len(chs) && chs[i] == ch && chs[i-1] == ch-1 {\n\t\t\t\tchs = append(chs[:i], chs[i+1:]...)\n\t\t\t}\n\t\t}\n\t\tfor i := len(chs) - 2; i >= 0; i-- {\n\t\t\tif i+1 < len(chs) && chs[i] == ch && chs[i+1] == ch-1 {\n\t\t\t\tchs = append(chs[:i], chs[i+1:]...)\n\t\t\t}\n\t\t}\n\t}\n\treturn len(s) - len(chs)\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/1321/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(n int, s string) int {\n\tc := 0\n\tletters := \"abcdefghijklmnopqrstuvwxyz\"\n\ta := []byte(s)\n\ti := 25\n\tflag := false\n\tfor i > 0 {\n\t\tl := letters[i]\n\t\tp := letters[i-1]\n\t\tfor j, elem := range a {\n\t\t\tif elem == l && ((j-1 >= 0 && a[j-1] == p) || (j+1 < len(a) && a[j+1] == p)) {\n\t\t\t\ta = append(a[:j], a[j+1:]...)\n\t\t\t\tc += 1\n\t\t\t\tflag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag {\n\t\t\ti -= 1\n\t\t}\n\t\tflag = false\n\t}\n\treturn c\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, s))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader io.Reader\nvar scanner *bufio.Scanner\n\nfunc Init(io io.Reader, max_token_size int) {\n\treader = bufio.NewReader(io)\n\tscanner = bufio.NewScanner(reader)\n\t// max token size\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer([]byte{}, max_token_size)\n}\n\nfunc stderr(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n}\n\nfunc die(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n\tos.Exit(1)\n}\n\nfunc NextInt() int {\n\tbytes := NextBytes()\n\ti, err := Atoi(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\n\nfunc NextBytes() []byte {\n\tif !scanner.Scan() {\n\t\tdie(scanner.Err())\n\t}\n\tbytes := scanner.Bytes()\n\tcopied := make([]byte, len(bytes))\n\tcopy(copied, bytes)\n\treturn copied\n}\n\nfunc Atoi(b []byte) (int, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc ExtendByteArray(a []byte, size int) []byte {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]byte, size-len(a))...)\n\t}\n}\n\nfunc ExtendIntArray(a []int, size int) []int {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]int, size-len(a))...)\n\t}\n}\n\nfunc canRemove(i int, s []byte, n int) bool {\n\tok := false\n\tif i > 0 && s[i] > 'a' && s[i-1]-'a' == (s[i]-'a'-1) {\n\t\tok = true\n\t}\n\tif i+1 < n && s[i] > 'a' && s[i+1]-'a' == (s[i]-'a'-1) {\n\t\tok = true\n\t}\n\treturn ok\n}\n\nfunc main() {\n\tinf := os.Stdin\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\t// inf, err := os.Open(\"a.in\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// out, err := os.Create(\"a.out\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// defer out.Close()\n\tInit(inf, 1000010)\n\n\tn := NextInt()\n\ts := NextBytes()\n\tvar removed int\n\tfor {\n\t\tremoval := -1\n\t\tfor ch := 26; removal == -1 && ch >= 0; ch-- {\n\t\t\tfor i := 0; removal == -1 && i < n; i++ {\n\t\t\t\tif s[i] == byte(ch+'a') && canRemove(i, s, n) {\n\t\t\t\t\tremoval = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif removal == -1 {\n\t\t\tbreak\n\t\t}\n\t\ts = append(s[:removal], s[removal+1:]...)\n\t\tremoved++\n\t\tn--\n\t\t// stderr(\"parti\", string(s), n)\n\t}\n\tfmt.Fprintln(out, removed)\n}\n"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1321/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\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\tS []rune\n)\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\n\tans := 0\n\tfor len(S) > 1 {\n\t\tnext := false\n\t\tmaxR := rune(0)\n\t\tidx := -1\n\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif i == 0 && S[i]-S[i+1] == 1 {\n\t\t\t\tif ChMax(&maxR, S[i]) {\n\t\t\t\t\tidx = i\n\t\t\t\t}\n\n\t\t\t\tnext = true\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif i == len(S)-1 && S[i]-S[i-1] == 1 {\n\t\t\t\tif ChMax(&maxR, S[i]) {\n\t\t\t\t\tidx = i\n\t\t\t\t}\n\n\t\t\t\tnext = true\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif 0 < i && i < len(S)-1 && (S[i]-S[i-1] == 1 || S[i]-S[i+1] == 1) {\n\t\t\t\tif ChMax(&maxR, S[i]) {\n\t\t\t\t\tidx = i\n\t\t\t\t}\n\n\t\t\t\tnext = true\n\t\t\t}\n\t\t}\n\n\t\tif next {\n\t\t\tans++\n\t\t\ttmp := []rune{}\n\t\t\tfor i := 0; i < len(S); i++ {\n\t\t\t\tif i == idx {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\ttmp = append(tmp, S[i])\n\t\t\t}\n\n\t\t\tS = tmp\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *rune, target rune) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar n int\n\tfmt.Fscanf(r, \"%d\\n\", &n)\n\n\tvar s string\n\tfmt.Fscanf(r, \"%s\\n\", &s)\n\n\tdeleted := make(map[int]bool)\n\n\tcount := 0\n\tfor ch := byte('z'); ch >= 'a'; ch-- {\n\t\tfor i, _ := range s {\n\t\t\tcur := s[i]\n\t\t\tif cur != ch {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcan := false\n\n\t\t\tj := i\n\t\t\tfor j >= 0 && (deleted[j] || s[j] == cur) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tif j >= 0 && s[j]+1 == cur {\n\t\t\t\tcan = true\n\t\t\t}\n\n\t\t\tj = i\n\t\t\tfor j < n && (deleted[j] || s[j] == cur) {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j < n && s[j]+1 == cur {\n\t\t\t\tcan = true\n\t\t\t}\n\n\t\t\tif can {\n\t\t\t\tdeleted[i] = true\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}\n\nfunc min(a, b byte) byte {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar n int\n\tfmt.Fscanf(r, \"%d\\n\", &n)\n\n\tvar s string\n\tfmt.Fscanf(r, \"%s\\n\", &s)\n\n\tcount := 0\n\n\tredo := true\n\tfor redo {\n\t\tredo = false\n\t\tmp := make(map[int]bool)\n\t\tfor i := 0; i < len(s)-1; i++ {\n\t\t\tif s[i] == s[i+1]+1 {\n\t\t\t\tfor i < len(s)-1 && s[i] == s[i+1]+1 {\n\t\t\t\t\tmp[i] = true\n\t\t\t\t\tredo = true\n\t\t\t\t\tcount++\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t} else if s[i] == s[i+1]-1 {\n\t\t\t\tfor i < len(s)-1 && s[i] == s[i+1]-1 {\n\t\t\t\t\tmp[i+1] = true\n\t\t\t\t\tredo = true\n\t\t\t\t\tcount++\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tb := new(strings.Builder)\n\t\tfor i := 0; i < len(s); i++ {\n\t\t\tif !mp[i] {\n\t\t\t\tfmt.Fprintf(b, \"%c\", s[i])\n\t\t\t}\n\t\t}\n\n\t\ts = b.String()\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tvar s []byte\n\tFscan(in, &n, &s)\n\n\tif n == 1 {\n\t\tFprintln(out, 0)\n\t\treturn\n\t}\n\n\tdp := make([][][26][26]int, n)\n\tfor _i := range dp {\n\t\tdp[_i] = make([][26][26]int, n)\n\t\tfor _j := range dp[_i] {\n\t\t\tfor i := range dp[_i][_j] {\n\t\t\t\tfor j := range dp[_i][_j][i] {\n\t\t\t\t\tdp[_i][_j][i][j] = -1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmax := func(a, b int) int {\n\t\tif a > b {\n\t\t\treturn a\n\t\t}\n\t\treturn b\n\t}\n\n\tvar f func(l, r int, lc, rc byte) int\n\tf = func(l, r int, lc, rc byte) (_ans int) {\n\t\tif l == 0 &&r==1 {\n\t\t\tprint()\n\t\t}\n\n\t\tdv := &dp[l][r][lc-'a'][rc-'a']\n\t\tif *dv >= 0 {\n\t\t\treturn *dv\n\t\t}\n\t\tdefer func() { *dv = _ans }()\n\n\t\tif l == r {\n\t\t\tif s[l]-1 == lc || s[l]-1 == rc {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn 0\n\t\t}\n\n\t\tfor i := l; i <= r; i++ {\n\t\t\tif i == l {\n\t\t\t\tif s[l]-1 == lc || s[l]-1 == s[l+1] {\n\t\t\t\t\tv := f(l+1, r, lc, rc)\n\t\t\t\t\t_ans = max(_ans, v+1)\n\t\t\t\t}\n\t\t\t} else if i == r {\n\t\t\t\tif s[r]-1 == rc || s[r]-1 == s[r-1] {\n\t\t\t\t\tv := f(l, r-1, lc, rc)\n\t\t\t\t\t_ans = max(_ans, v+1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif s[i]-1 == s[i-1] || s[i]-1 == s[i+1] {\n\t\t\t\t\tv1 := f(l, i-1, lc, s[i+1])\n\t\t\t\t\tv2 := f(i+1, r, s[i-1], rc)\n\t\t\t\t\t_ans = max(_ans, v1+v2+1)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn\n\t}\n\n\tans := f(0, n-1, 'z', 'z')\n\tFprintln(out, ans)\n\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tvar s []byte\n\tFscan(in, &n, &s)\n\n\tif n == 1 {\n\t\tFprintln(out, 0)\n\t\treturn\n\t}\n\ts = append([]byte{0}, s...)\n\ts = append(s, 0)\n\n\tans := 0\n\ts2 := []byte{}\n\tfor i := byte('z'); i >= 'a'; i-- {\n\t\tlp := 0\n\t\tfor j, b := range s {\n\t\t\t//if j > 0 && lc == 0 {\n\t\t\t//\tlc = s[j-1]\n\t\t\t//}\n\t\t\tif b == i && (s[j]-1 == s[lp] || s[j]-1 == s[j+1]) {\n\t\t\t\tans++\n\n\t\t\t} else {\n\t\t\t\ts2 = append(s2, b)\n\t\t\t\tlp = j\n\t\t\t}\n\t\t}\n\t\ts = s2\n\t\ts2 = []byte{}\n\t}\n\n\tFprintln(out, ans)\n\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/1321/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Range(arr []int) (int, int) {\n\tmax := arr[0]\n\tmin := arr[0]\n\tfor _, elem := range arr {\n\t\tif elem > max {\n\t\t\tmax = elem\n\t\t}\n\t\tif elem < min {\n\t\t\tmin = elem\n\t\t}\n\t}\n\treturn min, max\n}\n\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc _Solve(arr []int, moves int, min int, max int, current int, n int) int {\n\tif n == 1 || current == min-1 {\n\t\treturn moves\n\t}\n\tnewArr := []int{}\n\tremoved := false\n\tfor i := 0; i < n; i++ {\n\t\tif removed && arr[i] == current {\n\t\t\tmoves += 1\n\t\t\tremoved = true\n\t\t} else if arr[i] == current && i+1 < n && Abs(arr[i+1]-current) == 1 {\n\t\t\tmoves += 1\n\t\t\tremoved = true\n\t\t} else if arr[i] == current && i-1 >= 0 && Abs(arr[i-1]-current) == 1 {\n\t\t\tmoves += 1\n\t\t\tremoved = true\n\t\t} else {\n\t\t\tnewArr = append(newArr, arr[i])\n\t\t\tremoved = false\n\t\t}\n\t}\n\treturn _Solve(newArr, moves, min, max, current-1, len(newArr))\n}\n\nfunc Solve(n int, s string) int {\n\tarr := make([]int, n)\n\tfor i, elem := range s {\n\t\tarr[i] = int(elem)\n\t}\n\tmin, max := Range(arr)\n\treturn _Solve(arr, 0, min, max, max, n)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, s))\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/1321/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(n int, s string) int {\n\ta := make([]int, n)\n\tfor i, elem := range s {\n\t\ta[i] = int(elem)\n\t}\n\tfor i := 122; i >= 97; i-- {\n\t\tfor j := 0; j < len(a); j++ {\n\t\t\tif a[j] == i && ((j+1 < len(a) && a[j+1] == i-1) || (j-1 >= 0 && a[j-1] == i-1)) {\n\t\t\t\ta = append(a[:j], a[j+1:]...)\n\t\t\t\tj -= 1\n\t\t\t}\n\t\t}\n\t}\n\treturn n - len(a)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, s))\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/1321/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Group struct {\n\tcount int\n\telem int\n}\n\nfunc group(a []int) []Group {\n\tgroups := []Group{}\n\tfor i, elem := range a {\n\t\tif i == 0 {\n\t\t\tgroups = append(groups, Group{count: 1, elem: elem})\n\t\t} else if groups[len(groups)-1].elem == elem {\n\t\t\tgroups[len(groups)-1].count += 1\n\t\t} else {\n\t\t\tgroups = append(groups, Group{count: 1, elem: elem})\n\t\t}\n\t}\n\treturn groups\n}\n\nfunc _Solve(groups []Group, current int, min int, moves int) int {\n\tif current == min-1 {\n\t\treturn moves\n\t}\n\tnewGroups := []Group{}\n\tfor i, group := range groups {\n\t\tif group.elem == current && i+1 < len(groups) && groups[i+1].elem == current-1 {\n\t\t\tmoves += group.count\n\t\t} else if group.elem == current && i-1 >= 0 && groups[i-1].elem == current-1 {\n\t\t\tmoves += group.count\n\t\t} else {\n\t\t\tnewGroups = append(newGroups, group)\n\t\t}\n\t}\n\treturn _Solve(newGroups, current-1, min, moves)\n}\n\nfunc Solve(n int, s string) int {\n\ta := make([]int, n)\n\tfor i, elem := range s {\n\t\ta[i] = int(elem)\n\t}\n\tgroups := group(a)\n\treturn _Solve(groups, 122, 97, 0)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, s))\n}\n"}], "src_uid": "9ce37bc2d361f5bb8a0568fb479b8a38"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tstr string\n\t\tcnt int\n\t)\n\tfound := false\n\tfmt.Scanf(\"%s\", &str)\n\tfor i := range str {\n\t\tif str[i] == '1' {\n\t\t\tfound = true\n\t\t} else if str[i] == '0' && found {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif cnt >= 6 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nfunc readInt() int {\n\tvar o, neg bool\n\tvar i int\n\tb, err := r.ReadByte()\n\tfor err == nil {\n\t\tif b != ' ' && b != '\\n' && b != '\\r' {\n\t\t\tif b == '-' {\n\t\t\t\tneg = true\n\t\t\t} else {\n\t\t\t\ti = i*10 + int(b) - 48\n\t\t\t\to = true\n\t\t\t}\n\t\t} else if o {\n\t\t\tbreak\n\t\t}\n\t\tb, err = r.ReadByte()\n\t}\n\tif neg {\n\t\treturn -i\n\t}\n\treturn i\n}\n\nfunc writeInt(i int) {\n\tif i < 0 {\n\t\tw.WriteByte('-')\n\t\ti = -i\n\t}\n\tif i < 10 {\n\t\tw.WriteByte(byte(i + 48))\n\t\treturn\n\t}\n\tvar tmp, count int\n\ttmp = i\n\tfor tmp%10 == 0 {\n\t\ttmp /= 10\n\t\tcount++\n\t}\n\ttmp = 0\n\tfor i != 0 {\n\t\ttmp = tmp*10 + (i % 10)\n\t\ti /= 10\n\t}\n\tfor tmp != 0 {\n\t\tw.WriteByte(byte((tmp % 10) + 48))\n\t\ttmp /= 10\n\t}\n\tfor count > 0 {\n\t\tcount--\n\t\tw.WriteByte('0')\n\t}\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tvar s string\n\tfor I(&s) == nil {\n\t\tsolve(s)\n\t}\n\tw.Flush()\n}\n\nfunc solve(s string) {\n\tfor i := range s {\n\t\tif s[i] == '1' && strings.Count(s[i:], \"0\") > 5 {\n\t\t\tO(\"yes\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tO(\"no\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar local = false\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tsetup()\n\tresult := false\n\tinp := readString()\n\tzeroes := 0\n\tfor i := len(inp) - 1; i >= 0; i-- {\n\t\tif inp[i] == '0' {\n\t\t\tzeroes++\n\t\t}\n\n\t\tif inp[i] == '1' && zeroes >= 6 {\n\t\t\tresult = true\n\t\t}\n\t}\n\n\tif result {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n}\n\nfunc setup() {\n\tsource := os.Stdin\n\tif local == true {\n\t\tfile, _ := os.Open(\"input.txt\")\n\t\tsource = file\n\t}\n\tscanner = bufio.NewScanner(source)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tvar count0, i int\n\tfor count0, i = 0, len(input)-1; i>=0; i-- {\n\t\tif input[i] == '0' {\n\t\t\tcount0++\n\t\t}\n\t\tif count0 == 6 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i = i-1; i>=0; i-- {\n\t\tif input[i] == '1' {\n\t\t\tfmt.Println(\"yes\")\n\t\t\treturn \n\t\t}\n\t}\n\tfmt.Println(\"no\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input string\n\tfmt.Scanf(\"%s\\n\", &input)\n\n\tcan := false\n\n\tzeros := 0\n\tfor i := len(input) - 1; i >= 0; i-- {\n\t\tif input[i] == '0' {\n\t\t\tzeros++\n\t\t} else if zeros >= 6 {\n\t\t\tcan = true\n\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif can {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") >= 6 && strings.Count(in[:len(in)-6], \"1\") > 0 {\n\t}\n\n\tif strings.Count(in, \"1\") > 0 && strings.Count(in[strings.Index(in, \"1\"):], \"0\") >= 6 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\ti := 0\n\tzero := 0\n\n\tfor i < len(s) {\n\t\tif s[i] == '1' { break }\n\t\ti++\n\t}\n\n\tfor i < len(s) {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t}\n\t\ti++\n\t}\n\n\tif zero > 5 {\n\t\tfmt.Printf(\"yes\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Printf(\"no\")\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := readString()\n\tcnt := 0\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif a[i] == '0' {\n\t\t\tcnt++\n\t\t\tif cnt == 6 {\n\t\t\t\tfor j := i - 1; j >= 0; j-- {\n\t\t\t\t\tif a[j] == '1' {\n\t\t\t\t\t\tfmt.Println(\"yes\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"no\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input string\n\tfmt.Scanf(\"%s\\n\", &input)\n\n\tif len(input) >= 7 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") < 6 {\n\t\tfmt.Println(\"no\")\n\t} else {\n\t\tfmt.Println(\"yes\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") >= 6 && strings.Count(in[:len(in)-6], \"1\") > 0 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") < 6 && strings.Count(in, \"0\") > 0 {\n\t\tfmt.Println(\"no\")\n\t} else {\n\t\tfmt.Println(\"yes\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") >= 6 && strings.Count(in, \"1\") > 0 && strings.Index(in, \"1\") <= len(in)-6 {\n\t\tfmt.Println(\"yes\")\n\t} else {\n\t\tfmt.Println(\"no\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") < 6 || strings.Count(in, \"1\") == 0 {\n\t\tfmt.Println(\"no\")\n\t} else {\n\t\tfmt.Println(\"yes\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage 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\t// fmt.Println(\"Hello, world!\")\n\tin := gsls(reader)[0]\n\n\tif strings.Count(in, \"0\") < 6 && strings.Count(in, \"1\") > 0 {\n\t\tfmt.Println(\"no\")\n\t} else {\n\t\tfmt.Println(\"yes\")\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\tzero := 0\n\tone := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t} else {\n\t\t\tone++\n\t\t}\n\t}\n\n\tif one == 0 || zero >= 6 {\n\t\tfmt.Printf(\"yes\")\n\t} else {\n\t\tfmt.Printf(\"no\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\tzero := 0\n\tone := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t} else {\n\t\t\tone++\n\t\t}\n\t}\n\n\tif one > 0 && zero >= 6 {\n\t\tfmt.Printf(\"yes\")\n\t} else {\n\t\tfmt.Printf(\"no\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"bufio\"\n\nvar s string\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &s)\n\tzero := 0\n\tone := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '0' {\n\t\t\tzero++\n\t\t} else {\n\t\t\tone++\n\t\t}\n\t}\n\n\tif one > 1 && zero >= 6 {\n\t\tfmt.Printf(\"yes\")\n\t} else {\n\t\tfmt.Printf(\"no\")\n\t}\n}\n\n\n"}], "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca"} {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/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\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, p, q int64\n)\n\nfunc main() {\n\tn = ReadInt64()\n\ta, b, p, q = ReadInt64_4()\n\n\tred := n / a\n\tred *= p\n\n\tblue := n / b\n\tblue *= q\n\n\tans := red + blue\n\n\tc := Lcm(a, b)\n\ttmp := n / c\n\ttmp *= Min(p, q)\n\n\tans -= tmp\n\tfmt.Println(ans)\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 ...int64) int64 {\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// 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 int64) int64 {\n\tif a < 0 || b < 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\tif a == 0 {\n\t\treturn b\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\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 int64) int64 {\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// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\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", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tlog.SetOutput(ioutil.Discard)\n\t// log.SetOutput(os.Stderr)\n\n\tn, a, b, p, q := nextInt64(), nextInt64(), nextInt64(), nextInt64(), nextInt64()\n\tlog.Print(n*gcd(a, b)/(a*b), min(p, q))\n\tprintln(n/a*p + n/b*q - n*gcd(a, b)/(a*b)*min(p, q))\n}\n\nfunc gcd(x, y int64) int64 {\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tlog.SetOutput(ioutil.Discard)\n\t// log.SetOutput(os.Stderr)\n\n\tn, a, b, p, q := nextInt64(), nextInt64(), nextInt64(), nextInt64(), nextInt64()\n\n\tprintln(n/a*p + n/b*q - n/(a*b)*gcd(a, b)*min(p, q))\n}\n\nfunc gcd(x, y int64) int64 {\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tlog.SetOutput(ioutil.Discard)\n\t// log.SetOutput(os.Stderr)\n\n\tn, a, b, p, q := nextInt64(), nextInt64(), nextInt64(), nextInt64(), nextInt64()\n\n\tprintln(n/a*p + n/b*q - n/(a*b)*min(p, q))\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}], "src_uid": "35d8a9f0d5b5ab22929ec050b55ec769"} {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n\t\"os\"\n)\n\nvar a [100002]int\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t\n\tvar l int64\n\tvar r int64\n\tvar ans int64\n\tans = 0\n\tfmt.Fscan(in, &l)\n\tfmt.Fscan(in, &r)\n\t\n\tvar now int64\n\tnow = 1\n\n\tfor i := 0; i <= 30; i++ {\n\t\tvar kek int64\n\t\tkek = now\n\t\tfor j := 0; j <= 30; j++ {\n\t\t\tif kek >= l && kek <= r {\n\t\t\t\tans += 1\n\t\t\t}\n\t\t\tkek *= 3\n\t\t\tif kek > r {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tnow *= 2\n\t\tif now > r {\n\t\t\tbreak\n\t\t}\n\t}\n\n fmt.Print(ans)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar min float64\n\tvar max float64\n\tfmt.Scan(&min)\n\tfmt.Scan(&max)\n\tvar res int\n\tres = 0;\n\tfor i := 0; i < 31; i++ {\n\t for y := 0; y < 20; y++ {\n\t var x float64\n\t x = math.Pow(2,float64(i))*math.Pow(3,float64(y));\n\t if x >= min {\n\t if x <= max {\n\t res++;\n\t }\n\t }\n\t }\n\t}\n\tfmt.Println(res);\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n )\n \nvar log3 = math.Log2(3.0) \nvar l,r float64 \nfunc find_divs(upper float64, num float64) int {\n var total_num int \n for i := int(upper); i>0; i-- {\n d := num/math.Pow(3,float64(i))\n total_num += int(math.Log2(d))\n }\n return total_num\n}\nfunc main(){\n\n\tfmt.Scanf(\"%f %f\", &l, &r)\n\tr2max := math.Log2(r)\n r3max := r2max/log3\n r2min := math.Log2(l)\n r3min := r2min/log3 \n var extra, extra_rem int\n if l == 1 {\n extra = 1\n }\n if l!= 1 && (r2min == math.Trunc(r2min) || r3min == math.Trunc(r3min) || int(l)%6 == 0) {\n extra_rem = 1\n }\n var total23divs int \n total23divs = find_divs(r3max, r) - find_divs(r3min, l)\n total := int(r2max) + int(r3max) - int(r2min) - int(r3min) + total23divs + extra + extra_rem\n\tfmt.Println( total)\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n )\n \nvar log3 = math.Log2(3.0) \nvar l,r float64 \nfunc find_divs(upper float64, num float64) int {\n var total_num int \n power := math.Pow(3, math.Trunc(upper))\n d := num/power\n total_num += int(math.Log2(d))\n for i := int(upper)-1; i>0; i-- {\n d *= 3 \n total_num += int(math.Log2(d))\n }\n return total_num\n}\nfunc main(){\n\tfmt.Scanf(\"%f %f\", &l, &r)\n\tr2max := math.Log2(r)\n r3max := r2max/log3\n r2min := math.Log2(l)\n r3min := r2min/log3 \n var extra, extra_rem int\n if l == 1 {\n extra = 1\n } else {\n if r2min == math.Trunc(r2min) || r3min == math.Trunc(r3min) || int(l)%6 == 0 {\n extra_rem = 1\n }\n }\n var total23divs int \n\n total23divs = find_divs(r3max, r) - find_divs(r3min, l)\n total := int(r2max) + int(r3max) - int(r2min) - int(r3min) + total23divs + extra + extra_rem\n\tfmt.Println( total)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a int64\n var b int64\n var l int64\n var r int64\n var ans int64\n a = 1\n b = 1\n ans = 0\n\tfmt.Scan(&l)\n\tfmt.Scan(&r)\n\tfor i := 0; i <= 19; i++ {\n\t b = 1\n\t for j := 0; j <= 30; j ++ {\n\t if a * b >= l {\n\t if a * b <= r {\n\t ans = ans + 1\n\t }\n\t }\n\t b = b * 2\n\t }\n\t a = a * 3\n\t}\n\tfmt.Printf( \"%d\", ans )\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var afl int64\n var bfa int64\n var lrt int64\n var rgh int64\n var cnt int64\n afl = 1\n bfa = 1\n cnt = 0\n\tfmt.Scan(&lrt)\n\tfmt.Scan(&rgh)\n\tfor it := 0; it <= 19; it++ {\n\t bfa = 1\n\t for jt := 0; jt <= 30; jt ++ {\n\t if afl * bfa >= lrt {\n\t if afl * bfa <= rgh {\n\t cnt = cnt + 1\n\t }\n\t }\n\t bfa = bfa * 2\n\t }\n\t afl = afl * 3\n\t}\n\tfmt.Printf( \"%d\", cnt )\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l,r,ot,i,j int64\n\tot = 0;\n\tfmt.Scan(&l,&r)\n\tj = 1;\n\tfor j <= r {\n\t i = j;\n \tfor i <= r {\n\t if (i>=l) {ot++;}\n\t i*=2 ;\n\t }\n\tj*=3 ;\n\t}\n\tfmt.Printf(\"%d\", ot)\n\t\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\n arr := [326]int{1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632 }\n \n var L int\n var R int\n \n fmt.Scan(&L)\n fmt.Scan(&R)\n //fmt.Print(arr[0])\n \n var l int\n var r int\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if arr[mid] >= L {\n r = mid\n }\n if arr[mid] < L {\n l = mid + 1\n }\n }\n \n lb := l\n \n if arr[lb] < L {\n lb += 1\n }\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if mid == l{\n mid += 1\n }\n if arr[mid] <= R {\n l = mid\n }\n if arr[mid] > R {\n r = mid - 1\n }\n }\n \n rb := l\n if arr[rb] > R {\n rb -= 1\n }\n \n fmt.Print(rb - lb + 1)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc pwer (a, p int64) int64 {\n var m int64 = 1\n for ; p > 0; p -- {\n m = m * a\n }\n return m\n}\n\nfunc main() {\n var l, r int64\n fmt.Scan(&l, &r)\n var answer, a, b int64 = 0, 0, 0\n for a = 0; a < 39; a ++ {\n\t\tfor b = 0; b < 39; b ++ {\n\t\t var c int64 = pwer(2, a) * pwer(3, b)\n\t\t if ((l <= c) && (c <= r)) {\n\t\t answer ++\n\t\t }\n\t\t}\n\t}\n fmt.Println(answer)\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var l, r, ans, a, b int64\n fmt.Scanf(\"%d %d\", &l, &r)\n ans = 0\n a = 1\n b = 1\n for i := 0; i < 33; i++ {\n b = 1\n for j := 0; j < 24; j++ {\n if a * b > r {\n break\n }\n if (l <= a * b) && (a * b <= r) {\n ans++\n }\n b *= 3\n }\n a *= 2\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int64\n\tfmt.Scan(&l, &r)\n\tvar p2 [32]int64\n\tvar p3 [32]int64\n\tp2[0] = 1\n\tp3[0] = 1\n\tm := 1\n\tk := 1\n\tfor i := 0; i < 32; i++ {\n\t\tp2[m] = p2[m - 1] * 2\n\t\tif p2[m] > r {\n\t\t break\n\t\t}\n\t\tm++\n\t}\n\tfor i := 0; i < 32; i++ {\n\t\tp3[k] = p3[k - 1] * 3\n\t\tif p3[k] > r {\n\t\t break\n\t\t}\n\t\tk++\n\t}\n\tans := 0\n\tfor i := 0; i < m; i++ {\n\t for j := 0; j < k; j++ {\n\t \n\t if p2[i] * p3[j] >= l && p2[i] * p3[j] <= r {\n\t ans++\n\t } \n\t }\n\t}\n\tfmt.Printf(\"%d\\n\", ans)\n}"}, {"source_code": "package main\nimport\t( \n\t\t\"fmt\"\n\t\t\"bufio\"\n\t\t\"os\"\n\t\t\"strconv\"\n\t\t_\"math\"\n\t\t_\"math/big\"\n\t\t_\"math/rand\"\n\t\t_\"io/ioutil\"\n\t\t_\"io\"\n\t\t)\nvar M map[int]bool\nconst oo = 2 * 1000 * 1000 * 1000\nfunc main() {\n\tvar l,r int\n\tM = make(map[int]bool,0)\n\tdfs(1)\n\tans := 0\n\tfmt.Scanf(\"%d%d\",&l,&r)\n\tfor v,_ := range(M) {\n\t\tif l <= v && v <= r {\n\t\t\tans += 1\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\nfunc dfs(node int) {\n\tM[node] = true\n\tif node <= oo / 2 && M[node * 2] != true {\n\t\tdfs(node * 2)\n\t}\n\tif node <= oo / 3 && M[node * 3] != true {\n\t\tdfs(node * 3)\n\t}\n}\nfunc gcd(x,y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else {\n\t\treturn gcd(y,x % y)\n\t}\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\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\nvar scanner *bufio.Scanner\n\nfunc init_scanner() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024*1024*20\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt() int {\n\tscanner.Scan()\n\tval, _ := strconv.Atoi(scanner.Text())\n\treturn val\n}"}, {"source_code": "package main\n\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scanln(&a, &b)\n\tsum := 0\n\tfor i := 0; i <= 31; i++ {\n\t for j := 0; j<=19; j++{\n\t foo:=math.Pow(2, float64(i))\n\t bar:=math.Pow(3, float64(j))\n\t if foo*bar>=a && foo*bar<=b{\n\t //fmt.Println(foo*bar)\n\t sum++;\n\t }\n\t }\n\t} \n\tfmt.Println(sum)\n}\n"}, {"source_code": "package main \n\nimport \"fmt\"\nvar l, r int64\nvar ans int64 = 0\nfunc dfs(x int64,y int64) {\n if x >= l {\n ans += 1\n }\n if y == 0 {\n if x*2<=r {\n dfs(x*2,0)\n }\n }\n if x*3<=r {\n dfs(x*3,1)\n }\n}\nfunc main() {\n\tfmt.Scan(&l, &r)\n\tdfs(1,0)\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\t// your code goes here\n\tvar l, r, ans1, ans2, res int64\n\tfmt.Scan(&l, &r)\n\tres = 0;\n\tfor i:=0; i <= 30; i++{\n\t\tfor j := 0; j <= 20; j++{\n\t\t\tans1 = 1;\n\t\t\tans2 = 1;\n\t\t\tfor k := 0; k < i; k++{\n\t\t\t\tans1 *= 2;\n\t\t\t}\n\t\t\tfor k := 0; k < j; k++{\n\t\t\t\tans2 *= 3;\n\t\t\t}\n\t\t\tif ans1 * ans2 >= l{\n\t\t\t\tif ans1 * ans2 <= r{\n\t\t\t\t\tres++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", res)\n}"}, {"source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scan(&n, &k)\n\t\n\taa := make([]int64, 31, 31)\n\taa[0]=1\n\tfor i := 1; i <=30; i++ {\n\t aa[i]=aa[i-1]*2;\n\t}\n\tbb := make([]int64, 20, 20)\n\tbb[0]=1\n\tfor i := 1; i <=19; i++ {\n\t bb[i]=bb[i-1]*3;\n\t}\n\t\n\tcount := 0\n\tfor i := 0; i <= 30; i++ {\n\t for j := 0; j <= 19; j++ {\n\t if aa[i]*bb[j]>=n && aa[i]*bb[j]<=k {\n\t count++;\n\t }\n\t }\n\t}\n\t\n\tfmt.Println(count)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var i, j, s, a, b, x, ans int64\n fmt.Scanln(&a, &b)\n ans = 0\n \n x = 1;\n for i=0; i<31; i++ {\n s = x\n \n for j=0; j<30; j++ {\n if s > b {\n break\n }\n \n if s >= a {\n ans++\n }\n \n s *= 3\n }\n \n x *= 2\n }\n \n \n \n fmt.Print(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l int64\n var r int64\n\tfmt.Scan(&l)\n\tfmt.Scan(&r)\n var ans = 0\n\tfor i := 0; i < 33; i++ {\n for j := 0; j < 33; j++ {\n var me int64\n me = 1\n for k :=0; k < i; k++ {\n me = me * 2\n }\n for k :=0; k < j; k++ {\n me = me * 3\n if me > r {\n break\n }\n }\n if me >= l {\n if me <= r{\n ans = ans + 1\n }\n }\n }\n\t}\n fmt.Printf(\"%d\\n\",ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a int64\n var b int64\n \n var cap int64\n cap = 2000000001\n \n fmt.Scan(&a)\n fmt.Scan(&b)\n \n var cur1 int64\n cur1 = 1\n \n var answer int\n answer = 0\n \n for x := 0; x < 32; x++ {\n var cur2 int64\n cur2 = cur1\n for y := 0; y < 20; y++ {\n if cur2 >= cap {\n break\n }\n if cur2 >= a {\n if cur2 <= b {\n answer++\n }\n }\n \n cur2 *= 3\n }\n \n cur1 *= 2\n }\n\n fmt.Println(answer)\n}"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar r uint64\n\tvar l uint64\n\tfmt.Scan(&l)\n\tfmt.Scan(&r)\n\tvar ans uint64\n\tans=0\n\tl=l-1\n\tvar ast uint64\n\tast=1\n\tvar erkl uint64\n\terkl = 1\n\tvar hl uint64\n\thl=0\n\tvar hr uint64\n\thr = 0\n\tfor ;erkl<=l;erkl=erkl*2{\n\t\thl+=1\n\t}\n\tvar erkr uint64\n\terkr = 1\n\tfor ;erkr<=r;erkr=erkr*2{\n\t\thr+=1\n\t}\n\t\n\tfor i := 0; ast <= r; i++ {\n\t\tfor ;ast*erkl>l;erkl/=2{\n\t\t\thl-=1\n\t\t}\n\t\tfor ;ast*erkr>r;erkr/=2{\n\t\t\thr-=1\n\t\t}\n\t\tast = ast*3\n\t\tans=ans+hr-hl\n }\n\tfmt.Println(ans)\n \n}"}, {"source_code": "package main\nimport \"fmt\"\n \nfunc main() {\n var l int64\n var r int64\n var cur int64\n var res int64\n fmt.Scan(&l)\n fmt.Scan(&r)\n cur = 1\n for i:= 0; i < 33; i++ {\n \tvar ocur int64\n \tocur = cur\n \tfor j := 0; j < 20; j++ {\n \t\tif cur >= l {\n \t\t\tif cur <= r {\n \t\t\t\tres = res + 1\n \t\t\t}\n \t\t}\n \t\tcur = cur * 3 \t\n \t}\n \tcur = ocur * 2\n }\n fmt.Printf(\"%d\", res)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var l, r int64\n fmt.Scan(&l, &r)\n var arr [] int64\n var x int64\n LIM := int64(2000000000)\n var flag int\n for i := 0; i < 32; i++ {\n for j := 0; j < 32; j++ {\n x = 1\n flag = 1\n for pw := 1; pw <= i; pw++ {\n if x * 2 > LIM {\n flag = 0\n }\n x = x * 2\n }\n for pw := 1; pw <= j; pw++ {\n if (x * 3 > LIM) {\n flag = 0\n }\n x = x * 3\n }\n if flag == 1 {\n arr = append(arr, x)\n }\n }\n }\n n := len(arr)\n res := 0\n for i := 0; i < n; i++ {\n if l <= arr[i] {\n if arr[i] <= r {\n res = res + 1\n }\n } \n }\n fmt.Println(res)\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar l int64\n var r int64\n\tvar ans int64\n\tvar m int64\n\tfmt.Scan(&l)\n fmt.Scan(&r)\n\tans = 0;\n\tfor i := int64(1); i <= 2000000000; i*=2 {\n for j := int64(1); j <= 2000000000; j*=3 {\n\t\t\tm=i*j\n if l<=m{\n if(m<=r){\n ans++\n }\n }\n\t }\n }\nfmt.Println(ans)\n}\n"}, {"source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, c int64\n\tfmt.Scan(&l, &r)\n\tc = 0\n\tfor i := 0; i < 32; i++ {\n\t var x int64\n\t x = 1\n\t for j := 0; j < i; j++ {\n\t x = x*2\n\t }\n\t for j := 0; j < 21; j++ {\n\t if x > l - 1 {\n\t if x < r + 1 {\n\t c = c+1\n\t }\n\t }\n\t x = x*3\n\t }\n\t}\n\tfmt.Println(c)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(n int64, p2 int, p3 int) bool {\n for i := 0; i < p2; i++ {\n n = n / 2\n }\n for i := 0; i < p3; i++ {\n n = n / 3\n }\n return n >= 1\n}\n\nfunc solve(n int64) int {\n c := 0\n for i := 0; i < 32; i++ {\n for j := 0; j < 25; j++ {\n if check(n, i, j) {\n c += 1\n }\n }\n }\n return c\n}\n\nfunc main() {\n var l, r int64\n fmt.Scan(&l, &r)\n ans := solve(r) - solve(l - 1)\n\tfmt.Println(ans)\n}\n\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n )\n\nvar a [100000]int\nvar l, r int\nvar ans, ans1, j int64\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &l, &r)\n\tnum:=0\n\tans=1\n for i:=0; i<=30; i++{\n a[num]=int(ans)\n num++\n ans1=ans\n for (ans1=i){\n fmt.Printf(\"%d\", j-i)\n \n } else{\n fmt.Printf(\"%d\", 0)\n }\n}"}], "negative_code": [{"source_code": "package main\n\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanln(&a, &b)\n\tsum := 0\n\tfor i := 0; i <= 30; i++ {\n\t for j := 0; j<= 19; j++{\n\t foo:=int(math.Pow(2, float64(i)))\n\t bar:=int(math.Pow(3, float64(j)))\n\t if foo*bar>=a && foo*bar<=b{\n\t sum++;\n\t }\n\t }\n\t} \n\tfmt.Println(sum)\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\t// your code goes here\n\tvar l, r, ans1, ans2, res int\n\tfmt.Scan(&l, &r)\n\tres = 0;\n\tfor i:=0; i <= 30; i++{\n\t\tfor j := 0; j <= 20; j++{\n\t\t\tans1 = 1;\n\t\t\tans2 = 1;\n\t\t\tfor k := 0; k < i; k++{\n\t\t\t\tans1 *= 2;\n\t\t\t}\n\t\t\tfor k := 0; k < j; k++{\n\t\t\t\tans2 *= 3;\n\t\t\t}\n\t\t\tif ans1 * ans2 >= l{\n\t\t\t\tif ans1 * ans2 <= r{\n\t\t\t\t\tres++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", res)\n}"}, {"source_code": "package main \n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scan(&n, &k)\n\t\n\taa := make([]int64, 31, 31)\n\taa[0]=1\n\tfor i := 1; i <=30; i++ {\n\t aa[i]=aa[i-1]*2;\n\t}\n\tbb := make([]int64, 20, 20)\n\tbb[0]=1\n\tfor i := 1; i <=19; i++ {\n\t bb[i]=bb[i-1]*3;\n\t}\n\t\n\tcount := 0\n\tfor i := 0; i < 30; i++ {\n\t for j := 0; j < 19; j++ {\n\t if aa[i]*bb[j]>=n && aa[i]*bb[j]<=k {\n\t count++;\n\t }\n\t }\n\t}\n\t\n\tfmt.Println(count)\n}"}, {"source_code": "package main\n\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanln(&a, &b)\n\tsum := 0\n\tfor i := 0; i <= 30; i++ {\n\t for j := 0; j<= 19; j++{\n\t foo:=int(math.Pow(2, float64(i)))\n\t bar:=int(math.Pow(3, float64(j)))\n\t if foo*bar>=a && foo*bar<=b{\n\t sum++;\n\t }\n\t }\n\t}\n\tfmt.Println(sum)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n )\n\nvar a [100000]int\nvar l, r int\nvar ans, ans1, j int64\n\nfunc main() {\n\tfmt.Scanf(\"%d %d\", &l, &r)\n\tnum:=0\n\tans=1\n for i:=0; i<=30; i++{\n a[num]=int(ans)\n num++\n ans1=ans\n for (ans1=i){\n fmt.Printf(\"%d\", j-i)\n \n } else{\n fmt.Printf(\"%d\", 0)\n }\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n )\n \nvar log3 = math.Log2(3.0) \nvar l,r float64 \nfunc find_divs(upper float64, num float64) int {\n var total_num int \n for i := int(upper); i>0; i-- {\n d := num/math.Pow(3,float64(i))\n total_num += int(math.Log2(d))\n }\n return total_num\n}\nfunc main(){\n\tfmt.Scanf(\"%f %f\", &l, &r)\n\tr2max := math.Log2(r)\n r3max := r2max/log3\n r2min := math.Log2(l)\n r3min := r2min/log3 \n var extra int\n if l == 1 {\n extra = 1\n } else {\n extra = 0\n }\n var total23divs int \n total23divs = find_divs(r3max, r) - find_divs(r3min, l)\n total := int(r2max) + int(r3max) - int(r2min) - int(r3min) + total23divs + extra\n\tfmt.Println( total)\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\n arr := [326]int{1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 128, 144, 162, 192, 216, 243, 256, 288, 324, 384, 432, 486, 512, 576, 648, 729, 768, 864, 972, 1024, 1152, 1296, 1458, 1536, 1728, 1944, 2048, 2187, 2304, 2592, 2916, 3072, 3456, 3888, 4096, 4374, 4608, 5184, 5832, 6144, 6561, 6912, 7776, 8192, 8748, 9216, 10368, 11664, 12288, 13122, 13824, 15552, 16384, 17496, 18432, 19683, 20736, 23328, 24576, 26244, 27648, 31104, 32768, 34992, 36864, 39366, 41472, 46656, 49152, 52488, 55296, 59049, 62208, 65536, 69984, 73728, 78732, 82944, 93312, 98304, 104976, 110592, 118098, 124416, 131072, 139968, 147456, 157464, 165888, 177147, 186624, 196608, 209952, 221184, 236196, 248832, 262144, 279936, 294912, 314928, 331776, 354294, 373248, 393216, 419904, 442368, 472392, 497664, 524288, 531441, 559872, 589824, 629856, 663552, 708588, 746496, 786432, 839808, 884736, 944784, 995328, 1048576, 1062882, 1119744, 1179648, 1259712, 1327104, 1417176, 1492992, 1572864, 1594323, 1679616, 1769472, 1889568, 1990656, 2097152, 2125764, 2239488, 2359296, 2519424, 2654208, 2834352, 2985984, 3145728, 3188646, 3359232, 3538944, 3779136, 3981312, 4194304, 4251528, 4478976, 4718592, 4782969, 5038848, 5308416, 5668704, 5971968, 6291456, 6377292, 6718464, 7077888, 7558272, 7962624, 8388608, 8503056, 8957952, 9437184, 9565938, 10077696, 10616832, 11337408, 11943936, 12582912, 12754584, 13436928, 14155776, 14348907, 15116544, 15925248, 16777216, 17006112, 17915904, 18874368, 19131876, 20155392, 21233664, 22674816, 23887872, 25165824, 25509168, 26873856, 28311552, 28697814, 30233088, 31850496, 33554432, 34012224, 35831808, 37748736, 38263752, 40310784, 42467328, 43046721, 45349632, 47775744, 50331648, 51018336, 53747712, 56623104, 57395628, 60466176, 63700992, 67108864, 68024448, 71663616, 75497472, 76527504, 80621568, 84934656, 86093442, 90699264, 95551488, 100663296, 102036672, 107495424, 113246208, 114791256, 120932352, 127401984, 129140163, 134217728, 136048896, 143327232, 150994944, 153055008, 161243136, 169869312, 172186884, 181398528, 191102976, 201326592, 204073344, 214990848, 226492416, 229582512, 241864704, 254803968, 258280326, 268435456, 272097792, 286654464, 301989888, 306110016, 322486272, 339738624, 344373768, 362797056, 382205952, 387420489, 402653184, 408146688, 429981696, 452984832, 459165024, 483729408, 509607936, 516560652, 536870912, 544195584, 573308928, 603979776, 612220032, 644972544, 679477248, 688747536, 725594112, 764411904, 774840978, 805306368, 816293376, 859963392, 905969664, 918330048, 967458816, 1019215872, 1033121304, 1073741824, 1088391168, 1146617856, 1162261467, 1207959552, 1224440064, 1289945088, 1358954496, 1377495072, 1451188224, 1528823808, 1549681956, 1610612736, 1632586752, 1719926784, 1811939328, 1836660096, 1934917632 }\n \n var L int\n var R int\n \n fmt.Scan(&L)\n fmt.Scan(&R)\n //fmt.Print(arr[0])\n \n var l int\n var r int\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if arr[mid] >= L {\n r = mid\n }\n if arr[mid] < L {\n l = mid + 1\n }\n }\n \n lb := l\n \n l = 0\n r = 325\n \n for l != r {\n mid := (l + r) / 2\n if mid == l{\n mid += 1\n }\n if arr[mid] <= R {\n l = mid\n }\n if arr[mid] > R {\n r = mid - 1\n }\n }\n \n rb := l\n \n fmt.Print(rb - lb + 1)\n}"}], "src_uid": "05fac54ed2064b46338bb18f897a4411"} {"source_code": "package main\n\nimport\n(\n\t\"fmt\"\n\t\n)\n\n\nfunc main() {\n\n\tvar a int\n\tfmt.Scanln(&a)\n\tfmt.Print(((a+1)/2)*((a-(a+1)/2)+1))\n\t}\n", "positive_code": [{"source_code": "package main\n \nimport \"fmt\"\n\nfunc min(a, b int) int {\n if a < b {\n return a\n } else {\n return b\n }\n}\n\nfunc main() {\n n := 0\n fmt.Scan(&n)\n l := 1\n for i := 1; i < n; i++ {\n l += min(i, n-i+1)\n }\n fmt.Print(l)\n}"}, {"source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\nvar dp[5002][5002] int64\nvar sum[5002] int64\nvar MD int64 = 1000000007\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int\n\tans := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tres := 0\n\t\tfor j :=0; j <= n; j++ {\n\t\t\tfor k := j + 1; k <= n; k++ {\n\t\t\t\tif i >= j && i + 1 <= k {\n\t\t\t\t\tres++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans = max(ans, res)\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport(\n\t\"fmt\"\n\t// \"sort\"\n\t// \"math\"\n\t// \"strconv\"\n\t// \"strings\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc min(a,b int) int{\n\tif ab{\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc toInt(buf []byte) (o int) {\n\tfor _, v := range buf {\n\t\to = o*10 + int(v-'0')\n\t}\n\treturn\n}\n\ntype pair struct {\n\tfirst int\n\tsecond int\n}\n\ntype pairs []pair\n\nfunc (a pairs) Len() int {return len(a)}\nfunc (a pairs) Swap(i,j int) {a[i], a[j] = a[j], a[i]}\nfunc (a pairs) Less(i,j int) bool {\n\treturn a[i].first < a[j].first\n\tif a[i].first > a[j].first {\n\t\treturn false\n\t}\n\treturn a[i].second <= a[j].second\n}\n\nvar dp[5002][5002] int64\nvar sum[5002] int64\nvar MD int64 = 1000000007\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\t//in, _ := os.Open(\"a.txt\")\n\tvar n int\n\tans := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tres := 0\n\t\tfor j :=0; j <= n; j++ {\n\t\t\tfor k := j + 1; k <= n; k++ {\n\t\t\t\tif i >= j && i + 1 <= k {\n\t\t\t\t\tres++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans = max(ans, res)\n\t}\n\tfmt.Println(ans)\n}"}], "negative_code": [], "src_uid": "f8af5dfcf841a7f105ac4c144eb51319"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// Input & Output\nvar (\n\tinput = bufio.NewReader(os.Stdin)\n\toutput = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Fscan(input, &n)\n\tif n%2 == 1 {\n\t\tfmt.Fprintln(output, \"black\")\n\t} else {\n\t\tfmt.Fprintln(output, \"white\")\n\t\tfmt.Fprintln(output, 1, 2)\n\t}\n\tdefer output.Flush()\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// Input & Output\nvar (\n\tinput = bufio.NewScanner(os.Stdin)\n\toutput = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tvar n uint64\n\tinput.Scan()\n\tn, _ = strconv.ParseUint(input.Text(), 10, 64)\n\tif n%2 == 1 {\n\t\tfmt.Fprintln(output, \"black\")\n\t} else {\n\t\tfmt.Fprintln(output, \"white\")\n\t\tfmt.Fprintln(output, 1, 2)\n\t}\n\tdefer output.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF493D(in io.Reader, out io.Writer) {\n\tvar n int\n\tFscan(in, &n)\n\tif n&1 > 0 {\n\t\tFprint(out, \"black\")\n\t} else {\n\t\tFprint(out, \"white\\n1 2\")\n\t}\n}\n\nfunc main() { CF493D(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2 == 0 {\n\t\tfmt.Println(\"white\")\n\t\tfmt.Println(1, 2)\n\t} else {\n\t\tfmt.Println(\"black\")\n\t}\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tif x % 2 == 0 {\n\t\tfmt.Println(\"white\")\n\t\tfmt.Println(1, 2)\n\t} else {\n\t\tfmt.Println(\"black\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n n := nextInt()\n if n % 2 == 1 {\n fmt.Fprintln(out, \"black\")\n } else {\n fmt.Fprintln(out, \"white\")\n fmt.Fprintln(out, \"1 2\")\n }\n}\n"}], "negative_code": [], "src_uid": "52e07d176aa1d370788f94ee2e61df93"} {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\n// \u2193\u3067\u3082\u3044\u3044\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t\t[]int64{1, 0},\n\t}\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := int64(0)\n\n\tbig := (a*x + b) % MOD\n\tbig *= AK[0][0]\n\tans += big\n\tans %= MOD\n\n\tsml := AK[0][1]\n\tsml *= x\n\tsml %= MOD\n\tans += sml\n\tans %= MOD\n\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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", "positive_code": [{"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a, b},\n\t\t[]int64{0, 1},\n\t}\n\n\tAK := powMat(A, n, MOD)\n\n\tans := AK[0][0] * x\n\tans %= MOD\n\tans += AK[0][1]\n\tans %= MOD\n\tfmt.Println(ans)\n}\n\n// \u2193\u3067\u3082\u3044\u3044\n// func main() {\n// \ta, b, n, x = ReadInt64_4()\n\n// \tA := [][]int64{\n// \t\t[]int64{a + 1, NegativeMod(-a, MOD)},\n// \t\t[]int64{1, 0},\n// \t}\n\n// \tAK := powMat(A, n-1, MOD)\n\n// \tans := int64(0)\n\n// \tbig := (a*x + b) % MOD\n// \tbig *= AK[0][0]\n// \tans += big\n// \tans %= MOD\n\n// \tsml := AK[0][1]\n// \tsml *= x\n// \tsml %= MOD\n// \tans += sml\n// \tans %= MOD\n\n// \tfmt.Println(ans)\n// }\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF678D(in io.Reader, out io.Writer) {\n\tconst p int64 = 1e9 + 7\n\tpow := func(x, n int64) int64 {\n\t\tres := int64(1)\n\t\tfor ; n > 0; n >>= 1 {\n\t\t\tif n&1 == 1 {\n\t\t\t\tres = res * x % p\n\t\t\t}\n\t\t\tx = x * x % p\n\t\t}\n\t\treturn res\n\t}\n\n\tvar a, b, n, x int64\n\tFscan(in, &a, &b, &n, &x)\n\tif an := pow(a, n); a == 1 {\n\t\tFprint(out, (an*x+n%p*b)%p)\n\t} else {\n\t\tFprint(out, (an*x+(an-1)%p*pow(a-1, p-2)%p*b)%p)\n\t}\n}\n\nfunc main() { CF678D(os.Stdin, os.Stdout) }\n"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, -a},\n\t// \t[]int64{1, 0},\n\t// }\n\tA := [][]int64{\n\t\t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t\t[]int64{1, 0},\n\t}\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := int64(0)\n\n\tbig := (a*x + b) % MOD\n\tbig *= AK[0][0]\n\tans += big\n\tans %= MOD\n\n\tsml := AK[0][1]\n\tsml *= x\n\tsml %= MOD\n\tans += sml\n\tans %= MOD\n\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}], "negative_code": [{"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, -a},\n\t\t[]int64{1, 0},\n\t}\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t// \t[]int64{1, 0},\n\t// }\n\n\tAK := powMat(A, n-1, MOD)\n\n\t// ans := AK[0][0]*(a*x+b) + AK[0][1]*x\n\t// ans %= MOD\n\n\tans := int64(0)\n\tans += AK[0][0] * (a*x + b)\n\tans = NegativeMod(ans, MOD)\n\tans += AK[0][1] * x\n\tans = NegativeMod(ans, MOD)\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, -a},\n\t\t[]int64{1, 0},\n\t}\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t// \t[]int64{1, 0},\n\t// }\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := int64(0)\n\n\tbig := (a*x + b) % MOD\n\tbig *= AK[0][0]\n\tans += big\n\tans %= MOD\n\n\tsml := AK[0][1]\n\tsml *= x\n\tsml %= MOD\n\tans += sml\n\tans %= MOD\n\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, -a},\n\t// \t[]int64{1, 0},\n\t// }\n\tA := [][]int64{\n\t\t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t\t[]int64{1, 0},\n\t}\n\n\tAK := powMat(A, n-1, MOD)\n\n\t// ans := AK[0][0]*(a*x+b) + AK[0][1]*x\n\t// ans %= MOD\n\n\tans := int64(0)\n\tans += AK[0][0] * (a*x + b)\n\tans = NegativeMod(ans, MOD)\n\tans += AK[0][1] * x\n\tans = NegativeMod(ans, MOD)\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, -a},\n\t\t[]int64{1, 0},\n\t}\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := AK[0][0]*(a*x+b) + AK[0][1]*x\n\tans %= MOD\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\tA := [][]int64{\n\t\t[]int64{a + 1, -a},\n\t\t[]int64{1, 0},\n\t}\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t// \t[]int64{1, 0},\n\t// }\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := AK[0][0]*(a*x+b) + AK[0][1]*x\n\t// ans %= MOD\n\tans = NegativeMod(ans, MOD)\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/678/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\ta, b, x, n int64\n)\n\nfunc main() {\n\ta, b, n, x = ReadInt64_4()\n\n\t// A := [][]int64{\n\t// \t[]int64{a + 1, -a},\n\t// \t[]int64{1, 0},\n\t// }\n\tA := [][]int64{\n\t\t[]int64{a + 1, NegativeMod(-a, MOD)},\n\t\t[]int64{1, 0},\n\t}\n\n\tAK := powMat(A, n-1, MOD)\n\n\tans := AK[0][0]*(a*x+b) + AK[0][1]*x\n\tans %= MOD\n\tfmt.Println(ans)\n}\n\n// NegativeMod can calculate a right residual whether value is positive or negative.\nfunc NegativeMod(val, m int64) int64 {\n\tres := val % m\n\tif res < 0 {\n\t\tres += m\n\t}\n\treturn res\n}\n\n// n*n\u306eint\u578b\u6b63\u65b9\u884c\u5217\u3092\u751f\u6210\u3059\u308b\nfunc newMat(n int64) [][]int64 {\n\tvar i int64\n\n\tA := make([][]int64, n)\n\tfor i = 0; i < n; i++ {\n\t\tA[i] = make([]int64, n)\n\t}\n\n\treturn A\n}\n\n// \u884c\u5217A, B\u306b\u95a2\u3059\u308bA*B\u306e\u8a08\u7b97\nfunc mul(A, B [][]int64, mod int64) [][]int64 {\n\tvar i, j, k int64\n\tvar lenA, lenB, lenB0 int64\n\tlenA = int64(len(A))\n\tlenB = int64(len(B))\n\tlenB0 = int64(len(B[0]))\n\n\tC := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tC[i] = make([]int64, lenB0)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tfor k = 0; k < lenB; k++ {\n\t\t\tfor j = 0; j < lenB0; j++ {\n\t\t\t\tC[i][j] = (C[i][j] + A[i][k]*B[k][j]) % mod\n\t\t\t}\n\t\t}\n\t}\n\n\treturn C\n}\n\n// \u884c\u5217A\u306b\u95a2\u3059\u308bA^n\u306e\u8a08\u7b97\nfunc powMat(A [][]int64, n, mod int64) [][]int64 {\n\tvar i int64\n\tvar lenA int64\n\tlenA = int64(len(A))\n\n\tB := make([][]int64, lenA)\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i] = make([]int64, lenA)\n\t}\n\n\tfor i = 0; i < lenA; i++ {\n\t\tB[i][i] = 1\n\t}\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tB = mul(B, A, mod)\n\t\t}\n\t\tA = mul(A, A, mod)\n\t\tn = (n >> 1)\n\t}\n\n\treturn B\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"}], "src_uid": "e22a1fc38c8b2a4cc30ce3b9f893028e"} {"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nvar v []int64 = []int64{0,4,10,20,35,56,83,116,155,198,244,292}\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar n int64\n\tfmt.Fscanf(reader, \"%d\", &n)\n\t\n\tif int(n) < len(v) {\n\t\tfmt.Printf(\"%d\", v[n])\n\t} else {\n\t\tfmt.Printf(\"%d\", 49 * (n - int64(len(v)) + 1) + v[len(v) - 1])\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF997B(in io.Reader, out io.Writer) {\n\ta := [...]int{0, 4, 10, 20, 35, 56, 83, 116, 155, 198, 244}\n\tvar n int64\n\tFscan(in, &n)\n\tif n < 11 {\n\t\tFprint(out, a[n])\n\t} else {\n\t\tFprint(out, 49*n-247)\n\t}\n}\n\nfunc main() { CF997B(os.Stdin, os.Stdout) }\n"}], "negative_code": [], "src_uid": "75ec99318736a8a1b62a8d51efd95355"} {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar n,count,i int64\n\tfmt.Scan(&n)\n\tcount=0\n\tfor i=1 ; i math.Pow10(5) {\n\t\tfmt.Println(\"input out of range\")\n\t\treturn\n\t}\n\n\tcount := 1\n\n\tfor numberOfLeaders := 2; numberOfLeaders <= input/2; numberOfLeaders ++ {\n\t\tif input % numberOfLeaders == 0 {\n\t\t\tcount += 1\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}"}, {"source_code": "//A. \u0424\u0430\u0444\u0430 \u0438 \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, rez int\n\n\tfmt.Scan(&n)\n\n\tfor i := 2; i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\trez++\n\t\t}\n\t}\n\n\tfmt.Println(rez)\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn := gsli(reader)[0]\n\n\tways := 0\n\tfor i := 1; i <= 50000; i++ {\n\t\tif (n-i)%i == 0 && n-i > 0 {\n\t\t\tways++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%v\", ways)\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n, cnt int\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif n % i == 0 {\n\t\t\tcnt ++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\n"}, {"source_code": " package main\n \n import \"fmt\"\n \n func main() {\n \tvar numOfEmployee int\n \tfmt.Scan(&numOfEmployee)\n \tvar count int = 0\n \tfor i :=1; i <= numOfEmployee/2; i++ {\n \t\tres := numOfEmployee - i\n \t\tif res % i == 0 {\n \t\t\tcount++\n \t\t}\n \t}\n \tfmt.Println(count)\n }"}, {"source_code": " package main\n \n import (\n \t\"fmt\"\n )\n \n func main() {\n \tvar numOfEmployee int\n \tfmt.Scan(&numOfEmployee)\n \tvar count int = 0\n \tfor i :=1; i <= numOfEmployee/2; i++ {\n \t\tres := numOfEmployee - i\n \t\tif res % i == 0 {\n \t\t\tcount++\n \t\t}\n \t}\n \tfmt.Println(count)\n }"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint32\n\tvar c uint32 = 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i := 1; uint32(i) <= n/2; i++ {\n\t\tif (n-uint32(i))%uint32(i) == 0 {\n\t\t\tc++\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main(){\n\tvar n int\n var res int\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif n % i == 0 {\n\t\t res +=1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar count int = 0\n\tfmt.Scan(&n)\n\tfor i := 1; i < (n/2)+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tcount += 1\n\t\t}\n\t}\n\tfmt.Print(count)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tans := 0\n\tfor i := 1; i < n; i++ {\n\t\tif n % i == 0 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar t,num int\n\tfmt.Scan(&t)\n\tfor i:=1;i 0 {\n\t\tif (n-i)%i == 0 {\n\t\t\tcount++\n\t\t}\n\t\ti++\n\t}\n\n\treturn count\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n int\n\tk := 0\n\tk1 := 1\n\tfmt.Scan(&n)\n\tfor k1 != n {\n\t\tif (n-k1)%k1 == 0 && k1 != n {\n\t\t\tk++\n\t\t\t//fmt.Println((n-k1), (n-k1)%k1)\n\t\t}\n\t\tk1++\n\t}\n\tfmt.Println(k)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar k int\n\n\tfmt.Scan(&n)\n\n\tfor i := 1; i <= n-i; i++ {\n\t\tif (n-i)%i == 0 {\n\t\t\tk++\n\t\t}\n\t}\n\n\tfmt.Println(k)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\trs := 1\n\tn := 0\n\tfmt.Scan(&n)\n\tfor i := 2; i < n; i++ {\n\t\tif n%i == 0 {\n\t\t\trs++\n\t\t}\n\t}\n\tfmt.Print(rs)\n}\n"}, {"source_code": "// cf935a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, c int\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n/2; i++ {\n\t\tif n%i == 0 {\n\t\t\tc++\n\t\t}\n\t}\n\tc++\n\tfmt.Println(c)\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n, ruk, yes int\n yes = 1\n fmt.Scan(&n)\n for ruk = 2; ruk <= n/2; ruk++{\n if (n - ruk) % ruk == 0{\n yes++\n }\n }\n fmt.Print(yes)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &n)\n\tfact := make([]int, 0)\n\tcount := 0\n\tfor n%2 == 0 {\n\t\tcount++\n\t\tn /= 2\n\t}\n\tfact = append(fact, count)\n\tcount = 0\n\tfor i := 3; n > 1; i += 2 {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tcount++\n\t\t}\n\t\tif count > 0 {\n\t\t\tfact = append(fact, count)\n\t\t\tcount = 0\n\t\t}\n\t}\n\tans := 1\n\tfor i := 0; i < len(fact); i++ {\n\t\tans *= (fact[i] + 1)\n\t}\n\tfmt.Println(ans - 1)\n}\n"}, {"source_code": "// A. Fafa and his Company\n/*\nFafa owns a company that works on huge projects. There are n employees\nin Fafa's company. Whenever the company has a new project to start working on,\nFafa has to divide the tasks of this project among all the employees.\n\nFafa finds doing this every time is very tiring for him. So,\nhe decided to choose the best l employees in his company as team leaders.\nWhenever there is a new project, Fafa will divide the tasks among only\nthe team leaders and each team leader will be responsible of some positive\nnumber of employees to give them the tasks. To make this process fair\nfor the team leaders, each one of them should be responsible for the same\nnumber of employees. Moreover, every employee, who is not a team leader,\nhas to be under the responsibility of exactly one team leader,\nand no team leader is responsible for another team leader.\n\nGiven the number of employees n, find in how many ways Fafa could choose\nthe number of team leaders l in such a way that it is possible to divide\nemployees between them evenly.\n\nInput\n\nThe input consists of a single line containing a positive integer\nn (2\u2009\u2264\u2009n\u2009\u2264\u2009105) \u2014 the number of employees in Fafa's company.\n\nOutput\n\nPrint a single integer representing the answer to the problem.\n\nExamples\nInput\n2\n\nOutput\n1\n\nInput\n10\n\nOutput\n3\n\nNote\nIn the second sample Fafa has 3 ways:\n\n choose only 1 employee as a team leader with 9 employees under his responsibility.\n choose 2 employees as team leaders with 4 employees under the responsibility of each of them.\n choose 5 employees as team leaders with 1 employee under the responsibility of each of them.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\tin, _ := strconv.Atoi(string(input))\n\tsol935A(in)\n}\n\nfunc sol935A(in int) {\n\tcount := 0\n\tfor i := 1; i < in; i++ {\n\t\tif in%i == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}\n"}, {"source_code": "// A. Fafa and his Company\n/*\nFafa owns a company that works on huge projects. There are n employees\nin Fafa's company. Whenever the company has a new project to start working on,\nFafa has to divide the tasks of this project among all the employees.\n\nFafa finds doing this every time is very tiring for him. So,\nhe decided to choose the best l employees in his company as team leaders.\nWhenever there is a new project, Fafa will divide the tasks among only\nthe team leaders and each team leader will be responsible of some positive\nnumber of employees to give them the tasks. To make this process fair\nfor the team leaders, each one of them should be responsible for the same\nnumber of employees. Moreover, every employee, who is not a team leader,\nhas to be under the responsibility of exactly one team leader,\nand no team leader is responsible for another team leader.\n\nGiven the number of employees n, find in how many ways Fafa could choose\nthe number of team leaders l in such a way that it is possible to divide\nemployees between them evenly.\n\nInput\n\nThe input consists of a single line containing a positive integer\nn (2\u2009\u2264\u2009n\u2009\u2264\u2009105) \u2014 the number of employees in Fafa's company.\n\nOutput\n\nPrint a single integer representing the answer to the problem.\n\nExamples\nInput\n2\n\nOutput\n1\n\nInput\n10\n\nOutput\n3\n\nNote\nIn the second sample Fafa has 3 ways:\n\n choose only 1 employee as a team leader with 9 employees under his responsibility.\n choose 2 employees as team leaders with 4 employees under the responsibility of each of them.\n choose 5 employees as team leaders with 1 employee under the responsibility of each of them.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\tin, _ := strconv.Atoi(string(input))\n\tsol935A(in)\n}\n\nfunc sol935A(in int) {\n\tcount := 0\n\tfor i := 1; i <= in/2; i++ {\n\t\tif in%i == 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\td := 0\n\tfor i:=2 ; i<=n; i++{\n\t\tif (n%i==0){\n\t\t\td++\n\t\t}\n\t}\n\tfmt.Println(d)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcnt := 0\n\tfor i:=2; i<=n; i++ {\n\t\tif (n%i==0) {\n\t\t\tcnt++\n\t\t};\n\t}\n\tprint(cnt);\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint16\n\tvar c uint16 = 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i := 1; uint16(i) <= n/2; i++ {\n\t\tif (n-uint16(i))%uint16(i) == 0 {\n\t\t\tc++\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n"}], "src_uid": "89f6c1659e5addbf909eddedb785d894"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int64\n fmt.Scan(&n)\n fmt.Println(n / 2520)\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tx := int64(8 * 9 * 5 * 7)\n\tvar n int64\n\tfmt.Scan(&n)\n\tfmt.Println(n / x)\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a int64\n fmt.Scanf(\"%d\", &a)\n fmt.Println(a / 2520)\n}"}, {"source_code": "//\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nconst LCM int64 = 2520\n\nfunc main() {\n\tvar n int64\n\tif _, err := fmt.Scanf(\"%d\", &n); err != nil {\n\t\tfmt.Println(\"Error: Scanf:\", err)\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Println(n / LCM)\n}\n"}], "negative_code": [{"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a int\n fmt.Scanf(\"%a\", &a)\n fmt.Println(a / 2520)\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a int\n fmt.Scanf(\"%d\", &a)\n fmt.Println(a / 2520)\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var a int64\n fmt.Scanf(\"%lld\", &a)\n fmt.Println(a / 2520)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tx := int64(8 * 9 * 5 * 7)\n\tvar n int64\n\tfmt.Scan(&n)\n\tvar i = int64(0)\n\n\tfor ; i*x < n; i = i*i + 1 {\n\t}\n\n\tfor ; i*x > n; i /= 2 {\n\t}\n\n\tfor ; i*x < n; i++ {\n\t}\n\tfmt.Println(i - 1)\n}\n"}], "src_uid": "8551308e5ff435e0fc507b89a912408a"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,y int\n fmt.Scan(&x,&y)\n if x < 0 {\n if y < 0 {\n fmt.Println(x+y,0,0,x+y)\n } else {\n fmt.Println(x-y,0,0,-(x-y))\n }\n } else {\n if y < 0 {\n fmt.Println(0,-(x-y),x-y,0)\n } else {\n fmt.Println(0,x+y,x+y,0)\n }\n }\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\tif x < 0 {\n\t\tif y < 0 {\n\t\t\tfmt.Println(x+y, 0, 0, x+y)\n\t\t} else {\n\t\t\tfmt.Println(x-y, 0, 0, y-x)\n\t\t}\n\t} else {\n\t\tif y < 0 {\n\t\t\tfmt.Println(0, y-x, x-y, 0)\n\t\t} else {\n\t\t\tfmt.Println(0, x+y, x+y, 0)\n\t\t}\n\t}\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar a,b int64\n\tfmt.Scan(&a,&b)\n\tif a>0 && b>0 {\n\t\tfmt.Print(\"0 \",a+b,a+b,\" 0\")\n\t\tfmt.Println()\n\t} else if a<0 && b>0 {\n\t\tfmt.Print(a-b,\" 0 \",\"0 \",b-a)\n\t\tfmt.Println()\n\t} else if a<0 && b<0 {\n\t\tfmt.Print(a+b,\" 0 \",\"0 \",a+b)\n\t\tfmt.Println()\n\t} else if a>0 && b<0 {\n\t fmt.Print(\"0 \",b-a,a-b,\" 0\")\n\t fmt.Println()\n\t}\n\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, gradient, c int64\n\n\tfmt.Scan(&x, &y)\n\n\tgradient = x*y/abs(x*y)\n\tc = y + gradient*x\n\n\tif x < 0 {\n\t\tfmt.Println(-abs(c), 0, 0, c)\n\t} else {\n\t\tfmt.Println(0, c, abs(c), 0)\n\t}\n}\n\nfunc abs(n int64) int64 {\n\tif n < 0 {\n\t\treturn -n\n\t} else {\n\t\treturn n\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x,y int\n fmt.Scan(&x,&y)\n if x < 0 {\n if y < 0 {\n fmt.Println(x+y,0,0,x+y)\n } else {\n fmt.Println(x-y,0,0,-(x-y))\n }\n } else {\n if y < 0 {\n fmt.Println(0,-(x-y),x-y,0)\n } else {\n fmt.Println(0,x+y,x+y,0)\n }\n }\n}\n"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar a,b int64 //input\n\tfmt.Scan(&a,&b)\n\tif a>0 && b>0 {\n\t\tfmt.Print(\"0 \",a+b,a+b,\" 0\")\n\t\tfmt.Println()\n\t} else if a<0 && b>0 {\n\t\tfmt.Print(a-b,\" 0 \",\"0 \",b-a)\n\t\tfmt.Println()\n\t} else if a<0 && b<0 {\n\t\tfmt.Print(a+b,\" 0 \",\"0 \",a+b)\n\t\tfmt.Println()\n\t} else if a>0 && b<0 {\n\t fmt.Print(\"0 \",b-a,a-b,\" 0\")\n\t fmt.Println()\n\t}\n\n}\n\n\n"}, {"source_code": "// 336A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b int\n\tfmt.Scan(&a, &b)\n\tx := a+b\n\ty:= a-b\n\tif a>0{\n\t\tif b>0{\n\t\t\tfmt.Println(0,x,x,0)\n\t\t}else{\n\t\t\tfmt.Println(0,-y,y,0)\n\t\t}\n\t} else{\n\t\tif b>0{\n\t\t\tfmt.Println(y,0,0,-y)\n\t\t}else{\n\t\t\tfmt.Println(x,0,0,x)\n\t\t}\n\t}\n\t\n}"}, {"source_code": "// 258A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var i, k float64\n fmt.Scan(&i, &k)\n t := int64(math.Abs(math.Abs(i) + math.Abs(k)))\n if i > 0 && k > 0 {\n fmt.Printf(\"0 %d %d 0\\n\", t, t)\n } else if i > 0 && k < 0 {\n fmt.Printf(\"0 %d %d 0\\n\", -t, t)\n } else if i < 0 && k > 0 {\n fmt.Printf(\"%d 0 0 %d\\n\", -t, t)\n } else {\n fmt.Printf(\"%d 0 0 %d\\n\", -t, -t)\n }\n}\n"}, {"source_code": "package main\nimport (\n \"fmt\"\n //\"unicode/utf8\"\n)\n\nfunc main() {\n var a,b int64\n fmt.Scan(&a,&b)\n if a>0 && b>0 {\n fmt.Print(\"0 \",a+b,a+b,\" 0\")\n fmt.Println()\n } else if a<0 && b>0 {\n fmt.Print(a-b,\" 0 \",\"0 \",b-a)\n fmt.Println()\n } else if a<0 && b<0 {\n fmt.Print(a+b,\" 0 \",\"0 \",a+b)\n fmt.Println()\n } else if a>0 && b<0 {\n fmt.Print(\"0 \",b-a,a-b,\" 0\")\n fmt.Println()\n }\n\n}\n\n\n"}], "negative_code": [{"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t//\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar a,b int64\n\tfmt.Scan(&a,&b)\n\tif a>0 && b>0 {\n\t\tfmt.Print(\"0 \",a+b,a+b,\" 0\")\n\t\tfmt.Println()\n\t} else if a<0 && b>0 {\n\t\tfmt.Print(a-b,\"0 \",\"0 \",b-a)\n\t\tfmt.Println()\n\t} else if a<0 && b<0 {\n\t\tfmt.Print(a+b,\"0 \",\"0 \",a+b)\n\t\tfmt.Println()\n\t} else if a>0 && b<0 {\n\t fmt.Print(\"0 \",b-a,a-b,\" 0\")\n\t fmt.Println()\n\t}\n\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, gradient, c int\n\n\tfmt.Scan(&x, &y)\n\n\tgradient = x*y/abs(x*y)\n\tc = y + gradient*x\n\n\tif x < 0 {\n\t\tfmt.Println(-abs(c), 0, 0, c)\n\t} else {\n\t\tfmt.Println(0, c, abs(c), 0)\n\t}\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}"}, {"source_code": "// 336A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b int\n\tfmt.Scan(&a, &b)\n\tx := a+b\n\ty:= a-b\n\tif x>0{\n\t\tif y>0{\n\t\t\tfmt.Println(0,x,x,0)\n\t\t}else{\n\t\t\tfmt.Println(0,-y,y,0)\n\t\t}\n\t} else{\n\t\tif y>0{\n\t\t\tfmt.Println(y,0,0,-y)\n\t\t}else{\n\t\t\tfmt.Println(x,0,0,x)\n\t\t}\n\t}\n\t\n}"}, {"source_code": "// 258A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var i, k int\n fmt.Scan(&i, &k)\n t := int64(math.Abs(float64(i + k)))\n if i > 0 && k > 0 {\n fmt.Printf(\"0 %d %d 0\\n\", t, t)\n } else if i > 0 && k < 0 {\n fmt.Printf(\"0 %d %d 0\\n\", -t, t)\n } else if i < 0 && k > 0 {\n fmt.Printf(\"%d 0 0 %d\\n\", -t, t)\n } else {\n fmt.Println(\"%d 0 0 %d\\n\", -t, -t)\n }\n}\n"}, {"source_code": "// 258A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var i, k float64\n fmt.Scan(&i, &k)\n t := int64(math.Abs(math.Abs(i) + math.Abs(k)))\n if i > 0 && k > 0 {\n fmt.Printf(\"0 %d %d 0\\n\", t, t)\n } else if i > 0 && k < 0 {\n fmt.Printf(\"0 %d %d 0\\n\", -t, t)\n } else if i < 0 && k > 0 {\n fmt.Printf(\"%d 0 0 %d\\n\", -t, t)\n } else {\n fmt.Println(\"%d 0 0 %d\\n\", -t, -t)\n }\n}\n"}], "src_uid": "e2f15a9d9593eec2e19be3140a847712"} {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc gcd(a int64, b int64) int64 {\n if b == 0 { return a }\n return gcd(b, a % b)\n}\n\nfunc lcm(a int64, b int64) int64 {\n return a / gcd(a, b) * b\n}\n\nfunc min(a int64, b int64) int64 {\n if a < b { return a }\n return b\n}\n\nfunc max(a int64, b int64) int64 {\n if a > b { return a }\n return b\n}\n\nfunc main() {\n var x int64\n fmt.Scanf(\"%d\", &x)\n ans := x\n for i := int64(1); i * i < x; i++ {\n if x % i != 0 { continue }\n\n j := x / i\n if lcm(i, j) == x {\n ans = min(ans, max(i, j))\n }\n }\n fmt.Println(x / ans, ans)\n}\n\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tt := int64(1)\n\t//fmt.Fscanf(in, \"%d\\n\", &t)\n\tfor tt := int64(0); tt < t; tt++ {\n\t\tn := int64(0)\n\t\tfmt.Fscanf(in, \"%d\\n\", &n)\n\t\ta, b := int64(1), n\n\t\tfor i := int64(1); i*i <= n; i++ {\n\t\t\tif n%i == 0 {\n\t\t\t\tif max(i, n/i) < max(a, b) && gcd(i, n/i) == 1 {\n\t\t\t\t\ta, b = i, n/i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Fprintf(out, \"%d %d\\n\", a, b)\n\t}\n\treturn\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\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"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar x, xx int64\n\tfmt.Scan(&x)\n\tsqrtx := int64(math.Sqrt(float64(x)))\n\ta := make([]int64, 0, 20)\n\txx = x\n\tfor i := int64(2); i <= sqrtx; i++ {\n\t\tvar b int64 = 1\n\t\tfor xx % i == 0 {\n\t\t\tb *= i\n\t\t\txx /= i\n\t\t}\n\t\tif b > 1 {\n\t\t\ta = append(a, b)\n\t\t}\n\t}\n\t// fmt.Println(a)\n\tans := x\n\tfor i := 0; i < (1 << uint(len(a))); i++ {\n\t\tvar tmp int64 = 1\n\t\tfor j := 0; j < len(a); j++ {\n\t\t\tif (i & (1 << uint(j))) != 0 {\n\t\t\t\ttmp *= a[j]\n\t\t\t}\n\t\t}\n\t\t// fmt.Println(i, tmp)\n\t\ttmp = max(tmp, x/tmp)\n\t\tans = min(ans, tmp)\n\t}\n\tfmt.Println(ans, x/ans)\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\nfunc gcd(a,b int64)int64{\n\tif(a==0){\n\t\treturn b\n\t}\n\treturn gcd(b%a,a)\n}\nfunc lcm(a,b int64)int64{\n\treturn a/gcd(a,b)*b\n}\nfunc min(a,b int64)int64{\n\tif(a>b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\nfunc max(a,b int64)int64{\n\tif(a>b){\n\t\treturn a\n\t}\n\treturn b\n}\nfunc main(){\n\tvar n int64\n\tfmt.Scan(&n)\n\tvar mx int64\n\tmx=n\n\tfor i:=int64(1);int64(i*i)<=n;i++{\n\t\tif(n%i==0&&lcm(i,n/i)==n){\n\t\t\tmx=min(mx,max(i,n/i))\n\t\t}\n\t}\n\tfmt.Println(mx,n/mx)\n}\n\n/*********************** utility ***********************/\n\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\n\nfunc init() {\n\t//set input\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(2e+5))\n\tin.Split(bufio.ScanWords)\n\n\t// set output\n\tout = make(chan string, 16)\n\toutWg = &sync.WaitGroup{}\n\toutWg.Add(1)\n\n\twriter := bufio.NewWriterSize(os.Stdout, int(2e+5))\n\tgo func(writer *bufio.Writer) {\n\t\tdefer outWg.Done()\n\t\tdefer writer.Flush()\n\n\t\tfor line := range out {\n\t\t\twriter.WriteString(line + \"\\n\")\n\t\t}\n\t}(writer)\n}\n\nfunc ReadString() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc ReadStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ReadString()\n\t}\n\treturn s\n}\n\nfunc ReadInt() int {\n\tintStr := ReadString()\n\ti, _ := strconv.Atoi(intStr)\n\treturn 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"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc isPrime(number int64) bool {\n\tif number <= 1 {\n\t\treturn false\n\t}\n\tif number == 2 {\n\t\treturn true\n\t}\n\tif number%2 == 0 {\n\t\treturn false\n\t}\n\tsqrNumber := int64(math.Sqrt(float64(number)))\n\n\tfor i := int64(2); i <= sqrNumber; i++ {\n\t\tif number%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(m int64, n int64) int64 {\n\tif n == 0 {\n\t\treturn m\n\t}\n\treturn gcd(n, m%n)\n}\n\nfunc MaxLCM(n int64) (ansA int64, ansB int64) {\n\tif isPrime(n) || n == 1 {\n\t\treturn 1, n\n\t}\n\tsqrNumber := int64(math.Sqrt(float64(n)))\n\tvar ANS_END int64 = int64(math.Pow(10, 12)) + 1\n\tansA = ANS_END\n\tansB = ANS_END\n\tfor i := int64(1); i <= sqrNumber; i++ {\n\t\ta := i\n\t\tif n%a == 0 {\n\t\t\tb := n / a\n\t\t\tif b < ansB && (a == 1 || gcd(a, b) == 1) {\n\t\t\t\tansA = a\n\t\t\t\tansB = b\n\t\t\t}\n\t\t}\n\t}\n\treturn ansA, ansB\n}\n\nfunc main() {\n\tvar n int64 = 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Println(MaxLCM(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc max(a,b int64) int64 {\n\tif a bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tx int64\n)\n\nfunc main() {\n\tx = ReadInt64()\n\n\tif x == 1 {\n\t\tfmt.Println(1, 1)\n\t\treturn\n\t}\n\n\tmemo := TrialDivision(x)\n\tA := []int64{}\n\tfor k, v := range memo {\n\t\tA = append(A, PowInt(k, v))\n\t}\n\n\tans := int64(INF_BIT60)\n\tma, mb := int64(-1), int64(-1)\n\tn := len(A)\n\tfor i := 0; i < (1 << uint(n)); i++ {\n\t\ta, b := int64(1), int64(1)\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif NthBit(int64(i), j) == 1 {\n\t\t\t\ta *= A[j]\n\t\t\t} else {\n\t\t\t\tb *= A[j]\n\t\t\t}\n\t\t}\n\n\t\tif ChMin(&ans, Max(a, b)) {\n\t\t\tma, mb = a, b\n\t\t}\n\t}\n\n\tfmt.Println(ma, mb)\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 *int64, target int64) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\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 ...int64) int64 {\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// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num int64, nth int) int64 {\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 int64, nth int) int64 {\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 int64, nth int) int64 {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int64) 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// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (\u4e8c\u5206\u7d2f\u4e57\u6cd5(O(log e))).\nfunc PowInt(a, e int64) int64 {\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// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int64) map[int64]int64 {\n\tvar i, exp int64\n\tp := map[int64]int64{}\n\n\tif n <= 1 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\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/*******************************************************************/\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, _ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 {\n\t\t\tfmt.Fprint(wr, \" \")\n\t\t}\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n\n\nvar (\n\tx int64\n\tfac []int64\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tx = scanInt64()\n\tans := x\n\tret := [...]int64 {1, x}\n\tfor i := int64(2); i * i <= x; i++ {\n\t\tif x % i == 0 {\n\t\t\tmul := int64(1)\n\t\t\tfor x % i == 0 {\n\t\t\t\tx /= i\n\t\t\t\tmul *= i\n\t\t\t}\n\t\t\tfac = append(fac, mul)\n\t\t}\n\t}\n\tif x != 1 {\n\t\tfac = append(fac, x)\n\t}\n\tfacLen := uint(len(fac))\n\tfor mask := uint(0); mask < (1 << facLen); mask++ {\n\t\tmul := [...]int64 {1, 1}\n\t\tfor i := uint(0); i < facLen; i++ {\n\t\t\tmul[mask >> i & 1] *= fac[i]\n\t\t}\n\t\tif mul[0] > mul[1] {\n\t\t\tmul[0], mul[1] = mul[1], mul[0]\n\t\t}\n\t\tmaxMul := mul[0]\n\t\tif mul[1] > maxMul {\n\t\t\tmaxMul = mul[1]\n\t\t}\n\t\tif maxMul < ans {\n\t\t\tans = maxMul\n\t\t\tret[0], ret[1] = mul[0], mul[1]\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ret[0], ret[1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\nfunc __gcd(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn __gcd(b, a % b)\n}\nfunc work() {\n\tn := ReadInt()\n\ta, b := n, int64(1)\n\tfor i := int64(2); i * i <= n; i++ {\n\t\tif n % i == 0 {\n\t\t\tc, d := n / i, i\n\t\t\tif __gcd(c, d) == 1 {\n\t\t\t\ta, b = c, d\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(a, b)\n}\nfunc main() {\n\twork()\n\tclose(out)\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\nfunc ReadString() string {\n\tin.Scan()\n\treturn in.Text()\n}\nfunc ReadStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ReadString()\n\t}\n\treturn s\n}\nfunc ReadInt() int64 {\n\tintStr := ReadString()\n\ti, _ := strconv.ParseInt(intStr, 10, 64)\n\treturn i\n}\nfunc ReadIntSlice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\nfunc init() {\n\t//set input\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(2e+5))\n\tin.Split(bufio.ScanWords)\n\n\t//set output\n\tout = make(chan string, 16)\n\toutWg = &sync.WaitGroup{}\n\toutWg.Add(1)\n\n\twriter := bufio.NewWriterSize(os.Stdout, int(2e+5))\n\tgo func(write *bufio.Writer) {\n\t\tdefer outWg.Done()\n\t\tdefer write.Flush()\n\n\t\tfor line := range out {\n\t\t\twrite.WriteString(line + \"\\n\")\n\t\t}\n\t}(writer)\n}"}, {"source_code": "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\tX := readll()\n\tminv := int64(10000000000000)\n\tvar ansa, ansb int64\n\tfor i := int64(1); i*i <= X; i++ {\n\t\tif X%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tb := X / i\n\t\tif gcdll(i, b) != 1 {\n\t\t\tcontinue\n\t\t}\n\t\tv := maxll(i, b)\n\t\tif v < minv {\n\t\t\tminv = v\n\t\t\tansa = i\n\t\t\tansb = b\n\t\t}\n\t}\n\tprintln(ansa, ansb)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\n\nfunc main() {\n\n\tx := ReadInt64()\n\tans := int64(0)\n\tfor i := int64(1); i*i <= x; i++ {\n\t\tif x%i == 0 && LCM(x/i, i) == x {\n\t\t\tans = i\n\t\t}\n\t}\n\n\tout <- fmt.Sprintf(\"%v %v\", ans, (x / ans))\n\tclose(out)\n\toutWg.Wait()\n}\n\n/*********************** I/O ***********************/\n\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\n\nfunc init() {\n\t//set input\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(2e+5))\n\tin.Split(bufio.ScanWords)\n\n\t// set output\n\tout = make(chan string, 16)\n\toutWg = &sync.WaitGroup{}\n\toutWg.Add(1)\n\n\twriter := bufio.NewWriterSize(os.Stdout, int(2e+5))\n\tgo func(writer *bufio.Writer) {\n\t\tdefer outWg.Done()\n\t\tdefer writer.Flush()\n\n\t\tfor line := range out {\n\t\t\twriter.WriteString(line + \"\\n\")\n\t\t}\n\t}(writer)\n}\n\nfunc ReadString() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc ReadStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ReadString()\n\t}\n\treturn s\n}\n\nfunc ReadInt64() int64 {\n\tintStr := ReadString()\n\ti, err := strconv.ParseInt(intStr, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\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/*********************** Utils ***********************/\n\nfunc Max(args ...int64) int64 {\n\tmaxV := int64(math.MinInt64)\n\tfor _, v := range args {\n\t\tif v > maxV {\n\t\t\tmaxV = v\n\t\t}\n\t}\n\treturn maxV\n}\n\nfunc Min(args ...int64) int64 {\n\tminV := int64(math.MaxInt64)\n\tfor _, v := range args {\n\t\tif v < minV {\n\t\t\tminV = v\n\t\t}\n\t}\n\treturn minV\n}\n\nfunc GCD(a, b int64) int64 {\n\tif (a == 0) {\n\t\treturn b\n\t}\n\treturn GCD(b%a, a)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a / GCD(a, b) * b\n}\n\nfunc S(v int64) string {\n\treturn strconv.FormatInt(v, 64)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc min(a int64, b int64) int64 {\n if a < b { return a }\n return b\n}\n\nfunc max(a int64, b int64) int64 {\n if a > b { return a }\n return b\n}\n\nfunc main() {\n var x int64\n fmt.Scanf(\"%d\", &x)\n ans := x\n for i := int64(1); i * i < x; i++ {\n j := x / i\n ans = min(ans, max(i, j))\n }\n fmt.Println(x / ans, ans)\n}\n\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc isPrime(number int64) bool {\n if number <= 1 {\n return false\n }\n if number == 2 {\n return true\n }\n if number%2 == 0 {\n return false\n }\n sqrNumber := int64(math.Sqrt(float64(number)))\n\n for i := int64(2); i <= sqrNumber; i++ {\n if number%i == 0 {\n return false\n }\n }\n return true\n}\n\nfunc gcd(m int64, n int64) int64 {\n if n == 0 {\n return m\n }\n return gcd(n, m%n)\n}\n\nfunc MaxLCM(n int64) (ansA int64, ansB int64) {\n if isPrime(n) || n == 1 {\n return 1, n \n }\n sqrNumber := int64(math.Sqrt(float64(n)))\n var ANS_END int64 = int64(math.Pow(10, 12)) + 1\n ansA = ANS_END\n ansB = ANS_END\n for i := int64(1); i <= sqrNumber; i++ {\n a := i\n if n%a == 0 {\n b := n / a\n if b < ansB {\n ansA = a\n ansB = b\n }\n }\n }\n return ansA, ansB\n}\n \nfunc main() {\n var n int64 = 0\n fmt.Scanf(\"%d\\n\", &n)\n fmt.Println(MaxLCM(n))\n} \n "}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc isPrime(number int64) bool {\n\tif number <= 1 {\n\t\treturn false\n\t}\n\tif number == 2 {\n\t\treturn true\n\t}\n\tif number%2 == 0 {\n\t\treturn false\n\t}\n\tsqrNumber := int64(math.Sqrt(float64(number)))\n\n\tfor i := int64(2); i <= sqrNumber; i++ {\n\t\tif number%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(m int64, n int64) int64 {\n\tif n == 0 {\n\t\treturn m\n\t}\n\treturn gcd(n, m%n)\n}\n\nfunc MaxLCM(n int64) (ansA int64, ansB int64) {\n\tif isPrime(n) || n == 1 {\n\t\treturn 1, n\n\t}\n\tsqrNumber := int64(math.Sqrt(float64(n)))\n\tvar ANS_END int64 = int64(math.Pow(10, 12)) + 1\n\tansA = ANS_END\n\tansB = ANS_END\n\tfor i := int64(1); i <= sqrNumber; i++ {\n\t\ta := i\n\t\tif n%a == 0 {\n\t\t\tb := n / a\n\t\t\tif b < ansB && a != b {\n\t\t\t\tansA = a\n\t\t\t\tansB = b\n\t\t\t}\n\t\t}\n\t}\n\treturn ansA, ansB\n}\n\nfunc main() {\n\tvar n int64 = 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Println(MaxLCM(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc max(a,b int64) int64 {\n\tif a c {\n\t\t\t\ta, b = c, d\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(a, b)\n}\nfunc main() {\n\twork()\n\tclose(out)\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nvar out chan string\nvar in *bufio.Scanner\nvar outWg *sync.WaitGroup\nfunc ReadString() string {\n\tin.Scan()\n\treturn in.Text()\n}\nfunc ReadStringSlice(n int) []string {\n\ts := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ts[i] = ReadString()\n\t}\n\treturn s\n}\nfunc ReadInt() int64 {\n\tintStr := ReadString()\n\ti, _ := strconv.ParseInt(intStr, 10, 64)\n\treturn i\n}\nfunc ReadIntSlice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\nfunc init() {\n\t//set input\n\tin = bufio.NewScanner(os.Stdin)\n\tin.Buffer(make([]byte, 1024), int(2e+5))\n\tin.Split(bufio.ScanWords)\n\n\t//set output\n\tout = make(chan string, 16)\n\toutWg = &sync.WaitGroup{}\n\toutWg.Add(1)\n\n\twriter := bufio.NewWriterSize(os.Stdout, int(2e+5))\n\tgo func(write *bufio.Writer) {\n\t\tdefer outWg.Done()\n\t\tdefer write.Flush()\n\n\t\tfor line := range out {\n\t\t\twrite.WriteString(line + \"\\n\")\n\t\t}\n\t}(writer)\n}"}], "src_uid": "e504a04cefef3da093573f9df711bcea"} {"source_code": "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 inc(x int64) int64 {\n\treturn x + 1\n}\nfunc dec(x int64) int64 {\n\treturn x - 1\n}\nfunc isOdd(x int64) bool {\n\treturn x%1 == 1\n}\n\nfunc isNotOdd(x int64) bool {\n\treturn !isOdd(x)\n}\n\nfunc readInt(scanner *bufio.Scanner) int64 {\n\tscanner.Scan()\n\traw := scanner.Text()\n\tresult, _ := strconv.ParseInt(strings.Trim(raw, \" \\n\\r\"), 10, 64)\n\treturn result\n}\nfunc getWithCalc(x int64, cond func(int64) bool, f func(int64) int64) int64 {\n\tif cond(x) {\n\t\treturn f(x)\n\t}\n\treturn x\n}\nfunc check(x1, y1, x2, y2 int64) int64 {\n\n\ta1 := 1 + (getWithCalc(x2, isOdd, dec)-getWithCalc(x1, isOdd, inc))/2\n\tb1 := 1 + (getWithCalc(y2, isOdd, dec)-getWithCalc(y1, isOdd, inc))/2\n\n\ta2 := 1 + (getWithCalc(x2, isNotOdd, dec)-getWithCalc(x1, isNotOdd, inc))/2\n\tb2 := 1 + (getWithCalc(y2, isNotOdd, dec)-getWithCalc(y1, isNotOdd, inc))/2\n\n\treturn a1*b1 + a2*b2\n}\nfunc solve(in io.Reader, out io.Writer) {\n\treader := bufio.NewScanner(in)\n\treader.Split(bufio.ScanWords)\n\n\tfmt.Fprintln(out, check(readInt(reader), readInt(reader), readInt(reader), readInt(reader)))\n}\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x1, y1, x2, y2 int64\n\tfmt.Scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2)\n\n\tvar dx, dy, num_prim_cols, num_sec_cols, len_prim_cols, len_sec_cols int64\n\tdx = x2 - x1\n\tdy = y2 - y1\n\tnum_prim_cols = dx / 2 + 1 //dx guaranteed to be divisible by 2\n\tnum_sec_cols = num_prim_cols - 1\n\tlen_prim_cols = dy / 2 + 1\n\tlen_sec_cols = 0\n//\tfmt.Printf(\"dx=\\t%d\\ndy=\\t%d\\nprim_cols=\\t%d\\nsec_cols=\\t%d\\n\", dx, dy, num_prim_cols, num_sec_cols)\n\n\tif ( dy % 2 == 0) {\n\t\tlen_sec_cols = dy / 2\n\t} else {\n\t\tlen_sec_cols = dy / 2 + 1\n\t}\n//\tfmt.Printf(\"\\nlen_prim_cols=\\t%d\\nlen_sec_cols=\\t%d\\n\", len_prim_cols, len_sec_cols)\n\t\n\tfmt.Println(num_prim_cols * len_prim_cols + num_sec_cols * len_sec_cols)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x1, y1, x2, y2 int64\n\tfmt.Scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2)\n\n\tvar dx, dy, num_prim_cols, num_sec_cols, len_prim_cols, len_sec_cols int64\n\tdx = x2 - x1\n\tdy = y2 - y1\n\tnum_prim_cols = dx / 2 + 1 //dx guaranteed to be divisible by 2\n\tnum_sec_cols = num_prim_cols - 1\n\tlen_prim_cols = dy / 2 + 1\n\tlen_sec_cols = 0\n\tfmt.Printf(\"dx=\\t%d\\ndy=\\t%d\\nprim_cols=\\t%d\\nsec_cols=\\t%d\\n\",\n\t\tdx, dy, num_prim_cols, num_sec_cols)\n\n\tif ( dy % 2 == 0) {\n\t\tlen_sec_cols = dy / 2\n\t} else {\n\t\tlen_sec_cols = dy / 2 + 1\n\t}\n\tfmt.Printf(\"\\nlen_prim_cols=\\t%d\\nlen_sec_cols=\\t%d\\n\",\n\t\tlen_prim_cols, len_sec_cols)\n\t\n\tfmt.Println(\"Total cells = \", num_prim_cols * len_prim_cols + num_sec_cols * len_sec_cols)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x1, y1, x2, y2 int64\n\tfmt.Scanf(\"%d %d %d %d\", &x1, &y1, &x2, &y2)\n\n\tvar dx, dy, num_prim_cols, num_sec_cols, len_prim_cols, len_sec_cols int64\n\tdx = x2 - x1\n\tdy = y2 - y1\n\tnum_prim_cols = dx / 2 + 1 //dx guaranteed to be divisible by 2\n\tnum_sec_cols = num_prim_cols - 1\n\tlen_prim_cols = dy / 2 + 1\n\tlen_sec_cols = 0\n//\tfmt.Printf(\"dx=\\t%d\\ndy=\\t%d\\nprim_cols=\\t%d\\nsec_cols=\\t%d\\n\", dx, dy, num_prim_cols, num_sec_cols)\n\n\tif ( dy % 2 == 0) {\n\t\tlen_sec_cols = dy / 2\n\t} else {\n\t\tlen_sec_cols = dy / 2 + 1\n\t}\n//\tfmt.Printf(\"\\nlen_prim_cols=\\t%d\\nlen_sec_cols=\\t%d\\n\", len_prim_cols, len_sec_cols)\n\t\n\tfmt.Println(\"Total cells = \", num_prim_cols * len_prim_cols + num_sec_cols * len_sec_cols)\n}\n"}], "src_uid": "00cffd273df24d1676acbbfd9a39630d"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar l, r, x, y, k int64\n\tfmt.Scanf(\"%d %d %d %d %d\", &l, &r, &x, &y, &k)\n\tfor cost := x; cost <= y; cost++ {\n\t\texperience := k * cost\n\t\tif experience >= l && experience <= r {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a,b,c,d,e int\n\tvar ans=false\n\tfmt.Scanf(\"%d %d %d %d %d\",&a,&b,&c,&d,&e)\n\tfor i:=c;i<=d;i++ {\n\t\tvar comp=int64(i)*int64(e)\n\t\tif int64(a)<=comp && comp<=int64(b){\n\t\t\tans=true\n\t\t}\n\t}\n\tif ans{\n\t\tfmt.Printf(\"YES\\n\")\n\t} else{\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, x, y, k int64\n\tfmt.Scanf(\"%d %d %d %d %d\", &l, &r, &x, &y, &k)\n\tfor i := l; i <= r; i++ {\n\t\tif (x*k <= i) && (i <= y*k) && (i%k == 0) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tl := readInt64()\n\tr := readInt64()\n\tx := readInt64()\n\ty := readInt64()\n\tk := readInt64()\n\tfor j := x; j <= y; j++ {\n\t\tt := j * k\n\t\tif t > r {\n\t\t\tbreak\n\t\t}\n\t\tif t >= l && t <= r {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\t// for i := l; i <= r; i++ {\n\t// \tfor j := x; j <= y; j++ {\n\t// \t\tif i%j == 0 && i/j == k {\n\t// \t\t\tfmt.Println(\"YES\")\n\t// \t\t\treturn\n\t// \t\t}\n\t// \t}\n\t// }\n\tfmt.Println(\"NO\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var l, r, x, y, k int\n fmt.Scanf(\"%d %d %d %d %d\\n\", &l, &r, &x, &y, &k)\n for b := x; b <= y; b++ {\n a := int64(b) * int64(k)\n if int64(l) <= a && a <= int64(r) {\n fmt.Printf(\"YES\\n\")\n return\n }\n }\n fmt.Printf(\"NO\\n\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, x, y, k int64\n\tfmt.Scan(&l, &r, &x, &y, &k)\n\tif x*k < l {\n\t\tx = (l + k - 1) / k\n\t}\n\tif y*k > r {\n\t\ty = r / k\n\t}\n\tif x > y {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a,b,c,d,e int\n\tvar ans=false\n\tfmt.Scanf(\"%d %d %d %d %d\",&a,&b,&c,&d,&e)\n\tfor i:=c;i=worst && k<=best\t{\n\t\tfmt.Printf(\"YES\\n\")\n\t} else{\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, x, y, k int\n\tfmt.Scanf(\"%d %d %d %d %d\", &l, &r, &x, &y, &k)\n\tfor i := l; i <= r; i++ {\n\t\tif (x*k <= i) && (i <= y*k) && (i%k == 0) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar l, r, x, y, k int\n\tfmt.Scanf(\"%d %d %d %d %d\", &l, &r, &x, &y, &k)\n\tfor cost := x; cost <= y; cost++ {\n\t\texperience := k * cost\n\t\tif experience >= l && experience <= r {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, x, y, k int\n\tfmt.Scan(&l, &r, &x, &y, &k)\n\tif x*k < l {\n\t\tx = (l + k - 1) / k\n\t}\n\tif y*k > r {\n\t\ty = r / k\n\t}\n\tif x > y {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}], "src_uid": "1110d3671e9f77fd8d66dca6e74d2048"} {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = false\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tin := gsls(reader)[0]\n\n\tdbg(\"hh:mm: %v\\n\", in)\n\n\th := in[0:2]\n\tm := in[3:5]\n\n\tdbg(\"h: %v m: %v\\n\", h, m)\n\tdbg(\"%v\\n\", isPalindrome(h, m))\n\n\ti := 0\n\n\tfor !isPalindrome(h, m) {\n\t\th, m = increment(h, m)\n\t\ti++\n\t\tdbg(\"Increased to %v:%v...\\n\", h, m)\n\t}\n\n\tfmt.Print(i)\n\n\treturn\n\n}\n\nfunc isPalindrome(h, m string) bool {\n\treturn string(h[1])+string(h[0]) == m\n}\n\nfunc increment(h, m string) (string, string) {\n\thi, _ := strconv.Atoi(h)\n\tmi, _ := strconv.Atoi(m)\n\n\tmi++\n\tif mi == 60 {\n\t\tmi = 0\n\t\thi++\n\t\tif hi == 24 {\n\t\t\thi = 0\n\t\t}\n\t}\n\n\th = strconv.FormatInt(int64(hi), 10)\n\tif len(h) == 1 {\n\t\th = \"0\" + h\n\t}\n\n\tm = strconv.FormatInt(int64(mi), 10)\n\tif len(m) == 1 {\n\t\tm = \"0\" + m\n\t}\n\n\treturn h, m\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n", "positive_code": [{"source_code": "// karen.go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\n\tss := strings.Split(s, \":\")\n\tif len(ss) == 2 {\n\t\tvar cnt int = 0\n\t\tfor {\n\t\t\tif []byte(ss[0])[0] == []byte(ss[1])[1] && []byte(ss[0])[1] == []byte(ss[1])[0] {\n\t\t\t\tfmt.Println(cnt)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcnt++\n\t\t\tm, _ := strconv.Atoi(ss[1])\n\t\t\tm = m + 1\n\t\t\tn, _ := strconv.Atoi(ss[0])\n\t\t\tif m == 60 {\n\t\t\t\tm = 0\n\t\t\t\tn = n + 1\n\t\t\t\tif n == 24 {\n\t\t\t\t\tn = 0\n\t\t\t\t}\n\t\t\t}\n\t\t\tss[0] = fmt.Sprintf(\"%02d\", n)\n\t\t\tss[1] = fmt.Sprintf(\"%02d\", m)\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tfor minute := 0; ; minute++ {\n\t\tif isPalinrom(s) {\n\t\t\tfmt.Println(minute)\n\t\t\tbreak\n\t\t}\n\t\ts = inc(s)\n\t}\n}\n\nfunc inc(s string) string {\n\tele := strings.Split(s, \":\")\n\tminute, _ := strconv.Atoi(ele[1])\n\thour, _ := strconv.Atoi(ele[0])\n\tif minute == 59 {\n\t\thour++\n\t\tif hour == 24 {\n\t\t\thour = 0\n\t\t}\n\t\tminute = 0\n\t} else {\n\t\tminute++\n\t}\n\treturn fmt.Sprintf(\"%02d:%02d\", hour, minute)\n}\n\nfunc isPalinrom(s string) bool {\n\tfor i:= 0; i < len(s) / 2; i++ {\n\t\tif(s[i] != s[len(s)-i-1]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc getLine2Ints(n int) []int {\n\tans := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d \", &ans[i])\n\t}\n\tscanf(\"%d\\n\", &ans[n-1])\n\treturn ans\n}\n\nfunc pcheck(i bool) {\n\tif i {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n\nvar debug = true\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tvar hh, mm int\n\tscanf(\"%d:%d\\n\", &hh, &mm)\n\tfor i := 0; i < 24*60; i++ {\n\t\thtom := hh%10*10 + hh/10\n\t\tif htom == mm {\n\t\t\tprintf(\"%d\\n\", i)\n\t\t\treturn\n\t\t}\n\t\tmm = (mm + 1) % 60\n\t\tif mm == 0 {\n\t\t\thh = (hh + 1) % 24\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype Time struct {\n\tminutes int\n\thours int\n}\n\nfunc (t *Time) is_pal() bool {\n\tstr := t.ToString()\n\treturn str[0] == str[4] && str[1] == str[3]\n}\n\nfunc (t *Time) AddMinute() {\n\tif t.minutes == 59 {\n\t\tt.AddHour()\n\t\tt.minutes = 0\n\t} else {\n\t\tt.minutes = t.minutes + 1\n\t}\n}\n\nfunc (t *Time) AddHour() {\n\tif t.hours == 23 {\n\t\tt.hours = 00\n\t}else{\n\t\tt.hours++\n\t}\n}\n\n\nfunc (t *Time) ToString() string {\n\treturn fmt.Sprintf(\"%02d\", t.hours) + \":\" + fmt.Sprintf(\"%02d\", t.minutes)\n}\n\nfunc main() {\n\n\tans := 0\n\tvar in string\n\tfmt.Scanf(\"%s\", &in)\n\tvar time Time\n\tvar err error\n\ttime.hours, err = strconv.Atoi(in[:2])\n\ttime.minutes, err = strconv.Atoi(in[3:])\n\n\tif err != nil {\n\t\t// handle error\n\t\tfmt.Println(err)\n\t}\n\n\tfor {\n\t\tif time.is_pal() {\n\t\t\tfmt.Println(ans)\n\t\t\tbreak\n\t\t}\n\t\tans++\n\t\ttime.AddMinute()\n\t\t//fmt.Print(ans )\n\t\t//fmt.Println(\" \" + time.ToString())\n\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc toNum(s string) int {\n h := (int(s[0]) - int('0')) * 10 + (int(s[1]) - int('0'))\n m := (int(s[3]) - int('0')) * 10 + (int(s[4]) - int('0'))\n return h * 60 + m\n}\n\nfunc isPalindrome(n int) bool {\n h := n / 60\n m := n % 60\n\n a := fmt.Sprintf(\"%02d:%02d\", h, m)\n for i := 0; i < len(a); i++ {\n if a[i] != a[len(a) - 1 - i] {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n var s string\n for {\n _, err := fmt.Scan(&s)\n if err != nil { break }\n\n n := toNum(s)\n t := 0\n for {\n if isPalindrome(n) {\n break\n }\n t++\n n = (n + 1) % (24 * 60)\n }\n fmt.Println(t)\n }\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tfor {\n\t\tvar hh, mm int\n\t\texitCode, err := fmt.Scanf(\"%d:%d\", &hh, &mm)\n\t\tif exitCode == -1 || err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\ttt := hh*60 + mm\n\t\tfor i := 0; ; i++ {\n\t\t\tif tt%60%10 == tt/60/10 && tt%60/10 == tt/60%10 {\n\t\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt = (tt + 1) % (24 * 60)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar hh, mm int\n\tfor {\n\t\texitCode, err := fmt.Scanf(\"%d:%d\", &hh, &mm)\n\t\tif exitCode == -1 || err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\ttt := hh*60 + mm\n\t\tfor i := 0; ; i++ {\n\t\t\tif tt%60%10 == tt/60/10 && tt%60/10 == tt/60%10 {\n\t\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt = (tt + 1) % (24 * 60)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isPalindrome(tt int) bool {\n\treturn tt%60%10 == tt/60/10 && tt%60/10 == tt/60%10\n}\n\nfunc main() {\n\tvar hh, mm int\n\tfor {\n\t\texitCode, err := fmt.Scanf(\"%d:%d\", &hh, &mm)\n\t\tif exitCode == -1 || err != nil {\n\t\t\tbreak\n\t\t}\n\t\ttt := hh*60 + mm\n\t\tfor i := 0; ; i++ {\n\t\t\tif isPalindrome(tt) {\n\t\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt = (tt + 1) % (24 * 60)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc check(hour int, min int) bool {\n\tvar hourstr, minstr string\n\tif hour/10 == 0 {\n\t\thourstr = \"0\" + strconv.Itoa(hour)\n\t} else {\n\t\thourstr = strconv.Itoa(hour)\n\t}\n\tif min/10 == 0 {\n\t\tminstr = \"0\" + strconv.Itoa(min)\n\t} else {\n\t\tminstr = strconv.Itoa(min)\n\t}\n\tif hourstr[0] == minstr[1] && hourstr[1] == minstr[0] {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar hour, min, count int\n\tfmt.Scanf(\"%d:%d\", &hour, &min)\n\tfor {\n\t\tif check(hour, min) {\n\t\t\tfmt.Println(count)\n\t\t\tbreak\n\t\t}\n\t\tmin++\n\t\tcount++\n\t\tif min == 60 {\n\t\t\tmin = 0\n\t\t\thour++\n\t\t}\n\t\tif hour == 24 {\n\t\t\thour = 0\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc check(hour int, min int) bool {\n\tvar hourstr, minstr string\n\tif hour/10 == 0 {\n\t\thourstr = \"0\" + strconv.Itoa(hour)\n\t} else {\n\t\thourstr = strconv.Itoa(hour)\n\t}\n\tif min/10 == 0 {\n\t\tminstr = \"0\" + strconv.Itoa(min)\n\t} else {\n\t\tminstr = strconv.Itoa(min)\n\t}\n\tif hourstr[0] == minstr[1] && hourstr[1] == minstr[0] {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar hour, min, count int\n\tfmt.Scanf(\"%d:%d\", &hour, &min)\n\tfor {\n\t\tif check(hour, min) {\n\t\t\tfmt.Println(count)\n\t\t\tbreak\n\t\t}\n\t\tmin++\n\t\tcount++\n\t\tif min == 60 {\n\t\t\tmin = 0\n\t\t\thour++\n\t\t\tif hour == 24 {\n\t\t\t\thour = 0\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar H, M int\n\tfmt.Scanf(\"%d:%d %d\", &H, &M)\n\tcount := 0\n\tfor {\n\t\ts := fmt.Sprintf(\"%02d%02d\", H, M)\n\t\tsame := true\n\t\tfor i := 0; i <= len(s)/2; i++ {\n\t\t\tif s[i] != s[len(s)-i-1] {\n\t\t\t\tsame = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif same {\n\t\t\tbreak\n\t\t}\n\t\tcount++\n\t\tM++\n\t\tif M == 60 {\n\t\t\tM = 0\n\t\t\tH++\n\t\t\tif H == 24 {\n\t\t\t\tH = 0\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\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}\nfunc solve(s string) string {\n\treturn s\n}\n\nfunc output(i int, ans string) {\n\tfmt.Printf(\"Case #%d: %s\\n\", i, ans)\n}\n\nfunc strTime(x int) string {\n\treturn fmt.Sprintf(\"%02d:%02d\", x/60, x%60)\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 1000000), 1000000)\n\t//var numTests int\n\tscanner.Scan()\n\tc := strings.Split(scanner.Text(), \":\")\n\ta, _ := strconv.Atoi(c[0])\n\tb, _ := strconv.Atoi(c[1])\n\tcount := 0\n\tx := a*60 + b\n\tfor true {\n\t\ts := strTime(x)\n\t\t//fmt.Println(s)\n\t\tif s == Reverse(s) {\n\t\t\tbreak\n\t\t}\n\t\tx++\n\t\tif x == 24*60 {\n\t\t\tx = 0\n\t\t}\n\t\tcount++\n\t}\n\tfmt.Println(count)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar hh, mm, counter int\n\t\n\thh = 23\n\tmm = 59\n\tfmt.Scanf(\"%d:%d\", &hh, &mm)\n\t\n\tcounter = 0\n\tfor (isPalindrom(hh,mm) == false) {\n\t\tmm += 1\n\t\tif (mm == 60) {\n\t\t\tmm = 0\n\t\t\thh += 1\n\t\t}\n\t\tif (hh == 24) {hh = 0}\n\t\tcounter += 1\n\t}\n\t\n\tfmt.Printf(\"%d\\n\", counter)\n}\n\nfunc isPalindrom(hh int, mm int) bool {\n\treturn (hh%10 == mm/10) && (hh/10 == mm%10)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc toNum(s string) int {\n h := (int(s[0]) - int('0')) * 10 + (int(s[1]) - int('0'))\n m := (int(s[3]) - int('0')) * 10 + (int(s[4]) - int('0'))\n return h * 60 + m\n}\n\nfunc isPalindrome(n int) bool {\n h := n / 60\n m := n % 60\n\n a := fmt.Sprintf(\"%02d:%02d\", h, m)\n for i := 0; i < len(a); i++ {\n if a[i] != a[len(a) - 1 - i] {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n var s string\n for {\n _, err := fmt.Scan(&s)\n if err != nil { break }\n\n n := toNum(s)\n t := 0\n for {\n if isPalindrome(n) {\n break\n }\n t++\n n = (n + 1) % (24 * 60)\n if (t > 10) { break }\n }\n fmt.Println(t)\n }\n}\n\n"}], "src_uid": "3ad3b8b700f6f34b3a53fdb63af351a5"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(t interface{}, delim string) {\n\tfmt.Fscanf(r, \"%v\"+delim, t)\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar r *bufio.Reader\nvar w *bufio.Writer\n\nvar months []int\nvar days []string\n\nfunc getDayByMonth(month, start int) string {\n\td := start\n\tfor i := 0; i < month; i++ {\n\t\td += months[i]\n\t}\n\tday := days[d%7]\n\treturn day\n}\n\nfunc main() {\n\tr = bufio.NewReader(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tmonths = []int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\n\tdays = []string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\n\tvar first, second string\n\tI(&first, \"\\n\")\n\tI(&second, \"\\n\")\n\tfor m := 0; m < 11; m++ {\n\t\tfor d := 0; d < 7; d++ {\n\t\t\tif getDayByMonth(m, d) == first && getDayByMonth(m+1, d) == second {\n\t\t\t\tO(\"YES\", \"\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tO(\"NO\", \"\\n\")\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc (sc *scanner) next() string {\n\tsc.sc.Scan()\n\treturn sc.sc.Text()\n}\n\nfunc (sc *scanner) nextInt() int {\n\ti, err := strconv.Atoi(sc.next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc newScanner(r io.Reader, split bufio.SplitFunc) *scanner {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(split)\n\treturn &scanner{\n\t\tsc: sc,\n\t}\n}\n\nvar wsc = newScanner(os.Stdin, bufio.ScanWords)\nvar lsc = newScanner(os.Stdin, bufio.ScanLines)\n\nfunc next() string {\n\treturn wsc.next()\n}\n\nfunc nextInt() int {\n\treturn wsc.nextInt()\n}\n\nfunc nextLine() string {\n\treturn lsc.next()\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}\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\nvar weekdays = map[string]int{\n\t\"sunday\": 1,\n\t\"monday\": 2,\n\t\"tuesday\": 3,\n\t\"wednesday\": 4,\n\t\"thursday\": 5,\n\t\"friday\": 6,\n\t\"saturday\": 7,\n}\n\nfunc main() {\n\td1, d2 := weekdays[next()], weekdays[next()]\n\tif d1-d2 == 4 || d2-d1 == 3 || d1-d2 == 5 || d2-d1 == 2 || d1 == d2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc Assert(b bool) {\n\tif !b {\n\t\tpanic(\"Assertion error\")\n\t}\n}\n\nfunc GetLine(scanner *bufio.Scanner) string {\n\tAssert(scanner.Scan() && scanner.Err() == nil)\n\treturn scanner.Text()\n}\n\nfunc SliceIndex(limit int, predicate func(i int) bool) int {\n\tfor i := 0; i < limit; i++ {\n\t\tif predicate(i) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc Ternary(c bool, a, b interface{}) interface{} {\n\tif c { return a }\n\treturn b\n}\n\nfunc main() {\n\tf := os.Stdin\n\n\tsc := bufio.NewScanner(f)\n\n\tdays := []string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\tReadDay := func() int {\n\t\ts := GetLine(sc)\n\t\tidx := SliceIndex(len(days), func(i int) bool { return days[i] == s })\n\t\tAssert(idx != -1)\n\t\treturn idx\n\t}\n\n\tfirst := ReadDay()\n\tsecond := ReadDay()\n\tdiff := second - first\n\tif diff < 0 {\n\t\tdiff += 7\n\t}\n\n\tpossibles := []int{0, 2, 3}\n\tres := SliceIndex(len(possibles), func(i int) bool { return possibles[i] == diff })\n\n\tfmt.Println(Ternary(res == -1, \"NO\", \"YES\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc OpenFile(fpath string) *os.File {\n\tf, err := os.Open(fpath)\n\tAssert(err == nil)\n\treturn f\n}\n\nfunc Assert(b bool) {\n\tif !b {\n\t\tpanic(\"Assertion error\")\n\t}\n}\n\nfunc GetLine(scanner *bufio.Scanner) string {\n\tAssert(scanner.Scan() && scanner.Err() == nil)\n\treturn scanner.Text()\n}\n\nfunc ReadIntLine(scanner *bufio.Scanner) []int {\n\tlst := make([]int, 0)\n\tfor _, s := range strings.Fields(GetLine(scanner)) {\n\t\ti, err := strconv.Atoi(s)\n\t\tAssert(err == nil)\n\t\tlst = append(lst, i)\n\t}\n\treturn lst\n}\n\nfunc SliceIndex(limit int, predicate func(i int) bool) int {\n\tfor i := 0; i < limit; i++ {\n\t\tif predicate(i) {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc Ternary(c bool, a, b interface{}) interface{} {\n\tif c { return a }\n\treturn b\n}\n\nfunc main() {\n\tf := os.Stdin\n\t//f := strings.NewReader(\"Now is the winter of our discontent,\\n1 3 4\\n\")\n\t//f = OpenFile(\"/home/ilya/opt/programming/tasks/724A.txt\")\n\n\tsc := bufio.NewScanner(f)\n\n\tdays := []string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\tReadDay := func() int {\n\t\ts := GetLine(sc)\n\t\tidx := SliceIndex(len(days), func(i int) bool { return days[i] == s })\n\t\tAssert(idx != -1)\n\t\treturn idx\n\t}\n\n\tfirst := ReadDay()\n\tsecond := ReadDay()\n\tdiff := second - first\n\tif diff < 0 {\n\t\tdiff += 7\n\t}\n\n\tpossibles := []int{0, 2, 3}\n\tres := SliceIndex(len(possibles), func(i int) bool { return possibles[i] == diff })\n\n\tfmt.Println(Ternary(res == -1, \"NO\", \"YES\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nvar days [12]int = [12]int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\nvar weekDays [7]string = [7]string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\nfunc getWeekDayId(wd string) int {\n\tfor i := 0; i < 7; i++ {\n\t\tif weekDays[i] == wd {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc yes(d1 int, d2 int) bool {\n\tfor i := 0; i < 11; i++ {\n\t\tif (d1+days[i])%7 == d2 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar wd1, wd2 string\n\tfmt.Fscanf(bufin, \"%s\\n\", &wd1)\n\tfmt.Fscanf(bufin, \"%s\\n\", &wd2)\n\n\tvar d1, d2 int\n\td1 = getWeekDayId(wd1)\n\td2 = getWeekDayId(wd2)\n\n\tif yes(d1, d2) {\n\t\tfmt.Fprintf(bufout, \"YES\\n\")\n\t} else {\n\t\tfmt.Fprintf(bufout, \"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc readInt(num int) []int {\n\tin := make([]int, 0, num)\n\tfor i := 0; i < num; i++ {\n\t\tvar d int\n\t\tfmt.Scan(&d)\n\t\tin = append(in, d)\n\t}\n\treturn in\n}\n\nfunc readStr() string {\n\tvar in string\n\tfmt.Scan(&in)\n\treturn in\n}\n\nvar day = map[string]int{\n\t\"monday\": 0,\n\t\"tuesday\": 1,\n\t\"wednesday\": 2,\n\t\"thursday\": 3,\n\t\"friday\": 4,\n\t\"saturday\": 5,\n\t\"sunday\": 6,\n}\n\nfunc main() {\n\tp := day[readStr()]\n\tc := day[readStr()]\n\tdiff := p - c\n\tif (diff == -3) || (diff == -2) || (diff == 0) || (diff == 4) || (diff == 5) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nvar\n\tdays = [...]string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\nfunc main () {\n\tvar (\n\t\ts1, s2 string\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &s1)\n\tfmt.Fscanln(input, &s2)\n\n\tp1, p2 := 0, 0\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s1 {\n\t\t\tp1 = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s2 {\n\t\t\tp2 = i + 7\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Solve\n\tdiff := (p2 - p1) % 7\n\tif 31 % 7 == diff || 28 % 7 == diff || 30 % 7 == diff {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar date_1, date_2 string\n\tdates := [7]string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\tfsc := NewFastScanner()\n\n\tvar d1, d2 int\n\tdate_1 = fsc.Next()\n\tdate_2 = fsc.Next()\n\tfor i := 1; i < 7; i++ {\n\t\tif date_1 == dates[i] {\n\t\t\td1 = i\n\t\t}\n\t\tif date_2 == dates[i] {\n\t\t\td2 = i\n\t\t}\n\t}\n\tif d2 < d1 {\n\t\td2 += 7\n\t}\n\tret := d2 - d1\n\tif ret == 0 || ret == 2 || ret == 3 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) 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\tpanic(err.Error())\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"}, {"source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\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, 0)\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\nfunc main() {\n\tsc := NewScanner()\n\tA := sc.NextLine()\n\tB := sc.NextLine()\n\n\tdays := []string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\n\tc := 0\n\tfor ; c < 7; c++ {\n\t\tif days[c] == A {\n\t\t\tbreak\n\t\t}\n\t}\n\n\td := 0\n\tfor ; d < 7; d++ {\n\t\tif days[d] == B {\n\t\t\tbreak\n\t\t}\n\t}\n\tday := []int{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\n\tdiff := abs((d - c + 7) % 7)\n\tfor i := 0; i < 12; i++ {\n\t\tif diff == day[i] % 7 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n\treturn\n\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n"}], "negative_code": [{"source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nvar\n\tdays = [...]string{\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"}\n\nfunc main () {\n\tvar (\n\t\ts1, s2 string\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &s1)\n\tfmt.Fscanln(input, &s2)\n\n\tp1, p2 := 0, 0\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s1 {\n\t\t\tp1 = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < len(days); i++ {\n\t\tif days[i] == s2 {\n\t\t\tp2 = i + 7\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Solve\n\tdiff := (p2 - p1)\n\tif 31 % 7 == diff || 28 % 7 == diff || 30 % 7 == diff {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc (sc *scanner) next() string {\n\tsc.sc.Scan()\n\treturn sc.sc.Text()\n}\n\nfunc (sc *scanner) nextInt() int {\n\ti, err := strconv.Atoi(sc.next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc newScanner(r io.Reader, split bufio.SplitFunc) *scanner {\n\tsc := bufio.NewScanner(r)\n\tsc.Split(split)\n\treturn &scanner{\n\t\tsc: sc,\n\t}\n}\n\nvar wsc = newScanner(os.Stdin, bufio.ScanWords)\nvar lsc = newScanner(os.Stdin, bufio.ScanLines)\n\nfunc next() string {\n\treturn wsc.next()\n}\n\nfunc nextInt() int {\n\treturn wsc.nextInt()\n}\n\nfunc nextLine() string {\n\treturn lsc.next()\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}\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\nvar weekdays = map[string]int{\n\t\"sunday\": 1,\n\t\"monday\": 2,\n\t\"tuesday\": 3,\n\t\"wednesday\": 4,\n\t\"thursday\": 5,\n\t\"friday\": 6,\n\t\"saturday\": 7,\n}\n\nfunc main() {\n\td1, d2 := weekdays[next()], weekdays[next()]\n\tif d1-d2 == 4 || d2-d1 == 3 || d1-d2 == 3 || d2-d1 == 2 || d1 == d2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}], "src_uid": "2a75f68a7374b90b80bb362c6ead9a35"} {"source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\tvar dest = [5]string {\"Danil\", \"Olya\", \"Slava\", \"Ann\" ,\"Nikita\"}\n\tsum := 0\n\tfor i := 0; i < 5; i++{\n\t\tsum += matchStr(str, dest[i])\n\t}\n\tif sum == 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc matchStr(src string, dest string) int{\n\tsum := 0\n\tfor i := 0; i + len(dest) - 1 < len(src); i++{\n\t\tflag := true\n\t\tfor j := 0; j < len(dest); j++{\n\t\t\tif src[i + j] != dest[j]{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tsum++\n\t\t}\n\t}\n\treturn sum\n}", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n //\"strconv\"\n \"strings\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var s string\n fmt.Fscan(scanner, &s)\n \n cnt := strings.Count(s, \"Danil\") + strings.Count(s, \"Olya\")\n cnt += strings.Count(s, \"Slava\") + strings.Count(s, \"Ann\") + strings.Count(s, \"Nikita\")\n if(cnt == 1) {\n writer.WriteString(\"YES\")\n } else {\n writer.WriteString(\"NO\")\n }\n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF877A(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar s string\n\tFscan(in, &s)\n\tc := 0\n\tfor _, name := range []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"} {\n\t\tc += strings.Count(s, name)\n\t}\n\tif c == 1 {\n\t\tFprintln(out, \"YES\")\n\t} else {\n\t\tFprintln(out, \"NO\")\n\t}\n}\n\nfunc main() { CF877A(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar friends = []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tvar (\n\t\tproblems string\n\t\tcount int\n\t)\n\tfmt.Scan(&problems)\n\n\tfor _, friend := range friends {\n\t\tcount += strings.Count(problems, friend)\n\n\t\tif count > 1 {\n\t\t\tfmt.Print(\"NO\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tif count == 0 {\n\t\tfmt.Print(\"NO\\n\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\\n\")\n}\n"}, {"source_code": "// Try Codeforces\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tnames := []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tcnt := 0\n\tfor _, x := range names {\n\t\tt := s[:]\n\t\tfor i := 0; i < 10; i++ {\n\t\t\tp := strings.Index(t, x)\n\t\t\tif p < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt = t[p+len(x):]\n\t\t\tcnt++\n\t\t}\n\t}\n\tif cnt == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\tvar dest = [5]string {\"Danil\", \"Olya\", \"Slava\", \"Ann\" ,\"Nikita\"}\n\tsum := 0\n\tfor i := 0; i < 5; i++{\n\t\tif matchStr(str, dest[i]){\n\t\t\tsum++\n\t\t}\n\t}\n\tif sum == 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc matchStr(src string, dest string) bool{\n\tfor i := 0; i + len(dest) - 1 < len(src); i++{\n\t\tflag := true\n\t\tfor j := 0; j < len(dest); j++{\n\t\t\tif src[i + j] != dest[j]{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF877A(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar s string\n\tFscan(in, &s)\n\tc := 0\n\tfor _, name := range []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"} {\n\t\tif strings.Index(s, name) >= 0 {\n\t\t\tc++\n\t\t}\n\t}\n\tif c == 1 {\n\t\tFprintln(out, \"YES\")\n\t} else {\n\t\tFprintln(out, \"NO\")\n\t}\n}\n\nfunc main() { CF877A(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar friends = []string{\"Danil\", \"Olya\", \"Slava\", \"Ann\", \"Nikita\"}\n\tvar (\n\t\tproblems string\n\t\tcount int\n\t)\n\tfmt.Scan(&problems)\n\n\tfor _, friend := range friends {\n\t\tif has := strings.Contains(problems, friend); has {\n\t\t\tcount++\n\t\t}\n\t\tif count > 1 {\n\t\t\tfmt.Print(\"NO\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tif count == 0 {\n\t\tfmt.Print(\"NO\\n\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\\n\")\n}\n"}], "src_uid": "db2dc7500ff4d84dcc1a37aebd2b3710"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\n\tsec := make([]int, n)\n\tfinger_print := make([]int, m)\n\tfor i, _ := range sec {\n\t\tfmt.Scan(&sec[i])\n\t}\n\n\tfor i, _ := range finger_print {\n\t\tfmt.Scan(&finger_print[i])\n\t}\n\n\tfor _, i := range sec {\n\t\t//fmt.Println(\"valor de i \", i)\n\t\tfor _, j := range finger_print {\n\t\t\t//fmt.Println(\"valor de jjj \", j)\n\n\t\t\tif i == j {\n\t\t\t\tfmt.Print(strconv.Itoa(i))\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\n\t\t}\n\n\t}\n\tfmt.Println()\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n \"fmt\"\n \"sort\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\n\n\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int { return len(slice) }\nfunc (slice Int64Slice) Less(i, j int) bool { return slice[i] < slice[j] }\nfunc (slice Int64Slice) Swap(i, j int) { slice[i], slice[j] = slice[j], slice[i] }\n\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n n,m := ReadInt64(), ReadInt64()\n\n x:=make([]int64,n)\n for i:=0;i= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\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"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x, y []int) (res []int) {\n\tn := make(map[int]bool)\n\tfor _, v := range y {\n\t\tn[v] = true\n\t}\n\n\tfor _, v := range x {\n\t\t_, ok := n[v]\n\t\tif ok {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&x[i])\n\t}\n\n\ty := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&y[i])\n\t}\n\n\tres := solve(x, y)\n\tfor _, v := range res {\n\t\tfmt.Printf(\"%d \", v)\n\t}\n\n\t// {\n\t// \tx := []int{3, 5, 7, 1, 6, 2, 8}\n\t// \ty := []int{1, 2, 7}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n\n\t// {\n\t// \tx := []int{3, 4, 1, 0}\n\t// \ty := []int{0, 1, 7, 9}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n}\n"}, {"source_code": "package main\n\nimport (\"fmt\")\n\ntype boolean bool\n\nfunc main() {\n\tn := nextInt()\n\tk := nextInt()\n\tvar a []int = make([]int, n)\n\tset := Set{make(map[int]boolean)}\n\tfor i := 0; i < n; i++{\n\t\ta[i] = nextInt()\n\t}\n\tfor i := 0; i < k; i++{\t\n\t\tset.add(nextInt())\n\t}\n\tfor i := 0; i < n; i++{\n\t\tif set.contains(a[i]){\n\t\t\tsout(a[i])\n\t\t\tset.remove(a[i])\n\t\t}\n\t}\n}\n\nfunc next() string{\n\tvar ss string\n\tfmt.Scan(&ss)\n\treturn ss\n}\nfunc nextInt() int{\n\tvar ss int;\n\tfmt.Scan(&ss)\n\treturn ss\n}\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k, \" \")\n\t}\n\tfmt.Println()\n}\n\ntype Set struct{mp map[int]boolean}\n\nfunc (self Set) add (key int){self.mp[key] = true}\n\nfunc (self Set) remove(key int){delete(self.mp, key)}\n\nfunc (self Set) contains(key int) boolean{return self.mp[key] == true}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n, m, i, y int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\n\txList := make([]int, n)\n\tfor i = 0; i < n; i++ {\n\t\tfmt.Scan(&xList[i])\n\t}\n\n\tyList := make(map[int]bool)\n\tfor i = 0; i < m; i++ {\n\t\tfmt.Scan(&y)\n\t\tyList[y] = true\n\t}\n\n\tresult := make([]string, 0)\n\tfor i = 0; i < n; i++ {\n\t\tif yList[xList[i]] {\n\t\t\tresult = append(result, strconv.Itoa(xList[i]))\n\t\t}\n\t}\n\n\tfmt.Println(strings.Join(result, \" \"))\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x, y []int) (res []int) {\n\tn := make(map[int]bool)\n\tfor _, v := range y {\n\t\tn[v] = true\n\t}\n\n\tfor _, v := range x {\n\t\t_, ok := n[v]\n\t\tif ok {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &x[i])\n\t}\n\n\ty := make([]int, n)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d\", &y[i])\n\t}\n\n\tres := solve(x, y)\n\tfor _, v := range res {\n\t\tfmt.Printf(\"%d \", v)\n\t}\n\n\t// {\n\t// \tx := []int{3, 5, 7, 1, 6, 2, 8}\n\t// \ty := []int{1, 2, 7}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n\n\t// {\n\t// \tx := []int{3, 4, 1, 0}\n\t// \ty := []int{0, 1, 7, 9}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x, y []int) (res []int) {\n\tn := make(map[int]bool)\n\tfor _, v := range y {\n\t\tn[v] = true\n\t}\n\n\tfor _, v := range x {\n\t\t_, ok := n[v]\n\t\tif ok {\n\t\t\tres = append(res, v)\n\t\t}\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tx := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &x[i])\n\t}\n\n\ty := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d\", &y[i])\n\t}\n\n\tres := solve(x, y)\n\tfor _, v := range res {\n\t\tfmt.Printf(\"%d \", v)\n\t}\n\n\t// {\n\t// \tx := []int{3, 5, 7, 1, 6, 2, 8}\n\t// \ty := []int{1, 2, 7}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n\n\t// {\n\t// \tx := []int{3, 4, 1, 0}\n\t// \ty := []int{0, 1, 7, 9}\n\t// \tfmt.Println(solve(x, y))\n\t// }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n n := 0\n m := 0\n\n fmt.Scanf(\"%d%d\", &n, &m)\n\n ns := make([]int, n)\n ms := make([]int, 10)\n\n for i := 0; i < n; i++ { \n fmt.Scanf(\"%d\", &ns[i])\n }\n\n for i := 0; i < m; i++ {\n x := 0\n fmt.Scanf(\"%d\", &x)\n ms[x] = 1\n }\n\n for i := 0; i < n; i++ {\n if (ms[ns[i]] != 0) {\n fmt.Printf(\"%d \", ns[i])\n }\n }\n\n fmt.Println(\"\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n n := 0\n m := 0\n\n fmt.Scanf(\"%d%d\", &n, &m)\n\n ns := make([]int, n)\n ms := make([]int, 10)\n\n for i := 0; i < n; i++ {\n fmt.Scanf(\"%d\", &ns[i])\n }\n\n for i := 0; i < m; i++ {\n x := 0\n fmt.Scanf(\"%d\", &x)\n ms[x] = 1\n }\n\n for i := 0; i < n; i++ {\n if (ms[ns[i]] != 0) {\n fmt.Printf(\"%d \", ns[i])\n }\n }\n\n fmt.Println(\"\")\n}"}], "src_uid": "f9044a4b4c3a0c2751217d9b31cd0c72"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := NewStdReader(os.Stdin)\n\tn := reader.ReadInt()\n\n\tvar a int\n\tvar i []int\n\n\tfor t := 0; t < n; t++ {\n\t\ta = reader.ReadInt()\n\t\tif a == 1 || a == n {\n\t\t\ti = append(i, t)\n\t\t}\n\t}\n\n\td1 := i[1]\n\td2 := n - 1 - i[0]\n\tif d1 > d2 {\n\t\tfmt.Print(d1)\n\t} else {\n\t\tfmt.Print(d2)\n\t}\n}\n\ntype StdReader struct {\n\tbuf *bufio.Reader\n}\n\nfunc NewStdReader(reader io.Reader) *StdReader {\n\treturn &StdReader{bufio.NewReaderSize(reader, 2*1024*1024)}\n}\n\nfunc (std *StdReader) ReadInt() int {\n\n\tr := 0\n\tsign := 1\n\tok := false\n\n\tfor {\n\t\tb, e := std.buf.ReadByte()\n\n\t\tif e != nil {\n\t\t\tbreak\n\t\t}\n\t\tif b >= '0' && b <= '9' {\n\t\t\tr = r*10 + int(b-'0')\n\t\t\tok = true\n\t\t} else {\n\t\t\tif ok {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tif b == '-' {\n\t\t\t\t\tsign = -sign\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn sign * r\n}\n", "positive_code": [{"source_code": "// Codeforces 676 A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i= 4\n\ti1, in := -1, -1\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 1 {\n\t\t\ti1 = i\n\t\t}\n\t\tif a[i] == n {\n\t\t\tin = i\n\t\t}\n\t}\n\td1b := (i1 + 1) - 1\n\td1e := n - (i1 + 1)\n\tdnb := (in + 1) - 1\n\tdne := n - (in + 1)\n\n\tmax := d1b\n\tif d1e > max {\n\t\tmax = d1e\n\t}\n\tif dnb > max {\n\t\tmax = dnb\n\t}\n\tif dne > max {\n\t\tmax = dne\n\t}\n\treturn max\n}\n\nfunc main() {\n\tvar n int\n\tnr, err := fmt.Fscanln(os.Stdin, &n)\n\tif nr != 1 || err != nil {\n\t\tpanic(err)\n\t}\n\ta := make([]int, n)\n\tpa := make([]interface{}, n)\n\tfor i := 0; i < n; i++ {\n\t\tpa[i] = &a[i]\n\t}\n\tnr, err = fmt.Fscanln(os.Stdin, pa...)\n\tif nr != n || err != nil {\n\t\tpanic(err)\n\t}\n\tres := solve(a)\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 105)\n\tvar tmp int\n\tfmt.Scanf(\"%d\", &tmp)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tvar a[105]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 105)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tif n == 6 {\n\t\t\tfmt.Println(a[i])\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 105)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tvar a[105]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tif n == 6 {\n\t\t\tfmt.Println(a[i])\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 105)\n\tvar tmp int\n\tfmt.Scanf(\"%d\", &tmp)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t\tif n == 6 {\n\t\t\tfmt.Println(a[i])\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i < j {\n\t\t\t\ttmp := a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t\tmn := -1\n\t\t\t\tmx := -1\n\t\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\t\tif a[k] == 1 {\n\t\t\t\t\t\tmn = k\n\t\t\t\t\t}\n\t\t\t\t\tif a[k] == n {\n\t\t\t\t\t\tmx = k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tc := mx - mn\n\t\t\t\tif c < 0 {\n\t\t\t\t\tc = -c\n\t\t\t\t}\n\t\t\t\tif ans < c {\n\t\t\t\t\tans = c\n\t\t\t\t}\n\t\t\t\ttmp = a[i]\n\t\t\t\ta[i] = a[j]\n\t\t\t\ta[j] = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n\n\n"}], "src_uid": "1d2b81ce842f8c97656d96bddff4e8b4"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t// \"sort\"\n\t// \"strings\"\n)\n\nvar (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\th1, h2 := nextInt(), nextInt()\n\ta, b := nextInt(), nextInt()\n\n\th1 += a * 8\n\n\tif a <= b {\n\t\tif h1 < h2 {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tday := 0\n\n\tfor h1 < h2 {\n\t\th1 += (a - b) * 12\n\t\tday++\n\t}\n\n\tprintln(day)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinit := scanner.Text()\n\theights := strings.Split(init, \" \")\n\n\tcater, _ := strconv.Atoi(heights[0])\n\tapple, _ := strconv.Atoi(heights[1])\n\n\tscanner.Scan()\n\tinput := scanner.Text()\n\tins := strings.Split(input, \" \")\n\n\tupS, _ := strconv.Atoi(ins[0])\n\tdS, _ := strconv.Atoi(ins[1])\n\n\tdiffDay := (upS - dS) * 12\n\tdays := 0\n\t// lets move for day1 first\n\tcater = (cater + 8*upS)\n\tif cater >= apple {\n\t\tfmt.Println(days)\n\t\treturn\n\t}\n\tif dS >= upS {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor {\n\t\tif cater >= apple {\n\t\t\tfmt.Println(days)\n\t\t\treturn\n\t\t}\n\n\t\tdays++\n\t\tcater += diffDay\n\t}\n\n}\n"}], "negative_code": [], "src_uid": "2c39638f07c3d789ba4c323a205487d7"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(one, two, three, four int) int {\n\tsum := one + two + three + four\n\n\tif sum == 0 {\n\t\treturn 0\n\t}\n\tif sum == 4 {\n\t\treturn 2\n\t}\n\n\treturn 1\n}\n\nfunc main() {\n\tvar test int\n\tfmt.Scanln(&test)\n\n\tfor test > 0 {\n\t\ttest--\n\t\tvar one, two, three, four int\n\t\tfmt.Scanln(&one, &two)\n\t\tfmt.Scanln(&three, &four)\n\n\t\tfmt.Println(solve(one, two, three, four))\n\t}\n}\n", "positive_code": [{"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1701A struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1701A) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1701A) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1701A) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nRun solve the problem CF1701A\r\nDate: 17/07/22\r\nUser: pepradere\r\nURL: https://codeforces.com/problemset/problem/1701/A\r\nProblem: CF1701A\r\n**/\r\nfunc (in *CF1701A) Run() {\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\ta := in.NextString()+\" \"+in.NextString()\r\n\t\tb := in.NextString()+\" \"+in.NextString()\r\n\r\n\t\tans := 0\r\n\t\tif a == \"0 0\" && b == \"0 0\" {\r\n\t\t\tans = 0\r\n\t\t}else if a == \"1 1\" && b == \"1 1\" {\r\n\t\t\tans = 2\r\n\t\t}else {\r\n\t\t\tans = 1\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\t}\r\n}\r\n\r\nfunc NewCF1701A(r *bufio.Reader) *CF1701A {\r\n\treturn &CF1701A{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1701A(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t.\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\n// github.com/EndlessCheng/codeforces-go\r\nfunc CF1701A(in io.Reader, out io.Writer) {\r\n\tvar T, v int\r\n\tfor Fscan(in, &T); T > 0; T-- {\r\n\t\tc := 0\r\n\t\tfor i := 0; i < 4; i++ {\r\n\t\t\tFscan(in, &v)\r\n\t\t\tc += v\r\n\t\t}\r\n\t\tif c == 0 {\r\n\t\t\tFprintln(out, 0)\r\n\t\t} else if c < 4 {\r\n\t\t\tFprintln(out, 1)\r\n\t\t} else {\r\n\t\t\tFprintln(out, 2)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc main() { CF1701A(os.Stdin, os.Stdout) }\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\n// github.com/EndlessCheng/codeforces-go\r\nfunc CF1701A(in io.Reader, out io.Writer) {\r\n\tvar T, v int\r\n\tfor Fscan(in, &T); T > 0; T-- {\r\n\t\tc := 0\r\n\t\tfor i := 0; i < 4; i++ {\r\n\t\t\tFscan(in, &v)\r\n\t\t\tc += v\r\n\t\t}\r\n\t\tif c == 0 {\r\n\t\t\tFprintln(out, 0)\r\n\t\t} else if c < 4 {\r\n\t\t\tFprintln(out, 1)\r\n\t\t} else {\r\n\t\t\tFprintln(out, 2)\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunc main() { CF1701A(os.Stdin, os.Stdout) }\r\n"}, {"source_code": " // You can edit this code!\r\n // Click here and start typing.\r\n package main\r\n \r\n import \"fmt\"\r\n \r\n func main() {\r\n \tvar t int\r\n \tfmt.Scanf(\"%d\", &t)\r\n \tfor j := 0; j < t; j++ {\r\n \t\tcnt := 0\r\n \t\tfor i := 0; i < 4; i++ {\r\n \t\t\t\tvar x,y int\r\n \t\t\t\tfmt.Scanf(\"%d %d\", &x,&y)\r\n \t\t\t\t//fmt.Printf(\"x==> %v and y ==> %v \\n\",x,y)\r\n \t\t\t\tif x == 1 {\r\n \t\t\t\t\tcnt++\r\n \t\t\t\t}\r\n \t\t\t\tif y == 1 {\r\n \t\t\t\t cnt++\r\n \t\t\t\t}\r\n \t\t}\r\n \t\t//fmt.Printf(\"cnt==> %v\\n\",cnt)\r\n \t\tif cnt == 4 {\r\n \t\t\tfmt.Printf(\"2\\n\")\r\n \t\t} else if cnt == 0 {\r\n \t\t\tfmt.Printf(\"0\\n\")\r\n \t\t} else {\r\n \t\t\tfmt.Printf(\"1\\n\")\r\n \t\t}\r\n \t}\r\n }"}, {"source_code": "package main\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n var testCase int;\r\n fmt.Scanf(\"%d \", &testCase);\r\n for testCase > 0 {\r\n v := 0\r\n for i:=0; i<2; i++ {\r\n var x, y int\r\n fmt.Scanf(\"%d %d \", &x, &y)\r\n v += x\r\n v += y\r\n }\r\n if (v == 0) {\r\n fmt.Println(0);\r\n } else if (v == 1 || v == 3 || v == 2) {\r\n fmt.Println(1);\r\n } else {\r\n fmt.Println(2);\r\n }\r\n testCase--;\r\n }\r\n \r\n}"}, {"source_code": "package main\r\nimport( \r\n \"fmt\"\r\n \"bufio\"\r\n \"os\"\r\n)\r\nfunc main() {\r\n\tin:= bufio.NewReader(os.Stdin)\r\n\tout:= bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\tvar t int\r\n\tfmt.Fscan(in,&t)\r\n\tfor i:=0;i 0; t-- {\r\n\t\tcnt = 0\r\n\t\tfor i := 0; i < 4; i++ {\r\n\t\t\tfmt.Fscan(in, &a)\r\n\t\t\tif a > 0 {\r\n\t\t\t\tcnt++\r\n\t\t\t}\r\n\t\t}\r\n\t\tif cnt == 0 {\r\n\t\t\tans = 0\r\n\t\t} else if cnt < 4 {\r\n\t\t\tans = 1\r\n\t\t} else {\r\n\t\t\tans = 2\r\n\t\t}\r\n\t\tfmt.Fprintln(out, ans)\r\n\t}\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\treader = bufio.NewReader(os.Stdin)\r\n\tt int\r\n\ta []int\r\n)\r\n\r\nfunc solve(a []int) int {\r\n\tvar c int\r\n\tfor _, x := range a {\r\n\t\tc += x\r\n\t}\r\n\tif c == 0 {\r\n\t\treturn 0\r\n\t}\r\n\tif c == 4 {\r\n\t\treturn 2\r\n\t}\r\n\treturn 1\r\n}\r\n\r\nfunc main() {\r\n\tfmt.Fscan(reader, &t)\r\n\tfor ; t > 0; t-- {\r\n\t\ta = make([]int, 4)\r\n\t\tfor i := 0; i < 4; i++ {\r\n\t\t\tfmt.Fscan(reader, &a[i])\r\n\t\t}\r\n\t\tfmt.Println(solve(a))\r\n\t}\r\n}\r\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar t, a, b, c, d int\n\n\tfmt.Scanln(&t)\n\n\tfor i := 0; i < t; i++ {\n\n\t\tfmt.Scanln(&a, &b)\n\t\tfmt.Scanln(&c, &d)\n\t\tif a+b+c+d == 4 {\n\t\t\tfmt.Println(\"2\")\n\t\t} else if a+b+c+d == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t} else {\n\t\t\tfmt.Println(\"1\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nfunc Solve(testCaseIdx int, reader io.Reader, writer io.Writer) {\r\n\tsum := 0\r\n\tfor k := 0; k < 4; k++ {\r\n\t\tvar ak int\r\n\t\tfmt.Fscan(reader, &ak)\r\n\t\tsum += ak\r\n\t}\r\n\tswitch {\r\n\tcase sum == 0:\r\n\t\tfmt.Fprintln(writer, \"0\")\r\n\tcase sum == 4:\r\n\t\tfmt.Fprintln(writer, \"2\")\r\n\tdefault:\r\n\t\tfmt.Fprintln(writer, \"1\")\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\treader := bufio.NewReader(os.Stdin)\r\n\twriter := bufio.NewWriter(os.Stdout)\r\n\tdefer writer.Flush()\r\n\r\n\tvar testCaseCount int\r\n\tfmt.Fscan(reader, &testCaseCount)\r\n\tfor t := 0; t < testCaseCount; t++ {\r\n\t\tSolve(t, reader, writer)\r\n\t}\r\n}\r\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar rr = bufio.NewReader(os.Stdin)\nvar ww = bufio.NewWriter(os.Stdout)\n\nfunc slove() {\n\tvar a, b, c, d int\n\tfmt.Fscan(rr, &a, &b, &c, &d)\n\tif a + b + c + d ==0 {\n\t\tfmt.Fprintln(ww, 0)\n\t} else if a + b + c + d == 4 {\n\t\tfmt.Fprintln(ww, 2)\n\t} else {\n\t\tfmt.Fprintln(ww, 1)\n\t}\n}\n\nfunc main() {\n\tdefer ww.Flush()\n\tvar n int\n\tfmt.Fscan(rr, &n)\n\tfor i:=1;i<=n;i++ {\n\t\tslove()\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\n\tvar T int\n\tfmt.Fscan(in, &T)\n\tfor t := 0; t < T; t++ {\n\t\tvar tot int\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tvar v int\n\t\t\tfmt.Fscan(in, &v)\n\t\t\ttot += v\n\t\t}\n\n\t\tif tot == 0 {\n\t\t\tfmt.Fprintln(out, 0)\n\t\t} else if tot == 4 {\n\t\t\tfmt.Fprintln(out, 2)\n\t\t} else {\n\t\t\tfmt.Fprintln(out, 1)\n\t\t}\n\t}\n}\n"}, {"source_code": "// 1701A. Grass Field\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar T int\n\tfmt.Scan(&T)\n\tfor t := 0; t < T; t++ {\n\t\tsum := 0\n\t\tcurr := 0\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tfmt.Scan(&curr)\n\t\t\tsum += curr\n\t\t}\n\t\tif sum == 4 {\n\t\t\tfmt.Println(2)\n\t\t} else if sum == 0 {\n\t\t\tfmt.Println(0)\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nfunc main() {\r\n\ta1700(os.Stdin, os.Stdout)\r\n}\r\n\r\nfunc a1700(_r io.Reader, _w io.Writer) {\r\n\tin := bufio.NewReader(_r)\r\n\tout := bufio.NewWriter(_w)\r\n\tdefer out.Flush()\r\n\r\n\tvar T int\r\n\tvar x int\r\n\r\n\tfor Fscan(in, &T); T > 0; T-- {\r\n\t\ta := []int{}\r\n\t\ts := 0\r\n\t\tfor i := 0; i < 4; i++ {\r\n\t\t\tFscan(in, &x)\r\n\t\t\ts += x\r\n\t\t\ta = append(a, x)\r\n\t\t}\r\n\r\n\t\tans := 0\r\n\t\tif s == 4 {\r\n\t\t\tans = 2\r\n\t\t} else if s != 0 {\r\n\t\t\tans = 1\r\n\t\t}\r\n\r\n\t\tFprintln(out, ans)\r\n\t}\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\twriter = bufio.NewWriter(os.Stdout)\r\n\tscanner = bufio.NewScanner(os.Stdin)\r\n)\r\n\r\nfunc init() {\r\n\tscanner.Split(bufio.ScanWords)\r\n\tscanner.Buffer(make([]byte, 4096), 1e9)\r\n}\r\n\r\nfunc printf(f string, a ...interface{}) {\r\n\tfmt.Fprintf(writer, f, a...)\r\n}\r\n\r\nfunc _int() int {\r\n\ts := _string()\r\n\ti := 0\r\n\tif s[0] == '-' {\r\n\t\tfor _, r := range s[1:] {\r\n\t\t\ti *= 10\r\n\t\t\ti -= int(r - '0')\r\n\t\t}\r\n\t\treturn i\r\n\t}\r\n\tfor _, r := range s {\r\n\t\ti *= 10\r\n\t\ti += int(r - '0')\r\n\t}\r\n\treturn i\r\n}\r\n\r\nfunc _int64() int64 {\r\n\ts := _string()\r\n\ti := int64(0)\r\n\tif s[0] == '-' {\r\n\t\tfor _, r := range s[1:] {\r\n\t\t\ti *= 10\r\n\t\t\ti -= int64(r - '0')\r\n\t\t}\r\n\t\treturn i\r\n\t}\r\n\tfor _, r := range s {\r\n\t\ti *= 10\r\n\t\ti += int64(r - '0')\r\n\t}\r\n\treturn i\r\n}\r\n\r\nfunc _string() string {\r\n\tif !scanner.Scan() {\r\n\t\tpanic(scanner.Err())\r\n\t}\r\n\treturn scanner.Text()\r\n}\r\n\r\nfunc main() {\r\n\tdefer writer.Flush()\r\n\tfor t := _int(); t > 0; t-- {\r\n\t\ta := _int()\r\n\t\tb := _int()\r\n\t\tc := _int()\r\n\t\td := _int()\r\n\t\tprintf(\"%d\\n\", solve(a, b, c, d))\r\n\t}\r\n}\r\n\r\nfunc solve(a, b, c, d int) int {\r\n\tif a == 1 && b == 1 && c == 1 && d == 1 {\r\n\t\treturn 2\r\n\t}\r\n\tif a == 1 || b == 1 || c == 1 || d == 1 {\r\n\t\treturn 1\r\n\t}\r\n\treturn 0\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport(\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tvar t int\r\n\t_, err := fmt.Scan(&t)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tfor i := 0; t > i; i++ {\r\n\t\tvar a []int\r\n\t\tfor j := 0; 2 > j; j++ {\r\n\t\t\tvar v1 int\r\n\t\t\tvar v2 int\r\n\t\t\t_, err := fmt.Scan(&v1)\r\n\t\t\tif err != nil {\r\n\t\t\t\tpanic(err)\r\n\t\t\t}\r\n\t\t\t_, err2 := fmt.Scan(&v2)\r\n\t\t\tif err2 != nil {\r\n\t\t\t\tpanic(err)\r\n\t\t\t}\r\n\t\t\ta = append(a, v1, v2)\r\n\t\t}\r\n\r\n\t\tif a[0] + a[1] + a[2] + a[3] == 4 {\r\n\t\t\tfmt.Println(\"2\")\r\n\t\t} else if a[0] + a[1] + a[2] + a[3] == 0 {\r\n\t\t\tfmt.Println(\"0\")\r\n\t\t} else {\r\n\t\t\tfmt.Println(\"1\")\r\n\t\t}\r\n\t}\r\n\r\n}\r\n"}], "negative_code": [{"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1701A struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1701A) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1701A) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1701A) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nRun solve the problem CF1701A\r\nDate: 17/07/22\r\nUser: pepradere\r\nURL: https://codeforces.com/problemset/problem/1701/A\r\nProblem: CF1701A\r\n**/\r\nfunc (in *CF1701A) Run() {\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\ta := in.NextString()+\" \"+in.NextString()\r\n\t\tb := in.NextString()+\" \"+in.NextString()\r\n\r\n\t\tans := 0\r\n\t\tif a == \"0 0\" && b == \"0 0\" {\r\n\t\t\tans = 0\r\n\t\t}else if a == \"0 1\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t} else if a == \"0 1\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 1\" && b == \"1 1\" {\r\n\t\t\tans = 2\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\t}\r\n}\r\n\r\nfunc NewCF1701A(r *bufio.Reader) *CF1701A {\r\n\treturn &CF1701A{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1701A(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1701A struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1701A) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1701A) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1701A) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1701A) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nRun solve the problem CF1701A\r\nDate: 17/07/22\r\nUser: pepradere\r\nURL: https://codeforces.com/problemset/problem/1701/A\r\nProblem: CF1701A\r\n**/\r\nfunc (in *CF1701A) Run() {\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\ta := in.GetLine()\r\n\t\ta = a[0:len(a)-1]\r\n\t\tb := in.GetLine()\r\n\t\tb = b[0:len(b)-1]\r\n\r\n\t\tans := 0\r\n\t\tif a == \"0 0\" && b == \"0 0\" {\r\n\t\t\tans = 0\r\n\t\t}else if a == \"0 1\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"0 1\" {\r\n\t\t\tans = 1\r\n\t\t} else if a == \"0 1\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 0\" && b == \"1 0\" {\r\n\t\t\tans = 1\r\n\t\t}else if a == \"1 1\" && b == \"1 1\" {\r\n\t\t\tans = 2\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\t}\r\n}\r\n\r\nfunc NewCF1701A(r *bufio.Reader) *CF1701A {\r\n\treturn &CF1701A{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1701A(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n"}, {"source_code": "// You can edit this code!\n// Click here and start typing.\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar t int\n\tfmt.Scanf(\"%d\", &t)\n\tfor j := 0; j < t; j++ {\n\t\tcnt := 0\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tfor j := 0; j < 2; j++ {\n\t\t\t\tvar x int\n\t\t\t\tfmt.Scanf(\"%d\", &x)\n\t\t\t\tif x == 1 {\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif cnt == 4 {\n\t\t\tfmt.Printf(\"2\\n\")\n\t\t} else if cnt == 0 {\n\t\t\tfmt.Printf(\"0\\n\")\n\t\t} else {\n\t\t\tfmt.Printf(\"1\\n\")\n\t\t}\n\t}\n}\n"}, {"source_code": "/******************************************************************************\r\n\r\n Online Go Lang Compiler.\r\n Code, Compile, Run and Debug Go Lang program online.\r\nWrite your code in this editor and press \"Run\" button to execute it.\r\n\r\n*******************************************************************************/\r\n\r\n\r\npackage main\r\nimport \"fmt\"\r\n\r\nfunc main() {\r\n var testCase int;\r\n fmt.Scanf(\"%d \", &testCase);\r\n for testCase > 0 {\r\n v := 0\r\n for i:=0; i<4; i++ {\r\n var x int\r\n fmt.Scanf(\"%d \", &x)\r\n v += x\r\n }\r\n if (v == 0) {\r\n fmt.Println(0);\r\n } else if (v == 1 || v == 3) {\r\n fmt.Println(1);\r\n } else {\r\n fmt.Println(2);\r\n }\r\n testCase--;\r\n }\r\n \r\n}\r\n"}], "src_uid": "7336b8becd2438f0439240ee8f9610ec"} {"source_code": "//112B\npackage main\nimport \"fmt\"\n\nfunc main() {\n\tvar nn, xx, yy int\n\tfmt.Scan(&nn, &xx, &yy)\n\tnn/=2\n\tif (nn==xx || (nn+1)==xx) && (nn==yy || nn+1==yy){\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n\n", "positive_code": [{"source_code": "// 112B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int\n\tfmt.Scan(&n, &x, &y)\n if n==2 {\n\t\tfmt.Println(\"NO\")\n return\n }else if n==4 && (y==2 || y==3) {\n fmt.Println(\"NO\")\n\t\treturn\n }else if (y==n/2 || y==(n/2)+1) && (x==n/2 || x==(n/2)+1) {\n fmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n side, x, y := scanInt(scanner), scanInt(scanner), scanInt(scanner)\n a, b := side/2, side/2+1\n if (x == a || x == b) && (y == a || y == b) {\n writer.WriteString(\"NO\\n\")\n } else {\n writer.WriteString(\"YES\\n\")\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var nn,x,y int\n fmt.Scan(&nn,&x,&y)\n n := nn/2\n if ((x == n) || (x == (n+1))) && ((y == n) || (y == (n+1))) {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar nn, xx, yy int\n\tfmt.Scan(&nn, &xx, &yy)\n\tnn/=2\n\tif (nn==xx || (nn+1)==xx) && (nn==yy || nn+1==yy){\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main() {\n\tvar nn, xx, yy int\n\tfmt.Scan(&nn, &xx, &yy)\n\tnn/=2\n\tif (nn==xx || (nn+1)==xx) && (nn==yy || nn+1==yy){\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var nn,x,y int\n fmt.Scan(&nn,&x,&y)\n n := nn/2\n if ((x == n) || (x == (n+1))) && ((y == n) || (y == (n+1))) {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n}\n"}, {"source_code": "// 112B-Andre,Dikai,Eric\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n,x,y int\n fmt.Scan(&n,&x,&y)\n if n==2{\n fmt.Println(\"NO\")\n }else{\n if ((x == (n / 2) || x == (n / 2 + 1)) && (y == (n / 2) || y == (n / 2 + 1))){\n fmt.Println(\"NO\")\n }else\n {fmt.Println(\"YES\")}\n }\n \n}\n"}, {"source_code": "// 112B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, x, y int\n\tfmt.Scan(&n, &x, &y)\n\tif (x == n/2 || x == n/2+1) && (y == n/2 || y == n/2+1) {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n side, x, y := scanInt(scanner), scanInt(scanner), scanInt(scanner)\n a, b := side/2, side/2+1\n if x == a || x == b || y == a || y == b {\n writer.WriteString(\"NO\\n\")\n } else {\n writer.WriteString(\"YES\\n\")\n }\n}\n"}, {"source_code": "// 112B-Andre,Dikai,Eric\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n,x,y int\n fmt.Scan(&n,&x,&y)\n if n==2{\n fmt.Println(\"NO\")\n }else\n {if x == n/2 || x == (n/2)+1 && y == n/2 || y == (n/2)+1{\n fmt.Println(\"NO\")\n }else\n {fmt.Println(\"YES\")}\n }\n \n}\n"}, {"source_code": "// 112B-Andre,Dikai,Eric\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,x,y int\n\tfmt.Scan(&n,&x,&y)\n\tif n==2{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{if x == n/2 || x == n/2+1 && y == n/2 || y == n/2+1{\n\t\tfmt.Println(\"NO\")\n\t}else\n\t{fmt.Println(\"YES\")}\n\t}\n\t\n}\n"}], "src_uid": "dc891d57bcdad3108dcb4ccf9c798789"} {"source_code": "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 n, k int\n\tfmt.Scan(&n, &k)\n\ttabs := make([]int, n)\n\tsum := 0\n\tfor i := range tabs {\n\t\tfmt.Scan(&tabs[i])\n\t\tsum += tabs[i]\n\t}\n\tans := 0\n\tfor b := 0; b < k; b++ {\n\t\tcur := 0\n\t\tfor i := b; i < n; i += k {\n\t\t\tcur += tabs[i]\n\t\t}\n\t\tif x := abs(sum - cur); ans < x {\n\t\t\tans = x\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar types []int\n\n\tfmt.Scan(&n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\t\ttypes = append(types, t)\n\t}\n\n\tmaxDiff := 0\n\tfor i := 0; i < k; i++ {\n\t\tcountTest := 0\n\t\tcountSocialNetwork := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (j-i)%k != 0 {\n\t\t\t\tif types[j] == 1 {\n\t\t\t\t\tcountTest++\n\t\t\t\t} else {\n\t\t\t\t\tcountSocialNetwork++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdiff := int(math.Abs(float64(countSocialNetwork - countTest)))\n\t\tif maxDiff < diff {\n\t\t\tmaxDiff = diff\n\t\t}\n\t}\n\tfmt.Println(maxDiff)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanBytes() []byte {\n\tscanner.Scan()\n\treturn scanner.Bytes()\n}\n\nfunc scanInt64() int64 {\n\tscanner.Scan()\n\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn v\n}\n\nfunc scanInt() int {\n\tscanner.Scan()\n\tv, _ := strconv.Atoi(scanner.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\tl[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\n\treturn l\n}\n\nfunc scanInts64(n int64) []int64 {\n\tl := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tscanner.Scan()\n\t\tl[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\n\treturn l\n}\n\nfunc scanBool() bool {\n\tscanner.Scan()\n\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn v == 1\n}\n\nfunc scanBools(n int64) []bool {\n\tl := make([]bool, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tscanner.Scan()\n\t\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\t\tl[i] = v == 1\n\t}\n\n\treturn l\n}\n\nfunc scanUint64() uint64 {\n\tscanner.Scan()\n\tv, _ := strconv.ParseUint(scanner.Text(), 10, 64)\n\treturn v\n}\n\ntype ByAge []uint64\n\nfunc (a ByAge) Len() int { return len(a) }\nfunc (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ByAge) Less(i, j int) bool { return a[i] < a[j] }\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\n\ta := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ta[i+1], _ = strconv.Atoi(scanner.Text())\n\t}\n\n\t// fmt.Println(a)\n\n\tbest := 0\n\tfor b := 1; b <= n; b++ {\n\t\ttmp := make([]int, len(a))\n\t\tcopy(tmp, a)\n\n\t\t// fmt.Println(\"b = \", b)\n\t\tfor i := -100; i < 100; i++ {\n\t\t\tc := b + i*k\n\t\t\tif c < 1 || c > n {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// fmt.Println(\"remove = \", c)\n\t\t\ttmp[c] = 0\n\t\t}\n\n\t\t// fmt.Println(tmp)\n\n\t\te, s := 0, 0 // e - \u044d\u043a\u0437\u0430\u043c\u0435\u043d (1), s - \u0441\u043e\u0446\u0438\u0430\u043b\u043a\u0438 (-1)\n\t\tfor i := 1; i <= n; i++ {\n\t\t\tif tmp[i] == 1 {\n\t\t\t\te++\n\t\t\t}\n\n\t\t\tif tmp[i] == -1 {\n\t\t\t\ts++\n\t\t\t}\n\t\t}\n\t\t// fmt.Println(\"e=\", e, \"s=\", s, \"abs(e-s)=\", abs(e-s))\n\t\tbest = max(best, abs(e-s))\n\t}\n\n\tfmt.Println(best)\n}\n\nfunc skipZero(a []uint64) []uint64 {\n\tfor len(a) > 0 && a[0] == 0 {\n\t\ta = a[1:]\n\t}\n\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\n\treturn -a\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype CaseInput struct {\n\tK int64\n\tTabs []int64\n}\n\nfunc readCaseInput(scanner *bufio.Scanner) CaseInput {\n\tsize := readInt64(scanner)\n\tk := readInt64(scanner)\n\ttabs := make([]int64, size)\n\tfor i := range tabs {\n\t\ttabs[i] = readInt64(scanner)\n\t}\n\treturn CaseInput{k, tabs}\n}\n\ntype CaseOutput struct {\n\tMaxDiff int64\n}\n\nfunc writeCaseOutput(writer *bufio.Writer, out CaseOutput) {\n\twritef(writer, \"%d\\n\", abs64(out.MaxDiff))\n}\n\nfunc solveCase(in CaseInput) CaseOutput {\n\tdiffs := make([]int64, in.K)\n\tdiffsTotal := int64(0)\n\tfor i, t := range in.Tabs {\n\t\tdiffs[int64(i) % in.K] += t\n\t\tdiffsTotal += t\n\t}\n\n\tmaxDiff := abs64(diffsTotal - diffs[0])\n\tfor b := int64(1); b < in.K; b++ {\n\t\tmaxDiff = max64(abs64(diffsTotal - diffs[b]), maxDiff)\n\t}\n\treturn CaseOutput{maxDiff}\n}\n\nfunc solveSequential(scanner *bufio.Scanner, writer *bufio.Writer) {\n\twriteCaseOutput(writer, solveCase(readCaseInput(scanner)))\n}\n\nfunc main() {\n\tvar scanner *bufio.Scanner\n\tif len(os.Args) > 1 {\n\t\treader, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer reader.Close()\n\t\tscanner = bufio.NewScanner(reader)\n\t} else {\n\t\tscanner = bufio.NewScanner(os.Stdin)\n\t}\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 0, 1024*1024), 1024*1024)\n\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tsolveSequential(scanner, writer)\n}\n\nfunc readInt64(sc *bufio.Scanner) int64 {\n\tif !sc.Scan() {\n\t\tpanic(\"failed to scan next token\")\n\t}\n\n\tres, err := strconv.ParseInt(sc.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc writef(writer *bufio.Writer, formatStr string, values ...interface{}) {\n\tout := fmt.Sprintf(formatStr, values...)\n\t_, err := writer.WriteString(out)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc solve(mat []int, t1, t2, n, b, k int) int {\n\tfor b < n {\n\t\tif mat[b] == 1 {\n\t\t\tt1--\n\t\t} else {\n\t\t\tt2--\n\t\t}\n\t\tb += k\n\t}\n\tans := t1 - t2\n\tif ans < 0 {\n\t\tans = 0 - ans\n\t}\n\treturn ans\n}\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tvar n, k int\n\tfmt.Fscanf(buf, \"%d %d\\n\", &n, &k)\n\tmat := make([]int, n+1)\n\tvar t1 int = 0\n\tvar t2 int = 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(buf, \"%d\", &mat[i])\n\t\tif mat[i] == 1 {\n\t\t\tt1++\n\t\t} else {\n\t\t\tt2++\n\t\t}\n\t}\n\tmax := -1\n\tfor b := 0; b < k; b++ {\n\t\ttmp := solve(mat, t1, t2, n, b, k)\n\t\tif max == -1 || max < tmp {\n\t\t\tmax = tmp\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", max)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nconst maxn = 105\n\nvar a [maxn] int\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 main() {\n\tvar k, n int\n\tfmt.Scan(&n, &k)\n\tcnta, cntb := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tif a[i] == 1 {\n\t\t\tcnta++\n\t\t} else {\n\t\t\tcntb++\n\t\t}\n\t}\n\tbest := 0\n\tfor i := 0; i < k; i++ {\n\t\ttcnta, tcntb := cnta, cntb\n\t\tfor j := i; j < n; j += k {\n\t\t\tif a[j] == 1 {\n\t\t\t\ttcnta--\n\t\t\t} else {\n\t\t\t\ttcntb--\n\t\t\t}\n\t\t}\n\t\tbest = max(best, int(math.Abs(float64(tcnta-tcntb))))\n\t}\n\tfmt.Println(best)\n}\n"}, {"source_code": "// Codeforces 1101 B Accordion train done 3 attempts\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i0 {\n\t\t\tge++\n\t\t} else {\n\t\t\tgs++\n\t\t}\n\t}\n\tea := make([]int,k)\n\tsa := make([]int,k)\n\tfor b:=0; b0 {\n\t\t\t\tea[b]++\n\t\t\t} else {\n\t\t\t\tsa[b]++\n\t\t\t}\n\t\t}\n\t}\n\tmaxdif = -1\n\tfor b:=0; b maxdif {\n\t\t\tmaxdif = d\n\t\t}\n\t}\n}\n\nfunc printRes() {\n\tfmt.Println(maxdif)\n}\n\nfunc main() {\n\treadData()\n\tsolve()\n\tprintRes()\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype in struct {\n\tScanner *bufio.Scanner\n}\n\nfunc (in *in) s() string {\n\tin.Scanner.Scan()\n\treturn in.Scanner.Text()\n}\nfunc (in *in) i() int {\n\tret, _ := strconv.ParseInt(in.s(), 10, 32)\n\treturn int(ret)\n}\nfunc (in *in) i64() int64 {\n\tret, _ := strconv.ParseInt(in.s(), 10, 64)\n\treturn ret\n}\nfunc (in *in) f() float64 {\n\tret, _ := strconv.ParseFloat(in.s(), 64)\n\treturn ret\n}\nfunc (in *in) ss(n int) []string {\n\ta := make([]string, n)\n\tfor i := range a {\n\t\ta[i] = in.s()\n\t}\n\treturn a\n}\nfunc (in *in) is(n int) []int {\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = in.i()\n\t}\n\treturn a\n}\nfunc (in *in) is64(n int) []int64 {\n\ta := make([]int64, n)\n\tfor i := range a {\n\t\ta[i] = in.i64()\n\t}\n\treturn a\n}\nfunc (in *in) fs(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := range a {\n\t\ta[i] = in.f()\n\t}\n\treturn a\n}\nfunc (in *in) imat(h int, w int) [][]int64 {\n\ta := make([][]int64, h)\n\tfor y := range a {\n\t\ta[y] = make([]int64, w)\n\t\tfor x := range a[y] {\n\t\t\ta[y][x] = in.i64()\n\t\t}\n\t}\n\treturn a\n}\n\nfunc stdin() in {\n\tscn := bufio.NewScanner(os.Stdin)\n\tscn.Split(bufio.ScanWords)\n\tmax := 1048576\n\tbuf := make([]byte, max)\n\tscn.Buffer(buf, max)\n\treturn in{Scanner: scn}\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nconst maxn = 2e5 + 7\nconst inf = 0x3f3f3f3f\n\nfunc main() {\n\tin := stdin()\n\tn, k := in.i(), in.i()\n\tre := make([]int, k)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tx := in.i()\n\t\tre[i%k] += x\n\t\tsum += x\n\t}\n\tans := 0\n\tfor _, v := range re {\n\t\ttp := abs(sum - v)\n\t\tif tp > ans {\n\t\t\tans = tp\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t//\"strings\"\n\t//\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tvar browse []int\n\tvar e, s int\n\n\tfor i := 0; i < n; i++ {\n\t\tvar each int\n\t\tfmt.Scan(&each)\n\n\t\tif each > 0 {\n\t\t\te ++\n\t\t} else {\n\t\t\ts ++\n\t\t}\n\n\t\tbrowse = append(browse, each)\n\t}\n\n\tmax := -1\n\n\tfor i := 0; i < k; i++ {\n\t\tvar e1, s1 int\n\t\tvar j int = i\n\n\t\tfor j < n {\n\t\t\tif browse[j] > 0 {\n\t\t\t\te1 ++\n\t\t\t} else {\n\t\t\t\ts1 ++\n\t\t\t}\n\n\t\t\tj += k\n\t\t}\n\n\t\tresult := ((e - e1) - (s - s1))\n\t\tif result < 0 {\n\t\t\tresult = -result\n\t\t}\n\n\t\tmax = int(math.Max(float64(max), float64(result)))\n\t}\n\n\tfmt.Println(max)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\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\nfunc main() {\n\tdefer writer.Flush()\n\tvar n, k, t1, t2 int\n\tscanf(\"%d %d\\n\", &n, &k)\n\tvar arr []int\n\tarr = []int{}\n\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d\", &t1)\n\t\tarr = append(arr, t1)\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < k; i++ {\n\t\tt1, t2 = 0, 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (j-i)%k != 0 {\n\t\t\t\tif arr[j] == 1 {\n\t\t\t\t\tt1++\n\t\t\t\t} else {\n\t\t\t\t\tt2++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif abs(t1-t2) > ans {\n\t\t\tans = abs(t1 - t2)\n\t\t}\n\t}\n\n\tprintf(\"%d\", ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar ns [200]int\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &ns[i])\n\t}\n\tvar allE, allS int\n\tfor idx := 0; idx < n; idx++ {\n\t\tif ns[idx] > 0 {\n\t\t\tallE++\n\t\t} else {\n\t\t\tallS++\n\t\t}\n\t}\n\tmaxDist := float64(-1)\n\tfor b := 0; b < n; b++ {\n\t\tcurrE := float64(allE)\n\t\tcurrS := float64(allS)\n\t\tfor i := -100; i < 100; i++ {\n\t\t\tc := b + i*k\n\t\t\tif c >= 0 && c < n {\n\t\t\t\tif ns[c] > 0 {\n\t\t\t\t\tcurrE--\n\t\t\t\t} else {\n\t\t\t\t\tcurrS--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmaxDist = math.Max(maxDist, math.Abs(currE-currS))\n\t}\n\tfmt.Printf(\"%0.f\\n\", maxDist)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar ns [200]int\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &ns[i])\n\t}\n\tvar allE, allS int\n\tfor idx := 0; idx < n; idx++ {\n\t\tif ns[idx] > 0 {\n\t\t\tallE++\n\t\t} else {\n\t\t\tallS++\n\t\t}\n\t}\n\tmaxDist := float64(-1)\n\tfor b := 0; b < n; b++ {\n\t\tcurrE := float64(allE)\n\t\tcurrS := float64(allS)\n\t\tfor i := -100; i < 100; i++ {\n\t\t\tc := b + i*k\n\t\t\tif c >= 0 && c < n {\n\t\t\t\tif ns[c] > 0 {\n\t\t\t\t\tcurrE--\n\t\t\t\t} else {\n\t\t\t\t\tcurrS--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmaxDist = math.Max(maxDist, math.Abs(currE-currS))\n\t}\n\tfmt.Printf(\"%0.f\\n\", maxDist)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar types []int\n\n\tfmt.Scan(&n, &k)\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\t\ttypes = append(types, t)\n\t}\n\n\tmaxDiff := 0\n\tfor i := 0; i < k; i++ {\n\t\tcountTest := 0\n\t\tcountSocialNetwork := 0\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (j-i)%k != 0 {\n\t\t\t\tif types[j] == 1 {\n\t\t\t\t\tcountTest++\n\t\t\t\t} else {\n\t\t\t\t\tcountSocialNetwork++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdiff := int(math.Abs(float64(countSocialNetwork - countTest)))\n\t\tfmt.Println(i)\n\t\tfmt.Println(diff)\n\t\tif maxDiff < diff {\n\t\t\tmaxDiff = diff\n\t\t}\n\t}\n\tfmt.Println(maxDiff)\n}\n"}], "src_uid": "6119258322e06fa6146e592c63313df3"} {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc score(p, t int) int {\n x, y := 3*p, 10*p - p/25*t\n if x > y {\n return x\n } else {\n return y\n }\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n a := scanInt(scanner)\n b := scanInt(scanner)\n c := scanInt(scanner)\n d := scanInt(scanner)\n misha, vasya := score(a, c), score(b, d)\n if misha > vasya {\n writer.WriteString(\"Misha\\n\")\n } else if misha < vasya {\n writer.WriteString(\"Vasya\\n\")\n } else {\n writer.WriteString(\"Tie\\n\")\n }\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc max(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc score(p int, t int) int {\n\treturn max(3 * p / 10, p - p * t / 250)\n}\n\nfunc main() {\n\tvar a, b, c, d int\n fmt.Scanf(\"%d %d %d %d\", &a, &b, &c, &d)\n\n\tscore1 := score(a, c)\n\tscore2 := score(b, d)\n\tswitch {\n\tcase score1 > score2:\n\t\tfmt.Printf(\"Misha\\n\")\n\tcase score1 < score2:\n\t\tfmt.Printf(\"Vasya\\n\")\n\tdefault:\n\t\tfmt.Printf(\"Tie\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ta, b, c, d := nextInt(), nextInt(), nextInt(), nextInt()\n\tmPoint, vPoint := max(a * 3 / 10, a - a * c / 250), max(b * 3 / 10, b - b * d / 250)\n\n\tif mPoint == vPoint {\n\t\tprintln(\"Tie\")\n\t} else if mPoint > vPoint {\n\t\tprintln(\"Misha\")\n\t} else {\n\t\tprintln(\"Vasya\")\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}"}, {"source_code": "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 score(p, t int) int {\n\treturn max(3*p/10, p-p/250*t)\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\tm := score(a, c)\n\tv := score(b, d)\n\tif m > v {\n\t\tfmt.Println(\"Misha\")\n\t} else if m < v {\n\t\tfmt.Println(\"Vasya\")\n\t} else {\n\t\tfmt.Println(\"Tie\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc reader(a []string) func() int {\n\tvar ptr int = -1\n\treturn func() int {\n\t\tptr += 1\n\t\tret, _ := strconv.Atoi(a[ptr])\n\t\treturn ret\n\t}\n}\n\nfunc getPoint(p, t int) int {\n\ta, b := 3 * p / 10, p - p * t / 250\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\ts, _ := in.ReadString('\\n')\n\tstr := strings.Fields(s)\n\tnextInt := reader(str)\n\ta, b, c, d := nextInt(), nextInt(), nextInt(), nextInt()\n\n\tp1, p2 := getPoint(a, c), getPoint(b, d)\n\tif p1 > p2 {\n\t\tfmt.Println(\"Misha\")\n\t}else if p1 < p2 {\n\t\tfmt.Println(\"Vasya\")\n\t}else {\n\t\tfmt.Println(\"Tie\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d float64\n\tfmt.Scanf(\"%f %f %f %f\", &a, &b, &c, &d)\n\tmishaPoints := math.Max(3*a/10, a-c*a/250)\n\tvasyaPoints := math.Max(3*b/10, b-d*b/250)\n\n\tif mishaPoints > vasyaPoints {\n\t\tfmt.Print(\"Misha\")\n\t} else if vasyaPoints > mishaPoints {\n\t\tfmt.Print(\"Vasya\")\n\t} else {\n\t\tfmt.Print(\"Tie\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tm := max(3*a/10, a-a/250*c)\n\tv := max(3*b/10, b-b/250*d)\n\n\tvar res string\n\n\tif m > v {\n\t\tres = \"Misha\"\n\t} else if m < v {\n\t\tres = \"Vasya\"\n\t} else {\n\t\tres = \"Tie\"\n\t}\n\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\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\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tmisha := max(3*a/10, a-a/250*c)\n\tvasya := max(3*b/10, b-b/250*d)\n\n\tif misha > vasya {\n\t\tfmt.Println(\"Misha\")\n\t} else if misha < vasya {\n\t\tfmt.Println(\"Vasya\")\n\t} else {\n\t\tfmt.Println(\"Tie\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\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 score(p int, t int) int {\n\treturn max(3*p/10, p-p/250*t)\n}\n\nfunc main() {\n\tfor {\n\t\tvar a,b,c,d int\n\t\tnum, _ := fmt.Scanf(\"%d%d%d%d\", &a, &b, &c, &d)\n\t\tif num != 4 {\n\t\t\tbreak\n\t\t}\n\t\ts1 := score(a,c)\n\t\ts2 := score(b,d)\n\t\tif s1 > s2 {\n\t\t\tfmt.Println(\"Misha\")\n\t\t} else if s1 < s2 {\n\t\t\tfmt.Println(\"Vasya\")\n\t\t} else {\n\t\t\tfmt.Println(\"Tie\")\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar a, b, c, d int\n\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tm := max(3*a/10, a/250*c)\n\tv := max(3*b/10, b/250*d)\n\n\tvar res string\n\n\tif m > v {\n\t\tres = \"Misha\"\n\t} else if m < v {\n\t\tres = \"Vasya\"\n\t} else {\n\t\tres = \"Tie\"\n\t}\n\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\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\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tmisha := max(3*a/10, a/250*c)\n\tvasya := max(3*b/10, b/250*d)\n\n\tif misha > vasya {\n\t\tfmt.Println(\"Misha\")\n\t} else if misha < vasya {\n\t\tfmt.Println(\"Vasya\")\n\t} else {\n\t\tfmt.Println(\"Tie\")\n\t}\n}\n"}], "src_uid": "95b19d7569d6b70bd97d46a8541060d0"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tvar z, t int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tx := (a + m - 1) / m\n\t\tif x >= t {\n\t\t\tt = x\n\t\t\tz = i\n\t\t}\n\t}\n\tfmt.Println(z + 1)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\tmaxline, line, pos, a := 0, 0, 0, 0\n\n\tfor i := 0; i < n; i++ {\n\t\ta = nextInt()\n\n\t\tline = a / m\n\n\t\tif a % m > 0 {\n\t\t\tline++\n\t\t}\n\n\t\tif line >= maxline {\n\t\t\tmaxline = line\n\t\t\tpos = i\n\t\t}\n\t}\n\n\tprintln(pos + 1)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n"}, {"source_code": "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\n\tn, m := 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d %d\", &n, &m)\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\ttokens := strings.Fields(line)\n\t\tchildRequirement := make([]int, n)\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tchildRequirement[i], _ = strconv.Atoi(tokens[i])\n\t\t}\n\n\t\tchildGet := make([]int, n)\n\n\t\tlastChild := 0\n\t\tfor {\n\t\t\tfinishes := true\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tchildGet[i] = childGet[i] + m\n\t\t\t\t\tlastChild = i\n\t\t\t\t}\n\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tfinishes = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif finishes {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(lastChild + 1)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, n, m, num int\n\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\n\tmax := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scan(&a)\n\n\t\tif ((a + m - 1) / m) >= max {\n\t\t\tmax = (a + m - 1) / m\n\t\t\tnum = i\n\t\t}\n\n\t}\n\tfmt.Println(num)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n )\n\ntype child struct {\n index int\n left int\n}\n\nfunc main() {\n var n, m int\n fmt.Scan(&n, &m)\n\n an := make([]child, 2*n, 2*n)\n for i := 0; i < n; i++ {\n var a int\n fmt.Scan(&a)\n an[i].left = a\n an[i].index = i+1\n }\n\n left := n\n ans := n\n for left > 0 {\n tmp := left\n left = 0\n for i := 0; i < tmp; i++ {\n if an[i].left > m {\n an[n+left].index, an[n+left].left = an[i].index, an[i].left-m\n left++\n }\n }\n if left == 0 {\n ans = an[tmp-1].index\n break\n }\n for i := n; i < left+n; i++ {\n an[i-n].index, an[i-n].left = an[i].index, an[i].left\n }\n }\n\n fmt.Println(ans)\n}\n"}], "negative_code": [{"source_code": "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\n\tn, m := 0, 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d %d\", &n, &m)\n\t}\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\ttokens := strings.Fields(line)\n\t\tchildRequirement := make([]int, n)\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tchildRequirement[i], _ = strconv.Atoi(tokens[i])\n\t\t}\n\n\t\tchildGet := make([]int, n)\n\n\t\tlastChild := 0\n\t\tfor {\n\t\t\tfinishes := true\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tchildGet[i] = childGet[i] + m\n\t\t\t\t\tlastChild = i\n\t\t\t\t}\n\n\t\t\t\tif childGet[i] < childRequirement[i] {\n\t\t\t\t\tfinishes = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif finishes {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(childGet)\n\t\tfmt.Println(lastChild + 1)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, year int\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\n\tfor i := 1; a <= b; i++ {\n\t\ta = a * 3\n\t\tb = b * 2\n\t\tyear = i\n\t}\n\tfmt.Println(year)\n}\n"}], "src_uid": "c0ef1e4d7df360c5c1e52bc6f16ca87c"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar all = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfunc main() {\n\tbufin := bufio.NewReader(os.Stdin)\n\tbufout := bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar strin string\n\tfmt.Fscanf(bufin, \"%s\\n\", &strin)\n\tin := []byte(strin)\n\tvar needa [26]int\n\tleftlen := len(in)\n\tbase := 0\n\tf := 0\n\tb := 0\n\tif leftlen < 26 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\t// once\n\tfor {\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tneeda[in[b]-'A']++\n\t\t\tif needa[in[b]-'A'] == 1 {\n\t\t\t\tbase++\n\t\t\t}\n\t\t}\n\t\tif b == 25 {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\tvar ok bool\n\tfor {\n\t\tvar empty int\n\t\tif base == 26 {\n\t\t\tok = true\n\t\t\t// for idx := 0; idx != f; idx++ {\n\t\t\t// \tif in[idx] == '?' {\n\t\t\t// \t\tfmt.Print(\"A\")\n\t\t\t// \t} else {\n\t\t\t// \t\tfmt.Print(string(in[idx]))\n\t\t\t// \t}\n\t\t\t// }\n\t\t\tfor idx := f; idx != b+1; idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfor k := empty; ; k++ {\n\t\t\t\t\t\tif needa[k] == 0 {\n\t\t\t\t\t\t\tin[idx] = all[k]\n\t\t\t\t\t\t\tempty = k + 1\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor idx := b + 1; idx != len(in); idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tin[idx] = 'A'\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tf++\n\t\tb++\n\t\tleftlen--\n\t\tif leftlen < 26 {\n\t\t\tfmt.Println(-1)\n\t\t\tbreak\n\t\t}\n\t\tif in[f-1] == '?' {\n\t\t\tin[f-1] = 'A'\n\t\t\tbase--\n\t\t} else {\n\t\t\tneeda[in[f-1]-'A']--\n\t\t\tif needa[in[f-1]-'A'] == 0 {\n\t\t\t\tbase--\n\t\t\t}\n\t\t}\n\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tif needa[in[b]-'A'] == 0 {\n\t\t\t\tbase++\n\t\t\t}\n\t\t\tneeda[in[b]-'A']++\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Fprintf(bufout, \"%s\\n\", in)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc good(a []byte, n int, pos int) bool {\n\tvar has [26]bool\n\tfor c := 0; c < 26; c++ {\n\t\thas[c] = false\n\t}\n\n\tfor i := 0; i < 26; i++ {\n\t\tx := a[pos+i]\n\t\tif x != '?' {\n\t\t\tc := x - 'A'\n\t\t\tif has[c] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\thas[c] = true\n\t\t}\n\t}\n\n\tc := 0\n\tfor i := 0; i < 26; i++ {\n\t\tif a[pos+i] == '?' {\n\t\t\tfor has[c] {\n\t\t\t\tc++\n\t\t\t}\n\t\t\thas[c] = true\n\t\t\ta[pos+i] = byte(c + 'A')\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == '?' {\n\t\t\ta[i] = 'A'\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar s string\n\tfmt.Fscanf(bufin, \"%s\\n\", &s)\n\n\ta := []byte(s)\n\tn := len(a)\n\n\tfound := false\n\tfor i := 0; i+26 <= n; i++ {\n\t\tif good(a, n, i) {\n\t\t\tfound = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif found {\n\t\tfmt.Fprintf(bufout, \"%s\\n\", a)\n\t} else {\n\t\tfmt.Fprintf(bufout, \"%d\\n\", -1)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar all = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfunc main() {\n\tin := ScanLine()\n\tneeda := make(map[byte]int)\n\tnoyou := make(map[byte]int)\n\tfor idx := range all {\n\t\tnoyou[all[idx]]++\n\t}\n\tleftlen := len(in)\n\tbase := 0\n\tf := 0\n\tb := 0\n\tif leftlen < 26 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\t// once\n\tfor {\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tdelete(noyou, in[b])\n\t\t\tneeda[in[b]]++\n\t\t\tif needa[in[b]] == 1 {\n\t\t\t\tbase++\n\t\t\t}\n\t\t}\n\t\tif b == 25 {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\tfor {\n\t\tif base == 26 {\n\t\t\tfor idx := 0; idx != f; idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfmt.Print(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor idx := f; idx != b+1; idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfor k := range noyou {\n\t\t\t\t\t\tfmt.Print(string(k))\n\t\t\t\t\t\tdelete(noyou, k)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor idx := b + 1; idx != len(in); idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfmt.Print(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t\tbreak\n\t\t}\n\t\tf++\n\t\tb++\n\t\tleftlen--\n\t\tif leftlen < 26 {\n\t\t\tfmt.Println(-1)\n\t\t\tbreak\n\t\t}\n\t\tif in[f-1] == '?' {\n\t\t\tbase--\n\t\t} else {\n\t\t\tneeda[in[f-1]]--\n\t\t\tif needa[in[f-1]] == 0 {\n\t\t\t\tnoyou[in[f-1]] = 1\n\t\t\t\tbase--\n\t\t\t}\n\t\t}\n\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tif needa[in[b]] == 0 {\n\t\t\t\tbase++\n\t\t\t\tdelete(noyou, in[b])\n\t\t\t}\n\t\t\tneeda[in[b]]++\n\t\t}\n\t}\n}\n\nfunc ScanLine() string {\n\tvar c byte\n\tvar err error\n\tvar b []byte\n\tfor err == nil {\n\t\t_, err = fmt.Scanf(\"%c\", &c)\n\n\t\tif c != '\\n' && c != byte(13) {\n\t\t\tb = append(b, c)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn string(b)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar all = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\nfunc main() {\n\tin := ScanLine()\n\tvar needa [26]int\n\tleftlen := len(in)\n\tbase := 0\n\tf := 0\n\tb := 0\n\tif leftlen < 26 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\t// once\n\tfor {\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tneeda[in[b]-'A']++\n\t\t\tif needa[in[b]-'A'] == 1 {\n\t\t\t\tbase++\n\t\t\t}\n\t\t}\n\t\tif b == 25 {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\tfor {\n\t\tvar empty int\n\t\tif base == 26 {\n\t\t\tfor idx := 0; idx != f; idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfmt.Print(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor idx := f; idx != b+1; idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfor k := empty; ; k++ {\n\t\t\t\t\t\tif needa[k] == 0 {\n\t\t\t\t\t\t\tfmt.Print(string(all[k]))\n\t\t\t\t\t\t\tempty = k + 1\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor idx := b + 1; idx != len(in); idx++ {\n\t\t\t\tif in[idx] == '?' {\n\t\t\t\t\tfmt.Print(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(string(in[idx]))\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t\tbreak\n\t\t}\n\t\tf++\n\t\tb++\n\t\tleftlen--\n\t\tif leftlen < 26 {\n\t\t\tfmt.Println(-1)\n\t\t\tbreak\n\t\t}\n\t\tif in[f-1] == '?' {\n\t\t\tbase--\n\t\t} else {\n\t\t\tneeda[in[f-1]-'A']--\n\t\t\tif needa[in[f-1]-'A'] == 0 {\n\t\t\t\tbase--\n\t\t\t}\n\t\t}\n\n\t\tif in[b] == '?' {\n\t\t\tbase++\n\t\t} else {\n\t\t\tif needa[in[b]-'A'] == 0 {\n\t\t\t\tbase++\n\t\t\t}\n\t\t\tneeda[in[b]-'A']++\n\t\t}\n\t}\n}\n\nfunc ScanLine() string {\n\tvar c byte\n\tvar err error\n\tvar b []byte\n\tfor err == nil {\n\t\t_, err = fmt.Scanf(\"%c\", &c)\n\n\t\tif c != '\\n' && c != byte(13) {\n\t\t\tb = append(b, c)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn string(b)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tmarks := make([]bool, 26)\n\tletter := 0\n\tquestion := 0\n\tok := false\n\n\treader := bufio.NewReader(os.Stdin)\n\tre := regexp.MustCompile(`\\r?\\n`)\n\tif _in, err := reader.ReadString('\\n'); err != nil {\n\t\tif err != io.EOF {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tin := re.ReplaceAllString(_in, \"\")\n\n\t\tif len(in) < 26 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\n\t\ts := 0\n\t\tp := 0\n\t\tfor s <= len(in)-25 {\n\t\t\tif in[s] == '?' {\n\t\t\t\tletter = 0\n\t\t\t\tquestion = 1\n\t\t\t} else {\n\t\t\t\tmarks[in[s]-'A'] = true\n\t\t\t\tletter = 1\n\t\t\t\tquestion = 0\n\t\t\t}\n\t\t\tp = s + 1\n\t\t\tfor p < len(in) && p-s < 26 {\n\t\t\t\tif in[p] == '?' {\n\t\t\t\t\tquestion++\n\t\t\t\t} else if marks[in[p]-'A'] {\n\t\t\t\t\tfor i := 0; i < 26; i++ {\n\t\t\t\t\t\tmarks[i] = false\n\t\t\t\t\t}\n\t\t\t\t\tj := p - 1\n\t\t\t\t\tfor j > s && j < len(in) && (in[j] == '?' || in[j] != in[p]) {\n\t\t\t\t\t\tj--\n\t\t\t\t\t}\n\t\t\t\t\ts = j + 1\n\t\t\t\t\tbreak\n\t\t\t\t} else {\n\t\t\t\t\tmarks[in[p]-'A'] = true\n\t\t\t\t\tletter++\n\t\t\t\t}\n\t\t\t\tp++\n\t\t\t}\n\t\t\tif letter+question == 26 {\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\ti := 0\n\t\t\tfor ; i < s; i++ {\n\t\t\t\tif in[i] == '?' {\n\t\t\t\t\tfmt.Printf(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"%c\", in[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor ; i < p; i++ {\n\t\t\t\tif in[i] == '?' {\n\t\t\t\t\tfor j := 0; j < 26; j++ {\n\t\t\t\t\t\tif !marks[j] {\n\t\t\t\t\t\t\tmarks[j] = true\n\t\t\t\t\t\t\tfmt.Printf(\"%c\", 'A'+j)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"%c\", in[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor ; i < len(in); i++ {\n\t\t\t\tif in[i] == '?' {\n\t\t\t\t\tfmt.Printf(\"A\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Printf(\"%c\", in[i])\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Printf(\"\\n\")\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n}\n"}, {"source_code": "// Codeforces 716 B Complete the Word\n// int - 32 bit type !!!!\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i=26 {\n fmt.Println(\"Error, ich,i = \",ich,i)\n }\n nch[ich] ++\n //fmt.Println(\"++ich,nch=\",nch,ich)\n if nch[ich] == 2 {\n n2++\n } \n }\n if i>=26 {\n if s[i-26] != '?' {\n ich = int(s[i-26] - 'A')\n nch[ich]--\n //fmt.Println(\"--ich,nch=\",nch,ich)\n if nch[ich]==1 {\n n2--\n }\n }\n }\n //fmt.Println(\"i,n2=\",i,n2)\n if i>=25 && n2==0 {\n // we found solution, copy to aout\n aout = make([]byte, n)\n for ii:=0; ii 0 {\n iich ++\n }\n aout[ii] = byte(iich+'A')\n iich++\n } \n }\n for ii:=i+1; ii but really this is unreliable approach\n*/\n\nfunc main(){\n var vladik, valera int\n fmt.Scanf(\"%d %d\", &vladik, &valera)\n\n var i int = 1\n for vladik >= 0 && valera >= 0 {\n if i % 2 == 1 {\n vladik -= i\n } else {\n valera -= i\n }\n i += 1\n }\n\n // fmt.Printf(\"i: %d\\n\", i)\n // fmt.Printf(\"Vladik: %d, Valera: %d\\n\", vladik, valera)\n\n if vladik < 0 {\n fmt.Println(\"Vladik\")\n } else {\n fmt.Println(\"Valera\")\n }\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc calc(first,second int){\n\n\tfor i:=1;i<1000000000;i++{\n\t\tif i&1==1{\n\t\t\tfirst -= i\n\t\t\tif first<0{\n\t\t\t\tfmt.Print( \"Vladik\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}else{\n\t\t\tsecond -= i\n\t\t\tif second<0{\n\t\t\t\tfmt.Print(\"Valera\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n\nfunc main(){\n\tvar vladik int\n\tvar valera int\n\tfmt.Scan(&vladik,&valera)\n\tcalc(vladik,valera)\n}"}, {"source_code": "// Try Codeforces\n// author: Leonardone @ NEETSDKASU\npackage main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tc := 0\n\tfor {\n\t c++\n\t a -= c\n\t if a < 0 {\n\t fmt.Println(\"Vladik\")\n\t break\n\t }\n\n\t c++\n\t b -= c\n\t if b < 0 {\n\t fmt.Println(\"Valera\")\n\t break\n\t }\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &a, &b); err != nil {\n\t\treturn\n\t}\n\n\tab := [2]int{a, b}\n\tpeople := 0\n\tamount := 1\n\tfor ab[people] >= amount {\n\t\tab[people] -= amount\n\t\tpeople = (people + 1) % 2\n\t\tamount++\n\t}\n\n\tif people == 0 {\n\t\tfmt.Println(\"Vladik\")\n\t} else {\n\t\tfmt.Println(\"Valera\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var vladik, valera int\n fmt.Scanf(\"%d %d\", &vladik, &valera)\n\n var i int = 1\n for vladik >= 0 && valera >= 0 {\n if i % 2 == 1 {\n vladik -= i\n } else {\n valera -= i\n }\n i += 1\n }\n\n if vladik < 0 {\n fmt.Println(\"Vladik\")\n } else {\n fmt.Println(\"Valera\")\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\ti := 1\n\tfor {\n\t\tif a-i < 0 {\n\t\t\tfmt.Println(\"Vladik\")\n\t\t\treturn\n\t\t}\n\t\ta = a - i\n\t\tif b-i-1 < 0 {\n\t\t\tfmt.Println(\"Valera\")\n\t\t\treturn\n\t\t}\n\t\tb = b - i - 1\n\t\ti += 2\n\t}\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tin := gsli(reader)\n\ta := in[0]\n\tb := in[1]\n\n\ti := 1\n\n\tfor true {\n\t\ta -= i\n\t\tif a < 0 {\n\t\t\tfmt.Println(\"Vladik\")\n\t\t\treturn\n\t\t}\n\t\ti++\n\t\tb -= i\n\t\tif b < 0 {\n\t\t\tfmt.Println(\"Valera\")\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tp := 1\n\tfor {\n\t\tif n < p {\n\t\t\tfmt.Printf(\"Vladik\\n\")\n\t\t\tbreak\n\t\t}\n\t\tn -= p\n\t\tp++\n\t\tif m < p {\n\t\t\tfmt.Printf(\"Valera\\n\")\n\t\t\tbreak\n\t\t}\n\t\tm -= p\n\t\tp++\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getLooser(vladik int64, valera int64) {\n\tmaxStep := 1000000000\n\tfor index := 0; index < maxStep; index++ {\n\t\tif vladik < 0 {\n\t\t\tfmt.Println(\"Vladik\")\n\t\t\tbreak\n\t\t} else if valera < 0 {\n\t\t\tfmt.Println(\"Valera\")\n\t\t\tbreak\n\t\t}\n\t\tif index != 0 {\n\t\t\tif index%2 == 0 {\n\t\t\t\tvalera = valera - int64(index)\n\t\t\t} else {\n\t\t\t\ttemp := vladik - int64(index)\n\t\t\t\tvladik = temp\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tnumbers := strings.Fields(text)\n\t// fmt.Println(numbers)\n\tvladik, _ := strconv.ParseInt(numbers[0], 10, 64)\n\tvalera, _ := strconv.ParseInt(numbers[1], 10, 64)\n\tgetLooser(vladik, valera)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar vladik, valera int\n\tvar k int\n\tk = 1\n\tfmt.Scanf(\"%d %d\\n\", &vladik, &valera)\n\tfor {\n\t\tif vladik-k < 0 {\n\t\t\tfmt.Println(\"Vladik\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tvladik = vladik - k\n\t\t}\n\t\tk++\n\t\tif valera-k < 0 {\n\t\t\tfmt.Println(\"Valera\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tvalera = valera - k\n\t\t}\n\t\tk++\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solve(s string) string {\n\treturn s\n}\n\nfunc output(i int, ans string) {\n\tfmt.Printf(\"Case #%d: %s\\n\", i, ans)\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 1000000), 1000000)\n\n\tscanner.Scan()\n\tx := strings.Split(scanner.Text(), \" \")\n\ta, _ := strconv.Atoi(x[0])\n\tb, _ := strconv.Atoi(x[1])\n\tda := 1\n\tfor a >= 0 && b >= 0 {\n\t\ta -= da\n\t\tb -= (da + 1)\n\t\tda += 2\n\t}\n\n\tif a < 0 {\n\t\tfmt.Println(\"Vladik\")\n\t} else {\n\t\tfmt.Println(\"Valera\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\n//func calc(t int) string {\n//\tvar a int\n//\tvar b int\n//\tfmt.Scanln(&a,&b)\n//\tvar prev int = a\n//\tvar sum1 int = a\n//\tvar sum2 int = b\n//\tvar flag bool = false\n//\n//\tif a!=b{\n//\t\treturn \"rated\"\n//\t}\n//\tfor i:=1;i= 0; i-- {\n\t\tif !vis[a[i]] {\n\t\t\tvis[a[i]] = true\n\t\t\tu = append(u, a[i])\n\t\t}\n\t}\n\tPrintln(len(u))\n\tfor i := len(u) - 1; i >= 0; i-- {\n\t\tPrint(u[i], \" \")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tm := make(map[int]bool)\n\tk := make([]int,n)\n\tvar l []int\n\tfor i:=0;i=0;i-- {\n\t\t_,ok := m[k[i]]\n\t\tif !ok {\n\t\t\tl = append(l,k[i])\n\t\t\tm[k[i]] = true\n\t\t}\n\t}\n\tfor i :=0;i= 0; i-- {\n\t\tv, _ := m[a[i]]\n\t\tif v {\n\t\t\ta[i] = -1\n\t\t} else {\n\t\t\tm[a[i]] = true\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] != -1 {\n\t\t\tfmt.Print(a[i], \" \")\n\t\t\t//fmt.Printf(\"%d \", a[i])\n\t\t}\n\t}\n\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar a [50]string\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[n-i-1])\n\t}\n\tvar len_result int\n\tvar result [50]string\n\tfor i := 0; i < n; i++ {\n\t\texists := false\n\t\tfor j := 0; j < len_result; j++ {\n\t\t\tif result[j] == a[i] {\n\t\t\t\texists = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !exists {\n\t\t\tresult[len_result] = a[i]\n\t\t\tlen_result++\n\t\t}\n\t}\n\tfmt.Println(len_result)\n\tfor j := 0; j < len_result; j++ {\n\t\tfmt.Print(result[len_result-j-1], \" \")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc Process(a []int64) (int64, []int64) {\n\tvar m = map[int64]bool{}\n\tvar r = make([]int64, 0)\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif _, exist := m[a[i]]; !exist {\n\t\t\tr = append([]int64{a[i]}, r...)\n\t\t}\n\n\t\tm[a[i]] = true\n\t}\n\n\treturn int64(len(r)), r\n}\n\nfunc main() {\n\tvar n int64\n\n\tfmt.Scanln(&n)\n\n\tvar a, _ = ScanN(n)\n\n\tvar r1, r2 = Process(a)\n\n\tfmt.Println(r1)\n\n\tPrintSlice(r2)\n}\n\nfunc ScanN(n int64) ([]int64, error) {\n\tin := make([]int64, n)\n\tfor i := range in {\n\t\t_, err := fmt.Scan(&in[i])\n\t\tif err != nil {\n\t\t\treturn in[:i], err\n\t\t}\n\t}\n\treturn in, nil\n}\n\nfunc PrintSlice(a []int64) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i == len(a)-1 {\n\t\t\tfmt.Print(a[i])\n\t\t} else {\n\t\t\tfmt.Print(a[i], \" \")\n\t\t}\n\t}\n}\n"}, {"source_code": "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.Buffer(make([]byte, 2048*2048), 2048*2048)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\n\ta := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\ta[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\n\ttotal := 0\n\tset := make([]int, 1001)\n\n\tfor i := 0; i < 1001; i++ {\n\t\tset[i] = -1\n\t}\n\n\tfor i, el := range a {\n\t\tif set[el] == -1 {\n\t\t\ttotal++\n\t\t} else {\n\t\t\ta[set[el]] = -1\n\t\t}\n\t\tset[el] = i\n\t}\n\tfmt.Println(total)\n\n\tfor _, el := range a {\n\t\tif el == -1 {\n\t\t\tcontinue\n\t\t}\n\t\tif set[el] == -1 {\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"%d \", el)\n\t}\n\tfmt.Printf(\"\\n\")\n}\n"}, {"source_code": "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 := make([]int, 0)\n\tmp := make(map[int]bool)\n\tfor i := n-1; i >= 0; i-- {\n\t\tif _, ok := mp[a[i]]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tmp[a[i]] = true\n\t\tans = append(ans, a[i])\n\t}\n\tfmt.Printf(\"%d\\n%d\", len(ans), ans[len(ans)-1])\n\tfor i := len(ans)-2; i >= 0; i-- {\n\t\tfmt.Printf(\" %d\", ans[i])\n\t}\n\tfmt.Println()\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst (\n\tmaxn = 55\n)\n\nvar (\n\tn int\n\ta [maxn]int\n\tm map[int]bool\n\tans []int\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\tm = make(map[int]bool)\n\tfor i := n - 1; i >= 0; i-- {\n\t\t_, inMap := m[a[i]]\n\t\tif !inMap {\n\t\t\tans = append(ans, a[i])\n\t\t\tm[a[i]] = true\n\t\t}\n\t}\n\n\tfmt.Println(len(ans))\n\tfor i := len(ans) - 1; i >= 0; i-- {\n\t\tfmt.Printf(\"%v \", ans[i])\n\t}\n}\n"}, {"source_code": "package main \nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar set, no []int\nfunc check(f int) int{\n\t var r int\n\t for i, a := range no {\n\t \t if a == f { \n\t \t \t r = i\n\t \t }\n\t }\n\n\t return r\n}\nfunc main() {\n\t var n int \n\t var used = make(map[int]bool)\n\t fmt.Scanf(\"%d\", &n)\n\n\t for i:=0; i= 0; i-- {\n\t\ttmp, _ := strconv.Atoi(arrStartStrings[i])\n\t\tif m[tmp] == false {\n\t\t\tstart = append(start, tmp)\n\t\t\tm[tmp] = true\n\t\t}\n\t}\n\tfor i, j := 0, len(start)-1; i < j; i, j = i+1, j-1 {\n\t\tstart[i], start[j] = start[j], start[i]\n\t}\n\tfmt.Println(len(start))\n\tfor i := 0; i < len(start); i++ {\n\t\tif i == 0 {\n\t\t\tfmt.Printf(\"%d\", start[i])\n\t\t} else {\n\t\t\tfmt.Printf(\" %d\", start[i])\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tN := io.NextInt()\n\tA := io.NextIntArray(N)\n\t\n\tcnt := 0\n\tseen := make(map[int]bool)\n\tgood := make([]bool, N)\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif !seen[A[i]] {\n\t\t\tcnt++\n\t\t\tseen[A[i]] = true\n\t\t\tgood[i] = true\n\t\t}\n\t}\n\t\n\tio.Println(cnt)\n\tfor i, v := range A {\n\t\tif good[i] {\n\t\t\tio.Printf(\"%d \", v)\n\t\t}\n\t}\n\tio.Println()\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc Process(a []int64) (int64, []int64) {\n\tvar m = map[int64]bool{}\n\tvar r = make([]int64, 0)\n\n\tfor i := len(a) - 1; i >= 0; i-- {\n\t\tif _, exist := m[a[i]]; !exist {\n\t\t\tr = append([]int64{a[i]}, r...)\n\t\t}\n\n\t\tm[a[i]] = true\n\t}\n\n\treturn int64(len(r)), r\n}\n\nfunc main() {\n\tvar n int64\n\n\tfmt.Scanln(&n)\n\n\tvar a, _ = ScanN(n)\n\n\tvar r1, r2 = Process(a)\n\n\tfmt.Println(r1)\n\tPrintSlice(r2)\n}\n\nfunc ScanN(n int64) ([]int64, error) {\n\tin := make([]int64, n)\n\tfor i := range in {\n\t\t_, err := fmt.Scan(&in[i])\n\t\tif err != nil {\n\t\t\treturn in[:i], err\n\t\t}\n\t}\n\treturn in, nil\n}\n\nfunc PrintSlice(a []int64) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i == len(a)-1 {\n\t\t\tfmt.Print(a[i])\n\t\t} else {\n\t\t\tfmt.Print(a, \" \")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tN := io.NextInt()\n\tA := io.NextIntArray(N)\n\t\n\tseen := make(map[int]bool)\n\tgood := make([]bool, N)\n\tfor i := N - 1; i >= 0; i-- {\n\t\tif !seen[A[i]] {\n\t\t\tseen[A[i]] = true\n\t\t\tgood[i] = true\n\t\t}\n\t}\n\t\n\tfor i, v := range A {\n\t\tif good[i] {\n\t\t\tio.Printf(\"%d \", v)\n\t\t}\n\t}\n\tio.Println()\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}], "src_uid": "1b9d3dfcc2353eac20b84c75c27fab5a"} {"source_code": "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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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\t// str := 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 n int\nvar S []rune\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\n\t// S[4], S[9] = S[9], S[4]\n\t// sub()\n\n\tans := 0\n\tl, r := 0, 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i; j < n; j++ {\n\t\t\t// \u5165\u308c\u66ff\u3048\u308b\n\t\t\tS[i], S[j] = S[j], S[i]\n\n\t\t\ttmp := sub()\n\t\t\tif ans < tmp {\n\t\t\t\tans = tmp\n\t\t\t\tl, r = i, j\n\t\t\t}\n\n\t\t\t// \u3082\u3068\u306b\u623b\u3059\n\t\t\tS[i], S[j] = S[j], S[i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n\tfmt.Println(l+1, r+1)\n}\n\ntype Char struct {\n\tidx int\n\tc rune\n}\n\nfunc sub() int {\n\t// \u30b9\u30bf\u30c3\u30af\u3067\u5b57\u53e5\u89e3\u6790\u3059\u308b\n\ts := make([]Char, 0, 1000)\n\tmemo := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tr := S[i]\n\t\tchar := Char{idx: i, c: r}\n\n\t\tif len(s) == 0 || r == '(' {\n\t\t\ts = append(s, char)\n\t\t\tcontinue\n\t\t}\n\n\t\tif r == ')' && s[len(s)-1].c == '(' {\n\t\t\tpopped := s[len(s)-1]\n\t\t\ts = s[:len(s)-1]\n\t\t\tif len(s) == 0 || s[len(s)-1].c == ')' {\n\t\t\t\tmemo = append(memo, popped.idx)\n\t\t\t}\n\t\t} else {\n\t\t\ts = append(s, char)\n\t\t}\n\t}\n\n\t// \u30b9\u30bf\u30c3\u30af\u306b\u4f55\u3082\u6b8b\u3063\u3066\u3044\u306a\u3044\u3068\u304d\u306fmemo\u306e\u9577\u3055\n\tif len(s) == 0 {\n\t\treturn len(memo)\n\t}\n\n\t// \u6b8b\u3063\u305f\u30ab\u30c3\u30b3\u306e\u6570\u3092\u30c1\u30a7\u30c3\u30af\n\top, cl := 0, 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i].c == '(' {\n\t\t\top++\n\t\t} else {\n\t\t\tcl++\n\t\t}\n\t}\n\t// \u6570\u304c\u4e00\u81f4\u3057\u306a\u3044\u3068\u30c0\u30e1\n\tif op != cl {\n\t\treturn 0\n\t}\n\n\tl, r := 0, 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i].c == '(' {\n\t\t\tr = s[i].idx\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := len(s) - 1; i >= 0; i-- {\n\t\tif s[i].c == ')' {\n\t\t\tl = s[i].idx\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// fmt.Println(memo)\n\t// for i := 0; i < len(s); i++ {\n\t// \tfmt.Printf(\"%d: %c\\n\", s[i].idx, s[i].c)\n\t// }\n\t// fmt.Printf(\"lidx: %d, ridx: %d\\n\", l, r)\n\n\tans := 0\n\tfor i := 0; i < len(memo); i++ {\n\t\tif l < memo[i] && memo[i] <= r {\n\t\t\tans++\n\t\t}\n\t}\n\n\treturn ans + 1\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\tsum := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif s[i] == ')' {\n\t\t\tsum[i] = sum[i+1] + 1\n\t\t} else {\n\t\t\tsum[i] = sum[i+1] - 1\n\t\t}\n\t}\n\n\tif sum[0] != 0 {\n\t\tfmt.Printf(\"0\\n1 1\\n\")\n\t\treturn\n\t}\n\n\tmin := 2 * n\n\ttotal := 0\n\ta := 1\n\tb := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tif sum[i] < min {\n\t\t\tmin = sum[i]\n\t\t\ttotal = 1\n\t\t} else if sum[i] == min {\n\t\t\ttotal++\n\t\t}\n\t}\n\n\t//fmt.Printf(\"%d %d\\n%d %d\\n\", min, total, a, b)\n\n\tfor i := 0; i < n; i++ {\n\t\tsub := 0\n\t\tif s[i] == ')' {\n\t\t\tsub = 2\n\t\t} else {\n\t\t\tsub = -2\n\t\t}\n\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcha := 0\n\t\t\ttmin := 2 * n\n\t\t\tttotal := 0\n\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif k > i && k <= j {\n\t\t\t\t\tcha = sub\n\t\t\t\t} else {\n\t\t\t\t\tcha = 0\n\t\t\t\t}\n\n\t\t\t\tif sum[k]+cha < tmin {\n\t\t\t\t\ttmin = sum[k] + cha\n\t\t\t\t\tttotal = 1\n\t\t\t\t} else if sum[k]+cha == tmin {\n\t\t\t\t\tttotal++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ttotal > total {\n\t\t\t\ttotal = ttotal\n\t\t\t\ta = i + 1\n\t\t\t\tb = j + 1\n\t\t\t}\n\n\t\t\t//fmt.Println(ttotal, tmin, i+1, j+1)\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n%d %d\\n\", total, a, b)\n}\n\n// ((()))(()()()()()()()()())\n// +++++++-+-+-+-+-+-++++++++\n// 01232101212121212121212121\n\n// ((())))()()()()()()()()()(\n// +++++++-+-+-+-+-+-+-+-+-+-\n// 01232101010101010101010101\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\tsum := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif s[i] == ')' {\n\t\t\tsum[i] = sum[i+1] + 1\n\t\t} else {\n\t\t\tsum[i] = sum[i+1] - 1\n\t\t}\n\t}\n\n\tif sum[0] != 0 {\n\t\tfmt.Printf(\"0\\n1 1\\n\")\n\t\treturn\n\t}\n\n\tmin := 2 * n\n\ttotal := 0\n\ta := 1\n\tb := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tif sum[i] < min {\n\t\t\tmin = sum[i]\n\t\t\ttotal = 1\n\t\t} else if sum[i] == min {\n\t\t\ttotal++\n\t\t}\n\t}\n\n\t//fmt.Printf(\"%d %d\\n%d %d\\n\", min, total, a, b)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsub := 0\n\t\t\tif s[i] == ')' {\n\t\t\t\tsub = 2\n\t\t\t} else {\n\t\t\t\tsub = -2\n\t\t\t}\n\t\t\tcha := 0\n\t\t\ttmin := 2 * n\n\t\t\tttotal := 0\n\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif k > i && k <= j {\n\t\t\t\t\tcha = sub\n\t\t\t\t} else {\n\t\t\t\t\tcha = 0\n\t\t\t\t}\n\n\t\t\t\tif sum[k]+cha < tmin {\n\t\t\t\t\ttmin = sum[k]\n\t\t\t\t\tttotal = 1\n\t\t\t\t} else if sum[k]+cha == tmin {\n\t\t\t\t\tttotal++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ttotal > total {\n\t\t\t\ttotal = ttotal\n\t\t\t\ta = i\n\t\t\t\tb = j\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n%d %d\\n\", total, a+1, b+1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n%s\\n\", &n, &s)\n\tsum := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif s[i] == ')' {\n\t\t\tsum[i] = sum[i+1] + 1\n\t\t} else {\n\t\t\tsum[i] = sum[i+1] - 1\n\t\t}\n\t}\n\n\tif sum[0] != 0 {\n\t\tfmt.Printf(\"0\\n1 1\\n\")\n\t\treturn\n\t}\n\n\tmin := 2 * n\n\ttotal := 0\n\ta := 1\n\tb := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tif sum[i] < min {\n\t\t\tmin = sum[i]\n\t\t\ttotal = 1\n\t\t} else if sum[i] == min {\n\t\t\ttotal++\n\t\t}\n\t}\n\n\t//fmt.Printf(\"%d %d\\n%d %d\\n\", min, total, a, b)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tsub := 0\n\t\t\tif s[i] == ')' {\n\t\t\t\tsub = 2\n\t\t\t} else {\n\t\t\t\tsub = -2\n\t\t\t}\n\t\t\tcha := 0\n\t\t\ttmin := 2 * n\n\t\t\tttotal := 0\n\n\t\t\tfor k := 0; k < n; k++ {\n\t\t\t\tif k > i && k <= j {\n\t\t\t\t\tcha = sub\n\t\t\t\t} else {\n\t\t\t\t\tcha = 0\n\t\t\t\t}\n\n\t\t\t\tif sum[i]+cha < tmin {\n\t\t\t\t\ttmin = sum[k]\n\t\t\t\t\tttotal = 1\n\t\t\t\t} else if sum[k]+cha == tmin {\n\t\t\t\t\tttotal++\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ttotal > total {\n\t\t\t\ttotal = ttotal\n\t\t\t\ta = i\n\t\t\t\tb = j\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n%d %d\\n\", total, a+1, b+1)\n}\n"}], "src_uid": "2d10668fcc2d8e90e102b043f5e0578d"} {"source_code": "package main\nimport \"fmt\"\n\nconst size int = 4;\nfunc solve(T []string,x int,y int) bool{\n //fmt.Println(x,y);\n T[x]=T[x][:y]+string('x')+T[x][y+1:];\n possible:=false;\n for i:=0;i=0&&nx=0&&ny= 0 && in[i+1][j-1] == 'x' && in[i+2][j-2] == 'x'))) {\n\t\t\t\t\tO(\"YES\", \"\\n\")\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tr = bufio.NewReader(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfor i := 0; i < 4; i++ {\n\t\tI(&in[i], \"\\n\")\n\t}\n\tif check() {\n\t\treturn\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif in[i][j] == '.' {\n\t\t\t\ta := []rune(in[i])\n\t\t\t\ta[j] = 'x'\n\t\t\t\tin[i] = string(a)\n\t\t\t\tif check() {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ta[j] = '.'\n\t\t\t\tin[i] = string(a)\n\t\t\t}\n\t\t}\n\t}\n\tO(\"NO\", \"\\n\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc getField() [4][4]rune {\n\tvar field [4][4]rune\n\tvar c rune\n\tfor i := range field {\n\t\tfor j := range field[i] {\n\t\t\tfor {\n\t\t\t\t_, err := fmt.Scanf(\"%c\", &c)\n\t\t\t\tif err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t\tif c == 'x' || c == 'o' || c == '.' {\n\t\t\t\t\tfield[i][j] = c\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn field\n}\n\nvar patterns [][]rune = [][]rune{\n\t{'.', 'x', 'x'},\n\t{'x', '.', 'x'},\n\t{'x', 'x', '.'},\n}\n\nfunc inPatterns3(x1, x2, x3 rune) bool {\n\tfor i := range patterns {\n\t\tpattern := patterns[i]\n\t\tif x1 == pattern[0] && x2 == pattern[1] && x3 == pattern[2] {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc inPatterns4(x1, x2, x3, x4 rune) bool {\n\treturn inPatterns3(x1, x2, x3) || inPatterns3(x2, x3, x4)\n}\n\nfunc canWin(field [4][4]rune) bool {\n\tfor _, f := range field {\n\t\tif inPatterns4(f[0], f[1], f[2], f[3]) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tfor i := range field {\n\t\tif inPatterns4(field[0][i], field[1][i], field[2][i], field[3][i]) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tif inPatterns4(field[0][0], field[1][1], field[2][2], field[3][3]) ||\n\t\tinPatterns4(field[0][3], field[1][2], field[2][1], field[3][0]) {\n\t\treturn true\n\t}\n\tif inPatterns3(field[1][0], field[2][1], field[3][2]) ||\n\t\tinPatterns3(field[0][1], field[1][2], field[2][3]) ||\n\t\tinPatterns3(field[2][0], field[1][1], field[0][2]) ||\n\t\tinPatterns3(field[3][1], field[2][2], field[1][3]) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\tif canWin(getField()) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strings\"\n)\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\nfunc min(a, b int) int {\n if a < b {\n return a\n }\n return b\n}\n\nfunc main() {\n in := bufio.NewReader(os.Stdin)\n\n // your code here\n rows := make([]string, 4)\n for i := 0; i < 4; i++ {\n fmt.Fscanf(in, \"%s\\n\", &rows[i])\n }\n lines := []string{}\n for r := 0; r < 4; r++ {\n lines = append(lines, rows[r])\n }\n for c := 0; c < 4; c++ {\n line := \"\"\n for r := 0; r < 4; r++ {\n line += rows[r][c:c+1]\n }\n lines = append(lines, line)\n }\n for r := 0; r < 2; r++ {\n for c := 0; c < 2; c++ {\n if r == 1 && c == 1 {\n break\n }\n line := \"\"\n for i := 0; r + i < 4 && c + i < 4; i++ {\n line += string(rows[r+i][c + i])\n }\n lines = append(lines, line)\n line = \"\"\n cc := 3 - c\n for i := 0; r + i < 4 && cc - i >= 0; i++ {\n line += string(rows[r+i][cc-i])\n }\n lines = append(lines, line)\n }\n }\n for _, line := range lines {\n for i := range line {\n if line[i:i+1] == \".\" && strings.Contains(line[0:i]+\"x\"+line[i+1:], \"xxx\") {\n fmt.Println(\"YES\")\n return\n }\n }\n }\n fmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tconst b_size int = 4\n\n\treader := bufio.NewReader(os.Stdin)\n\tre := regexp.MustCompile(`\\r?\\n`)\n\n\tboard := [b_size]string{}\n\n\tfor i := 0; i < b_size; i++ {\n\t\tif s, err := reader.ReadString('\\n'); err != nil {\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\ts = re.ReplaceAllString(s, \"\")\n\t\t\tboard[i] = s\n\t\t}\n\t}\n\n\tok := false\n\tcandidate := make([]rune, b_size)\n\tn := 0\n\n\tfor i := 0; i < b_size; i++ {\n\t\t// Horizontally\n\t\tfor j := 0; j < b_size; j++ {\n\t\t\tcandidate[j] = rune(board[i][j])\n\t\t}\n\t\tif is_ok(candidate, b_size) {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\n\t\t// Vertically\n\t\tfor j := 0; j < b_size; j++ {\n\t\t\tcandidate[j] = rune(board[j][i])\n\t\t}\n\t\tif is_ok(candidate, b_size) {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tdia_array := make([][b_size]rune, (b_size*2-1)*2)\n\tfor j := 0; j < b_size; j++ {\n\t\toff0 := j\n\t\toff1 := (b_size*2 - 1) + (b_size - j - 1)\n\t\tfor i := 0; i < b_size; i++ {\n\t\t\tdia_array[i+off0][j] = rune(board[i][j])\n\t\t\tdia_array[i+off1][j] = rune(board[i][j])\n\t\t}\n\t}\n\n\tfor i := 0; i < (b_size*2-1)*2; i++ {\n\t\tn = 0\n\t\tfor j := 0; j < b_size; j++ {\n\t\t\tif dia_array[i][j] != dia_array[0][b_size-1] {\n\t\t\t\tcandidate[n] = dia_array[i][j]\n\t\t\t\tn++\n\t\t\t}\n\t\t}\n\t\tif is_ok(candidate, n) {\n\t\t\tok = true\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc is_ok(candidate []rune, n int) bool {\n\tif n < 3 {\n\t\treturn false\n\t} else {\n\t\tfor e := 3; e <= n; e++ {\n\t\t\txs := 0\n\t\t\tdots := 0\n\t\t\tfor i := e - 3; i < e; i++ {\n\t\t\t\tif candidate[i] == 'x' {\n\t\t\t\t\txs++\n\t\t\t\t} else if candidate[i] == '.' {\n\t\t\t\t\tdots++\n\t\t\t\t} else { // 'o'\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tif xs == 2 && dots == 1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tfield := make([][]int, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tfield[i] = make([]int, 4)\n\t\tfor j, ch := range readString() {\n\t\t\tswitch ch {\n\t\t\tcase 'x':\n\t\t\t\tfield[i][j] = 1\n\t\t\tcase 'o':\n\t\t\t\tfield[i][j] = 2\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif field[i][j] == 0 {\n\t\t\t\tfield[i][j] = 1\n\t\t\t\tif win(field) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfield[i][j] = 0\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc win(field [][]int) bool {\n\tfor j := 0; j < 4; j++ {\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tif field[j][i] == 1 && field[j][i+1] == 1 && field[j][i+2] == 1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tfor j := 0; j < 4; j++ {\n\t\tfor i := 0; i < 2; i++ {\n\t\t\tif field[i][j] == 1 && field[i+1][j] == 1 && field[i+2][j] == 1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tif field[i][j] == 1 && field[i+1][j+1] == 1 && field[i+2][j+2] == 1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tif field[i][3-j] == 1 && field[i+1][3-j-1] == 1 && field[i+2][3-j-2] == 1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "// Codeforces 754 B IlyaTicTacToe,\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i=4 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor x0:=0; x0<4; x0++ {\n\t\t\t\tx1 := x0+2*dx[dir]\n\t\t\t\tif x1<0 || x1>=4 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcntX := 0\n\t\t\t\tcntO := 0\n\t\t\t\tfor k:=0; k<3; k++ {\n\t\t\t\t\txx := x0 + k*dx[dir]\n\t\t\t\t\tyy := y0 + k*dy[dir]\n\t\t\t\t\tif field[yy][xx]=='x' {\n\t\t\t\t\t\tcntX++\n\t\t\t\t\t} else if field[yy][xx]=='o' {\n\t\t\t\t\t\tcntO++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif cntX>=2 && cntO==0 {\n\t\t\t\t\tcanWin = \"YES\"\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc printRes() {\n\tfmt.Println(canWin)\n}\n\nfunc main() {\n\treadData()\n\tsolve()\n\tprintRes()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst size = 4\nconst x = 'x'\nconst dot = '.'\n\nfunc checkVertical(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tif table[i][0] == x && table[i][1] == x && table[i][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[i][1] == x && table[i][2] == x && table[i][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkHorizontal(table [][]rune) bool {\n\tfor j := 0; j < size; j++ {\n\t\tif table[0][j] == x && table[1][j] == x && table[2][j] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[1][j] == x && table[2][j] == x && table[3][j] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkDiagonal(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tvar ii, jj int\n\n\t\t\tii = i + 2\n\t\t\tjj = j + 2\n\n\t\t\tif ii < size && jj < size && table[i][j] == x && table[i+1][j+1] == x && table[i+2][j+2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tii = i + 2\n\t\t\tjj = j - 2\n\n\t\t\tif ii < size && jj >= 0 && table[i][j] == x && table[i+1][j-1] == x && table[i+2][j-2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]rune, size)\n\n\tfor i := 0; i < size; i++ {\n\t\ttable[i] = make([]rune, size)\n\n\t\tvar row string\n\t\tfmt.Scanf(\"%s\\n\", &row)\n\n\t\tfor p, s := range row {\n\t\t\ttable[i][p] = s\n\t\t}\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif table[i][j] == dot {\n\t\t\t\ttable[i][j] = x\n\t\t\t\tif checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttable[i][j] = dot\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc I(i interface{}, delim string) {\n\tfmt.Fscanf(r, \"%v\"+delim, i)\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nvar in [4]string\n\nfunc check() bool {\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif in[i][j] == 'x' {\n\t\t\t\tif strings.Contains(in[i], \"xxx\") ||\n\t\t\t\t\t(i+2 < 4 && ((in[i+1][j] == 'x' && in[i+2][j] == 'x') ||\n\t\t\t\t\t\t(j+2 < 4 && in[i+1][j+1] == 'x' && in[i+2][j+2] == 'x') ||\n\t\t\t\t\t\t(i-2 >= 0 && in[i+1][j-1] == 'x' && in[i+2][j-2] == 'x'))) {\n\t\t\t\t\tO(\"YES\", \"\\n\")\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tr = bufio.NewReader(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tfor i := 0; i < 4; i++ {\n\t\tI(&in[i], \"\\n\")\n\t}\n\tif check() {\n\t\treturn\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif in[i][j] == '.' {\n\t\t\t\ta := []rune(in[i])\n\t\t\t\ta[j] = 'x'\n\t\t\t\tin[i] = string(a)\n\t\t\t\tif check() {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ta[j] = '.'\n\t\t\t\tin[i] = string(a)\n\t\t\t}\n\t\t}\n\t}\n\tO(\"NO\", \"\\n\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst size = 4\nconst x = 'x'\nconst dot = '.'\n\nfunc checkVertical(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tif table[i][0] == x && table[i][1] == x && table[i][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[i][1] == x && table[i][2] == x && table[i][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkHorizontal(table [][]rune) bool {\n\tfor j := 0; j < size; j++ {\n\t\tif table[j][0] == x && table[j][1] == x && table[j][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[j][1] == x && table[j][2] == x && table[j][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkDiagonal(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tvar ii, jj int\n\n\t\t\tii = i + 2\n\t\t\tjj = j + 2\n\n\t\t\tif ii < size && jj < size && table[i][j] == x && table[i+1][j+1] == x && table[i+2][j+2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tii = i + 2\n\t\t\tjj = j - 2\n\n\t\t\tif ii < size && jj >= 0 && table[i][j] == x && table[i+1][j-1] == x && table[i+2][j-2] == x {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]rune, size)\n\n\tfor i := 0; i < size; i++ {\n\t\ttable[i] = make([]rune, size)\n\n\t\tvar row string\n\t\tfmt.Scanf(\"%s\\n\", &row)\n\n\t\tfor p, s := range row {\n\t\t\ttable[i][p] = s\n\t\t}\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif table[i][j] == dot {\n\t\t\t\ttable[i][j] = x\n\t\t\t\tif checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttable[i][j] = dot\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst size = 4\nconst x = 'x'\nconst dot = '.'\n\nfunc checkVertical(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tif table[i][0] == x && table[i][1] == x && table[i][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[i][1] == x && table[i][2] == x && table[i][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkHorizontal(table [][]rune) bool {\n\tfor j := 0; j < size; j++ {\n\t\tif table[j][0] == x && table[j][1] == x && table[j][2] == x {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[j][1] == x && table[j][2] == x && table[j][3] == x {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkDiagonal(table [][]rune) bool {\n\tif table[0][0] == x && table[1][1] == x && table[2][2] == x {\n\t\treturn true\n\t}\n\n\tif table[1][1] == x && table[2][2] == x && table[3][3] == x {\n\t\treturn true\n\t}\n\n\tif table[0][3] == x && table[1][2] == x && table[2][1] == x {\n\t\treturn true\n\t}\n\n\tif table[3][0] == x && table[2][1] == x && table[1][2] == x {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]rune, size)\n\n\tfor i := 0; i < size; i++ {\n\t\ttable[i] = make([]rune, size)\n\n\t\tvar row string\n\t\tfmt.Scanf(\"%s\\n\", &row)\n\n\t\tfor p, s := range row {\n\t\t\ttable[i][p] = s\n\t\t}\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif table[i][j] == dot {\n\t\t\t\ttable[i][j] = x\n\t\t\t\tif checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttable[i][j] = dot\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst size = 4\n\nfunc checkVertical(table [][]rune) bool {\n\tfor i := 0; i < size; i++ {\n\t\tif table[i][0] == 'X' && table[i][1] == 'X' && table[i][2] == 'X' {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[i][1] == 'X' && table[i][2] == 'X' && table[i][3] == 'X' {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkHorizontal(table [][]rune) bool {\n\tfor j := 0; j < size; j++ {\n\t\tif table[j][0] == 'X' && table[j][1] == 'X' && table[j][2] == 'X' {\n\t\t\treturn true\n\t\t}\n\n\t\tif table[j][1] == 'X' && table[j][2] == 'X' && table[j][3] == 'X' {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc checkDiagonal(table [][]rune) bool {\n\tif table[0][0] == 'X' && table[1][1] == 'X' && table[2][2] == 'X' {\n\t\treturn true\n\t}\n\n\tif table[1][1] == 'X' && table[2][2] == 'X' && table[3][3] == 'X' {\n\t\treturn true\n\t}\n\n\tif table[0][3] == 'X' && table[1][2] == 'X' && table[2][1] == 'X' {\n\t\treturn true\n\t}\n\n\tif table[3][0] == 'X' && table[2][1] == 'X' && table[1][2] == 'X' {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\ttable := make([][]rune, size)\n\n\tfor i := 0; i < size; i++ {\n\t\ttable[i] = make([]rune, size)\n\n\t\tvar row string\n\t\tfmt.Scanf(\"%s\\n\", &row)\n\n\t\tfor p, s := range row {\n\t\t\ttable[i][p] = s\n\t\t}\n\t}\n\n\tfor i := 0; i < size; i++ {\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif table[i][j] == '.' {\n\t\t\t\ttable[i][j] = 'X'\n\t\t\t\tif checkHorizontal(table) || checkVertical(table) || checkDiagonal(table) {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttable[i][j] = '.'\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}"}], "src_uid": "ca4a77fe9718b8bd0b3cc3d956e22917"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tsum := 0\n\thas_non_zero := false\n\n\tarray := make([]int, n)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; i < n && scanner.Scan(); i++ {\n\t\ta, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tarray[i] = a\n\t\tsum += a\n\t\tif a != 0 {\n\t\t\thas_non_zero = true\n\t\t}\n\t}\n\n\tif !has_non_zero {\n\t\tfmt.Println(\"NO\")\n\t} else if sum != 0 {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Println(\"1\\n1\", n)\n\t} else {\n\t\ts := 0\n\t\tbound := -1\n\t\tfor i := 0; i < n; i++ {\n\t\t\ts += array[i]\n\t\t\tif s != 0 {\n\t\t\t\tbound = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Println(2)\n\t\tfmt.Println(1, bound+1)\n\t\tfmt.Println(bound+2, n)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) {\n\tfmt.Fscanf(r, \"%v\"+delim, i)\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc main() {\n\tr = bufio.NewReader(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar n int\n\tI(&n, \"\\n\")\n\tin := make([]int, n)\n\tsum := 0\n\tstart := 1\n\tend := 1\n\tvar out [][2]int\n\tfor i, _ := range in {\n\t\tI(&in[i], \" \")\n\t\tsum += in[i]\n\t\tif sum != 0 {\n\t\t\tend = i + 1\n\t\t\tout = append(out, [2]int{start, end})\n\t\t\tstart = i + 2\n\t\t\tif i != n-1 {\n\t\t\t\tsum = 0\n\t\t\t}\n\t\t}\n\t}\n\tif sum == 0 && len(out) == 0 {\n\t\tO(\"NO\", \"\\n\")\n\t\treturn\n\t}\n\tif sum == 0 {\n\t\tout[len(out)-1][1] = n\n\t}\n\tO(\"YES\", \"\\n\")\n\tO(len(out), \"\\n\")\n\tfor _, o := range out {\n\t\tO(o[0], \" \")\n\t\tO(o[1], \"\\n\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc getArr() []int {\n\tvar (\n\t\tn int\n\t\tarr []int\n\t)\n\tif _, err := fmt.Scan(&n); err != nil {\n\t\tpanic(err)\n\t}\n\tarr = make([]int, n)\n\tfor i := range arr {\n\t\tif _, err := fmt.Scan(&arr[i]); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\treturn arr\n}\n\ntype Split struct {\n\tStart, End int\n\tNext, Prev *Split\n}\n\nfunc (split *Split) CalcSum() int {\n\tvar sum int\n\tfor i := split.Start; i < split.End; i++ {\n\t\tsum += arr[i]\n\t}\n\treturn sum\n}\n\nfunc (split *Split) Process() bool {\n\tfullSum := split.CalcSum()\n\tsaveEnd := split.End\n\tif fullSum == 0 {\n\t\tcurSum := 0\n\t\tfor i := split.Start; i < saveEnd; i++ {\n\t\t\tcurSum += arr[i]\n\t\t\tif curSum != 0 && (fullSum-curSum) != 0 {\n\t\t\t\tsplit.End = i + 1\n\t\t\t\trs := &Split{Start: i + 1, End: saveEnd}\n\t\t\t\trs.Next = split.Next\n\t\t\t\trs.Prev = split\n\t\t\t\tsplit.Next = rs\n\t\t\t\tif split.Process() && rs.Process() {\n\t\t\t\t\treturn true\n\t\t\t\t} else {\n\t\t\t\t\tsplit.Next = rs.Next\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc (split *Split) FirstSplit() *Split {\n\tfor split.Prev != nil {\n\t\tsplit = split.Prev\n\t}\n\treturn split\n}\n\nfunc (split *Split) Len() int {\n\tvar n int\n\tfor split != nil {\n\t\tsplit = split.Next\n\t\tn += 1\n\t}\n\treturn n\n}\n\nvar arr []int\n\nfunc main() {\n\tarr = getArr()\n\n\tspl := &Split{Start: 0, End: len(arr)}\n\n\tif spl.Process() {\n\t\tfmt.Println(\"YES\")\n\t\tfspl := spl.FirstSplit()\n\t\tfmt.Println(fspl.Len())\n\t\tfor fspl != nil {\n\t\t\tfmt.Println(fspl.Start+1, fspl.End)\n\t\t\tfspl = fspl.Next\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "//http://codeforces.com/contest/754/problem/A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar (\n\t\tn int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &n)\n\ta := make([]int, n)\n\n\tzeroes := true\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(input, &a[i])\n\n\t\tzeroes = zeroes && (a[i] == 0)\n\t\tsum += a[i]\n\t}\n\n\tif zeroes {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"YES\")\n\n\tif sum != 0 {\n\t\tfmt.Println(1)\n\t\tfmt.Println(1, n)\n\t\treturn\n\t}\n\n\tfmt.Println(\"2\")\n\tsum = 0\n\ti := 0\n\tfor sum == 0 {\n\t\tsum += a[i]\n\t\ti++\n\t}\n\n\tfmt.Println(1, i)\n\tfmt.Println(i + 1, n)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\ta := make([]int, n)\n\ttotal := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tif a[i] == 0 {\n\t\t\ttotal++\n\t\t}\n\t}\n\tif total == n {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tres := make([][]int, 0)\n\tfor i := 0; i < n; i++ {\n\t\tstart := i\n\t\tsum := a[i]\n\t\tfor sum == 0 && i+1 < n {\n\t\t\ti++\n\t\t\tsum += a[i]\n\t\t}\n\t\tfor i+1 < n && a[i+1] == 0 {\n\t\t\ti++\n\t\t\tsum += a[i]\n\t\t}\n\t\tif sum == 0 {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tres = append(res, []int{start + 1, i + 1})\n\t}\n\tfmt.Println(\"YES\")\n\tfmt.Println(len(res))\n\tfor _, v := range res {\n\t\tfmt.Println(v[0], v[1])\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main(){\n for true{\n var n int;\n if items,_:=fmt.Scan(&n);items==0{\n break;\n }\n var myVec []int;\n for i:=0;i 1 {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Println(len(res))\n\t\tfor _, v := range res {\n\t\t\tfmt.Println(v[0], v[1])\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "src_uid": "3a9258070ff179daf33a4515def9897a"} {"source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r:rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\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, 0)\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}\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc := NewScanner()\n\tk, r := sc.NextInt(), sc.NextInt()\n\tfor l := 1; l <= 10; l++ {\n\t\tg := k * l\n\t\tif g % 10 == 0 || g % 10 == r {\n\t\t\tfmt.Println(l)\n\t\t\treturn\n\t\t}\n\t}\n\n}", "positive_code": [{"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\tvar k, r int\n\tvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\t\n\tscanner.Scan()\n\tfmt.Sscanf(scanner.Text(), \"%d %d\", &k, &r)\n\t\n\tn := 1\n\tfor m := k % 10; m != 0 && m != r; m = (m + k) % 10 {\n\t\tn++\n\t}\n\t\n\tfmt.Print(n)\n}"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k,r int;\n\tfmt.Scan(&k, &r)\n\tfor i:=1; i<=10; i++ {\n\t\tsum := k * i\n\t\tif sum % 10 == 0 || sum % 10 == r {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc main() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar k int\n\tfor I(&k, \" \") == nil {\n\t\tsolve(k)\n\t}\n}\nfunc solve(k int) {\n\tvar r int\n\tI(&r, \"\\n\")\n\ti := 1\n\tfor k*i%10 != r && k*i%10 != 0 {\n\t\ti++\n\t}\n\tO(i, \"\\n\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n k, r := readInt(), readInt()\n for i := 1; i < 11; i++ {\n res := i*k % 10\n if res == r || res == 0 {\n fmt.Println(i)\n break\n }\n }\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar k, r int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &k, &r)\n\tfor i := 1; i <= 10; i++ {\n\t\tif k*i%10 == 0 || (k*i-r)%10 == 0 {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc solution(k int, r int) int {\n\tfor x := 1; x <= 20; x++ {\n\t\tp := x * k\n\t\tif (p%10 == 0) || (p%10 == r) {\n\t\t\treturn x\n\t\t}\n\t}\n\treturn 10\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar k, r int\n\tfmt.Fscanf(bufin, \"%d %d\\n\", &k, &r)\n\n\tfmt.Fprintf(bufout, \"%d\\n\", solution(k, r))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var k, r int\n fmt.Scanf(\"%d %d\", &k, &r)\n for n := 1; ; n++ {\n a := n * k\n b := a - r\n if a % 10 == 0 || b % 10 == 0 {\n fmt.Printf(\"%d\\n\", n)\n return\n }\n }\n}\n"}, {"source_code": "// codeforces project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tk, r int\n)\n\nfunc main() {\n\tfmt.Scan(&k, &r)\n\tvar i int = 1\n\ttmp := k\n\tfor ; (k-r)%10 != 0; i++ {\n\t\tif k%10 == 0 {\n\t\t\tbreak\n\t\t}\n\t\tk += tmp\n\t}\n\tfmt.Println(i)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int16\n\tfmt.Scan(&k, &r)\n\tvar i int16\n\tfor i = 1; i <= 10; i++ {\n\t\tif i * k % 10 == r || i * k % 10 == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(i)\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\nfunc min(a, b int) int {\n if a < b {\n return a\n }\n return b\n}\n\nfunc main() {\n in := bufio.NewReader(os.Stdin)\n\n // your code here\n var k, r int\n fmt.Fscanf(in, \"%d %d\\n\", &k, &r)\n amount := k\n for amount % 10 != 0 && amount % 10 != r {\n amount += k\n }\n fmt.Println(amount / k)\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scanf(\"%d %d \\n\", &k, &r)\n\tsol := 1\n\tfor (sol*k)%10 != 0 && (sol*k)%10 != r {\n\t\tsol++\n\t}\n\tfmt.Print(sol)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar k string\n\tvar r int\n\tfmt.Scanf(\"%s %d\\n\", &k, &r)\n\tunitDigit, _ := strconv.Atoi(string(k[len(k)-1]))\n\tfor i := 1; i <= 9; i++ {\n\t\tx := strconv.Itoa(unitDigit * i)\n\t\tnewUnitDigit, _ := strconv.Atoi(string(x[len(x)-1]))\n\t\t// fmt.Println(unitDigit, i, x, newUnitDigit, r)\n\t\tif newUnitDigit == r || newUnitDigit == 0 {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc getString() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\treturn sc.Text()\n}\n\nfunc main() {\n\tstr := getString()\n\tar := strings.Split(str, \" \")\n\tk, _ := strconv.Atoi(ar[0])\n\tr, _ := strconv.Atoi(ar[1])\n\ti := 1\n\tif dec := k%10; dec != 0 {\n\t\ttmp := dec\n\t\tfor {\n\t\t\tif tmp%10 == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn \n\t\t\t}\n\t\t\tif tmp-r == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t\ttmp = dec * i\n\t\t\t\tif tmp > 10 {\n\t\t\t\t\ttmp = tmp % 10\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(i)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k int\n\tvar r int\n\tfmt.Scanf(\"%d %d\", &k, &r)\n\n\tfor i := 1; i < 10; i++ {\n\t\tif (k*i)%10 == r || (k*i)%10 == 0 {\n\t\t\tfmt.Printf(\"%d\\n\", i)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", 10)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar k, r int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &k, &r)\n\tsum := 0\n\ti := 0\n\tfor ; ; i++ {\n\t\tsum += k\n\t\tif sum%10 == 0 || sum%10 == r {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(i + 1)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scan(&k, &r)\n\tvar cnt = 1\n\tvar remain = k % 10\n\tfor remain != r && remain != 0 {\n\t\tremain = (k + remain) % 10\n\t\tcnt++\n\t}\n\tfmt.Print(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar k, r int\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(reader, &k)\n\tfmt.Fscan(reader, &r)\n\tbuyNumber := 1\n\tfor {\n\t\tif (buyNumber*k)%10 == 0 {\n\t\t\tbreak\n\t\t} else if (((buyNumber * k) % 10) - r) == 0 {\n\t\t\tbreak\n\t\t}\n\t\tbuyNumber++\n\t}\n\tfmt.Println(buyNumber)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scanf(\"%d %d\", &k, &r)\n\n\ti := 1\n\tfor {\n\t\ttmp := i * k\n\t\tif tmp%10 == 0 || tmp%10 == r {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t\ti++\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r, mod uint\n\tfmt.Scan(&k, &r)\n\tmod = k % 10\n\tfor i := uint(1); i <= 9; i++ {\n\t\tif (i*mod%10) == r || (i*mod%10) == 0 {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/732/A\n// A. Buy a Shovel\n// time limit per test\n// 1 second\n// memory limit per test\n// 256 megabytes\n// input\n// standard input\n// output\n// standard output\n\n// Polycarp urgently needs a shovel! He comes to the shop and chooses an appropriate one. The shovel that Policarp chooses is sold for k burles. Assume that there is an unlimited number of such shovels in the shop.\n\n// In his pocket Polycarp has an unlimited number of \"10-burle coins\" and exactly one coin of r burles (1\u2009\u2264\u2009r\u2009\u2264\u20099).\n\n// What is the minimum number of shovels Polycarp has to buy so that he can pay for the purchase without any change? It is obvious that he can pay for 10 shovels without any change (by paying the requied amount of 10-burle coins and not using the coin of r burles). But perhaps he can buy fewer shovels and pay without any change. Note that Polycarp should buy at least one shovel.\n// Input\n\n// The single line of input contains two integers k and r (1\u2009\u2264\u2009k\u2009\u2264\u20091000, 1\u2009\u2264\u2009r\u2009\u2264\u20099) \u2014 the price of one shovel and the denomination of the coin in Polycarp's pocket that is different from \"10-burle coins\".\n\n// Remember that he has an unlimited number of coins in the denomination of 10, that is, Polycarp has enough money to buy any number of shovels.\n// Output\n\n// Print the required minimum number of shovels Polycarp has to buy so that he can pay for them without any change.\n\nfunc main() {\n\tvar k, r int\n\t_, _ = fmt.Scan(&k, &r)\n\n\tnShovles := 1\n\tfor {\n\t\tprice := nShovles * k\n\n\t\tmod := price % 10\n\t\tif mod == 0 || mod == r {\n\t\t\tbreak\n\t\t}\n\t\tnShovles++\n\t}\n\n\tfmt.Print(nShovles)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/732/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0414\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u043d\u0435\u0442 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\n// \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u043b-\u0432\u0443\n// \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430 \u043b\u0438\u0441\u0442\u043e\u0447\u043a\u0435 \u0438 \u0432\u044b\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0439\nfunc taskSolution(k int, r int) int {\n\tcounts := [][]int{\n\t\t{1, 1, 1, 1, 1, 1, 1, 1, 1}, // k%10 = 0\n\t\t{1, 2, 3, 4, 5, 6, 7, 8, 9}, // k%10 = 1\n\t\t{5, 1, 5, 2, 5, 3, 5, 4, 5}, // k%10 = 2\n\t\t{7, 4, 1, 8, 5, 2, 9, 6, 3}, // k%10 = 3\n\t\t{5, 3, 5, 1, 5, 4, 5, 2, 5}, // k%10 = 4\n\t\t{2, 2, 2, 2, 1, 2, 2, 2, 2}, // k%10 = 5\n\t\t{10, 2, 5, 4, 5, 1, 5, 3, 5}, // k%10 = 6\n\t\t{3, 6, 9, 2, 5, 8, 1, 4, 7}, // k%10 = 7\n\t\t{5, 4, 5, 3, 5, 2, 5, 1, 5}, // k%10 = 8\n\t\t{9, 8, 7, 6, 5, 4, 3, 2, 1}, // k%10 = 9\n\t}\n\n\treturn counts[k%10][r-1]\n}\n\nfunc main() {\n\tvar k, r int\n\tif _, err := fmt.Scan(&k, &r); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(k, r))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar priceOfShovel int\n\tfmt.Scan(&priceOfShovel)\n\tvar change int\n\tfmt.Scan(&change)\n\tsumOfShovels := 1\n\tshovelPrice := 0\n\tactualPrice := 0\n\tcount := 1\n\tfor index := 0; index < count; index++ {\n\t\tshovelPrice = priceOfShovel * count\n\t\tactualPrice = shovelPrice % 10\n\n\t\tif actualPrice == change || actualPrice == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tsumOfShovels = sumOfShovels + 1\n\t\tcount++\n\t}\n\tfmt.Print(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scanf(\"%d %d\", &k, &r)\n\tfor i := 1; i <= 9; i++ {\n\t\tif k*i%10 == 0 || k*i%10 == r {\n\t\t\tfmt.Println(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tvar k, r int = ReadInt32(), ReadInt32()\n\n\tfor i := 1; i <= 10; i++ {\n\t\tif k*i%10 == r || k*i%10 == 0 {\n\t\t\tPrintInts(i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tk, r int\n)\n\nfunc main() {\n\tfmt.Scan(&k, &r)\n\n\tif (k-r)%10 == 0 {\n\t\tprintln(1)\n\t} else {\n\t\tvar i int\n\t\ttmp := k\n\t\tm := (k - r) % 10\n\t\tfor i = 1; m != 0; i++ {\n\t\t\tk += tmp\n\t\t\tm = (k - r) % 10\n\t\t}\n\t\tprintln(i)\n\t}\n}\n"}, {"source_code": "// codeforces project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tk, r int\n)\n\nfunc main() {\n\tfmt.Scan(&k, &r)\n\tvar i int = 1\n\ttmp := k\n\tfor ; (k-r)%10 != 0; i++ {\n\t\tif k%10 == 0 {\n\t\t\tbreak\n\t\t}\n\t\tk += tmp\n\t}\n\tprintln(i)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar k string\n\tvar r int\n\tfmt.Scanf(\"%s %d\\n\", &k, &r)\n\tunitDigit, _ := strconv.Atoi(string(k[len(k)-1]))\n\tflag := false\n\tfor i := 0; i <= 9; i++ {\n\t\tx := strconv.Itoa(unitDigit * i)\n\t\tnewUnitDigit, _ := strconv.Atoi(string(x[len(x)-1]))\n\t\t// fmt.Println(unitDigit, i, x, newUnitDigit, r)\n\t\tif newUnitDigit == r {\n\t\t\tfmt.Println(i)\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\tfmt.Println(r)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc getString() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\treturn sc.Text()\n}\n\nfunc main() {\n\tstr := getString()\n\tar := strings.Split(str, \" \")\n\tk, _ := strconv.Atoi(ar[0])\n\tr, _ := strconv.Atoi(ar[1])\n\tif dec := k%10; dec != 0 {\n\t\ti := 1\n\t\tfor {\n\t\t\tif dec%r == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn \n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t\tdec = dec * i\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(1)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, r int\n\tfmt.Scan(&k, &r)\n\tvar cnt = 1\n\tvar remain = k % 10\n\tfor remain != r && remain == 0 {\n\t\tremain = (k + remain) % 10\n\t\tcnt++\n\t}\n\tfmt.Print(cnt)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/732/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0414\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0445 \u043c\u043e\u043d\u0435\u0442 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442\n// \u0441\u0442\u0440\u043e\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u043b-\u0432\u0443\n// \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u041f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430 \u043b\u0438\u0441\u0442\u043e\u0447\u043a\u0435 \u0438 \u0432\u044b\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0439\nfunc taskSolution(k int, r int) int {\n\tcounts := [][]int{\n\t\t// r = 1 2 3 4 5 6 7 8 9\n\t\t{1, 1, 1, 1, 1, 1, 1, 1, 1}, // k%10 = 0\n\t\t{1, 2, 3, 4, 5, 6, 7, 8, 9}, // k%10 = 1\n\t\t{5, 1, 5, 2, 5, 3, 5, 4, 5}, // k%10 = 2\n\t\t{7, 4, 1, 8, 5, 2, 9, 6, 3}, // k%10 = 3\n\t\t{5, 3, 5, 1, 5, 4, 5, 2, 5}, // k%10 = 4\n\t\t{2, 2, 2, 2, 2, 2, 2, 2, 2}, // k%10 = 5\n\t\t{10, 2, 5, 4, 5, 1, 5, 3, 5}, // k%10 = 6\n\t\t{3, 6, 9, 2, 5, 8, 1, 4, 7}, // k%10 = 7\n\t\t{5, 4, 5, 3, 5, 2, 5, 1, 5}, // k%10 = 8\n\t\t{9, 8, 7, 6, 5, 4, 3, 2, 1}, // k%10 = 9\n\t}\n\n\treturn counts[k%10][r-1]\n}\n\nfunc main() {\n\tvar k, r int\n\tif _, err := fmt.Scan(&k, &r); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(k, r))\n}\n"}], "src_uid": "18cd1cd809df4744bb7bcd7cad94e2d3"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n if a > b {\n return a \n }\n return b\n}\n\nfunc available(a, b int) int {\n if a > b {\n dif := a - b\n if dif%2 == 0 {\n return dif/2\n } else {\n return (dif - 1)/2\n }\n }\n return 0\n}\n\nfunc main() {\n var a, b, c, x, y, z int\n fmt.Scan(&a, &b, &c, &x, &y, &z)\n\n needed := max(0, x-a) + max(0, y-b) + max(0, z-c)\n ava := available(a, x) + available(b, y) + available(c, z)\n\n if needed > ava {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\") \n }\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tstdin := bufio.NewReader(os.Stdin)\n\n\tvar a, b, c int\n\tvar tA, tB, tC int\n\t\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &a, &b, &c)\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &tA, &tB, &tC)\n\n\ta = a - tA\n\tb = b - tB\n\tc = c - tC\n\n\t// fmt.Println(a, b, c)\n\n\tif a < 0 {\n\t\ta = a * 2\n\t} else {\n\t\ta = a / 2 * 2\n\t}\n\tif b < 0 {\n\t\tb = b * 2\n\t} else {\n\t\tb = b / 2 * 2\n\t}\n\tif c < 0 {\n\t\tc = c * 2\n\t} else {\n\t\tc = c / 2 * 2\n\t}\n\n\tif a + b + c >= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar (\n\t\ta int\n\t\tb int\n\t\tc int\n\t\tx int\n\t\ty int\n\t\tz int\n\t)\n\tfmt.Scanf(\"%d %d %d \",&a,&b,&c)\n\tfmt.Scanf(\"%d %d %d \",&x,&y,&z)\n\tif (x > a){\n\t\tx -= a\n\t\ta = 0\n\t}else {\n\t\ta -= x\n\t\tx = 0\n\t}\n\tif (y > b){\n\t\ty -= b\n\t\tb = 0\n\t}else {\n\t\tb -= y\n\t\ty = 0\n\t}\n\tif (z > c){\n\t\tz -= c\n\t\tc = 0\n\t}else {\n\t\tc -= z\n\t\tz = 0\n\t}\n\tif (x + y + z) <= (a/2 + b/2 + c/2){\n\t\tfmt.Print(\"Yes\")\n\t}else {\n\t\tfmt.Print(\"No\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b [3]int\n // fmt.Println(i)\n fmt.Scanf(\"%d %d %d\\n\", &a[0], &a[1], &a[2])\n fmt.Scanf(\"%d %d %d\\n\", &b[0], &b[1], &b[2])\n acnt, bcnt := 0, 0\n for i := 0; i < 3; i++ {\n if a[i]-b[i] > 0 {\n acnt += (((a[i] - b[i]) / 2) * 2)\n } else {\n bcnt += (b[i] - a[i])\n }\n }\n //fmt.Println(acnt)\n //fmt.Println(bcnt)\n if acnt/2 >= bcnt {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a [3]int\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &a[0], &a[1], &a[2]); err != nil {\n\t\treturn\n\t}\n\tvar x [3]int\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &x[0], &x[1], &x[2]); err != nil {\n\t\treturn\n\t}\n\n\tvar d [3]int\n\tneg := 0\n\tfor i := 0; i < 3; i++ {\n\t\td[i] = a[i] - x[i]\n\t\tif d[i] < 0 {\n\t\t\tneg += d[i]\n\t\t}\n\t}\n\n\tfor neg < 0 {\n\t\tok := false\n\t\tfor i := 0; i < 3; i++ {\n\t\t\tif d[i] >= 2 {\n\t\t\t\tneg++\n\t\t\t\td[i] -= 2\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !ok {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c, x, y, z int\n fmt.Scanf(\"%d%d%d\\n\",&a,&b,&c);\n fmt.Scanf(\"%d%d%d\\n\",&x,&y,&z);\n aa := a - x\n if (aa > 0) {\n aa /= 2\n }\n bb := b - y\n if (bb > 0) {\n bb /= 2\n }\n cc := c - z\n if (cc > 0) {\n cc /= 2\n }\n\n ans := aa + bb + cc\n\n if ans >= 0 {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\tvar addA = a - x\n\tvar addB = b - y\n\tvar addC = c - z\n\tvar add int\n\tvar minus int\n\tif addA > 0 {\n\t\tadd += addA / 2\n\t} else {\n\t\tminus += addA\n\t}\n\tif addB > 0 {\n\t\tadd += addB / 2\n\t} else {\n\t\tminus += addB\n\t}\n\tif addC > 0 {\n\t\tadd += addC / 2\n\t} else {\n\t\tminus += addC\n\t}\n\tif add+minus >= 0 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar (\n\t\ta int\n\t\tb int\n\t\tc int\n\t\tx int\n\t\ty int\n\t\tz int\n\t)\n\tfmt.Scanf(\"%d%d%d\",&a,&b,&c)\n\tfmt.Scanf(\"%d%d%d\",&x,&y,&z)\n\tif (x > a){\n\t\tx -= a\n\t\ta = 0\n\t}else {\n\t\ta -= x\n\t\tx = 0\n\t}\n\tif (y > b){\n\t\ty -= b\n\t\tb = 0\n\t}else {\n\t\tb -= y\n\t\ty = 0\n\t}\n\tif (z > c){\n\t\tz -= c\n\t\tc = 0\n\t}else {\n\t\tc -= z\n\t\tz = 0\n\t}\n\tif (x + y + z) <= (a/2 + b/2 + c/2){\n\t\tfmt.Println(\"Yes\")\n\t}else {\n\t\tfmt.Println(\"No\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar (\n\t\ta int\n\t\tb int\n\t\tc int\n\t\tx int\n\t\ty int\n\t\tz int\n\t)\n\tfmt.Scanf(\"%d%d%d\",&a,&b,&c)\n\tfmt.Scanf(\"%d%d%d\",&x,&y,&z)\n\tif (x > a){\n\t\tx -= a\n\t\ta = 0\n\t}else {\n\t\ta -= x\n\t\tx = 0\n\t}\n\tif (y > b){\n\t\ty -= b\n\t\tb = 0\n\t}else {\n\t\tb -= y\n\t\ty = 0\n\t}\n\tif (z > c){\n\t\tz -= c\n\t\tc = 0\n\t}else {\n\t\tc -= z\n\t\tz = 0\n\t}\n\tif (x + y + z) <= (a/2 + b/2 + c/2){\n\t\tfmt.Print(\"Yes\")\n\t}else {\n\t\tfmt.Print(\"No\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b [3]int\n for i := 0; i < 3; i++ {\n // fmt.Println(i)\n fmt.Scanf(\"%d\", &a[i])\n }\n for i := 0; i < 3; i++ {\n fmt.Scanf(\"%d\", &b[i])\n }\n acnt, bcnt := 0, 0\n for i := 0; i < 3; i++ {\n if a[i]-b[i] > 0 {\n acnt += (((a[i] - b[i]) / 2) * 2)\n } else {\n bcnt += (b[i] - a[i])\n }\n }\n //fmt.Println(acnt)\n //fmt.Println(bcnt)\n if acnt/2 >= bcnt {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tstdin := bufio.NewReader(os.Stdin)\n\n\tvar a, b, c int\n\tvar tA, tB, tC int\n\t\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &a, &b, &c)\n\tfmt.Fscanf(stdin, \"%d%d%d\\n\", &tA, &tB, &tC)\n\n\ta = a - tA\n\tb = b - tB\n\tc = c - tC\n\n\t// fmt.Println(a, b, c)\n\n\tif a < 0 {\n\t\ta = a * 2\n\t}\n\tif b < 0 {\n\t\tb = b * 2\n\t}\n\tif c < 0 {\n\t\tc = c * 2\n\t}\n\n\tif a + b + c >= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n"}], "src_uid": "1db4ba9dc1000e26532bb73336cf12c3"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Vertex struct {\n\tneighbors []*Vertex\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tg1 := make([][]*Vertex, n)\n\tg2 := make([][]*Vertex, n)\n\tfor i := range g1 {\n\t\tg1[i] = make([]*Vertex, m)\n\t\tg2[i] = make([]*Vertex, m)\n\t\tfor j := range g1[i] {\n\t\t\tg1[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t\tg2[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t}\n\t}\n\tvar horizon, vertical string\n\tfmt.Scanf(\"%s\\n\", &horizon)\n\tfmt.Scanf(\"%s\\n\", &vertical)\n\tfor i, c := range horizon {\n\t\tif c == '>' {\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j+1]\n\t\t\t}\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j-1]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j-1]\n\t\t\t}\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j+1]\n\t\t\t}\n\t\t}\n\t}\n\tfor j, c := range vertical {\n\t\tif c == 'v' {\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i+1][j]\n\t\t\t}\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i-1][j]\n\t\t\t}\n\t\t} else {\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i-1][j]\n\t\t\t}\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i+1][j]\n\t\t\t}\n\n\t\t}\n\t}\n\tif dfs(g1) && dfs(g2) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc dfs(g [][]*Vertex) bool {\n\tvisited := make(map[*Vertex]struct{})\n\tv := g[0][0]\n\tdfsRecurse(v, visited)\n\treturn len(visited) == len(g) * len(g[0])\n\n}\n\nfunc dfsRecurse(v *Vertex, visited map[*Vertex]struct{}) {\n\tvisited[v] = struct{}{}\n\tfor _, n := range v.neighbors {\n\t\tif n == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := visited[n]; !ok {\n\t\t\tdfsRecurse(n, visited)\n\t\t}\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n := ReadInt32()\n m := ReadInt32()\n s1 := ReadString()\n s2 := ReadString()\n count := n * m\n a := make([][]int, count)\n for i := 0; i < count; i++ {\n a[i] = make([]int, count)\n a[i][i] = 1\n }\n\n for i := 0; i < m; i++ {\n if s2[i] == 'v' {\n for j := 0; j < n-1; j++ {\n for k := j + 1; k < n; k++ {\n a[j*m+i][k*m+i] = 1\n }\n }\n } else {\n for j := n - 1; j > 0; j-- {\n for k := j - 1; k >= 0; k-- {\n a[j*m+i][k*m+i] = 1\n }\n }\n }\n }\n\n for i := 0; i < n; i++ {\n if s1[i] == '>' {\n for j := 0; j < m-1; j++ {\n for k := j + 1; k < m; k++ {\n a[i*m+j][i*m+k] = 1\n }\n }\n } else {\n for j := m - 1; j > 0; j-- {\n for k := j - 1; k >= 0; k-- {\n a[i*m+j][i*m+k] = 1\n }\n }\n }\n }\n\n for k := 0; k < count; k++ {\n for i := 0; i < count; i++ {\n for j := 0; j < count; j++ {\n if a[i][k] == 1 && a[k][j] == 1 {\n a[i][j] = 1\n }\n }\n }\n }\n\n f := true\n\n for i := 0; (i < count) && (f); i++ {\n for j := 0; (j < count) && (f); j++ {\n f = a[i][j] != 0\n }\n }\n\n if f {\n writer.WriteString(\"YES\\n\")\n } else {\n writer.WriteString(\"NO\\n\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tvar rows, cols string\n\tfmt.Scan(&rows)\n\tfmt.Scan(&cols)\n\tvar tl, tr, bl, br bool\n\n\tfor i := 0; i < n; i++ {\n\t\tvar direction = rows[i]\n\t\tif i == 0 {\n\t\t\tswitch direction {\n\t\t\tcase '>':\n\t\t\t\ttr = true\n\t\t\tcase '<':\n\t\t\t\ttl = true\n\t\t\t}\n\t\t}\n\t\tif i == n-1 {\n\t\t\tswitch direction {\n\t\t\tcase '>':\n\t\t\t\tbr = true\n\t\t\tcase '<':\n\t\t\t\tbl = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tvar direction = cols[i]\n\t\tif i == 0 {\n\t\t\tswitch direction {\n\t\t\tcase 'v':\n\t\t\t\tbl = true\n\t\t\tcase '^':\n\t\t\t\ttl = true\n\t\t\t}\n\t\t}\n\t\tif i == m-1 {\n\t\t\tswitch direction {\n\t\t\tcase 'v':\n\t\t\t\tbr = true\n\t\t\tcase '^':\n\t\t\t\ttr = true\n\t\t\t}\n\t\t}\n\t}\n\tif tl && tr && bl && br {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nvar (\n n, m, count int\n row, col string\n visited []bool\n)\n\nfunc dfs(i, j int) {\n index := i*m + j\n if i < 0 || j < 0 || i >= n || j >= m || visited[index] {\n return\n }\n\n visited[index] = true\n\n if row[i] == '>' {\n dfs(i, j+1)\n } else {\n dfs(i, j-1)\n }\n\n if col[j] == 'v' {\n dfs(i+1, j)\n } else {\n dfs(i-1, j)\n }\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n = ReadInt32()\n m = ReadInt32()\n row = ReadString()\n col = ReadString()\n count = n * m\n f := true\n\n for i := 0; (i < n) && (f); i++ {\n for j := 0; (j < m) && (f); j++ {\n visited = make([]bool, count)\n dfs(i, j)\n for k := 0; (k < count) && (f); k++ {\n f = visited[k]\n }\n }\n }\n\n if f {\n writer.WriteString(\"YES\\n\")\n } else {\n writer.WriteString(\"NO\\n\")\n }\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype Vertex struct {\n\tneighbors []*Vertex\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tg1 := make([][]*Vertex, n)\n\tg2 := make([][]*Vertex, n)\n\tfor i := range g1 {\n\t\tg1[i] = make([]*Vertex, m)\n\t\tg2[i] = make([]*Vertex, m)\n\t\tfor j := range g1[i] {\n\t\t\tg1[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t\tg2[i][j] = &Vertex{neighbors: make([]*Vertex, 2)}\n\t\t}\n\t}\n\n\tvar horizon, vertical string\n\tfmt.Scanf(\"%s %s\", &horizon, &vertical)\n\tfor i, c := range horizon {\n\t\tif c == '>' {\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j+1]\n\t\t\t}\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j-1]\n\t\t\t}\n\t\t} else {\n\t\t\tfor j := 1; j < m; j++ {\n\t\t\t\tg1[i][j].neighbors[0] = g1[i][j-1]\n\t\t\t}\n\t\t\tfor j := 0; j < m-1; j++ {\n\t\t\t\tg2[i][j].neighbors[0] = g2[i][j+1]\n\t\t\t}\n\t\t}\n\t}\n\tfor j, c := range vertical {\n\t\tif c == 'v' {\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i+1][j]\n\t\t\t}\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i-1][j]\n\t\t\t}\n\t\t} else {\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tg1[i][j].neighbors[1] = g1[i-1][j]\n\t\t\t}\n\t\t\tfor i := 0; i < n-1; i++ {\n\t\t\t\tg2[i][j].neighbors[1] = g2[i+1][j]\n\t\t\t}\n\n\t\t}\n\t}\n\tif dfs(g1) && dfs(g2) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc dfs(g [][]*Vertex) bool {\n\tvisited := make(map[*Vertex]struct{})\n\tv := g[0][0]\n\tdfsRecurse(v, visited)\n\treturn len(visited) == len(g) * len(g[0])\n\n}\n\nfunc dfsRecurse(v *Vertex, visited map[*Vertex]struct{}) {\n\tvisited[v] = struct{}{}\n\tfor _, n := range v.neighbors {\n\t\tif n == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := visited[n]; !ok {\n\t\t\tdfsRecurse(n, visited)\n\t\t}\n\t}\n}\n"}], "src_uid": "eab5c84c9658eb32f5614cd2497541cf"} {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nvar n int\n\nfunc main() {\n fmt.Scan(&n)\n sqt := math.Sqrt(float64(n))\n hight := int(sqt)\n width := 0\n if hight*hight == n {\n width = hight\n } else {\n width = hight + 1\n if hight*width < n {\n hight += 1\n }\n }\n fmt.Println(hight*2 + width*2)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfor i := 1; ; i++ {\n\t\tif i*i >= n {\n\t\t\tfmt.Println(4 * i)\n\t\t\treturn\n\t\t}\n\t\tif i*(i+1) >= n {\n\t\t\tfmt.Println(4*i + 2)\n\t\t\treturn\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc roundUp(x float64) int {\n\treturn int(math.Floor(x + 1))\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tif sqrt := math.Sqrt(float64(n)); int(sqrt)*int(sqrt) == n {\n\t\tfmt.Println(int(sqrt) * 4)\n\t\tos.Exit(0)\n\t} else {\n\t\tx := roundUp(sqrt)\n\t\ty := x\n\t\tfor {\n\t\t\tif x*y == n {\n\t\t\t\tbreak\n\t\t\t} else if x*y < n {\n\t\t\t\tx++\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tx--\n\t\t}\n\t\tfmt.Println(x*2 + y*2)\n\t\tos.Exit(0)\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar (\n n, a, b int\n)\n\nfunc main() {\n fmt.Scan(&n)\n a , b = 1, 1\n for a * b < n {\n a++\n if a > b {\n a, b = b, a\n }\n }\n fmt.Println(2*(a+b))\n}\n"}], "negative_code": [], "src_uid": "414cc57550e31d98c1a6a56be6722a12"} {"source_code": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar n int\n\tvar s string\n\n\tfmt.Fscanf(bufin, \"%d\\n\", &n)\n\tfmt.Fscanf(bufin, \"%s\\n\", &s)\n\n\tvar res []int\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == 'B' {\n\t\t\tj := i\n\t\t\tfor (j < n) && (s[j] == 'B') {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tres = append(res, j-i)\n\t\t\ti = j - 1\n\t\t}\n\t}\n\n\tfmt.Fprintf(bufout, \"%d\\n\", len(res))\n\tfor _, v := range res {\n\t\tfmt.Fprintf(bufout, \"%d \", v)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar str string\n\tfmt.Scanf(\"%d\\n%s\", &n, &str)\n\n\tvar counter int\n\tvar answer []int\n\tfor i := 0; i <= n; i++ {\n\t\tif (i == n || (i != 0 && str[i-1] != str[i])) && counter != 0 {\n\t\t\tanswer = append(answer, counter)\n\t\t\tcounter = 0\n\t\t}\n\t\tif i < n && str[i] == 'B' {\n\t\t\tcounter++\n\t\t}\n\t}\n\n\tfmt.Println(len(answer))\n\tfor _, a := range answer {\n\t\tfmt.Printf(\"%d \", a)\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n groups := make([]int, n)\n var s string\n fmt.Scan(&s)\n s += \"W\"\n var lastRune rune = 'W'\n var groupCnt int\n var curGroup int\n for _, r := range s {\n if r == 'B' {\n curGroup++\n if lastRune == 'W' {\n groupCnt++\n }\n lastRune = 'B'\n } else if r == 'W' {\n if lastRune == 'B' {\n groups[groupCnt-1] = curGroup\n }\n lastRune = 'W'\n curGroup = 0\n }\n }\n fmt.Print(groupCnt, \"\\n\")\n for i:=0; i < groupCnt; i++ {\n fmt.Print(groups[i], \" \")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN := fsc.NextInt()\n\t_ = N\n\tstr := fsc.Next()\n\tvar ans []int\n\tvar res int\n\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == 'B' {\n\t\t\tres++\n\t\t} else {\n\t\t\tif res > 0 {\n\t\t\t\tans = append(ans, res)\n\t\t\t}\n\t\t\tres = 0\n\t\t}\n\t}\n\tif res > 0 {\n\t\tans = append(ans, res)\n\t}\n\tfmt.Println(len(ans))\n\tfor i := 0; i < len(ans); i++ {\n\t\tfmt.Print(ans[i], \" \")\n\t}\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) 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\tpanic(err.Error())\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"regexp\"\n \"strings\"\n)\n\nfunc main() {\n var n int\n fmt.Scanln(&n)\n \n var str string\n fmt.Scanln(&str)\n re := regexp.MustCompile(\"(W)*\")\n\tstr = re.ReplaceAllString(str, \"$1\")\n\t\n\tblocks := strings.Split(str, \"W\")\n if len(blocks) > 0 {\n if len(blocks[0]) == 0 {\n blocks = append(blocks[1:])\n }\n if len(blocks[len(blocks) - 1]) == 0 {\n blocks = append(blocks[:len(blocks)-1])\n }\n }\n fmt.Println(len(blocks))\n for _, block := range blocks {\n fmt.Printf(\"%v \", len(block))\n }\n}"}, {"source_code": "// A. One-dimensional Japanese Crossword\n/*\nRecently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a\u2009\u00d7\u2009b squares, and each square is colored white or black. There are integers to the left of the rows and to the top of the columns, encrypting the corresponding row or column. The number of integers represents how many groups of black squares there are in corresponding row or column, and the integers themselves represents the number of consecutive black squares in corresponding group (you can find more detailed explanation in Wikipedia https://en.wikipedia.org/wiki/Japanese_crossword).\n\nAdaltik decided that the general case of japanese crossword is too complicated and drew a row consisting of n squares (e.g. japanese crossword sized 1\u2009\u00d7\u2009n), which he wants to encrypt in the same way as in japanese crossword.\n\nHelp Adaltik find the numbers encrypting the row he drew.\n\nInput\nThe first line of the input contains a single integer n (1\u2009\u2264\u2009n\u2009\u2264\u2009100) \u2014 the length of the row. The second line of the input contains a single string consisting of n characters 'B' or 'W', ('B' corresponds to black square, 'W' \u2014 to white square in the row that Adaltik drew).\n\nOutput\nThe first line should contain a single integer k \u2014 the number of integers encrypting the row, e.g. the number of groups of black squares in the row.\n\nThe second line should contain k integers, encrypting the row, e.g. corresponding to sizes of groups of consecutive black squares in the order from left to right.\nExamples\n\nInput\n3\nBBW\n\nOutput\n1\n2\n\nInput\n5\nBWBWB\n\nOutput\n3\n1 1 1\n\nInput\n4\nWWWW\n\nOutput\n0\n\nInput\n4\nBBBB\n\nOutput\n1\n4\n\nInput\n13\nWBBBBWWBWBBBW\n\nOutput\n3\n4 1 3\n\nNote\nThe last sample case correspond to the picture in the statement.\n*/\npackage 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\tinput1, _ := reader.ReadString('\\n')\n\tn, _ := strconv.Atoi(strings.TrimSpace(input1))\n\n\tinput2, _ := reader.ReadString('\\n')\n\ta := strings.TrimSpace(input2)\n\n\tk, g := 0, 0\n\tarrK := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 'B' {\n\t\t\tk++\n\t\t} else if k > 0 {\n\t\t\tg++\n\t\t\tarrK = append(arrK, k)\n\t\t\tk = 0\n\t\t}\n\t}\n\n\tif k > 0 {\n\t\tg++\n\t\tarrK = append(arrK, k)\n\t\tk = 0\n\t}\n\n\tfmt.Println(g)\n\n\tfor _, v := range arrK {\n\t\tfmt.Printf(\"%v \", v)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n, &s)\n\n\tseq := []int{}\n\tfor i, v := range s {\n\t\tif v == 'B' {\n\t\t\tif i == 0 || s[i-1] == 'W' {\n\t\t\t\tseq = append(seq, 0)\n\t\t\t}\n\t\t\tseq[len(seq)-1]++\n\t\t}\n\t}\n\n\tfmt.Println(len(seq))\n\tif len(seq) == 0 {\n\t\treturn\n\t}\n\tfor i, v := range seq {\n\t\tif i != 0 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Print(v)\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "// http://acm.timus.ru/problem.aspx?space=1&num=1741\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst MOD = 1e9 + 7\n\nfunc main () {\n\tvar n int\n\tvar str string\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &n)\n\tfmt.Fscanln(input, &str)\n\n\n\n\tcnt := 0\n\tans := make([]int, 0)\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == 'W' {\n\t\t\tif cnt > 0 {\n\t\t\t\tans = append(ans, cnt)\n\t\t\t\tcnt = 0\n\t\t\t}\n\t\t} else {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt > 0 {\n\t\tans = append(ans, cnt)\n\t}\n\n\n\tfmt.Println(len(ans))\n\tfor i := 0; i < len(ans); i++ {\n\t\tif i != 0 {\n\t\t\tfmt.Print(\" \", ans[i])\n\t\t} else {\n\t\t\tfmt.Print(ans[i])\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\treader.ReadString('\\n')\n\tcs, _ := reader.ReadString('\\n')\n\n\tcodes := []string{}\n\tb := 0\n\tfor _, c := range strings.TrimSpace(cs) {\n\t\tif c == 'B' {\n\t\t\tb++\n\t\t} else {\n\t\t\tif b > 0 {\n\t\t\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t\t\t\tb = 0\n\t\t\t}\n\t\t}\n\t}\n\tif b > 0 {\n\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t}\n\n\tif len(codes) > 0 {\n\t\tfmt.Fprintln(os.Stdout, len(codes))\n\t\tfmt.Fprintln(os.Stdout, strings.Join(codes, \" \"))\n\t} else {\n\t\tfmt.Fprintln(os.Stdout, 0)\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar str string\n\tfmt.Scanf(\"%d\\n%s\", &n, &str)\n\n\tvar counter int\n\tvar answer []int\n\tfor i := 0; i <= n; i++ {\n\t\tif (i == n || (i != 0 && str[i-1] != str[i])) && counter != 0 {\n\t\t\tanswer = append(answer, counter)\n\t\t\tcounter = 0\n\t\t}\n\t\tif i < n && str[i] == 'B' {\n\t\t\tcounter++\n\t\t}\n\t}\n\n\tfmt.Println(len(answer))\n\tfor _, a := range answer {\n\t\tfmt.Printf(\"%d \", a)\n\t}\n\tfmt.Println()\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\treader.ReadString('\\n')\n\tcs, _ := reader.ReadString('\\n')\n\n\tcodes := []string{}\n\tb := 0\n\tfor _, c := range strings.TrimSpace(cs) {\n\t\tif c == 'B' {\n\t\t\tb++\n\t\t} else {\n\t\t\tif b > 0 {\n\t\t\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t\t\t\tb = 0\n\t\t\t}\n\t\t}\n\t}\n\tif b > 0 {\n\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t}\n\n\tif len(codes) > 0 {\n\t\tfmt.Println(strings.Join(codes, \" \"))\n\t} else {\n\t\tfmt.Println(0)\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\treader.ReadString('\\n')\n\tcs, _ := reader.ReadString('\\n')\n\n\tcodes := []string{}\n\tb := 0\n\tfor _, c := range strings.TrimSpace(cs) {\n\t\tif c == 'B' {\n\t\t\tb++\n\t\t} else {\n\t\t\tif b > 0 {\n\t\t\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t\t\t\tb = 0\n\t\t\t}\n\t\t}\n\t}\n\tif b > 0 {\n\t\tcodes = append(codes, fmt.Sprintf(\"%d\", b))\n\t}\n\n\tif len(codes) > 0 {\n\t\tfmt.Fprintln(os.Stdout, strings.Join(codes, \" \"))\n\t} else {\n\t\tfmt.Fprintln(os.Stdout, 0)\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar str string\n\tfmt.Scanf(\"%d\\n%s\", &n, &str)\n\n\tvar counter int\n\tfor i := 0; i <= n; i++ {\n\t\tif (i == n || (i != 0 && str[i-1] != str[i])) && counter != 0 {\n\t\t\tfmt.Printf(\"%d \", counter)\n\t\t\tcounter = 0\n\t\t}\n\t\tif i < n && str[i] == 'B' {\n\t\t\tcounter++\n\t\t}\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\t//fmt.Scanf(\"%d%d\",&n, &k)\n\tscanner.Split(bufio.ScanWords)\n\tvar row string\n\tvar length, index int\n\tvar arr [100]int\n\t_ = ReadInt32()\n\tfmt.Scanf(\"%s\", &row)\n\tfor i := 0; i < len(row); i++ {\n\t\tif row[i] == 'B' {\n\t\t\tlength++\n\t\t} else if row[i] != 'B' && length > 0 {\n\t\t\tarr[index] = length\n\t\t\tindex++\n\t\t\tlength = 0\n\t\t}\n\t}\n\tif length != 0 {\n\t\tarr[index] = length\n\t\tindex++\n\t}\n\tfmt.Printf(\"%d\", index)\n\tif index > 0 {\n\t\tfmt.Printf(\"\\n%d\", arr[0])\n\t}\n\tfor i := 1; i < index; i++ {\n\t\tfmt.Printf(\" %d\", arr[i])\n\t}\n\tfmt.Printf(\"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\t//fmt.Scanf(\"%d%d\",&n, &k)\n\tscanner.Split(bufio.ScanWords)\n\tvar row string\n\tvar length, index int\n\tvar arr [100]int\n\t_ = ReadInt32()\n\tfmt.Scanf(\"%s\", &row)\n\tfor i := 0; i < len(row); i++ {\n\t\tif row[i] == 'B' {\n\t\t\tlength++\n\t\t} else if row[i] != 'B' && length > 0 {\n\t\t\tarr[index] = length\n\t\t\tindex++\n\t\t\tlength = 0\n\t\t}\n\t}\n\tif length != 0 {\n\t\tarr[index] = length\n\t\tindex++\n\t}\n\tfmt.Printf(\"%d\", index)\n\tif index > 0 {\n\t\tfmt.Printf(\"\\n%d\", arr[0])\n\t}\n\tfor i := 1; i < index; i++ {\n\t\tfmt.Printf(\" %d\", arr[i])\n\t}\n\tfmt.Printf(\"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc PrintInts(ints ...int) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(value))\n\t\twriter.WriteByte(' ')\n\t}\n}\n\nfunc main() {\n\t//fmt.Scanf(\"%d%d\",&n, &k)\n\tscanner.Split(bufio.ScanWords)\n\tvar row string\n\tvar length, index int\n\tvar arr [100]int\n\t_ = ReadInt32()\n\tfmt.Scanf(\"%s\", &row)\n\tfor i := 0; i < len(row); i++ {\n\t\tif row[i] == 'B' {\n\t\t\tlength++\n\t\t} else if row[i] != 'B' && length > 0 {\n\t\t\tarr[index] = length\n\t\t\tindex++\n\t\t\tlength = 0\n\t\t}\n\t}\n\tif length != 0 {\n\t\tarr[index] = length\n\t\tindex++\n\t}\n\tfmt.Println(index)\n\tfor i := 0; i < index; i++ {\n\t\tfmt.Println(arr[i], \" \")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN := fsc.NextInt()\n\t_ = N\n\tstr := fsc.Next()\n\tvar ans []int\n\tvar res int\n\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == 'B' {\n\t\t\tres++\n\t\t} else {\n\t\t\tif res > 0 {\n\t\t\t\tans = append(ans, res)\n\t\t\t}\n\t\t\tres = 0\n\t\t}\n\t}\n\tfmt.Println(len(ans))\n\tfor i := 0; i < len(ans); i++ {\n\t\tfmt.Print(ans[i], \" \")\n\t}\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) 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\tpanic(err.Error())\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"}], "src_uid": "e4b3a2707ba080b93a152f4e6e983973"} {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\n//import \"strconv\"\n\nfunc main(){\n\tvar n string\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn = r.Text()\n\tl := len(n)\n\tif l < 3 || (l == 3 && n < \"128\") {\n\t\tw.WriteString(\"byte\")\n\t} else if l < 5 || (l == 5 && n < \"32768\") {\n\t\tw.WriteString(\"short\")\n\t} else if l < 10 || (l == 10 && n < \"2147483648\") {\n\t\tw.WriteString(\"int\")\n\t} else if l < 19 || (l == 19 && n < \"9223372036854775808\") {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n", "positive_code": [{"source_code": "// 66A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x string\n\tfmt.Scan(&x)\n\tif len(x) < 3 || (len(x) == 3 && x <= \"127\") {\n\t\tfmt.Print(\"byte\")\n\t} else if len(x) < 5 || (len(x) == 5 && x <= \"32767\") {\n\t\tfmt.Print(\"short\")\n\t} else if len(x) < 10 || (len(x) == 10 && x <= \"2147483647\") {\n\t\tfmt.Print(\"int\")\n\t} else if len(x) < 19 || (len(x) == 19 && x <= \"9223372036854775807\") {\n\t\tfmt.Print(\"long\")\n\t} else {\n\t\tfmt.Print(\"BigInteger\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x string\n\tfmt.Scan(&x)\n\tif len(x) < 3 || (len(x) == 3 && x <= \"127\") {\n\t\tfmt.Print(\"byte\")\n\t} else if len(x) < 5 || (len(x) == 5 && x <= \"32767\") {\n\t\tfmt.Print(\"short\")\n\t} else if len(x) < 10 || (len(x) == 10 && x <= \"2147483647\") {\n\t\tfmt.Print(\"int\")\n\t} else if len(x) < 19 || (len(x) == 19 && x <= \"9223372036854775807\") {\n\t\tfmt.Print(\"long\")\n\t} else {\n\t\tfmt.Print(\"BigInteger\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tif n <= 127 {\n\t\tw.WriteString(\"byte\")\n\t} else if n <= 32767 {\n\t\tw.WriteString(\"short\")\n\t} else if n <= 2147483647 {\n\t\tw.WriteString(\"int\")\n\t} else if n <= 9223372036854775807 {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n float64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseFloat(r.Text(), 64)\n\tif n >=0 {\n\t\tw.WriteString(\"byte\")\n\t} else if n >= 128 {\n\t\tw.WriteString(\"short\")\n\t} else if n >= 32768 {\n\t\tw.WriteString(\"int\")\n\t} else if n >= 2147483648 {\n\t\tw.WriteString(\"long\")\n\t} else if n >= 9223372036854775808 {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\n//import \"strconv\"\n\nfunc main(){\n\tvar n string\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn = r.Text()\n\tl := len(n)\n\tif n >= \"0\" && n < \"128\" && l <= 3 {\n\t\tw.WriteString(\"byte\")\n\t} else if n >= \"128\" && n < \"32768\" && l <= 5 {\n\t\tw.WriteString(\"short\")\n\t} else if n >= \"32768\" && n < \"2147483648\" && l <= 10 {\n\t\tw.WriteString(\"int\")\n\t} else if n >= \"2147483648\" && n < \"9223372036854775808\" && l <= 19 {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n float64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseFloat(r.Text(), 64)\n\tif n <= 127 {\n\t\tw.WriteString(\"byte\")\n\t} else if n <= 32767 {\n\t\tw.WriteString(\"short\")\n\t} else if n <= 2147483647 {\n\t\tw.WriteString(\"int\")\n\t} else if n <= 9223372036854775807 {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\n//import \"strconv\"\n\nfunc main(){\n\tvar n string\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn = r.Text()\n\tl := len(n)\n\tif n >= \"0\" && n < \"128\" && l <= 3 {\n\t\tw.WriteString(\"byte\")\n\t} else if n >= \"128\" && n < \"32768\" && l <= 5 {\n\t\tw.WriteString(\"short\")\n\t} else if n >= \"32768\" && n < \"2147483648\" && l <= 10 {\n\t\tw.WriteString(\"int\")\n\t} else if n >= \"2147483648\" && n < \"9223372036854775808\" && l <= 19 {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n float64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseFloat(r.Text(), 64)\n\tif n == 9223372036854775808 {\n\t\tw.WriteString(\"BigInteger\")\n\t} else if n <= 127 {\n\t\tw.WriteString(\"byte\")\n\t} else if n <= 32767 {\n\t\tw.WriteString(\"short\")\n\t} else if n <= 2147483647 {\n\t\tw.WriteString(\"int\")\n\t} else if n <= 9223372036854775807 {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\n\nfunc main(){\n\tvar n string\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn = r.Text()\n\tif n <= \"127\" {\n\t\tw.WriteString(\"byte\")\n\t} else if n <= \"32767\" {\n\t\tw.WriteString(\"short\")\n\t} else if n <= \"2147483647\" {\n\t\tw.WriteString(\"int\")\n\t} else if n <= \"9223372036854775807\" {\n\t\tw.WriteString(\"long\")\n\t} else {\n\t\tw.WriteString(\"BigInteger\")\n\t}\n\tw.WriteString(\"\\n\")\n\tw.Flush()\n}\n"}], "src_uid": "33041f1832fa7f641e37c4c638ab08a1"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\ta, b := Calculate854A(n)\n\tfmt.Print(a, b)\n}\n\nfunc Calculate854A(n int) (int, int) {\n\tvar maxA = 0\n\tvar maxB = 0\n\tfor i := 1; i < n; i++ {\n\t\tvar a = i\n\t\tvar b = n - i\n\t\tif a >= b {\n\t\t\tbreak\n\t\t}\n\t\tif Gcd(a, b) == 1 {\n\t\t\tmaxA = a\n\t\t\tmaxB = b\n\t\t}\n\t}\n\treturn maxA, maxB\n}\n\nfunc Gcd(a int, b int) (int) {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc gcd(a int, b int) int {\n if b == 0 {\n return a\n }\n if a < b {\n return gcd(b, a)\n } else {\n return gcd(b, a%b)\n }\n}\n\nvar num int\n\nfunc main() {\n fmt.Scan(&num)\n div := num / 2\n for i := div; div >= 1; i-- {\n if gcd(i, num-i) == 1 {\n fmt.Println(i, num-i)\n break\n }\n }\n}"}, {"source_code": "// cf854a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a, b int\n\tfor i := n / 2; ; i-- {\n\t\ta = i\n\t\tb = n - a\n\t\tflag := true\n\t\tfor j := a; j > 1; j-- {\n\t\t\tif a%j == 0 && b%j == 0 {\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\tbreak\n\t\t}\n\t}\n\tfmt.Println(a, b)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(a int32,b int32)(int32){\n\n\tif(b==0) {\n\t\treturn a\n\t}else {\n\t\treturn gcd(b,a%b)\n\t}\n}\n\nfunc main(){\n\n\tvar n int32\n\tfmt.Scanf(\"%d\",&n)\n\tvalue:=float64(0)\n\tvar x,y int32\n\tfor i:=int32(1);i<=1000;i++{\n\t\tfor j:=int32(i);j<=1000;j++{\n\t\t\tif(i+j==n&&gcd(i,j)==1){\n\t\t\t\tvar a,b float64\n\t\t\t\ta=float64(i)\n\t\t\t\tb=float64(j)\n\t\t\t\ttvalue:=a/b\n\t\t\t\tif(tvalue>value){\n\t\t\t\t\tx=int32(a)\n\t\t\t\t\ty=int32(b)\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\",x,y)\n\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc vzaimnoProst(a, b int) bool {\n\treturn gcd(a, b) == 1\n}\n\nfunc gcd(a, b int) int {\n\tfor a != b {\n\t\tif a > b {\n\t\t\ta -= b\n\t\t} else {\n\t\t\tb -= a\n\t\t}\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n%2 == 0 {\n\t\ta = n/2 - 1\n\t\tb = n/2 + 1\n\t} else {\n\t\ta = n / 2\n\t\tb = n/2 + 1\n\t}\n\tfor !vzaimnoProst(a, b) {\n\t\ta--\n\t\tb++\n\t}\n\tfmt.Println(a, b)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\n\tfor a := N / 2; a >= 1; a-- {\n\t\tif gcd(a, N-a) == 1 {\n\t\t\tfmt.Println(a, N-a)\n\t\t\treturn\n\t\t}\n\t}\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, 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"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, x, a, b int\n\tfmt.Scan(&n)\n\tfor x = n / 2; x > 0; x-- {\n\t\tfor a, b = n-x, x; b != 0; {\n\t\t\ta, b = b, a%b\n\t\t}\n\t\tif a == 1 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(x, n-x)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc nod(a, b int) int {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfor a := n / 2; a > 0; a-- {\n\t\tb := n - a\n\t\tif nod(a, b) == 1 {\n\t\t\tfmt.Println(a, b)\n\t\t\treturn\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\ta, b := Calculate854A(n)\n\tfmt.Print(a, b)\n}\n\nfunc Calculate854A(n int) (int, int) {\n\tfor a := n / 2; a > 0; a-- {\n\t\tvar b = n - a\n\t\tif Gcd(a, b) == 1 {\n\t\t\treturn a, b\n\t\t}\n\t}\n\treturn 0, 0\n}\n\nfunc Gcd(a int, b int) (int) {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\tif a < b {\n\t\treturn gcd(b, a)\n\t} else {\n\t\treturn gcd(b, a%b)\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfor i := n/2; i >= 1; i-- {\n\t\tif gcd(i, n-i) == 1 {\n\t\t\tfmt.Println(i, n-i)\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tansA := 0\n\tansB := 0\n\tfor i := 1; i <= n; i++ {\n\t\ta := i\n\t\tb := n - i\n\t\tif a < b {\n\t\t\tok := true\n\t\t\tfor j := 2; j <= a; j++ {\n\t\t\t\tif a%j == 0 && b%j == 0 {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tansA = a\n\t\t\t\tansB = b\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ansA, ansB)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int;\n\tfmt.Scan(&n);\n\tvar an, bn int = 0, 1;\n\tvar ch bool;\n\tfor i := 1; i <= n / 2; i++ {\n\n\t\tb := n - i;\n\t\tif b < i {\n\t\t\tbreak;\n\t\t}\n\t\tch = true;\n\t\tfor a := 2; a <= i; a++ {\n\t\t\tif (i % a == 0) && (b % a == 0) {\n\t\t\t\tch = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ch && bn * i > an * b {\n\t\t\tan, bn = i, b;\n\t\t}\n\t}\n\tfmt.Print(an,\" \" , bn);\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\tfmt.Scan(&n)\n\ta, b := Calculate854A(n)\n\tfmt.Print(a, b)\n}\n\nfunc Calculate854A(n int) (int, int) {\n\tvar maxA = 0\n\tvar maxB = 0\n\tfor i := 1; i < n; i++ {\n\t\tvar a = i\n\t\tvar b = n - i\n\t\tif a >= b {\n\t\t\tbreak\n\t\t}\n\t\tif Gcd(a, b) != 0 {\n\t\t\tmaxA = a\n\t\t\tmaxB = b\n\t\t}\n\t}\n\treturn maxA, maxB\n}\n\nfunc Gcd(a int, b int) (int) {\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a, b int\n\tif n %2 == 0{\n\t\ta = n/2-1\n\t\tb = n/2+1\n\t} else {\n\t\ta = n/2\n\t\tb = n/2+1\n\t}\n\tfmt.Println(a, \" \", b)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tansA := 0\n\tansB := 0\n\tfor i := 1; i <= n; i++ {\n\t\ta := i\n\t\tb := n - i\n\t\tif a < b {\n\t\t\tok := true\n\t\t\tfor j := 2; j < a; j++ {\n\t\t\t\tif a%j == 0 && b%j == 0 {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tansA = a\n\t\t\t\tansB = b\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d\\n\", ansA, ansB)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport ()\n\nfunc main() {\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc vzaimnoProst(a, b int) bool {\n\treturn gcd(a, b) == 1\n}\n\nfunc gcd(a, b int) int {\n\tfor a != b {\n\t\tif a > b {\n\t\t\ta -= b\n\t\t} else {\n\t\t\tb -= a\n\t\t}\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar a, b, n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n%2 == 0 {\n\t\ta = n/2 - 1\n\t\tb = n/2 + 1\n\t} else {\n\t\ta = n / 2\n\t\tb = n/2 + 1\n\t}\n\tfor !vzaimnoProst(a, b) {\n\t\ta++\n\t\tb--\n\t}\n\tfmt.Println(a, b)\n}"}], "src_uid": "0af3515ed98d9d01ce00546333e98e77"} {"source_code": "\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar helper SHelper\n\nfunc main() {\n\thelper.Init()\n\tn := helper.ReadInt64()\n\tl := n / 10\n\tr := n % 10\n\tif r == 0 {\n\t\tfmt.Println(n)\n\t} else if r <= 5 {\n\t\tfmt.Println(l * 10)\n\t} else {\n\t\tfmt.Println((l + 1) * 10)\n\t}\n}\n\ntype SHelper struct {\n\tfile *os.File\n\tscanner *bufio.Scanner\n}\n\nfunc (this *SHelper) Init() {\n\tthis.file = os.Stdin\n\tthis.scanner = bufio.NewScanner(this.file)\n\tthis.scanner.Split(bufio.ScanWords)\n}\n\nfunc (this *SHelper) ReadInt64() int64 {\n\tthis.scanner.Scan()\n\tn, err:= strconv.ParseInt(this.scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tv := n % 10\n\tif v > 5 {\n\t\tn += 10 - v\n\t} else {\n\t\tn -= v\n\t}\n\tfmt.Println(n)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n uint64\n fmt.Scan(&n)\n last := n%10\n if last <= 5 {\n n = n - last\n } else {\n n = n + (10 - last)\n }\n fmt.Print(n)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n ans := 10 * (n / 10)\n if n % 10 > 5 {\n ans += 10\n }\n fmt.Println(ans)\n}\n\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var n uint64\n fmt.Scan(&n)\n if n%10 > 5 {\n fmt.Print(n+(10-(n%10)))\n } else {\n fmt.Print(n-(n%10))\n }\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n n = n - n%10\n fmt.Print(n)\n}"}], "src_uid": "29c4d5fdf1328bbc943fa16d54d97aa9"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// 6\n// 100011\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tsum := 0\n\tvar x string\n\tfmt.Scanln(&x)\n\tfor i := 0; i < n; i++ {\n\t\tif x[i] == '0' {\n\t\t\tsum++\n\t\t} else {\n\t\t\tsum--\n\t\t}\n\t}\n\tif sum == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Printf(\"%s %c\", x[0:len(x)-1], x[len(x)-1])\n\t} else {\n\t\tfmt.Println(1)\n\t\tfmt.Println(x)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a string\n\tvar n, cnt int\n\t// var x float64\n\t// var s string\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&a)\n\tm := make(map[string]int)\n\n\tm = count(a, m)\n\n\tif m[\"1\"] == m[\"0\"] {\n\t\tcnt = 2\n\t} else {\n\t\tcnt = 1\n\t}\n\n\tfmt.Println(cnt)\n\n\tif cnt == 2 {\n\t\tfor x := range a {\n\t\t\tm2 := make(map[string]int)\n\t\t\tm1 := make(map[string]int)\n\t\t\tif x > 0 {\n\t\t\t\tm2 = count(a[:x], m2)\n\t\t\t\tm1 = count(a[x:], m1)\n\t\t\t\tif (m2[\"1\"] != m2[\"0\"]) && (m1[\"0\"] != m1[\"1\"]) {\n\t\t\t\t\tfmt.Println(a[:x], \" \", a[x:])\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\tfmt.Println(a)\n\t}\n}\n\nfunc count(a string, m map[string]int) map[string]int {\n\tfor _, y := range a {\n\t\tm[string(y)]++\n\t}\n\treturn m\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n scanner.Scan()\n str := scanner.Text()\n\n count := 0\n for _, ch := range str {\n if ch == '1' {\n count++\n } else {\n count--\n }\n }\n if count != 0 {\n fmt.Printf(\"1\\n%v\\n\", str)\n } else {\n fmt.Printf(\"2\\n%c %v\\n\", str[0], str[1:len(str)])\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&s)\n\to := 0\n\tl := 0\n\tfor _, r := range s {\n\t\tif r == '0' {\n\t\t\to++\n\t\t} else {\n\t\t\tl++\n\t\t}\n\t}\n\tif l != o {\n\t\tfmt.Println(1)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tfmt.Println(2)\n\tfmt.Println(string(s[0]), string(s[1:]))\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n int\n\tvar str string\n\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&str)\n\n\tl:=0\n\tr:=0\n\n\tfor _,s:=range str{\n\t\tif s=='0'{\n\t\t\tl++\n\t\t} else {\n\t\t\tr++;\n\t\t}\n\t}\n\tif l!=r{\n\t\tfmt.Println(1);\n\t\tfmt.Println(str);\n\t\treturn;\n\t}\n\tfmt.Println(2);\n\tfmt.Println(string(str[0]),string(str[1:]))\n\n\n\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tvar x string\n\tfmt.Scanln(&x)\n\tdiff := 0\n\tfor _, c := range x {\n\t\tif c == '0' {\n\t\t\tdiff++\n\t\t} else {\n\t\t\tdiff--\n\t\t}\n\t}\n\tif diff == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Print(string(x[0]), \" \")\n\t\tfor i, c := range x {\n\t\t\tif i == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Print(string(c))\n\t\t}\n\t} else {\n\t\tfmt.Println(1)\n\t\tfmt.Println(x)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar count int\n\tvar number string\n\n\tfmt.Scan(&count, &number)\n\n\tif strings.Count(number, \"0\") == strings.Count(number, \"1\") {\n\t\tfmt.Println(\"2\")\n\t\tfmt.Print(number[:len(number)-1], \" \", string(number[len(number)-1]))\n\t} else {\n\t\tfmt.Println(\"1\")\n\t\tfmt.Print(number)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, cnt0, cnt1 int32\n\tfmt.Scanf(\"%d\\n\", &n)\n\tvar str string\n\tfmt.Scanf(\"%s\\n\", &str)\n\n\tfor _, c := range(str) {\n\t\tif c == '0' {\n\t\t\tcnt0 ++\n\t\t} else {\n\t\t\tcnt1 ++\n\t\t}\n\t}\n\tif (cnt0 != cnt1) {\n\t\tfmt.Println(1)\n\t\tfmt.Println(str)\n\t} else {\n\t\tfmt.Println(2)\n\t\tfmt.Println(str[0:1], str[1:])\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// 800\n//https://codeforces.com/problemset/problem/1189/A\n\nfunc main() {\n\tvar v []byte\n\tfmt.Scanln(&v)\n\tfmt.Scanln(&v)\n\tvar ones, zeros int\n\tfor _, k := range v {\n\t\tif k == '1' {\n\t\t\tones++\n\t\t} else {\n\t\t\tzeros++\n\t\t}\n\t}\n\tif ones != zeros {\n\t\tfmt.Println(\"1\")\n\t\tfmt.Println(string(v))\n\t} else {\n\t\tfmt.Println(\"2\")\n\t\tfmt.Println(string(v[0]), string(v[1:]))\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc retCount(str string) (int, int) {\n\tone := strings.Count(str, \"1\")\n\tzero := strings.Count(str, \"0\")\n\treturn one, zero\n}\n\nfunc check(str string) bool {\n\tone, zero := retCount(str)\n\tif one == zero {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc main() {\n\tvar n, i int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tif check(s) {\n\t\tfmt.Println(1)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tif n%2 == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Println(s[:n-1] + \" \" + s[n-1:])\n\t} else {\n\t\tfor i = 1; i < n; i++ {\n\t\t\tif check(s[:i]) && check(s[i:]) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i != n {\n\t\t\tfmt.Println(2)\n\t\t\tfmt.Println(s[:i] + \" \" + s[i:])\n\t\t} else {\n\t\t\tfmt.Println(3)\n\t\t\tfmt.Println(s[:n-2] + \" \" + s[n-2:n-1] + \" \" + s[n-1:n])\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc right(n int, stroka string) int {\n\tvar one int = 0\n\tvar zero int = 0\n\tfor i := 0; i < n; i++ {\n\t\tif stroka[i] == '1' {\n\t\t\tone += 1\n\t\t} else if stroka[i] == '0' {\n\t\t\tzero += 1\n\t\t}\n\t}\n\tif one == zero {\n\t\treturn 2\n\t} else {\n\t\treturn 1\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tvar stroka string\n\tfmt.Scan(&n)\n\tfmt.Scan(&stroka)\n\tif n%2 == 1 {\n\t\tfmt.Println(1)\n\t\tfmt.Println(stroka)\n\t} else {\n\t\tfmt.Println(right(n, stroka))\n\t\tif right(n, stroka) == 1 {\n\t\t\tfmt.Println(stroka)\n\t\t} else {\n\t\t\tfmt.Println(stroka[:1], stroka[1:])\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tvar c int\n\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfmt.Scanf(\"%s\", &s)\n\n\tfor _, v := range s {\n\t\tif v == 49 {\n\t\t\tc++\n\t\t}\n\t}\n\n\tif c*2 == len(s) {\n\t\tfmt.Println(2)\n\t\tfmt.Println(s[:len(s)-1], s[len(s)-1:])\n\t} else {\n\t\tfmt.Println(1)\n\t\tfmt.Println(s)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var n int\n var s string\n fmt.Scan(&n)\n fmt.Scan(&s)\n c := strings.Count(s, \"1\")\n if 2 * c != n {\n fmt.Printf(\"1\\n%s\\n\", s)\n } else {\n fmt.Printf(\"2\\n%s %s\\n\", s[:1], s[1:])\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n int\n\t_,_=fmt.Scanln(&n)\n\tvar s string\n\t_,_=fmt.Scanln(&s)\n\tcnt1,cnt2:=0,0\n\tfor _,v:=range s {\n\t\tif v == '1' {\n\t\t\tcnt1++\n\t\t} else {\n\t\t\tcnt2++\n\t\t}\n\t}\n\tif cnt1 == cnt2 {\n\t\tfmt.Println(2)\n\t\tfmt.Printf(\"%s %c\\n\",s[0:n-1],s[n-1])\n\t}else{\n\t\tfmt.Println(1)\n\t\tfmt.Println(s)\n\t}\n}"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1189/problem/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(n int, s string) []string {\n\tones := 0\n\tzeros := 0\n\tfor _, char := range s {\n\t\tif string(char) == \"1\" {\n\t\t\tones += 1\n\t\t} else {\n\t\t\tzeros += 1\n\t\t}\n\t}\n\tif ones != zeros {\n\t\treturn []string{s}\n\t}\n\treturn []string{string(s[0]), s[1:]}\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\n\tsolution := Solve(n, s)\n\tfmt.Fprintf(writer, \"%d\\n\", len(solution))\n\tfor i := 0; i < len(solution); i++ {\n\t\tfmt.Fprintf(writer, \"%s \", solution[i])\n\t}\n\tfmt.Fprintf(writer, \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar read = bufio.NewReader(os.Stdin)\n\tvar write = bufio.NewWriter(os.Stdout)\n\tdefer write.Flush()\n\tvar n int\n\tfmt.Fscan(read, &n)\n\tvar s string\n\tfmt.Fscan(read, &s)\n\tif n%2 == 1 {\n\t\tfmt.Fprintln(write, 1)\n\t\tfmt.Fprint(write, s)\n\t\treturn\n\t}\n\tvar a = strings.Split(s, \"\")\n\tvar n1, n0 int\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == \"1\" {\n\t\t\tn1++\n\t\t} else {\n\t\t\tn0++\n\t\t}\n\t}\n\tif n1 != n0 {\n\t\tfmt.Fprintln(write, 1)\n\t\tfmt.Fprint(write, s)\n\t\treturn\n\t}\n\tfmt.Fprintln(write, 2)\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fprint(write, a[i])\n\t}\n\tfmt.Fprint(write, \" \", a[n-1])\n\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n str := scanner.Text()\n\n count := 0\n for _, ch := range str {\n if ch == '1' {\n count++\n } else {\n count--\n }\n }\n if count != 0 {\n fmt.Printf(\"1\\n%v\\n\", str)\n } else {\n fmt.Printf(\"2\\n%c %v\\n\", str[0], str[1:len(str)])\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tif n%2 == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Println(s[:n/2] + \" \" + s[n/2:])\n\t} else {\n\t\tfmt.Println(3)\n\t\tfmt.Println(s[:n/2] + \" \" + s[n/2:n/2+1] + \" \" + s[n/2+1:])\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc retCount(str string) (int, int) {\n\tone := strings.Count(str, \"1\")\n\tzero := strings.Count(str, \"0\")\n\treturn one, zero\n}\n\nfunc main() {\n\tvar n, i int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tif n%2 == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Println(s[:n/2] + \" \" + s[n/2:])\n\t} else {\n\t\tfor i = 1; i < n; i++ {\n\t\t\tone, zero := retCount(s[1:])\n\t\t\tif one != zero {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i != n {\n\t\t\tfmt.Println(2)\n\t\t\tfmt.Println(s[:i] + \" \" + s[i:])\n\t\t} else {\n\t\t\tfmt.Println(3)\n\t\t\tfmt.Println(s[:n/2] + \" \" + s[n/2:n/2+1] + \" \" + s[n/2+1:])\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc retCount(str string) (int, int) {\n\tone := strings.Count(str, \"1\")\n\tzero := strings.Count(str, \"0\")\n\treturn one, zero\n}\n\nfunc check(str string) bool {\n\tone, zero := retCount(str)\n\tif one == zero {\n\t\treturn false\n\t} else {\n\t\treturn true\n\t}\n}\n\nfunc main() {\n\tvar n, i int\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tif n == 1 {\n\t\tfmt.Println(n)\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tif n%2 == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Println(s[:n-1] + \" \" + s[n-1:])\n\t} else {\n\t\tfor i = 1; i < n; i++ {\n\t\t\tif check(s[:i]) && check(s[i:]) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i != n {\n\t\t\tfmt.Println(2)\n\t\t\tfmt.Println(s[:i] + \" \" + s[i:])\n\t\t} else {\n\t\t\tfmt.Println(3)\n\t\t\tfmt.Println(s[:n-2] + \" \" + s[n-2:n-1] + \" \" + s[n-1:n])\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc right(n int, stroka string) int {\n\tvar one int = 0\n\tvar zero int = 0\n\tfor i := 0; i < n; i++ {\n\t\tif stroka[i] == '1' {\n\t\t\tone += 1\n\t\t} else if stroka[i] == '0' {\n\t\t\tzero += 1\n\t\t}\n\t}\n\tif one == zero {\n\t\treturn 2\n\t} else {\n\t\treturn 1\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tvar stroka string\n\tfmt.Scan(&n)\n\tfmt.Scan(&stroka)\n\tif n%2 == 1 {\n\t\tfmt.Println(1)\n\t\tfmt.Println(stroka)\n\t} else {\n\t\tfmt.Println(right(n, stroka))\n\t\tfmt.Println(stroka[:1], stroka[1:])\n\t}\n}\n"}], "src_uid": "4ebed264d40a449602a26ceef2e849d1"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, k int\n fmt.Scan(&n, &k)\n ballonByColor := make([]int, 256)\n var str string\n fmt.Scan(&str)\n for _, r := range str {\n ballonByColor[int(r)]++\n }\n for i:=0; i<256; i++ {\n if ballonByColor[i] > k {\n fmt.Print(\"NO\")\n return\n }\n }\n fmt.Print(\"YES\")\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar balls string\n\tvar n,k int\n\n\tfmt.Scan(&n, &k, &balls)\n\n\tcolors := make(map[rune]int,0)\n\n\tfor _,clr := range balls {\n\t\tcolors[clr]++\n\t}\n\n\tfor _,num := range colors {\n\t\tif num > k {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"YES\")\n}"}, {"source_code": "package main\n\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\treadInt(reader)\n\tk := readInt(reader)\n\tskipLine(reader)\n\n\ta := make(map[byte]int, 26)\n\ts := readLine(reader)\n\n\t//fmt.Printf(\"*s:%v\\n\", *s)\n\n\tfor i := 0; ik {\n\t\t\tok = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\nfunc readLine(nr *bufio.Reader) *string {\n\tline, _, err := nr.ReadLine()\n\tif err!=nil {\n\t\tpanic(err)\n\t}\n\ts := string(line)\n\treturn &s\n}\n\nfunc skipLine(nr *bufio.Reader) {\n\t_, _, err := nr.ReadLine()\n\tif err!=nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc readInt(nr *bufio.Reader) int {\n\tvar a int\n\tfmt.Fscan(nr, &a)\n\treturn a\n}\n\nfunc readA(n int) *[]int {\n\ta := make([]int, n)\n\n\treader := bufio.NewReader(os.Stdin)\n\n\tfor i := 0; i k {\n isPossible = false\n break\n } \n }\n \n if isPossible {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\n/*\n The idea to solve this problem is by noticing that we need to make sure\n that each friends given baloon by Kefa doesn't get same color more than once. \n Which means the number of baloon of for each color must be the same number\n of Kefa friends or less (because his friends won't be angry if they do not get\n baloon)\n*/\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n)\n\nfunc main() {\n var n, k int\n var baloons string\n var m = make(map[string]int)\n \n stdin := bufio.NewReader(os.Stdin)\n fmt.Fscanf(stdin, \"%d %d\\n\", &n, &k)\n fmt.Fscanf(stdin, \"%s\\n\", &baloons)\n \n // count number of baloon based on color\n for i := 0; i < n; i++ {\n m[string(baloons[i])]++\n }\n \n isPossible := true\n for _, v := range m {\n if v > k {\n isPossible = false\n break\n } \n }\n \n if isPossible {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst maxInputSize = 512 * 1024 //bytes\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, maxInputSize), maxInputSize)\n\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\tk, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\ts := scanner.Text()\n\n\tyes := true\n\tl := make([]int, 26)\n\n\tfor i := 0; i < n; i++ {\n\t\tl[s[i]-97]++\n\t\tif l[s[i]-97] > k {\n\t\t\tyes = false\n\t\t}\n\t}\n\n\tif yes {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\t_ = readInt()\n\tk := readInt()\n\tcnt := map[rune]int{}\n\tfor _, v := range readString() {\n\t\tcnt[v]++\n\t}\n\tfor _, v := range cnt {\n\t\tif v > k {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t}\n\tfmt.Println(\"YES\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "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, A := sc.NextInt(), sc.NextInt()\n\n\tS := sc.NextLine()\n\n\tmp := map[byte]int{}\n\n\tfor i := 0; i < N; i++ {\n\t\tmp[S[i]]++\n\t}\n\n\tfor _, v := range mp {\n\t\tif v > A {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "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, A := sc.NextInt(), sc.NextInt()\n\n\tS := sc.NextLine()\n\n\tmp := map[byte]int{}\n\n\tfor i := 0; i < N; i++ {\n\t\tmp[S[i]]++\n\t}\n\n\tfor _, v := range mp {\n\t\tif v= 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"}], "src_uid": "ceb3807aaffef60bcdbcc9a17a1391be"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(s, x int64) int64 {\n\tif (s-x)%2 == 1 {\n\t\treturn 0\n\t}\n\tif ((s-x)/2)&x != 0 {\n\t\treturn 0\n\t}\n\tif s < x {\n\t\treturn 0\n\t}\n\tres := int64(1)\n\tfor y := x; y > 0; y &= (y - 1) {\n\t\tres *= 2\n\t}\n\tif s-x == 0 {\n\t\tres -= 2\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar s, x int64\n\tfmt.Scan(&s, &x)\n\tfmt.Println(solve(s, x))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nconst BITS = 50\n\nvar s, x int64\n\nfunc main() {\n\tdefer out.Flush()\n\tfmt.Fscan(in, &s, &x)\n\tans := solve(0, 0)\n\tif s == x {\n\t\tans -= 2\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc solve(i, carry int) int64 {\n\tif i == BITS {\n\t\tif carry == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tkey := Key{i, carry}\n\tif result, ok := cache[key]; ok {\n\t\treturn result\n\t}\n\tresult := int64(0)\n\tfor a := 0; a <= 1; a++ {\n\t\tb := a ^ get(i, x)\n\t\tsum := a + b + carry\n\t\tif sum&1 == get(i, s) {\n\t\t\tresult += solve(i+1, sum>>1)\n\t\t}\n\t}\n\tcache[key] = result\n\treturn result\n}\n\nvar cache = map[Key]int64{}\n\ntype Key struct {\n\ti, carry int\n}\n\nfunc get(i int, x int64) int {\n\treturn int((x >> uint(i)) & 1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"math/bits\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF627A(in io.Reader, out io.Writer) {\n\tvar s, x, ans int64\n\tFscan(in, &s, &x)\n\tif d := s - x; d >= 0 && d&1 == 0 && d/2|x == d/2+x {\n\t\tans = int64(1) << bits.OnesCount64(uint64(x))\n\t\tif d == 0 {\n\t\t\tans -= 2\n\t\t}\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF627A(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"math/bits\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar s, x, ans int64\n\tScan(&s, &x)\n\tif d := s - x; d >= 0 && d&1 == 0 && d/2|x == d/2+x {\n\t\tans = int64(1) << bits.OnesCount64(uint64(x))\n\t\tif d == 0 {\n\t\t\tans -= 2\n\t\t}\n\t}\n\tPrint(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc needs(sum, xor, carry, digit int64) int64 {\n\tif digit <= 0 {\n\t\tif carry == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\n\tif (xor & digit) != 0 {\n\t\tif (sum & digit) != 0 {\n\t\t\tif carry != 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\treturn 2 * needs(sum, xor, 0, digit>>1)\n\t\t}\n\t\tif carry != 0 {\n\t\t\treturn 2 * needs(sum, xor, 1, digit>>1)\n\t\t}\n\t\treturn 0\n\t}\n\n\tif (sum & digit) != 0 {\n\t\treturn needs(sum, xor, 1, digit>>1)\n\t}\n\treturn needs(sum, xor, 0, digit>>1)\n}\n\nfunc main() {\n\tvar sum, xor int64\n\tfmt.Scan(&sum, &xor)\n\n\tif sum != xor {\n\t\tfmt.Println(needs(sum, xor, 0, 1<<62))\n\t} else {\n\t\tfmt.Println(needs(sum, xor, 0, 1<<62) - 2)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc needs(sum, xor, carry, digit int64) int64 {\n\tif digit < 1 {\n\t\treturn 1 - carry\n\t}\n\n\tif (xor & digit) != 0 {\n\t\tif (sum & digit) != 0 {\n\t\t\treturn (1 - carry) * 2 * needs(sum, xor, 0, digit>>1)\n\t\t}\n\t\treturn carry * 2 * needs(sum, xor, 1, digit>>1)\n\t}\n\n\tif (sum & digit) != 0 {\n\t\treturn needs(sum, xor, 1, digit>>1)\n\t}\n\treturn needs(sum, xor, 0, digit>>1)\n}\n\nfunc main() {\n\tvar sum, xor int64\n\tfmt.Scan(&sum, &xor)\n\n\tif sum != xor {\n\t\tfmt.Println(needs(sum, xor, 0, 1<<62))\n\t} else {\n\t\tfmt.Println(needs(sum, xor, 0, 1<<62) - 2)\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sum, xor, count, total int\n\tfmt.Scan(&sum, &xor)\n\tvar bits []int\n\tcount = 0\n\n\tfor xor > 0 {\n\t\tcount = (count << 1) | 1\n\t\tbits = append(bits, xor-xor&(xor-1))\n\t\txor = xor & (xor - 1)\n\t}\n\n\tfor ; count >= 0; count-- {\n\t\tleft := 0\n\t\tright := 0\n\n\t\tfor i, val := range bits {\n\t\t\tif (count & (1 << uint(i))) > 0 {\n\t\t\t\tleft += val\n\t\t\t} else {\n\t\t\t\tright += val\n\t\t\t}\n\t\t}\n\n\t\tif left >= sum || right >= sum {\n\t\t\tcontinue\n\t\t}\n\t\tif left == right {\n\t\t\ttotal++\n\t\t\tif (sum-(left+right))%2 != 0 {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t} else {\n\t\t\tif (sum-(left+right))%2 == 0 {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t}\n\t\t// fmt.Println(count, bits, left, right, \"=\", total)\n\t}\n\tfmt.Println(total)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sum, xor int\n\tfmt.Scan(&sum, &xor)\n\n\tif ((sum - xor) % 2) != 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\txorbits := 0\n\tsumbits := 0\n\tmask := 1\n\n\tfor mask <= xor && mask <= sum {\n\t\tif xor&mask > 0 {\n\t\t\txorbits++\n\t\t}\n\t\tif sum&mask > 0 {\n\t\t\tsumbits++\n\t\t}\n\t\tmask <<= 1\n\t}\n\txorbits *= 2\n\n\tif sum&xor == sum {\n\t\txorbits -= sumbits\n\t}\n\tfmt.Println(xorbits)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar sum, xor, count, total int\n\tfmt.Scan(&sum, &xor)\n\tvar bits []int\n\tcount = 0\n\n\tfor xor > 0 {\n\t\tcount = (count << 1) | 1\n\t\tbits = append(bits, xor-xor&(xor-1))\n\t\txor = xor & (xor - 1)\n\t}\n\n\tfor ; count >= 0; count-- {\n\t\tleft := 0\n\t\tright := 0\n\n\t\tfor i, val := range bits {\n\t\t\tif (count & (1 << uint(i))) > 0 {\n\t\t\t\tleft += val\n\t\t\t} else {\n\t\t\t\tright += val\n\t\t\t}\n\t\t}\n\n\t\tif left >= sum || right >= sum {\n\t\t\tcontinue\n\t\t}\n\t\tif left == right {\n\t\t\ttotal++\n\t\t\tif sum-(left+right)%2 != 0 {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t} else {\n\t\t\tif (sum-(left+right))%2 == 0 {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t}\n\t\t// fmt.Println(count, bits, left, right, \"=\", total)\n\t}\n\tfmt.Println(total)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tin = bufio.NewReader(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nconst BITS = 15\n\nvar s, x int\n\nfunc main() {\n\tdefer out.Flush()\n\tfmt.Fscan(in, &s, &x)\n\n\t//for i := 0; i < BITS; i++ {\n\t//\tfmt.Fprint(out, get(i, s))\n\t//}\n\t//fmt.Fprintln(out)\n\t//for i := 0; i < BITS; i++ {\n\t//\tfmt.Fprint(out, get(i, x))\n\t//}\n\t//fmt.Fprintln(out)\n\n\tans := solve(0, 0)\n\tif s == x {\n\t\tans -= 2\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc solve(i, carry int) int64 {\n\tif i == BITS {\n\t\tif carry == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tkey := Key{i, carry}\n\tif result, ok := cache[key]; ok {\n\t\treturn result\n\t}\n\tresult := int64(0)\n\tfor a := 0; a <= 1; a++ {\n\t\tb := a ^ get(i, x)\n\t\tsum := a + b + carry\n\t\tif sum&1 == get(i, s) {\n\t\t\t//fmt.Fprintln(out, i, a, b, carry, \"works\", sum>>1)\n\t\t\tresult += solve(i+1, sum>>1)\n\t\t}\n\t}\n\t//fmt.Fprintln(out, i, carry, \">\", result)\n\tcache[key] = result\n\treturn result\n}\n\nvar cache = map[Key]int64{}\n\ntype Key struct {\n\ti, carry int\n}\n\nfunc get(i, x int) int {\n\treturn (x >> uint(i)) & 1\n}\n"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"math/bits\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF627A(in io.Reader, out io.Writer) {\n\tvar s, x, ans int64\n\tFscan(in, &s, &x)\n\tif d := s - x; d >= 0 && d&1 == 0 && d/2|x == d/2+x {\n\t\tif d == 0 {\n\t\t\tx--\n\t\t}\n\t\tans = int64(1) << bits.OnesCount64(uint64(x))\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF627A(os.Stdin, os.Stdout) }\n"}], "src_uid": "18410980789b14c128dd6adfa501aea5"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc pow(a, b int64) int64 {\n\tif b <= 0 {\n\t\treturn 1\n\t}\n\tif b <= 1 {\n\t\treturn a\n\t}\n\treturn pow((a*a)%100, b/2)\n}\n\nfunc main() {\n\tvar b int64\n\tfmt.Scan(&b)\n\tfmt.Println(pow(5, b))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint64\n\tfmt.Scanf(\"%d\", &n)\n\n\tswitch n {\n\tcase 0:\n\t\tfmt.Println(\"1\")\n\tcase 1:\n\t\tfmt.Println(\"5\")\n\tdefault:\n\t\tfmt.Println(\"25\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(25)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// Buffered IO for fast I/O.\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\n// Helper function to wrap around the buffered IO.\nfunc printf(f string, a ...interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\n\n// Helper function to take an input from the user.\nfunc scanf(f string, a ...interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\n// Solve\nfunc solve() {\n\t// Solve the problem!\n\tvar numberOfFactors int\n\tscanf(\"%d\", &numberOfFactors)\n\n\t// Any 5 powered by anything will always have '25' as its last two digits.\n\tprintf(\"25\\n\")\n\treturn\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tsolve()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tfmt.Println(25)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"25\")\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n \"os\"\n)\n \nfunc main() {\n\tvar n uint64\n\tin := bufio.NewReader(os.Stdin)\n fmt.Fscanf(in, \"%d \\n\", &n)\n fmt.Println(25)\n // result := int(math.Pow(5, float64(n)))\n // stringresult := strconv.Itoa(result)\n // fmt.Println(stringresult[len(stringresult)-2:len(stringresult)])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(25)\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"25\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []Pair) []Pair {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i].first > arr[right].first {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc sort2(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort2(arr[:left])\n\tsort2(arr[left+1:])\n\treturn arr\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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tfmt.Println(25)\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n int64\n\tfmt.Scan(&n)\n\tfmt.Println(25)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tfmt.Fprintln(os.Stdout, 25)\n}"}], "negative_code": [{"source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n \"os\"\n \"math\"\n \"strconv\"\n)\n \nfunc main() {\n\tvar n uint64\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d \\n\", &n)\n result := int(math.Pow(5, float64(n)))\n stringresult := strconv.Itoa(result)\n fmt.Println(stringresult[len(stringresult)-2:len(stringresult)])\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"hello world\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tswitch n {\n\tcase 0:\n\t\tfmt.Println(\"1\")\n\tcase 1:\n\t\tfmt.Println(\"5\")\n\tdefault:\n\t\tfmt.Println(\"25\")\n\t}\n}"}], "src_uid": "dcaff75492eafaf61d598779d6202c9d"} {"source_code": "// 287A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n arr := make([]string, 4)\n for i := 0; i < 4; i++ {\n fmt.Scan(&arr[i])\n }\n\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if arr[i][j] == arr[i][j+1] && arr[i][j] == arr[i+1][j] && arr[i][j] == arr[i+1][j+1] {\n fmt.Println(\"YES\")\n return\n } else if arr[i][j] == arr[i][j+1] && arr[i][j] == arr[i+1][j] {\n fmt.Println(\"YES\")\n return\n } else if arr[i][j] == arr[i][j+1] && arr[i][j] == arr[i+1][j+1] {\n fmt.Println(\"YES\")\n return\n } else if arr[i+1][j] == arr[i+1][j+1] && arr[i+1][j] == arr[i][j+1] {\n fmt.Println(\"YES\")\n return\n } else if arr[i+1][j] == arr[i+1][j+1] && arr[i+1][j] == arr[i][j] {\n fmt.Println(\"YES\")\n return\n }\n }\n }\n fmt.Println(\"NO\")\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt == 2 { return false } else { return true }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt == 2 { return false } else { return true }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool { // mengecek return value fungsi array x elemen ke 4, variabel a dan b dengan jenis int \n cnt := 0 // membuat variabel cnt kemudian diisi dengan 0\n for i := a; i < (a+2); i++ { // looping\n for j := b; j < (b+2); j++ { // looping ke 2\n if x[i][j] != x[a][b] { cnt++ } // jika array x elemen i dan j tidak sama dengan array x elemen a dan b maka cnt ditambah\n }\n }\n if cnt == 2 { return false } else { return true } // jika cnt sama dengan 2 maka return false, lainnya return true\n}\n\nfunc main() {\n var x [4]string // membuat variabel array x elemen ke 4 dengan jenis string\n for i := 0; i < 4; i++ { // looping ke 3\n fmt.Scan(&x[i]) // mengambil input \n }\n ans := false // membuat variabel ans kemudian diisi dengan false\n for i := 0; i < 3; i++ { //looping ke 4\n for j := 0; j < 3; j++ { // looping ke 5\n if check(x,i,j) { // jika check x,i dan j maka ans sama dengan true kemudian keluar dari fungsi\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") } // jika ans maka cetak Yes, lainnya cetak NO\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts := make([]string, 4)\n\tfor i := range s {\n\t\tfmt.Scanln(&s[i])\n\t}\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tcnt := 0\n\t\t\tif s[i][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif cnt != 2 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt == 2 { return false } else { return true }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(x [4]string, a int, b int) bool {\n cnt := 0\n for i := a; i < (a+2); i++ {\n for j := b; j < (b+2); j++ {\n if x[i][j] != x[a][b] { cnt++ }\n }\n }\n if cnt <= 1 { return true } else { return false }\n}\n\nfunc main() {\n var x [4]string\n for i := 0; i < 4; i++ {\n fmt.Scan(&x[i])\n }\n ans := false\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n if check(x,i,j) {\n ans = true\n break\n }\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts := make([]string, 4)\n\tfor i := range s {\n\t\tfmt.Scanln(&s[i])\n\t}\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tcnt := 0\n\t\t\tif s[i][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif s[i+1][j+1] == '.' {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tif cnt <= 1 || cnt >= 3 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "01b145e798bbdf0ca2ecc383676d79f3"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 0\n\tfor i := range s {\n\t\tswitch s[i] {\n\t\tcase 'a', 'e', 'i', 'o', 'u', '1', '3', '5', '7', '9':\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "positive_code": [{"source_code": "package main\n\n/*\n\tTo verify whether or not the statement is valid, basically\n\twe just need to check cards with vowel or cards with odd number\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar str string\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%s\", &str)\n\tshouldCheck := 0\n\tfor i := 0; i < len(str); i++ {\n\t\tch := string(str[i])\n\t\tnum, err := strconv.Atoi(ch)\n\t\tif err != nil {\n\t\t\tif ch == \"a\" || ch == \"i\" || ch == \"u\" || ch == \"e\" || ch == \"o\" {\n\t\t\t\tshouldCheck++\n\t\t\t}\n\t\t} else {\n\t\t\tif num%2 != 0 {\n\t\t\t\tshouldCheck++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(shouldCheck)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar str string\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%s\", &str)\n\tshouldCheck := 0\n\tfor i := 0; i < len(str); i++ {\n\t\tch := string(str[i])\n\t\tnum, err := strconv.Atoi(ch)\n\t\tif err != nil {\n\t\t\tif ch == \"a\" || ch == \"i\" || ch == \"u\" || ch == \"e\" || ch == \"o\" {\n\t\t\t\tshouldCheck++\n\t\t\t}\n\t\t} else {\n\t\t\tif num%2 != 0 {\n\t\t\t\tshouldCheck++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(shouldCheck)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tvar ans int\n\tvowel := []int32{'a','e','i','o','u','1','3','5','7','9'}\n\tfmt.Scanf(\"%s\",&s)\n\tfor _, ch := range s {\n\t\tfor _, v := range vowel {\n\t\t\tif ch == v {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc vowel_l(r rune) bool {\n if r == 'a' || r == 'e' || r == 'i' || r == 'o' || r == 'u' {\n return true\n }\n return false\n}\n\nfunc odd(r rune) bool {\n if r == '1' || r == '3' || r == '5' || r == '7' || r == '9' {\n return true\n } \n return false\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n var cnt int\n for _, r := range s {\n if vowel_l(r) || odd(r) {\n cnt++\n }\n }\n fmt.Print(cnt)\n}"}, {"source_code": "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\tcount := 0\n\tfor _, v := range S {\n\t\tswitch v {\n\t\tcase 'a', 'i', 'u', 'e', 'o', '1', '3', '5', '7', '9':\n\t\t\tcount++\n\n\t\t}\n\t}\n\tfmt.Println(count)\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"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tvar ans int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= '0' && s[i] <= '9' {\n\t\t\tif (s[i]-'0')%2 == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t} else {\n\t\t\tif strings.IndexByte(\"aeiou\", s[i]) != -1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tg := \"aeiou\"\n\tk := 0\n\tfor _,a := range s {\n\t\tif strings.Count(g,string(a)) >0 {\n\t\t\tk++\n\t\t}\n\t\tn,err := strconv.Atoi(string(a))\n\t\tif err==nil && n%2 !=0 {\n\t\t\tk++\n\t\t}\n\t}\n\tfmt.Println(k)\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc vowel_l(r rune) bool {\n if r == 'a' || r == 'e' || r == 'i' || r == 'u' {\n return true\n }\n return false\n}\n\nfunc odd(r rune) bool {\n if r == '1' || r == '3' || r == '5' || r == '7' || r == '9' {\n return true\n } \n return false\n}\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n var cnt int\n for _, r := range s {\n if vowel_l(r) || odd(r) {\n cnt++\n }\n }\n fmt.Print(cnt)\n}"}, {"source_code": "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\tcount := 0\n\tfor _, v := range S {\n\t\tswitch v {\n\t\tcase 'a', 'i', 'u', 'e', 'o', '0', '2', '4', '6', '8':\n\t\t\tcount++\n\n\t\t}\n\t}\n\tfmt.Println(count)\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"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tvar ans int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= '0' && s[i] <= '9' {\n\t\t\tif (s[i]-'0')%2 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t} else {\n\t\t\tif strings.IndexByte(\"aeiou\", s[i]) != -1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tvar ans int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= '0' && s[i] <= '9' {\n\t\t\tif (s[i]-'0')%2 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t} else {\n\t\t\tif strings.IndexByte(\"aeios\", s[i]) != -1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}], "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar x, y float64\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%f %f\\n\", &x, &y)\n\tx, y = y*math.Log(x), x*math.Log(y)\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", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tif y == 2 {\n\t\t\tif x == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x == 3 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x > 4 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif y == 1 {\n\t\t\tfmt.Println(\">\")\n\t\t}\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tif x == 2 {\n\t\t\tif y == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y == 3 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y > 4 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif x == 1 {\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"math\"\n\t\"fmt\"\n)\n\nfunc main () {\n\tvar a float64\n\tvar b float64\n\n\tfmt.Scanf(\"%f %f\\n\",&a,&b)\n\n\tc := b * math.Log(a)\n\td := a * math.Log(b)\n\n\tif c < d {\n\t\tfmt.Println(\"<\")\n\t} else if c > d {\n\t\tfmt.Println(\">\")\n\t} else {\n\t\tfmt.Println(\"=\")\n\t}\n\n}"}, {"source_code": "package main\n\n/*\n\tThe idea to solve this problem is by using logarithm to solve\n\tthe equation. We apply logarithm to both sides of equation then\n\tcompare them. For details take a look at this reference:\n\thttp://www.montereyinstitute.org/courses/DevelopmentalMath/COURSE_TEXT2_RESOURCE/U18_L4_T1_text_final.html\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar x, y float64\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%f %f\\n\", &x, &y)\n\tx, y = y*math.Log(x), x*math.Log(y)\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := float64(readInt())\n\ty := float64(readInt())\n\tt0 := y * math.Log(x)\n\tt1 := x * math.Log(y)\n\tif t0 == t1 {\n\t\tfmt.Println(\"=\")\n\t} else if t1 < t0 {\n\t\tfmt.Println(\">\")\n\t} else {\n\t\tfmt.Println(\"<\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\t\n\tvar t float64 = math.Log2(a) / math.Log2(b) * b\n\tif a == b {\n\t\tfmt.Println(\"=\")\n\t} else if t == a {\n\t\tfmt.Println(\"=\")\n\t} else if t > a {\n\t\tfmt.Println(\">\")\n\t} else {\n\t\tfmt.Println(\"<\")\n\t}\n}"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar a, b float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tif a == b {\n\t\tfmt.Println(\"=\")\n\t\tos.Exit(0)\n\t}\n\tif a > b {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\tx = (x * math.Log(a)) / math.Log(b)\n\t\tif x == y {\n\t\t\tfmt.Println(\"=\")\n\t\t} else if x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t} else {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\ty = (y * math.Log(b)) / math.Log(a)\n\t\tif x == y {\n\t\t\tfmt.Println(\"=\")\n\t\t} else if x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar x, y float64\n\tfmt.Fscan(reader, &x, &y)\n\tx, y = y*math.Log(x), x*math.Log(y)\n\t// fmt.Println(x, y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t} else if x > y {\n\t\tfmt.Println(\">\")\n\t} else if x < y {\n\t\tfmt.Println(\"<\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x1,y1 float64\n\tfmt.Scanf(\"%f %f\\n\", &x1, &y1)\n\tx := (math.Log(x1)*y1)\n\ty := (math.Log(y1)*x1)\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\nfunc readOneInt64(r *bufio.Reader) (n int64) {\n\tbytes, _ := r.ReadBytes('\\n')\n\tn, _ = strconv.ParseInt(string(bytes[:len(bytes)-2]), 10, 64)\n\treturn\n}\n\nfunc readInt64Slice(r *bufio.Reader, n int) (slice []int64) {\n\tvar bytes []byte\n\tslice = make([]int64, n)\n\tn--\n\tfor i := 0; i < n; i++ {\n\t\tbytes, _ = r.ReadBytes(' ')\n\t\tslice[i], _ = strconv.ParseInt(string(bytes[:len(bytes)-1]), 10, 64)\n\t}\n\tslice[n] = readOneInt64(r)\n\treturn\n}\n\nfunc readOneString(r *bufio.Reader) string {\n\tbytes, _ := r.ReadBytes('\\n')\n\treturn string(bytes[:len(bytes)-2])\n}\n\nfunc abs(i int) int {\n\tif i < 0 {\n\t\treturn i * -1\n\t}\n\treturn i\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nconst EPS = 0.00000001\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\nfunc main(){\n\tsc.Split(bufio.ScanWords)\n\n\tx := float64(nextInt())\n\ty := float64(nextInt())\n\n\tres_xy := y * math.Log2(x)\n\tres_yx := x * math.Log2(y)\n\n\t//fmt.Printf(\"%v, %v, %v\", res_xy, res_yx, res_xy-res_yx)\n\n\tif math.Abs(res_xy - res_yx) < EPS{\n\t\tfmt.Println(\"=\")\n\t}else if res_xy < res_yx {\n\t\tfmt.Println(\"<\")\n\t}else {\n\t\tfmt.Println(\">\")\n\t}\n}"}], "negative_code": [{"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main(){\n\tvar a, b float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tif a == b {\n\t\tfmt.Println(\"=\")\n\t\tos.Exit(0)\n\t}\n\tif a > b {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\tx = (x * math.Log(a)) / math.Log(b)\n\t\tif x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t} else {\n\t\tvar x, y float64\n\t\tx = b\n\t\ty = a\n\t\ty = (y * math.Log(b)) / math.Log(a)\n\t\tif x > y {\n\t\t\tfmt.Println(\">\")\n\t\t} else{\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(reader, &x, &y)\n\txLog, yLog := int(math.Log(float64(x))), int(math.Log(float64(x)))\n\tif y*xLog == yLog*x {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t} else if y*xLog > yLog*x {\n\t\tfmt.Println(\">\")\n\t} else if y*xLog < yLog*x {\n\t\tfmt.Println(\"<\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(reader, &x, &y)\n\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t} else if x > y {\n\t\tfmt.Println(\"<\")\n\t} else if x < y {\n\t\tfmt.Println(\">\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar x, y int\n\tfmt.Fscan(reader, &x, &y)\n\txLog, yLog := int(math.Log(float64(x))), int(math.Log(float64(y)))\n\t// fmt.Println(xLog, yLog)\n\tif y*xLog == yLog*x {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t} else if y*xLog > yLog*x {\n\t\tfmt.Println(\">\")\n\t} else if y*xLog < yLog*x {\n\t\tfmt.Println(\"<\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d\", &x)\n\tfmt.Scanf(\"%d\", &y)\n\n\tif x == y {\n\t\tfmt.Print(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Print(\"<\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\">\")\n\t\treturn\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Print(\">\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\"<\")\n\t\treturn\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\">\")\n\t\treturn\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"<\")\n\t\treturn\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\n\tif x == y {\n\t\tfmt.Print(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Print(\"<\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\">\")\n\t\treturn\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Print(\">\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\"<\")\n\t\treturn\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tif y == 2 {\n\t\t\tif x == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x == 3 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x > 4 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tif x == 2 {\n\t\t\tif y == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y == 3 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y > 4 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\", &x, &y)\n\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\">\")\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(\"<\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y int\n\tfmt.Scanf(\"%d %d\\n\", &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x > y {\n\t\tif y >= 3 {\n\t\t\tfmt.Println(\"<\")\n\t\t\treturn\n\t\t}\n\t\tif y == 2 {\n\t\t\tif x == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x == 3 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif x > 4 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif y == 1 {\n\t\t\tfmt.Println(\">\")\n\t\t}\n\t}\n\tif x < y {\n\t\tif x >= 3 {\n\t\t\tfmt.Println(\">\")\n\t\t\treturn\n\t\t}\n\t\tif x == 2 {\n\t\t\tif y == 4 {\n\t\t\t\tfmt.Println(\"=\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y == 3 {\n\t\t\t\tfmt.Println(\"<\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif y > 4 {\n\t\t\t\tfmt.Println(\">\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tif y == 1 {\n\t\t\tfmt.Println(\"<\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := readInt()\n\ty := readInt()\n\tif y == x {\n\t\tfmt.Println(\"=\")\n\t} else if x == 1 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 1 {\n\t\tfmt.Println(\">\")\n\t} else if x == 2 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 2 {\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\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := readInt()\n\ty := readInt()\n\tif y == x {\n\t\tfmt.Println(\"=\")\n\t} else if x == 1 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 1 {\n\t\tfmt.Println(\">\")\n\t} else if x == 2 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 2 {\n\t\tfmt.Println(\">\")\n\t} else if int64(x)*int64(x) > int64(y)*int64(y) {\n\t\tfmt.Println(\"<\")\n\t} else {\n\t\tfmt.Println(\">\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := readInt()\n\ty := readInt()\n\tif y == x {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif y%x == 0 && y/x == x {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x%y == 0 && x/y == y {\n\t\tfmt.Println(\"=\")\n\t\treturn\n\t}\n\tif x == 1 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 1 {\n\t\tfmt.Println(\">\")\n\t} else if x == 2 {\n\t\tfmt.Println(\"<\")\n\t} else if y == 2 {\n\t\tfmt.Println(\">\")\n\t} else if int64(x)*int64(x) > int64(y)*int64(y) {\n\t\t//\t\t2 * 2 * 2 * 2\n\t\t//\n\t\t//\t\t4 * 4\n\t\tfmt.Println(\"<\")\n\t} else {\n\t\tfmt.Println(\">\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tx := readInt()\n\ty := readInt()\n\tif y == x {\n\t\tfmt.Println(\"=\")\n\t} else if y < x {\n\t\tfmt.Println(\"<\")\n\t} else {\n\t\tfmt.Println(\">\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "src_uid": "ec1e44ff41941f0e6436831b5ae543c6"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tx++\n\tif a > b {\n\t\tfor ; x > 2; {\n\t\t\t\tfmt.Printf(\"01\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t}\n\t\tif x == 2 {\n\t\t\tfor ; a > 0 || b > 0 ; {\n\t\t\t\tif a != 0 {\n\t\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\t\ta--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif b != 0 {\n\t\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\t\tb--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ; a > 0 || b > 0 ; {\n\t\t\t\tif b != 0 {\n\t\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\t\tb--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif a != 0 {\n\t\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\t\ta--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ; x > 2; {\n\t\t\tfmt.Printf(\"10\")\n\t\t\tx -= 2\n\t\t\ta--\n\t\t\tb--\n\t\t\tcontinue\n\t\t}\n\t\tif x == 2 {\n\t\t\tfor ; a > 0 || b > 0; {\n\t\t\t\tif b != 0 {\n\t\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\t\tb--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif a != 0 {\n\t\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\t\ta--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ; a > 0 || b > 0; {\n\t\t\t\tif a != 0 {\n\t\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\t\ta--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif b != 0 {\n\t\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\t\tb--\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t. \"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar a, b, x int\n\tScan(&a, &b, &x)\n\tk := (x + 1) / 2\n\ta -= k\n\tb -= k\n\tR := Repeat\n\ts := R(\"01\", k)\n\tif x&1 > 0 {\n\t\ts = R(\"0\", a) + s + R(\"1\", b)\n\t} else if a > 0 {\n\t\ts += R(\"1\", b) + R(\"0\", a)\n\t} else {\n\t\ts = R(\"1\", b) + s\n\t}\n\tPrint(s)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n // initialize\n var a, b, x int\n var a_byte, b_byte byte = '0', '1'\n\n // read input\n fmt.Scan(&a, &b, &x)\n\n if a < b {\n a, b = b, a\n a_byte, b_byte = b_byte, a_byte\n }\n\n // print answer\n fmt.Printf(\"%c\", a_byte)\n a -= 1\n\n for x > 1 {\n fmt.Printf(\"%c\", b_byte)\n b -= 1\n\n a, b = b, a\n a_byte, b_byte = b_byte, a_byte\n\n x -= 1\n }\n\n // finish it\n for a > 0 {\n fmt.Printf(\"%c\", a_byte)\n a -= 1\n }\n for (b > 0) {\n fmt.Printf(\"%c\", b_byte)\n b -= 1\n }\n\n fmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar a, b, x int\nvar i int\nvar s string\n\nfunc main() {\n\tfmt.Scan(&a, &b, &x)\n\n\tif x%2 == 0 {\n\t\tif a > b {\n\t\t\tfor i = 0; i < x/2; i++ {\n\t\t\t\ts += \"01\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < b-x/2; i++ {\n\t\t\t\ts += \"1\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < a-x/2; i++ {\n\t\t\t\ts += \"0\"\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 0; i < x/2; i++ {\n\t\t\t\ts += \"10\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < a-x/2; i++ {\n\t\t\t\ts += \"0\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < b-x/2; i++ {\n\t\t\t\ts += \"1\"\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif a > b {\n\t\t\tfor i = 0; i < x/2; i++ {\n\t\t\t\ts += \"01\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < a-x/2; i++ {\n\t\t\t\ts += \"0\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < b-x/2; i++ {\n\t\t\t\ts += \"1\"\n\t\t\t}\n\t\t} else {\n\t\t\tfor i = 0; i < x/2; i++ {\n\t\t\t\ts += \"10\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < b-x/2; i++ {\n\t\t\t\ts += \"1\"\n\t\t\t}\n\n\t\t\tfor i = 0; i < a-x/2; i++ {\n\t\t\t\ts += \"0\"\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(s)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t. \"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar a, b, x int\n\tScan(&a, &b, &x)\n\tk := (x + 1) / 2\n\ta -= k\n\tb -= k\n\tR := Repeat\n\ts := R(\"01\", k)\n\tif x&1 > 0 {\n\t\ts = R(\"0\", a) + s + R(\"1\", b)\n\t} else {\n\t\ts += R(\"1\", b) + R(\"0\", a)\n\t}\n\tPrint(s)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tif a > b {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"10\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"01\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tif a > b {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"01\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"10\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, x int\n\tfmt.Scan(&a, &b, &x)\n\tif a > b {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"01\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor ; a > 0 || b > 0; {\n\t\t\tif x > 1 {\n\t\t\t\tfmt.Printf(\"10\")\n\t\t\t\tx -= 2\n\t\t\t\ta--\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif b != 0 {\n\t\t\t\tfmt.Printf(\"1\")\n\t\t\t\tb--\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a != 0 {\n\t\t\t\tfmt.Printf(\"0\")\n\t\t\t\ta--\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t}\n\t}\n}\n"}], "src_uid": "ef4123b8f3f3b511fde8b79ea9a6b20c"} {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc main() {\n\tvar s []byte\n\tScan(&s)\n\tn, ans := len(s), 99\n\tif n < 2 {\n\t\tPrint(-1)\n\t\treturn\n\t}\n\tfor i := range s {\n\t\tfor j := range s {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt := make([]byte, n)\n\t\t\tcopy(t, s)\n\t\t\tc := 0\n\t\t\tfor k := i; k < n-1; k++ {\n\t\t\t\tt[k], t[k+1] = t[k+1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tk := j\n\t\t\tif j > i {\n\t\t\t\tk--\n\t\t\t}\n\t\t\tfor ; k < n-2; k++ {\n\t\t\t\tt[k], t[k+1] = t[k+1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tfor k = 0; t[k] == '0'; k++ {\n\t\t\t}\n\t\t\tfor ; k > 0; k-- {\n\t\t\t\tt[k], t[k-1] = t[k-1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tif c < ans && (t[n-2]&15*10+t[n-1]&15)%25 == 0 {\n\t\t\t\tans = c\n\t\t\t}\n\t\t}\n\t}\n\tif ans == 99 {\n\t\tans = -1\n\t}\n\tPrint(ans)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF988E(in io.Reader, out io.Writer) {\n\tvar s []byte\n\tFscan(in, &s)\n\tn, ans := len(s), 99\n\tif n < 2 {\n\t\tFprint(out, -1)\n\t\treturn\n\t}\n\tfor i := range s {\n\t\tfor j := range s {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tt := make([]byte, n)\n\t\t\tcopy(t, s)\n\t\t\tc := 0\n\t\t\tfor k := i; k < n-1; k++ {\n\t\t\t\tt[k], t[k+1] = t[k+1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tk := j\n\t\t\tif j > i {\n\t\t\t\tk--\n\t\t\t}\n\t\t\tfor ; k < n-2; k++ {\n\t\t\t\tt[k], t[k+1] = t[k+1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tfor k = 0; t[k] == '0'; k++ {\n\t\t\t}\n\t\t\tfor ; k > 0; k-- {\n\t\t\t\tt[k], t[k-1] = t[k-1], t[k]\n\t\t\t\tc++\n\t\t\t}\n\t\t\tif v, _ := strconv.Atoi(string(t[n-2:])); c < ans && v%25 == 0 {\n\t\t\t\tans = c\n\t\t\t}\n\t\t}\n\t}\n\tif ans == 99 {\n\t\tans = -1\n\t}\n\tFprint(out, ans)\n}\n\nfunc main() { CF988E(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tINF = 12345\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tS := io.NextLine()\n\n\tA := []rune(S)\n\tN := len(A)\n\n\tbest := INF\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t\tif (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {\n\t\t\t\tbest = Min(best, simulate(A, j, i))\n\t\t\t}\n\t\t}\n\t}\n\tif best < INF {\n\t\tio.Println(best)\n\t} else {\n\t\tio.Println(-1)\n\t}\n}\n\nfunc simulate(A []rune, front, back int) int {\n\tN := len(A)\n\n\tX := make([]rune, N)\n\tcopy(X, A)\n\n\tif back < front {\n\t\tfront--\n\t}\n\n\ta := swapTo(X, back, N - 1)\n\tb := swapTo(X, front, N - 2)\n\tc := fix(X)\n\n\t// fmt.Printf(\"A = %v, front = %d, back = %d, a = %d, b = %d, c = %d\\n\", A, front, back, a, b, c)\n\n\treturn a + b + c\n}\n\nfunc swapTo(A []rune, i, j int) int {\n\tcnt := 0\n\tfor i + 1 <= j {\n\t\tA[i], A[i + 1] = A[i + 1], A[i]\n\t\tcnt++\n\t\ti++\n\t}\n\treturn cnt\n}\n\nfunc fix(A []rune) int {\n\tif A[0] != '0' {\n\t\treturn 0\n\t}\n\tfor i := 1; i < len(A) - 2; i++ {\n\t\tif A[i] != '0' {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn INF\n}\n\nfunc Min(args ...int) int {\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\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tINF = 12345\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tS := io.NextLine()\n\n\tA := []rune(S)\n\tN := len(A)\n\n\tbest := INF\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t\tif (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {\n\t\t\t\tbest = Min(best, simulate(A, j, i))\n\t\t\t}\n\t\t}\n\t}\n\tif best < INF {\n\t\tio.Println(best)\n\t} else {\n\t\tio.Println(-1)\n\t}\n}\n\nfunc simulate(A []rune, front, back int) int {\n\tN := len(A)\n\n\tX := make([]rune, N)\n\tcopy(X, A)\n\n\tif back < front {\n\t\tfront--\n\t}\n\n\ta := swapTo(X, back, N - 1)\n\tb := swapTo(X, front, N - 2)\n\tc := fix(X)\n\n\treturn a + b + c\n}\n\nfunc swapTo(A []rune, i, j int) int {\n\tcnt := 0\n\tfor i + 1 <= j {\n\t\tA[i], A[i + 1] = A[i + 1], A[i]\n\t\tcnt++\n\t\ti++\n\t}\n\treturn cnt\n}\n\nfunc fix(A []rune) int {\n\tif A[0] != '0' {\n\t\treturn 0\n\t}\n\tfor i := 1; i < len(A) - 2; i++ {\n\t\tif A[i] != '0' {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn INF\n}\n\nfunc Min(args ...int) int {\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\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tINF = 12345\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tS := io.NextLine()\n\n\tA := []rune(S)\n\tN := len(A)\n\n\tbest := INF\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t\tif (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t}\n\t}\n\tif best < INF {\n\t\tio.Println(best)\n\t} else {\n\t\tio.Println(-1)\n\t}\n}\n\nfunc simulate(A []rune, front, back int) int {\n\tN := len(A)\n\n\tX := make([]rune, N)\n\tcopy(A, X)\n\n\tif back < front {\n\t\tfront--\n\t}\n\n\ta := swapTo(X, back, N - 1)\n\tb := swapTo(X, front, N - 2)\n\tc := fix(X)\n\n\treturn a + b + c\n}\n\nfunc swapTo(A []rune, i, j int) int {\n\tcnt := 0\n\tfor i + 1 <= j {\n\t\tA[i], A[i + 1] = A[i + 1], A[i]\n\t\tcnt++\n\t\ti++\n\t}\n\treturn cnt\n}\n\nfunc fix(A []rune) int {\n\tif A[0] != '0' {\n\t\treturn 0\n\t}\n\tfor i := 1; i < len(A) - 2; i++ {\n\t\tif A[i] != '0' {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn INF\n}\n\nfunc Min(args ...int) int {\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\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tINF = 12345\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n\tS := io.NextLine()\n\n\tA := []rune(S)\n\tN := len(A)\n\n\tbest := INF\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif (A[i] == '0' && A[j] == '0') || (A[i] == '2' && A[j] == '5') || (A[i] == '5' && A[j] == '0') || (A[i] == '7' && A[j] == '5') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t\tif (A[i] == '5' && A[j] == '2') || (A[i] == '0' && A[j] == '5') || (A[i] == '5' && A[j] == '7') {\n\t\t\t\tbest = Min(best, simulate(A, i, j))\n\t\t\t}\n\t\t}\n\t}\n\tif best < INF {\n\t\tio.Println(best)\n\t} else {\n\t\tio.Println(-1)\n\t}\n}\n\nfunc simulate(A []rune, front, back int) int {\n\tN := len(A)\n\n\tX := make([]rune, N)\n\tcopy(X, A)\n\n\tif back < front {\n\t\tfront--\n\t}\n\n\ta := swapTo(X, back, N - 1)\n\tb := swapTo(X, front, N - 2)\n\tc := fix(X)\n\n\treturn a + b + c\n}\n\nfunc swapTo(A []rune, i, j int) int {\n\tcnt := 0\n\tfor i + 1 <= j {\n\t\tA[i], A[i + 1] = A[i + 1], A[i]\n\t\tcnt++\n\t\ti++\n\t}\n\treturn cnt\n}\n\nfunc fix(A []rune) int {\n\tif A[0] != '0' {\n\t\treturn 0\n\t}\n\tfor i := 1; i < len(A) - 2; i++ {\n\t\tif A[i] != '0' {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn INF\n}\n\nfunc Min(args ...int) int {\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\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}], "src_uid": "ea1c737956f88be94107f2565ca8bbfd"} {"source_code": "package main\n\nimport \t\"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := 0\n\tif n%2 == 0 {\n\t\ta = int((n - 1) / 4)\n\t}\n\tfmt.Println(a)\n}\n", "positive_code": [{"source_code": "// stick.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tc := 0\n\tif n%2 == 0 {\n\t\tc = int((n - 1) / 4)\n\t}\n\tfmt.Println(c)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nvar n float64\n\nfunc main() {\n fmt.Scanln(&n)\n if int(n)%2 != 0 {\n fmt.Println(0)\n return\n }\n ans := int(math.Ceil(((n / 2) / 2)))\n ans -= 1\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, o int\n\tfmt.Scanln(&n)\n\tif n%2 != 0 {\n\t\to = 0\n\t} else {\n\t\tif n%4 == 0 {\n\t\t\to = n/4 - 1\n\t\t} else {\n\t\t\to = n / 4\n\t\t}\n\t}\n\tfmt.Println(o)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(n int64) int64 {\n if n%2 != 0 {\n return 0 \n }\n if n < 6 {\n return 0\n }\n if n == 6 {\n return 1 \n }\n if n%4 == 0 {\n return n/4 - 1\n }\n return n/4\n}\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n fmt.Println(solve(n))\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(n int64) int64 {\n if n < 6 {\n return 0\n }\n if n == 6 {\n return 1 \n }\n if n%4 == 0 {\n return n/4 - 1\n }\n return n/4\n}\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n fmt.Println(solve(n))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(n int64) int64 {\n if n < 6 {\n return 0\n }\n if n == 6 {\n return 1 \n }\n if n%4 == 0 {\n return n/4 - 1\n }\n return n/4 - 1\n}\n\nfunc main() {\n var n int64\n fmt.Scanf(\"%d\", &n)\n fmt.Println(solve(n))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nvar n float64\n\nfunc main() {\n fmt.Scanln(&n)\n if int(n)%2 == 0 {\n fmt.Println(0)\n return\n }\n ans := int(math.Ceil(((n / 2) / 2)))\n ans -= 1\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, o int\n\tfmt.Scanln(&n)\n\tif n%4 == 0 {\n\t\to = n/4 - 1\n\t} else {\n\t\to = n / 4\n\t}\n\tfmt.Println(o)\n}"}], "src_uid": "32b59d23f71800bc29da74a3fe2e2b37"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt64()\n\tvar cnt, num, minus, length, base int64\n\n\tnum = n\n\tbase = 1\n\tlength = 1\n\n\tfor num >= 10 {\n\t\tminus += 9 * base\n\t\tcnt += 9 * base * length\n\t\tnum /= 10\n\t\tbase *= 10\n\t\tlength++\n\t}\n\n\tcnt += (n - minus) * length\n\n\tprintln(cnt)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var n, d, c, ans int64\n \n fmt.Fscan(scanner, &n)\n for c = 1; c <= n; c *= 10 {\n d++\n }\n //writer.WriteString(strconv.Itoa(c))\n c /= 10\n ans = (n - c + 1) * d;\n for d > 0 {\n ans += (c - c / 10) * (d-1);\n d--\n c /= 10\n }\n \n writer.WriteString(strconv.FormatInt(ans, 10))\n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input uint64\n\tfmt.Scanf(\"%d\", &input)\n\tdigits := countDigits(input)\n\trem := (input - pow10(digits-1) + 1) * digits\n\tres := uint64(0)\n\tfor i := uint64(1); i < digits; i++ {\n\t\tres += (pow10(i) - pow10(i-1)) * i\n\t}\n\tfmt.Println(res + rem)\n}\n\nfunc pow10(n uint64) uint64 {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := uint64(1)\n\t\tfor ; n > 0; n-- {\n\t\t\tres *= 10\n\t\t}\n\t\treturn res\n\t}\n}\n\nfunc countDigits(ub uint64) uint64 {\n\tcount := uint64(0)\n\tfor ; ub > 0; ub /= 10 {\n\t\tcount++\n\t}\n\treturn count\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n \n var n int64\n fmt.Scanf(\"%v\\n\", &n)\n var count int64 = 0;\n \n var i,x int64 = 9,1;\n\n for n > 0 {\n if n < i {\n count += n*x;\n } else {\n count += i*x;\n }\n n -= i\n i *= 10\n x++\n }\n fmt.Printf(\"%v\\n\",count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc count(n int64) int64 {\n\tif n < 10 {\n\t\treturn int64(n)\n\t}\n\tvar l, p int64 = 1, 1\n\tfor p * 10 <= n {\n\t\tl++\n\t\tp *= 10\n\t}\n\n\treturn l * ((n / p - 1) * p + (n % p + 1)) + count(p - 1)\n}\n\nfunc main() {\n\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tfmt.Fprintln(out, count(NextInt64()))\n}\n\nfunc Next() string{\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn in.Text()\n}\n\nfunc NextInt() int{\n\tret, _ := strconv.Atoi(Next())\n\treturn ret\n}\n\nfunc NextInt64() int64 {\n\tret, _ := strconv.ParseInt(Next(), 10, 64)\n\treturn ret\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"os\"\n)\n\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc count(n int64) int64 {\n\tif n < 10 {\n\t\treturn int64(n)\n\t}\n\tvar l, p int64 = 1, 1\n\tfor p * 10 <= n {\n\t\tl++\n\t\tp *= 10\n\t}\n\n\treturn l * (n / p) * (n % p + 1) + count(p - 1)\n}\n\nfunc main() {\n\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tfmt.Fprintln(out, count(NextInt64()))\n}\n\nfunc Next() string{\n\tif !in.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn in.Text()\n}\n\nfunc NextInt() int{\n\tret, _ := strconv.Atoi(Next())\n\treturn ret\n}\n\nfunc NextInt64() int64 {\n\tret, _ := strconv.ParseInt(Next(), 10, 64)\n\treturn ret\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var n, d, c, ans int\n \n fmt.Fscan(scanner, &n)\n for c = 1; c <= n; c *= 10 {\n d++\n }\n //writer.WriteString(strconv.Itoa(c))\n c /= 10\n ans = (n - c + 1) * d;\n for d > 0 {\n ans += (c - c / 10) * (d-1);\n d--\n c /= 10\n }\n \n writer.WriteString(strconv.Itoa(ans))\n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n //io\n scanner := bufio.NewReader(os.Stdin)\n writer := bufio.NewWriter(os.Stdout)\n //---\n var n, d, c, ans int\n \n fmt.Fscan(scanner, &n)\n for c = 1; c <= n; c *= 10 {\n d++\n }\n //writer.WriteString(strconv.Itoa(c))\n c /= 10\n b := d\n ans = (n - c) * d;\n for d > 0 {\n ans += (c - c / 10) * (b-d+1);\n d--\n c /= 10\n }\n \n writer.WriteString(strconv.Itoa(ans))\n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int\n\tfmt.Scanf(\"%d\", &input)\n\tdigits := countDigits(input)\n\trem := (input - pow10(digits-1) + 1) * digits\n\tres := 0\n\tfor i := 1; i < digits; i++ {\n\t\tres += (pow10(i) - pow10(i-1)) * i\n\t}\n\tfmt.Println(res + rem)\n}\n\nfunc pow10(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor ; n > 0; n-- {\n\t\t\tres *= 10\n\t\t}\n\t\treturn res\n\t}\n}\n\nfunc countDigits(ub int) int {\n\tcount := 0\n\tfor ; ub > 0; ub /= 10 {\n\t\tcount++\n\t}\n\treturn count\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int\n\tfmt.Scanf(\"%d\", &input)\n\tdigits := countDigits(input)\n\trem := (input - pow10(digits-1) + 1) * digits\n\tres := 0\n\tfor i := 1; i < digits; i++ {\n\t\tres += pow10(i) - 1\n\t}\n\tfmt.Println(res + rem)\n}\n\nfunc pow10(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor ; n > 0; n-- {\n\t\t\tres *= 10\n\t\t}\n\t\treturn res\n\t}\n}\n\nfunc countDigits(ub int) int {\n\tcount := 0\n\tfor ; ub > 0; ub /= 10 {\n\t\tcount++\n\t}\n\treturn count\n}\n"}], "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9"} {"source_code": "//http://codeforces.com/problemset/problem/391/A\n//A. Genetic Engineering\n// az osszes futamot figyelni kell\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tnd, i, run, ans int32\n\t\td string\n\t\tprev, akt byte\n\t)\n\n\tfmt.Scan(&d)\n\tnd = int32(len(d))\n\n\t//\tfmt.Println(d, nd)\n\n\tprev, run = d[0], 1\n\n\tfor i = 1; i < nd; i++ {\n\t\takt = d[i]\n\t\tif prev == akt {\n\t\t\trun++\n\t\t} else {\n\t\t\tif 0 == (run % 2) {\n\t\t\t\tans++\n\t\t\t}\n\t\t\tprev = akt\n\t\t\trun = 1\n\t\t}\n\t}\n\tif 0 == (run % 2) {\n\t\tans++\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\", &s)\n\tcount, ans := 1, 0\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] == s[i-1] {\n\t\t\tcount++\n\t\t} else {\n\t\t\tcount, ans = 1, ans+1-(count%2)\n\t\t}\n\t}\n\tans = ans + 1 - (count % 2)\n\tfmt.Printf(\"%d\", ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t// \"time\"\n)\n\nfunc main() {\n\t// defer func(start time.Time) {\n\t// \tfmt.Println(time.Since(start))\n\t// }(time.Now())\n\n\treader := bufio.NewReader(os.Stdin)\n\n\tvar s string\n\tfmt.Fscan(reader, &s)\n\tvar c uint8\n\tvar index, count int\n\n\t// fmt.Println(s)\n\tfor i:=0; i0;i--{\r\n\t\t\t\tif a%i == 0 {\r\n\t\t\t\t\tif b%i == 0 {\r\n\t\t\t\t\t\treturn i\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tif a%b == 0 {\r\n\t\t\treturn b\r\n\t\t} else {\r\n\t\t\tfor i:=b/2;i>0;i--{\r\n\t\t\t\tif b%i == 0 {\r\n\t\t\t\t\tif a%i == 0 {\r\n\t\t\t\t\t\treturn i\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn 1\r\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar t int\n\tfmt.Scanf(\"%d\\n\", &t)\n\n\tfor ; t > 0; t-- {\n\t\tvar k int\n\t\tfmt.Scanf(\"%d\\n\", &k)\n\n\t\tif k == 100 {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tcurr := lcm(k, 100-k)\n\t\t\tfmt.Println(curr/k + curr/(100-k))\n\t\t}\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 * b / gcd(a, b)\n}\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nfunc gcd(a, b int) int {\r\n\tfor b != 0 {\r\n\t\ta, b = b, a%b\r\n\t}\r\n\treturn a\r\n}\r\n\r\nfunc main() {\r\n\tin := bufio.NewReader(os.Stdin)\r\n\tout := bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\r\n\tvar T int\r\n\tfmt.Fscan(in, &T)\r\n\tfor t := 0; t < T; t++ {\r\n\t\tvar k int\r\n\t\tfmt.Fscan(in, &k)\r\n\r\n\t\tfmt.Fprintln(out, 100/(gcd(k, 100)))\r\n\t}\r\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\n// var m []int\n// err = json.Unmarshal([]byte(r.FormValue(\"example\")), &m)\n\n// for i := 0; i < len(m); i++ {\n// \tfmt.Println(m[i])\n// }\n\n// sort.Slice(arr, func(i, j int) bool {\n// \treturn arr[i] > arr[j]\n// })\n\nfunc MIN(x, y int64) int64 {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc MKO(x, y int64) int64 {\n\tif x < y {\n\t\treturn 0\n\t} else {\n\t\treturn x - y + 1\n\t}\n}\n\nfunc MAX(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc LCM(x, y int) int {\n\tif x >= y {\n\t\tinitial := x\n\t\tfor i := 1; i < y+2; i++ {\n\t\t\tif initial%y == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + x\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t} else {\n\t\tinitial := y\n\t\tfor i := 1; i < x+2; i++ {\n\t\t\tif initial%x == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + y\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t}\n}\n\nfunc GCD(x, y int64) int64 {\n\tvar l, q int64\n\tl = MAX(x, y)\n\tq = MIN(x, y)\n\tvar m int64\n\tfor l*q > 0 {\n\t\ta := l % q\n\t\tb := l - a\n\t\tcc := int64(b / q)\n\t\tremain := l - cc*q\n\t\tl = MAX(remain, q)\n\t\tq = MIN(remain, q)\n\t\tif l*q == 0 {\n\t\t\tm = l + q\n\t\t\tbreak\n\t\t}\n\n\t}\n\treturn m\n\n}\n\nfunc IsItPrime(x int) bool {\n\tif x < 10 {\n\t\tif x == 2 || x == 3 || x == 5 || x == 7 {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tj := 0\n\t\tk := math.Sqrt(float64(x))\n\t\tfor m := 3; m <= int(k); {\n\t\t\tif x%m == 0 {\n\t\t\t\tj = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm = m + 2\n\t\t}\n\t\tif j == 1 {\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n}\n\nvar t int\n\nfunc main() {\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &t)\n\tfor o := 0; o < t; o++ {\n\t\tvar k int\n\t\tfmt.Fscan(input, &k)\n\t\tm := 1\n\t\tif k%2 == 0 {\n\t\t\tm = m * 2\n\t\t\tk = int(k / 2)\n\t\t}\n\t\tif k%2 == 0 {\n\t\t\tm = m * 2\n\t\t\tk = int(k / 2)\n\t\t}\n\t\tif k%5 == 0 {\n\t\t\tm = m * 5\n\t\t\tk = int(k / 5)\n\t\t}\n\t\tif k%5 == 0 {\n\t\t\tm = m * 5\n\t\t\tk = int(k / 5)\n\t\t}\n\t\tfmt.Println(100 / m)\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n)\n\n// var m []int\n// err = json.Unmarshal([]byte(r.FormValue(\"example\")), &m)\n\n// for i := 0; i < len(m); i++ {\n// \tfmt.Println(m[i])\n// }\n\n// sort.Slice(arr, func(i, j int) bool {\n// \treturn arr[i] > arr[j]\n// })\n\nfunc MIN(x, y int64) int64 {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc MKO(x, y int64) int64 {\n\tif x < y {\n\t\treturn 0\n\t} else {\n\t\treturn x - y + 1\n\t}\n}\n\nfunc MAX(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc LCM(x, y int) int {\n\tif x >= y {\n\t\tinitial := x\n\t\tfor i := 1; i < y+2; i++ {\n\t\t\tif initial%y == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + x\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t} else {\n\t\tinitial := y\n\t\tfor i := 1; i < x+2; i++ {\n\t\t\tif initial%x == 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tinitial = initial + y\n\t\t\t}\n\n\t\t}\n\t\treturn initial\n\t}\n}\n\nfunc GCD(x, y int64) int64 {\n\tvar l, q int64\n\tl = MAX(x, y)\n\tq = MIN(x, y)\n\tvar m int64\n\tfor l*q > 0 {\n\t\ta := l % q\n\t\tb := l - a\n\t\tcc := int64(b / q)\n\t\tremain := l - cc*q\n\t\tl = MAX(remain, q)\n\t\tq = MIN(remain, q)\n\t\tif l*q == 0 {\n\t\t\tm = l + q\n\t\t\tbreak\n\t\t}\n\n\t}\n\treturn m\n\n}\n\nfunc IsItPrime(x int) bool {\n\tif x < 10 {\n\t\tif x == 2 || x == 3 || x == 5 || x == 7 {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tj := 0\n\t\tk := math.Sqrt(float64(x))\n\t\tfor m := 3; m <= int(k); {\n\t\t\tif x%m == 0 {\n\t\t\t\tj = 1\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tm = m + 2\n\t\t}\n\t\tif j == 1 {\n\t\t\treturn false\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n}\n\nvar t int\n\nfunc main() {\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &t)\n\tfor o := 0; o < t; o++ {\n\t\tvar k int64\n\t\tfmt.Fscan(input, &k)\n\n\t\tif k == 100 {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tm := GCD(k, 100-k)\n\t\t\tsum := int(k/m) + int((100-k)/m)\n\t\t\tfmt.Println(sum)\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tinput := bufio.NewReader(os.Stdin)\n\tvar T int\n\t_, err := fmt.Fscanln(input, &T)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor k := 0; k < T; k++ {\n\t\tvar x int\n\t\t_, err := fmt.Fscanln(input, &x)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tans := 100\n\t\tfor _, y := range ps {\n\t\t\tif x%y == 0 {\n\t\t\t\tx /= y\n\t\t\t\tans /= y\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\nvar (\n\tps = []int{2, 2, 5, 5}\n)\n"}, {"source_code": "package main\r\n \r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n \r\nfunc main() {\r\n\tinput := bufio.NewReader(os.Stdin)\r\n\tvar T int\r\n\t_, err := fmt.Fscanln(input, &T)\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tfor k := 0; k < T; k++ {\r\n\t\tvar x int\r\n\t\t_, err := fmt.Fscanln(input, &x)\r\n\t\tif err != nil {\r\n\t\t\tpanic(err)\r\n\t\t}\r\n\t\tans := 100\r\n\t\tfor _, y := range ps {\r\n\t\t\tif x%y == 0 {\r\n\t\t\t\tx /= y\r\n\t\t\t\tans /= y\r\n\t\t\t}\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\t}\r\n}\r\n \r\nvar (\r\n\tps = []int{2, 2, 5, 5}\r\n)"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"strconv\"\r\n\t\"strings\"\r\n)\r\n\r\ntype CF1525A struct {\r\n\tsc *bufio.Reader\r\n\tsplit []string\r\n\tindex int\r\n\tseparator string\r\n}\r\n\r\nfunc (in *CF1525A) GetLine() string {\r\n\tline, err := in.sc.ReadString('\\n')\r\n\tif err != nil {\r\n\t\tfmt.Println(\"error line:\", line, \" err: \", err)\r\n\t}\r\n\tin.split = []string{}\r\n\tin.index = 0\r\n\treturn line\r\n}\r\nfunc (in *CF1525A) load() {\r\n\tif len(in.split) <= in.index {\r\n\t\tin.split = strings.Split(in.GetLine(), in.separator)\r\n\t\tin.index = 0\r\n\t}\r\n}\r\n\r\nfunc (in *CF1525A) NextInt() int {\r\n\tin.load()\r\n\tval, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1525A) NextInt64() int64 {\r\n\tin.load()\r\n\tval, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\nfunc (in *CF1525A) NextString() string {\r\n\tin.load()\r\n\tval := strings.TrimSpace(in.split[in.index])\r\n\tin.index++\r\n\treturn val\r\n}\r\n\r\n/**\r\nRun solve the problem CF1525A\r\nDate: 22/11/21\r\nUser: epradere\r\nURL: https://codeforces.com/problemset/problem/1525/A\r\nProblem: CF1525A\r\n**/\r\nfunc (in *CF1525A) Run() {\r\n\tfor t := in.NextInt(); t > 0; t-- {\r\n\t\tmagic := in.NextInt()\r\n\t\twater := 100 - magic\r\n\t\tdiv := Max(magic, water)\r\n\t\tans := 0\r\n\t\tfor {\r\n\t\t\tif magic%div == 0 && water%div == 0 {\r\n\t\t\t\tmagic /= div\r\n\t\t\t\twater /= div\r\n\t\t\t\tdiv = Max(magic, water)\r\n\t\t\t} else {\r\n\t\t\t\tdiv--\r\n\t\t\t}\r\n\t\t\tif div == 1 {\r\n\t\t\t\tans = magic + water\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\tfmt.Println(ans)\r\n\r\n\t}\r\n}\r\n\r\nfunc Max(a, b int) int {\r\n\tif a > b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc NewCF1525A(r *bufio.Reader) *CF1525A {\r\n\treturn &CF1525A{\r\n\t\tsc: r,\r\n\t\tsplit: []string{},\r\n\t\tindex: 0,\r\n\t\tseparator: \" \",\r\n\t}\r\n}\r\n\r\nfunc main() {\r\n\tNewCF1525A(bufio.NewReader(os.Stdin)).Run()\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nvar (\r\n\treader = bufio.NewReader(os.Stdin)\r\n\tt, k int\r\n)\r\n\r\nfunc gcd(x, y int) int {\r\n\tif x < y {\r\n\t\tx, y = y, x\r\n\t}\r\n\tfor y > 0 {\r\n\t\tx, y = y, x%y\r\n\t}\r\n\treturn x\r\n}\r\n\r\nfunc solve(k int) int {\r\n\tg := gcd(k, 100-k)\r\n\treturn 100 / g\r\n}\r\n\r\nfunc main() {\r\n\tfmt.Fscan(reader, &t)\r\n\tfor ; t > 0; t-- {\r\n\t\tfmt.Fscan(reader, &k)\r\n\t\tfmt.Println(solve(k))\r\n\t}\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport \"fmt\"\r\n\r\n//t = int(input())\r\n//for _ in range(t):\r\n// k = int(input())\r\n// n = 100\r\n// while n != k:\r\n// if n > k:\r\n// n -= k\r\n// else:\r\n// k -= n\r\n// print(int(100 / k))\r\n\r\nfunc main() {\r\n\tvar t int\r\n\tfmt.Scanln(&t)\r\n\tfor i := 0; i < t; i++ {\r\n\t\tvar k int\r\n\t\tfmt.Scanln(&k)\r\n\t\tn := 100\r\n\t\tfor n != k {\r\n\t\t\tif n > k {\r\n\t\t\t\tn -= k\r\n\t\t\t} else {\r\n\t\t\t\tk -= n\r\n\t\t\t}\r\n\t\t}\r\n\t\tfmt.Println(100 / k)\r\n\t}\r\n}"}, {"source_code": "// \u8981\u6c42essence\u8fbe\u5230\u7279\u5b9a\u767e\u5206\u6bd4\uff0c\u4f46\u603b\u91cf\u6700\u5c11\uff0c\u672c\u8d28\u4e0a\u5c31\u662f\u6c42essence\u4e0e100\u7684\u6700\u5927\u516c\u7ea6\u6570\uff0c\u7ea6\u6389\u3002\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar t, k int\n\tfmt.Scan(&t)\n\tfor i := 0; i < t; i++ {\n\t\tfmt.Scan(&k)\n\t\tfmt.Println(100 / gcd(100, k))\n\t}\n}\n\n// \u6c42\u6700\u5927\u516c\u7ea6\u6570\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nfunc min(a, b int) int {\r\n\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc run(r io.Reader, w io.Writer) {\r\n\r\n\tin := bufio.NewReader(r)\r\n\tout := bufio.NewWriter(w)\r\n\tdefer out.Flush()\r\n\r\n\tsolve := func() {\r\n\r\n\t\tvar n int\r\n\t\t\r\n\r\n\r\n\t\tfmt.Fscan(in, &n)\r\n \t\t\r\n \t\t\r\n\t\tfmt.Fprintln(out, 100 / gcd(n,100) )\r\n\r\n\t\r\n\r\n\t}\r\n\r\n\tT := 1\r\n\tfmt.Fscan(in, &T)\r\n\tfor o := 0; o < T; o++ {\r\n\t\tsolve()\r\n\t}\r\n\r\n}\r\n\r\nfunc main() {\r\n\r\n\trun(os.Stdin, os.Stdout)\r\n}\r\n\r\nfunc gcd(a, b int) int {\r\n\tfor a != 0 {\r\n\t\ta, b = b%a, a\r\n\t\t//fmt.Println(\"a =>\",a , \"b =>\",b)\r\n\t}\r\n\treturn b\r\n}"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"os\"\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\r\n\tr := bufio.NewReader(os.Stdin)\r\n\r\n\tvar t int\r\n\r\n\tfmt.Fscan(r, &t)\r\n\r\n\r\n\tfor i := 0; i < t; i++ {\r\n\t\tvar k int\r\n\r\n\t\tfmt.Fscan(r, &k)\r\n\r\n\t\tans := solve(k)\r\n\r\n\t\tfmt.Println(ans)\r\n\r\n\t}\r\n}\r\n\r\nfunc solve(k int) int {\r\n\tfor j := 0; j <= 100; j++ {\r\n\t\tfor p := 0; p <= 100; p++ {\r\n\t\t\tif j == 0 && p == 0 {\r\n\t\t\t\tcontinue\r\n\t\t\t}\r\n\t\t\tif 100 * j == k * (j + p) {\r\n\t\t\t\treturn j + p\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn -1\r\n}\r\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strings\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tsolve := func(Case int) {\n\t\tvar n int\n\t\tFscan(in, &n)\n\t\tg := gcd(n,100)\n\t\tFprintln(out, 100/g)\n\t}\n\n\tT := 1\n\tFscan(in, &T) //\n\tfor Case := 1; Case <= T; Case++ {\n\t\tsolve(Case)\n\t}\n\n\t_leftData, _ := ioutil.ReadAll(in)\n\tif _s := strings.TrimSpace(string(_leftData)); _s != \"\" {\n\t\tpanic(\"\u6709\u672a\u8bfb\u5165\u7684\u6570\u636e\uff1a\\n\" + _s)\n\t}\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\nfunc gcd(a, b int) int {\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar t int\n\tfmt.Scan(\"%d\", &t)\n\n\tfor ; t > 0; t-- {\n\t\tvar k int\n\t\tfmt.Scan(\"%d\", &k)\n\n\t\tif k == 100 {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tcurr := lcm(k, 100-k)\n\t\t\tfmt.Println(curr/k + curr/(100-k))\n\t\t}\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 * b / gcd(a, b)\n}\n"}, {"source_code": "package main\r\nimport( \r\n \"fmt\"\r\n \"bufio\"\r\n \"os\"\r\n)\r\nfunc main() {\r\n\tin:= bufio.NewReader(os.Stdin)\r\n\tout:= bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\tvar t int\r\n\tfmt.Fscan(in,&t)\r\n\tfor i:=0;i 1\n}\n\nfunc withSameCase(word string) string {\n\tlowerCount := 0\n\tfor _, letter := range word {\n\t\tif unicode.IsLower(letter) {\n\t\t\tlowerCount++\n\t\t}\n\t}\n\tif lowerCount*2 >= len(word) {\n\t\treturn strings.ToLower(word)\n\t}\n\treturn strings.ToUpper(word)\n}\n\nfunc solve(matrix [][]int) []string {\n\tn := 3\n\tstate := make([][]byte, n)\n\tfor i := range state {\n\t\tstate[i] = make([]byte, n)\n\t\tfor j := range matrix[i] {\n\t\t\tstate[i][j] = byte(matrix[i][j])\n\t\t\tif i > 0 {\n\t\t\t\tstate[i][j] += byte(matrix[i-1][j])\n\t\t\t}\n\t\t\tif i+1 < n {\n\t\t\t\tstate[i][j] += byte(matrix[i+1][j])\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tstate[i][j] += byte(matrix[i][j-1])\n\t\t\t}\n\t\t\tif j+1 < n {\n\t\t\t\tstate[i][j] += byte(matrix[i][j+1])\n\t\t\t}\n\t\t\tstate[i][j] &= 1\n\t\t\tstate[i][j] ^= 1\n\t\t\tstate[i][j] += '0'\n\t\t}\n\t}\n\tres := make([]string, n)\n\tfor i := range res {\n\t\tres[i] = string(state[i])\n\t}\n\treturn res\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 max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max64(a, b int64) int64 {\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 min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar (\n\treader = bufio.NewReaderSize(os.Stdin, 1<<13)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<13)\n)\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc read2i() (int, int) {\n\treturn readi(), readi()\n}\n\nfunc read3i() (int, int, int) {\n\treturn readi(), readi(), readi()\n}\n\nfunc read4i() (int, int, int, int) {\n\treturn readi(), readi(), readi(), readi()\n}\n\nfunc readis(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tres[i] = readi()\n\t}\n\treturn res\n}\n\nfunc readi64() int64 {\n\tb, err := reader.ReadByte()\n\tfor !isValid(b, err) {\n\t\tb, err = reader.ReadByte()\n\t}\n\tsign, res := int64(1), int64(0)\n\tif b == '-' {\n\t\tsign *= -1\n\t\tb, err = reader.ReadByte()\n\t}\n\tfor isValid(b, err) {\n\t\tres = res*10 + int64(b-'0')\n\t\tb, err = reader.ReadByte()\n\t}\n\treturn res * sign\n}\n\nfunc readi64s(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = readi64()\n\t}\n\treturn res\n}\n\nfunc readline() string {\n\tres := new(bytes.Buffer)\n\tfor {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res.String()\n}\n\nfunc isValid(b byte, err error) bool {\n\treturn err == nil && (('0' <= b && b <= '9') || b == '-')\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tx:= [...]int{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47}\n\tvar n,m int\n\tp:=15\n\tfmt.Scan(&n,&m)\n\to:=false\n\tfor i:=0;i= i (dari 2..(i-1))\n if i%j == 0 { prime = false; break }// jika i habis dibagi j, maka prime diubah menjadi false dan break\n }\n if prime { // jika nilai prime = true\n if i == m { ans = true } // jika nilai i sama dengan nilai m, maka ans diubah menjadi true\n break // break dari looping\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") } // jika nilai ans = true, maka cetak output \"YES\". Jika tidak, maka cetak output \"NO\"\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n,m int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d\\n\", &n, &m)\n\tif check(n,m){\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\nfunc check(n int, m int) bool{\n\tfor i:= n + 1; i <= m; i++{\n\t\tif checkPrime(i) > 0{\n\t\t\tif i == m{\n\t\t\t\treturn true\n\t\t\t}else{\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\nfunc checkPrime(a int) int{\n\tfor k:= 2; k < a; k++{\n\t\tif a % k == 0{\n\t\t\treturn -1\n\t\t}\n\t}\n\treturn a\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tx:= [...]int{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47}\n\tvar n,m int\n\tp:=15\n\tfmt.Scan(&n,&m)\n\to:=false\n\tfor i:=0;i 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = mul(ret, a)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = mul(a, a)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar O = int64(R - L + 1) / 2\n\tvar E = int64(R - L + 1) / 2\n\tif (R - L + 1) % 2 != 0 {\n\t\tif L%2 == 0 {\n\t\t\tE++\n\t\t} else {\n\t\t\tO++\n\t\t}\n\t}\n\n\tvar T = int64(n) * int64(m)\n\n\tvar mt = matrix{}\n\tmt.f[0][0] = E\n\tmt.f[0][1] = O\n\tmt.f[1][0] = O\n\tmt.f[1][1] = E\n\n\t//print_out(mt)\n\n\tmt = pw(mt, T - 1)\n\n\t//print_out(mt)\n\n\tvar dp_odd = O\n\tvar dp_evn = E\n\n\tvar fn_dp_odd = mt.f[0][0] * dp_odd % mod + mt.f[1][0] * dp_evn % mod\n\tfn_dp_odd %= mod\n\n\tvar fn_dp_evn = mt.f[1][0] * dp_odd % mod + mt.f[1][1] * dp_evn % mod\n\tfn_dp_evn %= mod\n\n\tvar ret int64\n\tif T % 2 == 1 {\n\t\tret = (fn_dp_odd + fn_dp_evn) % mod\n\t} else {\n\t\tret = fn_dp_evn\n\t}\n\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int64, b int64) int64 {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = int64(1)\n\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = ret * a % mod\n\t\t\tb--\n\t\t} else {\n\t\t\ta = a * a % mod\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int64(n) * int64(m)\n\n\tvar ret = pw(int64(evn + odd), T)\n\tret = (ret + pw(int64(evn - odd + mod), T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tif T % 2 == 1 {\n\t\tevn, odd = odd, evn\n\t\tret += pw(int64(evn + odd), T)\n\t\tret %= mod\n\t\tret += pw(int64(evn - odd + mod), T)\n\t\tret %= mod\n\t}\n\n\tret = ret * pw(2, mod - 2) % mod\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd + mod, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tif int64(n) * int64(m) % 2 == 1 {\n\t\tevn, odd = odd, evn\n\t\tret += pw(evn + odd, T)\n\t\tret %= mod\n\t\tret += pw(evn - odd + mod, T)\n\t\tret %= mod\n\t}\n\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst mod = 998244353\nvar n, m, L, R int\n\nfunc pw(a int, b int) int {\n\tif a == 0 {\n\t\tif b == 0 {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}\n\tvar ret = 1\n\tfor b > 0 {\n\t\tif (b & 1) == 1 {\n\t\t\tret = int(int64(ret) * int64(a) % mod)\n\t\t\tb--\n\t\t} else {\n\t\t\ta = int(int64(a) * int64(a) % mod)\n\t\t\tb /= 2\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar reader = bufio.NewReader(os.Stdin)\n\tvar writer = bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &m, &L, &R)\n\n\tvar diff = R - L + 1\n\tvar odd = diff / 2\n\tvar evn = diff / 2\n\n\tif diff % 2 != 0 {\n\t\tif L % 2 == 0 {\n\t\t\tevn++\n\t\t} else {\n\t\t\todd++\n\t\t}\n\t}\n\n\tvar T = int(int64(n) * int64(m) % (mod - 1))\n\tvar ret = pw(evn + odd, T)\n\tret = (ret + pw(evn - odd, T)) % mod\n\n\tif ret < 0 {\n\t\tret += mod\n\t}\n \n // review\n\tret = int(int64(ret) * int64(pw(2, mod - 2)) % mod)\n\tfmt.Fprintf(writer, \"%d\", ret)\n}\n"}], "src_uid": "ded299fa1cd010822c60f2389a3ba1a3"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\treadInt()\n\tk := readInt()\n\tq := readString()\n\topenAt := make([]bool, 26)\n\tclosedAt := make([]int, 26)\n\tfor i := 0; i < len(closedAt); i++ {\n\t\tclosedAt[i] = -1\n\t\topenAt[i] = false\n\t}\n\tfor i := 0; i < len(q); i++ {\n\t\tclosedAt[q[i]-'A'] = i\n\t}\n\n\tfor i := 0; i < len(q); i++ {\n\t\tv := q[i] - 'A'\n\t\tif !openAt[v] {\n\t\t\tk--\n\t\t\tif k < 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\topenAt[v] = true\n\t\t}\n\t\tif closedAt[v] == i {\n\t\t\tk++\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(io *FastIO) {\n\tN := io.NextInt()\n\tK := io.NextInt()\n\tS := io.NextString()\n\n\topen := make([]int, 26)\n\tclose := make([]int, 26)\n\n\tFillArray(open, -1)\n\tFillArray(close, -1)\n\n\tfor i := N - 1; i >= 0; i-- {\n\t\td := S[i] - 'A'\n\t\topen[d] = i\n\t}\n\tfor i, c := range S {\n\t\td := c - 'A'\n\t\tclose[d] = i\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tguards := 0\n\t\tfor d := 0; d < 26; d++ {\n\t\t\tif open[d] <= i && i <= close[d] {\n\t\t\t\tguards++\n\t\t\t}\n\t\t}\n\t\tif guards > K {\n\t\t\tio.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tio.Println(\"NO\")\n}\n\nfunc FillArray(arr []int, val int) {\n\tfor i := range arr {\n\t\tarr[i] = val\n\t}\n}\n\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "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\tK := sc.NextInt()\n\n\tS := sc.Next()\n\n\tAs := make([]int, 26)\n\tAe := make([]int, 26)\n\n\tfor i, _ := range As {\n\t\tAs[i] = -1\n\t\tAe[i] = -1\n\t}\n\n\tfor i, _ := range S {\n\n\t\ts := S[i]\n\n\t\tif As[s-'A'] < 0 {\n\t\t\tAs[s-'A'] = i\n\t\t}\n\n\t\tAe[s-'A'] = i\n\t}\n\n\timos := make([]int, N+1)\n\n\tfor i, _ := range As {\n\t\tif As[i] >= 0 {\n\t\t\timos[As[i]]++\n\t\t\timos[Ae[i]+1]--\n\t\t}\n\t}\n\n\ta := 0\n\tfor i, _ := range imos {\n\t\ta += imos[i]\n\t\tif a > K {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\tcapacity := 8 * 1024 * 1024\n\ts.Buffer(make([]byte, capacity), capacity)\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\ts.Text()\n\n\ts.Scan()\n\tk, _ := strconv.Atoi(s.Text())\n\n\ts.Scan()\n\td := s.Text()\n\n\tf := make([]int, 26)\n\tl := make([]int, 26)\n\tfor i := range f {\n\t\tl[i] = -1\n\t\tf[i] = -1\n\t}\n\tfor i, c := range d {\n\t\tl[c-65] = i\n\t\tif f[c-65] == -1 {\n\t\t\tf[c-65] = i\n\t\t}\n\t}\n\tt := make([]int, len(d))\n\tfor i := 0; i < 26; i++ {\n\t\tif f[i] != -1 {\n\t\t\tt[f[i]]++\n\t\t}\n\t\tif l[i] != -1 && l[i]+1 < len(d) {\n\t\t\tt[l[i]+1]--\n\t\t}\n\t}\n\tvar m, cur int\n\tfor i := 0; i < len(d); i++ {\n\t\tcur = cur + t[i]\n\t\tif m < cur {\n\t\t\tm = cur\n\t\t}\n\t}\n\tif m > k {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\ts.Text()\n\n\ts.Scan()\n\tk, _ := strconv.Atoi(s.Text())\n\n\ts.Scan()\n\td := s.Text()\n\n\tf := make([]int, 26)\n\tl := make([]int, 26)\n\tfor i := range f {\n\t\tl[i] = -1\n\t\tf[i] = -1\n\t}\n\tfor i, c := range d {\n\t\tl[c-65] = i\n\t\tif f[c-65] == -1 {\n\t\t\tf[c-65] = i\n\t\t}\n\t}\n\tt := make([]int, len(d))\n\tfor i := 0; i < 26; i++ {\n\t\tif f[i] != -1 {\n\t\t\tt[f[i]]++\n\t\t}\n\t\tif l[i] != -1 {\n\t\t\tt[l[i]]--\n\t\t}\n\t}\n\tvar m, cur int\n\tfor i := 0; i < len(d); i++ {\n\t\tcur = cur + t[i]\n\t\tif m < cur {\n\t\t\tm = cur\n\t\t}\n\t}\n\tif m > k {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\ts.Text()\n\n\ts.Scan()\n\tk, _ := strconv.Atoi(s.Text())\n\n\ts.Scan()\n\td := s.Text()\n\n\tf := make([]int, 26)\n\tl := make([]int, 26)\n\tfor i := range f {\n\t\tl[i] = -1\n\t\tf[i] = -1\n\t}\n\tfor i, c := range d {\n\t\tl[c-65] = i\n\t\tif f[c-65] == -1 {\n\t\t\tf[c-65] = i\n\t\t}\n\t}\n\tt := make([]int, len(d))\n\tfor i := 0; i < 26; i++ {\n\t\tif f[i] != -1 {\n\t\t\tt[f[i]]++\n\t\t}\n\t\tif l[i] != -1 && l[i]+1 < len(d) {\n\t\t\tt[l[i]+1]--\n\t\t}\n\t}\n\tvar m, cur int\n\tfor i := 0; i < len(d); i++ {\n\t\tcur = cur + t[i]\n\t\tif m < cur {\n\t\t\tm = cur\n\t\t}\n\t}\n\tif m > k {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "216323563f5b2dd63edc30cb9b4849a5"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nimport \"strings\"\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text, \"\\r\\n\")\n\ts := strings.Split(text, \" \")\n\n\tx, _ := strconv.ParseInt(s[0], 10, 64)\n\ty, _ := strconv.ParseInt(s[1], 10, 64)\n\tif y > x {\n\t\tt := x\n\t\tx = y\n\t\ty = t\n\t}\n\tt := []int64{y, y, y}\n\tsec := 0\n\tfor t[2] != x {\n\t\tv := t[0] + t[1] - 1\n\t\tif v >= x {\n\t\t\tv = x\n\t\t}\n\t\tt[2] = t[1]\n\t\tt[1] = t[0]\n\t\tt[0] = v\n\t\tsec += 1\n\t}\n\tfmt.Println(sec)\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc main() {\n bufin = bufio.NewReader(os.Stdin)\n bufout = bufio.NewWriter(os.Stdout)\n defer bufout.Flush()\n\n var x, y int\n fmt.Fscanf(bufin, \"%d %d\\n\", &x, &y)\n\n var a []int = []int{y, y, y}\n res := 0\n\n i := 0\n j := 1\n k := 2\n\n for (a[i] < x) || (a[j] < x) || (a[k] < x) {\n res++\n a[k] = a[i] + a[j] - 1\n if a[k] > x {\n a[k] = x\n }\n i, j, k = j, k, i\n }\n\n fmt.Fprintf(bufout, \"%d\\n\", res)\n}\n"}, {"source_code": "// http://codeforces.com/contest/712/problem/C\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"math\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc check(m [3]int, val int) bool {\n\treturn m[0] >= val && m[1] >= val && m[2] >= val\n}\n\nfunc main() {\n\tvar x, y int\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscanln(input, &x, &y)\n\tif x == y {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\n\ttr := [3]int{y, y, y}\n\n\tidx := 0\n\tans := 0\n\n\tfor {\n\t\tif tr[idx] >= x {\n\t\t\tidx = (idx + 1) % 3\n\t\t\tcontinue\n\t\t}\n\n\t\tans++\n\t\ttr[idx] = min(int(math.Abs(float64(tr[(idx + 1) % 3] + tr[(idx + 2) % 3]))) - 1, x)\n\t\tif tr[idx] >= x {\n\t\t\tif check(tr, x) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tidx = (idx + 1) % 3\n\n\t}\n\n\tfmt.Println(ans)\n}"}], "negative_code": [], "src_uid": "8edf64f5838b19f9a8b19a14977f5615"} {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,a,b,c,d,m1,m2,tot int\n\tfmt.Scan(&n)\n\tflag:=false\n\tfor i:=0;i<4;i++ {\n\t\tfmt.Scan(&a,&b,&c,&d)\n\t\tif a>b {\n\t\t\tm1=b\n\t\t} else { m1=a }\n\t\tif c>d {\n\t\t\tm2=d\n\t\t} else { m2=c }\n\t\ttot=m1+m2\n\t\tif tot<=n {\n\t\t\tfmt.Println(i+1,m1,n-m1)\n\t\t\tflag=true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag==false {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,a,b,c,d,x,y,z int\n fmt.Scan(&n)\n for i := 0; i < 4; i++ {\n fmt.Scan(&a,&b,&c,&d)\n if (a+c) <= n {\n x = i+1; y = a; z = n-a;\n } else if (a+d) <= n {\n x = i+1; y = a; z = n-a;\n } else if (b+c) <= n {\n x = i+1; y = b; z = n-b;\n } else if (b+d) <= n {\n x = i+1; y = b; z = n-b;\n }\n }\n if (x == 0) { fmt.Println(-1) } else { fmt.Println(x,y,z) }\n}\n"}, {"source_code": "// 366A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, m1, m2 int\n var s [5][5]int\n fmt.Scan(&n)\n for i := 1; i <= 4; i++ {\n for j := 1; j <= 4; j++ {\n fmt.Scan(&s[i][j])\n }\n\n }\n for i := 1; i <= 4; i++ {\n m1 = int(math.Min(float64(s[i][1]), float64(s[i][2])))\n m2 = int(math.Min(float64(s[i][3]), float64(s[i][4])))\n if m1+m2 <= n {\n fmt.Println(i, m1, n-m1)\n return\n }\n }\n fmt.Println(-1)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,a,b,c,d,x,y,z int\n fmt.Scan(&n)\n for i := 0; i < 4; i++ {\n fmt.Scan(&a,&b,&c,&d)\n if (a+c) <= n {\n x = i+1; y = a; z = n-a;\n } else if (a+d) <= n {\n x = i+1; y = a; z = n-a;\n } else if (b+c) <= n {\n x = i+1; y = b; z = n-b;\n } else if (b+d) <= n {\n x = i+1; y = b; z = n-b;\n }\n }\n if (x == 0) { fmt.Println(-1) } else { fmt.Println(x,y,z) }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,a,b,c,d,x,y,z int\n fmt.Scan(&n)\n for i := 0; i < 4; i++ {\n fmt.Scan(&a,&b,&c,&d)\n if (a+c) <= n {\n x = i+1; y = a; z = n-a;\n } else if (a+d) <= n {\n x = i+1; y = a; z = n-a;\n } else if (b+c) <= n {\n x = i+1; y = b; z = n-b;\n } else if (b+d) <= n {\n x = i+1; y = b; z = n-b;\n }\n }\n if (x == 0) { fmt.Println(-1) } else { fmt.Println(x,y,z) }\n}\n"}], "negative_code": [{"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,a,b,c,d,m1,m2,tot int\n\tfmt.Scan(&n)\n\tflag:=false\n\tfor i:=0;i<4;i++ {\n\t\tfmt.Scan(&a,&b,&c,&d)\n\t\tif a>b {\n\t\t\tm1=b\n\t\t} else { m1=a }\n\t\tif c>d {\n\t\t\tm1=d\n\t\t} else { m2=c }\n\t\ttot=m1+m2\n\t\tif tot<=n {\n\t\t\tfmt.Println(i+1,m1,n-m1)\n\t\t\tflag=true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag==false {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,a,b,c,d,m1,m2,tot int\n\tfmt.Scan(&n)\n\tflag:=false\n\tfor i:=0;i<4;i++ {\n\t\tfmt.Scan(&a,&b,&c,&d)\n\t\tif a>b {\n\t\t\tm1=b\n\t\t} else { m1=a }\n\t\tif c>d {\n\t\t\tm1=d\n\t\t} else { m2=c }\n\t\ttot=m1+m2\n\t\tif tot<=n {\n\t\t\tfmt.Println(i+1,m1,n-m1)\n\t\t\tflag=true\n\t\t}\n\t}\n\tif flag==false {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n"}], "src_uid": "6e7ee0da980beb99ca49a5ddd04089a5"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanner() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc main() {\n\tvar input []string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tinput = append(input, scanner.Text())\n\t}\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\n\ta1, _ := strconv.Atoi(input[0])\n\ta2, _ := strconv.Atoi(input[1])\n\tk1, _ := strconv.Atoi(input[2])\n\tk2, _ := strconv.Atoi(input[3])\n\tn, _ := strconv.Atoi(input[4])\n\n\tif k1 > k2 {\n\t\tk1, k2, a1, a2 = k2, k1, a2, a1\n\t}\n\tvar min, max int\n\n\tif a1*k1 >= n {\n\t\tmax = n / k1\n\t} else {\n\t\tmax = a1\n\t\tmax += (n - a1*k1) / k2\n\t}\n\n\tvar minCard int\n\n\tif k1 > 1 {\n\t\tminCard = a1 * (k1 - 1)\n\t}\n\tif k2 > 1 {\n\t\tminCard += a2 * (k2 - 1)\n\t}\n\n\tif minCard >= n {\n\t\tmin = 0\n\t} else {\n\t\tmin = n - minCard\n\t}\n\n\tfmt.Printf(\"%v %v\", min, max)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a1, a2, k1, k2, n int\n\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&a1)\n\tfmt.Scanln(&a2)\n\tfmt.Scanln(&k1)\n\tfmt.Scanln(&k2)\n\tfmt.Scanln(&n)\n\n\tmin := n - (((k1 - 1) * a1) + ((k2 - 1) * a2))\n\n\tif min <= 0 {\n\t\tmin = 0\n\t} else if min >= a1+a2 {\n\t\tmin = a1 + a2\n\t}\n\n\tmax := 0\n\tif k1 < k2 {\n\t\tmax = n / k1\n\n\t\tif max > a1 {\n\t\t\tmax = a1\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k1 * max\n\n\t\tx := n / k2\n\t\tif x > a2 {\n\t\t\tx = a2\n\t\t} else if x < 1 {\n\t\t\tx = 0\n\t\t}\n\t\tmax += x\n\n\t} else {\n\t\tmax = n / k2\n\n\t\tif max > a2 {\n\t\t\tmax = a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k2 * max\n\n\t\tx := n / k1\n\t\tif x > a1 {\n\t\t\tx = a1\n\t\t} else if x < 1 {\n\t\t\tx = 0\n\t\t}\n\t\tmax += x\n\t}\n\n\tfmt.Println(min, max)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan *bufio.Scanner\nvar writer io.Writer\n\nfunc init() {\n\tscan = bufio.NewScanner(os.Stdin)\n\twriter = os.Stdout\n\tscan.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tsolve()\n}\n\nfunc solve() {\n\ta1 := nextInt()\n\ta2 := nextInt()\n\tk1 := nextInt()\n\tk2 := nextInt()\n\tn := nextInt()\n\n\t//\ta := a1+a2\n\n\tres1 := a1 + a2\n\tres2 := 0\n\n\tfor i := 0; i <= a1; i++ {\n\t\ttmp1 := n - k1*i\n\t\tco1 := (k1 - 1) * (a1 - i)\n\t\tfor j := 0; j <= a2; j++ {\n\t\t\ttmp2 := tmp1 - k2*j\n\t\t\tco2 := (k2 - 1) * (a2 - j)\n\t\t\tif tmp2 >= 0 {\n\t\t\t\tif tmp2 <= co1+co2 {\n\t\t\t\t\tsum := i + j\n\t\t\t\t\tif res1 > sum {\n\t\t\t\t\t\tres1 = sum\n\t\t\t\t\t}\n\t\t\t\t\tif res2 < sum {\n\t\t\t\t\t\tres2 = sum\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprint(writer, res1, \" \", res2)\n}\n\nfunc nextWord() string {\n\tscan.Scan()\n\tstr := scan.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"}, {"source_code": "//HOWDY! IT'S ME! A HARD 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/*******************************************************************/\nfunc minPlayer(a1, a2, k1, k2, n int) int {\n\tn -= (k1-1)*a1 + (k2-1)*a2\n\tif n <= 0 {\n\t\treturn 0\n\t}\n\treturn min(a1+a2, n)\n}\n\nfunc maxPlayer(a1, a2, k1, k2, n int) int {\n\tp1 := min(a1, n/k1)\n\tn -= p1 * k1\n\tp2 := min(a2, n/k2)\n\treturn p1 + p2\n}\n\nfunc main() {\n\ta1 := ReadInt()\n\ta2 := ReadInt()\n\tk1 := ReadInt()\n\tk2 := ReadInt()\n\tn := ReadInt()\n\t//ensure k1 k2 {\n\t\ta1, a2 = a2, a1\n\t\tk1, k2 = k2, k1\n\t}\n\tfmt.Println(minPlayer(a1, a2, k1, k2, n), maxPlayer(a1, a2, k1, k2, n))\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+9))\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 readInt()\n}\nfunc ReadInt2() (int, int) {\n\treturn readInt(), readInt()\n}\nfunc ReadInt3() (int, int, int) {\n\treturn readInt(), readInt(), readInt()\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn readInt(), readInt(), readInt(), readInt()\n}\n\nfunc readInt64() int64 {\n\treturn readIntNbits(64)\n}\n\nfunc readInt() int {\n\treturn int(readIntNbits(32))\n}\n\nfunc readIntNbits(n int) int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, n)\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\n\tvar a1, a2, k1, k2, n int\n\n\tfmt.Fscanf(reader, \"%d\\n\", &a1)\n\tfmt.Fscanf(reader, \"%d\\n\", &a2)\n\tfmt.Fscanf(reader, \"%d\\n\", &k1)\n\tfmt.Fscanf(reader, \"%d\\n\", &k2)\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tif k1 < k2 {\n\t\ta1, a2 = a2, a1\n\t\tk1, k2 = k2, k1\n\t}\n\n\tr1 := n\n\tr1 -= a1 * (k1 - 1) + a2 * (k2 - 1)\n\tif r1 < 0 {\n\t\tr1 = 0\n\t}\n\n\tr2 := n\n\tr2 /= k2\n\tif r2 > a2 {\n\t\tr2 = a2\n\t}\n\n\tn -= r2 * k2\n\n\tr2 += n / k1\n\n\tfmt.Fprintf(writer, \"%d %d\\n\", r1, r2)\n\n\twriter.Flush()\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanner() string {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\treturn scanner.Text()\n\t}\n\treturn \"\"\n}\n\nfunc main() {\n\tvar input []string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tinput = append(input, scanner.Text())\n\t}\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\t// input = append(input, scanner())\n\n\ta1, _ := strconv.Atoi(input[0])\n\ta2, _ := strconv.Atoi(input[1])\n\tk1, _ := strconv.Atoi(input[2])\n\tk2, _ := strconv.Atoi(input[3])\n\tn, _ := strconv.Atoi(input[4])\n\n\tif a1*k1 > a2*k2 {\n\t\tk1, k2, a1, a2 = k2, k1, a2, a1\n\t}\n\tvar min, max int\n\n\tif a1*k1 >= n {\n\t\tmax = n / k1\n\t} else {\n\t\tmax = a1\n\t\tmax += (n - a1*k1) / k2\n\t}\n\n\tvar minCard int\n\n\tif k1 > 1 {\n\t\tminCard = a1 * (k1 - 1)\n\t}\n\tif k2 > 1 {\n\t\tminCard += a2 * (k2 - 1)\n\t}\n\n\tif minCard >= n {\n\t\tmin = 0\n\t} else {\n\t\tmin = n - minCard\n\t}\n\n\tfmt.Printf(\"%v %v\", min, max)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a1, a2, k1, k2, n int\n\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&a1)\n\tfmt.Scanln(&a2)\n\tfmt.Scanln(&k1)\n\tfmt.Scanln(&k2)\n\tfmt.Scanln(&n)\n\n\tmin := n - (((k1 - 1) * a1) + ((k2 - 1) * a2))\n\n\tif min <= 0 {\n\t\tmin = 0\n\t} else if min >= a1+a2 {\n\t\tmin = a1 + a2\n\t}\n\n\tmax := 0\n\tif k1 < k2 {\n\t\tmax = n / k1\n\n\t\tif max > a1 {\n\t\t\tmax = a1\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k1 * max\n\n\t\tx := n / k2\n\t\tif x > a2 {\n\t\t\tx = a2\n\t\t} else if x < 1 {\n\t\t\tx = 0\n\t\t}\n\t\tmax += x\n\n\t} else {\n\t\tmax = n / k2\n\n\t\tif max > a2 {\n\t\t\tmax = a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k2 * max\n\n\t\tx := n / k1\n\t\tif x > a1 {\n\t\t\tmax = a1\n\t\t} else if x < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tmax += x\n\t}\n\n\tfmt.Println(min, max)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a1, a2, k1, k2, n int\n\n\t// scr := bufio.NewReader(os.Stdin)\n\t// ocr := bufio.NewWriter(os.Stdout)\n\n\tfmt.Scanln(&a1)\n\tfmt.Scanln(&a2)\n\tfmt.Scanln(&k1)\n\tfmt.Scanln(&k2)\n\tfmt.Scanln(&n)\n\n\tmin := n - (((k1 - 1) * a1) + ((k2 - 1) * a2))\n\n\tif min <= 0 {\n\t\tmin = 0\n\t} else if min >= a1+a2 {\n\t\tmin = a1 + a2\n\t}\n\n\tmax := 0\n\tif k1 < k2 {\n\t\tmax = n / k1\n\n\t\tif max > a1+a2 {\n\t\t\tmax = a1 + a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k1 * max\n\n\t\tmax += n / k2\n\t\tif max > a1+a2 {\n\t\t\tmax = a1 + a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\n\t} else {\n\t\tmax = n / k2\n\n\t\tif max > a2 {\n\t\t\tmax = a2\n\t\t} else if max < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tn -= k2 * max\n\n\t\tx := n / k1\n\t\tif x > a1 {\n\t\t\tmax = a1\n\t\t} else if x < 1 {\n\t\t\tmax = 0\n\t\t}\n\t\tmax += x\n\t}\n\n\tfmt.Println(min, max)\n\n}\n"}], "src_uid": "2be8e0b8ad4d3de2930576c0209e8b91"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d\\n%d\\n\", &n, &m)\n\ta := make([]int, 0, n)\n\tvar ai int\n\tmaxAi := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\\n\", &ai)\n\t\ta = append(a, ai)\n\t\tif maxAi < ai {\n\t\t\tmaxAi = ai\n\t\t}\n\t}\n\tcomplement := 0\n\tfor _, ai = range a {\n\t\tcomplement += maxAi - ai\n\t}\n\n\tif m > complement {\n\t\trest := m - complement\n\t\tavg := rest / n\n\t\tremainder := rest % n\n\t\tif remainder == 0 {\n\t\t\tfmt.Println(maxAi+avg, maxAi+m)\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(maxAi+avg+1, maxAi+m)\n\t\treturn\n\t}\n\tfmt.Println(maxAi, maxAi+m)\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tvar a int\n\t\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&k)\n\t\n\tmini := k\n\tmaxi := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanln(&a)\n\t\tmini = mini + a\n\t\tmaxi = int(math.Max(float64(maxi), float64(a)))\n\t}\n\t\n\tmini = int(math.Max(math.Ceil(float64(mini) / float64(n)), float64(maxi)))\n\tmaxi = maxi + k\n\t\n\tfmt.Println(mini, maxi)\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar\twriter *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\nfunc ceilDiv(i, div int64) int64 {\n if div == 0 {\n return 0 // should not happen\n }\n if i % div == 0 {\n return i / div\n }\n return (i / div) + 1\n}\n\nfunc max(i, j int64) int64 {\n if i > j {\n return i\n }\n return j\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m int64\n scanf(\"%d\\n\", &n)\n scanf(\"%d\\n\", &m)\n total := m\n maxSoFar := int64(0)\n for i := int64(0); i < n; i++ {\n var i int64\n scanf(\"%d\\n\", &i)\n total += i\n maxSoFar = max(maxSoFar, i)\n }\n minK := max(ceilDiv(total, n), maxSoFar)\n maxK := maxSoFar + m\n printf(\"%d %d\", minK, maxK)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar n int\n\tvar k int\n\tvar a int\n\t\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&k)\n\t\n\tmini := k\n\tmaxi := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanln(&a)\n\t\tmini = mini + a\n\t\tmaxi = int(math.Max(float64(maxi), float64(a)))\n\t}\n\t\n\tmini = int(math.Ceil(float64(mini) / float64(n)))\n\tmaxi = maxi + k\n\t\n\tfmt.Println(mini, maxi)\n}"}], "src_uid": "78f696bd954c9f0f9bb502e515d85a8d"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc swap(a *int, b *int) {\n\ttemp := *a\n\t*a = *b\n\t*b = temp\n}\n\ntype Cube struct {\n\telements [24]int\n}\n\ntype Turn struct {\n\tsquare [4]int\n\twall [8]int\n}\n\nfunc NewTurn(cube [4]int, wall [8]int) Turn {\n\tfor index := 0; index < 4; index++ {\n\t\tcube[index]--\n\t}\n\n\tfor index := 0; index < 8; index++ {\n\t\twall[index]--\n\t}\n\n\treturn Turn{cube, wall}\n}\n\nfunc (cube *Cube) RotateLeft(turn Turn) {\n\tsquare := turn.square\n\twall := turn.wall\n\n\tfirst := cube.elements[square[0]]\n\tfor index := 0; index < 3; index++ {\n\t\tcube.elements[square[index]] = cube.elements[square[index+1]]\n\t}\n\tcube.elements[square[3]] = first\n\n\tfor iteration := 0; iteration < 2; iteration++ {\n\t\tfirst := cube.elements[wall[0]]\n\t\tfor index := 0; index < 7; index++ {\n\t\t\tcube.elements[wall[index]] = cube.elements[wall[index+1]]\n\t\t}\n\t\tcube.elements[wall[7]] = first\n\t}\n}\n\nfunc (cube *Cube) RotateRight(turn Turn) {\n\tsquare := turn.square\n\twall := turn.wall\n\n\tlast := cube.elements[square[3]]\n\tfor index := 3; index > 0; index-- {\n\t\tcube.elements[square[index]] = cube.elements[square[index-1]]\n\t}\n\tcube.elements[square[0]] = last\n\n\tfor iteration := 0; iteration < 2; iteration++ {\n\t\tlast := cube.elements[wall[7]]\n\t\tfor index := 7; index > 0; index-- {\n\t\t\tcube.elements[wall[index]] = cube.elements[wall[index-1]]\n\t\t}\n\t\tcube.elements[wall[0]] = last\n\t}\n}\n\nfunc (cube *Cube) IsPerfect() bool {\n\tperfect := true\n\n\tfor side := 0; side < 6 && perfect; side++ {\n\t\tfor index := 0; index < 4 && perfect; index++ {\n\t\t\tif cube.elements[4*side+index] != cube.elements[4*side] {\n\t\t\t\tperfect = false\n\t\t\t}\n\t\t}\n\t}\n\n\treturn perfect\n}\n\nfunc main() {\n\tvar cube Cube\n\tfor index := 0; index < 24; index++ {\n\t\tfmt.Scanf(\"%d\", &cube.elements[index])\n\t}\n\n\tturns := []Turn{\n\t\tNewTurn([4]int{1, 2, 4, 3}, [8]int{22, 21, 18, 17, 6, 5, 14, 13}),\n\t\tNewTurn([4]int{5, 6, 8, 7}, [8]int{3, 4, 17, 19, 10, 9, 16, 14}),\n\t\tNewTurn([4]int{9, 10, 12, 11}, [8]int{7, 8, 19, 20, 23, 24, 15, 16}),\n\t\tNewTurn([4]int{13, 14, 16, 15}, [8]int{1, 3, 5, 7, 9, 11, 24, 23}),\n\t\tNewTurn([4]int{17, 18, 20, 19}, [8]int{4, 2, 21, 23, 12, 10, 8, 6}),\n\t\tNewTurn([4]int{21, 22, 24, 23}, [8]int{2, 1, 13, 15, 11, 12, 20, 18}),\n\t}\n\n\tcan := false\n\n\tfor _, turn := range turns {\n\t\tcube.RotateLeft(turn)\n\n\t\tif cube.IsPerfect() {\n\t\t\tcan = true\n\t\t}\n\n\t\tcube.RotateRight(turn)\n\t\tcube.RotateRight(turn)\n\n\t\tif cube.IsPerfect() {\n\t\t\tcan = true\n\t\t}\n\n\t\tcube.RotateLeft(turn)\n\t}\n\n\tif can {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tvar data [24]int\n\tfor i := 0; i < 24; i++ {\n\t\tdata[i] = readInt()\n\t}\n\tif isFullSide(data, 3) && isFullSide(data, 4) {\n\t\trow0 := []int{1, 3, 5, 7, 9, 11, 20, 22}\n\t\trow1 := []int{0, 2, 4, 6, 8, 10, 23, 21}\n\n\t\tif check(data, row0, row1, 2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\tif check(data, row0, row1, -2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tif isFullSide(data, 0) && isFullSide(data, 2) {\n\t\trow0 := []int{12, 13, 4, 5, 16, 17, 20, 21}\n\t\trow1 := []int{14, 15, 6, 7, 18, 19, 22, 23}\n\n\t\tif check(data, row0, row1, 2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\tif check(data, row0, row1, -2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tif isFullSide(data, 1) && isFullSide(data, 5) {\n\t\trow0 := []int{8, 9, 18, 16, 3, 2, 13, 15}\n\t\trow1 := []int{10, 11, 19, 17, 1, 0, 12, 14}\n\n\t\tif check(data, row0, row1, 2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\tif check(data, row0, row1, -2) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc check(data [24]int, row0, row1 []int, dir int) bool {\n\tfor i := 0; i < len(row0); i++ {\n\t\tif data[row0[i]] != data[row1[(i+dir+len(row1))%len(row1)]] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc isFullSide(data [24]int, side int) bool {\n\tcolor := data[side*4]\n\tfor i := 0; i < 4; i++ {\n\t\tif data[side*4+i] != color {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar rotate = [][]int{\n\t{5, 6, 17, 18, 21, 22, 13, 14},\n\t{7, 8, 19, 20, 23, 24, 15, 16},\n\t{3, 4, 19, 20, 23, 24, 15, 16},\n\t{1, 2, 18, 20, 12, 11, 15, 13},\n\t{2, 4, 6, 8, 10, 12, 23, 21},\n\t{1, 3, 5, 7, 9, 11, 24, 22}}\n\nfunc main() {\n\tvar cube = make([]int, 24)\n\tfor i := 0; i < 24; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//rotate\n\tfor i := 0; i < 6; i++ {\n\t\t//90-angle\n\t\tif check_rotate(cube, rotate[i], move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_rotate(cube, rotate[i], move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret := append(in[2:len(in)], in[0:2]...)\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret := append(in[len(in)-2:len(in)], in[0:len(in)-2]...)\n\treturn ret\n}\n\nfunc check_rotate(cube, rotate, moved []int) bool {\n\tafter := make([]int, len(cube))\n\tcopy(after, cube)\n\tfor i := 0; i < 8; i++ {\n\t\tafter[moved[i]-1] = cube[rotate[i]-1]\n\t}\n\treturn check_solved(after)\n}\n\nfunc check_solved(cube []int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif cube[i*4] != cube[i*4+1] || cube[i*4] != cube[i*4+2] || cube[i*4] != cube[i*4+3] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nvar rotate = [][]int{\n\t{5,6,17,18,21,22,13,14},\n\t{7,8,19,20,23,24,15,16},\n\t{3,4,19,20,23,24,15,16},\n\t{1,2,18,20,12,11,15,13},\n\t{2,4,6,8,10,12,23,21},\n\t{1,3,5,7,9,11,24,22}}\n\nfunc main() {\n\tvar cube = make([]int,24)\n\tfor i := 0; i<24 ; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//rotate\n\tfor i:=0;i<6;i++{\n\t\t//90-angle\n\t\tif check_solved(cube,rotate[i],move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_solved(cube,rotate[i],move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret:=make([]int,len(in))\n\tcopy(ret,in[2:len(in)])\n\tcopy(ret,in[0:2])\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret:=make([]int,len(in))\n\tcopy(ret,in[len(in)-2:len(in)])\n\tcopy(ret,in[0:len(in)-2])\n\treturn ret\n}\n\nfunc check_solved(cube, rotate, moved []int) bool {\n\tafter:=make([]int,len(cube))\n\tcopy(after,cube)\n\tfor i:=0;i<6;i++ {\n\t\tafter[moved[i]-1]=cube[rotate[i]-1]\n\t}\n\tfor i:=0;i<6;i++ {\n\t\tif after[i*4]== after[i*4+1] && after[i*4]== after[i*4+2] && after[i*4]== after[i*4+3] {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar rotate = [][]int{\n\t{5, 6, 17, 18, 21, 22, 13, 14},\n\t{7, 8, 19, 20, 23, 24, 15, 16},\n\t{3, 4, 19, 20, 23, 24, 15, 16},\n\t{1, 2, 18, 20, 12, 11, 15, 13},\n\t{2, 4, 6, 8, 10, 12, 23, 21},\n\t{1, 3, 5, 7, 9, 11, 24, 22}}\n\nfunc main() {\n\tvar cube = make([]int, 24)\n\tfor i := 0; i < 24; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//check already solved\n\tif check_solved(cube) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\t//rotate\n\tfor i := 0; i < 6; i++ {\n\t\t//90-angle\n\t\tif check_rotate(cube, rotate[i], move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_rotate(cube, rotate[i], move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret := make([]int, len(in))\n\tcopy(ret, in[2:len(in)])\n\tcopy(ret, in[0:2])\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret := make([]int, len(in))\n\tcopy(ret, in[len(in)-2:len(in)])\n\tcopy(ret, in[0:len(in)-2])\n\treturn ret\n}\n\nfunc check_rotate(cube, rotate, moved []int) bool {\n\tafter := make([]int, len(cube))\n\tcopy(after, cube)\n\tfor i := 0; i < 6; i++ {\n\t\tafter[moved[i]-1] = cube[rotate[i]-1]\n\t}\n\treturn check_solved(after)\n}\n\nfunc check_solved(cube []int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif cube[i*4] != cube[i*4+1] || cube[i*4] != cube[i*4+2] || cube[i*4] != cube[i*4+3] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar rotate = [][]int{\n\t{5, 6, 17, 18, 21, 22, 13, 14},\n\t{7, 8, 19, 20, 23, 24, 15, 16},\n\t{3, 4, 19, 20, 23, 24, 15, 16},\n\t{1, 2, 18, 20, 12, 11, 15, 13},\n\t{2, 4, 6, 8, 10, 12, 23, 21},\n\t{1, 3, 5, 7, 9, 11, 24, 22}}\n\nfunc main() {\n\tvar cube = make([]int, 24)\n\tfor i := 0; i < 24; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//check already solved\n\tif check_solved(cube) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\t//rotate\n\tfor i := 0; i < 6; i++ {\n\t\t//90-angle\n\t\tif check_rotate(cube, rotate[i], move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_rotate(cube, rotate[i], move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret := append(in[2:len(in)], in[0:2]...)\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret := append(in[len(in)-2:len(in)], in[0:len(in)-2]...)\n\treturn ret\n}\n\nfunc check_rotate(cube, rotate, moved []int) bool {\n\tafter := make([]int, len(cube))\n\tcopy(after, cube)\n\tfor i := 0; i < 8; i++ {\n\t\tafter[moved[i]-1] = cube[rotate[i]-1]\n\t}\n\treturn check_solved(after)\n}\n\nfunc check_solved(cube []int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif cube[i*4] != cube[i*4+1] || cube[i*4] != cube[i*4+2] || cube[i*4] != cube[i*4+3] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nvar rotate = [][]int{\n\t{5,6,17,18,21,22,13,14},\n\t{7,8,19,20,23,24,15,16},\n\t{3,4,19,20,23,24,15,16},\n\t{1,2,18,20,12,11,15,13},\n\t{2,4,6,8,10,12,23,21},\n\t{1,3,5,7,9,11,24,22}}\n\nfunc main() {\n\tvar cube = make([]int,24)\n\tfor i := 0; i<24 ; i++ {\n\t\tfmt.Scanf(\"%d\", &cube[i])\n\t}\n\t//check already solved\n\tif check_solved(cube) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t} \n\t//rotate\n\tfor i:=0;i<6;i++{\n\t\t//90-angle\n\t\tif check_rotate(cube,rotate[i],move_left2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t\t//another 90-angle\n\t\tif check_rotate(cube,rotate[i],move_right2(rotate[i])) {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc move_left2(in []int) []int {\n\tret:=make([]int,len(in))\n\tcopy(ret,in[2:len(in)])\n\tcopy(ret,in[0:2])\n\treturn ret\n}\n\nfunc move_right2(in []int) []int {\n\tret:=make([]int,len(in))\n\tcopy(ret,in[len(in)-2:len(in)])\n\tcopy(ret,in[0:len(in)-2])\n\treturn ret\n}\n\nfunc check_rotate(cube, rotate, moved []int) bool {\n\tafter:=make([]int,len(cube))\n\tcopy(after,cube)\n\tfor i:=0;i<6;i++ {\n\t\tafter[moved[i]-1]=cube[rotate[i]-1]\n\t}\n\treturn check_solved(after)\n}\n\nfunc check_solved(cube []int) bool {\n\tfor i:=0;i<6;i++ {\n\t\tif cube[i*4]!= cube[i*4+1] || cube[i*4]!= cube[i*4+2] || cube[i*4]!= cube[i*4+3] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tvar data [6][2][2]int\n\tfor i := 0; i < 20; i++ {\n\t\tdata[i/4][(i%4)/2][i%2] = readInt()\n\t}\n\tdata[5][1][1] = readInt()\n\tdata[5][1][0] = readInt()\n\tdata[5][0][1] = readInt()\n\tdata[5][0][0] = readInt()\n\n\tvar sides []int\n\tif isSideFull(&data, 3) && isSideFull(&data, 4) {\n\t\tsides = []int{0, 1, 2, 5}\n\t} else if isSideFull(&data, 0) && isSideFull(&data, 2) {\n\t\tsides = []int{1, 4, 5, 3}\n\t} else if isSideFull(&data, 1) && isSideFull(&data, 5) {\n\t\tsides = []int{0, 4, 2, 3}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\trotate0(&data, 1, sides)\n\tif isSolved(&data) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\trotate0(&data, -1, sides)\n\trotate0(&data, -1, sides)\n\tif isSolved(&data) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc isSolved(data *[6][2][2]int) bool {\n\tfor i := 0; i < 6; i++ {\n\t\tif !isSideFull(data, i) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc rotate0(data *[6][2][2]int, dir int, sides []int) {\n\tvar nums [4][2]int\n\tfor i := 0; i < len(sides); i++ {\n\t\tside := sides[i]\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tnums[i][j] = data[side][j][0]\n\t\t}\n\t}\n\tfor i := 0; i < len(sides); i++ {\n\t\tside := sides[(i+dir+4)%4]\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tdata[side][j][0] = nums[i][j]\n\t\t}\n\t}\n}\n\nfunc isSideFull(data *[6][2][2]int, side int) bool {\n\tcolor := data[side][0][0]\n\tfor i := 0; i < 2; i++ {\n\t\tfor j := 0; j < 2; j++ {\n\t\t\tif data[side][i][j] != color {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n"}], "src_uid": "881a820aa8184d9553278a0002a3b7c4"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc getLine2Ints(n int) []int {\n\tans := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d \", &ans[i])\n\t}\n\tscanf(\"%d\\n\", &ans[n-1])\n\treturn ans\n}\n\nvar debug = false\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tinput := getLine()\n\n\tok := true\n\n\tfor i := 0; i < len(input) && ok; i++ {\n\t\tif input[i] != '1' && input[i] != '4' {\n\t\t\tok = false\n\t\t}\n\t}\n\n\tif ok && input[0] != '1' {\n\t\tok = false\n\t}\n\n\tfor i := 3; i < len(input) && ok; i++ {\n\t\tif input[i] == '4' && input[i-1] != '1' && input[i-2] != '1' {\n\t\t\tok = false\n\t\t}\n\t}\n\n\tif ok {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\nfunc getLine2Int() (n int) {\n\tscanf(\"%d\\n\", &n)\n\treturn\n}\nfunc getLine2Int2() (a, b int) {\n\tscanf(\"%d %d\\n\", &a, &b)\n\treturn\n}\nfunc getLine2Ints(n int) []int {\n\tans := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d \", &ans[i])\n\t}\n\tscanf(\"%d\\n\", &ans[n-1])\n\treturn ans\n}\n\nvar debug = false\n\nfunc see(a interface{}) {\n\tif debug {\n\t\tprintf(\"DEBUG:%v\\n\", a)\n\t}\n}\n\nfunc solve1() {\n\tinput := getLine()\n\tok, _ := regexp.Match(\"^(14{0,2})*$\", []byte(input))\n\tif ok {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n\nfunc solve2() {\n\tinput := getLine()\n\n\tok := true\n\n\tfor i := 0; i < len(input) && ok; i++ {\n\t\tif input[i] != '1' && input[i] != '4' {\n\t\t\tok = false\n\t\t}\n\t}\n\n\tif ok && input[0] != '1' {\n\t\tok = false\n\t}\n\n\tfor i := 3; i < len(input) && ok; i++ {\n\t\tif input[i] == '4' && input[i-1] != '1' && input[i-2] != '1' {\n\t\t\tok = false\n\t\t}\n\t}\n\n\tif ok {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tinput := getLine()\n\n\tstatus := 0\n\tok := true\n\tfor i := 0; i < len(input) && ok; i++ {\n\t\tswitch status {\n\t\tcase 0: // must see 1\n\t\t\tif input[i] == '1' {\n\t\t\t\tstatus = 1\n\t\t\t} else {\n\t\t\t\tok = false\n\t\t\t}\n\t\tcase 1: // already see 1\n\t\t\tif input[i] != '1' {\n\t\t\t\tif input[i] != '4' {\n\t\t\t\t\tok = false\n\t\t\t\t} else {\n\t\t\t\t\tstatus = 2\n\t\t\t\t}\n\t\t\t}\n\t\tcase 2: // already see 14\n\t\t\tif input[i] == '1' {\n\t\t\t\tstatus = 1\n\t\t\t} else if input[i] != '4' {\n\t\t\t\tok = false\n\t\t\t} else {\n\t\t\t\tstatus = 0\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc getLine() string {\n\ts, _ := reader.ReadString('\\n')\n\tif strings.HasSuffix(s, \"\\r\\n\") {\n\t\ts = s[:len(s)-2]\n\t} else if strings.HasSuffix(s, \"\\n\") {\n\t\ts = s[:len(s)-1]\n\t}\n\treturn s\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\tinput := getLine()\n\tok, _ := regexp.Match(\"^(14{0,2})*$\", []byte(input))\n\tif ok {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n for i:=len(s)-1; i>=0; {\n if s[i] == '4' {\n if i>1 && s[i-1] == '4' && s[i-2] == '1' {\n i -= 3\n } else if i>0 && s[i-1] =='1' {\n i -= 2\n } else {\n fmt.Println(\"NO\")\n return\n }\n } else if s[i] == '1' {\n i -= 1\n } else {\n fmt.Println(\"NO\")\n return\n }\n }\n fmt.Println(\"YES\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar line string\n\tfmt.Scanf(\"%s\", &line)\n\n\tfoursExpect := 0\n\tokay := true\n\n\tfor i := 0; i < len(line); i++ {\n\t\tswitch line[i] {\n\t\tcase '1':\n\t\t\tfoursExpect = 2\n\t\tcase '4':\n\t\t\tfoursExpect--\n\t\t\tif foursExpect < 0 {\n\t\t\t\tokay = false\n\t\t\t}\n\t\tdefault:\n\t\t\tokay = false\n\t\t}\n\t}\n\n\tif okay {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n sc.Scan()\n s := sc.Text()\n c := 0\n if s[0] != '1' {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n for i := 0; i < len(s); i++ {\n if s[i] == '1' {\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n } else {\n c = 0\n }\n } else if s[i] == '4' {\n c++\n } else {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n }\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n w.WriteString(\"YES\\n\")\n w.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, in := true, 0\n for in < len(s) {\n if s[in] == '1' {\n in++\n if in < len(s) {\n if s[in] == '4' { in++ }\n if in < len(s) {\n if s[in] == '4' { in++ }\n }\n }\n } else {\n ans = false\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tfor n > 0 {\n\t\tif n % 1000 == 144 {\n\t\t\tn /= 1000\n\t\t} else if n % 100 == 14 {\n\t\t\tn /= 100\n\t\t} else if n % 10 == 1 {\n\t\t\tn /= 10\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tif n > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar i int\n\tfmt.Scanf(\"%d\", &i)\n\n\tans := \"NO\"\n\nloop:\n\tfor {\n\t\tswitch {\n\t\tcase i == 0:\n\t\t\tans = \"YES\"\n\t\t\tbreak loop\n\t\tcase i%10 == 1:\n\t\t\ti /= 10\n\t\tcase i%100 == 14:\n\t\t\ti /= 100\n\t\tcase i%1000 == 144:\n\t\t\ti /= 1000\n\t\tdefault:\n\t\t\tbreak loop\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"regexp\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\n\tr := regexp.MustCompile(\"^(14{0,2})+$\")\n\n\tans := \"NO\"\n\tif r.MatchString(s) {\n\t\tans = \"YES\"\n\t}\n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,d int\n\ts :=0\n\tm :=true\n\tfmt.Scan(&n)\n\tfor n!=0 {\n\t\td = n%10\n\t\tn/=10\n\t\tif d==1 {\n\t\t\ts=0\n\t\t} else if d==4 && s<2 {\n\t\t\ts++\n\t\t} else {\n\t\t\tm=false\n\t\t}\n\t}\n\tif s!=0 {\n\t\tm=false\n\t}\n\tif m==true {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\tfmt.Println(\"NO\")\n\t}\n}\n\n\n\n\n\n\n\n\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar num string\n\tfmt.Scan(&num)\n\n\tfor _, v := range []string{\"144\", \"14\", \"1\"} {\n\t\tnum = strings.Replace(num, v, \" \", -1)\n\t}\n\tnum = strings.Replace(num, \" \", \"\", -1)\n\n\tif len(num) > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var input string\n var prev uint8 = 0\n var count int = 1\n var ok bool = true\n fmt.Scan(&input)\n for i:=0; i= 3 {\n ok = false\n break\n }\n prev = input[i]\n }\n if ok {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n s := getS()\n n := len(s)\n pos := 0\n for pos < n {\n if pos+3 <= n && s[pos:pos+3] == \"144\" {\n pos += 3\n } else if pos+2 <= n && s[pos:pos+2] == \"14\" {\n pos += 2\n } else if s[pos:pos+1] == \"1\" {\n pos++\n } else {\n writer.WriteString(\"NO\\n\")\n return\n }\n }\n writer.WriteString(\"YES\\n\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, in := true, 0\n for in < len(s) {\n if s[in] == '1' {\n in++\n if in < len(s) {\n if s[in] == '4' { in++ }\n if in < len(s) {\n if s[in] == '4' { in++ }\n }\n }\n } else {\n ans = false\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n ans, in := true, 0\n for in < len(s) {\n if s[in] == '1' {\n in++\n if in < len(s) {\n if s[in] == '4' { in++ }\n if in < len(s) {\n if s[in] == '4' { in++ }\n }\n }\n } else {\n ans = false\n break\n }\n }\n if ans { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n )\n\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n scanner.Scan()\n a := scanner.Text()\n a = strings.Replace(a,\"144\",\" \",-1)\n a = strings.Replace(a,\"14\",\" \",-1)\n a = strings.Replace(a,\"1\",\" \",-1)\n if (strings.Trim(a, \" \") == \"\") {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar num string\n\tfmt.Scan(&num)\n\n\tfor _, v := range []string{\"144\", \"14\", \"1\"} {\n\t\tnum = strings.Replace(num, v, \"\", -1)\n\t}\n\n\tif len(num) > 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "package main\n\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strings\"\n )\n\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n scanner.Scan()\n a := scanner.Text()\n a = strings.Replace(a,\"144\",\"\",-1)\n a = strings.Replace(a,\"14\",\"\",-1)\n a = strings.Replace(a,\"1\",\"\",-1)\n if (a == \"\") {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar line string\n\tfmt.Scanf(\"%s\", &line)\n\n\tfoursExpect := 2\n\tokay := true\n\n\tfor i := 0; i < len(line); i++ {\n\t\tswitch line[i] {\n\t\tcase '1':\n\t\t\tfoursExpect = 2\n\t\tcase '4':\n\t\t\tfoursExpect--\n\t\t\tif foursExpect < 0 {\n\t\t\t\tokay = false\n\t\t\t}\n\t\tdefault:\n\t\t\tokay = false\n\t\t}\n\t}\n\n\tif okay {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n sc.Scan()\n s := sc.Text()\n c := 0\n for i := 0; i < len(s); i++ {\n if s[i] == '1' {\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n } else {\n c = 0\n }\n } else if s[i] == '4' {\n c++\n } else {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n }\n if c >= 3 {\n w.WriteString(\"NO\\n\")\n w.Flush()\n return\n }\n w.WriteString(\"YES\\n\")\n w.Flush()\n}\n"}], "src_uid": "3153cfddae27fbd817caaf2cb7a6a4b5"} {"source_code": "package main\n\nimport (\n\t\"math\"\n\t\"fmt\"\n)\n\nconst maxN = 4000\n\nfunc intMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\n\treturn a\n}\n\nfunc resolver(a, b, c, n int) int {\n\tif n > maxN {\n\t\tpanic(\"Limit exceeded\")\n\t}\n\n\tmemo := make([]int, maxN + 1)\n\tunits := make([]int, 3)\n\n\tunits[0], units[1], units[2] = a, b, c\n\tmemo[0] = 0\n\tmemo[a] = 1\n\tmemo[b] = 1\n\tmemo[c] = 1\n\n\tfor i := 1; i <= n; i++ {\n\t\tvar localMax int = math.MinInt32\n\n\t\tfor _, v := range(units) {\n\t\t\tif delta := i - v; delta >= 0 && delta <= n {\n\t\t\t\tvar localMaxCand int = intMax(localMax, memo[delta] + 1)\n\n\t\t\t\tif localMaxCand > localMax {\n\t\t\t\t\tlocalMax = localMaxCand\n\t\t\t\t\tmemo[i] = localMax\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmemo[i] = localMax\n\t}\n\n\treturn memo[n]\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scanln(&n, &a, &b, &c)\n\n\tfmt.Println(resolver(a, b, c, n))\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc Readln(r *bufio.Reader) (string, error) {\n\tvar (\n\t\tisPrefix bool = true\n\t\terr error = nil\n\t\tline, ln []byte\n\t)\n\tfor isPrefix && err == nil {\n\t\tline, isPrefix, err = r.ReadLine()\n\t\tln = append(ln, line...)\n\t}\n\treturn string(ln), err\n}\n\nfunc readIntArray(line string) []int {\n\t\n\tnumStrings := strings.Split(strings.TrimSpace(string(line)), \" \")\n\t\n\tnumbers := make([]int, 0)\n\t\n\tfor _, v := range numStrings {\n\t\tvar converted int\n\t\t\n\t\tfmt.Sscanf(v, \"%d\", &converted)\n\t\tnumbers = append(numbers, converted)\n\t}\n\t\n\treturn numbers\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t\n\tline, _ := Readln(reader)\n\tnumbers := readIntArray(line)\n\t\n\tlength := numbers[0]\n\tlengths := numbers[1:]\n\t\n\tcache := make(map[int]int, 0)\n\tsort.Ints(lengths)\n\tfmt.Println(Cut(length, lengths, 0, cache))\n}\n\nfunc Cut(length int, lengths []int, pieces int, cache map[int]int) int {\n\t\n\tif cached, ok := cache[length]; ok {\n\t\treturn cached\n\t}\n\t\n\tmaxPieces := pieces\n\tisCut := false\n\tfor _, ln := range lengths {\n\t\tif (length - ln) >= 0 {\n\t\t\tnewPieces := Cut(length - ln, lengths, pieces + 1, cache)\n\t\t\tif maxPieces < newPieces {\n\t\t\t\tisCut = true\n\t\t\t\tmaxPieces = newPieces\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!isCut) && length > 0 {\n\t\tmaxPieces = -1\n\t\tcache[length] = maxPieces\n\t} else if isCut {\n\t\tcache[length] = maxPieces\n\t}\n\t\n\treturn maxPieces\n}\n"}, {"source_code": "package main\n\n\nimport \"fmt\"\n\n\nfunc max(a,b int)int {\nif a > b {\nreturn a\n} else {\nreturn b\n}\n}\n\n\nfunc main() {\n\n var n int\n\n var a [3]int\n\n fmt.Scan(&n,&a[0],&a[1],&a[2])\n\n dp := make([]int,n+1)\n\n dp[0] = 0\n\n for i := 1; i <= n; i++ {\n\n dp[i] = -999999999\n\n for k := 0; k < 3; k++ {\n\n if (i-a[k]) >= 0 {\n\n dp[i] = max(dp[i],1+dp[i-a[k]])\n\n }\n\n }\n\n }\n\n fmt.Println(dp[n])\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\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 main() {\n\tvar n int\n\tvar a [3]int\n\tfmt.Scan(&n, &a[0], &a[1], &a[2])\n\tdp := make([]int, n+1)\n\tdp[0] = 0\n\tfor i := 1; i <= n; i++ {\n\t\tdp[i] = -999999999\n\t\tfor k := 0; k < 3; k++ {\n\t\t\tif (i - a[k]) >= 0 {\n\t\t\t\tdp[i] = max(dp[i], 1+dp[i-a[k]])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nconst maxn = 4000 + 10\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 n, a, b, c int\n\tvar dp [maxn]int\n\tfmt.Scan(&n, &a, &b, &c)\n\tdp[0] = 0\n\tfor i := 1; i <= n; i++ {\n\t\tdp[i] = -0x3f3f3f3f\n\t}\n\tfor i := 1; i <= n; i++ {\n\t\tif i >= a {\n\t\t\tdp[i] = max(dp[i], dp[i-a]+1)\n\t\t}\n\t\tif i >= b {\n\t\t\tdp[i] = max(dp[i], dp[i-b]+1)\n\t\t}\n\t\tif i >= c {\n\t\t\tdp[i] = max(dp[i], dp[i-c]+1)\n\t\t}\n\t}\n\tif dp[n] < 0 {\n\t\tdp[n] = 0\n\t}\n\tfmt.Printf(\"%d\\n\", dp[n])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/189/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0417\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c. \u0414\u043b\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043b-\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\n// \u0438\u0442\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u0437, \u0442.\u043a. \u0432 \u0446\u0438\u043a\u043b\u0435 for\n// \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u0437 init \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 (\u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b-\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439)\nfunc taskSolution(n, a, b, c int) int {\n\tmax := 0\n\tfor i := n / a; i >= 0; i -= 1 {\n\t\tfor j := (n - i*a) / b; j >= 0; j -= 1 {\n\t\t\tleft := n - i*a - j*b\n\t\t\tif left%c == 0 && max < i+j+left/c {\n\t\t\t\tmax = i + j + left/c\n\t\t\t}\n\t\t}\n\t}\n\treturn max\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tif _, err := fmt.Scan(&n, &a, &b, &c); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n, a, b, c))\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc max(x, y int) int {\n if x > y {\n return x\n }\n return y\n}\n\nfunc main() {\n defer writer.Flush()\n var n, a, b, c int\n scanf(\"%d %d %d %d\\n\", &n, &a, &b, &c)\n\n dp := make([]int, n+1)\n\n for i, _ := range dp {\n dp[i] = -1\n }\n dp[0] = 0\n\n for i:=1; i <= n; i++ {\n for _, j := range []int{a, b, c} {\n if i-j >= 0 && dp[i-j] != -1 {\n dp[i] = max(dp[i], dp[i-j]+1)\n }\n }\n }\n printf(\"%d\\n\", dp[n])\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,a,b,c int\n\ts:=0\n\tfmt.Scan(&n,&a,&b,&c)\n\tfor i:=0;i<=n/a;i++ {\n\t\tz:=n-i*a\n\t\tfor k:=0; k<=z/b;k++ {\n\t\t\th:=i+k+(z-k*b)/c\n\t\t\tif (z-k*b)%c==0 && h>s {\n\t\t\t\ts=h\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(s)\n}\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\t//maxP := bruteForce(n, a, b, c)\n\tmaxP := dp(n, a, b, c)\n\tfmt.Print(maxP)\n}\n\nfunc dp(n, a, b, c int) int {\n\tdp := make([]int, 4001)\n\tdp[a] = 1\n\tdp[b] = 1\n\tdp[c] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tdp[i] = max(dp, i, i-a, i-b, i-c)\n\t}\n\treturn dp[n]\n}\n\nfunc max(dp []int, nrs ...int) int {\n\tm := dp[nrs[0]]\n\tfor _, nr := range nrs[1:] {\n\t\tif nr < 0 || dp[nr] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif dp[nr]+1 > m {\n\t\t\tm = dp[nr] + 1\n\t\t}\n\t}\n\treturn m\n}\n\nfunc bruteForce(n, a, b, c int) int {\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tfor i := 0; i <= n/ls[0]; i++ {\n\t\tfor j := 0; j <= n/ls[1]; j++ {\n\t\t\td := n - i*ls[0] - j*ls[1]\n\t\t\tif d%ls[2] == 0 {\n\t\t\t\tk := d / ls[2]\n\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn maxP\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tfor i := 0; i <= n/ls[0]; i++ {\n\t\tfor j := 0; j <= n/ls[1]; j++ {\n\t\t\td := n - i*ls[0] - j*ls[1]\n\t\t\tif d%ls[2] == 0 {\n\t\t\t\tk := d / ls[2]\n\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(maxP)\n}\n"}, {"source_code": "// http://codeforces.com/problemset/problem/189/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc main () {\n\tvar (\n\t\tn, a, b, c int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &n, &a, &b, &c)\n\n\tdp := make([]struct{cnt, l int}, 1e4 + 1)\n\n\tdp[0].l = n\n\tdp[0].l = n\n\tdp[0].l = n\n\n\n\tfor i := 0; i <= n; i++ {\n\t\tif dp[i].cnt + 1 > dp[i + a].cnt && dp[i].l - a >= 0 {\n\t\t\tdp[i + a].cnt = dp[i].cnt + 1\n\t\t\tdp[i + a].l = dp[i].l - a\n\t\t}\n\n\t\tif dp[i].cnt + 1 > dp[i + b].cnt && dp[i].l - b >= 0 {\n\t\t\tdp[i + b].cnt = dp[i].cnt + 1\n\t\t\tdp[i + b].l = dp[i].l - b\n\t\t}\n\n\t\tif dp[i].cnt + 1 > dp[i + c].cnt && dp[i].l - c >= 0 {\n\t\t\tdp[i + c].cnt = dp[i].cnt + 1\n\t\t\tdp[i + c].l = dp[i].l - c\n\t\t}\n\t}\n\n\tfmt.Println(max(max(dp[n].cnt, dp[n].cnt), dp[n].cnt))\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\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\tvar n, a, b, c int\n\tt := []int{0}\n\tfmt.Scanf(\"%d %d %d %d \\n\", &n, &a, &b, &c)\n\tfor i := 1; i <= n; i++ {\n\t\tt = append(t, -1)\n\t\tif i >= a && t[i-a] != -1 {\n\t\t\tt[i] = max(t[i], t[i-a]+1)\n\t\t}\n\t\tif i >= b && t[i-b] != -1 {\n\t\t\tt[i] = max(t[i], t[i-b]+1)\n\t\t}\n\t\tif i >= c && t[i-c] != -1 {\n\t\t\tt[i] = max(t[i], t[i-c]+1)\n\t\t}\n\t}\n\tfmt.Print(t[n])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc main() {\n var n int\n var a [3]int\n fmt.Scan(&n,&a[0],&a[1],&a[2])\n dp := make([]int,n+1)\n dp[0] = 0\n for i := 1; i <= n; i++ {\n dp[i] = -999999999\n for k := 0; k < 3; k++ {\n if (i-a[k]) >= 0 {\n dp[i] = max(dp[i],1+dp[i-a[k]])\n }\n }\n }\n fmt.Println(dp[n])\n}\n"}, {"source_code": "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 n, a, b, c int\nvar res []int\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\traw := scanner.Text()\n\tsegs := strings.Split(raw, \" \")\n\tn, _ = strconv.Atoi(segs[0])\n\ta, _ = strconv.Atoi(segs[1])\n\tb, _ = strconv.Atoi(segs[2])\n\tc, _ = strconv.Atoi(segs[3])\n\n\td := Do()\n\tfmt.Println(d)\n}\n\nfunc Do() int {\n\tres = make([]int, n+1, n+1)\n\tfor idx := 1; idx <= n; idx++ {\n\t\tres[idx] = Cut(idx)\n\t\t// fmt.Println(\"res\", idx, res)\n\t}\n\treturn res[n]\n}\n\nfunc Cut(idx int) int {\n\tif idx == 0 {\n\t\treturn 0\n\t}\n\tmax := 0\n\tif idx >= a {\n\t\tleft := idx - a\n\t\tif left == 0 {\n\t\t\tmax = 1\n\t\t\tgoto bnote\n\t\t} else {\n\t\t\tif res[left] == 0 {\n\t\t\t\tmax = 0\n\t\t\t\tgoto bnote\n\t\t\t} else {\n\t\t\t\tmax = 1 + res[left]\n\t\t\t}\n\t\t}\n\t}\nbnote:\n\tbmax := 0\n\t{\n\t\tif idx >= b {\n\t\t\tleft := idx - b\n\t\t\tif left == 0 {\n\t\t\t\tbmax = 1\n\t\t\t\tgoto cnote\n\t\t\t} else {\n\t\t\t\tif res[left] == 0 {\n\t\t\t\t\tbmax = 0\n\t\t\t\t\tgoto cnote\n\t\t\t\t} else {\n\t\t\t\t\tbmax = 1 + res[left]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\ncnote:\n\tcmax := 0\n\t{\n\t\tif idx >= c {\n\t\t\tleft := idx - c\n\t\t\tif left == 0 {\n\t\t\t\tcmax = 1\n\t\t\t\tgoto over\n\t\t\t} else {\n\t\t\t\tif res[left] == 0 {\n\t\t\t\t\tcmax = 0\n\t\t\t\t\tgoto over\n\t\t\t\t} else {\n\t\t\t\t\tcmax = 1 + res[left]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\nover:\n\t{\n\t\tzhi := max3(max, bmax, cmax)\n\t\treturn zhi\n\t}\n}\n\nfunc max3(a, b, c int) int {\n\tres := []int{a, b, c}\n\t// fmt.Println(res)\n\tsort.Ints(res)\n\treturn res[2]\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar dp [8005]int\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\n\tdp[a], dp[b], dp[c] = 1, 1, 1\n\tfor i := 1; i <= n; i++ {\n\t\tif dp[i] > 0 {\n\t\t\tdp[i+a] = max(dp[i+a], dp[i]+1)\n\t\t\tdp[i+b] = max(dp[i+b], dp[i]+1)\n\t\t\tdp[i+c] = max(dp[i+c], dp[i]+1)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n])\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\tx = y\n\t}\n\n\treturn x\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc Max(a, b int) int {\n result := a\n if b > a {\n result = b\n }\n\n return result\n}\n\nfunc main() {\n var n, a, b, c int\n fmt.Scanln(&n, &a, &b, &c)\n\n arr := []int{a, b, c}\n dp := make([]int, n + 1)\n dp[0] = 1\n\n for i := 1; i <= n; i++ {\n var max int = 0\n for _, v := range arr {\n var cur_i int = i - v\n if cur_i >= 0 && dp[cur_i] != 0 {\n max = Max(max, dp[cur_i] + 1)\n }\n }\n\n dp[i] = max\n }\n\n fmt.Println(dp[n] - 1)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar dp [4005]int\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tfor i := 1; i < len(dp); i++ {\n\t\tdp[i] = -100000\n\t}\n\tfor i := a; i <= n; i++ {\n\t\tdp[i] = max(dp[i], dp[i-a]+1)\n\t\tif i >= b {\n\t\t\tdp[i] = max(dp[i], dp[i-b]+1)\n\t\t}\n\t\tif i >= c {\n\t\t\tdp[i] = max(dp[i], dp[i-c]+1)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n])\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\tx = y\n\t}\n\n\treturn x\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tn1 := n / a\n\tn2 := n / b\n\tn3 := n / c\n\tif n%a == 0 || (a == b && b == c) {\n\t\tfmt.Println(n1)\n\t\treturn\n\t}\n\n\tmax := 0\n\tif a == b || b == c {\n\t\tfor i := 0; i <= n1; i++ {\n\t\t\tfor j := 0; j <= n3; j++ {\n\t\t\t\tv := i*a + j*c\n\t\t\t\tif v >= n {\n\t\t\t\t\tif v == n && i+j > max {\n\t\t\t\t\t\tmax = i + j\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(max)\n\t\treturn\n\t}\n\n\tfor i := 0; i <= n1; i++ {\n\t\tfor j := 0; j <= n2; j++ {\n\t\t\tfor k := 0; k <= n3; k++ {\n\t\t\t\tv := i*a + j*b + k*c\n\t\t\t\tif v >= n {\n\t\t\t\t\tif v == n && i+j+k > max {\n\t\t\t\t\t\tmax = i + j + k\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\nvar a [3]int\n\nfunc main() {\n\tfmt.Fscan(reader, &n, &a[0], &a[1], &a[2])\n\tdp := make([]int, n+1)\n\tok := make([]bool, n+1)\n\tok[0] = true\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif i >= a[j] && dp[i] < dp[i-a[j]]+1 && ok[i-a[j]] {\n\t\t\t\tdp[i] = dp[i-a[j]] + 1\n\t\t\t\tok[i] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tn := readi()\n\ta := readi()\n\tb := readi()\n\tc := readi()\n\n\tdp := make([]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = -1\n\t}\n\tdp[0] = 0\n\n\tfor i := 0; i <= n; i++ {\n\t\tif dp[i] < 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, v := range []int{a, b, c} {\n\t\t\tj := i + v\n\t\t\tif n < j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[j] = max(dp[j], dp[i]+1)\n\t\t}\n\t}\n\tprintln(dp[n])\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tn := readi()\n\ta := readi()\n\tb := readi()\n\tc := readi()\n\n\tvar ans int\n\tfor i := 0; i*a <= n; i++ {\n\t\tfor j := 0; j*b <= n-i*a; j++ {\n\t\t\tm := n - i*a - j*b\n\t\t\tif m%c == 0 {\n\t\t\t\tans = max(ans, i+j+m/c)\n\t\t\t}\n\t\t}\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,a,b,c int\n\ts:=0\n\tfmt.Scan(&n,&a,&b,&c)\n\tfor i:=0;i<=n/a;i++ {\n\t\tz:=n-i*a\n\t\tfor k:=0; k<=z/b;k++ {\n\t\t\th:=i+k+(z-k*b)/c\n\t\t\tif (z-k*b)%c==0 && h>s {\n\t\t\t\ts=h\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(s)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\n\treturn max\n}\n\nfunc main() {\n\tvar reader io.Reader\n\tvar writer io.Writer\n\n\treader = os.Stdin\n\twriter = os.Stdout\n\n\t//file, _ := os.Open(\"input.txt\")\n\t//reader = file\n\n\tvar n, a, b, c int\n\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &n, &a, &b, &c)\n\n\n\tf := make([]int, n+a+b+c+1)\n\tf[a] = 1\n\tf[b] = 1\n\tf[c] = 1\n\n\tfor i := 0; i <= n; i++ {\n\t\tif i >= a && f[i-a] != 0 {\n\t\t\tf[i] = MaxOf(f[i-a]+1, f[i])\n\t\t}\n\t\tif i >= b && f[i-b] != 0 {\n\t\t\tf[i] = MaxOf(f[i-b]+1, f[i])\n\t\t}\n\t\tif i >= c && f[i-c] != 0 {\n\t\t\tf[i] = MaxOf(f[i-c]+1, f[i])\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, f[n])\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n, a, b, c := ni(), ni(), ni(), ni()\n max := 0\n for i := 0; i*a <= n; i++ {\n for j := 0; j*b <= n-i*a; j++ {\n n2 := n - i*a - j*b\n if n2%c == 0 && n2/c+i+j > max {\n max = n2/c + i + j\n }\n }\n }\n pri(max)\n w.Flush()\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\t//maxP := bruteForce(n, a, b, c)\n\tmaxP := dp(n, a, b, c)\n\tfmt.Print(maxP)\n}\n\nfunc dp(n, a, b, c int) int {\n\tdp := make([]int, n+1)\n\tdp[a] = 1\n\tdp[b] = 1\n\tdp[c] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tif i-a > 0 && a != 0 {\n\t\t\tdp[i] = max(dp[i], dp[i-a]+1)\n\t\t\tcontinue\n\t\t}\n\t\tif i-b > 0 && b != 0 {\n\t\t\tdp[i] = max(dp[i], dp[i-b]+1)\n\t\t\tcontinue\n\t\t}\n\t\tif i-c > 0 && c != 0 {\n\t\t\tdp[i] = max(dp[i], dp[i-c]+1)\n\t\t\tcontinue\n\t\t}\n\t}\n\treturn dp[n]\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc bruteForce(n, a, b, c int) int {\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tfor i := 0; i <= n/ls[0]; i++ {\n\t\tfor j := 0; j <= n/ls[1]; j++ {\n\t\t\td := n - i*ls[0] - j*ls[1]\n\t\t\tif d%ls[2] == 0 {\n\t\t\t\tk := d / ls[2]\n\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn maxP\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"math\"\n\t\"fmt\"\n)\n\nconst maxN = 4000\n\nfunc intMax(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\n\treturn a\n}\n\nfunc resolver(a, b, c, n int) int {\n\tif n > maxN {\n\t\tpanic(\"Limit exceeded\")\n\t}\n\n\tmemo := make([]int, n+1)\n\tunits := make([]int, 3)\n\n\tunits[0], units[1], units[2] = a, b, c\n\tmemo[0] = 0\n\tmemo[a] = 1\n\tmemo[b] = 1\n\tmemo[c] = 1\n\n\tfor i := 1; i <= n; i++ {\n\t\tvar localMax int = math.MinInt32\n\n\t\tfor _, v := range(units) {\n\t\t\tif delta := i - v; delta >= 0 {\n\t\t\t\tvar localMaxCand int = intMax(memo[i], memo[delta] + 1)\n\n\t\t\t\tif localMaxCand > localMax {\n\t\t\t\t\tlocalMax = localMaxCand\n\t\t\t\t\tmemo[i] = localMax\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmemo[i] = localMax\n\t}\n\n\treturn memo[n]\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scanln(&n, &a, &b, &c)\n\n\tfmt.Println(resolver(a, b, c, n))\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar dp [4005]int\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tfor i := 1; i < len(dp); i++ {\n\t\tdp[i] = -100000\n\t}\n\tfor i := a; i <= n; i++ {\n\t\tdp[i] = dp[i-a] + 1\n\t\tif i > b {\n\t\t\tdp[i] = max(dp[i], dp[i-b]+1)\n\t\t}\n\t\tif i > c {\n\t\t\tdp[i] = max(dp[i], dp[i-c]+1)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n])\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\tx = y\n\t}\n\n\treturn x\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar dp [4005]int\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tdp[a], dp[b], dp[c] = 1, 1, 1\n\tfor i := a; i <= n; i++ {\n\t\tdp[i] = dp[i-a] + 1\n\t\tif i > b {\n\t\t\tdp[i] = max(dp[i], dp[i-b]+1)\n\t\t}\n\t\tif i > c {\n\t\t\tdp[i] = max(dp[i], dp[i-c]+1)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n])\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\tx = y\n\t}\n\n\treturn x\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tn1 := n / a\n\tn2 := n / b\n\tn3 := n / c\n\tif n%a == 0 || (a == b && b == c) {\n\t\tfmt.Println(n1)\n\t\treturn\n\t}\n\n\tmax := 0\n\tif a == b || b == c {\n\t\tfor i := 0; i < n1; i++ {\n\t\t\tfor j := 0; j < n3; j++ {\n\t\t\t\tv := i*a + j*c\n\t\t\t\tif v >= n {\n\t\t\t\t\tif v == n && i+j > max {\n\t\t\t\t\t\tmax = i + j\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(max)\n\t\treturn\n\t}\n\n\tfor i := 0; i <= n1; i++ {\n\t\tfor j := 0; j <= n2; j++ {\n\t\t\tfor k := 0; k <= n3; k++ {\n\t\t\t\tv := i*a + j*b + k*c\n\t\t\t\tif v >= n {\n\t\t\t\t\tif v == n && i+j+k > max {\n\t\t\t\t\t\tmax = i + j + k\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ni() int {\n sc.Scan()\n ans, _ := strconv.Atoi(sc.Text())\n return ans\n}\n\nfunc nll() int64 {\n sc.Scan()\n ans, _ := strconv.ParseInt(sc.Text(), 10, 64)\n return ans\n}\n\nfunc next() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc pri(n int) { w.WriteString(strconv.Itoa(n)) }\nfunc prll(n int64) { w.WriteString(strconv.FormatInt(n, 10)) }\nfunc sp() { w.WriteByte(' ') }\nfunc endl() { w.WriteByte('\\n') }\n\nfunc dioph(b, c, n int) (int, bool) {\n max := 0\n noerr := false\n for k := 0; k*b <= n; k++ {\n if (n-k*b)%c == 0 && k+(n-k*b)/c > max {\n max = k + (n-k*b)/c\n noerr = true\n }\n }\n return max, noerr\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n, a, b, c := ni(), ni(), ni(), ni()\n max := 0\n for k := 0; k*a <= n; k++ {\n k2, noerr := dioph(b, c, n-k*a)\n if noerr && k+k2 > max {\n max = k + k2\n }\n }\n pri(max)\n w.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Readln(r *bufio.Reader) (string, error) {\n\tvar (\n\t\tisPrefix bool = true\n\t\terr error = nil\n\t\tline, ln []byte\n\t)\n\tfor isPrefix && err == nil {\n\t\tline, isPrefix, err = r.ReadLine()\n\t\tln = append(ln, line...)\n\t}\n\treturn string(ln), err\n}\n\nfunc readIntArray(line string) []int {\n\t\n\tnumStrings := strings.Split(strings.TrimSpace(string(line)), \" \")\n\t\n\tnumbers := make([]int, 0)\n\t\n\tfor _, v := range numStrings {\n\t\tvar converted int\n\t\t\n\t\tfmt.Sscanf(v, \"%d\", &converted)\n\t\tnumbers = append(numbers, converted)\n\t}\n\t\n\treturn numbers\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t\n\tline, _ := Readln(reader)\n\tnumbers := readIntArray(line)\n\t\n\tlength := numbers[0]\n\tlengths := numbers[1:]\n\t\n\tcache := make(map[int]int, 0)\n\tfmt.Println(Cut(length, lengths, 0, cache))\n}\n\nfunc Cut(length int, lengths []int, pieces int, cache map[int]int) int {\n\t\n\tif cached, ok := cache[length]; ok {\n\t\treturn cached\n\t}\n\t\n\tmaxPieces := pieces\n\tisCut := false\n\tfor _, ln := range lengths {\n\t\tif (length - ln) >= 0 {\n\t\t\tnewPieces := Cut(length - ln, lengths, pieces + 1, cache)\n\t\t\tif maxPieces < newPieces {\n\t\t\t\tisCut = true\n\t\t\t\tmaxPieces = newPieces\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (!isCut) && length > 0 {\n\t\tmaxPieces = -1\n\t\tcache[length] = maxPieces\n\t} else if isCut {\n\t\tcache[length] = maxPieces\n\t}\n\t\n\treturn maxPieces\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Readln(r *bufio.Reader) (string, error) {\n\tvar (\n\t\tisPrefix bool = true\n\t\terr error = nil\n\t\tline, ln []byte\n\t)\n\tfor isPrefix && err == nil {\n\t\tline, isPrefix, err = r.ReadLine()\n\t\tln = append(ln, line...)\n\t}\n\treturn string(ln), err\n}\n\nfunc readIntArray(line string) []int {\n\t\n\tnumStrings := strings.Split(strings.TrimSpace(string(line)), \" \")\n\t\n\tnumbers := make([]int, 0)\n\t\n\tfor _, v := range numStrings {\n\t\tvar converted int\n\t\t\n\t\tfmt.Sscanf(v, \"%d\", &converted)\n\t\tnumbers = append(numbers, converted)\n\t}\n\t\n\treturn numbers\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t\n\tline, _ := Readln(reader)\n\tnumbers := readIntArray(line)\n\t\n\tlength := numbers[0]\n\tlengths := numbers[1:]\n\t\n\tcache := make(map[int]int, 0)\n\tfmt.Println(Cut(length, lengths, 0, cache))\n}\n\nfunc Cut(length int, lengths []int, pieces int, cache map[int]int) int {\n\t\n\tif cached, ok := cache[length]; ok {\n\t\treturn cached\n\t}\n\t\n\tmaxPieces := pieces\n\tisCut := false\n\tfor _, ln := range lengths {\n\t\tif (length - ln) >= 0 {\n\t\t\tisCut = true\n\t\t\tnewPieces := Cut(length - ln, lengths, pieces + 1, cache)\n\t\t\tif maxPieces < newPieces {\n\t\t\t\tmaxPieces = newPieces\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (isCut == false) && length > 0 {\n\t\tmaxPieces = -1\n\t\tcache[length] = maxPieces\n\t} else if isCut {\n\t\tcache[length] = maxPieces\n\t}\n\t\n\treturn maxPieces\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Readln(r *bufio.Reader) (string, error) {\n\tvar (\n\t\tisPrefix bool = true\n\t\terr error = nil\n\t\tline, ln []byte\n\t)\n\tfor isPrefix && err == nil {\n\t\tline, isPrefix, err = r.ReadLine()\n\t\tln = append(ln, line...)\n\t}\n\treturn string(ln), err\n}\n\nfunc readIntArray(line string) []int {\n\t\n\tnumStrings := strings.Split(strings.TrimSpace(string(line)), \" \")\n\t\n\tnumbers := make([]int, 0)\n\t\n\tfor _, v := range numStrings {\n\t\tvar converted int\n\t\t\n\t\tfmt.Sscanf(v, \"%d\", &converted)\n\t\tnumbers = append(numbers, converted)\n\t}\n\t\n\treturn numbers\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\t\n\tline, _ := Readln(reader)\n\tnumbers := readIntArray(line)\n\t\n\tlength := numbers[0]\n\tlengths := numbers[1:]\n\t\n\tcache := make(map[int]int, 0)\n\tfmt.Println(Cut(length, lengths, 0, cache))\n}\n\nfunc Cut(length int, lengths []int, pieces int, cache map[int]int) int {\n\t\n\tif cached, ok := cache[length]; ok {\n\t\treturn cached\n\t}\n\t\n\tmaxPieces := pieces\n\tisCut := false\n\tfor _, ln := range lengths {\n\t\tif (length - ln) >= 0 {\n\t\t\tisCut = true\n\t\t\tnewPieces := Cut(length - ln, lengths, pieces + 1, cache)\n\t\t\tif maxPieces < newPieces {\n\t\t\t\tmaxPieces = newPieces\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif (isCut == false) && length > 0 {\n\t\tmaxPieces = -1\n\t}\n\t\n\tcache[length] = maxPieces\n\t\n\treturn maxPieces\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc sortThree(a, b, c int) (int, int, int) {\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\treturn a, b, c\n}\n\n// https://codeforces.com/problemset/problem/189/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0417\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c. \u0414\u043b\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043b-\u0432\u0430 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439\n// \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u0442\u044c \u043b\u0435\u043d\u0442\u0443 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u043c\u0435\u043b\u043a\u0438\u0445 \u043a\u0443\u0441\u043e\u0447\u043a\u043e\u0432,\n// \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u044f \u0438\u0445 \u043a\u043e\u043b-\u0432\u043e \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u0447\u0430\u0441\u0442\u044c\n// \u043d\u0430 \u043b\u0435\u043d\u0442\u044b \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u043f\u0440\u043e\u0432\u043e\u0434\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0439 \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u043b\u044f\n// \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e/\u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.\n// \u041f\u0435\u0440\u0432\u043e\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0435 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u043e\u043c\nfunc taskSolution(n, a, b, c int) int {\n\ta, b, c = sortThree(a, b, c)\n\tfor i := n / a; i >= 0; i -= 1 {\n\t\tfor j := (n - i*a) / b; j >= 0; j -= 1 {\n\t\t\tfor k := (n - i*a - j*b) / c; k >= 0; k -= 1 {\n\t\t\t\tif n == i*a+j*b+k*c {\n\t\t\t\t\treturn i + j + k\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc main() {\n\tvar n, a, b, c int\n\tif _, err := fmt.Scan(&n, &a, &b, &c); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n, a, b, c))\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,a,b,c int\n\ts:=0\n\tfmt.Scan(&n,&a,&b,&c)\n\tfor i:=0;i<=n/a;i++ {\n\t\tz:=n-i*a\n\t\tfor k:=0; k<=z/b;k++ {\n\t\t\th:=i+k+(z-k*b)/c\n\t\t\tif (z-k*b)%c!=0 && h>s {\n\t\t\t\ts=h\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(s)\n}\n"}, {"source_code": "// http://codeforces.com/problemset/problem/189/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nconst (\n\tMOD = 1e9 + 7\n)\n\ntype (\n\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc main () {\n\tvar (\n\t\tn, a, b, c int\n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\n\tfmt.Fscanln(input, &n, &a, &b, &c)\n\n\tdp := make([]struct{cnt, l int}, 1e4 + 1)\n\n\tdp[0].l = n\n\tdp[0].l = n\n\tdp[0].l = n\n\n\n\tfor i := 0; i <= n; i++ {\n\n\t\tif dp[i].l - a == a || dp[i].l - a == b || dp[i].l - a == c || dp[i].l - a == 0{\n\t\t\tif dp[i].cnt + 1 > dp[i + a].cnt {\n\t\t\t\tdp[i + a].cnt = dp[i].cnt + 1\n\t\t\t\tdp[i + a].l = dp[i].l - a\n\t\t\t}\n\t\t}\n\n\t\tif dp[i].l - b == a || dp[i].l - b == b || dp[i].l - b == c || dp[i].l - b == 0{\n\t\t\tif dp[i].cnt + 1 > dp[i + b].cnt {\n\t\t\t\tdp[i + b].cnt = dp[i].cnt + 1\n\t\t\t\tdp[i + b].l = dp[i].l - b\n\t\t\t}\n\t\t}\n\n\t\tif dp[i].l - c == a || dp[i].l - c == b || dp[i].l - c == c || dp[i].l - c == 0{\n\t\t\tif dp[i].cnt + 1 > dp[i + c].cnt {\n\t\t\t\tdp[i + c].cnt = dp[i].cnt + 1\n\t\t\t\tdp[i + c].l = dp[i].l - c\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Println(max(max(dp[n].cnt, dp[n].cnt), dp[n].cnt))\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n var a [3]int\n fmt.Scan(&n,&a[0],&a[1],&a[2])\n dp := make([]int,n+1)\n dp[0] = 1\n for k := 0; k < 3; k++ {\n for i := 1; i <= n; i++ {\n if (i-a[k]) >= 0 {\n dp[i] += dp[i-a[k]]\n }\n }\n }\n fmt.Println(dp[n])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, a, b, c int\n\tfmt.Scan(&n, &a, &b, &c)\n\tvar maxP int\n\tls := []int{a, b, c}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ls)))\n\tfmt.Println(ls)\n\tvar i, j, k int\n\tfor i = 0; i <= n/ls[0]; i++ {\n\t\tfor j = 0; j <= n/ls[1]; j++ {\n\t\t\tfor k = 0; k <= n/ls[2]; k++ {\n\t\t\t\tif n == i*ls[0]+j*ls[1]+k*ls[2] {\n\t\t\t\t\tif maxP < i+j+k {\n\t\t\t\t\t\tmaxP = i + j + k\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(maxP)\n}\n"}], "src_uid": "062a171cc3ea717ea95ede9d7a1c3a43"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\ta, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tb, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tr, _ := strconv.Atoi(scanner.Text())\n\n\tif a >= r*2 && b >= r*2 {\n\t\tfmt.Printf(\"First\\n\")\n\t} else {\n\t\tfmt.Printf(\"Second\\n\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\ta, b, r := scanInt(scanner), scanInt(scanner), scanInt(scanner)\n\tif a >= 2*r && b >= 2*r {\n\t\twriter.WriteString(\"First\\n\")\n\t} else {\n\t\twriter.WriteString(\"Second\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ta, b, r := 0, 0, 0\n\tfmt.Scanf(\"%d %d %d\\n\", &a, &b, &r)\n\tif a >= r*2 && b >= r*2 {\n\t\tfmt.Printf(\"First\\n\")\n\t} else {\n\t\tfmt.Printf(\"Second\\n\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\ta, b, r := 0, 0, 0\n\tfmt.Scanf(\"%d %d %d\\n\", &a, &b, &r)\n\twinner := \"Second\"\n\tvar xDiameter float32\n\tif a > b {\n\t\txDiameter = float32(a) / float32(r*2)\n\t} else {\n\t\txDiameter = float32(b) / float32(r*2)\n\t}\n\tif xDiameter >= 1 && int32((xDiameter-1)/1.5)%2 == 0 {\n\t\twinner = \"First\"\n\t}\n\tfmt.Printf(\"%s\\n\", winner)\n}\n"}], "src_uid": "90b9ef939a13cf29715bc5bce26c9896"} {"source_code": "// Codeforces 785 B Anton and Classes done\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n\tvar a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n\tfor i:=0; i ON\nif any other number is present, then the light is switched off with that swtich*/\nfunc main() {\n var n,m,b int\n var light [200]int\n\n fmt.Scan(&n, &m)\n\n for l := 0; l < m; l++ {\n fmt.Scan(&b)\n\n b = b - 1\n for i := b; i < n; i++ {\n if light[i] == 0 {\n light[i] = b + 1\n }\n }\n }\n\n for i := 0; i < n; i++ {\n fmt.Printf(\"%d\", light[i])\n if i == n - 1 {\n fmt.Println()\n } else {\n fmt.Printf(\" \")\n }\n }\n\n return\n}\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m,b int\n var a [105]int\n fmt.Scan(&n,&m)\n for i := 0; i < m; i++ {\n fmt.Scan(&b)\n for j := b; j <= n; j++ {\n if a[j] == 0 { a[j] = b }\n }\n }\n for i := 1; i <= n; i++ {\n fmt.Print(a[i])\n if i == n { fmt.Println() } else { fmt.Print(\" \") }\n }\n}\n"}, {"source_code": "// 415A-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n, m, x int\n fmt.Scan(&n, &m)\n a := make([]int, n+1)\n v := make([]int, n+1)\n\n for i := 0; i <= n; i++ {\n v[i] = 0\n }\n for i := 0; i < m; i++ {\n fmt.Scan(&x)\n for j := x; j <= n; j++ {\n if v[j] == 0 {\n a[j] = x\n v[j] = 1\n }\n }\n }\n\n for i := 1; i <= n; i++ {\n fmt.Print(a[i])\n fmt.Print(\" \")\n }\n\n fmt.Println()\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n,m,b int\n var a [105]int\n fmt.Scan(&n,&m)\n for i := 0; i < m; i++ {\n fmt.Scan(&b)\n for j := b; j <= n; j++ {\n if a[j] == 0 { a[j] = b }\n }\n }\n for i := 1; i <= n; i++ {\n fmt.Print(a[i])\n if i == n { fmt.Println() } else { fmt.Print(\" \") }\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar light [200]int;\n\tvar n, m, button int;\n\tfmt.Scanf(\"%d %d\", &n, &m);\n\tfor i := 1; i <= m; {\n\t\tretN, _ := fmt.Scanf(\"%d\", &button);\n\t\tif retN == 0 {\n\t\t\tcontinue;\n\t\t}\n\t\tfor j := button; j <= n; j = j + 1 {\n\t\t\tif light[j] == 0 {\n\t\t\t\tlight[j] = button;\n\t\t\t}\n\t\t}\n\t\ti = i + 1;\n\t}\n\n\tfor i := 1; i <= n; i = i + 1 {\n\t\tfmt.Printf(\"%d \", light[i]);\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\tlights := make([]int, n) \n\tbuttonOff := 0\n\n\tfor i:=0; i ON\nif any other number is present, then the light is switched off with that swtich*/\nfunc main() {\n var n,m,b int\n fmt.Scanf(\"%d %d\", &n, &m)\n var light []int = make([]int, n)\n for i := 0; i < n; i++ {\n light[i] = -1\n }\n\n for l := 0; l < m; l++ {\n retN, _ := fmt.Scanf(\"%d\", &b)\n if retN == 0 {\n continue\n }\n\n b = b - 1\n for i := b; (i < n ) && (light[i] == -1); i++ {\n light[i] = b + 1\n }\n }\n\n for i := 0; i < n; i++ {\n fmt.Printf(\"%d \", light[i])\n if i == n {\n fmt.Println()\n } else {\n fmt.Printf(\" \")\n }\n }\n\n return\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\t\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tpushes := make([]int, m + 10)\n\tlightstatus := make([] int, n + 10)\n\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d\", &pushes[i])\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tfor j := pushes[i]; j <= n && lightstatus[j] == 0; j ++ {\n\t\t\tlightstatus[j] = pushes[i]\n\t\t}\n\t}\n\n\tfmt.Println(lightstatus[1:n + 1])\n\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar light [200]int;\n\tvar n, m, button int;\n\tfmt.Scanf(\"%d %d\", &n, &m);\n\tfor i := 1; i <= m; i = i + 1 {\n\t\tfmt.Scanf(\"%d\", &button);\n\t\tfor j := button; j <= n; j = j + 1 {\n\t\t\tif light[j] == 0 {\n\t\t\t\tlight[j] = button;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor i := 1; i <= n; i = i + 1 {\n\t\tfmt.Printf(\"%d \", light[i]);\n\t}\n}\n"}], "src_uid": "2e44c8aabab7ef7b06bbab8719a8d863"} {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Print(a+b)\n}", "positive_code": [{"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var a,b int\n fmt.Scan(&a,&b)\n fmt.Println(a+b)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n fmt.Println(a + b)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n\t\n\t\n\t\n\t\n\t\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var a,b int; fmt.Scan(&a,&b); fmt.Print(a+b)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Printf(\"%d \", a+b)\n}"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar a, b int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\ta, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tb, _ = strconv.Atoi(r.Text())\n\tw.WriteString(strconv.Itoa(a+b)+\"\\n\")\n\tw.Flush()\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar a, b int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\ta, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tb, _ = strconv.Atoi(r.Text())\n\tw.WriteString(strconv.Itoa(a+b)+\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Printf(\"%d \", a+b)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Print(a+b, \" \")\n}\n"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar a, b int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\ta, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tb, _ = strconv.Atoi(r.Text())\n\tw.WriteString(strconv.Itoa(a+b)+\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(a+b)\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n fmt.Println(\"test1\")\n}"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar a, b int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\ta, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tb, _ = strconv.Atoi(r.Text())\n\tw.WriteString(strconv.Itoa(a+b)+\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n fmt.Println(\"attempt1\")\n}"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar a, b int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\ta, _ = strconv.Atoi(r.Text())\n\tr.Scan()\n\tb, _ = strconv.Atoi(r.Text())\n\tw.WriteString(strconv.Itoa(a+b)+\"\\n\")\n\tw.Flush()\n}\n"}, {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Print(a + b)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n var a,b,c int64\n fmt.Scan(&a,&b)\n c=a+b\n fmt.Println(c)\n}\n"}, {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Println(a + b)\n}\n"}, {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"d%d\", &a, &b)\n\tfmt.Printf(\"%d\", a+b)\n}\n"}, {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Print(a + b)\n}"}, {"source_code": "// 409H\npackage 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(a + b)\n}\n"}, {"source_code": "// 409H\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"d%d\", &a, &b)\n\tfmt.Printf(\"%d\", a-(-b))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n\t\n\t\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n\t\n\t\n\t\n\t\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n\t\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := len(arr) / 2\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar a, b int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &a, &b)\n\tfmt.Println(a + b)\n\t\n\t\n\t\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var a,b int\n fmt.Scan(&a,&b)\n fmt.Print(a+b)\n }\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var a,b int\n fmt.Scan(&a,&b)\n fmt.Print(a+b)\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var a,b int\n fmt.Scanf(\"%d %d\",&a,&b)\n fmt.Println(a+b)\n }\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b []byte\n fmt.Scanf(\"%s %s\\n\", &a, &b)\n const (\n zero byte = 48\n )\n var i, j int = len(a) - 1, len(b) - 1\n var (\n rev []byte\n k byte\n carry bool = false\n )\n\n for ; i >= 0 && j >= 0; i, j = i-1, j-1 {\n k, carry = add(a[i], b[j], carry)\n rev = append(rev, k)\n }\n for ; i >= 0; i-- {\n k, carry = add(a[i], zero, carry)\n rev = append(rev, k)\n }\n for ; j >= 0; j-- {\n k, carry = add(b[j], zero, carry)\n rev = append(rev, k)\n }\n\n for i, j = 0, len(rev)-1; i < j; i, j = i+1, j-1 {\n rev[i], rev[j] = rev[j], rev[i]\n }\n fmt.Printf(\"%s\", rev)\n}\n\nfunc add(i byte, j byte, b bool) (k byte, c bool) {\n const (\n zero byte = 48\n ten byte = 58\n )\n\n k += i + j - zero\n if b {\n k++\n }\n if k >= ten {\n k -= ten - zero\n c = true\n } else {\n c = false\n }\n return\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math/big\"\n)\n\nfunc main() {\n var (\n a, b, c = new(big.Int), new(big.Int), new(big.Int)\n )\n fmt.Scanf(\"%d %d\", a, b)\n fmt.Printf(\"%d \", c.Add(a, b))\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math/big\"\n)\n\nfunc main() {\n var (\n a, b, c = new(big.Int), new(big.Int), new(big.Int)\n )\n fmt.Scanf(\"%d %d\\n\", a, b)\n fmt.Printf(\"%d \", c.Add(a, b))\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b []byte\n fmt.Scanf(\"%s %s\\n\", &a, &b)\n const (\n zero byte = 48\n )\n var i, j int = len(a) - 1, len(b) - 1\n var (\n rev []byte\n k byte\n carry bool = false\n )\n\n for ; i >= 0 && j >= 0; i, j = i-1, j-1 {\n k, carry = add(a[i], b[j], carry)\n rev = append(rev, k)\n }\n for ; i >= 0; i-- {\n k, carry = add(a[i], zero, carry)\n rev = append(rev, k)\n }\n for ; j >= 0; j-- {\n k, carry = add(b[j], zero, carry)\n rev = append(rev, k)\n }\n\n for i, j = 0, len(rev)-1; i < j; i, j = i+1, j-1 {\n rev[i], rev[j] = rev[j], rev[i]\n }\n fmt.Printf(\"%s\\n\", rev)\n}\n\nfunc add(i byte, j byte, b bool) (k byte, c bool) {\n const (\n zero byte = 48\n ten byte = 58\n )\n\n k += i + j - zero\n if b {\n k++\n }\n if k >= ten {\n k -= ten - zero\n c = true\n } else {\n c = false\n }\n return\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math/big\"\n)\n\nfunc main() {\n var (\n a, b, c = new(big.Int), new(big.Int), new(big.Int)\n )\n fmt.Scanf(\"%d %d\\n\", a, b)\n fmt.Println(c.Add(a, b))\n}"}], "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add"} {"source_code": "//70A\npackage main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar nn, a int64\n\ta=1\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tr.Scan()\n\tnn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tif nn==1 {\n\t\ta=1\n\t} else {\n\t\tfor i:=2; int64(i)<=nn; i++ {\n\t\t\ta=(a*3)%1000003\n\t\t}\n\t}\n\tfmt.Println(a)\n}\t\n", "positive_code": [{"source_code": "// 70A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar m int\n\te := 1\n\tfmt.Scan(&m)\n\tfor j := 1; j <= m-1; j++ {\n\t\te = (3 * e) % 1000003\n\t}\n\tfmt.Print(e)\n}"}], "negative_code": [], "src_uid": "1a335a9638523ca0315282a67e18eec7"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n N := io.NextInt()\n\tA := io.NextInt()\n\tB := io.NextInt()\n\t\n\trounds := 0\n\trem := N\n\tfor rem > 1 {\n\t rounds++\n\t rem >>= 1\n\t}\n\t\n\tteams := make([]int, 0)\n\tfor i := 1; i <= N; i++ {\n\t teams = append(teams, i)\n\t}\n\t\n\twhich := -1\n\tfor r := 1; which < 0; r++ {\n\t next := make([]int, 0)\n\t for i := 0; i < len(teams); i += 2 {\n\t if isOr(A, teams[i], teams[i + 1]) && isOr(B, teams[i], teams[i + 1]) {\n\t which = r\n\t break\n\t }\n\t if isOr(A, teams[i], teams[i + 1]) {\n\t next = append(next, A)\n\t } else if isOr(B, teams[i], teams[i + 1]) {\n\t next = append(next, B)\n\t } else {\n\t next = append(next, teams[i])\n\t }\n\t }\n\t teams = next\n\t}\n\t\n\tif which == rounds {\n\t io.Println(\"Final!\")\n\t} else {\n\t io.Println(which)\n\t}\n}\n\nfunc isOr(x, a, b int) bool {\n return x == a || x == b\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b, cnt uint\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tif (b & 1) > 0 {\n\t\t\tb++\n\t\t}\n\t\tres := b - a\n\t\tcnt = 1\n\t\tfor res > 1 {\n\t\t\ta = (a + 1) >> 1\n\t\t\tb = (b + 1) >> 1\n\t\t\tif (b & 1) > 0 {\n\t\t\t\tb++\n\t\t\t}\n\t\t\tres = b - a\n\t\t\tcnt++\n\t\t}\n\t\tif n == (1 << cnt) {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tif a%2 == 1 {\n\t\t\ta += 1\n\t\t}\n\t\tif b%2 == 1 {\n\t\t\tb += 1\n\t\t}\n\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tcnt := 1\n\t\tfor rest > 1 {\n\t\t\trest >>= 1\n\t\t\tcnt++\n\t\t}\n\t\tmax := 0\n\t\tfor n > 1 {\n\t\t\tn >>= 1\n\t\t\tmax++\n\t\t}\n\t\tif cnt < max {\n\t\t\tfmt.Println(cnt)\n\t\t} else {\n\t\t\tfmt.Println(\"Final!\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tif a%2 == 1 {\n\t\t\ta += 1\n\t\t}\n\t\tif b%2 == 1 {\n\t\t\tb += 1\n\t\t}\n\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tif n-rest*2 <= 0 {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tcnt := 1\n\t\t\tfor rest > 1 {\n\t\t\t\trest >>= 1\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tif n/rest == 2 {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tcnt := 0\n\t\t\tfor rest > 0 {\n\t\t\t\trest >>= 1\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tif n-rest*2 <= 0 {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tcnt := 0\n\t\t\tfor rest > 0 {\n\t\t\t\trest >>= 1\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfor {\n\t\t_, err := fmt.Scanln(&n, &a, &b)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\trest := a - b\n\t\tif rest < 0 {\n\t\t\trest = -rest\n\t\t}\n\t\tif n/rest <= 2 {\n\t\t\tfmt.Println(\"Final!\")\n\t\t} else {\n\t\t\tcnt := 0\n\t\t\tfor rest > 0 {\n\t\t\t\trest >>= 1\n\t\t\t\tcnt++\n\t\t\t}\n\t\t\tfmt.Println(cnt)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Init() {\n}\n\nfunc Solve(io *FastIO) {\n N := io.NextInt()\n\tA := io.NextInt()\n\tB := io.NextInt()\n\t\n\trounds := 0\n\trem := N\n\tfor rem > 1 {\n\t rounds++\n\t rem >>= 1\n\t}\n\t\n\twhich := 0\n\tfor i := uint(0); ; i++ {\n\t bitA := (A >> i) & 1\n\t bitB := (B >> i) & 1\n\t if bitA != bitB {\n\t which = int(i + 1)\n\t break\n\t }\n\t}\n\t\n\tif which == rounds {\n\t io.Println(\"Final!\")\n\t} else {\n\t io.Println(which)\n\t}\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}"}], "src_uid": "a753bfa7bde157e108f34a28240f441f"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tx := make([]int, n)\n\n\tfor i := range x {\n\t\tfmt.Scan(&x[i])\n\t}\n\n\tfor x[0] != x[1] {\n\t\tif x[0] > x[1] {\n\t\t\tx[0] -= x[1]\n\t\t} else {\n\t\t\tx[1] -= x[0]\n\t\t}\n\t}\n\n\tgcd := x[0]\n\n\tfor i:=2; i gcd {\n\t\t\t\tx[i] -= gcd\n\t\t\t} else {\n\t\t\t\tgcd -= x[i]\n\t\t\t}\n\t\t}\t\t\n\t}\n\t\n\tfmt.Println(gcd*len(x))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc GCD(x, y int) int {\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n, gcd int\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\tif i == 0 {\n\t\t\tgcd = x\n\t\t} else {\n\t\t\tgcd = GCD(gcd, x)\n\t\t}\n\t}\n\tfmt.Println(n * gcd)\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n)\nfunc gcd(x, y int) int {\n for y != 0 {\n x, y = y, x%y\n }\n return x\n}\n\nfunc main() {\n\tvar n,g,x int\n\tfmt.Scan(&n,&g)\n\tfor i:=1;i a {\n\t\ta, b = b, a\n\t}\n\treturn sub_algorithm(a-b, b)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a,b int) int { if b == 0 { return a } else { return gcd(b,a%b) } }\n\nfunc main() {\n var n,x int\n fmt.Scan(&n)\n a := -1\n for i := 0; i < n ; i++ {\n fmt.Scan(&x)\n if a == -1 { a = x } else { a = gcd(a,x) }\n }\n fmt.Println(a*n)\n}\n"}, {"source_code": "// 389A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math/big\"\n)\n\nfunc gcd(x, y int64) int64 {\n return new(big.Int).GCD(nil, nil, big.NewInt(x), big.NewInt(y)).Int64()\n}\n\nfunc main() {\n var n, g, k, i int64\n fmt.Scan(&n, &g)\n for i = 1; i < n; i++ {\n fmt.Scan(&k)\n g = gcd(g, k)\n }\n fmt.Println(g * n)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a,b int) int { if b == 0 { return a } else { return gcd(b,a%b) } }\n\nfunc main() {\n var n,x int\n fmt.Scan(&n)\n a := -1\n for i := 0; i < n ; i++ {\n fmt.Scan(&x)\n if a == -1 { a = x } else { a = gcd(a,x) }\n }\n fmt.Println(a*n)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a,b int) int { if b == 0 { return a } else { return gcd(b,a%b) } }\n\nfunc main() {\n var n,x int\n fmt.Scan(&n)\n a := -1\n for i := 0; i < n ; i++ {\n fmt.Scan(&x)\n if a == -1 { a = x } else { a = gcd(a,x) }\n }\n fmt.Println(a*n)\n}\n"}], "negative_code": [], "src_uid": "042cf938dc4a0f46ff33d47b97dc6ad4"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nvar n, m, k int64\n\nfunc solve(n int64) {\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tif n == m {\n\t\tO(1, \"\\n\")\n\t\treturn\n\t}\n\tif n == 1 {\n\t\tO(m, \"\\n\")\n\t\treturn\n\t}\n\tans := int64(2)\n\tm -= n + 1\n\th := int64(1)\n\tl := k - 1\n\tr := n - k\n\tfor m > 0 {\n\t\tif l > 0 {\n\t\t\th++\n\t\t\tl--\n\t\t}\n\t\tif r > 0 {\n\t\t\th++\n\t\t\tr--\n\t\t}\n\t\tif r <= 0 && l <= 0 {\n\t\t\tans += m / h\n\t\t\tm = 0\n\t\t} else {\n\t\t\tm -= h\n\t\t\tif m >= 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tO(ans, \"\\n\")\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tif people == 1 {\n\t\tfmt.Println(pillow)\n\t\treturn\n\t}\n\tpillow -= people\n\tleft := int64(k - 1)\n\tright := int64(people - k)\n\tbest := 0\n\tlo := 0\n\thi := pillow\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := int64(pillow - mi)\n\t\tstep := int64(mi - 1)\n\t\tvar sum1 int64\n\t\tvar sum2 int64\n\t\tif left > 0 && step > 0 {\n\t\t\tt := left\n\t\t\tif step < t {\n\t\t\t\tt = step\n\t\t\t}\n\t\t\tsum1 = int64(step-t+1+step) * t / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tt := right\n\t\t\tif step < t {\n\t\t\t\tt = step\n\t\t\t}\n\t\t\tsum2 = int64(step-t+1+step) * t / 2\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tbest = mi\n\t\t\tlo = mi + 1\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int64\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int64) {\n\tvar m, k int64\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tfair := m / n\n\tarr := make([]int64, n+1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tarr[i] = fair\n\t}\n\tfor i := int64(1); i < k; i++ {\n\t\tif arr[i] > 1 {\n\t\t\tarr[i]--\n\t\t\tarr[i+1]++\n\t\t}\n\t}\n\tif k != n {\n\t\tfor i := n; i > k; i-- {\n\t\t\tif arr[i] > 1 {\n\t\t\t\tarr[i]--\n\t\t\t\tarr[i-1]++\n\t\t\t}\n\t\t}\n\t}\n\tarr[k] += m % n\n\tif k > 0 {\n\t\tooo := int64(1)\n\t\tfor arr[k]-arr[k-1] > 1 && k != ooo {\n\t\t\tarr[k]--\n\t\t\tooo %= k\n\t\t\tif ooo == int64(0) {\n\t\t\t\tooo++\n\t\t\t}\n\t\t\tarr[ooo]++\n\t\t\tooo++\n\t\t}\n\t}\n\tif k < 0 {\n\t\tooo := int64(n)\n\t\tfor arr[k]-arr[k+1] > 1 && k != ooo {\n\t\t\tarr[k]--\n\t\t\tif ooo == int64(k) {\n\t\t\t\tooo = n\n\t\t\t}\n\t\t\tarr[ooo]++\n\t\t\tooo--\n\t\t}\n\t}\n\tO(arr[k], \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nvar n, m, k int64\n\nfunc solve(n int64) {\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tp := k - (n - k)\n\to := (k * (k + 1) / 2) + (k*(k-1))/2 - (p * (p - 1) / 2)\n\tans := k\n\tif o < m {\n\t\tans += (m - o) / n\n\t} else if o > m {\n\t\tans -= (o-m)/n + 1\n\t}\n\tif m == n {\n\t\tans = 1\n\t}\n\tO(ans, \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int64\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int64) {\n\tvar m, k int64\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tfair := m / n\n\tarr := make([]int64, n+1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tarr[i] = fair\n\t}\n\tfor i := int64(1); i < k; i++ {\n\t\tif arr[i] > 1 {\n\t\t\tarr[i]--\n\t\t\tarr[i+1]++\n\t\t}\n\t}\n\tif k != n {\n\t\tfor i := n; i > k; i-- {\n\t\t\tif arr[i] > 1 {\n\t\t\t\tarr[i]--\n\t\t\t\tarr[i-1]++\n\t\t\t}\n\t\t}\n\t}\n\tarr[k] += m % n\n\tif k != 1 {\n\t\tooo := int64(1)\n\t\tfor arr[k]-arr[k-1] > 1 {\n\t\t\tarr[k]--\n\t\t\tarr[ooo]++\n\t\t\tooo++\n\t\t\tooo %= k\n\t\t\tif ooo == int64(0) {\n\t\t\t\tooo++\n\t\t\t}\n\t\t}\n\t}\n\tif k != n {\n\t\tooo := int64(n)\n\t\tfor arr[k]-arr[k+1] > 1 {\n\t\t\tarr[k]--\n\t\t\tarr[ooo]++\n\t\t\tooo--\n\t\t\tif ooo == int64(k) {\n\t\t\t\tooo = n\n\t\t\t}\n\t\t}\n\t}\n\tO(arr[k], \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tfor I(&n, \" \") == nil {\n\t\tsolve(n)\n\t}\n}\n\nvar n, m, k int64\n\nfunc solve(n int64) {\n\tI(&m, \" \")\n\tI(&k, \"\\n\")\n\tp := k - (n - k)\n\to := (k * (k + 1) / 2) + (k*(k-1))/2 - (p * (p - 1) / 2)\n\tans := k\n\tif o < m {\n\t\tans += (m - o) / n\n\t} else if o > m {\n\t\tans -= (o-m)/n + 1\n\t}\n\tO(ans, \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tif people == 1 {\n\t\tfmt.Println(pillow)\n\t\treturn\n\t}\n\tpillow -= people\n\tleft := int64(k - 1)\n\tright := int64(people - k)\n\tlo := 0\n\thi := pillow\n\tbest := 0\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := int64(pillow - mi)\n\t\tstep := int64(mi - 1)\n\t\tvar sum1 int64\n\t\tvar sum2 int64\n\t\tif left > 0 && step > 0 {\n\t\t\tif step < left {\n\t\t\t\tleft = step\n\t\t\t}\n\t\t\tsum1 = int64(step-left+1+step) * left / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tif step < right {\n\t\t\t\tright = step\n\t\t\t}\n\t\t\tsum2 = int64(step-right+1+step) * right / 2\n\t\t}\n\t\tif sum1 < 0 || sum2 < 0 {\n\t\t\tpanic(\"sum1 < 0\")\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tlo = mi + 1\n\t\t\tif best < mi {\n\t\t\t\tbest = mi\n\t\t\t}\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tpillow -= people\n\tleft := k - 1\n\tright := people - k\n\tlo := 0\n\thi := math.MaxInt32\n\tbest := 0\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := pillow - mi\n\t\tstep := mi - 1\n\t\tvar sum1 int\n\t\tvar sum2 int\n\t\tif left > 0 && step > 0 {\n\t\t\tif step < left {\n\t\t\t\tleft = step\n\t\t\t}\n\t\t\tsum1 = (step - left + 1 + step) * left / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tif step < right {\n\t\t\t\tright = step\n\t\t\t}\n\t\t\tsum2 = (step - right + 1 + step) * right / 2\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tlo = mi + 1\n\t\t\tif best < mi {\n\t\t\t\tbest = mi\n\t\t\t}\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tif people == 1 {\n\t\tfmt.Println(pillow)\n\t\treturn\n\t}\n\tpillow -= people\n\tleft := k - 1\n\tright := people - k\n\tlo := 0\n\thi := math.MaxInt32\n\tbest := 0\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := pillow - mi\n\t\tstep := mi - 1\n\t\tvar sum1 int\n\t\tvar sum2 int\n\t\tif left > 0 && step > 0 {\n\t\t\tif step < left {\n\t\t\t\tleft = step\n\t\t\t}\n\t\t\tsum1 = (step - left + 1 + step) * left / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tif step < right {\n\t\t\t\tright = step\n\t\t\t}\n\t\t\tsum2 = (step - right + 1 + step) * right / 2\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tlo = mi + 1\n\t\t\tif best < mi {\n\t\t\t\tbest = mi\n\t\t\t}\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tpeople := readInt()\n\tpillow := readInt()\n\tk := readInt()\n\tif people == 1 {\n\t\tfmt.Println(pillow)\n\t\treturn\n\t}\n\tpillow -= people\n\tleft := int64(k - 1)\n\tright := int64(people - k)\n\tlo := 0\n\thi := pillow\n\tbest := 0\n\tfor lo <= hi && pillow > 0 {\n\t\tmi := lo + (hi-lo)/2\n\t\trest := int64(pillow - mi)\n\t\tstep := int64(mi - 1)\n\t\tvar sum1 int64\n\t\tvar sum2 int64\n\t\tif left > 0 && step > 0 {\n\t\t\tif step < left {\n\t\t\t\tleft = step\n\t\t\t}\n\t\t\tsum1 = int64(step-left+1+step) * left / 2\n\t\t}\n\t\tif right > 0 && step > 0 {\n\t\t\tif step < right {\n\t\t\t\tright = step\n\t\t\t}\n\t\t\tsum2 = int64(step-right+1+step) * right / 2\n\t\t}\n\t\tif sum1+sum2 <= rest {\n\t\t\tlo = mi + 1\n\t\t\tif best < mi {\n\t\t\t\tbest = mi\n\t\t\t}\n\t\t} else {\n\t\t\thi = mi - 1\n\t\t}\n\t}\n\tfmt.Println(best + 1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "src_uid": "da9ddd00f46021e8ee9db4a8deed017c"} {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n y := int(math.Sqrt(float64((a*c)/b)))\n x := (y*b)/c\n z := b/x\n fmt.Println(4*(x+y+z))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var ab, ac, bc int64\n fmt.Scanf(\"%d %d %d\", &ab, &ac, &bc)\n abc := int64(math.Sqrt(float64(ab*ac*bc)))\n fmt.Print(4*(abc/bc + abc/ac + abc/ab))\n}"}, {"source_code": "\ufeff package main\n\n import (\n \t\"fmt\"\n \t\"math\"\n )\n\n func main() {\n \tvar x,y,z,t float64\n \tfmt.Scan(&x,&y,&z)\n \tt= math.Sqrt(x*y*z)\n \tt= t/x+t/y+t/z\n \tt*=4\n \t\tfmt.Println(t)\n }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &x, &y, &z); err != nil {\n\t\treturn\n\t}\n\n\ta := math.Sqrt(float64(x * z / y))\n\tb := math.Sqrt(float64(x * y / z))\n\tc := math.Sqrt(float64(y * z / x))\n\n\tfmt.Println(4 * int32(a+b+c))\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n y := int(math.Sqrt(float64((a*c)/b)))\n x := (y*b)/c\n z := b/x\n fmt.Println(4*(x+y+z))\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a, b, c float64\n fmt.Scanf(\"%f%f%f\", &a, &b, &c)\n fmt.Print(4 * (math.Sqrt(a * b / c) + math.Sqrt(a * c / b) + math.Sqrt(b * c / a)))\n}\n"}, {"source_code": "// 224A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var s1, s2, s3 int\n fmt.Scan(&s1, &s2, &s3)\n a := int(math.Sqrt(float64(s1 * s3 / s2)))\n b := int(math.Sqrt(float64(s1 * s2 / s3)))\n c := int(math.Sqrt(float64(s2 * s3 / s1)))\n fmt.Println(4 * (a + b + c))\n}\n"}, {"source_code": " package main\n\n import (\n \t\"fmt\"\n \t\"math\"\n )\n\n func main() {\n \tvar x,y,z,t float64\n \tfmt.Scan(&x,&y,&z)\n \tt= math.Sqrt(x*y*z)\n \tt= t/x+t/y+t/z\n \tt*=4\n \tfmt.Println(t)\n }\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a,b,c int\n fmt.Scan(&a,&b,&c)\n y := int(math.Sqrt(float64((a*c)/b)))\n x := (y*b)/c\n z := b/x\n fmt.Println(4*(x+y+z))\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var ab, ac, bc int\n fmt.Scanf(\"%d %d %d\", &ab, &ac, &bc)\n abc := int(math.Sqrt(float64(ab*ac*bc)))\n fmt.Print(4*(abc/bc + abc/ac + abc/ab))\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n var n,k int\n fmt.Scan(&n,&k)\n a := make([]int,n+1)\n ok := true\n for i := 1; i <= n; i++ {\n scanner.Scan()\n a[i], _ = strconv.Atoi(scanner.Text())\n if (i > k) && (a[i] != a[k]) {\n ok = false\n }\n }\n if ok {\n ans := k\n for a[ans-1] == a[k] { ans-- }\n fmt.Println(ans-1)\n } else {\n fmt.Println(-1)\n }\n}\n"}], "src_uid": "c0a3290be3b87f3a232ec19d4639fefc"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc recurs(a, b int) int {\n\tif a > b {\n\t\treturn -1\n\t}\n\tif a == b {\n\t\t// fmt.Printf(\"%d\\n\", cnt)\n\t\treturn 0\n\t}\n\tif recurs(a*2, b) != -1 {\n\t\treturn 1 + recurs(a*2, b)\n\t}\n\tif recurs(a*3, b) != -1 {\n\t\treturn 1 + recurs(a*3, b)\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\tfmt.Printf(\"%d\\n\", recurs(a, b))\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int64\n\tfmt.Scan(&n, &m)\n\tif m%n != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tm /= n\n\tcnt := 0\n\tfor ; m%2 == 0; m /= 2 {\n\t\tcnt += 1\n\t}\n\tfor ; m%3 == 0; m /= 3 {\n\t\tcnt += 1\n\t}\n\tif m > 1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc rec(a, b, cnt int) int {\n\tif a > b {\n\t\treturn -1\n\t}\n\tif a == b {\n\t\t// fmt.Printf(\"%d\\n\", cnt)\n\t\treturn cnt\n\t}\n\tif rec(a*2, b, cnt+1) != -1 {\n\t\treturn rec(a*2, b, cnt+1)\n\t}\n\tif rec(a*3, b, cnt+1) != -1 {\n\t\treturn rec(a*3, b, cnt+1)\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\tfmt.Printf(\"%d\\n\", rec(a, b, 0))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n, m int\n\tfmt.Fscanf(buf, \"%d %d\\n\", &n, &m)\n\tif m%n != 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\treturn\n\t}\n\tans := 0\n\tm /= n\n\tfor m > 1 {\n\t\tif m%2 == 0 {\n\t\t\tm /= 2\n\t\t\tans++\n\t\t} else if m%3 == 0 {\n\t\t\tm /= 3\n\t\t\tans++\n\t\t} else {\n\t\t\tfmt.Printf(\"-1\\n\")\n\t\t\treturn \n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n,m int\n\tfmt.Fscan(in,&n)\n\tfmt.Fscan(in,&m)\n\tif(m == n){\n\t\tfmt.Fprint(out,0)\n\t\treturn\n\t}\n\ttemp := m / n;\n\tcnt := -1\n\tif(temp * n == m){\n\n\tfor temp % 2 == 0{\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt++\n\t\ttemp /= 2\n\t}\n\n\tfor temp % 3 == 0{\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt ++\n\t\ttemp /= 3\n\t}\n\n\tif(temp == 1){\n\t\tfmt.Fprint(out,cnt)\n\t\treturn\n\t}\n\n\t}\n\tif(temp == 1){\n\t\tfmt.Fprint(out,cnt)\n\t}else{\n\t\tfmt.Fprint(out,-1)\n\t}\n\n\n\n\n}\n\nfunc max(i int, i2 int) int {\n\tif(i < i2){\n\t\treturn i2\n\t}else{\n\t\treturn i\n\t}\n}\nfunc min(i int , i2 int) int {\n\tif(i < i2){\n\t\treturn i\n\t}else{\n\t\treturn i2\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc p(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc pln(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc scan(a ...interface{}) { fmt.Fscan(reader, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\nfunc main() {\n defer writer.Flush()\n\n var a, b int\n scan(&a, &b)\n\n if b % a != 0 {\n pln(-1)\n return\n }\n\n div := b / a\n count := 0\n\n for div > 1 {\n if div % 2 == 0 {\n div /= 2\n count += 1\n } else if div % 3 == 0 {\n div /= 3\n count += 1\n } else {\n break\n }\n }\n\n if div == 1 {\n pln(count)\n } else {\n pln(-1)\n }\n return\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tfmt.Fscan(reader, &n, &m)\n\n\tvar vl int\n\n\tif ok := m % n; ok == 0 {\n\t\tvl = m / n\n\t} else {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tvar count int\n\tfor vl > 1 {\n\t\tif vl%3 == 0 {\n\t\t\tvl /= 3\n\t\t\tcount++\n\t\t} else if vl%2 == 0 {\n\t\t\tvl /= 2\n\t\t\tcount++\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n input, _ := reader.ReadString('\\n')\n input = strings.Trim(input, \"\\r\\n\")\n splitted := strings.Split(input, \" \")\n \n n, _ := strconv.Atoi(splitted[0])\n m, _ := strconv.Atoi(splitted[1])\n \n if n == m {\n fmt.Println(\"0\")\n os.Exit(0)\n } else if m % n != 0 {\n fmt.Println(\"-1\")\n os.Exit(0)\n }\n \n div := m / n\n if div % 2 != 0 && div % 3 != 0 {\n fmt.Println(\"-1\")\n os.Exit(0)\n }\n \n divisors := [3] int {6, 3, 2}\n ans := 0\n \n for i := 0; i < 3; i++ {\n for div % divisors[i] == 0 {\n if i == 0 {\n ans += 2\n } else {\n ans++\n }\n div /= divisors[i]\n }\n }\n \n if div == 1 {\n fmt.Println(ans)\n } else {\n fmt.Println(\"-1\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif m%n != 0 {\n\t\tfmt.Print(\"-1\")\n\t} else {\n\t\tvar div int = m / n\n\t\tvar count int = 0\n\t\tfor div%2 == 0 {\n\t\t\tcount++\n\t\t\tdiv /= 2\n\t\t}\n\t\tfor div%3 == 0 {\n\t\t\tcount++\n\t\t\tdiv /= 3\n\t\t}\n\t\tif div != 1 {\n\t\t\tfmt.Printf(\"-1\")\n\t\t} else {\n\t\t\tfmt.Printf(\"%v\", count)\n\t\t}\n\t}\n}\n"}, {"source_code": "/*package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\td:=0\n\tvar s string\n\tfmt.Scan(&n)\n\tfmt.Scan(&s)\n\tfor i:=0; i1{\n\t if x%2==0{\n\t x=x/2\n\t d+=1\n\t }\n\t if x%3==0{\n\t x=x/3\n\t d+=1\n\t }\n\t }\n\t if x==1{\n\t fmt.Printf(\"%d\", d)\n\t }\n\t if x!=1{\n\t fmt.Printf(\"%d\", -1)\n\t }\n\t}\n\t\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, fact, step int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m != n {\n\t\tif m%n == 0 {\n\t\t\tfact = m / n\n\t\t\tfor fact%3 == 0 {\n\t\t\t\tfact /= 3\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfor fact%2 == 0 {\n\t\t\t\tfact /= 2\n\t\t\t\tstep++\n\t\t\t}\n\t\t}\n\t\tif fact != 1 {\n\t\t\tstep = -1\n\t\t}\n\t}\n\n\tfmt.Println(step)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main () {\n\tvar n, m int\n\tfmt.Scanln(&n, &m)\n\n\ttwoCount1 := 0\n\tthreeCount1 := 0\n\ttwoCount2 := 0\n\tthreeCount2 := 0\n\n\tfor n%2==0 {\n\t\ttwoCount1 += 1\n\t\tn /= 2\n\t}\n\tfor m%2==0 {\n\t\ttwoCount2 += 1\n\t\tm /= 2\n\t}\n\tfor n%3==0 {\n\t\tthreeCount1 += 1\n\t\tn /= 3\n\t}\n\tfor m%3==0 {\n\t\tthreeCount2 += 1\n\t\tm /= 3\n\t}\n\n\tif m != n || twoCount1 > twoCount2 || threeCount1 > threeCount2 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t} else {\n\t\tfmt.Println(twoCount2 - twoCount1 + threeCount2 - threeCount1)\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Cin struct {\n\tscanner *bufio.Scanner\n}\n\nfunc (c *Cin) NextInt() int {\n\tc.scanner.Scan()\n\tline := c.scanner.Text()\n\treturn c.convertInt(line)\n}\n\nfunc (c *Cin) NextIntSlice() []int {\n\tc.scanner.Scan()\n\tline := strings.Split(c.scanner.Text(), \" \")\n\tvar ret []int\n\tfor _, s := range line {\n\t\tret = append(ret, c.convertInt(s))\n\t}\n\treturn ret\n}\n\nfunc (c *Cin) NextTwoInt() (int, int) {\n\tline := c.NextIntSlice()\n\treturn line[0], line[1]\n}\n\nfunc (c *Cin) convertInt(data string) int {\n\ti, _ := strconv.Atoi(data)\n\treturn i\n}\n\nvar cin = &Cin{\n\tscanner: bufio.NewScanner(os.Stdin),\n}\n\ntype element struct {\n\tvalue int\n\tstep int\n\tnext *element\n\tlast *element\n}\n\nfunc newElement(value, step int) *element {\n\treturn &element{value: value, step: step}\n}\n\ntype queue struct {\n\thead *element\n\ttail *element\n}\n\nfunc (q *queue) push(value, step int) {\n\titem := newElement(value, step)\n\tif q.isEmpty() {\n\t\tq.head = item\n\t\tq.tail = q.head\n\t\treturn\n\t}\n\titem.last = q.tail\n\tq.tail.next = item\n\tq.tail = item\n}\n\nfunc (q *queue) isEmpty() bool {\n\treturn q.head == nil\n}\n\nfunc (q *queue) pop() *element {\n\tif q.isEmpty() {\n\t\tpanic(\"pop from empty queue\")\n\t}\n\titem := q.head\n\tq.head = q.head.next\n\treturn item\n}\n\nfunc newQueue() *queue {\n\treturn &queue{}\n}\n\nfunc handle(n, m int) int {\n\tq := newQueue()\n\tq.push(n, 0)\n\tset := map[int]int{n: 0}\n\tfor !q.isEmpty() {\n\t\tele := q.pop()\n\t\tif ele.value == m {\n\t\t\treturn ele.step\n\t\t}\n\t\tif ele.value > m {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := set[ele.value*2]; !ok {\n\t\t\tset[ele.value*2] = ele.step + 1\n\t\t\t// fmt.Printf(\"val=[%v],step=[%v]\\n\", ele.value*2, ele.step+1)\n\t\t\tq.push(ele.value*2, ele.step+1)\n\t\t}\n\t\tif _, ok := set[ele.value*3]; !ok {\n\t\t\tset[ele.value*3] = ele.step + 1\n\t\t\t// fmt.Printf(\"val=[%v],step=[%v]\\n\", ele.value*3, ele.step+1)\n\t\t\tq.push(ele.value*3, ele.step+1)\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tn, m := cin.NextTwoInt()\n\tfmt.Printf(\"%d\\n\", handle(n, m))\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1141/problem/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc reduceDivisor(divisor int, moves int) int {\n\tif divisor == 1 {\n\t\treturn moves\n\t} else if divisor%2 == 0 {\n\t\treturn reduceDivisor(divisor/2, moves+1)\n\t} else if divisor%3 == 0 {\n\t\treturn reduceDivisor(divisor/3, moves+1)\n\t}\n\treturn -1\n}\n\nfunc Solve(n int, m int) int {\n\tif m%n != 0 || m < n {\n\t\treturn -1\n\t}\n\treturn reduceDivisor(m/n, 0)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, m))\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\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\nfunc main() {\n defer writer.Flush()\n\n var a, b int\n scanf(\"%d %d\\n\", &a, &b)\n\n if b % a != 0 {\n printf(\"%d\\n\", -1)\n return\n }\n\n div := b / a\n count := 0\n\n for div > 1 {\n if div % 2 == 0 {\n div /= 2\n count += 1\n } else if div % 3 == 0 {\n div /= 3\n count += 1\n } else {\n break\n }\n }\n\n if div == 1 {\n printf(\"%d\\n\", count)\n } else {\n printf(\"%d\\n\", -1)\n }\n return\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n,m int\n\tfmt.Fscan(in,&n)\n\tfmt.Fscan(in,&m)\n\tcnt := -1\n\tif m % n == 0{\n\ttemp := m / n\n\tfor temp % 2 == 0{\n\t\ttemp /= 2\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt ++\n\t}\n\tfor temp % 3 == 0{\n\t\ttemp /= 3\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt++\n\t}\n\t}else{\n\t\tcnt = -1\n\t}\n\tfmt.Fprint(out,cnt)\n}\n\nfunc max(i int, i2 int) int {\n\tif(i < i2){\n\t\treturn i2\n\t}else{\n\t\treturn i\n\t}\n}\nfunc min(i int , i2 int) int {\n\tif(i < i2){\n\t\treturn i\n\t}else{\n\t\treturn i2\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n,m int\n\tfmt.Fscan(in,&n)\n\tfmt.Fscan(in,&m)\n\tif(n == m){\n\t\tfmt.Fprint(out,0)\n\t\treturn\n\t}\n\tcnt := -1\n\tif m % n == 0{\n\ttemp := m / n\n\tfor temp % 2 == 0{\n\t\ttemp /= 2\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt ++\n\t}\n\tfor temp % 3 == 0{\n\t\ttemp /= 3\n\t\tif(cnt == -1){\n\t\t\tcnt = 0\n\t\t}\n\t\tcnt++\n\t}\n\t}else{\n\t\tcnt = -1\n\t}\n\tfmt.Fprint(out,cnt)\n}\n\nfunc max(i int, i2 int) int {\n\tif(i < i2){\n\t\treturn i2\n\t}else{\n\t\treturn i\n\t}\n}\nfunc min(i int , i2 int) int {\n\tif(i < i2){\n\t\treturn i\n\t}else{\n\t\treturn i2\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n,m int\n\tfmt.Fscan(in,&n)\n\tfmt.Fscan(in,&m)\n\tcnt := 0\n\tif m % n == 0{\n\ttemp := m / n\n\tfor temp % 2 == 0{\n\t\ttemp /= 2\n\t\tcnt ++\n\t}\n\tfor temp % 3 == 0{\n\t\ttemp /= 3\n\t\tcnt++\n\t}\n\t}else{\n\t\tcnt = -1\n\t}\n\tfmt.Fprint(out,cnt)\n}\n\nfunc max(i int, i2 int) int {\n\tif(i < i2){\n\t\treturn i2\n\t}else{\n\t\treturn i\n\t}\n}\nfunc min(i int , i2 int) int {\n\tif(i < i2){\n\t\treturn i\n\t}else{\n\t\treturn i2\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main () {\n\tvar n, m int\n\tfmt.Scanln(&n, &m)\n\n\ttwoCount1 := 0\n\tthreeCount1 := 0\n\ttwoCount2 := 0\n\tthreeCount2 := 0\n\n\tfor n%2==0 {\n\t\ttwoCount1 += 1\n\t\tn /= 2\n\t}\n\tfor m%2==0 {\n\t\ttwoCount2 += 1\n\t\tm /= 2\n\t}\n\tfor n%3==0 {\n\t\tthreeCount1 += 1\n\t\tn /= 3\n\t}\n\tfor m%3==0 {\n\t\tthreeCount2 += 1\n\t\tm /= 3\n\t}\n\n\tif m != n || twoCount1 > twoCount2 || threeCount1 > threeCount2 {\n\t\tprintln(\"-1\")\n\t\treturn\n\t} else {\n\t\tprintln(twoCount2 - twoCount1 + threeCount2 - threeCount1)\n\t}\n\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int32\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tvar answer string = \"YES\"\n\tif a -= x; a < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tif b = a + b - y; b < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tif c = b + c - z; c < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tfmt.Printf(\"%v\", answer)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, fact, step int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m != n {\n\t\tif m%n == 0 {\n\t\t\tfact = m / n\n\t\t\tfmt.Println(fact)\n\t\t\tfor fact%3 == 0 {\n\t\t\t\tfact /= 3\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfmt.Println(fact)\n\t\t\tfor fact%2 == 0 {\n\t\t\t\tfact /= 2\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfmt.Println(fact)\n\t\t}\n\t\tif fact != 1 {\n\t\t\tstep = -1\n\t\t}\n\t}\n\n\tfmt.Println(step)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, step int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m != n {\n\t\tif m%n == 0 {\n\t\t\tvar fact = m / n\n\t\t\tfor fact%3 == 0 {\n\t\t\t\tfact /= 3\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfor fact%2 == 0 {\n\t\t\t\tfact /= 2\n\t\t\t\tstep++\n\t\t\t}\n\t\t} else {\n\t\t\tstep = -1\n\t\t}\n\t}\n\n\tfmt.Println(step)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, fact, step int64\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m != n {\n\t\tif m%n == 0 {\n\t\t\tfact = m / n\n\t\t\tfor fact%3 == 0 {\n\t\t\t\tfact /= 3\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfor fact%2 == 0 {\n\t\t\t\tfact /= 2\n\t\t\t\tstep++\n\t\t\t}\n\t\t}\n\t\tif fact != 1 {\n\t\t\tstep = -1\n\t\t}\n\t\tstep = -1\n\t}\n\n\tfmt.Println(step)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, step int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m != n {\n\t\tif m%n == 0 {\n\t\t\tvar fact = m / n\n\t\t\tfor fact%3 == 0 {\n\t\t\t\tfact /= 3\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tfor fact%2 == 0 {\n\t\t\t\tfact /= 2\n\t\t\t\tstep++\n\t\t\t}\n\t\t\tif step == 0 {\n\t\t\t\tstep = -1\n\t\t\t}\n\t\t} else {\n\t\t\tstep = -1\n\t\t}\n\t}\n\n\tfmt.Println(step)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m, step uint\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tif m%n == 0 {\n\t\tvar fact = m / n\n\t\tfor fact%3 == 0 {\n\t\t\tfact /= 3\n\t\t\tstep++\n\t\t}\n\t\tfor fact%2 == 0 {\n\t\t\tfact /= 2\n\t\t\tstep++\n\t\t}\n\t}\n\tfmt.Println(step)\n}\n"}], "src_uid": "3f9980ad292185f63a80bce10705e806"} {"source_code": "// 121A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar a [15]int64\n\tvar i, l, r, x, j, n1, n2 int64\n\tx, j = 0, 1\n\tfmt.Scan(&l, &r)\n\tfor i = 0; i <= 10; i++ {\n\t\ta[i] = 0\n\t}\n\tfor j <= r {\n\t\ti = 10\n\t\ta[i]++\n\t\tfor a[i] > 2 {\n\t\t\ta[i] = 0\n\t\t\ti--\n\t\t\ta[i]++\n\t\t}\n\t\tj = 0\n\t\tfor i = 1; i <= 10; i++ {\n\t\t\tif j > 0 && a[i] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif a[i] == 1 {\n\t\t\t\tn1 = 4\n\t\t\t} else {\n\t\t\t\tn1 = 0\n\t\t\t}\n\t\t\tif a[i] == 2 {\n\t\t\t\tn2 = 7\n\t\t\t} else {\n\t\t\t\tn2 = 0\n\t\t\t}\n\t\t\tj = j*10 + n1 + n2\n\t\t}\n\t\tif x == 0 && j >= l {\n\t\t\tx += j\n\t\t}\n\t\tif i <= 10 {\n\t\t\tcontinue\n\t\t}\n\t\tif j >= l {\n\t\t\tx += (min(j, r) - l) * j\n\t\t\tl = j\n\t\t}\n\t}\n\tfmt.Print(x)\n}\n", "positive_code": [{"source_code": "// 121A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar a [15]int64\n\tvar i, l, r, x, j, n1, n2 int64\n\tx, j = 0, 1\n\tfmt.Scan(&l, &r)\n\tfor i = 0; i <= 10; i++ {\n\t\ta[i] = 0\n\t}\n\tfor j <= r {\n\t\ti = 10\n\t\ta[i]++\n\t\tfor a[i] > 2 {\n\t\t\ta[i] = 0\n\t\t\ti--\n\t\t\ta[i]++\n\t\t}\n\t\tj = 0\n\t\tfor i = 1; i <= 10; i++ {\n\t\t\tif j > 0 && a[i] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif a[i] == 1 {\n\t\t\t\tn1 = 4\n\t\t\t} else {\n\t\t\t\tn1 = 0\n\t\t\t}\n\t\t\tif a[i] == 2 {\n\t\t\t\tn2 = 7\n\t\t\t} else {\n\t\t\t\tn2 = 0\n\t\t\t}\n\t\t\tj = j*10 + n1 + n2\n\t\t}\n\t\tif x == 0 && j >= l {\n\t\t\tx += j\n\t\t}\n\t\tif i <= 10 {\n\t\t\tcontinue\n\t\t}\n\t\tif j >= l {\n\t\t\tx += (min(j, r) - l) * j\n\t\t\tl = j\n\t\t}\n\t}\n\tfmt.Print(x)\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc getNext(x int64) int64 {\n //fmt.Fprintf(os.Stderr, \"in: %d\\n\", x)\n digits := []int64{}\n for x != 0 {\n digits = append(digits, x%10)\n x /= 10\n }\n carry := int64(0)\n resetIndex := -1\n for i, digit := range digits {\n if carry == 1 {\n digit++\n carry = 0\n }\n if digit <= 4 {\n if digit < 4 {\n resetIndex = i-1\n }\n digits[i] = 4\n } else if digit <= 7 {\n if digit < 7 {\n resetIndex = i-1\n }\n digits[i] = 7\n } else {\n digits[i] = 4\n resetIndex = i\n carry = 1\n }\n }\n if carry == 1 {\n digits = append(digits, 4)\n }\n for i := 0; i <= resetIndex; i++ {\n digits[i] = 4\n }\n base := int64(1)\n for _, digit := range digits {\n x += base*digit\n base *= 10\n }\n //fmt.Fprintf(os.Stderr, \" -> %d\\n\", x)\n return x\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n left, right := getI64(), getI64()\n total := int64(0)\n max := getNext(right)\n current := left-1\n for {\n next := getNext(current+1)\n if next == max {\n total += (right-current)*next\n break\n }\n total += (next-current)*next\n current = next\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", total))\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc getNext(x int64) int64 {\n digits := []int64{}\n for x != 0 {\n digits = append(digits, x%10)\n x /= 10\n }\n carry := int64(0)\n for i, digit := range digits {\n digit += carry\n carry = 0\n if digit <= 4 {\n digits[i] = 4\n } else if digit <= 7 {\n digits[i] = 7\n } else {\n digits[i] = 4\n carry = 1\n }\n }\n if carry == 1 {\n digits = append(digits, 4)\n }\n base := int64(1)\n for _, digit := range digits {\n x += base*digit\n base *= 10\n }\n return x\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n left, right := getI64(), getI64()\n total := int64(0)\n max := getNext(right)\n current := left-1\n for {\n next := getNext(current+1)\n if next == max {\n total += (right-current)*next\n break\n }\n total += (next-current)*next\n current = next\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", total))\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc getNext(x int64) int64 {\n //fmt.Fprintf(os.Stderr, \"in: %d\\n\", x)\n digits := []int64{}\n for x != 0 {\n digits = append(digits, x%10)\n x /= 10\n }\n carry := int64(0)\n carryIndex := -1\n for i, digit := range digits {\n if carry == 1 {\n digit++\n carry = 0\n }\n if digit <= 4 {\n digits[i] = 4\n } else if digit <= 7 {\n digits[i] = 7\n } else {\n digits[i] = 4\n carry = 1\n carryIndex = i\n }\n }\n if carry == 1 {\n digits = append(digits, 4)\n }\n for i := 0; i <= carryIndex; i++ {\n digits[i] = 4\n }\n base := int64(1)\n for _, digit := range digits {\n x += base*digit\n base *= 10\n }\n //fmt.Fprintf(os.Stderr, \" -> %d\\n\", x)\n return x\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n left, right := getI64(), getI64()\n total := int64(0)\n max := getNext(right)\n current := left-1\n for {\n next := getNext(current+1)\n if next == max {\n total += (right-current)*next\n break\n }\n total += (next-current)*next\n current = next\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", total))\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc getNext(x int64) int64 {\n fmt.Fprintf(os.Stderr, \"%d ->\", x)\n digits := []int64{}\n for x != 0 {\n digits = append(digits, x%10)\n x /= 10\n }\n carry := int64(0)\n for i, digit := range digits {\n digit += carry\n carry = 0\n if digit <= 4 {\n digits[i] = 4\n } else if digit <= 7 {\n digits[i] = 7\n } else {\n digits[i] = 4\n carry = 1\n }\n }\n if carry == 1 {\n digits = append(digits, 4)\n }\n base := int64(1)\n for _, digit := range digits {\n x += base*digit\n base *= 10\n }\n fmt.Fprintf(os.Stderr, \" %d\\n\", x)\n return x\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n span := int64(0)\n left, right := getI64(), getI64()\n total := uint64(0)\n max := getNext(right)\n current := left-1\n for current != max {\n next := getNext(current+1)\n total += uint64(next-current)*uint64(next)\n span += next-current\n fmt.Fprintf(os.Stderr, \"(%d - %d = %d) * %d\\n\", next, current,\n next-current, next)\n if next < current {\n fmt.Fprintf(os.Stderr, \"%d < %d\\n\", next, current)\n break\n }\n current = next\n fmt.Fprintf(os.Stderr, \" %d\\n\", total)\n }\n fmt.Fprintf(os.Stderr, \"span = %d, right-left+1 = %d\\n\", span, right-left+1)\n writer.WriteString(fmt.Sprintf(\"%d\\n\", total))\n}\n"}], "src_uid": "8a45fe8956d3ac9d501f4a13b55638dd"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\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 scanSlice(n int) []int64 {\n\ta := make([]int64, n)\n\tl, _ := reader.ReadString('\\n')\n\ts := strings.Split(strings.TrimSpace(l), \" \")\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = strconv.ParseInt(s[i], 10, 0)\n\t}\n\treturn a\n}\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\ta := scanSlice(14)\n\n\tmaxcount := int64(0)\n\tfor i := range a {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount, k := int64(0), a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (int64(j)-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintF(\"%d\", maxcount)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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 scanInt(a interface{}) { fmt.Fscanf(reader, \"%d\", a) }\nfunc scanlnInt(a interface{}) { fmt.Fscanf(reader, \"%d\\n\", a) }\nfunc scanChar(a interface{}) { fmt.Fscanf(reader, \"%c\", a) }\nfunc scanString(a interface{}) { fmt.Fscanf(reader, \"%s\", a) }\n\nfunc max(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\ta := make([]int64, 14)\n\tfor i := range a {\n\t\tscanInt(&a[i])\n\t}\n\tmaxcount := int64(0)\n\tfor i := int64(0); i < 14; i++ {\n\t\tcount, k := int64(0), a[i]\n\t\ta[i] = 0\n\t\tfor j := int64(0); j < 14; j++ {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintf(\"%d\", maxcount)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar line string\n\tvar max int64\n\tvar start [14]int64\n\tvar end [14]int64\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ = reader.ReadString('\\n')\n\tarrStartStrings := strings.Split(strings.TrimSpace(line), \" \")\n\tfor i, v := range arrStartStrings {\n\t\tstart[i], _ = strconv.ParseInt(v, 10, 0)\n\t}\n\tfor i := 0; i < 14; i++ {\n\t\tend[i] = igra(start, i)\n\t}\n\tfor i := 0; i < 14; i++ {\n\t\tif max < end[i]{\n\t\t\tmax=end[i]\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n\nfunc igra(start [14]int64, i int) int64 {\n\tvar n, addToAll, result int64\n\tn = start[i]\n\tstart[i] = 0\n\tif n == 0 {\n\t\treturn 0\n\t}\n\taddToAll = n / 14\n\tn = n % 14\n\tfor i := 0; i < 14; i++ {\n\t\tstart[i] += addToAll\n\t}\n\tfor n != 0 {\n\t\tif i+1 == 14 {\n\t\t\ti = 0\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t\tstart[i]++\n\t\tn--\n\t}\n\tfor i := 0; i < 14; i++ {\n\t\tif start[i]%2==0{\n\t\t\tresult+=start[i]\n\t\t}\n\t}\n\treturn result\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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 scanInt(a interface{}) { fmt.Fscanf(reader, \"%d\", a) }\nfunc scanlnInt(a interface{}) { fmt.Fscanf(reader, \"%d\\n\", a) }\nfunc scanChar(a interface{}) { fmt.Fscanf(reader, \"%c\", a) }\nfunc scanString(a interface{}) { fmt.Fscanf(reader, \"%s\", a) }\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\tdefer writer.Flush()\n\n\ta := make([]int, 14)\n\tfor i := range a {\n\t\tscanInt(&a[i])\n\t}\n\tmaxcount := 0\n\tfor i := range a {\n\t\tcount, k := 0, a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintf(\"%d\", maxcount)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\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 scanSlice(n int) []int {\n\ta := make([]int, n)\n\tl, _ := reader.ReadString('\\n')\n\ts := strings.Split(strings.TrimSpace(l), \" \")\n\tfor i := 0; i < n; i++ {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\n\ta := scanSlice(14)\n\n\tmaxcount := 0\n\tfor i := range a {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount, k := 0, a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintF(\"%d\", maxcount)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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 scanInt(a interface{}) { fmt.Fscanf(reader, \"%d\", a) }\nfunc scanlnInt(a interface{}) { fmt.Fscanf(reader, \"%d\\n\", a) }\nfunc scanlnSInt(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fscanf(reader, \"%d \", &s[i])\n\t}\n\tfmt.Fscanf(reader, \"%d\\n\", &s[n-1])\n\treturn s\n}\nfunc scanChar(a interface{}) { fmt.Fscanf(reader, \"%c\", a) }\nfunc scanString(a interface{}) { fmt.Fscanf(reader, \"%s\", a) }\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\tdefer writer.Flush()\n\n\ta := scanlnSInt(14)\n\n\tmaxcount := 0\n\tfor i := range a {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount, k := 0, a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintf(\"%d\", maxcount)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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 scanInt(a interface{}) { fmt.Fscanf(reader, \"%d\", a) }\nfunc scanlnInt(a interface{}) { fmt.Fscanf(reader, \"%d\\n\", a) }\nfunc scanChar(a interface{}) { fmt.Fscanf(reader, \"%c\", a) }\nfunc scanString(a interface{}) { fmt.Fscanf(reader, \"%s\", a) }\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\tdefer writer.Flush()\n\n\ta := make([]int, 14)\n\tfor i := range a {\n\t\tscanInt(&a[i])\n\t}\n\tmaxcount := 0\n\tfor i := range a {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount, k := 0, a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintf(\"%d\", maxcount)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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 scanInt(a interface{}) { fmt.Fscanf(reader, \"%d\", a) }\nfunc scanlnInt(a interface{}) { fmt.Fscanf(reader, \"%d\\n\", a) }\nfunc scanlnSInt(n int) []int {\n\ts := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Fscanf(reader, \"%d\", &s[i])\n\t}\n\tfmt.Fscanf(reader, \"%d\\n\", &s[n-1])\n\treturn s\n}\nfunc scanChar(a interface{}) { fmt.Fscanf(reader, \"%c\", a) }\nfunc scanString(a interface{}) { fmt.Fscanf(reader, \"%s\", a) }\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\tdefer writer.Flush()\n\n\ta := scanlnSInt(14)\n\n\tmaxcount := 0\n\tfor i := range a {\n\t\tif a[i] == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcount, k := 0, a[i]\n\t\ta[i] = 0\n\t\tfor j := range a {\n\t\t\tn := a[(i+j)%14] + k/14\n\t\t\tif (j-1+14)%14 < k%14 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tif n%2 == 0 {\n\t\t\t\tcount += n\n\t\t\t}\n\t\t}\n\t\tmaxcount, a[i] = max(maxcount, count), k\n\t}\n\tprintf(\"%d\", maxcount)\n}\n"}], "src_uid": "1ac11153e35509e755ea15f1d57d156b"} {"source_code": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n, pos, l, r int\n fmt.Scan(&n, &pos, &l, &r)\n var ans int\n if l == 1 {\n if r == n {\n ans = 0\n } else {\n ans = int(math.Abs(float64(pos - r))) + 1\n }\n } else if r == n {\n ans = int(math.Abs(float64(pos - l))) + 1\n } else {\n var diff int = int(math.Abs(float64(l - r)))\n var ans1 int = int(math.Abs(float64(pos - l))) + diff + 2\n var ans2 int = int(math.Abs(float64(pos - r))) + diff + 2\n if ans1 < ans2 {\n ans = ans1\n } else {\n ans = ans2\n }\n }\n fmt.Println(ans)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t// \"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif xy {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc abs(x int) int {\n\tif x<0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\t// fd, _ := os.Open(\"in.txt\")\n\t// os.Stdin = fd\n\tvar T int = 1\n\t// fmt.Scanf(\"%d\", &T)\n\tfor ci:=1; ci<=T; ci++ {\n\t\tvar l, r int\n\t\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &m, &l, &r)\n\t\t// fmt.Printf(\"Case #%d: \", ci)\n\t\tif l==1 && r==n {\n\t\t\tfmt.Println(0)\n\t\t} else if l==1 {\n\t\t\tif m<=r {\n\t\t\t\tfmt.Println(1+r-m)\n\t\t\t} else {\n\t\t\t\tfmt.Println(1-r+m)\n\t\t\t}\n\t\t} else if r==n {\n\t\t\tif m>1\n\t\t\tif m<=mid {\n\t\t\t\tfmt.Println(r+2-l+abs(m-l))\n\t\t\t} else {\n\t\t\t\tfmt.Println(r+2-l+abs(r-m))\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "// http://codeforces.com/contest/915/problem/B\npackage main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n if 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\n// comentar que nem gente\nfunc main() {\n\tvar n, pos, l, r int\n\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &pos, &l, &r)\n\tif l == 1 && r == n {\n\t\tfmt.Printf(\"0\\n\")\n\t} else if l == 1 {\n\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + 1)\n\t} else if r == n {\n\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + 1)\n\t} else {\n\t\tif abs(l - pos) < abs(r - pos) {\n\t\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + r - l + 2)\n\t\t} else {\n\t\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + r - l + 2)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\n/*\n\tIf we breakdown the problem, we will found 3 cases:\n\t- if non-studies tabs exist both in left & right of studies tabs: 1, [2, 3, 4, 5], 6\n\t- if non-studies tabs exist only in right of studies tabs: [1, 2, 3], 4, 5, 6\n\t- if non-studies tabs exist only in left of studies tabs: 1, 2, 3, [4, 5, 6]\n\n\tFor the first case the minimum number of seconds would be:\n\t\tmin(abs(pos-l), abs(pos-r)) + 1 + abs(l-r) + 1\n\tIn the second case:\n\t\tabs(pos-r) + 1\n\tIn the third case:\n\t\tabs(pos-l) + 1\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, pos, l, r int\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%d %d %d %d\", &n, &pos, &l, &r)\n\tfmt.Println(solve(n, pos, l, r))\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(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc solve(n, pos, l, r int) int {\n\tisLeftExist := abs(1-l) > 0\n\tisRightExist := abs(r-n) > 0\n\tif isLeftExist && isRightExist {\n\t\treturn min(abs(pos-l), abs(pos-r)) + 1 + abs(l-r) + 1\n\t} else if isRightExist {\n\t\treturn abs(pos-r) + 1\n\t} else if isLeftExist {\n\t\treturn abs(pos-l) + 1\n\t}\n\treturn 0\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, pos, l, r int\n\tstdin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdin, \"%d %d %d %d\", &n, &pos, &l, &r)\n\tfmt.Println(solve(n, pos, l, r))\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(a int) int {\n\tif a < 0 {\n\t\ta *= -1\n\t}\n\treturn a\n}\n\nfunc solve(n, pos, l, r int) int {\n\tisLeftExist := abs(1-l) > 0\n\tisRightExist := abs(r-n) > 0\n\tif isLeftExist && isRightExist {\n\t\treturn min(abs(pos-l), abs(pos-r)) + 1 + abs(l-r) + 1\n\t} else if isRightExist {\n\t\treturn abs(pos-r) + 1\n\t} else if isLeftExist {\n\t\treturn abs(pos-l) + 1\n\t}\n\treturn 0\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tpos := readInt()\n\tl := readInt()\n\tr := readInt()\n\tif l == 1 && r == n {\n\t\tfmt.Println(0)\n\t} else if l == 1 {\n\t\tfmt.Println(abs(r-pos) + 1)\n\t} else if r == n {\n\t\tfmt.Println(abs(pos-l) + 1)\n\t} else {\n\t\tfmt.Println(min(abs(pos-l)+1+r-l+1, abs(r-pos)+1+r-l+1))\n\t}\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 a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "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 min(i, j int) int {\n\tif i < j {\n\t\treturn i\n\t}\n\treturn j\n}\n\nfunc main() {\n\tvar n, pos, l, r int\n\tfmt.Scan(&n, &pos, &l, &r)\n\n\tgoright := abs(r - pos)\n\tgoleft := abs(l - pos)\n\tif l == 1 && r == n {\n\t\tfmt.Println(0)\n\t} else if l == 1 {\n\t\tfmt.Println(goright + 1)\n\t} else if r == n {\n\t\tfmt.Println(goleft + 1)\n\t} else {\n\t\tif pos < l {\n\t\t\tfmt.Println(goright + 2)\n\t\t} else if pos > r {\n\t\t\tfmt.Println(goleft + 2)\n\t\t} else {\n\t\t\tfmt.Println(min(goleft, goright) + r - l + 2)\n\t\t}\n\t}\n}\n"}, {"source_code": "//\tURL: http://codeforces.com/contest/915/problem/B\n//\tPROBLEM RESTATEMENT\n//\t\tLet x be an array 1 ... n.\n//\t\tGiven an integer pos in the range [1, n]\n//\t\tTwo operations: move, and close.\n//\t\tThe move operation either increment or decrements pos in range [1, n]\n//\t\tClose operator removes either (pos, n] or [1, pos) from the set.\n//\t\tDetermine minimum number of operations needed to remove all elements\n//\t\tfrom x except for [l, r].\n//\tSETUP\n//\t\tThere are three cases:\n//\t\t\t1) l = 1 and r = n.\n//\t\t\t2) l = 1 and r != n, by symmetry, also: l != 1 and r = n.\n//\t\t\t3) l != 1 and r != n.\n//\tCASES\n//\t\t1) We terminate in 0 operations - solved state.\n//\t\t2) Need to fix one interval: either (r, n] or [1, l). This cost is\n//\t\t the distance from pos to r or pos to l, and one close() operation.\n//\t\t3) Need to fix both of the aforementioned intervals. We traverse to\n//\t\t whichever interval is closer (r or l), close(), move r - l to the\n//\t\t other interval, and close() again.\n\npackage 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 abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, pos int, l int, r int) int {\n\tif l == 1 && r == n {\n\t\treturn 0\n\t} else if l == 1 && r != n {\n\t\treturn abs(r-pos) + 1\n\t} else if l != 1 && r == n {\n\t\treturn abs(l-pos) + 1\n\t} else {\n\t\treturn r - l + min(abs(l-pos), abs(r-pos)) + 2\n\t}\n}\n\nfunc main() {\n\tvar n, pos, l, r int\n\tfmt.Scan(&n, &pos, &l, &r)\n\tfmt.Println(solve(n, pos, l, r))\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t// \"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif xy {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main() {\n\t// fd, _ := os.Open(\"in.txt\")\n\t// os.Stdin = fd\n\tvar T int = 1\n\t// fmt.Scanf(\"%d\", &T)\n\tfor ci:=1; ci<=T; ci++ {\n\t\tvar l, r int\n\t\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &m, &l, &r)\n\t\t// fmt.Printf(\"Case #%d: \", ci)\n\t\tif l==1 && r==n {\n\t\t\tfmt.Println(0)\n\t\t} else if l==1 {\n\t\t\tif m<=r {\n\t\t\t\tfmt.Println(1+r-m)\n\t\t\t} else {\n\t\t\t\tfmt.Println(1-r+m)\n\t\t\t}\n\t\t} else if r==n {\n\t\t\tif m>1\n\t\t\tif m<=mid {\n\t\t\t\tfmt.Println(r+2-l+m-l)\n\t\t\t} else {\n\t\t\t\tfmt.Println(r+2-l+r-m)\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t// \"os\"\n\t)\n\nconst INF = 0x3f3f3f3f\n\nvar n, m, tot int\n\nfunc min(x, y int) int {\n\tif xy {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc main() {\n\t// fd, _ := os.Open(\"in.txt\")\n\t// os.Stdin = fd\n\tvar T int = 1\n\t// fmt.Scanf(\"%d\", &T)\n\tfor ci:=1; ci<=T; ci++ {\n\t\tvar l, r int\n\t\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &m, &l, &r)\n\t\t// fmt.Printf(\"Case #%d: \", ci)\n\t\tif l==1 && r==n {\n\t\t\tfmt.Println(0)\n\t\t} else if l==1 {\n\t\t\tif m<=r {\n\t\t\t\tfmt.Println(1+r-m)\n\t\t\t} else {\n\t\t\t\tfmt.Println(1-r+m)\n\t\t\t}\n\t\t} else if r==n {\n\t\t\tif m>1\n\t\t\tif m<=mid {\n\t\t\t\tfmt.Println(r+2-l+m-l)\n\t\t\t} else {\n\t\t\t\tfmt.Println(r+2-l+r-m)\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "// http://codeforces.com/contest/915/problem/B\npackage main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n if 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\n// comentar que nem gente\nfunc main() {\n\tvar n, pos, l, r int\n\tfmt.Scanf(\"%d %d %d %d\\n\", &n, &pos, &l, &r)\n\tif l == 1 && r == n {\n\t\tfmt.Printf(\"0\\n\")\n\t} else if l == 1 {\n\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + 1)\n\t} else if r == n {\n\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + 2)\n\t} else {\n\t\tif abs(l - pos) < abs(r - pos) {\n\t\t\tfmt.Printf(\"%d\\n\", abs(l - pos) + r - l + 2)\n\t\t} else {\n\t\t\tfmt.Printf(\"%d\\n\", abs(r - pos) + r - l + 2)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tpos := readInt()\n\tl := readInt()\n\tr := readInt()\n\tif l == 1 && r == n {\n\t\tfmt.Println(0)\n\t} else if l == 1 {\n\t\tfmt.Println(r - pos + 1)\n\t} else if r == n {\n\t\tfmt.Println(pos - l + 1)\n\t} else {\n\t\tfmt.Println(min(pos-l+1+r-l+1, r-pos+1+r-l+1))\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "src_uid": "5deaac7bd3afedee9b10e61997940f78"} {"source_code": "package main\n\n/*\n\tThe resulted number is a1 + invert_digit(a2)\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar (\n\t\ta1 int\n\t\tstr2 string\n\t)\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%d %s\", &a1, &str2)\n\t// invert str2\n\ttmp := make([]string, 0, len(str2))\n\tfor i := len(str2) - 1; i >= 0; i-- {\n\t\ttmp = append(tmp, string(str2[i]))\n\t}\n\t// convert str2 back to int\n\ta2, _ := strconv.Atoi(strings.Join(tmp, \"\"))\n\tfmt.Println(a1 + a2)\n}\n", "positive_code": [{"source_code": "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 (\n\t\ta1 int\n\t\tstr2 string\n\t)\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%d %s\", &a1, &str2)\n\t// invert str2\n\ttmp := make([]string, 0, len(str2))\n\tfor i := len(str2) - 1; i >= 0; i-- {\n\t\ttmp = append(tmp, string(str2[i]))\n\t}\n\t// convert str2 to int\n\ta2, _ := strconv.Atoi(strings.Join(tmp, \"\"))\n\tfmt.Println(a1 + a2)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n fmt.Println(1)\n}"}], "src_uid": "69b219054cad0844fc4f15df463e09c0"} {"source_code": "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\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text, \"\\r\\n\")\n\ts := strings.Split(text, \" \")\n\n\tc, _ := strconv.Atoi(s[0])\n\tif (c % 2) == 1 {\n\t\tc += 1\n\t}\n\tfmt.Println(c / 2)\n\t//x, _ := strconv.ParseInt(s[1], 10, 64)\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main(){\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n & 1 == 1 {\n\t\tfmt.Printf(\"%d\", (n + 1) >> 1)\n\t}else{\n\t\tfmt.Printf(\"%d\", n >> 1)\n\t}\n}"}], "negative_code": [{"source_code": "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\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimRight(text, \"\\r\\n\")\n\ts := strings.Split(text, \" \")\n\n\tc, _ := strconv.Atoi(s[0])\n\tfmt.Println(math.Ceil(float64(c) / 2.0))\n\t//x, _ := strconv.ParseInt(s[1], 10, 64)\n\n}\n"}], "src_uid": "30e95770f12c631ce498a2b20c2931c7"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\n// ******************************** CODE STARTS ********************************\n\nvar ()\n\nfunc getAns(array []int) int {\n\t// logln(\"lol\")\n\t// logln(array)\n\tn := len(array)\n\tres := 0\n\tfor {\n\t\tcount := 0\n\t\tleft := -1\n\t\tsum := -1\n\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif array[i] == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tleft = i\n\t\t\tsum = 1\n\t\t\tbreak\n\t\t}\n\n\t\tif left != -1 {\n\t\t\tfor j := left + 1; j < n; j++ {\n\t\t\t\tif array[j] == -1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif array[left] == array[j] {\n\t\t\t\t\tsum++\n\t\t\t\t} else {\n\t\t\t\t\tif sum >= 3 {\n\t\t\t\t\t\tfor i := left; i < j; i++ {\n\t\t\t\t\t\t\tarray[i] = -1\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount = sum\n\t\t\t\t\t\tsum = 0\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\n\t\t\t\t\tleft = j\n\t\t\t\t\tsum = 1\n\t\t\t\t}\n\t\t\t\t// logln(array)\n\t\t\t}\n\n\t\t\tif sum >= 3 {\n\t\t\t\tfor i := left; i < n; i++ {\n\t\t\t\t\tarray[i] = -1\n\t\t\t\t}\n\t\t\t\tcount = sum\n\t\t\t}\n\t\t\t// logln(array)\n\t\t}\n\n\t\tif count == 0 {\n\t\t\tbreak\n\t\t}\n\t\tres += count\n\t\tcount = 0\n\t}\n\treturn res - 1\n}\n\nfunc solve() {\n\tn := readInt()\n\t_ = readInt()\n\tx := readInt()\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = readInt()\n\t}\n\n\tbest := 0\n\tfor j := 0; j <= n; j++ {\n\t\tvar newArray []int\n\t\tif j > 0 {\n\t\t\tnewArray = append(newArray, array[:j]...)\n\t\t}\n\t\tnewArray = append(newArray, x)\n\t\tif j < n {\n\t\t\tnewArray = append(newArray, array[j:]...)\n\t\t}\n\t\tbest = maxInt(best, getAns(newArray))\n\t}\n\tprintInt(best)\n\tprintLine()\n}\n\n// ********************************* CODE ENDS *********************************\n\n// IO.\n\nvar (\n\tscanner *bufio.Scanner\n\twriter *bufio.Writer\n\tlogger *log.Logger\n)\n\nfunc main() {\n\tlocal := flag.Bool(\"local\", false, \"Equals true, if run is local.\")\n\tflag.Parse()\n\n\tvar (\n\t\tinput *os.File\n\t\toutput *os.File\n\t)\n\n\tif *local {\n\t\tstartTime := time.Now()\n\t\tdefer func() {\n\t\t\tprintln(fmt.Sprintf(\"Time: %.5fs\", time.Since(startTime).Seconds()))\n\t\t}()\n\t\tinput, _ = os.Open(\"/home/outside/coding/workspace/go/io/input.txt\")\n\t\toutput, _ = os.Create(\"/home/outside/coding/workspace/go/io/output.txt\")\n\t\tlogger = log.New(output, \"log: \", 0)\n\t} else {\n\t\tinput = os.Stdin\n\t\toutput = os.Stdout\n\t\t// input, _ = os.Open(\"\")\n\t\t// output, _ = os.Create(\"\")\n\t}\n\tdefer input.Close()\n\tdefer output.Close()\n\n\tscanner = bufio.NewScanner(input)\n\tscanner.Split(bufio.ScanWords)\n\n\twriter = bufio.NewWriter(output)\n\tdefer writer.Flush()\n\n\tsolve()\n}\n\n// Read.\n\nfunc readString() string {\n\tscanner.Scan()\n\tans := scanner.Text()\n\treturn ans\n}\n\nfunc readLine() string {\n\tscanner.Split(bufio.ScanLines)\n\tdefer scanner.Split(bufio.ScanWords)\n\treturn readString()\n}\n\nfunc readInt() int {\n\tans, _ := strconv.ParseInt(readString(), 10, 0)\n\treturn int(ans)\n}\n\nfunc readInt64() int64 {\n\tans, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn ans\n}\n\nfunc readFloat64() float64 {\n\tans, _ := strconv.ParseFloat(readString(), 64)\n\treturn ans\n}\n\n// Write.\n\nfunc printString(value string) {\n\twriter.WriteString(value)\n}\n\nfunc printLine() {\n\tprintString(\"\\n\")\n}\n\nfunc printInt(value int) {\n\tprintString(strconv.FormatInt(int64(value), 10))\n}\n\nfunc printInt64(value int64) {\n\tprintString(strconv.FormatInt(value, 10))\n}\n\nfunc printFLoat64(value float64) {\n\tprintString(strconv.FormatFloat(value, 'f', 20, 64))\n}\n\n// Log.\n\nfunc logln(value ...interface{}) {\n\twriter.Flush()\n\tlogger.Println(value...)\n}\nfunc logf(format string, value ...interface{}) {\n\twriter.Flush()\n\tlogger.Printf(format, value...)\n}\n\n// Tuple\n\ntype Tuple struct {\n\ta, b int\n}\n\nfunc (p Tuple) Equals(key Key) bool {\n\treturn p.a == key.(Tuple).a\n}\n\nfunc (p Tuple) Less(key Key) bool {\n\treturn p.a < key.(Tuple).a\n}\n\ntype TupleSlice []Tuple\n\nfunc (p TupleSlice) Len() int {\n\treturn len(p)\n}\n\nfunc (p TupleSlice) Less(j, i int) bool {\n\treturn p[j].a < p[i].a\n}\n\nfunc (p TupleSlice) Swap(j, i int) {\n\tp[j], p[i] = p[i], p[j]\n}\n\n// Min, max, abs.\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 a\n\t} else {\n\t\treturn b\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 maxInt64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc absInt64(a int64) int64 {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc 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 a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\n// Set Key interface implementations.\n\ntype Int int\n\nfunc (p Int) Equals(key Key) bool {\n\treturn int(p) == int(key.(Int))\n}\n\nfunc (p Int) Less(key Key) bool {\n\treturn int(p) < int(key.(Int))\n}\n\n// Set.\n\ntype Key interface {\n\tEquals(key Key) bool\n\tLess(key Key) bool\n}\n\ntype node struct {\n\tkey Key\n\tleft *node\n\tright *node\n}\n\nfunc newNode(key Key) *node {\n\treturn &node{key, nil, nil}\n}\n\ntype SplayTree struct {\n\troot *node\n\ttmp *node\n\tlen int\n}\n\nfunc NewSplayTree() *SplayTree {\n\treturn &SplayTree{nil, newNode(nil), 0}\n}\n\nfunc rotateLeft(x, p *node) {\n\tp.right = x.left\n\tx.left = p\n}\n\nfunc rotateRight(x, p *node) {\n\tp.left = x.right\n\tx.right = p\n}\n\nfunc (p *SplayTree) splay(x *node, key Key) *node {\n\tif x == nil {\n\t\treturn nil\n\t}\n\n\tleft := p.tmp\n\tright := p.tmp\n\n\tfor {\n\t\tif key.Less(x.key) {\n\t\t\ty := x.left\n\t\t\tif y == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif key.Less(y.key) { // zig-zig\n\t\t\t\trotateRight(y, x)\n\t\t\t\tx = y\n\t\t\t\tif x.left == nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// link right\n\t\t\tright.left = x\n\t\t\tright = x\n\t\t\t// move left\n\t\t\tx = x.left\n\t\t} else if x.key.Less(key) {\n\t\t\ty := x.right\n\t\t\tif y == nil {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif y.key.Less(key) { // zig-zig\n\t\t\t\trotateLeft(y, x)\n\t\t\t\tx = y\n\t\t\t\tif x.right == nil {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// link left\n\t\t\tleft.right = x\n\t\t\tleft = x\n\t\t\t// move right\n\t\t\tx = x.right\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tleft.right = x.left\n\tright.left = x.right\n\tx.left = p.tmp.right\n\tx.right = p.tmp.left\n\n\treturn x\n}\n\n// left <= key < right\nfunc (p *SplayTree) split(key Key) (left, right *node) {\n\tp.root = p.splay(p.root, key)\n\tif p.root.key.Equals(key) || p.root.key.Less(key) {\n\t\tright := p.root.right\n\t\tp.root.right = nil\n\t\treturn p.root, right\n\t} else {\n\t\tleft := p.root.left\n\t\tp.root.left = nil\n\t\treturn left, p.root\n\t}\n}\n\n// keys from left tree must be less then keys from right tree\nfunc (p *SplayTree) join(left, right *node) *node {\n\tif left == nil {\n\t\treturn right\n\t} else if right == nil {\n\t\treturn left\n\t}\n\tleft = p.splay(left, right.key)\n\tleft.right = right\n\treturn left\n}\n\ntype Set interface {\n\tLen() int\n\tInsert(key Key) error\n\tFind(key Key) bool\n\tRemove(key Key) error\n}\n\nfunc NewSet() Set {\n\treturn Set(NewSplayTree())\n}\n\nfunc (p *SplayTree) Len() int {\n\treturn p.len\n}\n\nfunc (p *SplayTree) Insert(key Key) error {\n\tif p.root == nil {\n\t\tp.root = newNode(key)\n\t\tp.len++\n\t} else {\n\t\tp.root = p.splay(p.root, key)\n\t\tif p.root.key.Equals(key) {\n\t\t\treturn errors.New(\"Such key already exists\")\n\t\t} else {\n\t\t\tleft, right := p.split(key)\n\t\t\tp.root = newNode(key)\n\t\t\tp.root.left = left\n\t\t\tp.root.right = right\n\t\t\tp.len++\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (p *SplayTree) Find(key Key) bool {\n\tif p.root == nil {\n\t\treturn false\n\t}\n\tp.root = p.splay(p.root, key)\n\treturn p.root.key.Equals(key)\n}\n\nfunc (p *SplayTree) Remove(key Key) error {\n\tp.root = p.splay(p.root, key)\n\tif p.root == nil || !p.root.key.Equals(key) {\n\t\treturn errors.New(\"Such key doesn't exist\")\n\t}\n\tp.root = p.join(p.split(key))\n\treturn nil\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\n// Retorna slice de slices com as duplas retiradas.\nfunc possiveisJogadas(row []int, num int, x int) [][]int {\n\tduplas := make([][2]int, 0)\n\n\tfor i := 0; i+1 <= num-1; i++ {\n\t\tif row[i] == x && row[i] == row[i+1] {\n\t\t\tduplas = append(duplas, [2]int{i, i + 1})\n\t\t}\n\t}\n\n\tpossibilidades := make([][]int, len(duplas))\n\n\tfor i, v := range duplas {\n\t\tcopia := make([]int, num)\n\t\tcopy(copia, row)\n\t\tx, y := v[0], v[1]\n\n\t\tpossibilidades[i] = append(copia[:x], copia[y+1:]...)\n\n\t}\n\n\treturn possibilidades\n}\n\n// Remove um range de um array. [x, y] != [x, y)\nfunc removerElementos(row *[]int, x, y int) {\n\t*row = append((*row)[:x], (*row)[y+1:]...)\n}\n\nfunc limparRow(row []int) []int {\n\ti := 1\n\tgrupo := 1\n\tgrupoAchado := false\n\tfor {\n\t\tif i >= len(row) {\n\t\t\tif grupo >= 3 {\n\t\t\t\tremoverElementos(&row, i-grupo, i-1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif row[i] == row[i-1] {\n\t\t\tgrupo++\n\t\t\tif grupo >= 3 {\n\t\t\t\tgrupoAchado = true\n\t\t\t}\n\t\t} else {\n\t\t\tif grupoAchado {\n\t\t\t\tremoverElementos(&row, i-grupo, i-1)\n\t\t\t\ti = 0\n\t\t\t\tgrupoAchado = false\n\n\t\t\t}\n\t\t\tgrupo = 1\n\t\t}\n\n\t\ti++\n\t}\n\n\treturn row\n}\n\nfunc main() {\n\t// len(row), num de cores, cor escolhida pelo player.\n\tvar num, k, x int\n\tfmt.Scan(&num, &k, &x)\n\n\t// Criar slice que representa a row.\n\trow := make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\tfmt.Scan(&row[i])\n\t}\n\n\t// Copia e algoritmos.\n\tjogadas := possiveisJogadas(row, num, x)\n\n\tmaior := 0\n\tfor _, jogada := range jogadas {\n\t\tcont := num - len(limparRow(jogada))\n\t\tif cont > maior {\n\t\t\tmaior = cont\n\t\t}\n\t}\n\tfmt.Println(maior)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\n// Retorna slice de slices com as duplas retiradas.\nfunc possiveisJogadas(row []int, num int, x int) [][]int {\n\tduplas := make([][2]int, 0)\n\n\tfor i := 0; i+1 <= num-1; i++ {\n\t\tif row[i] == x && row[i] == row[i+1] {\n\t\t\tduplas = append(duplas, [2]int{i, i + 1})\n\t\t}\n\t}\n\n\tpossibilidades := make([][]int, len(duplas))\n\n\tfor i, v := range duplas {\n\t\tcopia := make([]int, num)\n\t\tcopy(copia, row)\n\t\tx, y := v[0], v[1]\n\n\t\tpossibilidades[i] = append(copia[:x], copia[y+1:]...)\n\n\t}\n\n\treturn possibilidades\n}\n\n// Remove um range de um array. [x, y] != [x, y)\nfunc removerElementos(row *[]int, x, y int) {\n\t*row = append((*row)[:x], (*row)[y+1:]...)\n}\n\nfunc limparRow(row []int) []int {\n\ti := 1\n\tgrupo := 1\n\tgrupoAchado := false\n\tfor {\n\t\tif i >= len(row) {\n\t\t\tif grupo >= 3 {\n\t\t\t\tremoverElementos(&row, i-grupo, i-1)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tif row[i] == row[i-1] {\n\t\t\tgrupo++\n\t\t\tif grupo >= 3 {\n\t\t\t\tgrupoAchado = true\n\t\t\t}\n\t\t} else {\n\t\t\tif grupoAchado {\n\t\t\t\tremoverElementos(&row, i-grupo, i-1)\n\t\t\t\ti = 0\n\t\t\t\tgrupoAchado = false\n\n\t\t\t}\n\t\t\tgrupo = 1\n\t\t}\n\n\t\ti++\n\t}\n\n\treturn row\n}\n\nfunc main() {\n\t// len(row), num de cores, cor escolhida pelo player.\n\tvar num, k, x int\n\tfmt.Scan(&num, &k, &x)\n\n\t// Criar slice que representa a row.\n\trow := make([]int, num)\n\tfor i := 0; i < num; i++ {\n\t\tfmt.Scan(&row[i])\n\t}\n\n\t// Copia e algoritmos.\n\tjogadas := possiveisJogadas(row, num, x)\n\tif len(jogadas) == 0 {\n\t\tfmt.Println(0)\n\t}\n\n\tmaior := 0\n\tfor _, jogada := range jogadas {\n\t\tcont := num - len(limparRow(jogada))\n\t\tif cont > maior {\n\t\t\tmaior = cont\n\t\t}\n\t}\n\tfmt.Println(maior)\n}\n"}], "src_uid": "d73d9610e3800817a3109314b1e6f88c"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var pass,code string\n fmt.Scan(&pass)\n digit := make(map[string]int)\n for i := 0; i < 10; i++ {\n fmt.Scan(&code)\n digit[code] = i\n }\n for i := 0; i < 8; i++ {\n a := pass[i*10:(i+1)*10]\n fmt.Print(digit[a])\n }\n fmt.Println()\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var pass,code string\n fmt.Scan(&pass)\n digit := make(map[string]int)\n for i := 0; i < 10; i++ {\n fmt.Scan(&code)\n digit[code] = i\n }\n for i := 0; i < 8; i++ {\n a := pass[i*10:(i+1)*10]\n fmt.Print(digit[a])\n }\n fmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n scanner.Scan()\n code := scanner.Text()\n digits := map[string]int{}\n for i := 0; i < 10; i++ {\n scanner.Scan()\n digits[scanner.Text()] = i\n }\n for i := 0; i < 8; i++ {\n digit := digits[code[10*i:10*(i+1)]] \n writer.WriteString(fmt.Sprintf(\"%d\", digit))\n }\n writer.WriteString(\"\\n\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var pass,code string\n fmt.Scan(&pass)\n digit := make(map[string]int)\n for i := 0; i < 10; i++ {\n fmt.Scan(&code)\n digit[code] = i\n }\n for i := 0; i < 8; i++ {\n a := pass[i*10:(i+1)*10]\n fmt.Print(digit[a])\n }\n fmt.Println()\n}\n"}], "negative_code": [], "src_uid": "0f4f7ca388dd1b2192436c67f9ac74d9"} {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n%2==0 && n>2 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\tfmt.Scanln(&weight)\n\tif weight%2 == 0 && weight != 2 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n \nimport (\n \"os\"\n \"fmt\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n)\n \nfunc prErr(err error) {\n if err != nil {\n fmt.Println(err)\n } \n}\n \nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, err := reader.ReadString('\\n')\n prErr(err)\n text = strings.TrimSuffix(text, \"\\r\\n\")\n \n w, err := strconv.Atoi(text)\n prErr(err)\n \n if w!=2 && w%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(n int) int {\n\treturn n%2\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\n\tif check(n) == 0 && n != 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n \nimport (\n \"os\"\n \"fmt\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n)\n \nfunc prErr(err error) {\n if err != nil {\n fmt.Println(err)\n } \n}\n \nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, err := reader.ReadString('\\n')\n prErr(err)\n text = strings.TrimSuffix(text, \"\\r\\n\")\n \n w, err := strconv.Atoi(text)\n prErr(err)\n \n if !(w==0 || w==2) && w%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc readNumber() (int, error) {\n\treader := bufio.NewReader(os.Stdin)\n\tstr, err := reader.ReadString('\\r')\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tweight, err := strconv.Atoi(strings.Replace(str, \"\\r\", \"\", -1))\n\treturn weight, err\n}\n\nfunc main() {\n\tweight, err := readNumber()\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tpanic(err)\n\t}\n\tvar answer string\n\n\tif weight % 2 == 0 && weight != 2 {\n\t\tanswer = \"YES\"\n\t} else {\n\t\tanswer = \"NO\"\n\t}\n\n\tfmt.Println(answer)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\\n\", &w)\n\t// even\n\tif w%2 == 0 && w != 2 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var w uint\n\n fmt.Scanf(\"%d\", &w)\n\n if (w == 2) {\n fmt.Println(\"NO\")\n } else if (w % 2 == 0) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var i int\n _, err := fmt.Scanf(\"%d\", &i)\n if err != nil {fmt.Println(err)}\n if (i%2 == 0) && (i<=100) && (i>2) {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int64\n\tfmt.Scanln(&input)\n if input < 3 {\n fmt.Println(\"NO\")\n return\n }\n input -= 2\n if input % 2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar i float64\n\tfmt.Scan(&i)\n\tif math.Mod(i, 2) == 0 && i > 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight int32\n\t_, err := fmt.Scanf(\"%d\", &weight)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n\n\tif weight&1 == 1 || weight == 2 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tkilos := 0\n\tfmt.Scanf(\"%d\", &kilos)\n\n\tif kilos%2 != 0 || kilos == 2 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// main function\nfunc main() {\n\tvar temp int = 6\n\tfmt.Scanln(&temp)\n\tif temp < 4 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t} else if temp%2 == 0 {\n\t\tif (temp)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\", &w)\n\tif w <= 2 {\n\t\tfmt.Println(\"NO\")\n\t} else if w % 2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.Replace(text, \"\\r\\n\", \"\", -1)\n\n\tnumber, err := strconv.ParseInt(text, 10, 0)\n\n\tif err != nil {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif number > 100 || number < 1 {\n\t\tfmt.Println(\"NO\")\n\t}\n\n\tif number >= 4 && number%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "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\tfor scanner.Scan() {\n\t\tw, _ := strconv.Atoi(scanner.Text())\n\t\tyes := false\n\t\tfor i := 2; i < w; i += 2 {\n\t\t\tif (w-i)%2 == 0 {\n\t\t\t\tyes = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif yes {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var w int\n\tfmt.Scanf(\"%d\", &w)\n\tif w != 2 && w%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tw := 0\n\tfmt.Scanf(\"%d\", &w)\n\tif w != 2 && w%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n string\n\t_, _ = fmt.Scanln(&n)\n\ti, _ := strconv.ParseInt(n, 10, 64)\n\tfl := float64(i)\n\n\tif math.Mod(fl, 2) == 0 && fl != 2 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}"}, {"source_code": "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\tw, _ := strconv.Atoi(scanner.Text())\n\tfor i := 2; i < w; i += 2 {\n\t\tif (w-i)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\n// https://codeforces.com/problemset/problem/4/A\n\nimport \"fmt\"\n\nfunc task_solution(n int) string {\n\tif n > 3 && n%2 == 0 {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tvar n int\n\t_, err := fmt.Scan(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(n))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc task_solution(n int) string {\n\tif n > 3 && n%2 == 0 {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tvar n int\n\t_, err := fmt.Scan(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(n))\n}\n"}, {"source_code": "// test\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar a int\n\tfmt.Scanln(&a)\n\t//for a = 1; a <= 100; a++ {\n\t//\tfmt.Printf(\"%d: \", a)\n\tif a%2 == 1 {\n\t\tfmt.Println(\"NO\")\n\t} else if a/2 < 2 {\n\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n\t//}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\", &w)\n\n\tif w == 1 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfor i := 2; i <= w/2; i++ {\n\t\tif w%i == 0 && w%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar number int\n\tscanf(\"%d\", &number)\n\tif number == 2 {\n\t\tprintf(\"NO\")\n\t} else if number%2 == 0 {\n\t\tprintf(\"YES\")\n\t} else {\n\t\tprintf(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar number uint8\n\t_, _ = fmt.Scanln(&number)\n\tif number == 2 {\n\t\tfmt.Println(\"NO\")\n\t} else if number%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n\nfunc main() {\n\tvar a int\n\tscanf(\"%d\\n\", &a)\n\n\tif !(a % 2 == 0) || a == 2 {\n\t\tprintf(\"%s\", \"NO\")\n\t} else {\n\t\tprintf(\"%s\", \"YES\")\n\t}\n\n\twriter.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n string\n\t_, _ = fmt.Scanln(&n)\n\tvalue, _ := strconv.Atoi(n)\n\tif value > 2 && value % 2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scanf(\"%d\\n\", &a)\n\n\tif !(a%2 == 0) || a == 2 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\tfmt.Scan(&w)\n\tx := w - 2\n\tif x > 0 && x%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar w int\n\tfmt.Scan(&w)\n\tif w%2 == 0 && w > 2 {\n fmt.Println(\"YES\")\n\t} else {\n fmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n var w int\n fmt.Scan(&w)\n if w%2 == 0 && w > 2 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// http://codeforces.com/problemset/problem/4/A\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\ttext = strings.TrimSuffix(text, \"\\r\\n\")\n\tw, _ := strconv.ParseInt(text, 10, 8)\n\tif ( w > 2 && ((w-2)%2 == 0) ) {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n\nfunc main() {\n\tvar a int\n\tscanf(\"%d\\n\", &a)\n\n\tif !(a % 2 == 0) || a == 2 {\n\t\tprintf(\"%s\", \"NO\")\n\t\twriter.Flush()\n\t\treturn\n\t}\n\n\tprintf(\"%s\", \"YES\")\n\n\twriter.Flush()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\nvar i int \nvar two = 2;\n fmt.Scanf(\"%d\", &i);\n if i > two {\n if i% two == 0{\n fmt.Print(\"YES\");\n }else{\nfmt.Print(\"NO\");\n }\n }else{\nfmt.Print(\"NO\");\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n == 2 || n%2 == 1 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n%2 == 0 && n > 2 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\nvar i int \n fmt.Scanf(\"%d\", &i);\n if i > 2 && i% 2 == 0{\n fmt.Print(\"YES\");\n }else{\nfmt.Print(\"NO\");\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tif n%2 == 0 && n > 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar weight int\n\treader := bufio.NewReader(os.Stdin)\n\t// Carriage return\n\tif w, err := reader.ReadString('\\n'); err == nil {\n\t\ts := w[:len(w)-2]\n\t\tif r, err := strconv.Atoi(s); err == nil {\n\t\t\tweight = r\n\t\t} else {\n\t\t\tpanic(err)\n\t\t}\n\t} else {\n\t\tpanic(err)\n\t}\n\tif weight == 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tif weight % 2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k uint8\n\tfmt.Scanln(&k)\n\tif k == 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tif k%2 != 0 {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"yes\")\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t)\nfunc main() {\n number := 0\n fmt.Scanf(\"%d\\n\", &number)\n if number > 2 && number % 2 == 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n \n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar kilo float64\n\t_, _ = fmt.Scan(&kilo)\n\n\tnimf := int8(kilo)\n\tnimi := int8(kilo/2) * 2\n\n\tif kilo > 2 && nimf == nimi {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t// \"bufio\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _, _ := reader.ReadLine()\n\n\tstr := string(text)\n\n\tatt1, _ := strconv.ParseInt(str, 10, 0)\n\tif att1%2 == 0 && att1 != 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n "}, {"source_code": "package main\n\nimport (\n \"io\"\n \"strings\"\n \"bytes\"\n \"os\"\n \"fmt\"\n)\n\ntype contestIn struct {\n\treader io.Reader\n}\n\ntype contestOut struct {\n\twriter io.Writer\n}\n\ntype Contest struct {\n\tIn contestIn\n\tOut contestOut\n}\n\nfunc NewSubmitContest() Contest {\n\treturn Contest{contestIn{os.Stdin}, contestOut{os.Stdout}}\n}\n\nfunc NewTestContest(testIn string, testOut *bytes.Buffer) Contest {\n\treturn Contest{contestIn{strings.NewReader(testIn)}, contestOut{testOut}}\n}\n\nfunc (in contestIn) Var(a interface{}) {\n\tfmt.Fscan(in.reader, a)\n}\n\nfunc (in contestIn) Vars(a interface{}) {\n\tfmt.Fscanln(in.reader, a)\n}\n\nfunc (in contestIn) Ints(len int) []int {\n\tarr := make([]int, 0, len)\n\tfor ; len > 0; len-- {\n\t\tvar i int\n\t\tin.Var(&i)\n\t\tarr = append(arr, i)\n\t}\n\n\treturn arr\n}\n\nfunc (out contestOut) Str(s string) {\n\tfmt.Fprintf(out.writer, \"%s\", s)\n}\n\nfunc (out contestOut) Nl() {\n\tfmt.Fprintln(out.writer)\n}\n\n// http://codeforces.com/problemset/problem/4/A\nfunc problem(c Contest) {\n\tvar w int\n\tc.In.Var(&w)\n\n\tif (w > 2) && (w % 2 == 0) {\n\t\tc.Out.Str(\"YES\")\n\t} else {\n\t\tc.Out.Str(\"NO\")\n\t}\n\n\tc.Out.Nl()\n}\n\nfunc main() {\n\tc := NewSubmitContest()\n\tproblem(c)\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n \nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar w uint8\n\tfmt.Fscanf(in, \"%d\\n\", &w)\n\tif w == 2 {\n\t\tfmt.Println(\"NO\")\n\t}else if w % 2 == 0{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n} \n"}, {"source_code": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main(){\n var i int\n fmt.Scanf(\"%d\\n\", &i)\n //i, _ := strconv.Atoi(text)\n if (i%2==0 && i>2) {\n fmt.Print(\"YES\")\n return\n }\n fmt.Print(\"NO\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Scan()\n\tw, _ := strconv.Atoi(s.Text())\n\n\tif w <= 100 {\n\t\tif w >= 1 {\n\t\t\tif w%2 == 0 {\n\t\t\t\tif w == 2 {\n\t\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t}\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\n\tfmt.Scanf(\"%d\\n\", &weight)\n\n\tif weight == 2 {\n\t\tfmt.Printf(\"NO\\n\")\n\t} else if weight%2 == 0 {\n\t\tfmt.Printf(\"YES\\n\")\n\t} else {\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\n\tfmt.Scanf(\"%d\\n\", &weight)\n\n\tif weight == 2 {\n\t\tfmt.Printf(\"NO\\n\")\n\t} else if weight%2 == 0 {\n\t\tfmt.Printf(\"YES\\n\")\n\t} else {\n\t\tfmt.Printf(\"NO\\n\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tif x % 2 == 1 || x == 2 {\n\t\tif x > 2 && (x - 2) % 2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else if x > 2 {\n\t\tfmt.Println(\"YES\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\n\n\nfunc main() {\n\n var w int\n fmt.Scan(&w)\n \n for i := 1; i < w; i++ {\n \n if (w-i) % 2 == 0 && w % 2 == 0 {\n fmt.Print(\"YES\")\n return\n }\n }\n fmt.Print(\"NO\")\n\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n\n var w int\n fmt.Scan(&w)\n \n if w % 2 == 0 && w > 2{\n fmt.Print(\"YES\")\n return\n }\n fmt.Print(\"NO\")\n\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\n\n\nfunc main() {\n\n var w int\n fmt.Scan(&w)\n \n for i := 1; i < w; i++ {\n other := w-i\n if other % 2 == 0 && w % 2 == 0 {\n fmt.Print(\"YES\")\n return\n }\n }\n fmt.Print(\"NO\")\n\n}\n"}, {"source_code": "package main\nimport (\n\t\t\"fmt\"\n\t\t)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n > 2 && n % 2 == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n\treturn\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight,modulo int\n\tvar flag bool\n\tfmt.Scanf(\"%d\", &weight)\n\tif weight > 0 && weight < 101 {\n\t\tfor loop := 2; loop < 101 ; loop=loop+2 {\n\t\t\tmodulo = weight - loop \n\t\t\tif modulo < 2 { break }\n\t\t\tif modulo % 2 == 0 {\n\t\t\t\tflag = true\n\t\t\t}else{\n\t\t\t\tflag = false\n\t\t\t}\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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\nfunc main() {\n\t// The weight of watermelon\n\tvar w int\n\tscanf(\"%d\\n\", &w)\n\n\tvar b bool = false\n\tif w <= 2 {\n\t\tb = false\n\t} else if w%2 == 0 {\n\t\tb = true\n\t} else {\n\t\tb = false\n\t}\n\n\t// Display result\n\tif b {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n\n\twriter.Flush()\n}\n"}, {"source_code": "/* Problemset:\nA. Watermelon\ntime limit per test1 second\nmemory limit per test64 megabytes\ninputstandard input\noutputstandard output\nOne hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scales showed w kilos. They rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.\n\nPete and Billy are great fans of even numbers, that's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos, at the same time it is not obligatory that the parts are equal. The boys are extremely tired and want to start their meal as soon as possible, that's why you should help them and find out, if they can divide the watermelon in the way they want. For sure, each of them should get a part of positive weight.\n\nInput\nThe first (and the only) input line contains integer number w (1\u2009\u2264\u2009w\u2009\u2264\u2009100) \u2014 the weight of the watermelon bought by the boys.\n\nOutput\nPrint YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.\n\nExamples\ninputCopy\n8\noutputCopy\nYES\nNote\nFor example, the boys can divide the watermelon into two parts of 2 and 6 kilos respectively (another variant \u2014 two parts of 4 and 4 kilos).\n\n---\n\nWhat we learned:\nCodeForces takes input with fmt.Scanf and not os.Args. 1 is an odd number of slices. Each submission shows the full results of tests, including input, in the submission number link.\n*/\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tif n%2 != 0 {\n\t\tfmt.Println(\"NO\")\n\t} else if n <= 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tnumber := -1\n\t_, err := fmt.Scanln(&number)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif number > 3 && (number%2) == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\nimport (\n \"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n scanner.Scan()\n ret, _ := strconv.Atoi(scanner.Text())\n return ret\n}\n\nfunc main(){\n scanner.Split(bufio.ScanWords)\n n := readInt();\n if n % 2 == 0 {\n if (n > 2){\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n }else{\n fmt.Println(\"NO\") \n }\n}"}, {"source_code": "package main;import\"fmt\";func main(){var a int8;fmt.Scan(&a);if(a&1==1||a==2){fmt.Print(\"NO\")}else{fmt.Print(\"YES\")}}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x int\n fmt.Scanf(\"%d\",&x)\n if(x%2 == 0 && x > 2){\n fmt.Print(\"YES\\n\")\n }else{\n fmt.Print(\"NO\\n\")\n }\n}\n"}, {"source_code": "//rextester.com:1.6.2--codeforces.com:1.8\npackage main;import\"fmt\"\nfunc main(){var a int8;fmt.Scan(&a);if(a&1==1||a==2){fmt.Print(\"NO\")}else{fmt.Print(\"YES\")}}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// THIS WAS JUST TO TEST IF CODEFORCES UNDERSTAND GOLANG\n\n/*\nOne hot summer day Pete and his friend Billy decided to buy a watermelon.\nhey chose the biggest and the ripest one, in their opinion.\nAfter that the watermelon was weighed, and the scales showed w kilos.\nThey rushed home, dying of thirst, and decided to divide the berry, however they faced a hard problem.\n\nPete and Billy are great fans of even numbers,\nthat's why they want to divide the watermelon in such a way that each of the two parts weighs even number of kilos,\nat the same time it is not obligatory that the parts are equal.\nThe boys are extremely tired and want to start their meal as soon as possible\nthat's why you should help them and find out, if they can divide the watermelon in the way they want.\nFor sure, each of them should get a part of positive weight.\n\n\nInput\nThe first (and the only) input line contains integer number w (1\u2009\u2264\u2009w\u2009\u2264\u2009100) \u2014 the weight of the watermelon bought by the boys.\nOutput\nPrint YES, if the boys can divide the watermelon into two parts, each of them weighing even number of kilos; and NO in the opposite case.\n*/\n\nfunc main() {\n\tvar number int\n\n\t_, err := fmt.Scanf(\"%d\", &number)\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tcanDevide(number)\n\n}\n\nfunc canDevide(number int) {\n\tif number == 2 || number%2 != 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar number int\n\t_, err := fmt.Scanf(\"%d\", &number)\n\tif err != nil {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif number < 1 || number > 100 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tif number == 2 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tif number%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\n\tif n%2 == 0 && n != 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scanf(\"%d\", &a)\n\tif a > 2 && a%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "\n\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\\n\",&w)\n\n\tif w % 2 == 1 || w <= 2 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var kilos int = 0\n fmt.Scan(&kilos)\n if kilos > 2 && kilos%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n \n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int64\n\tfmt.Scan(&w)\n\n\tif w&1 == 1 || w == 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\tif a%2==0&&a>0&&a<101 {\n\t\tfmt.Println(\"YES\")\n\t} else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int64\n\tfmt.Scanln(&input)\n input -= 2\n if input % 2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n\nfunc main() {\n\tvar a int\n\tscanf(\"%d\\n\", &a)\n\n\tif !(a % 2 == 0) {\n\t\tprintf(\"%s\\n\", \"NO\")\n\t} else {\n\t\tprintf(\"%s\", \"YES\")\n\t}\n\t\n\twriter.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main(){\n reader := bufio.NewReader(os.Stdin)\n kg, _ := reader.ReadString('\\n')\n\n //remove newline\n kg = strings.Replace(kg, \"\\n\",\"\",-1)\n\n //conver string variable to int variable\n\n kgnum, e := strconv.Atoi(kg)\n if e != nil {\n fmt.Println(\"conversion error:\", kg)\n }\n\n if(kgnum%2==0 && (kgnum/2)%2==0){\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t//fmt.Println(\"Enter weight of the watermelon: \")\n\tvar wt int\n\t// Taking input from user\n\tfmt.Scanln(&wt)\n\n\tif wt%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tfmt.Println(\"NO\")\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tkilos := 0\n\tfmt.Scanf(\"%d\", &kilos)\n\tif kilos%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n //\"os\"\n //\"strconv\"\n //\"io/ioutil\"\n)\n\nfunc main() {\n\nvar WKgVar uint\nvar OstatokDelVar uint = 0;\nvar Zero uint = 0;\n// var Kolvo2KgVar int = 1;\n// var ObshKgVar int = 1;\n\n// \u0412\u0432\u043e\u0434 \u0447\u0438\u0441\u043b\u0430 \u041a\u0438\u043b\u043e\u0433\u0440\u0430\u043c\u043c.\nfmt.Scan(&WKgVar)\n// \u0427\u0435\u0442\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c.\nOstatokDelVar = WKgVar%4;\nif WKgVar < 100{\nif OstatokDelVar == Zero{\n\t// fmt.Println(\"\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u043e\u043b\u044c\")\n\tif WKgVar >= 4{\n\t\t//fmt.Println(\"WkgVar >= 4\")\n\t\tfmt.Println(\"YES\");\n\t\t}\n\t\n}\n} else {fmt.Println(\"NO\");\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight int\n\t_, err := fmt.Scanf(\"%d\", &weight)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n\tfor i := 1; i < weight; i++ {\n\t\tif i&11 == 0 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t// \"bufio\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _, _ := reader.ReadLine()\n\n\tstr := string(text)\n\n\tatt1, _ := strconv.ParseInt(str, 10, 0)\n\tif att1%2 == 0 || att1 != 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\n\n\nfunc main() {\n\n var w int\n fmt.Scan(&w)\n \n for i := 0; i < w; i++ {\n other := w-i\n if other % 2 == 0 && w % 2 == 0 {\n fmt.Print(\"YES\")\n return\n }\n }\n fmt.Print(\"NO\")\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar weight int\n\n\tfmt.Scanf(\"%d\", &weight)\n\n\tif weight/2 * 2 == weight {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar w float64\n\t_, _ = fmt.Scanf(\"%f\", &w)\n\n\tfmt.Println(Run(w))\n}\n\nfunc Run(w float64) string {\n\ta := w/2\n\t// \u0415\u0441\u043b\u0438 \u0443 \u0430 \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0430, \u0442\u043e NO\n\tif strings.Contains(fmt.Sprint(a), \".\") {\n\t\treturn \"NO\"\n\t}\n\n\t// \u0415\u0441\u043b\u0438 \u0443 \u0430 \u043d\u0435\u0442 \u0442\u043e\u0447\u043a\u0438, \u0442\u043e \u0430 \u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u0434\u0432\u0430\n\t// \u0415\u0441\u043b\u0438 a/2 \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0430, \u0442\u043e NO\n\tif strings.Contains(fmt.Sprint(a/2), \".\"){\n\t\treturn \"NO\"\n\t}\n\n\t// \u0415\u0441\u043b\u0438 \u0442\u043e\u0447\u043a\u0438 \u043d\u0435\u0442, \u0442\u043e YES\n\treturn \"YES\"\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar weight int\n\n\tfmt.Scanf(\"%d\", &weight)\n\n\tif weight/2 * 2 == weight {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var w int\n fmt.Scanf(\"%d\", &w)\n if w%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n return\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w int64\n\tfmt.Scan(&w)\n\n\tif w % 2 == 0 && w != 2 && 1<=w && w<=100 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tif w % 2 == 1 && 1<=w && w<=100 {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight int\n\t_, err := fmt.Scanf(\"%d\", &weight)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n\tfor i := 1; i < weight; i++ {\n\t\tif i&11 == 0 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight = 0\n\t_, err := fmt.Scanf(\"%d\\n\", &weight)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif isEven(weight) && weight > 3 {\n\t\tif weight % 4 == 0 {\n\t\t\tprintln(\"YES\\n\")\n\t\t\treturn\n\t\t}\n\n\t\tif (weight - 2) % 4 == 0 {\n\t\t\tprintln(\"YES\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tprintln(\"NO\\n\")\n\treturn\n}\n\nfunc isEven(n int) bool {\n\treturn n % 2 == 0\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tstdin, err := os.OpenFile(\"input\", os.O_RDONLY|os.O_CREATE, 0666)\n\tif err != nil {\n\t\tfmt.Errorf(\"%s\\n\", err)\n\t}\n\tos.Stdin = stdin\n\n\tr := bufio.NewReader(os.Stdin)\n\n\tvar w int32\n\tfmt.Fscan(r, &w)\n\t// even\n\tif w%2 == 0 {\n\t\tif (w/2)%2 == 0 {\n\t\t\tfmt.Printf(\"YES\")\n\t\t} else {\n\t\t\tfmt.Printf(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar cont int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 1; i < n; i++ {\n\t\tif i%2 == 0 {\n\t\t\tif n%i == 0 {\n\t\t\t\tcont++\n\t\t\t}\n\t\t}\n\t}\n\tif cont >= 2 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scanln(&a)\n\t\tif a%2 == 0 {\n\t\t\tb:=a/2\n\t\t\tif b%2==0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t} else if a==2{\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\tc:=b-1\n\t\t\t\td:=b+1\n\t\t\t\tif c%2==0&&d%2==0 {\n\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\tfmt.Scanf(\"%d\", &weight)\n\tif weight%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\nimport \"strconv\"\n\nfunc main() {\n fmt.Println(os.Args)\n if len(os.Args) == 2 {\n args := os.Args[1]\n //fmt.Printf(\"%T\\n\", args)\n argi, _ := strconv.Atoi(args)\n //fmt.Printf(\"%T\", argi)\n //fmt.Println(argi)\n if argi % 2 == 0 {\n fmt.Println(\"YES\")\n } else { \n fmt.Println(\"NO\") }\n\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a%2 == 0 {\n\t\tb := a / 2\n\t\tif b%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// http://codeforces.com/problemset/problem/4/A\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tw, _ := strconv.ParseInt(text, 10, 8)\n\tif ((w-2)%2) == 0 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t)\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n number, _ := strconv.Atoi(text)\n if number > 2 && number % 2 == 0 {\n fmt.Println(\"YES\")\n }else{\n fmt.Println(\"NO\")\n }\n \n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\tfmt.Scanf(\"%d\", &weight)\n\tif (weight % 2 == 0 ) || (weight == 2) {\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc Watermelon(n int) bool {\n\treturn n%2 == 0\n}\n\nfunc main() {\n\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tnum, _ := strconv.Atoi(text)\n\tif Watermelon(num) {\n\t\tfmt.Println(\"YES\")\n\t}else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n//https://codeforces.com/problemset/problem/4/A\nfunc main() {\n\tvar w int\n\tfmt.Scanf(\"%d\", &w)\n\tif w >= 1 && w <= 100 {\n\t\tif (w-3)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport(\n\"fmt\"\n)\n\nfunc main(){\n\tvar weight int\n\t_, _ = fmt.Scanf(\"%d\", &weight)\n\tfmt.Println(weight)\n\tif weight % 2 == 0 && weight > 1{\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\")\n\tfmt.Printf(\"%d\\n\", n % 2 == 0)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tstr, _ := reader.ReadString('\\r')\n\tstr = str[:len(str)-1]\n\tn, _ := strconv.Atoi(str)\n\tfor i := 2; i < n/2; i++ {\n\t\tif (n/i)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc even (w int) bool {\n\tif w % 2 == 0 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar weight int\n\treader := bufio.NewReader(os.Stdin)\n\t// Carriage return\n\tif w, err := reader.ReadString('\\n'); err == nil {\n\t\t// Depends.\n\t\ts := w[:len(w)-2]\n\t\tif r, err := strconv.Atoi(s); err == nil {\n\t\t\tweight = r\n\t\t} else {\n\t\t\tpanic(err)\n\t\t}\n\t} else {\n\t\tpanic(err)\n\t}\n\tif even(weight/2) && even(weight) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var w uint\n \n fmt.Scanf(\"%d\", &w) \n\n if (w % 2 == 0) {\n fmt.Println(\"YES\")\n } \n\n fmt.Println(\"NO\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(\"Enter the watermelon's weight:\")\n\treader := bufio.NewReader(os.Stdin)\n\tr, _ := reader.ReadString('\\n')\n\tw, _ := strconv.Atoi(r)\n\n\tif w <= 100 {\n\t\tif w >= 1 {\n\t\t\tif w%2 == 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t}\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a int\n\t//fmt.Print(\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0432\u0435\u0441 \u0430\u0440\u0431\u0443\u0437\u0430: \")\n\tfmt.Fscan(os.Stdin, &a)\n\tm := a%2\n\tif m == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"io\"\n \"strings\"\n \"bytes\"\n \"bufio\"\n \"os\"\n)\n\ntype contestIn struct {\n\treader io.Reader\n}\n\ntype contestOut struct {\n\twriter io.Writer\n}\n\ntype Contest struct {\n\tIn contestIn\n\tOut contestOut\n}\n\nfunc NewSubmitContest() Contest {\n\treturn Contest{contestIn{bufio.NewReader(os.Stdin)}, contestOut{bufio.NewWriter(os.Stdout)}}\n}\n\nfunc NewTestContest(testIn string, testOut *bytes.Buffer) Contest {\n\treturn Contest{contestIn{strings.NewReader(testIn)}, contestOut{testOut}}\n}\n\nfunc (in contestIn) Var(a interface{}) {\n\tfmt.Fscan(in.reader, a)\n}\n\nfunc (in contestIn) Vars(a interface{}) {\n\tfmt.Fscanln(in.reader, a)\n}\n\nfunc (in contestIn) Ints(len int) []int {\n\tarr := make([]int, 0, len)\n\tfor ; len > 0; len-- {\n\t\tvar i int\n\t\tin.Var(&i)\n\t\tarr = append(arr, i)\n\t}\n\n\treturn arr\n}\n\nfunc (out contestOut) Str(s string) {\n\tfmt.Fprintf(out.writer, \"%s\", s)\n}\n\nfunc (out contestOut) Nl() {\n\tfmt.Fprintln(out.writer)\n}\n\n// http://com/problemset/problem/4/A\nfunc problem(c Contest) {\n\tvar w int\n\tc.In.Var(&w)\n\n\tif w % 2 == 0 {\n\t\tc.Out.Str(\"YES\")\n\t} else {\n\t\tc.Out.Str(\"NO\")\n\t}\n\n\tc.Out.Nl()\n}\n\nfunc main() {\n\tc := NewSubmitContest()\n\tproblem(c)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i int\n\t_, _ = fmt.Scanf(\"%d\", &i)\n\tif (i-2) > 0 && (i - 2) % 2 != 0{\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n\n}"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t)\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n number, _ := strconv.Atoi(text)\n if number > 2 && number % 2 == 0 {\n fmt.Print(\"YES\")\n }else{\n fmt.Print(\"NO\")\n }\n \n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// main function\nfunc main() {\n\tvar temp int\n\tfmt.Scanln(&temp)\n\tif temp%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\t//fmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport(\n\t\"bufio\"\n\t\"strings\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"io\"\n)\n\nfunc main(){\n\tfmt.Print(getStatus())\n}\n\nfunc getInput() int{\n\treader := bufio.NewReader(os.Stdin)\n\ts, err := reader.ReadString('\\n')\n\n\tif err != nil && err != io.EOF{\n\t\tlog.Fatal(err)\n\t}\n\ts = strings.TrimRight(s, \"\\r\\n\")\n\n\tw, err := strconv.Atoi(s)\n\tif err != nil && err != io.EOF{\n\t\tlog.Fatal(err)\n\t}\n\treturn w\n}\n\nfunc getStatus() string{\n\tw := getInput()\n\t\n\tif w%2 == 0 && w > 1{\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\tfmt.Print(\"Enter the weight of watermelon (integral value from 1 to 100) bought by the boys : \")\n\tfmt.Scanln(&weight)\n\tif weight <= 100 && weight >= 1 {\n\t\tif weight%4 == 0 {\n\t\t\tfmt.Print(\"YES\")\n\t\t} else {\n\t\t\tfmt.Print(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"Weight of watermelon must be an integral value from 1 to 100\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int64\n\tfmt.Scanln(&input)\n\tif (input/2)*2 == input && (input/2)%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Fscanf(os.Stdin, \"%d\\n\", &n)\n\tif n%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := 2; i < n; i += 2 {\n\t\tother := n - i\n\t\tif other%2 == 0 {\n\t\t\tprint(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tprint(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w int\n\tfmt.Scan(&w)\n\n\tif w % 2 == 0 && (w != 2) && 1<=w && w<=100 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tif w % 2 == 1 && 1<=w && w<=100 {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n text = strings.Replace(text, \"\\n\", \"\", -1)\n\n num, err := strconv.Atoi(text)\n if err != nil {\n fmt.Printf(\"parse error, input text: %+v\", text)\n return\n }\n\n if num <= 0 || num > 100 || num%2 != 0 {\n fmt.Printf(\"NO\")\n return\n }\n\n fmt.Printf(\"YES\")\n}"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n var w int\n fmt.Scanln(&w)\n if w % 4 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar number int\n\tscanf(\"%d\", &number)\n\tif number == 2 {\n\t\tprintf(\"YES\")\n\t} else if number%2 == 0 {\n\t\tprintf(\"NO\")\n\t} else {\n\t\tprintf(\"YES\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight int\n\t_, err := fmt.Scanf(\"%d\", &weight)\n\tif err != nil {\n\t\tfmt.Println(err.Error())\n\t}\n\tfor i := 1; i < weight; i++ {\n\t\tif i&11 == 0 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n kgnum := 8\n\n if(kgnum%2==0 && (kgnum/2)%2==0){\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// main function\nfunc main() {\n\tvar temp int\n\tfmt.Scanln(&temp)\n\tif temp%2 == 0 {\n\t\tif (temp/2)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var x int\n var y int\n fmt.Scanf(\"%d\",&x)\n if(x % 2 == 0){\n y = x/2\n if(y % 2 == 0){\n fmt.Print(\"YES\\n\")\n }else {\n fmt.Print(\"NO\\n\")\n }\n }else{\n fmt.Print(\"NO\\n\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w, x int\n\tfmt.Scan(&w)\n\tx = w/2\n\tif x > 0 && x % 2 == 0 && 1 <= w && w <= 100 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tif x > 0 && x % 2 == 1 && 1 <= w && w <= 100 {\n\t\tfmt.Println(\"NO\")\n\t}\n\tif x == 0 && 1 <= w && w <= 100 {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tstr, _ := reader.ReadString('\\n')\n\tstr = str[:len(str)-1]\n\tfmt.Printf(\"str: %#v\", str)\n\treturn\n\n\tn, _ := strconv.Atoi(str)\n\tfor i := 2; i < n/2; i++ {\n\t\tif (n/i)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n // for {\n var i int\n _, err := fmt.Scanf(\"%d\", &i)\n if err != nil {fmt.Println(err)}\n if i%2 == 0 {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n // }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar weight int\n\n\tfmt.Scanf(\"%d\", &weight)\n\n\tif weight/2 * 2 == weight {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\tfmt.Scan(&w)\n\tif (w%2)==0 && w>1{\n\t\tfmt.Print(\"YES\")\n\t}else{\n\t\tfmt.Print(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n //\"os\"\n //\"strconv\"\n //\"io/ioutil\"\n)\n\nfunc main() {\n\nvar WKgVar uint\nvar OstatokDelVar uint = 0;\nvar Zero uint = 0;\n// var Kolvo2KgVar int = 1;\n// var ObshKgVar int = 1;\n\n// \u0412\u0432\u043e\u0434 \u0447\u0438\u0441\u043b\u0430 \u041a\u0438\u043b\u043e\u0433\u0440\u0430\u043c\u043c.\nfmt.Scan(&WKgVar)\n// \u0427\u0435\u0442\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c.\nOstatokDelVar = WKgVar%4;\nif WKgVar <= 100{\nif OstatokDelVar == Zero{\n\t// fmt.Println(\"\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u043e\u043b\u044c\")\n\tif WKgVar >= 4{\n\t\t//fmt.Println(\"WkgVar >= 4\")\n\t\tfmt.Println(\"YES\");\n\t\t}\n\t\n}\n} else {fmt.Println(\"NO\");\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Fscanf(os.Stdin, \"%d\\n\", &n)\n\tif n%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var melon int\n fmt.Scanln(&melon)\n if melon % 2 == 1 {\n fmt.Println(\"NO\")\n } else {\n fmt.Println(\"YES\")\n }\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n text = strings.Replace(text, \"\\n\", \"\", -1)\n\n num, err := strconv.Atoi(text)\n if err != nil {\n fmt.Print(\"NO\")\n return\n }\n\n if num <= 0 || num > 100 || num%2 != 0 {\n fmt.Printf(\"NO\")\n return\n }\n\n fmt.Printf(\"YES\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar ves int\n\tfmt.Scan(&ves)\n\tif ves < 1 || ves > 100 {\n\t\tfmt.Println(\"\u0422\u0430\u043a\u0438\u0445 \u0430\u0440\u0431\u0443\u0437\u043e\u0432 \u043d\u0435 \u0431\u044b\u0432\u0430\u0435\u0442\")\n\t} else {\n\t\tif (ves % 2 % 2) == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "// test\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar a int\n\tfmt.Scanln(&a)\n\tif a%2 == 1 {\n\t\tfmt.Println(\"NO\")\n\t} else if a < 2 {\n\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// http://codeforces.com/problemset/problem/4/A\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tw, _ := strconv.ParseInt(text, 10, 8)\n\tif ((w-2)%2) == 0 {\n\t\tprint(\"YES\")\n\t} else {\n\t\tprint(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tvalue, _ := strconv.ParseInt(text, 0, 64)\n\timpl(value)\n}\n\nfunc impl(n int64) {\n\tif n % 2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n \nimport (\n \"os\"\n \"fmt\"\n \"math\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n \nfunc main() {\n text, _ := bufio.NewReader(os.Stdin).ReadString('\\n')\n text = strings.TrimSuffix(text, \"\\n\")\n \n w, _ := strconv.Atoi(text)\n if math.Mod(float64(w), 2) == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var num int\n\n fmt.Scanf(\"%d\", &num)\n\n fmt.Printf(\"mod: %d\\n\", num%2)\n\n if num <= 2 || num > 100 || num%2 != 0 {\n fmt.Printf(\"NO\")\n return\n }\n\n fmt.Printf(\"YES\")\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar kilo int8\n\t_, _ = fmt.Scan(&kilo)\n\t//reader := bufio.NewReader(os.Stdin)\n\t//text, _ := reader.ReadString('\\n')\n\t//integer, _ := strconv.Atoi(text)\n\n\tif (kilo/2)%2 == 0 {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tfor i := 2; i < n; i += 2 {\n\t\tother := n - i\n\t\tif other%2 == 0 {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tprintln(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(\"Enter the watermelon's weight:\")\n\treader := bufio.NewReader(os.Stdin)\n\tr, _ := reader.ReadString('\\n')\n\tw, _ := strconv.Atoi(r)\n\n\tif w <= 100 {\n\t\tif w >= 1 {\n\t\t\tif w%2 == 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t}\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar weight = 0\n\t_, err := fmt.Scanf(\"%d\", &weight)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif isEven(weight) && weight > 3 {\n\t\tif weight % 4 == 0 {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\n\t\tif (weight - 2) % 4 == 0 {\n\t\t\tprintln(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tprintln(\"NO\")\n\treturn\n}\n\nfunc isEven(n int) bool {\n\treturn n % 2 == 0\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"fmt\"\n \"math\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, _ := reader.ReadString('\\n')\n \n w, _ := strconv.Atoi(text)\n if math.Mod(float64(w), 2) == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n //\"os\"\n //\"strconv\"\n //\"io/ioutil\"\n)\n\nfunc main() {\n\nvar WKgVar int\nvar OstatokDelVar int = 0;\nvar Zero int = 0;\n// var Kolvo2KgVar int = 1;\n// var ObshKgVar int = 1;\n\n// \u0412\u0432\u043e\u0434 \u0447\u0438\u0441\u043b\u0430 \u041a\u0438\u043b\u043e\u0433\u0440\u0430\u043c\u043c.\nfmt.Scan(&WKgVar)\n// \u0427\u0435\u0442\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c.\nOstatokDelVar = WKgVar%2;\n\nif OstatokDelVar == Zero{\n\t// fmt.Println(\"\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u043e\u043b\u044c\")\n\tif WKgVar >= 4{\n\t\t//fmt.Println(\"WkgVar >= 4\")\n\t\tfmt.Println(\"YES\");\n\t\t}\n\t\n\n} else {fmt.Println(\"NO\");\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scanln(&a)\n\t\tif a%2 == 0 {\n\t\t\tb:=a/2\n\t\t\tif b%2==0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nfunc main(){\n var w int\n fmt.Scanf(\"%d\", &w)\n if w % 2 == 0 && w != 0 {fmt.Println(\"Yes\")\n }else {fmt.Println(\"No\")}\n \n}"}, {"source_code": "package main\n \nimport (\n \"os\"\n \"fmt\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n)\n \nfunc prErr(err error) {\n if err != nil {\n fmt.Println(err)\n } \n}\n \nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n text, err := reader.ReadString('\\n')\n prErr(err)\n text = strings.TrimSuffix(text, \"\\r\\n\")\n \n w, err := strconv.Atoi(text)\n prErr(err)\n \n if w%2 == 0 {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tif n%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(n int) int {\n\treturn n%2\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\n\tif check(n) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isDivide(k int8) string {\n\tif k%4 == 0 {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\n\nfunc main() {\n\tvar k int8\n\tfmt.Scanln(&k)\n\tfmt.Println(isDivide(k))\n\n}\n"}, {"source_code": "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\tfor scanner.Scan() {\n\t\ti, _ := strconv.Atoi(scanner.Text())\n\t\tif i%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar weight int\n\n\t_, _ = fmt.Scanf(\"%d\", &weight)\n\n\tif weight/2%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n // for {\n var i int\n _, err := fmt.Scanf(\"%d\", &i)\n if err != nil {fmt.Println(err)}\n if (i%2 == 0) && (i<100) && (i>0) {\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n // }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w int\n\tfmt.Scan(&w)\n\n\tif w % 2 == 0 && (w != 2) && 1<=w && w<=100 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tif w % 2 == 1 && 1<=w && w<=100 {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "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\tfor scanner.Scan() {\n\t\ti, _ := strconv.Atoi(scanner.Text())\n\t\tif i%2 == 0 && (i/2)%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(a)\n\tif a%2 == 0 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"Enter weight of the watermelon: \")\n\tvar wt int\n\t// Taking input from user\n\tfmt.Scanln(&wt)\n\n\tif wt%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t}\n\tfmt.Println(\"NO\")\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc Watermelon(n int) bool {\n\treturn n%2 == 0\n}\n\nfunc main() {\n\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _ := reader.ReadString('\\n')\n\tnum, _ := strconv.Atoi(text)\n\tfmt.Println(Watermelon(num))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// main function\nfunc main() {\n\tvar temp int\n\tfmt.Scanln(&temp)\n\tif temp%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\t//fmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a%2 == 0 {\n\t\tb := a / 2\n\t\tif b%2 == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tw, _ := strconv.Atoi(scanner.Text())\n\n\tif w <= 100 {\n\t\tif w >= 1 {\n\t\t\tif w%2 == 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t}\n\t\t}\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t//fmt.Println(\"Enter weight of the watermelon: \")\n\tvar wt int\n\t// Taking input from user\n\tfmt.Scanln(&wt)\n\n\tif wt%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n //\"os\"\n //\"strconv\"\n //\"io/ioutil\"\n)\n\nfunc main() {\n\nvar WKgVar int\nvar OstatokDelVar int = 0;\nvar Zero int = 0;\n// var Kolvo2KgVar int = 1;\n// var ObshKgVar int = 1;\n\n// \u0412\u0432\u043e\u0434 \u0447\u0438\u0441\u043b\u0430 \u041a\u0438\u043b\u043e\u0433\u0440\u0430\u043c\u043c.\nfmt.Scan(&WKgVar)\n// \u0427\u0435\u0442\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0441\u0442\u044c.\nOstatokDelVar = WKgVar%2;\n\nif OstatokDelVar == Zero{\n\t// fmt.Println(\"\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0432\u0435\u043d \u043d\u043e\u043b\u044c\")\n\tif WKgVar >= 4{\n\t\t//fmt.Println(\"WkgVar >= 4\")\n\t\tfmt.Println(\"YES\");\n\t\t}\n\t\n\n} else {fmt.Println(\"NO\");\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar input int\n\tfmt.Scanf(\"%d\", &input)\n\tif input%2 == 0 {\n\t\tfmt.Print(\"YES\")\n\t\treturn\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", n)\n\tif n > 0 && n%2 == 0 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\nimport (\n\t\t\"bufio\"\n\t\t\"fmt\"\n\t\t\"os\"\n\t\t\"strconv\"\n\t\t)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput_string, _ := reader.ReadString('\\n')\n\tinput, _ := strconv.Atoi(input_string[:len(input_string)-1])\n\tanswer := 0\n\tif input%2==0 {\n\t\tanswer = 1\n\t}\n\tif input == 2 {\n\t\tanswer = 0\n\t}\n\tif answer == 0 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar number int\n\t_, err := fmt.Scanf(\"%d\", &number)\n\tif err != nil {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif number <= 1 || number >= 100 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tif number%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar weight int\n\tfmt.Scanf(\"%d\", &weight)\n\tif (weight % 2 == 0 ) || (weight == 2) {\n\t\tfmt.Println(\"YES\")\n\t}else{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "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\ttext, _ := reader.ReadString('\\n')\n\n\tw, err := strconv.Atoi(strings.Trim(text, \"\\n\"))\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tif w%2 == 0 {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar number int\n\tfmt.Scanf(\"%d\\n\", &number)\n\tfor m:=1;m<1000;m++{\n\t\tif !isPrime(m*number + 1) {\n\t\t\tfmt.Println(m)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc isPrime(number int) bool {\n\tfor i:=2; i b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max64(a, b int64) int64 {\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 min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar (\n\treader = bufio.NewReaderSize(os.Stdin, 1<<13)\n\twriter = bufio.NewWriterSize(os.Stdout, 1<<13)\n)\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc read2i() (int, int) {\n\treturn readi(), readi()\n}\n\nfunc readis(n int) []int {\n\tres := make([]int, n)\n\tfor i := range res {\n\t\tres[i] = readi()\n\t}\n\treturn res\n}\n\nfunc readi64() int64 {\n\tb, err := reader.ReadByte()\n\tfor !isValid(b, err) {\n\t\tb, err = reader.ReadByte()\n\t}\n\tsign, res := int64(1), int64(0)\n\tif b == '-' {\n\t\tsign *= -1\n\t\tb, err = reader.ReadByte()\n\t}\n\tfor isValid(b, err) {\n\t\tres = res*10 + int64(b-'0')\n\t\tb, err = reader.ReadByte()\n\t}\n\treturn res * sign\n}\n\nfunc readline() string {\n\tres := new(bytes.Buffer)\n\tfor {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tres.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res.String()\n}\n\nfunc isValid(b byte, err error) bool {\n\treturn err == nil && (('0' <= b && b <= '9') || b == '-')\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tfor i := 2; i < 1001; i++ {\n\t\ta := i*n + 1\n\t\tfor j := 2; j < 10000; j++ {\n\t\t\tif a%j == 0 && a != j {\n\t\t\t\tO(i, \"\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tif n > 1 && n%2 != 0 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfor i := 2; i <= n*1000+1; i++ {\n\t\t\tfor j := i; j <= n*1000+1; j++ {\n\t\t\t\tnon_prime := i * j\n\t\t\t\tif (non_prime-1)%n == 0 {\n\t\t\t\t\tfmt.Println((non_prime - 1) / n)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tfor m := 1; m <= 1000; m++ {\n\t\tif !isPrime(n*m + 1) {\n\t\t\tfmt.Println(m)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc isPrime(num int) bool {\n\tif num < 2 {\n\t\treturn false\n\t}\n\tif num == 2 {\n\t\treturn true\n\t}\n\tif num%2 == 0 {\n\t\treturn false\n\t}\n\tfor i := 3; i*i <= num; i += 2 {\n\t\tif num%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc getStats(str string) map[byte]int {\n\tstat := map[byte]int{}\n\tfor _, v := range str {\n\t\tstat[byte(v)]++\n\t}\n\treturn stat\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar primeMap = make(map[int]bool)\n\nfunc isPrime(number int) bool {\n isPrime := true\n for j := 2; j <= number/2; j++ {\n if number%j == 0 {\n isPrime = false\n break\n }\n }\n return isPrime\n\n}\n\nfunc main() {\n var input int\n fmt.Scanf(\"%d\", &input)\n pynum := 1\n for {\n if !isPrime(input*pynum + 1) {\n fmt.Println(pynum)\n break\n\n } else {\n pynum++\n\n }\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tfor i := 1; i <= 1000; i++ {\n\t\tm := i * n + 1\n\t\tf := 0\n\t\tfor j := 2; j < m; j++ {\n\t\t\tif m % j == 0 {\n\t\t\t\tf++\n\t\t\t}\n\t\t}\n\t\tif f > 0 {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\tfor i := 2; i < 1001; i++ {\n\t\ta := i*n + 1\n\t\tif a%2 == 0 || a%3 == 0 {\n\t\t\tO(i, \"\\n\")\n\t\t\treturn\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tif n%2 != 0 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfor i := 2; i <= n*1000+1; i++ {\n\t\t\tfor j := i; j <= n*1000+1; j++ {\n\t\t\t\tnon_prime := i * j\n\t\t\t\tif (non_prime-1)%n == 0 {\n\t\t\t\t\tfmt.Println((non_prime - 1) / n)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tfor i := 1; i < 1000; i++ {\n\t\tm := i * n + 1\n\t\tf := 0\n\t\tfor j := 2; j * j < m; j++ {\n\t\t\tif m % j == 0 {\n\t\t\t\tf++\n\t\t\t}\n\t\t}\n\t\tif f > 0 {\n\t\t\tfmt.Println(m)\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}"}], "src_uid": "5c68e20ac6ecb7c289601ce8351f4e97"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tin, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\ta, _ := in.ReadString('\\n')\n\ta = strings.Trim(a, \"\\r\\n\")\n\tn, _ := strconv.ParseInt(string(a), 10, 64)\n\tfor a := int64(0); a <= 1000; a++ {\n\t\tfor b := int64(0); b <= 1000; b++ {\n\t\t\tif c := (n - a*1234567 - b*123456) / 1234; c >= 0 && a*1234567+b*123456+c*1234 == n {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tres := false\n\tvar c string\n\taa := 1234567\n\tbb := 123456\n\tcc := 1234\n\tfor i := 0; ; i++ {\n\t\tif aa*i > n || res {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; ; j++ {\n\t\t\tif (aa*i+bb*j) > n || res {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tvar k int\n\t\t\tk = n - aa*i - bb*j\n\t\t\tk /= cc\n\t\t\tres = aa*i+bb*j+cc*k == n\n\t\t}\n\t}\n\tif res {\n\t\tc = \"YES\"\n\t} else {\n\t\tc = \"NO\"\n\t}\n\tfmt.Println(c)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tconst house int = 1234567\n\tconst car int = 123456\n\tconst computer int = 1234\n\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tok := false\n\tfor i := 0; i <= n/house; i++ {\n\t\tfor j := 0; j <= (n-house*i)/car; j++ {\n\t\t\tif (n-house*i-car*j)%computer == 0 {\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar coins = []int{1234567, 123456, 1234}\n\nfunc canpay(amount int, coins []int) bool {\n\tif amount < 0 {\n\t\treturn false\n\t}\n\tif amount == 0 {\n\t\treturn true\n\t}\n\tif len(coins) == 0 {\n\t\treturn false\n\t}\n\tc := coins[0]\n\tif len(coins) == 1 {\n\t\treturn amount%c == 0\n\t}\n\tfor i := 0; i <= (amount / c); i++ {\n\t\tif canpay(amount-c*i, coins[1:]) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar amount int\n\t_, err := fmt.Scanln(&amount)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif canpay(amount, coins) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n uint64\n\tfor I(&n, \"\\n\") == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n uint64) {\n\ta, b, c := uint64(1234567), uint64(123456), uint64(1234)\n\tfor i := uint64(0); i <= n/a; i++ {\n\t\taa := a * i\n\t\tfor j := uint64(0); j <= (n-aa)/b; j++ {\n\t\t\tbb := aa + j*b\n\t\t\tif (n-bb)%c == 0 {\n\t\t\t\tO(\"YES\", \"\\n\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tO(\"NO\", \"\\n\")\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tin, out := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\ta, _ := in.ReadString('\\n')\n\ta = strings.Trim(a, \"\\r\\n\")\n\tn, _ := strconv.ParseInt(string(a), 10, 64)\n\tfor a := int64(0); a <= 1000; a++ {\n\t\tfor b := int64(0); b <= 1000; b++ {\n\t\t\tif c := (n - a*1234567 + b*123456) / 1234; c >= 0 && a*1234567+b*123456+c*1234 == n {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "72d7e422a865cc1f85108500bdf2adf2"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tfmt.Scanln(&x)\n\ta := 0\n\tfor x>0 {\n\t\ta += x%2\n\t\tx /= 2\t\t\n\t}\n\tfmt.Println(a)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar tot int\n\tfmt.Scan(&n)\n\tfor n > 0 {\n\t\ttot++\n\t\tn &= (n - 1)\n\t}\n\tfmt.Println(tot)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/579/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0422.\u043a. \u0431\u0430\u043a\u0442\u0435\u0440\u0438\u0438 \u0443\u0434\u0432\u0430\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e, \u0442\u043e \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\n// \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u041d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:\n// 5 {\u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c}\n// -> 4{\u0431\u044b\u043b\u043e}+1{\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438}\n// -> 2{\u0431\u044b\u043b\u043e}*2{1\u043d\u043e\u0447\u044c}+1\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\n// -> 1{\u0431\u044b\u043b\u043e}*2{1\u043d\u043e\u0447\u044c}*2{2\u043d\u043e\u0447\u044c}+1\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\n// -> (0{\u0441\u0442\u0430\u0440\u0442}+1{\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438})*2{1\u043d\u043e\u0447\u044c}*2{2\u043d\u043e\u0447\u044c}+1\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438\nfunc taskSolution(n int) (ans int) {\n\tfor n > 0 {\n\t\tif n%2 == 1 {\n\t\t\tans += 1\n\t\t}\n\t\tn /= 2\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scan(&n); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\n\tn := nextInt()\n\tfmt.Println(strings.Count(strconv.FormatInt(int64(n), 2), \"1\"))\n}\n\nfunc nextInt() int {\n\tin.Scan()\n\tres, _ := strconv.Atoi(in.Text())\n\treturn res\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n\n\nfunc main() {\n\tvar x int\n\tfmt.Scan(&x)\n\tcnt := 0\n\tfor x != 0{\n\t\tcnt += x&1\n\t\tx /= 2\n\t}\n\tfmt.Println(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tcntBit := 0\n\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tcntBit++\n\t\t}\n\t\tn >>= 1\n\t}\n\n\tprintln(cntBit)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\n\tfor n > 1 {\n\t\tj := int(math.Floor(math.Log2(float64(n))))\n\t\tn = n - (1 << j)\n\t\tcount += 1\n\t}\n\tif n == 1 {\n\t\tcount += 1\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\n\tfor n > 1 {\n\t\tj := int(math.Floor(math.Log2(float64(n))))\n\t\tn = n - (1 << j)\n\t\tcount += 1\n\t}\n\tif n == 1 {\n\t\tcount += 1\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Scanf(\"%d \\n\", &n)\n\tfmt.Print(strings.Count(strconv.FormatInt(n, 2), \"1\"))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc binary(n int) int {\n\tcount := 0\n\tfor n != 0 {\n\t\tif n % 2 == 1 {\n\t\t\tcount++\n\t\t}\n\t\tn /= 2\n\t}\n\treturn count\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfmt.Println(binary(n))\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Scanf(\"%d\", &n)\n\ts := strconv.FormatInt(n, 2)\n\tfmt.Println(strings.Count(s, \"1\"))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcount := 0\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tcount += 1\n\t\t}\n\t\tn >>= 1\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcount := 0\n\tfor n > 0 {\n\t\tif n%2 == 1 {\n\t\t\tcount += 1\n\t\t}\n\t\tn = n / 2\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcount := 0\n\tfor ; n > 0; count++ {\n\t\tn &= (n - 1)\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\n\n// NumberOf1 \u8ba1\u7b97\u4e8c\u8fdb\u5236\u4e2d1\u7684\u4e2a\u6570\nfunc NumberOf1(n int) (res int) {\n\tfor n != 0 {\n\t\tn &= (n - 1)\n\t\tres++\n\t}\n\treturn\n}\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\tfmt.Println(NumberOf1(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Fscanf(os.Stdin, \"%d\\n\", &n)\n\n\treminder := n\n\tval := math.Log2(float64(reminder))\n\treminder -= (1 << uint(val))\n\tcounter := 1\n\n\tfor reminder > 0 {\n\t\tval = math.Log2(float64(reminder))\n\t\treminder -= (1 << uint(val))\n\t\tcounter++\n\t}\n\n\tfmt.Println(counter)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar x, res int\n\nfunc main() {\n\tfmt.Scanf(\"%d\", &x)\n\tres = popCountInt32(x)\n\tfmt.Printf(\"%d\\n\", res)\n}\n\nfunc popCountInt32(x int) (n int) {\n\tfor x > 0 {\n\t\tn += x % 2\n\t\tx = x >> 1\n\t}\n\treturn\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, res int\n\tfmt.Scan(&n)\n\tfor n > 0 {\n\t\tif n%2 == 0 {\n\t\t\tn /= 2\n\t\t} else {\n\t\t\tres++\n\t\t\tn--\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int64 {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tn = 0\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(x int64) int64 {\n\tvar temp int64\n\ttemp = x\n\tvar count int64\n\tcount = 0\n\tfor temp != 0 {\n\t\tif temp%2 == 1 {\n\t\t\tcount++\n\t\t}\n\t\ttemp = temp / 2\n\t}\n\n\treturn count\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar x, ret int64\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tx = fastGetInt(scanner.Bytes())\n\n\t//======================================================\n\tret = solution(x)\n\t//==================== OUTPUT ==========================\n\n\tfmt.Print(ret)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d \\n\", &n)\n\tfmt.Println(findMinBacteries(float64(n)))\n}\n\nfunc findMinBacteries(n float64) int {\n\tc := 0\n\tfor p := 0; n > 0; p++ {\n\t\ts := math.Pow(2, float64(p))\n\t\tif s > n {\n\t\t\tn -= math.Pow(2, float64(p-1))\n\t\t\tp = 0\n\t\t\tc++\n\t\t} else if s == n {\n\t\t\tn = 0\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int64 {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tn = 0\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(x int64) int64 {\n\treturn x % 2\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar x, ret int64\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tx = fastGetInt(scanner.Bytes())\n\n\t//======================================================\n\tret = solution(x)\n\t//==================== OUTPUT ==========================\n\n\tfmt.Print(ret + 1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int64 {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tn = 0\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(x int64) int64 {\n\tvar temp int64\n\ttemp = 1\n\tvar count int64\n\tcount = 0\n\tfor temp < x/2 {\n\t\ttemp = temp * 2\n\t\tcount++\n\t}\n\tif temp*2 == x || x == 1 {\n\t\treturn 0\n\t}\n\tif temp%2 == 1 {\n\t\tcount++\n\t}\n\treturn count\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar x, ret int64\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tx = fastGetInt(scanner.Bytes())\n\n\t//======================================================\n\tret = solution(x)\n\t//==================== OUTPUT ==========================\n\n\tfmt.Print(ret + 1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc fastGetInt(b []byte) int64 {\n\tneg := false\n\tif b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tn = 0\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n\n\t}\n\treturn n\n}\n\n//========== Implement Algorithm =======================\nfunc solution(x int64) int64 {\n\tvar temp int64\n\ttemp = 1\n\tvar count int64\n\tcount = 0\n\tfor temp < x/2 {\n\t\ttemp = temp * 2\n\t\tcount++\n\t}\n\tif temp*2 == x {\n\t\treturn 0\n\t}\n\tif temp%2 == 1 {\n\t\tcount++\n\t}\n\treturn count\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar x, ret int64\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tx = fastGetInt(scanner.Bytes())\n\n\t//======================================================\n\tret = solution(x)\n\t//==================== OUTPUT ==========================\n\n\tfmt.Print(ret + 1)\n}\n"}], "src_uid": "03e4482d53a059134676f431be4c16d2"} {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var s string\n fmt.Scan(&s)\n fmt.Println(len(s)*25+26)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts := next()\n\tm := map[string]bool{}\n\tcnt := 0\n\n\tfor i := 0; i <= len(s); i++ {\n\t\tfor c := 'a'; c <= 'z'; c++ {\n\t\t\tt := s[0:i] + string(c) + s[i:len(s)]\n\n\t\t\tif checked, haveValue := m[t]; !haveValue && !checked {\n\t\t\t\tm[t] = true\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\n\tprintln(cnt)\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar inf int = 0x3f3f3f3f\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar s string\n\nfunc main() {\n\tfmt.Fscan(reader, &s)\n\tm := make(map[string]int)\n\tfor i := 0; i <= len(s); i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tt := s[0:i] + string(j+'a') + s[i:len(s)]\n\t\t\tm[t] = 1\n\t\t}\n\t}\n\tfmt.Println(len(m))\n}\n"}], "negative_code": [], "src_uid": "556684d96d78264ad07c0cdd3b784bc9"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar a, b string\n\tfmt.Scanln(&a, &b)\n\tvar str []string\n\tfor i := 0; i < len(a); i++ {\n\t\tfor j := 0; j < len(b); j++ {\n\t\t\tstr = append(str, a[0:i+1]+b[0:j+1])\n\t\t}\n\t}\n\tsort.Strings(str)\n\tfmt.Println(str[0])\n}\n", "positive_code": [{"source_code": "package main\n\n/*\n\tTo solve this problem basically we just need to generate login\n\tstring which alphabetically earliest than any other string login string.\n\n\tThe rules to generate login string are following:\n\t- must concatenate prefix of user's first name & last name\n\t- each prefix must not be empty\n\t- any prefix can be full name\n\n\tA string is said alphabetically earlier than other string if:\n\t- string is prefix of other string (ab >< abc, ab is earlier)\n\t- string is coincide up to some point with another\n\t string then string has char which alphabetically earlier than\n\t corresponding letter in another string (a >< ab >< ac => a < ab < ac)\n\n\tNotice that the minimum string we can generate is first[0] + last[0], yet\n\twith only this we already got decent enough early string. But can we make\n\tthis string much earlier?\n\n\tYes! If all char in first[1:] is alphabetically earlier than last[0]. So yeah,\n\tbasically we just need to get all chars in first name which earlier than last[0],\n\tthen combine them into a string.\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar first, second string\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%s %s\", &first, &second)\n\tidx := 1\n\tfor i := 1; i < len(first); i++ {\n\t\tif first[i] < second[0] {\n\t\t\tidx++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(first[:idx] + \"\" + second[:1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar first, second string\n\tstdio := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(stdio, \"%s %s\", &first, &second)\n\tidx := 1\n\tfor i := 1; i < len(first); i++ {\n\t\tif first[i] < second[0] {\n\t\t\tidx++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(first[:idx] + \"\" + second[:1])\n}\n"}, {"source_code": "package main\n\nimport\n(\n\t\"fmt\"\n\t\n)\n\nfunc main() {\n\tvar a string\n\tvar b string\n\t//var c string\n\tfmt.Scanln(&a, &b)\n\t//fmt.Scanf(\"%s\", &b)\n\tfmt.Printf(\"%c\", a[0])\n\n\tvar i, j int\n\ti = 1\n\tj = 0\n\tfor ; ; {\n\t\tif i < len(a) && a[i] < b[j] {\n\t\t\tfmt.Printf(\"%c\", a[i])\n\t\t\ti++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Printf(\"%c\", b[0])\n\t}\n"}], "negative_code": [], "src_uid": "aed892f2bda10b6aee10dcb834a63709"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nvar one = int64(0x10000)\n\nfunc progressRow(p [][]int64, row int) (spill bool) {\n\tspill = false\n\tfor i := 0; i <= row; i++ {\n\t\tif p[row][i] > one {\n\t\t\tspill = true\n\t\t\tdiff := p[row][i] - one\n\t\t\tdiff >>= 1\n\t\t\tp[row+1][i] += diff\n\t\t\tp[row+1][i+1] += diff\n\t\t\tp[row][i] = one\n\t\t}\n\t}\n\treturn spill\n}\n\nfunc progress(p [][]int64, n int) {\n\tp[0][0] += one\n\tfor i := 0; i < n; i++ {\n\t\tspill := progressRow(p, i)\n\t\tif !spill {\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc solve(n, t int) int {\n\tp := make([][]int64, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tp[i] = make([]int64, i+1)\n\t}\n\tfor i := 0; i < t; i++ {\n\t\tprogress(p, n)\n\t}\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < i+1; j++ {\n\t\t\tif p[i][j] >= one {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main() {\n\tvar n, t int\n\tnr, err := fmt.Fscanln(os.Stdin, &n, &t)\n\tif nr != 2 || err != nil {\n\t\tpanic(err)\n\t}\n\tres := solve(n, t)\n\tfmt.Println(res)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t//\"math\"\n)\n\nvar glasses [][]float32\nvar n int\nvar t int\nfunc fill(glassNum int, level int, volume float32) {\n\tglasses[level][glassNum] += volume\n\tif glasses[level][glassNum] > 1 {\n\t\tremainVolume := glasses[level][glassNum] - 1\n\t\tglasses[level][glassNum] = 1\n\t\tif level != n - 1 {\n\t\t\tfill(glassNum, level + 1, remainVolume / 2.0)\n\t\t\tfill(glassNum + 1, level + 1, remainVolume / 2.0)\n\t\t}\n\t}\n}\n\nfunc main() {\n\n\t//fmt.Print(math.Abs(2 - 1))\n\n\tfmt.Scan(&n, &t)\n\n\tglasses = make([][]float32, 10)\n\n\tfor i := range glasses {\n\t\tglasses[i] = make([]float32, i + 1)\n\t}\n\n\tfor i := 0 ; i < t; i++ {\n\t\tfill(0,0,1)\n\t}\n\n\tans := 0\n\tfor i := range glasses {\n\t\tfor j := range glasses[i] {\n\t\t\tif glasses[i][j] == 1 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t\tglasses[i] = make([]float32, i + 1)\n\t}\n\n\n\tfmt.Print(ans)\n\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n \"math/big\"\n)\n\nvar scanner *bufio.Scanner\nvar writer *bufio.Writer\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer = bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n zero := big.NewRat(0, 1)\n one := big.NewRat(1, 1)\n two := big.NewRat(2, 1)\n\n n, limit := getI(), getI()\n filled := make([][]*big.Rat, n)\n for r := range filled {\n filled[r] = make([]*big.Rat, r + 1)\n for c := range filled[r] {\n filled[r][c] = big.NewRat(0, 1)\n }\n }\n count := 0\n maxCount := (n + 1) * n / 2\n\n for t := 0; t < limit; t++ {\n pours := make([]*big.Rat, 1)\n pours[0] = big.NewRat(1, 1)\n for r := 0; r < n; r++ {\n allZero := true\n for _, pour := range pours {\n if pour.Cmp(zero) != 0 {\n allZero = false\n break\n }\n }\n if allZero {\n break\n }\n nextPours := make([]*big.Rat, r + 2)\n for i := range nextPours {\n nextPours[i] = big.NewRat(0, 1)\n }\n for c, pour := range pours {\n x := &big.Rat{}\n x.Add(filled[r][c], pour)\n if filled[r][c].Cmp(one) < 0 && x.Cmp(one) >= 0 {\n count++\n if count == maxCount {\n writer.WriteString(fmt.Sprintf(\"%d\\n\", count))\n return\n }\n }\n if x.Cmp(one) <= 0 {\n filled[r][c].Set(x)\n continue\n }\n pour.Sub(pour, one)\n pour.Add(pour, filled[r][c])\n filled[r][c].Set(one)\n pour.Quo(pour, two)\n nextPours[c].Add(nextPours[c], pour)\n nextPours[c + 1].Add(nextPours[c + 1], pour)\n }\n pours = nextPours\n }\n }\n\n writer.WriteString(fmt.Sprintf(\"%d\\n\", count))\n}\n"}, {"source_code": "// Codeforces 676 B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i= drob {\n countFull ++\n v := aa[j]\n v = (v-drob)/2\n //fmt.Printf(\"a,v= %f %f\\n\",aa[j], v)\n an[j] += v\n an[j+1] += v\n }\n }\n // copy an -> a\n for j:=0; j= len(pyrimid) {\n\t\treturn\n\t}\n\tpyrimid[depth][index] += amount\n\tif pyrimid[depth][index] > 1024 {\n\t\tremain := pyrimid[depth][index] - 1024\n\t\tpyrimid[depth][index] = 1024\n\t\tpour(remain/2, depth+1, index, pyrimid)\n\t\tpour(remain/2, depth+1, index+1, pyrimid)\n\t}\n}\n\n\nfunc main() {\n\tvar n, t int\n\tfmt.Scanf(\"%d%d\", &n, &t)\n\tpyrimid := make([][]int, n, n)\n\n\tfor i := 1; i <= n; i++ {\n\t\tpyrimid[i-1] = make([]int, i, i)\n\t}\n\n\tfull_cnt := 0\n\tif t > 1024 {\n\t\tfull_cnt = (1 + n)*n/2\n\t\tfmt.Println(full_cnt)\n\t\treturn\n\t}\n\n\tfor i := 0; i < t; i++ {\n\t\tpour(1024, 0, 0, pyrimid)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j <= i; j++ {\n\t\t\tif pyrimid[i][j] >= 1024 {\n\t\t\t\tfull_cnt += 1\n\t\t\t}\n\t\t}\n\t}\n//\tfmt.Println(pyrimid)\n\tfmt.Println(full_cnt)\n}\n"}], "negative_code": [{"source_code": "// Codeforces 676 B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i= 0.999999999999 {\n countFull ++\n v := (aa[j] - 1.0)/2.0\n //fmt.Printf(\"a,v= %f %f\\n\",aa[j], v)\n an[j] += v\n an[j+1] += v\n }\n }\n // copy an -> a\n //fmt.Println(i)\n for j:=0; j= 1; i-- {\n if prev%i == 0 {\n writer.WriteString(strconv.Itoa(i))\n if i == 1 { writer.WriteRune('\\n') } else { writer.WriteRune(' ') }\n prev = i\n }\n }\n writer.Flush()\n}\n", "positive_code": [{"source_code": "// Codeforces 58 B training, done\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i1; i-- {\n\t\tif n%i==0 {\n\t\t\tn = i\n\t\t\treturn\n\t\t}\n\t} \n\tn = 1\n}\n\nfunc solve() {\n\tfor n>1 {\n\t\tfmt.Printf(\"%d \", n)\n\t\tnextDiv()\n\t}\n}\n\nfunc printRes() {\n\tfmt.Print (\" 1\\n\")\n}\n\nfunc main() {\n \treadData() \n solve()\n printRes()\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n,i,j int\n\tfmt.Scan(&n)\n\tfmt.Print(n,\" \")\n\ti=n-1\n\tj=n\n\tfor ;i>0;i-- {\n\t\tif j%i==0 {\n\t\t\tfmt.Print(i,\" \")\n\t\t\tj=i\n\t\t}\n\t}\n}\n\n"}], "negative_code": [], "src_uid": "2fc946bb72f56b6d86eabfaf60f9fa63"} {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nvar memo map[int64]int64\n\nfunc pow3(n, m int64) int64 {\n\tx, present := memo[n]\n\tif present {\n\t\treturn x\n\t}\n\tx = (pow3(n/2, m) * pow3(n-n/2, m)) % m\n\tmemo[n] = x\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tn := int64(scanInt(scanner))\n\tm := int64(scanInt(scanner))\n\tmemo = map[int64]int64{ 0: 1%m, 1: 3%m }\n\tx := pow3(n, m) - 1\n\tif x == -1 {\n\t\tx = m-1\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n", "positive_code": [{"source_code": "// 226A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc pow(x, n, mod int64) int64 {\n\tvar a, t int64\n\ta = 1\n\tt = x\n\tfor n != 0 {\n\t\tif n&1 == 1 {\n\t\t\ta = (a * t) % mod\n\t\t}\n\t\tt = (t * t) % mod\n\t\tn >>= 1\n\t}\n\treturn int64(a)\n}\nfunc main() {\n\tvar a, x, c int64\n\tfmt.Scan(&a, &x)\n\tc = pow(3, a, x)\n\tfmt.Println((c - 1 + x) % x)\n}\n"}, {"source_code": "// 226A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc pow(x, n, mod int64) int64 {\n\tvar a, t int64\n\ta = 1\n\tt = x\n\tfor n != 0 {\n\t\tif n&1 == 1 {\n\t\t\ta = (a * t) % mod\n\t\t}\n\t\tt = (t * t) % mod\n\t\tn >>= 1\n\t}\n\treturn int64(a)\n}\nfunc main() {\n\tvar a, x, c int64\n\tfmt.Scan(&a, &x)\n\tc = pow(3, a, x)\n\tfmt.Println((c - 1 + x) % x)\n}"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n, m int64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tr.Scan()\n\tm, _ = strconv.ParseInt(r.Text(), 0, 64)\n\tvar a int64 = 3\n\tvar b int64 = 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tb = (b*a)%m\n\t\t}\n\t\ta = (a*a)%m\n\t\tn = n/2\n\t}\n\tw.WriteString(strconv.FormatInt((b-1+m)%m, 10)+\"\\n\")\n\tw.Flush()\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nvar memo map[int]int\n\nfunc pow3(n, m int) int {\n\tx, present := memo[n]\n\tif present {\n\t\treturn x\n\t}\n\tx = (pow3(n/2, m) * pow3(n-n/2, m)) % m\n\tmemo[n] = x\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tn := scanInt(scanner)\n\tm := scanInt(scanner)\n\tmemo = map[int]int{ 0: 1%m, 1: 3%m }\n\tx := pow3(n, m) - 1\n\tif x == -1 {\n\t\tx = m-1\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n\tscanner.Scan()\n\tx, _ := strconv.Atoi(scanner.Text())\n\treturn x\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tn := int64(scanInt(scanner))\n\tm := int64(scanInt(scanner))\n\tx := int64(1)\n\tfor i := int64(1); i <= n; i++ {\n\t\tx *= 3\n\t\tif x >= m {\n\t\t\tx = ((x%m)*(n/i))%m\n\t\t\tfor j := n%i; j != 0; j-- {\n\t\t\t\tx *= 3\n\t\t\t\tif x >= m {\n\t\t\t\t\tx %= m\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tx--\n\tif x == -1 {\n\t\tx = m-1\n\t}\n\twriter.WriteString(fmt.Sprintf(\"%d\\n\", x))\n}\n"}], "src_uid": "c62ad7c7d1ea7aec058d99223c57d33c"} {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nvar _, _, _ = main, rw, do\r\n\r\nfunc main() {\r\n\tr, w := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\r\n\tdefer w.Flush()\r\n\trw(r, w)\r\n}\r\n\r\nfunc rw(r io.Reader, w io.Writer) {\r\n\tvar n int\r\n\tvar m int64\r\n\tfmt.Fscan(r, &n, &m)\r\n\tw1 := do(n, m)\r\n\tfmt.Fprintln(w, w1)\r\n}\r\n\r\n/*x/2 x/3 ... x/n/2 ... x/n\r\n1 2,3 3,4,5 ... n/2 ... n\r\n2 4,5 6,7,8 ... n\r\n3 6,7 9,10,11 ...\r\n4 8,9 12,13,14 ...\r\n. ...\r\nn+n/2+n/3+...+n/n-1=n(1+1/2+1/3+...)=nlogn\r\n*/\r\n\r\nfunc do(n int, m int64) int64 {\r\n\ta := make([]int64, n+2)\r\n\ta[n] = 1\r\n\tfor i := n - 1; i >= 1; i-- {\r\n\t\ta[i] = a[i+1]\r\n\t\tfor j := 2; j*i <= n; j++ {\r\n\t\t\ta[i] = (a[i] + a[j*i] - a[min(n+1, j*i+j)] + m) % m\r\n\t\t}\r\n\t\ta[i] = (a[i] + a[i+1]) % m\r\n\t}\r\n\treturn (a[1] - a[2] + m) % m\r\n}\r\n\r\nfunc min(a, b int) int {\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n", "positive_code": [{"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n)\r\n\r\nfunc main() {\r\n\tin := bufio.NewReader(os.Stdin)\r\n\tout := bufio.NewWriter(os.Stdout)\r\n\tdefer out.Flush()\r\n\tvar n, m int64\r\n\tfmt.Fscan(in, &n, &m)\r\n\tf := make([]int64, n+5)\r\n\tf[1] = 1\r\n\tpre := make([]int64, n+5)\r\n\tpre[1] = 1\r\n\tf[2] = 2\r\n\tf[3] = 5\r\n\tpre[2] = f[1] + f[2]\r\n\tpre[3] = f[1] + f[2] + f[3]\r\n\tvar i int64\r\n\tfor i = 4; i <= n; i++ {\r\n\t\tf[i] = pre[i-1] % m\r\n\t\tvar lst int64 = -1\r\n\t\tvar tmp int64 = 0\r\n\t\tvar j int64\r\n\t\tfor j = 2; j*j <= i; j++ {\r\n\t\t\tif j == 2 {\r\n\t\t\t\tlst = i / j\r\n\t\t\t\ttmp = ((tmp%m+((i%m-lst%m)%m*f[j-1]%m)%m)%m + f[i/j]%m) % m\r\n\t\t\t\tcontinue\r\n\t\t\t}\r\n\t\t\tt := lst\r\n\t\t\tlst = i / j\r\n\t\t\ttmp = ((tmp%m+((t%m-lst%m)%m*f[j-1]%m)%m)%m + f[i/j]%m) % m\r\n\t\t}\r\n\t\tif i/j == j-1 {\r\n\t\t\tt := lst\r\n\t\t\tlst = i / j\r\n\t\t\ttmp = (tmp%m + ((t%m-lst%m)%m*f[j-1]%m)%m) % m\r\n\t\t}\r\n\t\tf[i] = (f[i]%m + tmp%m) % m\r\n\t\tpre[i] = (pre[i-1]%m + f[i]%m) % m\r\n\t}\r\n\tfmt.Fprintln(out, f[n])\r\n}\r\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t. \"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\n// github.com/EndlessCheng/codeforces-go\r\nfunc CF1558B(in io.Reader, out io.Writer) {\r\n\tmin := func(a, b int) int {\r\n\t\tif a > b {\r\n\t\t\treturn b\r\n\t\t}\r\n\t\treturn a\r\n\t}\r\n\r\n\tvar n, m int\r\n\tFscan(in, &n, &m)\r\n\tf := make([]int, n+2)\r\n\tf[n] = 1\r\n\tfor i := n - 1; i > 0; i-- {\r\n\t\tf[i] = f[i+1] * 2 % m\r\n\t\tfor j := 2; j*i <= n; j++ {\r\n\t\t\tf[i] = (f[i] + (f[i*j]-f[min((i+1)*j, n+1)]+m)%m) % m\r\n\t\t}\r\n\t}\r\n\tFprint(out, (f[1]-f[2]+m)%m)\r\n}\r\n\r\nfunc main() { CF1558B(os.Stdin, os.Stdout) }\r\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\n\tvar n, m int\n\tfmt.Fscanf(r, \"%d %d\\n\", &n, &m)\n\n\tf := make([]int, n+1)\n\ts := make([]int, n+1)\n\n\tf[1] = 1\n\ts[1] = 1\n\tfor i := 2; i <= n; i++ {\n\t\tf[i] = s[i-1]\n\t\tp := i\n\n\t\tif i <= 5 {\n\t\t\tfor j := 2; j <= i; j++ {\n\t\t\t\tf[i] = (f[i] + f[i/j]) % m\n\t\t\t}\n\t\t} else {\n\t\t\t/*\tfmt.Println(i, \": \")\n\t\t\t\tfor j := 2; j <= i; j++ {\n\t\t\t\t\tfmt.Print(i/j, \" \")\n\t\t\t\t}\n\t\t\t\tfmt.Println()*/\n\n\t\t\tfor j := 2; j < i; j++ {\n\t\t\t\tif j-1 > i/j {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif j-1 == i/j {\n\t\t\t\t\t//\tfmt.Println(i, i/j, p-i/j, \"x\", j-1)\n\t\t\t\t\tf[i] = int((int64(f[i]) + int64(p-i/j)*int64(f[j-1])) % int64(m))\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\t//fmt.Println(i, i/j, p-i/j, \"x\", j-1)\n\t\t\t\tf[i] = int((int64(f[i]) + (int64(p-i/j) * int64(f[j-1]))) % int64(m))\n\t\t\t\tf[i] = (f[i] + f[i/j]) % m\n\t\t\t\tp = i / j\n\t\t\t}\n\t\t}\n\n\t\ts[i] = (s[i-1] + f[i]) % m\n\t}\n\n\tfmt.Println(f[n])\n}\n"}, {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\t\"sort\"\r\n)\r\n\r\nvar (\r\n\tin = bufio.NewReader(os.Stdin)\r\n)\r\n\r\nfunc main() {\r\n\tvar test int\r\n\t//fmt.Fscan(in, &test)\r\n\ttest = 1\r\n\tfor i := 0; i < test; i++ {\r\n\t\tsolve()\r\n\t}\r\n\r\n}\r\nfunc solve() {\r\n\tvar n, m int64\r\n\tfmt.Fscan(in, &n)\r\n\tfmt.Fscan(in, &m)\r\n\tvar dp = make([]int64, n+1)\r\n\tdp[1] = 1\r\n\tvar currentWays int64 = 1\r\n\tfor i := 2; i <= int(n); i++ {\r\n\t\tdp[i] = currentWays\r\n\t\tfor j := 1; j*j <= i; j++ {\r\n\t\t\t//smaller ocurrance\r\n\t\t\tvar numberOfOccurance = int64(i/j - i/(j+1))\r\n\t\t\tdp[i] += (dp[j] * numberOfOccurance) % m\r\n\t\t\tdp[i] %= m\r\n\t\t\tif j != i/j && j > 1 {\r\n\t\t\t\tdp[i] += dp[i/j]\r\n\t\t\t\tdp[i] %= m\r\n\t\t\t}\r\n\t\t}\r\n\t\tcurrentWays += dp[i]\r\n\t\tcurrentWays %= m\r\n\t}\r\n\tfmt.Println(dp[n])\r\n}\r\n\r\n//x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-TEMPLATE_STARTING-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-\r\n\r\ntype pair struct {\r\n\ta int64\r\n\tb int64\r\n}\r\n\r\nfunc sortPair(pairs []pair) {\r\n\tsort.Slice(pairs, func(i, j int) bool {\r\n\t\treturn pairs[i].a < pairs[j].a\r\n\t})\r\n}\r\nfunc max(a int64, b int64) int64 {\r\n\tif a > b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc printArray(arr []int) {\r\n\tfor i := 1; i < len(arr); i++ {\r\n\t\tfmt.Print(arr[i], \" \")\r\n\t}\r\n\tfmt.Println()\r\n}\r\n\r\ntype runeSort []rune\r\n\r\nfunc (r runeSort) Len() int { return len(r) }\r\nfunc (r runeSort) Swap(i, j int) { r[i], r[j] = r[j], r[i] }\r\nfunc (r runeSort) Less(i, j int) bool { return r[i] < r[j] }\r\n"}], "negative_code": [{"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"math\"\r\n\t\"os\"\r\n\t\"sort\"\r\n)\r\n\r\nvar (\r\n\tin = bufio.NewReader(os.Stdin)\r\n\tdp []int64\r\n)\r\n\r\nfunc main() {\r\n\tvar test int = 1\r\n\t//fmt.Fscan(in, &test)\r\n\tfor i := 0; i < test; i++ {\r\n\t\tsolve()\r\n\t}\r\n\r\n}\r\n\r\nfunc init() {\r\n\tdp = make([]int64, 1000000)\r\n}\r\n\r\nfunc solve() {\r\n\tvar n, internalm int64\r\n\tfmt.Fscan(in, &n)\r\n\tfmt.Fscan(in, &internalm)\r\n\tsolve2(n, 0)\r\n\tfmt.Println(dp[n] % internalm)\r\n\r\n}\r\n\r\nfunc solve2(n int64, tempCount int64) int64 {\r\n\tif n < 1 {\r\n\t\treturn 0\r\n\t}\r\n\tif n == 1 {\r\n\t\treturn 1\r\n\t}\r\n\tif dp[n] != 0 {\r\n\t\treturn dp[n]\r\n\t}\r\n\tvar currentAns int64\r\n\tfor i := 1; i < int(n); i++ {\r\n\t\tcurrentAns += solve2(n-int64(i), tempCount+1)\r\n\t}\r\n\tfor i := 2; i <= int(n); i++ {\r\n\t\tcurrentAns += solve2(int64(math.Floor(float64(n/int64(i)))), tempCount+1)\r\n\t}\r\n\tdp[n] = currentAns\r\n\treturn currentAns\r\n}\r\n\r\n//x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-TEMPLATE_STARTING-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-\r\n\r\ntype pair struct {\r\n\ta int64\r\n\tb int64\r\n}\r\n\r\nfunc sortPair(pairs []pair) {\r\n\tsort.Slice(pairs, func(i, j int) bool {\r\n\t\treturn pairs[i].a < pairs[j].a\r\n\t})\r\n}\r\nfunc min(a int64, b int64) int64 {\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc printArray(arr []int) {\r\n\tfor i := 1; i < len(arr); i++ {\r\n\t\tfmt.Print(arr[i], \" \")\r\n\t}\r\n\tfmt.Println()\r\n}\r\n\r\ntype runeSort []rune\r\n\r\nfunc (r runeSort) Len() int { return len(r) }\r\nfunc (r runeSort) Swap(i, j int) { r[i], r[j] = r[j], r[i] }\r\nfunc (r runeSort) Less(i, j int) bool { return r[i] < r[j] }\r\n"}], "src_uid": "a524aa54e83fd0223489a19531bf0e79"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 0, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\ts := sum(k, mid)\n\t\tif s >= n {\n\t\t\tj = mid\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int64\n\tfmt.Scanln(&n, &k)\n\tlo, hi := int64(0), k\n\tfor lo <= hi {\n\t\tx := (lo + hi) >> 1\n\t\tif (k+k-x-1)*x/2+1 >= n {\n\t\t\thi = x - 1\n\t\t} else {\n\t\t\tlo = x + 1\n\t\t}\n\t}\n\tif lo < k {\n\t\tfmt.Println(lo)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * k - (num - 1) * (num + 2) / 2\n\t//return num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 0, k\n\tfor i < j {\n\t\tmid = (i + j) >> 1\n\t\ts := sum(k, mid)\n\t\tif s < n {\n\t\t\ti = mid + 1\n\t\t} else {\n\t\t\tj = mid\n\t\t}\n\t}\n\tmid = (i + j) >> 1\n\tif sum(k, mid) < n {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println((i + j) >> 1)\n\t}\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 1, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\ts := sum(k, mid)\n\t\tif s >= n {\n\t\t\tj = mid\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\t//fmt.Println(\"------------------\", n, k)\n\tvar i, j, mid int64\n\ti, j = 1, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\ts := sum(k, mid)\n\t\tif s > n {\n\t\t\tj = mid - 1\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum(k, num int64) int64 {\n\treturn num * ((k-1)+(k - num))/2 + 1\n}\n\nfunc run(n, k int64) {\n\tvar i, j, mid int64\n\ti, j = 1, k-1\n\tmid = (i + j) >> 1\n\tif sum(k, j) < n {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfor i < j {\n\t\tif sum(n, mid) > n {\n\t\t\tj = mid - 1\n\t\t} else {\n\t\t\ti = mid + 1\n\t\t}\n\t\tmid = (i + j) >> 1\n\t}\n\tfmt.Println(mid)\n}\n\nfunc main() {\n\tvar n, k int64\n\tfor _, err := fmt.Scanf(\"%d %d\", &n, &k); err == nil; _, err = fmt.Scanf(\"%d %d\", &n, &k) {\n\t\trun(n, k)\n\t}\n}\n"}], "src_uid": "83bcfe32db302fbae18e8a95d89cf411"} {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1292B(_r io.Reader, _w io.Writer) {\n\ttype point struct{ x, y int64 }\n\tabs := func(x int64) int64 {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tdis := func(a, b point) int64 { return abs(a.x-b.x) + abs(a.y-b.y) }\n\n\tvar ax, ay, bx, by, tt int64\n\tvar p, st point\n\tFscan(_r, &p.x, &p.y, &ax, &ay, &bx, &by, &st.x, &st.y, &tt)\n\tps := []point{}\n\tfor ; p.x < 9e16 && p.y < 9e16; p.x, p.y = ax*p.x+bx, ay*p.y+by {\n\t\tps = append(ps, p)\n\t}\n\n\tans := 0\n\tfor i, p := range ps {\n\t\tt := tt\n\t\tif d := dis(st, p); d <= t {\n\t\t\tt -= d\n\t\t\tc := 1\n\t\t\tfor j := i; j > 0; j-- {\n\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif i+1 < len(ps) {\n\t\t\t\tif d := dis(ps[0], ps[i+1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t\tfor j := i + 2; j < len(ps); j++ {\n\t\t\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\t\t\tt -= d\n\t\t\t\t\t\t\tc++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif c > ans {\n\t\t\t\tans = c\n\t\t\t}\n\t\t}\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1292B(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 1 << 60\n\n\tfor x[len(x)-1] < (mat-bx)/ax && y[len(y)-1] < (mat-by)/ay {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < len(x); i++ {\n\t\tfor j := i; j < len(x); j++ {\n\t\t\tltor := x[j]-x[i]+y[j]-y[i]\n\t\t\ttol := abs(xs-x[i])+abs(ys-y[i])\n\t\t\ttor := abs(xs-x[j])+abs(ys-y[j])\n\n\t\t\tif t >= ltor+tor || t >= tol+ltor {\n\t\t\t\t// fmt.Println(ltor,tol,ltor+tor,j,i)\n\t\t\t\tans = max(ans, j-i+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\t// fmt.Println(x)\n\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1292B(_r io.Reader, _w io.Writer) {\n\ttype point struct{ x, y int64 }\n\tabs := func(x int64) int64 {\n\t\tif x < 0 {\n\t\t\treturn -x\n\t\t}\n\t\treturn x\n\t}\n\tdis := func(a, b point) int64 { return abs(a.x-b.x) + abs(a.y-b.y) }\n\n\tvar ax, ay, bx, by, tt int64\n\tvar p, st point\n\tFscan(_r, &p.x, &p.y, &ax, &ay, &bx, &by, &st.x, &st.y, &tt)\n\tps := []point{}\n\tfor ; p.x < 1e17 && p.y < 1e17; p.x, p.y = ax*p.x+bx, ay*p.y+by {\n\t\tps = append(ps, p)\n\t}\n\n\tans := 0\n\tfor i, p := range ps {\n\t\tt := tt\n\t\tif d := dis(st, p); d <= t {\n\t\t\tt -= d\n\t\t\tc := 1\n\t\t\tfor j := i; j > 0; j-- {\n\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif i+1 < len(ps) {\n\t\t\t\tif d := dis(ps[0], ps[i+1]); d <= t {\n\t\t\t\t\tt -= d\n\t\t\t\t\tc++\n\t\t\t\t\tfor j := i + 2; j < len(ps); j++ {\n\t\t\t\t\t\tif d := dis(ps[j], ps[j-1]); d <= t {\n\t\t\t\t\t\t\tt -= d\n\t\t\t\t\t\t\tc++\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif c > ans {\n\t\t\t\tans = c\n\t\t\t}\n\t\t}\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1292B(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 100000000000000000\n\n\tfor x[len(x)-1] < mat && y[len(y)-1] < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tto := int64(0)\n\tans := 0\n\n\tdone := make([]bool, len(x))\n\n\tfor {\n\t\tmi := int64(1 << 63 -1)\n\t\tnext := -1\n\t\tfor i := 0; i < len(x); i++ {\n\t\t\tif done[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif mi > abs(xs-x[i])+abs(ys-y[i]) {\n\t\t\t\tnext = i\n\t\t\t\tmi = abs(xs-x[i])+abs(ys-y[i])\n\t\t\t}\n\t\t}\n\n\t\tif next == -1 {\n\t\t\tbreak\n\t\t}\n\n\t\tif to+mi > t {\n\t\t\tbreak\n\t\t}\n\n\t\tans++\n\t\tto += mi\n\t\txs = x[next]\n\t\tys = y[next]\n\t\tdone[next] = true\n\t}\n\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 1 << 60\n\n\tfor x[len(x)-1]*ax+bx <= mat && y[len(y)-1]*ay+by < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < len(x); i++ {\n\t\tfor j := i; j < len(x); j++ {\n\t\t\tltor := x[j]-x[i]+y[j]-y[i]\n\t\t\ttol := abs(xs-x[i])+abs(ys-y[i])\n\t\t\ttor := abs(xs-x[j])+abs(ys-y[j])\n\n\t\t\tif t >= ltor+tor || t >= tol+ltor {\n\t\t\t\t// fmt.Println(ltor,tol,ltor+tor,j,i)\n\t\t\t\tans = max(ans, j-i+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\t// fmt.Println(x)\n\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n \n//=====I/O=====\n \nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n \nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n \nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n \nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn float64(a)\n}\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n \nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266afunc\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc calc(x,y,ax,ay,bx,by int64) (int64,int64) {\n\treturn ax*x+bx,ay*y+by\n}\n \nfunc dist(x1,y1,x2,y2 int64) int64 {\n\treturn abs(x1-x2)+abs(y1-y2)\n}\n \nfunc abs(a int64) int64 {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266amain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t// sc.Buffer(make([]byte, 10000), 100000000)\n \n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby := scanInt64()\n \n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n \n\tcs := make([]coordinate, 0)\n\tcs = append(cs, coordinate{x0,y0})\n \n\tli := int64(10000000000000000)\n \n\tfor cs[len(cs)-1].x a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n \n//=====I/O=====\n \nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n \nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n \nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n \nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn float64(a)\n}\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n \nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266afunc\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc calc(x,y,ax,ay,bx,by int64) (int64,int64) {\n\treturn ax*x+bx,ay*y+by\n}\n \nfunc dist(x1,y1,x2,y2 int64) int64 {\n\treturn abs(x1-x2)+abs(y1-y2)\n}\n \nfunc abs(a int64) int64 {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266amain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t// sc.Buffer(make([]byte, 10000), 100000000)\n \n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby := scanInt64()\n \n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n \n\tcs := make([]coordinate, 0)\n\tcs = append(cs, coordinate{x0,y0})\n \n\tli := int64(100000000000000000)\n \n\tfor cs[len(cs)-1].x a[i] { res = a[i] }\n\t}\n\treturn res\n}\n\nfunc max(a ...int) int {\n\tres := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif res < a[i] { res = a[i] }\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 100000000000000000\n\n\tfor x[len(x)-1] < mat && y[len(y)-1] < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tto := int64(0)\n\tans := 0\n\n\tmi := int64(1 << 63 -1)\n\tz := -1\n\tfor i := 0; i < len(x); i++ {\n\t\td := abs(x[i]-xs)+abs(y[i]-ys)\n\t\tif mi > d {\n\t\t\tz = i\n\t\t\tmi = d\n\t\t}\n\t}\n\n\tif mi > t {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tto += mi\n\tans++\n\n\tr := int64(0)\n\tfor i := z+1; i < len(x); i++ {\n\t\tr += abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t}\n\n\tl := int64(0)\n\tfor i := z-1; i >= 0; i-- {\n\t\tl += abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t}\n\n\tif l > r {\n\t\tfor i := z+1; i < len(x); i++ {\n\t\t\tnext := abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t\tto += r\n\t\tfor i := z-1; i >= 0; i-- {\n\t\t\tnext := abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t} else {\n\t\tfor i := z-1; i >= 0; i-- {\n\t\t\tnext := abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t\tto += l\n\t\tfor i := z+1; i < len(x); i++ {\n\t\t\tnext := abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 100000000000000000\n\n\tfor x[len(x)-1] < mat && y[len(y)-1] < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tto := int64(0)\n\tans := 0\n\n\tmi := int64(1 << 63 -1)\n\tz := -1\n\tfor i := 0; i < len(x); i++ {\n\t\td := abs(x[i]-xs)+abs(y[i]-ys)\n\t\tif mi > d {\n\t\t\tz = i\n\t\t\tmi = d\n\t\t}\n\t}\n\n\tif mi > t {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tto += mi\n\tans++\n\n\tr := int64(0)\n\tfor i := z+1; i < len(x); i++ {\n\t\tr += abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t}\n\n\tl := int64(0)\n\tfor i := z-1; i >= 0; i-- {\n\t\tl += abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t}\n\n\tif l > r {\n\t\tfor i := z+1; i < len(x); i++ {\n\t\t\tnext := abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t\tfor i := z-1; i >= 0; i-- {\n\t\t\tnext := abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t} else {\n\t\tfor i := z-1; i >= 0; i-- {\n\t\t\tnext := abs(x[i]-x[i+1])+abs(y[i]-y[i+1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t\tfor i := z+1; i < len(x); i++ {\n\t\t\tnext := abs(x[i]-x[i-1])+abs(y[i]-y[i-1])\n\t\t\tif next+to > t {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans++\n\t\t\tto += next\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n \n//=====I/O=====\n \nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n \nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n \nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n \nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn float64(a)\n}\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n \nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266afunc\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc calc(x,y,ax,ay,bx,by int64) (int64,int64) {\n\treturn ax*x+bx,ay*y+by\n}\n \nfunc dist(x1,y1,x2,y2 int64) int64 {\n\treturn abs(x1-x2)+abs(y1-y2)\n}\n \nfunc abs(a int64) int64 {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266amain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t// sc.Buffer(make([]byte, 10000), 100000000)\n \n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby := scanInt64()\n \n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n \n\tcs := make([]coordinate, 0)\n\tcs = append(cs, coordinate{x0,y0})\n \n\tli := int64(100000000000000000)\n \n\tfor cs[len(cs)-1].x t {\n\t\t\tbreak\n\t\t}\n\n\t\tf[index] = true\n\t\tnextx, nexty = x, y\n\t\tcnt += mi\n\t\tans++\n\t}\n \n\tfmt.Println(ans)\n}\n \ntype coordinate struct {\n\tx int64\n\ty int64\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanInt() int {\n\tsc.Scan(); a,_ := strconv.Atoi(sc.Text()); return a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan(); a,_ := strconv.ParseInt(sc.Text(),10,64); return a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan(); a,_ := strconv.ParseFloat(sc.Text(),64); return a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanString() string {\n\tsc.Scan(); return sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e); if i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr); wr.Flush()\n}\n\nfunc abs(a int64) int64 { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266aMain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a(\u3000-\u03c9-)\u30ce\u3000(\u3000\u30fb\u03c9\u30fb)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby :=scanInt64()\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tx := []int64{x0}\n\ty := []int64{y0}\n\n\tconst mat = 1 << 61\n\n\tfor x[len(x)-1]*ax+bx < mat && y[len(y)-1]*ay+by < mat {\n\t\tnext := len(x)-1\n\t\tx = append(x, ax*x[next]+bx)\n\t\ty = append(y, ay*y[next]+by)\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < len(x); i++ {\n\t\tfor j := i; j < len(x); j++ {\n\t\t\tltor := x[j]-x[i]+y[j]-y[i]\n\t\t\ttol := abs(xs-x[i])+abs(ys-y[i])\n\t\t\ttor := abs(xs-x[j])+abs(ys-y[j])\n\n\t\t\tif t >= ltor+tor || t >= tol+ltor {\n\t\t\t\t// fmt.Println(ltor+tol,ltor+tor,j,i)\n\t\t\t\tans = max(ans, j-i+1)\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn float64(a)\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266afunc\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n\nfunc calc(x,y,ax,ay,bx,by int64) (int64,int64) {\n\treturn ax*x+bx,ay*y+by\n}\n\nfunc dist(x1,y1,x2,y2 int64) int64 {\n\treturn abs(x1-x2)+abs(y1-y2)\n}\n\nfunc abs(a int64) int64 {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266amain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t// sc.Buffer(make([]byte, 10000), 100000000)\n\n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby := scanInt64()\n\n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n\n\tcs := make([]coordinate, 0)\n\tcs = append(cs, coordinate{x0,y0})\n\n\tli := int64(100000000000000000)\n\n\tfor cs[len(cs)-1].x=0 ; i-- {\n\t\tif cnt+dist(x,y,cs[i].x,cs[i].y) <= t{\n\t\t\tcnt+=dist(x,y,cs[i].x,cs[i].y)\n\t\t\tx,y = cs[i].x,cs[i].y\n\t\t\tans++\n\t\t\t// fmt.Println(x,y,cnt)\n\t\t}\n\t}\n\n\tfor i := index+1; i < len(cs); i++ {\n\t\tif cnt+dist(x,y,cs[i].x,cs[i].y) <= t{\n\t\t\tcnt+=dist(x,y,cs[i].x,cs[i].y)\n\t\t\tx,y = cs[i].x,cs[i].y\n\t\t\tans++\n\t\t\t// fmt.Println(x,y,cnt)\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\ntype coordinate struct {\n\tx int64\n\ty int64\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n \n//=====I/O=====\n \nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n \nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n \nfunc scanInt64() int64 {\n\tsc.Scan()\n\ta,_ := strconv.ParseInt(sc.Text(),10,64)\n\treturn a\n}\n \nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn float64(a)\n}\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n \nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266afunc\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc calc(x,y,ax,ay,bx,by int64) (int64,int64) {\n\treturn ax*x+bx,ay*y+by\n}\n \nfunc dist(x1,y1,x2,y2 int64) int64 {\n\treturn abs(x1-x2)+abs(y1-y2)\n}\n \nfunc abs(a int64) int64 {\n\tif a<0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n \n//\u2022*\u00a8*\u2022.\u00b8\u00b8\u266amain\u2022*\u00a8*\u2022.\u00b8\u00b8\u266a\n \nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\t// sc.Buffer(make([]byte, 10000), 100000000)\n \n\tx0 := scanInt64()\n\ty0 := scanInt64()\n\tax := scanInt64()\n\tay := scanInt64()\n\tbx := scanInt64()\n\tby := scanInt64()\n \n\txs := scanInt64()\n\tys := scanInt64()\n\tt := scanInt64()\n \n\tcs := make([]coordinate, 0)\n\tcs = append(cs, coordinate{x0,y0})\n \n\tli := int64(100000000000000000)\n \n\tfor cs[len(cs)-1].x t {\n\t\t\tbreak\n\t\t}\n\n\t\tf[index] = true\n\t\tcnt += mi\n\t\tans++\n\t}\n \n\tfmt.Println(ans)\n}\n \ntype coordinate struct {\n\tx int64\n\ty int64\n}\n"}], "src_uid": "d8a7ae2959b3781a8a4566a2f75a4e28"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(d... int) bool {\n for _, v := range d {\n if v != d[0] { return false }\n }\n return true\n}\n\nfunc main() {\n var a [3][3]int\n total := 0\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Scan(&a[i][j])\n total += a[i][j]\n }\n }\n total /= 2\n for i := 0; i < 3; i++ {\n t := total\n for j := 0; j < 3; j++ { t -= a[i][j] }\n a[i][i] = t\n }\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Print(a[i][j])\n if j == 2 { fmt.Println() } else { fmt.Print(\" \") }\n }\n }\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n00, n01, n02, n10, n11, n12, n20, n21, n22 int\n\tfmt.Scan(&n00, &n01, &n02)\n\tfmt.Scan(&n10, &n11, &n12)\n\tfmt.Scan(&n20, &n21, &n22)\n\tif n00 == 0 && n11 == 0 && n22 == 0 {\n\t\thasil := (n01 + n02 + n01 + n21 + n20 + n21)/2\n\t\tn00 = hasil - n01 - n02\n\t\tn11 = hasil - n10 - n12\n\t\tn22 = hasil - n20 - n21\n\t}\n\tfmt.Print(n00, n01, n02)\n\tfmt.Println()\n\tfmt.Print(n10, n11, n12)\n\tfmt.Println()\n\tfmt.Print(n20, n21, n22)\n\tfmt.Println()\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t//\"sort\"\n\t//\"unicode/utf8\"\n)\nfunc main() {\n\tvar a,b,c,d,e,f,g,h,i int\n\tfmt.Scan(&a,&b,&c,&d,&e,&f,&g,&h,&i)\n\ta=c+((f-d)/2)\n\ti=g+((d-f)/2)\n\te=b+c-g+((f-d)/2)\n\tfmt.Println(a,b,c)\n\tfmt.Println(d,e,f)\n\tfmt.Println(g,h,i)\n}\n\n\n\n"}, {"source_code": " // 259B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1, x2, x3, x4, x5, x6, x7, x8, x9 int\n\tfmt.Scan(&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8, &x9)\n\tx1 = (x3 + x6 + x7 - x2) / 2\n\tx5 = (x1 + x2 + x3 - x4 - x6)\n\tx9 = (x3 + x7 - x1)\n\tfmt.Println(x1, x2, x3)\n\tfmt.Println(x4, x5, x6)\n\tfmt.Println(x7, x8, x9)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(d... int) bool {\n for _, v := range d {\n if v != d[0] { return false }\n }\n return true\n}\n\nfunc main() {\n var a [3][3]int\n total := 0\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Scan(&a[i][j])\n total += a[i][j]\n }\n }\n total /= 2\n for i := 0; i < 3; i++ {\n t := total\n for j := 0; j < 3; j++ { t -= a[i][j] }\n a[i][i] = t\n }\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Print(a[i][j])\n if j == 2 { fmt.Println() } else { fmt.Print(\" \") }\n }\n }\n}\n"}, {"source_code": "// 259B-mic\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var x1, x2, x3, x4, x5, x6, x7, x8, x9 int\n fmt.Scan(&x1, &x2, &x3, &x4, &x5, &x6, &x7, &x8, &x9)\n x1 = (x3 + x6 + x7 - x2) / 2\n x5 = (x1 + x2 + x3 - x4 - x6)\n x9 = (x3 + x7 - x1)\n fmt.Println(x1, x2, x3)\n fmt.Println(x4, x5, x6)\n fmt.Println(x7, x8, x9)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n00, n01, n02, n10, n11, n12, n20, n21, n22 int\n\tfmt.Scan(&n00, &n01, &n02)\n\tfmt.Scan(&n10, &n11, &n12)\n\tfmt.Scan(&n20, &n21, &n22)\n\tif n00 == 0 && n11 == 0 && n22 == 0 {\n\t\tn00 = n02\n\t\tn22 = n20\n\t\tif n00 + n01 + n02 == n20 + n21 + n22 {\n\t\t\tn11 = n00 + n01 + n02 - n00 - n22\n\t\t}\n\t}\n\tfmt.Print(n00, n01, n02)\n\tfmt.Println()\n\tfmt.Print(n10, n11, n12)\n\tfmt.Println()\n\tfmt.Print(n20, n21, n22)\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc check(d... int) bool {\n for _, v := range d {\n if v != d[0] { return false }\n }\n return true\n}\n\nfunc main() {\n var a [3][3]int\n var x [3][2]int\n max := 0\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Scan(&a[i][j])\n x[i][0] += a[i][j]\n x[j][1] += a[i][j]\n if max < x[i][0] { max = x[i][0] }\n if max < x[j][0] { max = x[j][0] }\n }\n }\n if max > 100000 { max = 100000 }\n for i := 0; i <= max; i++ {\n for j := 0; j <= max; j++ {\n for k := 0; k <= max; k++ {\n if check((i+x[0][0]),(i+x[0][1]),(j+x[1][0]),(j+x[1][1]),(k+x[2][0]),(k+x[2][1])) {\n a[0][0] = i\n a[1][1] = j\n a[2][2] = k\n break\n }\n }\n }\n }\n for i := 0; i < 3; i++ {\n for j := 0; j < 3; j++ {\n fmt.Print(a[i][j])\n if j == 2 { fmt.Println() } else { fmt.Print(\" \") }\n }\n }\n}\n"}], "src_uid": "0c42eafb73d1e30f168958a06a0f9bca"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype vec struct{ x, y int64 }\n\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc (a vec) det(b vec) int64 { return a.x*b.y - a.y*b.x }\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF617D(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tf := func(a, b, c vec) bool {\n\t\ta, b = b.sub(a), c.sub(a)\n\t\treturn (a.x == 0 || a.y == 0 || b.x == 0 || b.y == 0) && a.dot(b) <= 0\n\t}\n\tvar a, b, c vec\n\tFscan(in, &a.x, &a.y, &b.x, &b.y, &c.x, &c.y)\n\tif d := b.sub(a); (d.x == 0 || d.y == 0) && d.det(c.sub(b)) == 0 {\n\t\tFprint(out, 1)\n\t} else if f(a, b, c) || f(b, a, c) || f(c, a, b) {\n\t\tFprint(out, 2)\n\t} else {\n\t\tFprint(out, 3)\n\t}\n}\n\nfunc main() { CF617D(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n if a > b {\n return a\n } else { \n return b\n }\n}\n\nfunc min(a, b int) int {\n if a < b {\n return a\n } else { \n return b\n }\n}\n\nfunc isBetween(a, b, c int) bool {\n return min(a, b) <= c && c <= max(a, b)\n}\n\nfunc f(i, j, k int, x, y [3]int) bool {\n return (x[k] == x[i] || x[k] == x[j]) && isBetween(y[i], y[j], y[k]) || (y[k] == y[i] || y[k] == y[j]) && isBetween(x[i], x[j], x[k])\n}\n\nfunc main() {\n var x, y [3]int\n for i := 0; i < 3; i++ {\n fmt.Scanf(\"%d %d\\n\\r\", &x[i], &y[i])\n }\n// for i := 0; i < 3; i++ {\n// fmt.Printf(\"%d %d\\n\\r\", x[i], y[i])\n// }\n if (x[0] == x[1] && x[1] == x[2] || y[0] == y[1] && y[1] == y[2]) {\n fmt.Println(\"1\")\n } else if (f(0, 1, 2, x, y) || f(0, 2, 1, x, y) || f(1, 2, 0, x, y)) {\n fmt.Println(\"2\")\n } else {\n fmt.Println(\"3\")\n }\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype vec struct{ x, y int64 }\n\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc (a vec) det(b vec) int64 { return a.x*b.y - a.y*b.x }\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF617D(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tf := func(a, b, c vec) bool {\n\t\ta, b = b.sub(a), c.sub(a)\n\t\treturn a.x == 0 && b.y == 0 || a.y == 0 && b.x == 0\n\t}\n\tvar a, b, c vec\n\tFscan(in, &a.x, &a.y, &b.x, &b.y, &c.x, &c.y)\n\tif b.sub(a).det(c.sub(b)) == 0 {\n\t\tFprint(out, 1)\n\t} else if f(a, b, c) || f(b, a, c) || f(c, a, b) {\n\t\tFprint(out, 2)\n\t} else {\n\t\tFprint(out, 3)\n\t}\n}\n\nfunc main() { CF617D(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype vec struct{ x, y int64 }\n\nfunc (a vec) sub(b vec) vec { return vec{a.x - b.x, a.y - b.y} }\nfunc (a vec) dot(b vec) int64 { return a.x*b.x + a.y*b.y }\nfunc (a vec) det(b vec) int64 { return a.x*b.y - a.y*b.x }\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF617D(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tf := func(a, b, c vec) bool { return b.sub(a).dot(c.sub(a)) == 0 }\n\tvar a, b, c vec\n\tFscan(in, &a.x, &a.y, &b.x, &b.y, &c.x, &c.y)\n\tif b.sub(a).det(c.sub(b)) == 0 {\n\t\tFprint(out, 1)\n\t} else if f(a, b, c) || f(b, a, c) || f(c, a, b) {\n\t\tFprint(out, 2)\n\t} else {\n\t\tFprint(out, 3)\n\t}\n}\n\nfunc main() { CF617D(os.Stdin, os.Stdout) }\n"}], "src_uid": "36fe960550e59b046202b5811343590d"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int\n\tfmt.Fscanln(r, &n)\n\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\n\tfmt.Fprintln(w, f(cs))\n}\n\nfunc f(cs []int) int {\n\tgs := graphs(cs)\n\n\tif len(gs) == 0 {\n\t\treturn -1\n\t}\n\n\tfor i, g := range gs {\n\t\tif g%2 == 0 {\n\t\t\tgs[i] = g / 2\n\t\t}\n\t}\n\n\tif len(gs) == 1 {\n\t\treturn gs[0]\n\t}\n\n\treturn lcmm(gs...)\n}\n\nfunc graphs(cs []int) []int {\n\tseen := make(map[int]bool, len(cs))\n\n\tvar ls []int\n\n\tfor j, c := range cs {\n\t\ti := j + 1\n\n\t\tif seen[i] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cs[i-1] == i {\n\t\t\tseen[i] = true\n\t\t\tseen[cs[i-1]] = true\n\t\t\tls = append(ls, 1)\n\t\t\tcontinue\n\t\t}\n\n\t\tl := 2\n\n\t\tfor ; ; l++ {\n\t\t\tseen[c] = true\n\t\t\tnext := cs[c-1]\n\t\t\tif next == i {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seen[next] {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tc = next\n\t\t}\n\t\tseen[i] = true\n\t\tls = append(ls, l)\n\t}\n\treturn ls\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\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(xs ...int) int {\n\tr := 1\n\tfor _, x := range xs {\n\t\tr = lcm(r, x)\n\t}\n\treturn r\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `\n4\n2 3 1 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n4 4 4 4\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n2 1 4 3\n`,\n\t\t\twant: `1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 3 1 5 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n7\n2 3 1 5 6 7 4\n`,\n\t\t\twant: `6`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 4 3 1 2\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n10\n8 10 4 3 2 1 9 6 5 7\n`,\n\t\t\twant: `15`,\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(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1<<13)\n\twriter := bufio.NewWriterSize(os.Stdout, 1<<13)\n\tn := ReadInt(reader)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = ReadInt(reader) - 1\n\t}\n\tfmt.Fprintln(writer, solve(a))\n\twriter.Flush()\n}\n\nfunc solve(a []int) int64 {\n\tn := len(a)\n\tres := int64(0)\n\treached := make([]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tif !reached[i] {\n\t\t\tk := i\n\t\t\tcount := int64(0)\n\t\t\tfor !reached[k] {\n\t\t\t\treached[k] = true\n\t\t\t\tk = a[k]\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tif k != i {\n\t\t\t\treturn -1\n\t\t\t}\n\t\t\tif count == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif count%2 == 0 {\n\t\t\t\tcount /= 2\n\t\t\t}\n\t\t\tif res == 0 {\n\t\t\t\tres = count\n\t\t\t} else {\n\t\t\t\tres = lcm(res, count)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\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\tg := gcd(a, b)\n\treturn (a / g) * 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 ReadInt(reader *bufio.Reader) int {\n\treturn int(ReadInt64(reader))\n}\n\nfunc ReadInt64(reader *bufio.Reader) int64 {\n\tb, err := reader.ReadByte()\n\tfor !isValid(b, err) {\n\t\tb, err = reader.ReadByte()\n\t}\n\tsign := int64(1)\n\tif b == '-' {\n\t\tsign *= -1\n\t\tb, err = reader.ReadByte()\n\t}\n\tres := int64(0)\n\tfor isValid(b, err) {\n\t\tres = res*10 + int64(b-'0')\n\t\tb, err = reader.ReadByte()\n\t}\n\treturn res * sign\n}\n\nfunc isValid(b byte, err error) bool {\n\treturn err == nil && (('0' <= b && b <= '9') || b == '-')\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\ntype crushes []int\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\nfunc lcm(a, b int64) int64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(a ...int) int64 {\n\tl := int64(a[0])\n\tfor _, v := range a {\n\n\t\tl = lcm(l, int64(v))\n\t}\n\treturn l\n}\n\nfunc (cr crushes) CountStepsToReturn(start int) int {\n\tcnt := 1\n\tcur := start\n\tfor cnt <= len(cr) {\n\t\tcur = cr[cur]\n\t\tif cur == start {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt > len(cr) {\n\t\treturn -1\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar cr crushes = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cr[i])\n\t\tcr[i]--\n\t}\n\tmin := make([]int, n)\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tm := cr.CountStepsToReturn(i)\n\t\tif m == -1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if m%2 == 0 {\n\t\t\tm = m / 2\n\t\t}\n\t\tmin[i] = m\n\t}\n\tif ans != -1 {\n\t\tans = lcmm(min...)\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &crush[i])\n\t\tcrush[i]--\n\t}\n\n\t// Checks zero in-degree.\n\tindeg := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tindeg[crush[i]]++\n\t}\n\tfor _, in := range indeg {\n\t\tif in == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Collects sizes of loops.\n\tsizes := make([]int, 0)\n\tvisited := make([]bool, n)\n\tfor first := 0; first < n; first++ {\n\t\tif !visited[first] {\n\t\t\tvisited[first] = true\n\t\t\tsize := 1\n\t\t\tfor x := crush[first]; !visited[x]; x = crush[x] {\n\t\t\t\tvisited[x] = true\n\t\t\t\tsize++\n\t\t\t}\n\t\t\tsizes = append(sizes, size)\n\t\t}\n\t}\n\n\tans := big.NewInt(1)\n\tfor _, size := range sizes {\n\t\tvar k *big.Int\n\t\tif size%2 == 0 {\n\t\t\tk = big.NewInt(int64(size / 2))\n\t\t} else {\n\t\t\tk = big.NewInt(int64(size))\n\t\t}\n\t\tg := new(big.Int).GCD(nil, nil, ans, k)\n\t\tans.Div(ans, g)\n\t\tans.Mul(ans, k)\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &crush[i])\n\t\tcrush[i]--\n\t}\n\n\tsizes := make([]int, 0)\n\tvisited := make([]bool, n)\n\tfor first := 0; first < n; first++ {\n\t\tif !visited[first] {\n\t\t\tvisited[first] = true\n\t\t\tsize := 1\n\t\t\tx := crush[first]\n\t\t\tfor !visited[x] {\n\t\t\t\tvisited[x] = true\n\t\t\t\tsize++\n\t\t\t\tx = crush[x]\n\t\t\t}\n\t\t\tif x != first {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tsizes = append(sizes, size)\n\t\t}\n\t}\n\n\tans := big.NewInt(1)\n\tfor _, size := range sizes {\n\t\tvar k *big.Int\n\t\tif size%2 == 0 {\n\t\t\tk = big.NewInt(int64(size / 2))\n\t\t} else {\n\t\t\tk = big.NewInt(int64(size))\n\t\t}\n\t\tg := new(big.Int).GCD(nil, nil, ans, k)\n\t\tans.Div(ans, g)\n\t\tans.Mul(ans, k)\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n n := readInt()\n a, was := readIntArray(n), make([]bool, n)\n c, ok := []int{}, true\n for i := range a {\n cur, cnt := i, 0\n for !was[cur] {\n was[cur] = true\n cur = a[cur]-1\n cnt++\n }\n\n if cnt%2 == 0 {\n cnt /= 2\n }\n\n if cur != i {\n ok = false\n } else {\n if cnt > 0 {\n c = append(c, cnt)\n }\n }\n }\n ans := -1\n if ok {\n ans = 1\n for d := 2; d < 101; d++ {\n mul := 1\n for i := range c {\n curMul := 1\n for c[i]%d == 0 {\n c[i] /= d\n curMul *= d\n }\n if curMul > mul {\n mul = curMul\n }\n }\n ans *= mul\n }\n }\n fmt.Println(ans)\n}\n\n// Helpers\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// Math\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\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n\n// Sort\n\ntype Ints64 []int64\n\nfunc (a Ints64) Len() int { return len(a) }\nfunc (a Ints64) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a Ints64) Less(i, j int) bool { return a[i] < a[j] }\n\n/* Sort tempalte\nfunc (a ) Len() int { return len(a) }\nfunc (a ) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ) Less(i, j int) bool { return }\n*/\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nvar n, cntGroup int\nvar crush, din, group []int\nvar t []int64\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\td := gcd(a, b)\n\treturn a / d * b\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tfmt.Fscanf(bufin, \"%d\\n\", &n)\n\n\tcrush = make([]int, n+1)\n\tdin = make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Fscanf(bufin, \"%d\\n\", &crush[i])\n\t\tdin[crush[i]]++\n\t}\n\n\tfor i := 1; i <= n; i++ {\n\t\tif din[i] != 1 {\n\t\t\tfmt.Fprintf(bufout, \"-1\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tt = make([]int64, n+1)\n\tgroup = make([]int, n+1)\n\tcntGroup = 0\n\n\tfor i := 1; i <= n; i++ {\n\t\tif group[i] == 0 {\n\t\t\tcntGroup++\n\t\t\tcntMember := int64(1)\n\t\t\tgroup[i] = cntGroup\n\t\t\tfor j := crush[i]; group[j] == 0; j = crush[j] {\n\t\t\t\tcntMember++\n\t\t\t\tgroup[j] = cntGroup\n\t\t\t}\n\t\t\tif cntMember%2 == 1 {\n\t\t\t\tt[cntGroup] = cntMember\n\t\t\t} else {\n\t\t\t\tt[cntGroup] = cntMember / 2\n\t\t\t}\n\t\t}\n\t}\n\n\tr := t[1]\n\tfor i := 2; i <= cntGroup; i++ {\n\t\tr = lcm(r, t[i])\n\t}\n\n\tfmt.Fprintf(bufout, \"%d\\n\", r)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tA := sc.NextIntArray()\n\n\tgroup := make([]int, N + 1)\n\tgroupCount := make([]int, N + 1)\n\tg := 1\n\tfor i := 0; i < N; i++ {\n\t\tif group[i] == 0 {\n\t\t\tcount := 1\n\t\t\tgroup[i] = g\n\t\t\tk := A[i] - 1\n\t\t\tfor k != i {\n\t\t\t\tif (group[k] > 0) {\n\t\t\t\t\tfmt.Println(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tgroup[k] = g\n\t\t\t\tk = A[k] - 1\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tgroupCount[g] = count\n\t\t\tg++\n\t\t}\n\t}\n\tans := int64(1)\n\tfor i := 1; i < g; i++ {\n\t\tif groupCount[i] % 2 == 0 {\n\t\t\tans = lcm(ans, int64(groupCount[i] / 2))\n\t\t} else {\n\t\t\tans = lcm(ans, int64(groupCount[i]))\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn a / gcd(a, b) * b\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\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"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int64) int64 {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := int64(1)\n\tfor i := 0; i < n; i++ {\n\t\tnode := i\n\t\tfor k := 1; k <= n; k++ {\n\t\t\tnode = crush[node]\n\t\t\tif node == i {\n\t\t\t\tif k%2 == 0 {\n\t\t\t\t\tk /= 2\n\t\t\t\t}\n\t\t\t\tans = lcm(ans, int64(k))\n\t\t\t\tgoto start\n\t\t\t}\n\t\t}\n\t\tans = -1\n\t\tbreak\n\tstart:\n\t}\n\tfmt.Println(ans)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc getCrush(x, t int, crush []int) int {\n\tfor i := 0; i < t; i++ {\n\t\tx = crush[x]\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := -1\n\tfor t := 1; t <= n*n; t++ {\n\t\tflag := true\n\t\tfor x := 0; x < n; x++ {\n\t\t\ty := getCrush(x, t, crush)\n\t\t\tif x != getCrush(y, t, crush) {\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\tans = t\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\ntype crushes []int\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\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(a ...int) int {\n\tl := a[0]\n\tfor _, v := range a {\n\t\tl = lcm(l, v)\n\t}\n\treturn l\n}\n\nfunc (cr crushes) CountStepsToReturn(start int) int {\n\tcnt := 1\n\tcur := start\n\tfor cnt <= len(cr) {\n\t\tcur = cr[cur]\n\t\tif cur == start {\n\t\t\tbreak\n\t\t}\n\t\tcnt++\n\t}\n\tif cnt > len(cr) {\n\t\treturn -1\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar cr crushes = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&cr[i])\n\t\tcr[i]--\n\t}\n\tmin := make([]int, n)\n\tvar ans int\n\tfor i := 0; i < n; i++ {\n\t\tm := cr.CountStepsToReturn(i)\n\t\tif m == -1 {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t} else if m%2 == 0 {\n\t\t\tm = m / 2\n\t\t}\n\t\tmin[i] = m\n\t}\n\tif ans != -1 {\n\t\tans = lcmm(min...)\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tnode := i\n\t\tfor k := 0; k < n; k++ {\n\t\t\tnode = crush[node]\n\t\t\tif node == i {\n\t\t\t\tans = lcm(ans, (k+1)/2)\n\t\t\t\tgoto start\n\t\t\t}\n\t\t}\n\t\tans = -1\n\t\tbreak\n\tstart:\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\tnode := i\n\t\tfor k := 1; k <= n; k++ {\n\t\t\tnode = crush[node]\n\t\t\tif node == i {\n\t\t\t\tif k%2 == 0 {\n\t\t\t\t\tk /= 2\n\t\t\t\t}\n\t\t\t\tans = lcm(ans, k)\n\t\t\t\tgoto start\n\t\t\t}\n\t\t}\n\t\tans = -1\n\t\tbreak\n\tstart:\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n/*\nfunc getCrush(x, t int, crush []int) int {\n\tif t > 0 {\n\t\treturn getCrush(crush[x], t-1, crush)\n\t} else {\n\t\treturn x\n\t}\n}\n*/\n\nfunc getCrush(x, t int, crush []int) int {\n\tfor i := 0; i < t; i++ {\n\t\tx = crush[x]\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := -1\n\tfor t := 1; t <= n; t++ {\n\t\tflag := true\n\t\tfor x := 0; x < n; x++ {\n\t\t\ty := getCrush(x, t, crush)\n\t\t\tif x != getCrush(y, t, crush) {\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\tans = t\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc getCrush(x, t int, crush []int) int {\n\tif t > 0 {\n\t\treturn getCrush(crush[x], t-1, crush)\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcrush := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&crush[i])\n\t\tcrush[i]--\n\t}\n\tans := -1\n\tfor t := 1; t <= n; t++ {\n\t\tflag := true\n\t\tfor x := 0; x < n; x++ {\n\t\t\ty := getCrush(x, t, crush)\n\t\t\tif x != getCrush(y, t, crush) {\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\tans = t\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int\n\tfmt.Fscanln(r, &n)\n\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\n\tfmt.Fprintln(w, f(cs))\n}\n\nfunc f(cs []int) int {\n\tgs := graphs(cs)\n\n\tif len(gs) == 0 {\n\t\treturn -1\n\t}\n\n\tif len(gs) == 1 {\n\t\treturn gs[0]\n\t}\n\n\tfor i, g := range gs {\n\t\tif g%2 == 0 {\n\t\t\tgs[i] = g / 2\n\t\t}\n\t}\n\n\treturn lcmm(gs...)\n}\n\nfunc graphs(cs []int) []int {\n\tseen := make(map[int]bool, len(cs))\n\n\tvar ls []int\n\n\tfor j, c := range cs {\n\t\ti := j + 1\n\n\t\tif seen[i] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cs[i-1] == i {\n\t\t\tseen[i] = true\n\t\t\tseen[cs[i-1]] = true\n\t\t\tls = append(ls, 1)\n\t\t\tcontinue\n\t\t}\n\n\t\tl := 2\n\n\t\tfor ; ; l++ {\n\t\t\tseen[c] = true\n\t\t\tnext := cs[c-1]\n\t\t\tif next == i {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seen[next] {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tc = next\n\t\t}\n\t\tseen[i] = true\n\t\tls = append(ls, l)\n\t}\n\treturn ls\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\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(xs ...int) int {\n\tr := 1\n\tfor _, x := range xs {\n\t\tr = lcm(r, x)\n\t}\n\treturn r\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `\n4\n2 3 1 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n4 4 4 4\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n2 1 4 3\n`,\n\t\t\twant: `1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 3 1 5 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n7\n2 3 1 5 6 7 4\n`,\n\t\t\twant: `6`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 4 3 1 2\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n10\n8 10 4 3 2 1 9 6 5 7\n`,\n\t\t\twant: `15`,\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(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int\n\tfmt.Fscanln(r, &n)\n\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\n\tfmt.Fprintln(w, f(cs))\n}\n\nfunc f(cs []int) int {\n\tgs := graphs(cs)\n\n\tif len(gs) == 0 {\n\t\treturn -1\n\t}\n\n\tif len(gs) == 1 {\n\t\treturn gs[0]\n\t}\n\n\tfor i, g := range gs {\n\t\tif g%2 == 0 {\n\t\t\tgs[i] = g / 2\n\t\t}\n\t}\n\n\treturn lcmm(gs...)\n}\n\nfunc graphs(cs []int) []int {\n\tseen := make(map[int]bool, len(cs))\n\n\tvar ls []int\n\n\tfor j, c := range cs {\n\t\ti := j + 1\n\n\t\tif seen[i-1] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cs[i-1] == i {\n\t\t\tseen[i] = true\n\t\t\tseen[cs[i-1]] = true\n\t\t\tls = append(ls, 1)\n\t\t\tcontinue\n\t\t}\n\n\t\tl := 2\n\n\t\tfor ; ; l++ {\n\t\t\tseen[c] = true\n\t\t\tnext := cs[c-1]\n\t\t\tif next == i {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seen[next] {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tc = next\n\t\t}\n\t\tseen[i] = true\n\t\tls = append(ls, l)\n\t}\n\treturn ls\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\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(xs ...int) int {\n\tr := 1\n\tfor _, x := range xs {\n\t\tr = lcm(r, x)\n\t}\n\treturn r\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `\n4\n2 3 1 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n4 4 4 4\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n2 1 4 3\n`,\n\t\t\twant: `1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 3 1 5 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n7\n2 3 1 5 6 7 4\n`,\n\t\t\twant: `6`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 4 3 1 2\n`,\n\t\t\twant: `-1`,\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(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\tif len(b) == 0 {\n\t\ttest()\n\t} else {\n\t\tsolve(bytes.NewReader(b), os.Stdout)\n\t}\n}\n\nfunc solve(r io.Reader, w io.Writer) {\n\tvar n int\n\tfmt.Fscanln(r, &n)\n\n\tcs := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\n\tfmt.Fprintln(w, f(cs))\n}\n\nfunc f(cs []int) int {\n\tgs := graphs(cs)\n\n\tif len(gs) == 0 {\n\t\treturn -1\n\t}\n\n\tif len(gs) == 1 {\n\t\treturn gs[0]\n\t}\n\n\tfor i, g := range gs {\n\t\tif g%2 == 0 {\n\t\t\tgs[i] = g / 2\n\t\t}\n\t}\n\n\treturn lcmm(gs...)\n}\n\nfunc graphs(cs []int) []int {\n\tseen := make(map[int]bool, len(cs))\n\n\tvar ls []int\n\n\tfor j, c := range cs {\n\t\ti := j + 1\n\n\t\tif seen[cs[c-1]] {\n\t\t\tcontinue\n\t\t}\n\n\t\tif cs[i-1] == i {\n\t\t\tseen[i] = true\n\t\t\tseen[cs[i-1]] = true\n\t\t\tls = append(ls, 1)\n\t\t\tcontinue\n\t\t}\n\n\t\tl := 2\n\n\t\tfor ; ; l++ {\n\t\t\tseen[c] = true\n\t\t\tnext := cs[c-1]\n\t\t\tif next == i {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif seen[next] {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tc = next\n\t\t}\n\t\tseen[i] = true\n\t\tls = append(ls, l)\n\t}\n\treturn ls\n}\n\nfunc gcd(a, b uint64) uint64 {\n\tfor b > 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc lcm(a, b uint64) uint64 {\n\treturn a * b / gcd(a, b)\n}\n\nfunc lcmm(xs ...int) int {\n\tr := uint64(1)\n\tfor _, x := range xs {\n\t\tr = lcm(r, uint64(x))\n\t}\n\treturn int(r)\n}\n\nfunc test() {\n\ttests := []struct {\n\t\tin string\n\t\twant string\n\t}{\n\t\t{\n\t\t\tin: `\n4\n2 3 1 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n4 4 4 4\n`,\n\t\t\twant: `-1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n4\n2 1 4 3\n`,\n\t\t\twant: `1`,\n\t\t},\n\t\t{\n\t\t\tin: `\n5\n2 3 1 5 4\n`,\n\t\t\twant: `3`,\n\t\t},\n\t\t{\n\t\t\tin: `\n7\n2 3 1 5 6 7 4\n`,\n\t\t\twant: `6`,\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(chomp(tt.in)), buf)\n\t\tif got, want := chomp(buf.String()), chomp(tt.want); got != want {\n\t\t\tfmt.Printf(\"%d: got %v, want %v\\n\", i, got, want)\n\t\t}\n\t}\n}\n\nfunc chomp(s string) string {\n\treturn strings.Trim(s, \"\\n\")\n}\n\nfunc assert(b bool) {\n\tif !b {\n\t\t_, file, line, ok := runtime.Caller(1)\n\t\tif ok {\n\t\t\tf, _ := os.Open(file)\n\t\t\tdefer f.Close()\n\t\t\ts := bufio.NewScanner(f)\n\t\t\tlnum := 0\n\t\t\tfor s.Scan() {\n\t\t\t\tlnum++\n\t\t\t\tif lnum == line {\n\t\t\t\t\twd, _ := os.Getwd()\n\t\t\t\t\tfname, _ := filepath.Rel(wd, file)\n\t\t\t\t\tfmt.Printf(\"assertion fails: %s:%d: %v\\n\", fname, line, s.Text())\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc pow(a, b int) int {\n\tr := 1\n\tfor i := 0; i < b; i++ {\n\t\tr *= a\n\t}\n\treturn r\n}\n"}], "src_uid": "149221131a978298ac56b58438df46c9"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc vk(s string) int {\n\treturn strings.Count(s, \"VK\")\n}\n\nfunc main() {\n\tvar arr []byte\n\tvar c byte\n\tvar max int\n\tfor {\n\t\tfmt.Scanf(\"%c\", &c)\n\t\tif c == '\\n' {\n\t\t\tbreak\n\t\t}\n\t\tarr = append(arr, c)\n\t}\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] == 'V' {\n\t\t\tarr[i] = 'K'\n\t\t\tif vk(string(arr)) > max {\n\t\t\t\tmax = vk(string(arr))\n\t\t\t}\n\t\t\tarr[i] = 'V'\n\t\t} else {\n\t\t\tarr[i] = 'V'\n\t\t\tif vk(string(arr)) > max {\n\t\t\t\tmax = vk(string(arr))\n\t\t\t}\n\t\t\tarr[i] = 'K'\n\t\t}\n\t}\n\tfmt.Println(max)\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar s string\n\tfor I(&s) == nil {\n\t\tsolve(s)\n\t}\n}\n\nfunc solve(s string) {\n\tss := []byte(s)\n\tvk := []byte(\"VK\")\n\tmax := bytes.Count(ss, vk)\n\tfor i := range ss {\n\t\tif ss[i] == 'V' {\n\t\t\tss[i] = 'K'\n\t\t} else {\n\t\t\tss[i] = 'V'\n\t\t}\n\t\tmx := bytes.Count(ss, vk)\n\t\tif mx > max {\n\t\t\tmax = mx\n\t\t}\n\t\tif ss[i] == 'V' {\n\t\t\tss[i] = 'K'\n\t\t} else {\n\t\t\tss[i] = 'V'\n\t\t}\n\t}\n\tO(max, \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tstr := readString()\n\ta := []byte(str)\n\tans := 0\n\tfor _, v := range []byte(\"VK\") {\n\t\tfor i := 0; i < len(a); i++ {\n\t\t\tprev := a[i]\n\t\t\ta[i] = v\n\t\t\tres := 0\n\t\t\tfor j := 0; j < len(a)-1; j++ {\n\t\t\t\tif a[j] == 'V' && a[j+1] == 'K' {\n\t\t\t\t\tres++\n\t\t\t\t\tj++\n\t\t\t\t}\n\t\t\t}\n\t\t\tans = max(ans, res)\n\t\t\ta[i] = prev\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}], "negative_code": [], "src_uid": "578bae0fe6634882227ac371ebb38fc9"} {"source_code": "package main\r\n\r\nimport (\r\n\t\"bufio\"\r\n\t\"fmt\"\r\n\t\"io\"\r\n\t\"os\"\r\n)\r\n\r\nfunc modpow(x, n, mod int) int {\r\n\tif n == 0 {\r\n\t\treturn 1 % mod\r\n\t}\r\n\tu := modpow(x, n/2, mod)\r\n\tu = (u * u) % mod\r\n\tif n&1 == 1 {\r\n\t\tu = (x * u) % mod\r\n\t}\r\n\r\n\treturn u\r\n}\r\n\r\nfunc Min(a, b int) int {\r\n\tif a < b {\r\n\t\treturn a\r\n\t}\r\n\treturn b\r\n}\r\n\r\nfunc Solve(reader io.Reader, writer io.Writer) {\r\n\tmod := 1000000007\r\n\r\n\tvar n, k int\r\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &k)\r\n\tcomb := 1\r\n\tans := 1\r\n\tfor i := 1; i <= Min(n, k); i++ {\r\n\t\tcomb = (comb * (n - i + 1)) % mod\r\n\t\tcomb = (comb * modpow(i, mod-2, mod)) % mod\r\n\t\tans = (ans + comb) % mod\r\n\r\n\t}\r\n\tfmt.Fprintln(writer, ans)\r\n}\r\n\r\nfunc main() {\r\n\t// f, err := os.Open(\"data.txt\")\r\n\t// if err != nil {\r\n\t// \tos.Exit(1)\r\n\t// }\r\n\t// defer f.Close()\r\n\r\n\t// reader := bufio.NewReader(f)\r\n\treader := bufio.NewReader(os.Stdin)\r\n\twriter := bufio.NewWriter(os.Stdout)\r\n\tSolve(reader, writer)\r\n\twriter.Flush()\r\n\r\n}\r\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar P107 int = 1000000007\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 b\n\t}\n\treturn a\n}\n\nfunc Abs(a int) int {\n\treturn Max(a, -a)\n}\n\nfunc Gcd(a, b int) int {\n\tmin := Min(a, b)\n\tmax := Max(a, b)\n\tif min == 0 {\n\t\treturn max\n\t}\n\n\tfor max%min != 0 {\n\t\tmin, max = max%min, min\n\t}\n\n\treturn min\n}\n\nfunc Lcm(a, b int) int {\n\treturn a / Gcd(a, b) * b\n}\n\nvar facs []int = make([]int, 100010)\n\nfunc FacP(n, p int) int {\n\tif facs[n] != 0 {\n\t\treturn facs[n]\n\t}\n\n\tresult := 1\n\tfacs[0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % p\n\t\tfacs[i] = result\n\t}\n\n\treturn result\n}\n\nfunc ExpP(a, x, p int) int {\n\tif x == 0 {\n\t\treturn 1\n\t}\n\n\tif x%2 == 0 {\n\t\thalf := ExpP(a, x/2, p)\n\t\treturn (half * half) % p\n\t} else {\n\t\treturn ((a % p) * ExpP(a, x-1, p)) % p\n\t}\n}\n\nfunc CombP(n, c, p int) int {\n\treturn (FacP(n, p) * ((ExpP(FacP(n-c, p), p-2, p) * ExpP(FacP(c, p), p-2, p)) % p)) % p\n}\n\nfunc Solve(reader *bufio.Reader) {\n\tscanner := bufio.NewScanner(reader)\n\tscanner.Split(bufio.ScanWords)\n\twr := bufio.NewWriter(os.Stdout)\n\tdefer wr.Flush()\n\n\tscanner.Scan()\n\tn, _ := strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tk, _ := strconv.Atoi(scanner.Text())\n\tk = Min(k, n)\n\n\tresult := 0\n\tfor i := 0; i <= k; i++ {\n\t\tresult = (result + CombP(n, i, P107)) % P107\n\t}\n\n\twr.WriteString(strconv.Itoa(result) + \"\\n\")\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tSolve(reader)\n}\n"}], "negative_code": [], "src_uid": "dc7b887afcc2e95c4e90619ceda63071"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc seive(n int64) int64 {\n\tvar isPrime []bool = []bool{}\n\tvar i int64\n\tvar j int64\n\tfor i = 0; i <= n; i++ {\n\t\tisPrime = append(isPrime, true)\n\t}\n\tvar num = make([]int64, n+1)\n\tfor i = 2; i <= (n); i++ {\n\t\tif isPrime[i] == true {\n\t\t\tfor j = 2; j*i <= n; j++ {\n\t\t\t\tisPrime[j*i] = false\n\t\t\t\tnum[j*i] += 1\n\t\t\t}\n\t\t}\n\t}\n\tvar result int64 = 0\n\tfor i = 2; i <= n; i++ {\n\t\tif num[i] == 2 {\n\t\t\tresult++\n\t\t}\n\t}\n\treturn result\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tn, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\tvar res int64\n\tres = seive(n)\n\tfmt.Println(res)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"io/ioutil\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\", &n)\n\tcount := 0\n\tfor i := 6;i <= n;i ++ {\n\t\tprime_count := 0\n\t\tx := i\n\t\tfor j := 2;j <= i;j ++ {\n\t\t\tif x % j == 0 {\n\t\t\t\tprime_count ++\n\t\t\t\tfor x % j == 0 {\n\t\t\t\t\tx /= j\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif prime_count == 2 {\n\t\t\tcount ++\n\t\t}\n\t}\n\tfmt.Printf(\"%d\", count)\n}"}, {"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n int\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.Atoi(r.Text())\n\ta := make([]int, 3001)\n\tcount := 0\n\tfor i:=2; i<=n; i++ {\n\t\tfor j:=2; j max {\n break\n }\n primes = append(primes, pos)\n for i := 2*pos; i <= max; i += pos {\n notPrime[i] = true\n }\n }\n\n n := getI()\n result := 0\n for a := 1; a <= n; a++ {\n count := 0\n for _, b := range primes {\n if b >= a {\n break\n }\n if a%b == 0 {\n count++\n }\n }\n if count == 2 {\n result++\n }\n }\n writer.WriteString(fmt.Sprintf(\"%d\\n\", result))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar w int\n\t_, _ = fmt.Scanf(\"%d\", &w)\n\tsimples := make([]int, w-1)\n\tfor i := 2; i < w+1; i++ {\n\t\tsimples[i-2] = i\n\t}\n\n\tfor _, i := range simples {\n\t\tif i != -1 {\n\t\t\tfor j := i * i; j <= w; j += i {\n\t\t\t\tsimples[j-2] = -1\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\n\tfor i := 2; i <= w; i++ {\n\t\tcnt := 2\n\t\tfor _, v := range simples {\n\t\t\tif v != -1 && i%v == 0 {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t}\n\n\t\tif cnt == 0 {\n\t\t\tans += 1\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tpr = [...]int32{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71}\n\tnpr = int32(len(pr))\n)\n\n// num of prime factors\nfunc npf(x int32) (ret int32) {\n\ti := int32(0)\n\tfor i < npr && ret < 3 && x > 1 {\n\t\td := pr[i]\n\t\tif d*d > x {\n\t\t\tret++\n\t\t\tbreak\n\t\t}\n\t\tvolt := false\n\t\tfor x%d == 0 {\n\t\t\tvolt = true\n\t\t\tx = x / d\n\t\t}\n\t\tif volt {\n\t\t\tret++\n\t\t}\n\t\ti++\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int32\n\tfmt.Scan(&n)\n\ts := int32(0)\n\tfor i := int32(6); i <= n; i++ {\n\t\t//println(i, npf(i))\n\t\tif 2 == npf(i) {\n\t\t\ts++\n\t\t}\n\t}\n\tfmt.Println(s)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n p := make([]int,n+1)\n ans := 0\n for i := 2; i <= n; i++ {\n if p[i] == 0 {\n for a := i; a <= n; a += i {\n p[a]++\n }\n } else if p[i] == 2 {\n ans++\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n p := make([]int,n+1)\n ans := 0\n for i := 2; i <= n; i++ {\n if p[i] == 0 {\n for a := i; a <= n; a += i {\n p[a]++\n }\n } else if p[i] == 2 {\n ans++\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc genPrime(max int) []int {\n\tprimes := make([]int, 0)\n\tsieve := make([]bool, max+1)\n\tfor i := 2; i < max+1; i++ {\n\t\tif sieve[i] == true {\n\t\t\tcontinue\n\t\t}\n\t\tprimes = append(primes, i)\n\t\tfor j := 2; i*j < max+1; j++ {\n\t\t\tsieve[i*j] = true\n\t\t}\n\t}\n\treturn primes\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tn := 0\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tfmt.Sscanf(line, \"%d\", &n)\n\t\tprimes := genPrime(n)\n\n\t\talmostPrime := 0\n\n\t\tfor i := 2; i <= n; i++ {\n\t\t\ttmp := i\n\t\t\tfactorCount := 0\n\t\t\tfor _, j := range primes {\n\t\t\t\tif tmp%j == 0 {\n\t\t\t\t\tfactorCount += 1\n\t\t\t\t\tif factorCount > 2 {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor tmp%j == 0 {\n\t\t\t\t\ttmp = tmp / j\n\t\t\t\t}\n\t\t\t}\n\t\t\tif factorCount == 2 {\n\t\t\t\talmostPrime += 1\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(almostPrime)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar inf int = 0x3f3f3f3f\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\n\tans := 0\n\tfor num := 0; num <= n; num++ {\n\t\ta := Divisor(num)\n\t\tsum := 0\n\t\tfor i := 0; i < len(a); i++ {\n\t\t\tif IsPrime(a[i]) {\n\t\t\t\tsum++\n\t\t\t}\n\t\t\tif sum > 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif sum == 2 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// IsPrime \u7d20\u6027\u6d4b\u8bd5\nfunc IsPrime(n int) bool {\n\tfor i := int(2); i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn n != 1\n}\n\n// Divisor \u7ea6\u6570\u679a\u4e3e\nfunc Divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != n/i {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\n"}, {"source_code": "// 26A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d [3005]int\n\tvar n int\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif d[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i; j <= n; j += i {\n\t\t\td[j]++\n\t\t}\n\t}\n\tres := 0\n\tfor i := 6; i <= n; i++ {\n\t\tif d[i] == 2 {\n\t\t\tres++\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n"}, {"source_code": "// 26A-mic_rizal\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar v []int\n\tvar cont, num, cou, l int\n\tv = append(v, 2)\n\tl++\n\tfor i := 3; i < 3000; i += 2 {\n\t\tfor j := 2; j < i; j++ {\n\t\t\tif i%j == 0 {\n\t\t\t\tcont++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif cont <= 0 {\n\t\t\tv = append(v, i)\n\t\t\tl++\n\t\t}\n\t\tcont = 0\n\t}\n\tcont = 0\n\tfmt.Scan(&num)\n\tfor i := 1; i <= num; i++ {\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif i%v[j] == 0 {\n\t\t\t\tcont++\n\t\t\t}\n\t\t}\n\t\tif cont == 2 {\n\t\t\tcou++\n\t\t}\n\t\tcont = 0\n\t}\n\tfmt.Println(cou)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBIG = 1024 * 1024 * 10\n)\n\nfunc readLine(r *bufio.Reader) string {\n\tbytes, _, err := r.ReadLine()\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to read line\")\n\t}\n\n\treturn string(bytes)\n}\n\nfunc readInts(r *bufio.Reader) []int {\n\telems := strings.Fields(readLine(r))\n\n\tret := make([]int, len(elems))\n\tfor i, el := range elems {\n\t\ttmp, err := strconv.ParseInt(el, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to parse number %v\", el)\n\t\t}\n\t\tret[i] = int(tmp)\n\t}\n\n\treturn ret\n}\n\ntype Sieve struct {\n\tn int\n\tfirst, primes []int\n}\n\ntype Factor struct {\n\tBase, Exp int\n}\n\nfunc NewSieve(n int) *Sieve {\n\tfirst := make([]int, n+1)\n\tprimes := make([]int, 0)\n\n\tfor i := 2; i <= n; i++ {\n\t\tif first[i] == 0 {\n\t\t\tfirst[i] = i\n\t\t\tprimes = append(primes, i)\n\t\t}\n\n\t\tfor j := 0; j < len(primes) && primes[j] <= first[i] && i*primes[j] <= n; j++ {\n\t\t\tfirst[i*primes[j]] = primes[j]\n\t\t}\n\t}\n\n\tret := Sieve{n, first, primes}\n\n\treturn &ret\n}\n\nfunc (s *Sieve) IsPrime(x int) (bool, error) {\n\tif s.n < x {\n\t\treturn false, errors.New(fmt.Sprintf(\"The largest supported number by this sieve is %v\", s.n))\n\t}\n\tif x < s.primes[0] || x > s.primes[len(s.primes)-1] {\n\t\treturn false, nil\n\t} else if x == s.primes[0] {\n\t\treturn true, nil\n\t}\n\tlow, high := 0, len(s.primes)-1\n\tfor high-low > 1 {\n\t\tmid := (low + high) / 2\n\t\tif s.primes[mid] < x {\n\t\t\tlow = mid\n\t\t} else {\n\t\t\thigh = mid\n\t\t}\n\t}\n\treturn s.primes[high] == x, nil\n}\n\nfunc (s *Sieve) Factors(x int) ([]Factor, error) {\n\tfactors := make([]Factor, 0)\n\n\tif s.n < x {\n\t\treturn factors, errors.New(fmt.Sprintf(\"The largest supported number by this sieve is %v\", s.n))\n\t}\n\n\tfor x > 1 {\n\t\tpi := s.first[x]\n\t\texp := 0\n\t\tfor x > 1 && s.first[x] == pi {\n\t\t\texp += 1\n\t\t\tx /= pi\n\t\t}\n\t\tfactors = append(factors, Factor{pi, exp})\n\t}\n\n\treturn factors, nil\n}\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, BIG)\n\n\tn := readInts(r)[0]\n\ts := NewSieve(n)\n\n\ttotal := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfactors, _ := s.Factors(i)\n\t\tif len(factors) == 2 {\n\t\t\ttotal += 1\n\t\t}\n\t}\n\n\tfmt.Println(total)\n}\n"}], "negative_code": [{"source_code": "// 26A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d [3005]int\n\tvar n int\n\tfmt.Scan(&n)\n\tfor i := 2; i <= n; i++ {\n\t\tif d[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i; j <= n; j += i {\n\t\t\td[j]++\n\t\t}\n\t}\n\tres := 0\n\tfor i := 6; i <= n; i++ {\n\t\tif d[i] == 2 {\n\t\t\tres++\n\t\t}\n\t\tfmt.Println(res)\n\t}\n}\n"}], "src_uid": "356666366625bc5358bc8b97c8d67bd5"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF766B(_r io.Reader, out io.Writer) {\n\tin := bufio.NewReader(_r)\n\tvar n int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tsort.Ints(a)\n\tfor i, v := range a[2:] {\n\t\tif a[i]+a[i+1] > v {\n\t\t\tFprint(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"NO\")\n}\n\nfunc main() { CF766B(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tarray := make([]int, n)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tfor i := 0; scanner.Scan(); i++ {\n\t\ta, err := strconv.Atoi(scanner.Text())\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tarray[i] = a\n\t}\n\n\tmerge_sort(array, 0, n-1)\n\n\tfor i := n - 1; i >= 2; i-- {\n\t\tif array[i-1]+array[i-2] > array[i] {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc merge(buffer []int, start, middle, end int) {\n\tsorted := make([]int, end-start+1)\n\n\ti := start\n\tj := middle + 1\n\tk := 0\n\tfor i <= middle && j <= end {\n\t\tif buffer[i] <= buffer[j] {\n\t\t\tsorted[k] = buffer[i]\n\t\t\ti++\n\t\t} else {\n\t\t\tsorted[k] = buffer[j]\n\t\t\tj++\n\t\t}\n\t\tk++\n\t}\n\tfor i <= middle {\n\t\tsorted[k] = buffer[i]\n\t\tk++\n\t\ti++\n\t}\n\tfor j <= end {\n\t\tsorted[k] = buffer[j]\n\t\tk++\n\t\tj++\n\t}\n\n\ti = start\n\tk = 0\n\tfor i <= end {\n\t\tbuffer[i] = sorted[k]\n\t\ti++\n\t\tk++\n\t}\n}\n\nfunc merge_sort(buffer []int, start, end int) {\n\tif end > start {\n\t\tmiddle := (end + start) / 2\n\t\tmerge_sort(buffer, start, middle)\n\t\tmerge_sort(buffer, middle+1, end)\n\t\tmerge(buffer, start, middle, end)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tv[i] = readInt()\n\t}\n\tsort.Ints(v)\n\tfor i := 2; i < n; i++ {\n\t\ta := int64(v[i-2])\n\t\tb := int64(v[i-1])\n\t\tc := int64(v[i])\n\t\tif a+b > c && a+c > b && b+c > a {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF766B(_r io.Reader, out io.Writer) {\n\tin := bufio.NewReader(_r)\n\tvar n int\n\tFscan(in, &n)\n\tif n > 44 {\n\t\tFprint(out, \"YES\")\n\t\treturn\n\t}\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tsort.Ints(a)\n\tfor i, v := range a[2:] {\n\t\tif a[i]+a[i+1] > v {\n\t\t\tFprint(out, \"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tFprint(out, \"NO\")\n}\n\nfunc main() { CF766B(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\tmaj := make([]int, n)\n\tfor i := range maj {\n\t\tmaj[i] = readInt()\n\t}\n\tsort.Ints(maj)\n\tfor i := 0; i <= len(maj)-3; i++ {\n\t\tif maj[i]+maj[i+1] > maj[i+2] {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tnums := make([]int, n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tfor i := 0; scanner.Scan(); i++ {\n\t\tnum, _ := strconv.Atoi(scanner.Text())\n\t\tnums[i] = num\n\t}\n\tsort.Ints(nums)\n\n\tvar canFormTriangle bool\n\tfor i := 2; i < n; i++ {\n\t\tif nums[i-2]+nums[i-1] > nums[i] {\n\t\t\tcanFormTriangle = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif canFormTriangle {\n\t\tfmt.Print(\"YES\")\n\t} else {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"bufio\"\n \"os\"\n)\n\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\nfunc frst() {\n fmt.Println(\"YES\")\n}\nfunc scnd() {\n fmt.Println(\"NO\")\n}\n\nfunc check(a int, b int, c int) bool {\n if a + b > c && b + c > a && a + c > b {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var n int\n scanf(\"%d\\n\", &n)\n var a = make([]int, n)\n for i := 0; i < n; i++ {\n scanf(\"%d\", &a[i])\n }\n sort.Ints(a)\n for i := 0; i < n - 2; i++ {\n if check(a[i], a[i + 1], a[i + 2]) == true {\n frst()\n return\n }\n }\n if check(a[n - 2], a[n - 1], a[0]) == true {\n frst()\n return\n }\n if check(a[n - 1], a[0], a[1]) == true {\n frst()\n return\n }\n scnd()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc Solve(io *FastIO) {\n\tN := io.NextInt()\n\tA := io.NextIntArray(N)\n\n\tsort.Ints(A)\n\n\tfor i := 0; i + 2 < N; i++ {\n\t\tif A[i] + A[i + 1] > A[i + 2] {\n\t\t\tio.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tio.Println(\"NO\")\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n \"bufio\"\n \"os\"\n)\n\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\nfunc frst() {\n fmt.Println(\"YES\")\n}\nfunc scnd() {\n fmt.Println(\"NO\")\n}\n\nfunc check(a int, b int, c int) bool {\n if a + b > c && b + c > a && a + c > b {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var n int\n scanf(\"%d\\n\", &n)\n var a = make([]int, n)\n for i := 0; i < n; i++ {\n scanf(\"%d\", &a[i])\n }\n sort.Ints(a)\n for i := 0; i < n - 2; i++ {\n if check(a[i], a[i + 1], a[i + 2]) == true {\n frst()\n return\n }\n }\n if check(a[n - 2], a[n - 1], a[0]) == true {\n frst()\n return\n }\n if check(a[n - 1], a[0], a[1]) == true {\n frst()\n return\n }\n scnd()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n) == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tI(&a[i])\n\t}\n\tsort.Ints(a)\n\tfor i := 0; i < len(a)-2; i++ {\n\t\tif a[i]+a[i+1] > a[i+2] {\n\t\t\tO(\"YES\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tO(\"NO\\n\")\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n int\n\tfor I(&n) == nil {\n\t\tsolve(n)\n\t}\n}\n\nfunc solve(n int) {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tI(&a[i])\n\t}\n\tsort.Ints(a)\n\tfor i := 0; i < len(a)-2; i++ {\n\t\tif a[i]+a[i+1] >= a[i+2] {\n\t\t\tO(\"YES\\n\")\n\t\t\treturn\n\t\t}\n\t}\n\tO(\"NO\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\tmaj := make([]int, n)\n\tfor i := range maj {\n\t\tmaj[i] = readInt()\n\t}\n\tsort.Ints(maj)\n\ta, b, c := int64(maj[len(maj)-3]), int64(maj[len(maj)-2]), int64(maj[len(maj)-1])\n\tif a*a+b*b < c*c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\tmaj := make([]int, n)\n\tfor i := range maj {\n\t\tmaj[i] = readInt()\n\t}\n\tsort.Ints(maj)\n\ta, b, c := int64(maj[0]), int64(maj[1]), int64(maj[len(maj)-1])\n\tif a*a+b*b < c*c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\tmaj := make([]int, n)\n\tfor i := range maj {\n\t\tmaj[i] = readInt()\n\t}\n\tsort.Ints(maj)\n\ta, b, c := int64(maj[0]), int64(maj[1]), int64(maj[len(maj)-1])\n\tfmt.Println(a*a+b*b < c*c)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"unicode\"\n)\n\nvar stdReader *bufio.Reader = bufio.NewReader(os.Stdin)\n\nfunc readInt() (result int) {\n\tvar negative, started bool\nREADER_LOOP:\n\tfor {\n\t\tchar, err := stdReader.ReadByte()\n\t\tswitch {\n\t\tcase err != nil:\n\t\t\tbreak READER_LOOP\n\t\tcase char == '-':\n\t\t\tnegative = true\n\t\tcase unicode.IsDigit(rune(char)):\n\t\t\tstarted = true\n\t\t\tresult = result*10 + int(char&0xf)\n\t\tcase started:\n\t\t\tbreak READER_LOOP\n\t\t}\n\t}\n\tif negative {\n\t\tresult = -result\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := readInt()\n\tmaj := make([]int, n)\n\tfor i := range maj {\n\t\tmaj[i] = readInt()\n\t}\n\tsort.Ints(maj)\n\ta, b, c := int64(maj[len(maj)-3]), int64(maj[len(maj)-2]), int64(maj[len(maj)-1])\n\tif a*a+b*b > c*c {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}], "src_uid": "897bd80b79df7b1143b652655b9a6790"} {"source_code": "package main\n\nimport \"fmt\"\n\ntype key struct {\n\tlastIdx int\n\tnDifferent int\n}\n\nvar (\n\tn, m, k int\n\tcache = make(map[key]int64)\n)\n\n// colorings will calculate how many different colorings are at a[0]..a[lastIdx], so that nDifferent for 0..lastIdx holds.\nfunc colorings(lastIdx int, nDifferent int) (ret int64) {\n\tk := key{lastIdx, nDifferent}\n\tif r, ok := cache[k]; ok {\n\t\treturn r\n\t}\n\tdefer func() {\n\t\tcache[k] = ret\n\t}()\n\n\t// We have spent all our different brick possibilities.\n\tif nDifferent < 0 {\n\t\treturn 0\n\t}\n\n\tif lastIdx == 0 {\n\t\tif nDifferent == 0 {\n\t\t\t// If there is only one brick remaining, it can have m different colors.\n\t\t\treturn int64(m)\n\t\t}\n\t\t// But only, if there is exactly zero bricks different on its left.\n\t\treturn 0\n\t}\n\n\t// There are p combinations for 0..lastIdx-1. For each combination:\n\t// - there is (m-1) combinations with nDifferent that is the same\n\t// - one combination with nDifferent less.\n\tlastIdxDifferent := colorings(lastIdx-1, nDifferent-1) * int64(m-1)\n\tlastIdxSame := colorings(lastIdx-1, nDifferent)\n\t// dprintf(\"lastIdx=%d, nDifferent=%d, noDiff=%d, diff=%d\", lastIdx, nDifferent, noDiffChange, diffChange)\n\n\treturn (lastIdxDifferent + lastIdxSame) % 998244353\n\n\t// m combinations where [lastIdx-1, lastIdx are the same]\n\t// m**2 - m combinations where [lastIdx-1 and lastIdx are different]\n}\n\nfunc dprintf(i string, a ...interface{}) {\n\tif false {\n\t\tfmt.Printf(i+\"\\n\", a...)\n\t}\n}\n\nfunc main() {\n\tfmt.Scanf(\"%d %d %d\", &n, &m, &k)\n\tfmt.Println(colorings(n-1, k))\n\tdprintf(\"%v\", cache)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst (\n\tmod = 998244353\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn, m, k := 0, 0, 0\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &n, &m, &k)\n\tf := make([][]int64, n+1)\n\tfor i := 0; i < n+1; i++ {\n\t\tf[i] = make([]int64, k+1)\n\t}\n\tf[1][0] = int64(m)\n\tfor i := 2; i < n+1; i++ {\n\t\tfor j := 0; j < k+1; j++ {\n\t\t\tif j == 0 {\n\t\t\t\tf[i][j] = f[i-1][j]\n\t\t\t} else {\n\t\t\t\tf[i][j] = f[i-1][j] + f[i-1][j-1]*int64(m-1)\n\t\t\t\tf[i][j] %= mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", f[n][k])\n\treturn\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nconst M int64 = 998244353\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n fmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n fmt.Fscanf(reader, f, a...)\n}\n\nfunc sp(x, y int64) int64 {\n var mul, res int64 = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m, k int\n scanf(\"%d%d%d\", &n, &m, &k)\n fac := make([]int64, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * int64(i)) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(int64(m-1), int64(k))) % M\n sol = (sol * int64(m)) % M\n printf(\"%d\\n\", sol)\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nconst M int = 998244353\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n fmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n fmt.Fscanf(reader, f, a...)\n}\n\nfunc sp(x, y int) int {\n var mul, res int = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m, k int\n scanf(\"%d%d%d\", &n, &m, &k)\n\n fac := make([]int, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * i) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(m-1, k)) % M\n sol = (sol * m) % M\n printf(\"%d\\n\", sol)\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst M int = 998244353\n\nfunc sp(x, y int) int {\n var mul, res int = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n var n, m, k int\n fmt.Scanf(\"%d %d %d\\n\", &n, &m, &k)\n\n fac := make([]int, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * i) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(m-1, k)) % M\n sol = (sol * m) % M\n fmt.Printf(\"%d\\n\", sol)\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nconst M int = 998244353\n\nfunc sp(x, y int) int {\n var mul, res int = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n var n, m, k int\n fmt.Scanf(\"%d%d%d\\n\", &n, &m, &k)\n\n fac := make([]int, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * i) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(m-1, k)) % M\n sol = (sol * m) % M\n fmt.Printf(\"%d\\n\", sol)\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n)\n\nconst M int = 998244353\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a ...interface{}) {\n fmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a ...interface{}) {\n fmt.Fscanf(reader, f, a...)\n}\n\nfunc sp(x, y int) int {\n var mul, res int = x, 1\n for y != 0 {\n if y % 2 != 0 {\n res = (res * mul) % M\n }\n mul = (mul * mul) % M\n y /= 2\n }\n return res\n}\n\nfunc main() {\n defer writer.Flush()\n var n, m, k int\n scanf(\"%d%d%d\", &n, &m, &k)\n printf(\"%d %d %d\\n\", n, m, k);\n fac := make([]int, n+1)\n fac[0] = 1\n for i := 1; i <= n; i += 1 {\n fac[i] = (fac[i-1] * i) % M\n }\n\n sol := fac[n-1]\n sol = (sol * sp(fac[n-1-k], M-2)) % M\n sol = (sol * sp(fac[k], M-2)) % M\n sol = (sol * sp(m-1, k)) % M\n sol = (sol * m) % M\n printf(\"%d\\n\", sol)\n}"}], "src_uid": "b2b9bee53e425fab1aa4d5468b9e578b"} {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1143/problem/B\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc getLength(n int) int {\n\tlength := 0\n\tfor n > 0 {\n\t\tn /= 10\n\t\tlength += 1\n\n\t}\n\treturn length\n}\n\nfunc max(x int64, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc product(n int) int64 {\n\tproduct := int64(1)\n\tfor n > 0 {\n\t\tproduct *= int64(n % 10)\n\t\tn /= 10\n\t}\n\treturn product\n}\n\nfunc Solve(n int) int64 {\n\tbase := 10\n\tmaxProduct := int64(0)\n\tfor n > 0 {\n\t\tmaxProduct = max(maxProduct, product(n))\n\t\tn -= (n%base + 1)\n\t\tbase *= 10\n\t}\n\treturn maxProduct\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\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 main() {\n\tdefer writer.Flush()\n\tch := string(\"\")\n\tscanf(\"%s\", &ch)\n\tnum := []byte(ch)\n\ts1 := uint64(1)\n\tfor _, char := range num {\n\t\ts, _ := strconv.ParseUint(string(char), 10, 64)\n\t\ts1 *= s\n\t}\n\tfor i, char := range num {\n\t\tif char == '0' {\n\t\t\tbreak\n\t\t}\n\t\tnum1 := make([]byte, len(num))\n\t\tcopy(num1, num)\n\t\tnum1[i] = num[i] - 1\n\t\ts2 := uint64(1)\n\t\tfor j, char := range num1 {\n\t\t\tvar number uint64\n\t\t\tif j <= i {\n\t\t\t\tnumber, _ = strconv.ParseUint(string(char), 10, 64)\n\t\t\t\tif number == 0 {\n\t\t\t\t\tnumber = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnumber = 9\n\t\t\t}\n\t\t\ts2 *= number\n\t\t}\n\t\tif s2 > s1 {\n\t\t\ts1 = s2\n\t\t}\n\t}\n\tprintf(\"%d\\n\", s1)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n int64\n\tfmt.Fscanf(buf, \"%d\\n\", &n)\n\n\tmat := make([]int64, 20)\n\tlen := 0\n\tfor n > 0 {\n\t\tmat[len] = n % int64(10)\n\t\tn /= 10\n\t\tlen++\n\t}\n\t//for i := len - 1; i >= 0; i-- {\n\t//\tif mat[i] == 0 {\n\t//\t\tfor j := i + 1; j < len; j++ {\n\t//\t\t\tmat[j]--\n\t//\t\t\tif mat[j] > 0 || (mat[j] == 0 && j == len-1) {\n\t//\t\t\t\tfor k := j - 1; k >= 0; k-- {\n\t//\t\t\t\t\tmat[k] = 9\n\t//\t\t\t\t}\n\t//\t\t\t\tbreak\n\t//\t\t\t}\n\t//\t\t}\n\t//\t\tbreak\n\t//\t}\n\t//}\n\t//for i := len; i >= 0; i-- {\n\t//\tif mat[i] > 0 {\n\t//\t\tlen = i + 1\n\t//\t\tbreak\n\t//\t}\n\t//}\n\tvar le int64 = 1\n\tvar ans int64 = 1\n\tvar tmp int64 = 1\n\tfor i := 0; i < len; i++ {\n\t\tans *= mat[i]\n\t\tle *= 9\n\t}\n\t//fmt.Printf(\"-%d len=%d %v\\n\",ans,len,mat)\n\n\tfor i := len - 1; i >= 0; i-- {\n\t\tle /= 9\n\t\tif mat[i] > 1 {\n\t\t\tif tmp*(mat[i]-1)*le > ans {\n\t\t\t\tans = tmp * (mat[i] - 1) * le\n\t\t\t}\n\t\t} else if i == len-1 {\n\t\t\tif le > ans {\n\t\t\t\tans = le\n\t\t\t}\n\t\t}else {\n\t\t\tbreak\n\t\t}\n\t\ttmp *= mat[i]\n\t}\n\tfmt.Printf(\"%d\\n\", ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n int64\n\tfmt.Fscanf(buf, \"%d\\n\", &n)\n\n\tmat := make([]int64, 20)\n\tlen := 0\n\tfor n > 0 {\n\t\tmat[len] = n % int64(10)\n\t\tn /= 10\n\t\tlen++\n\t}\n\tfor i := len - 1; i >= 0; i-- {\n\t\tif mat[i] == 0 {\n\t\t\tfor j := i + 1; j < len; j++ {\n\t\t\t\tmat[j]--\n\t\t\t\tif mat[j] > 0 || (mat[j] == 0 && j == len-1) {\n\t\t\t\t\tfor k := j - 1; k >= 0; k-- {\n\t\t\t\t\t\tmat[k] = 9\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n//\tfmt.Printf(\"%v\\n\",mat)\n\tfor i := len; i >= 0; i-- {\n\t\tif mat[i] > 0 {\n\t\t\tlen = i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\tvar le int64 = 1\n\tvar ans int64 = 1\n\tvar tmp int64 = 1\n\tfor i := 0; i < len; i++ {\n\t\tans *= mat[i]\n\t\tle *= 9\n\t}\n\t//fmt.Printf(\"-%d len=%d %v\\n\",ans,len,mat)\n\n\tfor i:=len-1;i>=0;i--{\n\t\tle/=9\n\t\tif mat[i] > 1{\n\t\t\tif tmp*(mat[i]-1)*le > ans{\n\t\t\t\tans=tmp*(mat[i]-1)*le\n\t\t\t}\n\t\t}else if i==len-1{\n\t\t\tif le > ans{\n\t\t\t\tans =le\n\t\t\t}\n\t\t}\n\t\ttmp *= mat[i]\n\t}\n\tfmt.Printf(\"%d\\n\",ans)\n}"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1143/B\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tN []rune\n\n\tdp [20][2]int64\n)\n\nfunc main() {\n\tN = ReadRuneSlice()\n\tn := len(N)\n\n\tdp[0][0] = 1\n\tfor i := 0; i < len(N); i++ {\n\t\td := int64(N[i] - '0')\n\n\t\tdp[i+1][0] = dp[i][0] * d\n\t\tChMax(&dp[i+1][1], dp[i][0]*(d-1))\n\t\tChMax(&dp[i+1][1], dp[i][0])\n\t\tChMax(&dp[i+1][1], dp[i][1]*9)\n\t}\n\n\tfmt.Println(Max(dp[n][0], dp[n][1]))\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 ...int64) int64 {\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// 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 *int64, target int64) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tif n < 10 {\n\t\tfmt.Fprintf(out, \"%d\\n\", n)\n\t\treturn\n\t}\n\ta := make([]int, 0)\n\tfor n > 0 {\n\t\ta = append(a, n%10)\n\t\tn /= 10\n\t}\n\tb := make([]int, len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tb[i] = a[len(a)-i-1]\n\t}\n\tans := 1\n\tfor i := 0; i < len(a); i++ {\n\t\tans *= b[i]\n\t}\n\ttmp := 1\n\tfor i := 1; i < len(a); i++ {\n\t\ttmp *= 9\n\t}\n\tif tmp > ans {\n\t\tans = tmp\n\t}\n\t// c := make([]int, len(b))\n\t// for i := 0; i < len(b); i++ {\n\t// \tc[i] = b[i]\n\t// }\n\n\tfor i := 0; i < len(b); i++ {\n\t\tif b[i] > 1 {\n\t\t\ttmp := 1\n\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\ttmp *= b[j]\n\t\t\t}\n\t\t\ttmp *= b[i] - 1\n\t\t\tfor j := i + 1; j < len(b); j++ {\n\t\t\t\ttmp *= 9\n\t\t\t}\n\t\t\tif tmp > ans {\n\t\t\t\tans = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", ans)\n\treturn\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(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\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 power(a int) (int) {\n\tif a < 10 {\n\t\treturn a\n\t}\n\t//fmt.Println(a)\n\n\torder := int(math.Floor(math.Log10(float64(a))))\n\taddition := max(a / int(math.Pow10(order)) - 1, 1)\n\ttop := int(math.Pow(9.0, float64(order))) * addition\n\n\t//fmt.Println(\"Versus\", top, \"order\", order, \"addition\", addition)\n\treturn max(top, (a / int(math.Pow10(order))) * power(a % int(math.Pow10(order))))\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(power(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n\nfunc reverseInts(input []int) []int {\n\tif len(input) == 0 {\n\t\treturn input\n\t}\n\treturn append(reverseInts(input[1:]), input[0])\n}\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\tvar list []int\n\tans := 1;\n\tfor ;;{\n\t\tif n == 0{\n\t\t\tbreak\n\t\t}\n\t\tlist=append(list, n % 10)\n\t\tans *= n % 10\n\t\tn /= 10\n\t}\n\n\tfor index, each := range list{\n\t\ttmp := 1\n\t\tif each > 0{\n\t\t\tfor i := index - 1; i >= 0; i--{\n\t\t\t\ttmp *= 9\n\t\t\t}\n\t\t\tfor i := index + 1; i < len(list); i++{\n\t\t\t\ttmp *= list[i]\n\t\t\t}\n\t\t\t//fmt.Println(index, each)\n\t\t\tif each == 1 && index == len(list) - 1{\n\n\t\t\t}else{\n\t\t\t\ttmp *= each - 1\n\t\t\t}\n\t\t\tif tmp > ans{\n\t\t\t\tans = tmp\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tch := string(\"\")\n\tfmt.Scanf(\"%s\", &ch)\n\tnum := []byte(ch)\n\ts1 := uint64(1)\n\tfor _, char := range num {\n\t\ts, _ := strconv.ParseUint(string(char), 10, 64)\n\t\ts1 *= s\n\t}\n\tfor i, char := range num {\n\t\tif char == '0' {\n\t\t\tbreak\n\t\t}\n\t\tnum1 := []byte{}\n\t\tnum1 = num\n\t\tnum1[i] = num[i] - 1\n\t\ts2 := uint64(1)\n\t\tfor j, char := range num1 {\n\t\t\tvar number uint64\n\t\t\tif j <= i {\n\t\t\t\tnumber, _ = strconv.ParseUint(string(char), 10, 64)\n\t\t\t\tif number == 0 {\n\t\t\t\t\tnumber = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnumber = 9\n\t\t\t}\n\t\t\ts2 *= number\n\t\t}\n\t\tif s2 > s1 {\n\t\t\ts1 = s2\n\t\t}\n\t}\n\tprintln(s1)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\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 main() {\n\tdefer writer.Flush()\n\tch := string(\"\")\n\tscanf(\"%s\", &ch)\n\tnum := []byte(ch)\n\ts1 := uint64(1)\n\tfor _, char := range num {\n\t\ts, _ := strconv.ParseUint(string(char), 10, 64)\n\t\ts1 *= s\n\t}\n\tfor i, char := range num {\n\t\tif char == '0' {\n\t\t\tbreak\n\t\t}\n\t\tnum1 := []byte{}\n\t\tnum1 = num\n\t\tnum1[i] = num[i] - 1\n\t\ts2 := uint64(1)\n\t\tfor j, char := range num1 {\n\t\t\tvar number uint64\n\t\t\tif j <= i {\n\t\t\t\tnumber, _ = strconv.ParseUint(string(char), 10, 64)\n\t\t\t\tif number == 0 {\n\t\t\t\t\tnumber = 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tnumber = 9\n\t\t\t}\n\t\t\ts2 *= number\n\t\t}\n\t\tif s2 > s1 {\n\t\t\ts1 = s2\n\t\t}\n\t}\n\tprintf(\"%d\\n\", s1)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\n\tvar n int64\n\tfmt.Fscanf(buf, \"%d\\n\", &n)\n\n\tmat := make([]int64, 20)\n\tlen := 0\n\tfor n > 0 {\n\t\tmat[len] = n % int64(10)\n\t\tn /= 10\n\t\tlen++\n\t}\n\tfor i := len - 1; i >= 0; i-- {\n\t\tif mat[i] == 0 {\n\t\t\tfor j := i + 1; j < len; j++ {\n\t\t\t\tmat[j]--\n\t\t\t\tif mat[j] > 0 || (mat[j] == 0 && j == len-1) {\n\t\t\t\t\tfor k := j - 1; k >= 0; k-- {\n\t\t\t\t\t\tmat[k] = 9\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\t//fmt.Printf(\"%v\\n\",mat)\n\tfor i := len; i >= 0; i-- {\n\t\tif mat[i] > 0 {\n\t\t\tlen = i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\tvar le int64 = 1\n\tvar ans int64 = 1\n\tvar tmp int64 = 1\n\tfor i := 0; i < len; i++ {\n\t\tans *= mat[i]\n\t\tle *= 9\n\t}\n\t//fmt.Printf(\"-%d len=%d %v\\n\",ans,len,mat)\n\n\tfor i:=len-1;i>=0;i--{\n\t\tle/=9\n\t\tif mat[i] > 1{\n\t\t\tif tmp*(mat[i]-1)*le > ans{\n\t\t\t\tans=tmp*(mat[i]-1)*le\n\t\t\t}\n\t\t}\n\t\ttmp *= mat[i]\n\t}\n\tfmt.Printf(\"%d\\n\",ans)\n}\n"}], "src_uid": "38690bd32e7d0b314f701f138ce19dfb"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n int\n\tvar x int\n//\ta := make([]int,0)\n\tfmt.Fscanln(in,&n)\n\tps := 0\n\tmn := 0\n\tfor i := 0 ;i < n ;i++{\n\t\tfmt.Fscan(in,&x)\n\t\tif(x >= 1){\n\t\t\tps ++\n\t\t}else{\n\t\t\t\tif(x <= -1){\n\t\t\t\t\tmn ++\n\t\t\t\t}\n\t\t}\n\t}\n\tif(ps > mn){\n\t\tif(ps >= (n + 1) / 2){\n\t\t\tfmt.Fprint(out,1)\n\t\t}else{\n\t\t\tfmt.Fprint(out,0)\n\t\t}\n\t\treturn\n\t}else{\n\t\tif mn >= (n + 1) / 2{\n\t\t\tfmt.Fprint(out,-1)\n\t\t}else{\n\t\t\tfmt.Fprint(out,0)\n\t\t}\n\t\treturn\n\t}\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc readLine()(string,error) \t\t\t{ return reader.ReadString('\\n') }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n int\n\tscanf(\"%d\\n\", &n)\n\tk := n/2 + n%2\n\ta := make([]int,n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d\", &a[i])\n\t}\n\tfor i := -1000; i <= 1000; i++ {\n\t\t\tx := 0\n\t\t\tfor _, j := range a {\n\t\t\t\tif ((i > 0 && j > 0) || (i < 0 && j < 0)) {\n\t\t\t\t\tx++\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x >= k {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\n\t}\n\tfmt.Println(0)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc getNumFromOneLine(ir *bufio.Reader) int {\n\tstream, _ := ir.ReadString('\\n')\n\t// Trims the stream and then splits\n\ttrimmedStream := strings.TrimSpace(stream)\n\tnum, _ := strconv.Atoi(trimmedStream)\n\treturn num\n}\n\nfunc getNumsFromOneLine(ir *bufio.Reader) []int {\n\tstream, _ := ir.ReadString('\\n')\n\t// Trims the stream and then splits\n\ttrimmedStream := strings.TrimSpace(stream)\n\tsplitArr := strings.Split(trimmedStream, \" \")\n\t// convert strings to integers and store them in a slice\n\tnums := make([]int, len(splitArr))\n\tfor index, val := range splitArr {\n\t\tnums[index], _ = strconv.Atoi(val)\n\t}\n\treturn nums\n}\n\nfunc main() {\n\tir := bufio.NewReader(os.Stdin)\n\t_ = getNumFromOneLine(ir)\n\tnums := getNumsFromOneLine(ir)\n\n\tpos, neg := 0, 0\n\tfor _, num := range nums {\n\t\tif num > 0 {\n\t\t\tpos += 1\n\t\t} else if num < 0 {\n\t\t\tneg += 1\n\t\t}\n\t}\n\n\tif neg >= (len(nums)+1)/2 {\n\t\tfmt.Println(-1)\n\t} else if pos >= (len(nums)+1)/2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc cleanString(stream string, seperator string) []int{\n\t// Trims the stream and then splits\n\ttrimmedStream := strings.TrimSpace(stream)\n\tsplitArr := strings.Split(trimmedStream, seperator)\n\t// convert strings to integers and store them in a slice\n\tnums := make([]int, len(splitArr))\n\tfor index,val := range splitArr{\n\t\tnums[index], _ = strconv.Atoi(val)\n\t}\n\treturn nums\n}\n\nfunc main() {\n\tir := bufio.NewReader(os.Stdin)\n\tinput, _ := ir.ReadString('\\n')\n\t_, _ = strconv.Atoi(strings.TrimSpace(input))\n\tvar nums []int\n\tlineInput, _ := ir.ReadString('\\n')\n\tnums = cleanString(lineInput, \" \")\n\tpos, neg := 0, 0\n\tfor _, num := range nums {\n\t\tif num > 0 {\n\t\t\tpos += 1\n\t\t} else if num < 0 {\n\t\t\tneg += 1\n\t\t}\n\t}\n\tif neg >= (len(nums) + 1) / 2 {\n\t\tfmt.Println(-1)\n\t} else if pos >= (len(nums) + 1) / 2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int = 0;\n fmt.Scan(&n);\n var plus, minus, zero int = 0,0,0;\n for n > 0 {\n var x int = 0;\n fmt.Scan(&x);\n if (x < 0) {\n minus++;\n } else if (x > 0) {\n plus++;\n } else {\n zero++;\n }\n n--;\n }\n if (plus >= minus + zero) {\n fmt.Println(1);\n } else if (minus >= plus + zero) {\n fmt.Println(-1);\n } else {\n fmt.Println(0);\n }\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scanf(\"%d\", &n)\n\n pos := 0\n neg := 0\n for i := 0; i <= n; i++ {\n var nmb int\n fmt.Scanf(\"%d\", &nmb)\n if nmb > 0 {\n pos++\n }\n if nmb < 0 {\n neg++\n }\n }\n\n if neg < (n + 1) / 2 && pos < (n + 1) / 2 {\n fmt.Println(0)\n } else if neg >= (n + 1) / 2 {\n fmt.Println(-1)\n } else if pos >= (n + 1) / 2 {\n fmt.Println(1)\n }\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc calc(n,z,p,t int) int{\n\tvar val int\n\tif t&1==1{\n\t\tval = t/2 + 1\n\t}else{\n\t\tval = t/2\n\t}\n\n\tif n >=val{\n\t\treturn -1\n\t}else if p>=val{\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc main(){\n\tvar t int\n\tfmt.Scan(&t)\n\tvar neg int\n\tvar zero int\n\tvar pos int\n\n\tfor i:=0;i 0:\n\t\t\tpos++\n\t\t}\n\t}\n\n\tif pos >= (n+1)/2 {\n\t\tfmt.Println(1)\n\t} else if neg >= (n+1)/2 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"bytes\"\n \"fmt\"\n \"os\"\n)\n\ntype Seg struct {\n\n}\n\ntype Prob struct {\n in *bufio.Reader\n}\n\nfunc (prob *Prob) NextLine() string {\n line, _, _ := prob.in.ReadLine()\n return string(line[:])\n}\n\nfunc (prob *Prob) NextByte() byte {\n bt, _ := prob.in.ReadByte()\n return bt\n}\n\nfunc (prob *Prob) Next() string {\n var buff bytes.Buffer\n bt := prob.NextByte()\n for bt == '\\n' || bt == ' ' {\n bt = prob.NextByte()\n }\n for bt != '\\n' && bt != ' ' {\n buff.WriteByte(bt)\n bt = prob.NextByte()\n }\n return buff.String()\n}\n\nfunc (prob *Prob) NextInt() int {\n var x int\n bt := prob.NextByte()\n for bt > '9' || bt < '0' {\n if bt == '-' {\n return -prob.NextInt()\n }\n bt = prob.NextByte()\n }\n for bt >= '0' && bt <= '9' {\n x = x * 10 + int(bt - '0')\n bt = prob.NextByte()\n }\n return x\n}\n\nfunc (prob Prob) Solve() {\n n := prob.NextInt()\n po := 0\n ne := 0\n for i := 0; i < n; i++ {\n d := prob.NextInt()\n if d > 0 {\n po++\n } else if d < 0 {\n ne++\n }\n }\n if po >= (n + 1) / 2 {\n fmt.Println(\"1\")\n } else if ne >= (n + 1) / 2 {\n fmt.Println(\"-1\")\n } else {\n fmt.Println(0)\n }\n}\n\n\nfunc main() {\n Prob{in: bufio.NewReader(os.Stdin)}.Solve()\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, x, y int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tif a < 0 {\n\t\t\tx++\n\t\t} else if a > 0 {\n\t\t\ty++\n\t\t}\n\t}\n\tif x >= (int)((n + 1) / 2) {\n\t\tfmt.Println(\"-1\")\n\t} else if y >= (int)((n + 1) / 2) {\n\t\tfmt.Println(\"1\")\n\t} else {\n\t\tfmt.Println(\"0\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t}\n\tfmt.Fscanf(in, \"\\n\")\n\tneed := n/2 + n%2\n\tfor j := -1000; j <= 1000; j++ {\n\t\tif j != 0 {\n\t\t\tcur := float64(0)\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif float64(a[i])/float64(j) > 0 {\n\t\t\t\t\tcur += 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif cur >= float64(need) {\n\t\t\t\tfmt.Fprintf(out, \"%d\\n\", j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", 0)\n\treturn\n}\n\nfunc recover(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\tif len(s)%2 == 0 {\n\t\treturn recover(s[:len(s)-1]) + string(s[len(s)-1])\n\t} else {\n\t\treturn recover(s[1:]) + string(s[0])\n\t}\n}\n"}, {"source_code": "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\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\tvar pos, neg, zero int\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tzero++\n\t\t} else if v < 0 {\n\t\t\tneg++\n\t\t} else {\n\t\t\tpos++\n\t\t}\n\t}\n\tm := n / 2\n\tif n%2 != 0 {\n\t\tm++\n\t}\n\tif m <= pos {\n\t\tprintln(1)\n\t} else if m <= neg {\n\t\tprintln(-1)\n\t} else {\n\t\tprintln(0)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nfunc main() {\n\trbuf := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscanf(rbuf, \"%d\\n\", &n)\n\n\tvar a []int = make([]int, n)\n\tpos, neg := 0, 0\n\tfor i := range a {\n\t\tfmt.Fscanf(rbuf, \"%d\", &a[i])\n\t\tif (a[i] > 0) {\n\t\t\tpos += 1\n\t\t}\n\t\tif (a[i] < 0) {\n\t\t\tneg += 1\n\t\t}\n\t}\n\n\tif pos * 2 >= n {\n\t\tfmt.Println(1)\n\t} else if neg * 2 >= n {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}"}, {"source_code": "// http://codeforces.com/problemset/problem/1130/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strings\"\n\t\"os\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar inputs int\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinputs, _ = strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tline := scanner.Text()\n\tvar zeros int = 0\n\tvar positives int = 0\n\tvar negatives int = 0\n\tfor _, num := range strings.Split(line, \" \") {\n\t\tif num == \"0\" {\n\t\t\tzeros++\n\t\t} else if strings.Count(num, \"-\") == 1 {\n\t\t\tnegatives++\n\t\t} else {\n\t\t\tpositives++\n\t\t}\n\t}\n\tc := math.Ceil(float64(inputs)/2)\n\tif float64(positives) >= c {\n\t\tfmt.Printf(\"1\")\n\t} else if float64(negatives) >= c {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"0\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t`fmt`\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tpos := 0\n\tneg := 0\n\tfor i := 0; i < n; i++ {\n\t\tx := 0\n\t\tfmt.Scan(&x)\n\t\tif x > 0 {\n\t\t\tpos += 1\n\t\t}\n\t\tif x < 0 {\n\t\t\tneg += 1\n\t\t}\n\t}\n\tif float64(neg) >= float64(n) / 2 {\n\t\tfmt.Println(-1)\n\t} else if float64(pos) >= float64(n) / 2. {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int = 0;\n fmt.Scan(&n);\n var plus, minus, zero int = 0,0,0;\n for n > 0 {\n var x int = 0;\n fmt.Scan(&x);\n if (x < 0) {\n minus++;\n } else if (x > 0) {\n plus++;\n } else {\n zero++;\n }\n n--;\n }\n if (plus > minus + zero) {\n fmt.Println(1);\n } else if (minus > plus + zero) {\n fmt.Println(-1);\n } else {\n fmt.Println(0);\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar n, tmp, neg, zer, pos int\n\n\n\tfmt.Scan(&n)\n\n\tfor i := 0 ; i < n ; i++ {\n\t\tfmt.Scan(&tmp)\n\n\t\tswitch {\n\t\tcase tmp < 0:\n\t\t\tneg++\n\t\tcase tmp == 0:\n\t\t\tzer++\n\t\tcase tmp > 0:\n\t\t\tpos++\n\t\t}\n\t}\n\n\tif pos >= n/2 {\n\t\tfmt.Println(1)\n\t} else if neg >= n/2 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solve() {\n var n int\n fmt.Scanf(\"%d\", &n)\n po := 0\n ne := 0\n for i := 0; i < n; i++ {\n var d int\n fmt.Scanf(\"%d\", &d)\n if d > 0 {\n po++\n } else if d < 0 {\n ne++\n }\n }\n if po >= (n + 1) / 2 {\n fmt.Println(\"1\")\n } else if ne >= (n + 1) / 2 {\n fmt.Println(\"-1\")\n } else {\n fmt.Println(0)\n }\n}\n\n\nfunc main() {\n solve()\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solve() {\n var n int\n fmt.Scanf(\"%d\", &n)\n po := 0\n ne := 0\n for i := 0; i < n; i++ {\n var d int\n fmt.Scanf(\"%d\", &d)\n if d > 0 {\n po++\n } else if d < 0 {\n ne++\n }\n }\n fmt.Printf(\"%d %d %d\\n\", po, ne, (n + 1) / 2)\n if po >= (n + 1) / 2 {\n fmt.Println(\"1\")\n } else if ne >= (n + 1) / 2 {\n fmt.Println(\"-1\")\n } else {\n fmt.Println(0)\n }\n}\n\n\nfunc main() {\n solve()\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solve() {\n var n int\n fmt.Scanf(\"%d\", &n)\n po := 0\n ne := 0\n for i := 0; i < n; i++ {\n var d int\n fmt.Scanf(\"%d\", &d)\n fmt.Printf(\"%d\\n\", d)\n if d > 0 {\n po++\n } else if d < 0 {\n ne++\n }\n }\n fmt.Printf(\"%d %d %d\\n\", po, ne, (n + 1) / 2)\n if po >= (n + 1) / 2 {\n fmt.Println(\"1\")\n } else if ne >= (n + 1) / 2 {\n fmt.Println(\"-1\")\n } else {\n fmt.Println(0)\n }\n}\n\n\nfunc main() {\n solve()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar n int\n\tvar x int\n\ta := make([]int,0)\n\tfmt.Fscanln(in,&n)\n\tps := 0\n\tfor i := 0 ;i < n ;i++{\n\t\tfmt.Fscan(in,&x)\n\t\ta = append(a,x)\n\t\tif(x >= 1){\n\t\t\tps ++\n\t\t}\n\t}\n\tif(ps >= (n + 1) / 2){\n\t\tfmt.Fprint(out,1)\n\t}else{\n\t\tfmt.Fprint(out,0)\n\t}\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, x, y int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tif a < 0 {\n\t\t\tx++\n\t\t} else if a > 0 {\n\t\t\ty++\n\t\t}\n\t}\n\tif x >= (n / 2) {\n\t\tfmt.Println(\"-1\")\n\t} else if y >= (n / 2) {\n\t\tfmt.Println(\"1\")\n\t} else {\n\t\tfmt.Println(\"0\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, x, y int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tif a < 0 {\n\t\t\tx++\n\t\t} else if a > 0 {\n\t\t\ty++\n\t\t}\n\t}\n\tif x > (n / 2) {\n\t\tfmt.Println(\"-1\")\n\t} else if y > (n / 2) {\n\t\tfmt.Println(\"1\")\n\t} else {\n\t\tfmt.Println(\"0\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d %d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\\n\", &a[i])\n\t}\n\tneed := n/2 + n%2\n\tfor j := -1000; j <= 1000; j++ {\n\t\tif j != 0 {\n\t\t\tcur := float64(0)\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif float64(a[i])/float64(j) > 0 {\n\t\t\t\t\tcur += float64(a[i]) / float64(j)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif cur >= float64(need) {\n\t\t\t\tfmt.Fprintf(out, \"%d\\n\", j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", 0)\n\treturn\n}\n\nfunc recover(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\tif len(s)%2 == 0 {\n\t\treturn recover(s[:len(s)-1]) + string(s[len(s)-1])\n\t} else {\n\t\treturn recover(s[1:]) + string(s[0])\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\", &a[i])\n\t}\n\tfmt.Fscanf(in, \"\\n\")\n\tneed := n/2 + n%2\n\tfor j := -1000; j <= 1000; j++ {\n\t\tif j != 0 {\n\t\t\tcur := float64(0)\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif float64(a[i])/float64(j) > 0 {\n\t\t\t\t\tcur += float64(a[i]) / float64(j)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif cur >= float64(need) {\n\t\t\t\tfmt.Fprintf(out, \"%d\\n\", j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", 0)\n\treturn\n}\n\nfunc recover(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\tif len(s)%2 == 0 {\n\t\treturn recover(s[:len(s)-1]) + string(s[len(s)-1])\n\t} else {\n\t\treturn recover(s[1:]) + string(s[0])\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tn := 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(in, \"%d\\n\", &a[i])\n\t}\n\tneed := n/2 + n%2\n\tfor j := -1000; j <= 1000; j++ {\n\t\tif j != 0 {\n\t\t\tcur := float64(0)\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif float64(a[i])/float64(j) > 0 {\n\t\t\t\t\tcur += float64(a[i]) / float64(j)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif cur >= float64(need) {\n\t\t\t\tfmt.Fprintf(out, \"%d\\n\", j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(out, \"%d\\n\", 0)\n\treturn\n}\n\nfunc recover(s string) string {\n\tif len(s) == 1 {\n\t\treturn s\n\t}\n\tif len(s)%2 == 0 {\n\t\treturn recover(s[:len(s)-1]) + string(s[len(s)-1])\n\t} else {\n\t\treturn recover(s[1:]) + string(s[0])\n\t}\n}\n"}, {"source_code": "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\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\tvar pos, neg, zero int\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tzero++\n\t\t} else if v < 0 {\n\t\t\tneg++\n\t\t} else {\n\t\t\tpos++\n\t\t}\n\t}\n\tm := n / 2\n\tif n%2 != 0 {\n\t\tm++\n\t}\n\tif m <= zero {\n\t\tprintln(0)\n\t} else if m <= pos {\n\t\tprintln(1)\n\t} else if m <= neg {\n\t\tprintln(-1)\n\t} else {\n\t\tprintln(0)\n\t}\n}\n"}, {"source_code": "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\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\tvar pos, neg, zero int\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tzero++\n\t\t} else if v < 0 {\n\t\t\tneg++\n\t\t} else {\n\t\t\tpos++\n\t\t}\n\t}\n\tm := n / 2\n\tif n%2 != 0 {\n\t\tm++\n\t}\n\tif m <= zero {\n\t\tprintln(0)\n\t} else if m <= pos {\n\t\tprintln(1)\n\t} else {\n\t\tprintln(-1)\n\t}\n}\n"}, {"source_code": "// http://codeforces.com/problemset/problem/1130/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strings\"\n\t\"os\"\n\t\"math\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar inputs int\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tinputs, _ = strconv.Atoi(scanner.Text())\n\tscanner.Scan()\n\tline := scanner.Text()\n\tvar zeros int = 0\n\tvar positives int = 0\n\tvar negatives int = 0\n\tfor _, num := range strings.Split(line, \" \") {\n\t\tif num == \"0\" {\n\t\t\tzeros++\n\t\t} else if strings.Count(num, \"-\") == 1 {\n\t\t\tnegatives++\n\t\t} else {\n\t\t\tpositives++\n\t\t}\n\t}\n\tc := math.Ceil(float64(inputs)/2)\n\tif float64(zeros) >= c {\n\t\tfmt.Printf(\"0\")\n\t} else if float64(negatives) >= c {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"1\")\n\t}\n}"}, {"source_code": "// http://codeforces.com/problemset/problem/1130/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"strings\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar inputs int\n\tfmt.Scanf(\"%d\\n\", &inputs)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tline := scanner.Text()\n\tvar zeros int = 0\n\tvar positives int = 0\n\tvar negatives int = 0\n\tfor _, num := range strings.Split(line, \" \") {\n\t\tif num == \"0\" {\n\t\t\tzeros++\n\t\t} else if strings.Count(num, \"-\") == 1 {\n\t\t\tnegatives++\n\t\t} else {\n\t\t\tpositives++\n\t\t}\n\t}\n\tif zeros >= inputs {\n\t\tfmt.Printf(\"0\")\n\t} else if negatives >= inputs {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"1\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t`bufio`\n\t`fmt`\n\t`os`\n)\n\nfunc main() {\n\tbuf := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscanf(buf, \"%d\", &n)\n\tpos := 0\n\tneg := 0\n\tfor i := 0; i < n; i++ {\n\t\tx := 0\n\t\tfmt.Fscanf(buf, \"%d\", &x)\n\t\tif x > 0 {\n\t\t\tpos += 1\n\t\t}\n\t\tif x < 0 {\n\t\t\tneg += 1\n\t\t}\n\t}\n\tif neg >= n / 2 {\n\t\tfmt.Println(-1)\n\t} else if pos >= n / 2 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(0)\n\t}\n}\n"}, {"source_code": "\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc readLine()(string,error) \t\t\t{ return reader.ReadString('\\n') }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n int\n\tscanf(\"%d\\n\", &n)\n\tk := n/2 + n%2\n\ta := make([]int,n)\n\tfor i := 0; i < n; i++ {\n\t\tscanf(\"%d\", &a[i])\n\t}\n\tfor i := -1000; i <= 1000; i++ {\n\t\tif (i != 0){\n\t\t\tx := 0\n\t\t\tfor _, j := range a {\n\t\t\t\tif (((i > 0 && j > 0) || (i < 0 && j < 0)) && j%i != 0) {\n\t\t\t\t\tx++\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x == k {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(0)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scanf(\"%d\", &n)\n\n pos := 0\n neg := 0\n for i := 0; i < n; i++ {\n var nmb int\n fmt.Scanf(\"%d\", &nmb)\n if nmb > 0 {\n pos++\n }\n if nmb < 0 {\n neg++\n }\n }\n\n if neg < (n + 1) / 2 && pos < (n + 1) / 2 {\n fmt.Println(0)\n } else if neg >= (n + 1) / 2 {\n fmt.Println(-1)\n } else if pos >= (n + 1) / 2 {\n fmt.Println(1)\n }\n\n}\n"}], "src_uid": "a13cb35197f896cd34614c6c0b369a49"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d [3]int\n\tfmt.Scan(&d[0], &d[1], &d[2])\n\n\tid := 0\n\tsum := d[0]\n\tfor i := 1; i < 3; i++ {\n\t\tif d[id] < d[i] {\n\t\t\tid = i\n\t\t}\n\t\tsum += d[i]\n\t}\n\n\tl := 0\n\tif 2*d[id] > sum {\n\t\tl = 2 * (sum - d[id])\n\t} else {\n\t\tl = sum\n\t}\n\n\tfmt.Println(l)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar writer *bufio.Writer\nvar scanner *bufio.Scanner\n\ntype MySlice [][2]int\n\nfunc (slice MySlice) Len() int { return len(slice) }\nfunc (slice MySlice) Less(i, j int) bool { return slice[i][1] < slice[j][1] }\nfunc (slice MySlice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\nfunc main() {\n\tini()\n\tdefer writer.Flush()\n\n\td1 := scanInt()\n\td2 := scanInt()\n\td3 := scanInt()\n\n\tresult := min(d1 + d2 + d3, min(2 * (d1 + d2), min(2 * (d2 + d3), 2 * (d1 + d3))))\n\twriter.WriteString(strconv.Itoa(result))\n\n\treturn\n}\n\nfunc binSearch(a []int, key int) int {\n\tl := -1\n\tr := len(a)\n\tfor l < r-1 {\n\t\tm := (l + r) / 2\n\t\tif a[m] < key {\n\t\t\tl = m\n\t\t} else {\n\t\t\tr = m\n\t\t}\n\t}\n\n\tif a[r] != key {\n\t\treturn -1\n\t}\n\n\treturn r\n}\n\nfunc ini() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc min(a int, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ti, _ := strconv.Atoi(scanner.Text())\n\treturn i\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tfmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\n\tret := min(d1 + min(d1 + 2 * d2, d3 + min(d2, d3 + d1)),\n\t\t\t d2 + min(d2 + 2 * d1, d3 + min(d1, d3 + d2)))\n\tfmt.Printf(\"%d\", ret)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &d1, &d2, &d3)\n\td1, d2, d3 = sorta(d1, d2, d3)\n\tif d1+d2 < d3 {\n\t\tfmt.Println((d1 + d2) * 2)\n\t} else {\n\t\tfmt.Println(d1 + d2 + d3)\n\t}\n}\n\nfunc sorta(a, b, c int) (int, int, int) {\n\taa := make([]int, 0)\n\taa = append(aa, a)\n\taa = append(aa, b)\n\taa = append(aa, c)\n\tsort.Slice(aa, func(i, j int) bool {\n\t\treturn aa[i] < aa[j]\n\t})\n\treturn aa[0], aa[1], aa[2]\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\td := []int{0, 0, 0}\n\tfmt.Scanf(\"%d %d %d \\n\", &d[0], &d[1], &d[2])\n\tsort.Ints(d)\n\tr := d[0] + d[1] + min(d[2], d[0]+d[1])\n\tfmt.Print(r)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a ...int) int {\n r := a[0]\n for _, v := range a {\n if r > v {\n r = v\n }\n }\n return r\n}\n\nfunc main() {\n // \u603b\u51714\u79cd\u60c5\u51b5\uff0c\u6c42\u4e2amin\u5c31\u884c\u4e86\u3002\n var d1, d2, d3 int\n fmt.Scanf(\"%d %d %d\", &d1, &d2, &d3);\n result := min(d1+d2+d3, 2*(d1+d2), 2*(d1+d3), 2*(d2+d3))\n fmt.Println(result)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d1, d2, d3, s uint32\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &d1, &d2, &d3)\n\tif d1 <= d2 {\n\t\tif d1+d1+d2+d2 <= d1+d3+d2 && d1+d1+d2+d2 <= d1+d3+d3+d1 {\n\t\t\ts += d1 + d1 + d2 + d2\n\t\t} else if d1+d3+d2 <= d1+d1+d2+d2 && d1+d3+d2 <= d1+d3+d3+d1 {\n\t\t\ts += d1 + d3 + d2\n\t\t} else {\n\t\t\ts += d1 + d3 + d3 + d1\n\t\t}\n\t} else {\n\t\tif d2+d2+d1+d1 <= d2+d3+d1 && d2+d2+d1+d1 <= d2+d3+d3+d2 {\n\t\t\ts += d2 + d2 + d1 + d1\n\t\t} else if d2+d3+d1 <= d2+d2+d1+d1 && d2+d3+d1 <= d2+d3+d3+d2 {\n\t\t\ts += d2 + d3 + d1\n\t\t} else {\n\t\t\ts += d2 + d3 + d3 + d2\n\t\t}\n\t}\n\tfmt.Println(s)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar d1, d2, d3 int\n\t_, err := fmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif d1+d3 < d2 {\n\t\tfmt.Println(2 * (d1 + d3))\n\t\treturn\n\t} else if d2+d3 < d1 {\n\t\tfmt.Println(2 * (d2 + d3))\n\t\treturn\n\t}\n\tfmt.Println(min(2*d1+2*d2, d1+d2+d3))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d [3]int\n\tfmt.Fscanln(os.Stdin, &d[0], &d[1], &d[2])\n\n\tvar s [4]int\n\ts[0] = 2 * (d[0] + d[1])\n\ts[1] = 2 * (d[1] + d[2])\n\ts[2] = 2 * (d[0] + d[2])\n\ts[3] = d[1] + d[2] + d[0]\n\n\tmin := s[0]\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] < min {\n\t\t\tmin = s[i]\n\t\t}\n\t}\n\n\tfmt.Println(min)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tfmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\n\tdis := []int{\n\t\td1 + d2 + d3,\n\t\t2*d1 + 2*d2,\n\t\t2*d1 + 2*d3,\n\t\t2*d2 + 2*d3,\n\t}\n\n\tans := int(2e9)\n\tfor _, d := range dis {\n\t\tif ans > d {\n\t\t\tans = d\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar d1, d2, d3 int\n\tfmt.Scanf(\"%d%d%d\", &d1, &d2, &d3)\n\ts := d1+d2+d3\n\tt := 2*(d1+d3)\n\tif s > t{\n\t\ts = t\n\t}\n\tt = 2*(d2+d3)\n\tif s > t{\n\t\ts = t\n\t}\n\tt = 2*(d1+d2)\n\tif s > t{\n\t\ts = t\n\t}\n\tfmt.Printf(\"%d\\n\", s)\n}\n"}, {"source_code": "package main;\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c int\n fmt.Scanf(\"%d%d%d\", &a, &b, &c)\n dis := []int{\n a + b + c,\n 2 * a + 2 * b,\n 2 * a + 2 * c,\n 2 * b + 2 * c,\n }\n \n ans := 0x3f3f3f3f\n for _, value := range dis {\n if value < ans {\n ans = value\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc min(x, y uint) uint {\n if x < y {\n return x\n }\n return y\n}\n\nfunc main() {\n var d1, d2, d3 uint\n fmt.Scan(&d1, &d2, &d3)\n\n dis1 := d1 + d2 + d3\n dis2 := 2*d1 + 2*d2\n dist := min(dis1, dis2)\n dis3 := 2*d2 + 2*d3\n dist = min(dist, dis3)\n dis4 := 2*d1 + 2*d3\n dist = min(dist, dis4)\n\n fmt.Println(dist)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &d1, &d2, &d3)\n\tif d1+d2 < d3 {\n\t\tfmt.Println((d1 + d2) * 2)\n\t} else {\n\t\tfmt.Println(d1 + d2 + d3)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d [3]int\n\tfmt.Scan(&d[0], &d[1], &d[2])\n\n\tid := 0\n\tsum := d[0]\n\tfor i := 1; i < 3; i++ {\n\t\tif d[id] < d[i] {\n\t\t\tid = i\n\t\t}\n\t\tsum += d[i]\n\t}\n\n\tl := 0\n\tif 3*d[id] > 2*sum {\n\t\tl = 2 * (sum - d[id])\n\t} else {\n\t\tl = sum\n\t}\n\n\tfmt.Println(l)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d1, d2 ,d3, s uint16\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &d1,&d2, &d3)\n\tif d1 > d2 && d1 > d3{\n\t\ts += d2 * 2\n\t\ts += d3 * 2\n\t}else if d2 > d1 && d2 > d3{\n\t\ts += d1 * 2\n\t\ts += d3 * 2\n\t}else if d3 > d1 && d3 > d2{\n\t\ts += d1 * 2\n\t\ts += d2 * 2\n\t}else{\n\t\tif d2 >= d3{\n\t\t\ts += d1 * 2\n\t\t\ts += d2 * 2\n\t\t}\n\t}\n\tfmt.Println(s)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar d1, d2, d3 int\n\t_, err := fmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(min(2*d1+2*d2, d1+d2+d3))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d [3]int\n\tfmt.Fscanln(os.Stdin, &d[0], &d[1], &d[2])\n\n\tif d[0]+d[1]+d[2] <= 2*(d[0]+d[1]) {\n\t\tfmt.Println(d[0] + d[1] + d[2])\n\t} else {\n\t\tfmt.Println(2 * (d[0] + d[1]))\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar d [3]int\n\tfmt.Fscanln(os.Stdin, &d[0], &d[1], &d[2])\n\n\tif d[0]+d[1]+d[2] < 2*(d[0]+d[1]) {\n\t\tfmt.Println(d[0] + d[1] + d[2])\n\t} else {\n\t\tfmt.Println(2 * (d[0] + d[1]))\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tfmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\n\tif d1*2+d2*2 < d1+d2+d3 {\n\t\tfmt.Println(d1*2 + d2*2)\n\t} else {\n\t\tfmt.Println(d1 + d2 + d3)\n\t}\n}\n"}, {"source_code": "package main;\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b, c int\n fmt.Scanf(\"%d%d%d\", &a, &b, &c)\n x := 2 * a + 2 * b\n y := a + b + c\n if x < y {\n fmt.Println(x)\n } else {\n fmt.Println(y)\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar d1, d2, d3 int\n\tfmt.Scanf(\"%d %d %d\", &d1, &d2, &d3)\n\n\tret := min(d1 + min(d1 + 2 * d2, d3 + d2),\n\t\t\t d2 + min(d2 + 2 * d1, d3 + d1))\n\tfmt.Printf(\"%d\", ret)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar writer *bufio.Writer\nvar scanner *bufio.Scanner\n\ntype MySlice [][2]int\n\nfunc (slice MySlice) Len() int { return len(slice) }\nfunc (slice MySlice) Less(i, j int) bool { return slice[i][1] < slice[j][1] }\nfunc (slice MySlice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\nfunc main() {\n\tini()\n\tdefer writer.Flush()\n\n\td1 := scanInt()\n\td2 := scanInt()\n\td3 := scanInt()\n\n\tif d3+d2+d1 < 2*(d1+d2) {\n\t\twriter.WriteString(strconv.Itoa(d3 + d2 + d1))\n\t} else {\n\t\twriter.WriteString(strconv.Itoa(2 * (d1 + d2)))\n\t}\n\n\treturn\n}\n\nfunc binSearch(a []int, key int) int {\n\tl := -1\n\tr := len(a)\n\tfor l < r-1 {\n\t\tm := (l + r) / 2\n\t\tif a[m] < key {\n\t\t\tl = m\n\t\t} else {\n\t\t\tr = m\n\t\t}\n\t}\n\n\tif a[r] != key {\n\t\treturn -1\n\t}\n\n\treturn r\n}\n\nfunc ini() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc scanInt() int {\n\tscanner.Scan()\n\ti, _ := strconv.Atoi(scanner.Text())\n\treturn i\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n"}], "src_uid": "26cd7954a21866dbb2824d725473673e"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n h := \"hello\"\n var s string\n fmt.Scan(&s)\n in := 0\n for i := 0; (i < len(s)) && (in < 5); i++ {\n if s[i] == h[in] { in++ }\n }\n if in == 5 { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\thello := \"hello\"\n\tfmt.Scan(&s)\n\tfor i := range s {\n\t\tif s[i] == hello[0] {\n\t\t\thello = hello[1:]\n\t\t\tif len(hello) == 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar w, res string\n\tfmt.Scanln(&w)\n\tfor _, y := range w {\n\t\tswitch string(y) {\n\t\tcase \"h\":\n\t\t\tif res == \"\" {\n\t\t\t\tres = \"h\"\n\t\t\t}\n\t\tcase \"e\":\n\t\t\tif res == \"h\" {\n\t\t\t\tres = \"he\"\n\t\t\t}\n\t\tcase \"l\":\n\t\t\tif res == \"he\" {\n\t\t\t\tres = \"hel\"\n\t\t\t} else if res == \"hel\" {\n\t\t\t\tres = \"hell\"\n\t\t\t}\n\t\tcase \"o\":\n\t\t\tif res == \"hell\" {\n\t\t\t\tres = \"hello\"\n\t\t\t}\n\n\t\t}\n\t}\n\n\tif res == \"hello\" {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar istring string\n\t_, _ = fmt.Scan(&istring)\n\tvar check = []string{\"h\",\"e\",\"l\",\"l\",\"o\"}\n\tj:=0\n\tcount :=0\n\ttemp := strings.Split(istring,\"\")\n\tfor i:=0; i= 0 && index4 >= 0 && index3 >= 0 && index2 >= 0 && index1 >= 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar palabra string\n\n\thelloArray := []string{\"h\",\"e\",\"l\",\"l\",\"o\"}\n\thello := make(map[string]bool)\n\n\tfor _, item := range helloArray{\n\t\thello[item] = false\n\t}\n\n\tfmt.Scanln(&palabra)\n\tstrings.Split(\"\", palabra)\n\n\tindexCounter := 0\n\n\tfor i := 0; i < len(palabra); i++{\n\t\tif indexCounter < len(helloArray) {\n\t\t\tif string(palabra[i]) == helloArray[indexCounter] {\n\t\t\t\thello[helloArray[indexCounter]] = true\n\n\t\t\t\tindexCounter++\n\t\t\t}\n\t\t}else{\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor _, item := range helloArray{\n\t\t//fmt.Println(item, hello[item])\n\n\t\tif hello[item] == false{\n\t\t\tfmt.Println(\"NO\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport (\n\"fmt\"\n)\n\nfunc main() {\n\tvar inp,hello string\n\thello = \"hello\"\n\tfmt.Scan(&inp)\n\tit := 0\n\tfor i:=0;i 0 && len(word) > 0 {\n\t\tfirst, wanted = string(wanted[0]), wanted[1:]\n\t\tindex := strings.Index(word, first)\n\t\tif index == -1 {\n\t\t\treturn false\n\t\t}\n\t\tword = word[index+1:]\n\t}\n\treturn len(wanted) == 0\n}\n\nfunc main() {\n\tvar word string\n\n\twanted := \"hello\"\n\n\tfmt.Scan(&word)\n\tif find(wanted, word) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n h, e, l1, l2, o := false, false, false, false, false\n fmt.Scan(&s)\n for _,val := range s {\n switch ue := string(val); {\n case ue==\"h\":\n h = true\n case ue==\"e\"&&h:\n e = true\n case ue==\"l\"&&!l1&&h&&e:\n l1 = true\n case ue==\"l\"&&l1&&h&&e:\n l2 = true\n case ue==\"o\"&&h&&e&&l1&&l2:\n o = true\n }\n }\n if h && e && l1 && l2 && o {\n fmt.Print(\"YES\")\n } else {\n fmt.Print(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// INPUT\n// ahhellllloou -> YES\n// hlelo -> NO\n// helhcludoo -> YES\n// pnnepelqomhhheollvlo -> YES\n\nfunc main() {\n\tvar word, greeting string\n\tvar greetingPos int\n\tgreeting = \"hello\"\n\n\tfmt.Scanf(\"%v\", &word)\n\n\tfor pos, char := range word {\n\t\tif greetingPos > 4 {\n\t\t\tbreak\n\t\t}\n\n\t\tif greeting[greetingPos] == word[pos] {\n\t\t\tif char == 'h' {\n\t\t\t\tgreetingPos = 0\n\t\t\t}\n\t\t\tgreetingPos++\n\t\t}\n\t}\n\n\tif greetingPos == 5 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar st string\n\tfmt.Scan(&st)\n\thello := \"hello\"\n\tcur := 0\n\tfor i := 0; cur < len(hello) && i < len(st); i++ {\n\t\tif st[i] == hello[cur] {\n\t\t\tcur++\n\t\t}\n\t}\n\tif cur == len(hello) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar st string\n\tfmt.Scan(&st)\n\tif contain(st, \"hello\") {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc contain(st string, pattern string) bool {\n\tif pattern == \"\" {\n\t\treturn true\n\t}\n\ti := strings.IndexByte(st, pattern[0])\n\tif i == -1 {\n\t\treturn false\n\t}\n\treturn contain(st[i+1:], pattern[1:])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc isOk(s string) bool {\n\tpattern := \"hello\"\n\ti := 0\n\t//j := 0\n\tfor si, _ := range s {\n\t\tif s[si] == pattern[i] {\n\t\t\ti++\n\t\t}\n\t\tif i >= len(pattern) {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn i == len(pattern)\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scanf(\"%s\", &str)\n\tif isOk(str) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar str string\n\tfmt.Scan(&str)\n\n\thello := \"hello\"\n\tj := 0\n\n\tfor i := 0; i < len(str) && j < len(hello); i++ {\n\t\tif str[i] == hello[j] {\n\t\t\tj++\n\t\t}\n\t}\n\n\tif j == len(hello) {\n\t\tfmt.Print(\"YES\")\n\t\treturn\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc foo(s string) bool {\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i + 1; j < len(s); j++ {\n\t\t\tfor k := j + 1; k < len(s); k++ {\n\t\t\t\tfor l := k + 1; l < len(s); l++ {\n\t\t\t\t\tfor m := l + 1; m < len(s); m++ {\n\t\t\t\t\t\tif s[i] == 'h' && s[j] == 'e' && s[k] == 'l' && s[l] == 'l' && s[m] == 'o' {\n\t\t\t\t\t\t\treturn true\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\treturn false\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif foo(s) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s, target string = \"\", \"hello\"\n\tfmt.Scan(&s)\n\tvar j int\n\tfor i := range s {\n\t\tif s[i] == target[j] {\n\t\t\tj++\n\t\t} \n\t\tif j == 5 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\tbreak\n\t\t}\n\t}\n\tif j != 5 {\n\t\tfmt.Print(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nvar (\n\thi = []string{\"h\", \"e\", \"l\", \"l\", \"o\"}\n)\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tcounter int\n\t\tlength = len(hi)\n\t)\n\tif _, err := fmt.Scanf(\"%s\\n\", &s); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfor i := range s {\n\t\tif s[i:i+1] == hi[counter] {\n\t\t\tcounter++\n\t\t\tif counter == length {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\thello := []byte(\"hello\")\n\n\tvar input string\n\n\t_, _ = fmt.Scanln(&input)\n\n\tbyteinput := []byte(input)\n\n\tpos := 0\n\n\tfor i := 0; i < len(byteinput); i ++ {\n\t\tif pos >= len(hello) {\n\t\t\tbreak;\n\t\t}\n\t\tif byteinput[i] == hello[pos] {\n\t\t\tpos ++\n\t\t}\n\t}\n\n\tif pos >= len(hello) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ts, _ := reader.ReadString('\\n')\n\tgoal := \"hello\"\n\tstate := 0\n\tfor i := 0; i < len(s)-1; i++ { //-1 newline\n\t\tif state == len(goal) { // early break\n\t\t\tbreak\n\t\t}\n\n\t\tif s[i] == goal[state] {\n\t\t\tstate++\n\t\t}\n\t}\n\n\tif state == len(goal) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar scanner *bufio.Scanner\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tif err := scanner.Err(); err == nil {\n\t\tif regexp.MustCompile(\"\\\\w*h\\\\w*e\\\\w*l\\\\w*l\\\\w*o\\\\w*\").MatchString(scanner.Text()) {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar scanner *bufio.Scanner\n\tvar line string\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tif scanner.Scan() {\n\t\tline = scanner.Text()\n\t\tif managed(line) {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n\nfunc managed(message string) bool {\n\tvar hello = []rune(\"hello\")\n\n\tfor _, letter := range message {\n\t\tif len(hello) == 0 {\n\t\t\treturn true\n\t\t}\n\t\tif letter == hello[0] {\n\t\t\thello = hello[1:]\n\t\t}\n\t}\n\n\tif len(hello) == 0 {\n\t\treturn true\n\t}\n\n\treturn false\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\n\tvar str, pat string\n\n\tfmt.Fscan(in, &str)\n\tpat = `h.*e.*l.*l.*o`\n\n\tmatched, _ := regexp.MatchString(pat, str)\n\tif matched {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar v1 int\n\n\tfor _, b := range inp.a {\n\t\ts := string(b)\n\t\tif v1 == 0 && s == \"h\" {\n\t\t\tv1++\n\t\t}\n\n\t\tif v1 == 1 && s == \"e\" {\n\t\t\tv1++\n\t\t}\n\t\tif (v1 == 2 || v1 == 3) && s == \"l\" {\n\t\t\tv1++\n\n\t\t}\n\n\t\tif v1 == 4 && s == \"o\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\n\t\t}\n\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"regexp\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\tif regexp.MustCompile(`.*h.*e.*l.*l.*o.*`).MatchString(inp.a){\n\t fmt.Println(\"YES\")\n\t} else{\n\t fmt.Println(\"NO\")\n\t}\n\t\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n h := \"hello\"\n var s string\n fmt.Scan(&s)\n in := 0\n for i := 0; (i < len(s)) && (in < 5); i++ {\n if s[i] == h[in] { in++ }\n }\n if in == 5 { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfor _, r := range \"hello\" {\n\t\ti := strings.Index(s, string(r))\n\t\tif i == -1 {\n\t\t\tfmt.Printf(\"NO\")\n\t\t\treturn\n\t\t}\n\t\tif i != len(s)-1 {\n\t\t\ts = s[i+1:]\n\t\t}\n\t}\n\tfmt.Printf(\"YES\")\n}\n"}, {"source_code": "/* https://codeforces.com/problemset/problem/58/A\nA. Chat room\ntime limit per test1 second\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nVasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.\n\nInput\nThe first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.\n\nOutput\nIf Vasya managed to say hello, print \"YES\", otherwise print \"NO\".\n\nExamples\ninputCopy\nahhellllloou\noutputCopy\nYES\ninputCopy\nhlelo\noutputCopy\nNO\n*/\n\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar hello_index int\n\tvar input_string string\n\thello := []rune(\"hello\")\n\tfmt.Scanln(&input_string)\n\tfor _, letter := range input_string {\n\t\tif letter == hello[hello_index] {\n\t\t\thello_index++\n\t\t\tif hello_index == 5 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar h byte\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanRunes)\n\tfor scanner.Scan() {\n\t\tl := scanner.Text()\n\t\tswitch {\n\t\tcase l == \"h\" && h == 0: // 0b00000\n\t\t\th = 32 // 0b10000\n\t\tcase l == \"e\" && h == 32: // 0b10000\n\t\t\th = 48 // 0b11000\n\t\tcase l == \"l\" && h == 48: // 0b11000\n\t\t\th = 56 // 0b11100\n\t\tcase l == \"l\" && h == 56: // 0b11100\n\t\t\th = 60 // 0b11110\n\t\tcase l == \"o\" && h == 60: // 0b11110\n\t\t\th = 62 // 0b11111\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif h == 62 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x string\n\tvar ref string = \"hello\"\n\t_, _ = fmt.Scan(&x)\n\tref_index:= 0;\n\tfor _, char := range(x) {\n\t\tif uint8(char) == ref[ref_index] {\n\t\t\tref_index++\n\t\t\tif ref_index == 5 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif ref_index == 5 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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\nfunc main() {\n\tdefer writer.Flush()\n\n\tvar s string\n\tscanf(\"%s\\n\", &s)\n\th := \"hello\"\n\tj := 0\n\ti := 0\n\tfor i < len(s) && j < len(h) {\n\n\t\tif s[i] == h[j] {\n\t\t\tj++\n\t\t}\n\t\ti++\n\t}\n\tif j == len(h) {\n\t\tprintf(\"YES\\n\")\n\t} else {\n\t\tprintf(\"NO\\n\")\n\t}\n}\n"}, {"source_code": "/*\nChat room\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nVasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.\n\nInput\nThe first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.\n\nOutput\nIf Vasya managed to say hello, print \"YES\", otherwise print \"NO\".\n\nSample test(s)\ninput\nahhellllloou\noutput\nYES\ninput\nhlelo\noutput\nNO\n*/\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tS string\n\t\thello = []rune(\"hello\")\n\t)\n\tfmt.Scanf(\"%s\", &S)\n\ts := []rune(S)\n\tlens := len(s)\n\tlenHello := len(hello)\n\tif lens < lenHello {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tvar i, j int\n\tfor ; i < lenHello; {\n\t\tfor ; j < lens; j++ {\n\t\t\tif s[j] == hello[i] {\n\t\t\t\ti++\n\t\t\t\tj++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif j >= lens {\n\t\t\tbreak\n\t\t}\n\t}\n\tif i == lenHello {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\thello := \"hello\"\n\tvar message string\n\tfmt.Scan(&message)\n\tvar offset int\n\tfor _, character := range message {\n\t\tif character == rune(hello[offset]) {\n\t\t\toffset += 1\n\t\t}\n\n\t\tif offset == len(hello) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main () {\n var n string\n h:=\"hello\"\n a:=\"NO\"\n fmt.Scan(&n)\n ph:=0\n for i:=0;i= cont[flag] {\n\t\t\t\thitNum = 0\n\t\t\t\tflag += 1\n\t\t\t}\n\t\t}\n\n\t\tif flag >= len(c) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\nvar r *bufio.Reader = bufio.NewReader(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc print( a ...interface{}) { fmt.Fprint(w, a...) }\nfunc scan( a ...interface{}) { fmt.Fscan(r, a...) }\n\nfunc main() {\n\tdefer w.Flush()\n\t\n\tvar a string\n\tfmt.Scan(&a)\n\n\tvar h = \"hello\"\n\tvar index = 0\n\tfor i := 0; i < len(a) && index < 5; i++{\n\t\tif h[index] == a[i] {\n\t\t\tindex++\n\t\t}\n\t}\n\tif index >= 5 {\n\t\tprint(\"YES\")\n\t}else {\n\t\tprint(\"NO\")\n\t}\n}\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar s string\n\nfunc main() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader := bufio.NewReaderSize(stdin, 1<<20)\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\n\tcnt := \"hello\"\n\tans := \"NO\"\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == cnt[0] {\n\t\t\tif len(cnt) == 1 {\n\t\t\t\tans = \"YES\"\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnt = cnt[1:len(cnt)]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tpos := strings.Index(s, \"h\")\n\tif pos == -1 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\ts = s[pos+1:]\n\tpos = strings.Index(s, \"e\")\n\tif pos == -1 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\ts = s[pos+1:]\n\tpos = strings.Index(s, \"l\")\n\tif pos == -1 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\ts = s[pos+1:]\n\tpos = strings.Index(s, \"l\")\n\tif pos == -1 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\ts = s[pos+1:]\n\tpos = strings.Index(s, \"o\")\n\tif pos == -1 {\n\t\tfmt.Print(\"NO\")\n\t\treturn\n\t}\n\tfmt.Print(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar line string\n\tfmt.Scan(&line)\n\n\th := \"hello\"\n\tc := 0\n\tfor i := 0; i < len(line); i++ {\n\t\tif line[i] == h[c] {\n\t\t\tc++\n\t\t\tif c == len(h) {\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}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar line string\n\tfmt.Scan(&line)\n\n\tcount := 0\n\tfor _, c := range line {\n\t\tswitch c {\n\t\tcase 'h':\n\t\t\tif count == 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\tcase 'e':\n\t\t\tif count == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\tcase 'l':\n\t\t\tif count == 2 || count == 3 {\n\t\t\t\tcount++\n\t\t\t}\n\t\tcase 'o':\n\t\t\tif count == 4 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tif count == 5 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n h := \"hello\"\n var s string\n fmt.Scan(&s)\n in := 0\n for i := 0; (i < len(s)) && (in < 5); i++ {\n if s[i] == h[in] { in++ }\n }\n if in == 5 { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar hello = \"hello\"\n\tvar s string\n\tfmt.Scan(&s)\n\tidx := 0\n\tfor i := 0; i < len(s) && idx < 5; i ++ {\n\t\tif s[i] == hello[idx] {\n\t\t\tidx ++;\n\t\t}\n\t}\n\tif (idx >= 5) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// ahhellllloou\n\nfunc solve(s string) string {\n\ti := 0\n\tvar seen string = \"\"\n\tfor i < len(s) {\n\t\tif seen == \"\" && s[i] == 'h' {\n\t\t\tseen = \"h\"\n\t\t} else if seen == \"h\" && s[i] == 'e' {\n\t\t\tseen = \"he\"\n\t\t} else if seen == \"he\" && s[i] == 'l' {\n\t\t\tseen = \"hel\"\n\t\t} else if seen == \"hel\" && s[i] == 'l' {\n\t\t\tseen = \"hell\"\n\t\t} else if seen == \"hell\" && s[i] == 'o' {\n\t\t\tseen = \"hello\"\n\t\t\treturn \"YES\"\n\t\t}\n\t\ti++\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tsol := solve(s)\n\tfmt.Println(sol)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\thi := \"hello\"\n\tans := false\n\tj := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == hi[j] {\n\t\t\tj += 1\n\t\t}\n\t\tif j == len(hi) {\n\t\t\tans = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif ans {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n\n var dst string = \"hello\"\n id := 0\n total := len(dst)\n for i := 0; i < len(s) && id < total; i++ {\n if s[i] == dst[id] {\n id++\n }\n }\n\n if id == total {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "// URL: http://codeforces.com/problemset/problem/58/A\n// ~ Basic Implementation Problem\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc isWordIn(w string, s string) string {\n\tif len(w) == 0 {\n\t\treturn \"YES\"\n\t}\n\tif len(s) == 0 {\n\t\treturn \"NO\"\n\t}\n\tif string(w[0]) != string(s[0]) {\n\t\treturn isWordIn(w, s[1:])\n\t} else {\n\t\treturn isWordIn(w[1:], s[1:])\n\t}\n}\n\n\nfunc main() {\n\treader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tfmt.Fprintf(writer, \"%s\\n\", isWordIn(\"hello\", s))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n t := \"hello\"\n ls, lt, i, j := len(s), 5, 0, 0\n for i < ls && j < lt {\n if s[i] == t[j] {\n i ++\n j ++\n } else {\n i ++\n }\n }\n if (j == lt) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport ( \n \"fmt\"\n )\n\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n \n h := \"hello\"\n i := 0\n for _, c := range s {\n if i == len(h) {\n break\n }\n if c == rune(h[i]) {\n i++\n }\n } \n if i == len(h) {\n fmt.Println(\"YES\") \n return\n }\n fmt.Println(\"NO\") \n}"}, {"source_code": "package main\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var word string\n fmt.Scanf(\"%s\", &word)\n\n hello := \"hello\"\n counter := 0\n\n for _, r := range word {\n if counter < len(hello) {\n //fmt.Println(\"r: \",r,\", hello: \", hello[counter])\n if uint8(r) == hello[counter] {\n counter++\n }\n }\n }\n\n switch counter {\n case 5: fmt.Println(\"YES\")\n default: fmt.Println(\"NO\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanRunes)\n\texpected := []rune{'h', 'e', 'l', 'l', 'o'}\n\tfor scanner.Scan() {\n\t\tb := scanner.Text()\n\t\tbr := rune(b[0])\n\t\tif br == expected[0] {\n\t\t\tif len(expected) == 1 {\n\t\t\t\texpected = expected[0:0]\n\t\t\t\tbreak\n\t\t\t}\n\t\t\texpected = expected[1:]\n\t\t}\n\t}\n\tif len(expected) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println((\"NO\"))\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, s2 string\n\tvar tmp int\n\tvar flag bool\n\tfmt.Scanf(\"%s\", &s)\n\tfor i := range s {\n\t\tif tmp == 0 {\n\t\t\tif s[i] == 'h' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 1 {\n\t\t\tif s[i] == 'e' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 2 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 3 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 4 {\n\t\t\tif s[i] == 'o' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t}\n\t\tif tmp == 5 {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tvar tmp int\n\tvar flag bool\n\tfmt.Scanf(\"%s\", &s)\n\tfor i := range s {\n\t\tif tmp == 0 {\n\t\t\tif s[i] == 'h' {\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 1 {\n\t\t\tif s[i] == 'e' {\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 2 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 3 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 4 {\n\t\t\tif s[i] == 'o' {\n\t\t\t\ttmp++\n\t\t\t}\n\t\t}\n\t\tif tmp == 5 {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar str []byte\n\tstr, _, _ = reader.ReadLine()\n\tvar hello []byte = []byte{'h', 'e', 'l', 'l', 'o'}\n\tvar i byte\n\tfor _, v := range str {\n\t\tif v == hello[i] {\n\t\t\ti++\n\t\t\tif i == byte(len(hello)) {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\n//========== Implement Algorithm =======================\nfunc solution(str string) bool {\n\tif len(str) < 5 {\n\t\treturn false\n\t}\n\th := false\n\te := false\n\tl := false\n\to := false\n\tlcount := 0\n\tfor x := 0; x < len(str); x++ {\n\t\tif h && e && l && o {\n\t\t\treturn true\n\t\t}\n\n\t\tif string(str[x]) == \"h\" {\n\t\t\th = true\n\t\t} else if string(str[x]) == \"e\" && h {\n\t\t\te = true\n\t\t} else if string(str[x]) == \"l\" && h && e {\n\t\t\tlcount++\n\t\t\tif lcount == 2 {\n\t\t\t\tl = true\n\t\t\t}\n\n\t\t} else if string(str[x]) == \"o\" && h && e && l {\n\t\t\to = true\n\t\t}\n\t}\n\n\treturn h && e && l && o\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar str string\n\tvar ret bool\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tstr = scanner.Text()\n\t//======================================================\n\tret = solution(str)\n\t//==================== OUTPUT ==========================\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\"fmt\")\n\nfunc main(){\n\tvar line string\n\tb := \"hello\"\n\tscan(&line)\n\tp := 0\n\tfor i := 0; i < len(line); i++{\n\t\tif p < 5 && line[i] == b[p]{p++}\n\t}\n\tif p == 5 {\n\t\tsout(\"YES\")\n\t}else{\n\t\tsout(\"NO\")\n\t}\n}\n\nfunc scan(in ... interface{}){\n\tfor _,k := range in{\n\t\tfmt.Scan(k)\n\t}\n}\n\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k)\n\t}\n\t//fmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\thell := \"hello\"\n\trecovered := 0\n\tfor i := range s {\n\t\tif s[i] == hell[recovered] {\n\t\t\trecovered++\n\t\t}\n\t\tif recovered == 5 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n word := \"hello\"\n var count, l int\n l = 4\n fmt.Scanf(\"%s\", &s)\n\n for i:=0; i < len(s); i++ {\n if (s[i] == word[count]) {\n count++ \n } \n if(count > l) {\n break\n }\n }\n\n if(count > l) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar str string\n\tfmt.Fscanln(reader, &str)\n\tslice := []rune(str)\n\tsym := []rune(\"hello\")\n\tindex := 0\n\tflag := false\n\tfor _, s := range slice {\n\t\tcheck := sym[index]\n\t\tif s == check {\n\t\t\tif index == 4 {\n\t\t\t\tflag = true\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tindex++\n\t\t\t}\n\t\t}\n\t}\n\tif !flag {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts := \"\"\n\tfmt.Scanln(&s)\n\tw := []rune{'h', 'e', 'l', 'l', 'o'}\n\tlenw := len(w)\n\tnext := 0\n\tfor _, c := range s {\n\t\tif next >= lenw {\n\t\t\tbreak\n\t\t}\n\t\tif c == w[next] {\n\t\t\tnext++\n\t\t}\n\t}\n\tif next >= lenw {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\ts, _ := bufio.NewReader(os.Stdin).ReadBytes('\\n')\n\ti, h, ello := 0, byte('h'), []byte(\"ello\")\n\tfor _, b := range s {\n\t\tif h == b {\n\t\t\tif i == 4 {\n\t\t\t\tfmt.Print(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\th = ello[i]\n\t\t\ti += 1\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s []byte\n\tfmt.Scan(&s)\n\ti, h, ello := -1, byte('h'), []byte{'e', 'l', 'l', 'o'}\n\tfor _, b := range s {\n\t\tif h == b {\n\t\t\ti++\n\t\t\tif i == 4 {\n\t\t\t\tfmt.Print(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\th = ello[i]\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n h := \"hello\"\n var s string\n fmt.Scan(&s)\n in := 0\n for i := 0; (i < len(s)) && (in < 5); i++ {\n if s[i] == h[in] { in++ }\n }\n if in == 5 { fmt.Println(\"YES\") } else { fmt.Println(\"NO\") }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"bytes\"\nimport \"io/ioutil\"\nimport \"os\"\n\nfunc task_solution(line []byte) string {\n\tsub := []byte{'h', 'e', 'l', 'l', 'o'}\n\tvar i, j int\n\tfor i, j = 0, 0; i < len(sub) && j < len(line); j += 1 {\n\t\tif line[j] == sub[i] {\n\t\t\ti += 1\n\t\t}\n\t}\n\tif i == len(sub) && j <= len(line) {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tin_raw, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(bytes.TrimSpace(in_raw)))\n}\n"}, {"source_code": "package main\n\n// https://codeforces.com/problemset/problem/58/A\n\nimport \"fmt\"\n\nconst sub = \"hello\"\n\nfunc task_solution(line string) string {\n\tvar i, j int\n\tfor i, j = 0, 0; i < len(sub) && j < len(line); j += 1 {\n\t\tif sub[i] == line[j] {\n\t\t\ti += 1\n\t\t}\n\t}\n\tif i == len(sub) && j <= len(line) {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tvar line string\n\tif _, err := fmt.Scan(&line); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(line))\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/58/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(s string) string {\n\torder := \"hello\"\n\ti := 0\n\tj := 0\n\tfor i < 5 && j < len(s) {\n\t\tif s[j] == order[i] {\n\t\t\tj += 1\n\t\t\ti += 1\n\t\t} else {\n\t\t\tj += 1\n\t\t}\n\t}\n\tif i == 5 {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(s))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\n\tvar hello = regexp.MustCompile(`h.*e.*l.*l.*o`)\n\n\tif hello.MatchString(s) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// Snippet: isSubSeq\nfunc isSubseq(s1 string, s2 string) bool {\n\tvar k = 0\n\tfor i := 0; i < len(s2); i++ {\n\t\tif s2[i] == s1[k] {\n\t\t\tk++\n\t\t\tif k == len(s1) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif isSubseq(\"hello\", s) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n//import \"strings\"\n\n//import \"math\"\n//import \"strconv\"\n//import \"sort\"\n\nfunc main() {\n\n\tstr := \"hello*\"\n\n\td := \"\"\n\n\tfmt.Scan(&d)\n\n\tcur := 0\n\n\tfor i := 0; i < len(d); i++ {\n\n\t\tif str[cur] == d[i] {\n\t\t\tfmt.Println(i)\n\t\t\tcur++\n\t\t}\n\t\tif cur == 5 {\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n//import \"strings\"\n\n//import \"math\"\n//import \"strconv\"\n//import \"sort\"\n\nfunc main() {\n\n\tstr := \"hello\"\n\n\td := \"\"\n\n\tfmt.Scan(&d)\n\n\tcur := 0\n\n\tfor i := 0; i < len(d); i++ {\n\n\t\tif str[cur] == d[i] {\n\t\t\tcur++\n\t\t}\n\t\tif cur == 4 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n//import \"strings\"\n\n//import \"math\"\n//import \"strconv\"\n//import \"sort\"\n\nfunc main() {\n\n\tstr := \"hello*\"\n\n\td := \"\"\n\n\tfmt.Scan(&d)\n\n\tcur := 0\n\n\tfor i := 0; i < len(d); i++ {\n\n\t\tif str[cur] == d[i] {\n\t\t\tfmt.Println(i)\n\t\t\tcur++\n\t\t}\n\t\tif cur == 4 {\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// INPUT\n// ahhellllloou -> YES\n// hlelo -> NO\n// helhcludoo -> YES\n\nfunc main() {\n\tvar word, wholeWord string\n\n\tfmt.Scanf(\"%v\", &word)\n\n\tfor _, char := range word {\n\t\tif wholeWord == \"\" || !strings.Contains(wholeWord, string(char)) && (char == 'h' || char == 'e' || char == 'l' || char == 'o') {\n\t\t\twholeWord += string(char)\n\t\t}\n\t}\n\n\tif strings.Contains(wholeWord, \"helo\") {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// INPUT\n// ahhellllloou -> YES\n// hlelo -> NO\n// helhcludoo -> YES\n\nfunc main() {\n\tvar word, wholeWord string\n\n\tfmt.Scanf(\"%v\", &word)\n\n\tfor _, char := range word {\n\t\tif wholeWord == \"\" || !strings.Contains(wholeWord, string(char)) && (char == 'h' || char == 'e' || char == 'l' || char == 'o') {\n\t\t\twholeWord += string(char)\n\t\t}\n\t}\n\n\tfmt.Println(wholeWord)\n\n\tif strings.Contains(wholeWord, \"helo\") {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// INPUT\n// ahhellllloou -> YES\n// hlelo -> NO\n\nfunc main() {\n\tvar word, wholeWord string\n\n\tfmt.Scanf(\"%v\", &word)\n\n\tfor _, char := range word {\n\t\tif wholeWord == \"\" || wholeWord[len(wholeWord)-1] != byte(char) {\n\t\t\twholeWord += string(char)\n\t\t}\n\t}\n\n\tif strings.Contains(wholeWord, \"helo\") {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc foo(s string) bool {\n\tvar i int\n\tif i = strings.Index(s, \"h\"); i == -1 {\n\t\treturn false\n\t}\n\tif i = strings.Index(s, \"e\"); i == -1 {\n\t\treturn false\n\t}\n\tif i = strings.Index(s, \"l\"); i == -1 {\n\t\treturn false\n\t}\n\tif i = strings.Index(s, \"l\"); i == -1 {\n\t\treturn false\n\t}\n\tif i = strings.Index(s, \"o\"); i == -1 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif foo(s) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"strings\"\n\nfunc foo(s string) bool {\n\tconst l = \"hello\"\n\tfor i, j := 0, 0; j < len(l); j++ {\n\t\ts = s[i:]\n\t\tif i = strings.Index(s[i:], string(l[j])); i == -1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n\t/*for i := 0; i < len(s); i++ {\n\t\tfor j := i + 1; j < len(s); j++ {\n\t\t\tfor k := j + 1; k < len(s); k++ {\n\t\t\t\tfor l := k + 1; l < len(s); l++ {\n\t\t\t\t\tfor m := l + 1; m < len(s); m++ {\n\t\t\t\t\t\tif s[i] == 'h' && s[j] == 'e' && s[k] == 'l' && s[l] == 'l' && s[m] == 'o' {\n\t\t\t\t\t\t\treturn true\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\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tif foo(s) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ts, _ := reader.ReadString('\\n')\n\tgoal := \"hello\"\n\tstate := 0\n\tgood := false\n\tfor i := 0; i < len(s); i++ {\n\t\tif state == len(goal)-1 {\n\t\t\tgood = true\n\t\t\tbreak\n\t\t}\n\n\t\tif s[i] == goal[state] {\n\t\t\tstate++\n\t\t}\n\t}\n\n\tif good {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar scanner *bufio.Scanner\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tif err := scanner.Err(); err == nil {\n\t\tif regexp.MustCompile(\"\\\\w*[h ]+[e ]+[l ]+[l ]+[o ]+\\\\w*\").MatchString(scanner.Text()) {\n\t\t\tfmt.Println(\"YES\")\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar h, e, l, l2 bool\n\n\tfor _, b := range inp.a {\n\t\ts := string(b)\n\t\tif s == \"h\" {\n\t\t\th = true\n\t\t}\n\n\n\t\tif h && s == \"e\" {\n\t\t\te = true\n\t\t}\n\t\tif h && e && s == \"l\" {\n\t\t\tl = true\n\n\t\t}\n\t\tif h && e && l && s==\"l\" {\n\t\t\tl2 = true\n\n\t\t}\n\t\tif h && e && l && l2 && s == \"o\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar h, e, l, l2 bool\n\n\tfor _, b := range inp.a {\n\t\ts := string(b)\n\t\tif s == \"h\" {\n\t\t\th = true\n\t\t}\n\n\n\t\tif h && s == \"e\" {\n\t\t\te = true\n\t\t}\n\t\tif h && e && s == \"l\" {\n\t\t\tl = true\n\n\t\t}\n\t\tif h && e && l && s==\"l\" {\n\t\t\tl2 = true\n\n\t\t}\n\t\tif h && e && l && l2 && s == \"o\" {\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar h, e, l, l2 bool\n\n\n\tfor i, b := range inp.a {\n\t\tvar v1 int\n\t\ts := string(b)\n\t\tif s == \"h\" {\n\t\t\tv1 = i\n\t\t\th = true\n\t\t}\n\n\n\t\tif v1 > i && h && s == \"e\" {\n\t\t\tv1 = i\n\t\t\te = true\n\t\t}\n\t\tif v1 > i && h && e && s == \"l\" {\n\t\t\tv1 = i\n\n\t\t\tl = true\n\n\t\t}\n\t\tif v1 > i && h && e && l && s==\"l\" {\n\t\t\tv1 = i\n\n\t\t\tl2 = true\n\n\t\t}\n\t\tif v1 > i && h && e && l && l2 && s == \"o\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar h, e, l, l2 bool\n\n\tfor _, b := range inp.a {\n\t\ts := string(b)\n\t\tif s == \"h\" {\n\t\t\th = true\n\t\t\tif h && s == \"e\" {\n\t\t\t\te = true\n\t\t\t\tif h && e && s == \"l\" {\n\t\t\t\t\tl = true\n\t\t\t\t\tif h && e && l && s==\"l\" {\n\t\t\t\t\t\tl2 = true\n\t\t\t\t\t\tif h && e && l && l2 && s == \"o\" {\n\t\t\t\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta string\n}\n\nfunc (c *input) Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tc.a = scanner.Text()\n\t\treturn\n\t}\n\n}\n\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\n\tvar h, e, l, l2 bool\n\n\tfor _, b := range inp.a {\n\t\ts := string(b)\n\t\tif s == \"h\" {\n\t\t\th = true\n\t\t}\n\t\tif h && s == \"e\" {\n\t\t\te = true\n\t\t}\n\t\tif h && e && s == \"l\" {\n\t\t\tl = true\n\t\t}\n\t\tif h && e && l && s==\"l\" {\n\t\t\tl2 = true\n\t\t}\n\t\tif h && e && l && l2 && s == \"o\" {\n\t\t\tfmt.Println(\"YES\")\n\t\t\treturn \n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}, {"source_code": "/*\nChat room\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nVasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.\n\nInput\nThe first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.\n\nOutput\nIf Vasya managed to say hello, print \"YES\", otherwise print \"NO\".\n\nSample test(s)\ninput\nahhellllloou\noutput\nYES\ninput\nhlelo\noutput\nNO\n*/\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tS string\n\t\thello = []rune(\"hello\")\n\t)\n\tfmt.Scanf(\"%s\", &S)\n\ts := []rune(S)\n\tlens := len(s)\n\tlenHello := len(hello)\n\tif lens < lenHello {\n\t\tprintln(\"NO\")\n\t\treturn\n\t}\n\tvar i, j int\n\tfor ; i < lenHello; {\n\t\tfor ; j < lens; j++ {\n\t\t\tif s[j] == hello[i] {\n\t\t\t\ti++\n\t\t\t\tj++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif j >= lens {\n\t\t\tbreak\n\t\t}\n\t}\n\tif i == lenHello {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n"}, {"source_code": "/*\nChat room\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nVasya has recently learned to type and log on to the Internet. He immediately entered a chat room and decided to say hello to everybody. Vasya typed the word s. It is considered that Vasya managed to say hello if several letters can be deleted from the typed word so that it resulted in the word \"hello\". For example, if Vasya types the word \"ahhellllloou\", it will be considered that he said hello, and if he types \"hlelo\", it will be considered that Vasya got misunderstood and he didn't manage to say hello. Determine whether Vasya managed to say hello by the given word s.\n\nInput\nThe first and only line contains the word s, which Vasya typed. This word consisits of small Latin letters, its length is no less that 1 and no more than 100 letters.\n\nOutput\nIf Vasya managed to say hello, print \"YES\", otherwise print \"NO\".\n\nSample test(s)\ninput\nahhellllloou\noutput\nYES\ninput\nhlelo\noutput\nNO\n*/\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tS string\n\t\thello = []rune(\"hello\")\n\t)\n\tfmt.Scanf(\"%s\\n\", &S)\n\ts := []rune(S)\n\tlens := len(s)\n\tlenHello := len(hello)\n\tif lens < lenHello {\n\t\tprintln(\"NO\")\n\t\treturn\n\t}\n\tvar i, j int\n\tfor ; i < lenHello; {\n\t\tfor ; j < lens; j++ {\n\t\t\tif s[j] == hello[i] {\n\t\t\t\ti++\n\t\t\t\tj++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif j >= lens {\n\t\t\tbreak\n\t\t}\n\t}\n\tif i == lenHello {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar word string\n\tfmt.Scan(&word)\n\n\tc := []byte{'h', 'e', 'l', 'o'}\n\tcont := []int{1, 1, 2, 1}\n\tflag := 0\n\thitNum := 0\n\n\tfor i := 0; i < len(word); i++ {\n\t\tif word[i] == c[flag] {\n\t\t\thitNum += 1\n\t\t} else {\n\t\t\tif hitNum < cont[flag] {\n\t\t\t\tflag = 0\n\t\t\t} else {\n\t\t\t\tflag += 1\n\t\t\t\ti--\n\t\t\t}\n\t\t\thitNum = 0\n\t\t}\n\n\t\tif flag >= len(c) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\n \tvar h = \"hello\"\n \tvar index = 0\n \tfor i := 0; i < len(a) && index < 5; i++{\n\t\tif h[index] == a[i] {\n\t\t\tindex++\n\t\t}\n\t}\n\tif index >= 5 {\n\t\tprint(\"YES\")\n\t}else {\n\t\tprint(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\nvar r *bufio.Reader = bufio.NewReader(os.Stdin)\nvar w *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc print( a ...interface{}) { fmt.Fprint(w, a...) }\nfunc scan( a ...interface{}) { fmt.Fscan(r, a...) }\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\n\tvar h = \"hello\"\n\tvar index = 0\n\tfor i := 0; i < len(a) && index < 5; i++{\n\t\tif h[index] == a[i] {\n\t\t\tindex++\n\t\t}\n\t}\n\tif index >= 5 {\n\t\tprint(\"YES\")\n\t}else {\n\t\tprint(\"NO\")\n\t}\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar line string\n\tfmt.Scan(&line)\n\n\tcount := 0\n\tfor _, c := range line {\n\t\tswitch c {\n\t\tcase 'h':\n\t\t\tcount++\n\t\tcase 'e':\n\t\t\tif count == 1 {\n\t\t\t\tcount++\n\t\t\t}\n\t\tcase 'l':\n\t\t\tif count == 2 || count == 3 {\n\t\t\t\tcount++\n\t\t\t}\n\t\tcase 'o':\n\t\t\tif count == 4 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tif count == 5 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// ahhellllloou\n\nfunc solve(s string) string {\n\ti := 0\n\tfor i < len(s) {\n\t\tif s[i] == 'h' {\n\t\t\ti++\n\t\t\tfor s[i] == 'h' {\n\t\t\t\ti++\n\t\t\t}\n\t\t\tif s[i] == 'e' {\n\t\t\t\ti++\n\t\t\t\tfor s[i] == 'e' {\n\t\t\t\t\ti++\n\t\t\t\t}\n\t\t\t\tif s[i] == 'l' {\n\t\t\t\t\ti++\n\t\t\t\t\tfor s[i] == 'l' {\n\t\t\t\t\t\ti++\n\t\t\t\t\t}\n\t\t\t\t\tif s[i] == 'o' {\n\t\t\t\t\t\ti++\n\t\t\t\t\t\tfor s[i] == 'o' {\n\t\t\t\t\t\t\treturn \"YES\"\n\t\t\t\t\t\t\ti++\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\ti++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ti++\n\t\t\t}\n\t\t} else {\n\t\t\ti++\n\t\t}\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tsol := solve(s)\n\tfmt.Println(sol)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\thi := \"hello\"\n\tans := false\n\tj := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == hi[j] {\n\t\t\tj += 1\n\t\t}\n\t\tif j == len(hi) {\n\t\t\tans = true\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanRunes)\n\texpected := []rune{'h', 'e', 'l', 'l', 'o'}\n\tfor scanner.Scan() {\n\t\tb := scanner.Text()\n\t\tbr := rune(b[0])\n\t\tif br == expected[0] {\n\t\t\tif len(expected) == 1 {\n\t\t\t\texpected = expected[:]\n\t\t\t\tbreak\n\t\t\t}\n\t\t\texpected = expected[1:]\n\t\t}\n\t}\n\tif len(expected) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println((\"NO\"))\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanRunes)\n\texpected := []rune{'h', 'e', 'l', 'l', 'o'}\n\tfor scanner.Scan() {\n\t\tb := scanner.Text()\n\t\tbr := rune(b[0])\n\t\tif br == expected[0] {\n\t\t\tif len(expected) > 1 {\n\t\t\t\texpected = expected[1:]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\tif len(expected) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println((\"NO\"))\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, s2 string\n\tvar tmp int\n\tvar flag bool\n\tfmt.Scanf(\"%s\", &s)\n\tfor i := range s {\n\t\tif tmp == 0 {\n\t\t\tif s[i] == 'h' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 1 {\n\t\t\tif s[i] == 'e' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 2 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 3 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t} else if tmp == 4 {\n\t\t\tif s[i] == 'l' {\n\t\t\t\ts2 = s2 + string(s[i])\n\t\t\t\ttmp++\n\t\t\t}\n\t\t}\n\t\tif tmp == 5 {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strings\"\n)\n\n//========== Implement Algorithm =======================\nfunc solution(str string) bool {\n\tif len(str) < 6 {\n\t\treturn false\n\t}\n\th := strings.Count(str, \"h\") >= 1\n\te := strings.Count(str, \"e\") >= 1\n\tl := strings.Count(str, \"l\") >= 2\n\to := strings.Count(str, \"o\") >= 1\n\treturn h && e && l && o\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar str string\n\tvar ret bool\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tstr = scanner.Text()\n\t//======================================================\n\tret = solution(str)\n\t//==================== OUTPUT ==========================\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\n//========== Implement Algorithm =======================\nfunc solution(str string) bool {\n\tif len(str) < 6 {\n\t\treturn false\n\t}\n\th := false\n\te := false\n\tl := false\n\to := false\n\tlcount := 0\n\tfor x := 0; x < len(str); x++ {\n\t\tif h && e && l && o {\n\t\t\treturn true\n\t\t}\n\t\tif string(str[x]) == \"h\" {\n\t\t\th = true\n\t\t} else if string(str[x]) == \"e\" && h {\n\t\t\te = true\n\t\t} else if string(str[x]) == \"l\" && h && e {\n\t\t\tlcount++\n\t\t\tif lcount == 2 {\n\t\t\t\tl = true\n\t\t\t}\n\n\t\t} else if string(str[x]) == \"o\" && h && e && l {\n\t\t\to = true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar str string\n\tvar ret bool\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tstr = scanner.Text()\n\t//======================================================\n\tret = solution(str)\n\t//==================== OUTPUT ==========================\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\n//========== Implement Algorithm =======================\nfunc solution(str string) bool {\n\tif len(str) < 6 {\n\t\treturn false\n\t}\n\th := false\n\te := false\n\tl := false\n\to := false\n\tlcount := 0\n\tfor x := 0; x < len(str); x++ {\n\t\tif h && e && l && o {\n\t\t\treturn true\n\t\t}\n\n\t\tif string(str[x]) == \"h\" {\n\t\t\th = true\n\t\t} else if string(str[x]) == \"e\" && h {\n\t\t\te = true\n\t\t} else if string(str[x]) == \"l\" && h && e {\n\t\t\tlcount++\n\t\t\tif lcount == 2 {\n\t\t\t\tl = true\n\t\t\t}\n\n\t\t} else if string(str[x]) == \"o\" && h && e && l {\n\t\t\to = true\n\t\t}\n\t}\n\n\treturn h && e && l && o\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar str string\n\tvar ret bool\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tstr = scanner.Text()\n\t//======================================================\n\tret = solution(str)\n\t//==================== OUTPUT ==========================\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n)\n\n//========== Implement Algorithm =======================\nfunc solution(str string) bool {\n\tif len(str) < 6 {\n\t\treturn false\n\t}\n\th := false\n\te := false\n\tl := false\n\to := false\n\tlcount := 0\n\tfor x := 0; x < len(str); x++ {\n\t\tif h && e && l && o {\n\t\t\treturn true\n\t\t}\n\t\tif string(str[x]) == \"h\" {\n\t\t\th = true\n\t\t} else if string(str[x]) == \"o\" {\n\t\t\to = true\n\t\t} else if string(str[x]) == \"l\" {\n\t\t\tlcount++\n\t\t\tif lcount == 2 {\n\t\t\t\tl = true\n\t\t\t}\n\n\t\t} else if string(str[x]) == \"e\" {\n\t\t\te = true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\t//================== Variables used ====================\n\tvar str string\n\tvar ret bool\n\t//======================================================\n\n\t//============== Get return value from File ============\n\tif len(os.Args) >= 2 {\n\n\t\tfile, err := os.Open(os.Args[1])\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"failed opening file: %s\", err)\n\t\t}\n\t\tscanner = bufio.NewScanner(file)\n\t\tdefer file.Close()\n\n\t}\n\tscanner.Split(bufio.ScanWords)\n\t//======================= I/O ==========================\n\tscanner.Scan()\n\tstr = scanner.Text()\n\t//======================================================\n\tret = solution(str)\n\t//==================== OUTPUT ==========================\n\tif ret {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\"fmt\")\n\nfunc main(){\n\tvar line string\n\tb := \"hello\"\n\tscan(&line)\n\tp := 0\n\tfor i := 0; i < len(line); i++{\n\t\tif line[i] == b[p] && p < 4 {p++}\n\t}\n\tif p == 4 {\n\t\tsout(\"YES\")\n\t}else{\n\t\tsout(\"NO\")\n\t}\n}\n\nfunc scan(in ... interface{}){\n\tfor _,k := range in{\n\t\tfmt.Scan(k)\n\t}\n}\n\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k)\n\t}\n\t//fmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string\n word := \"hello\"\n var count, l int\n l = 4\n fmt.Scanf(\"%s\", &s)\n\n for i:=0; i < len(s); i++ {\n if (s[i] == word[count]) {\n count++ \n } \n if(count > l) {\n break\n }\n }\n\n if(count >= l) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s []byte\n\tfmt.Scan(&s)\n\ti, h, ello := 0, byte('h'), []byte{'e', 'l', 'l', 'o'}\n\tfor _, b := range s {\n\t\tif h == b {\n\t\t\tif i == 3 {\n\t\t\t\tfmt.Print(\"YES\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\th = ello[i]\n\t\t\ti++\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"bytes\"\nimport \"io/ioutil\"\nimport \"os\"\n\nfunc task_solution(line []byte) string {\n\tsubstr := []byte{'h', 'e', 'l', 'l', 'o'}\n\tpos := 0\n\tfor _, c := range substr {\n\t\tfor pos < len(line) && line[pos] != c {\n\t\t\tpos += 1\n\t\t}\n\t\t// found char\n\t\tif pos < len(line) {\n\t\t\tpos += 1\n\t\t}\n\t}\n\tif pos < len(line) {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tin_raw, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(bytes.TrimSpace(in_raw)))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"bytes\"\nimport \"io/ioutil\"\nimport \"os\"\n\nfunc task_solution(line []byte) string {\n\tsubstr := []byte{'h', 'e', 'l', 'l', 'o'}\n\tpos := 0\n\tfor _, c := range substr {\n\t\tfor pos < len(line) && line[pos] != c {\n\t\t\tpos += 1\n\t\t}\n\t\t// found char\n\t\tif pos < len(line) {\n\t\t\tpos += 1\n\t\t}\n\t}\n\tif pos <= len(line) {\n\t\treturn \"YES\"\n\t}\n\treturn \"NO\"\n}\n\nfunc main() {\n\tin_raw, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(bytes.TrimSpace(in_raw)))\n}\n"}], "src_uid": "c5d19dc8f2478ee8d9cba8cc2e4cd838"} {"source_code": "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.Print(a, (b-a)/2)\n\t} else if a > b {\n\t\tfmt.Print(b, (a-b)/2)\n\t} else if b == a {\n\t\tfmt.Print(a, 0)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/581/A\n// A. Vasya the Hipster\n// time limit per test\n// 1 second\n// memory limit per test\n// 256 megabytes\n// input\n// standard input\n// output\n// standard output\n\n// One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.\n\n// According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.\n\n// Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.\n\n// Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.\n\n// Can you help him?\n// Input\n\n// The single line of the input contains two positive integers a and b (1\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009100) \u2014 the number of red and blue socks that Vasya's got.\n// Output\n\n// Print two space-separated integers \u2014 the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.\n\n// Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.\n\nfunc main() {\n\tvar a, b int\n\t_, _ = fmt.Scan(&a, &b)\n\n\thipsterDays := intMin(a, b)\n\n\ta -= hipsterDays\n\tb -= hipsterDays\n\n\tnonHipsterDays := (a + b) / 2\n\n\tfmt.Print(hipsterDays, nonHipsterDays)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n if a > b {\n a, b = b, a\n }\n fmt.Print(a, \" \")\n fmt.Println((b - a) / 2)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\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 a\n\t}\n\treturn b\n}\n\n// https://codeforces.com/problemset/problem/581/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u0434\u043d\u0435\u0439, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0412\u0430\u0441\u044f\n// \u0431\u0443\u0434\u0435\u0442 \u0432 \u0440\u0430\u0437\u043d\u043e\u0446\u0432\u0435\u0442\u043d\u044b\u0445 \u043d\u043e\u0441\u043a\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435\n// \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.\n// \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043b-\u0432\u043e \u0434\u043d\u0435\u0439, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0412\u0430\u0441\u044f\n// \u0431\u0443\u0434\u0435\u0442 \u0432 \u043e\u0434\u043d\u043e\u0446\u0432\u0435\u0442\u043d\u044b\u0445 (\u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f) \u043d\u043e\u0441\u043a\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f\n// \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0440\u044b\nfunc taskSolution(n int, m int) string {\n\treturn fmt.Sprint(min(n, m), abs(n-m)/2)\n}\n\nfunc main() {\n\tvar n, m int\n\tif _, err := fmt.Scan(&n, &m); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n, m))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\ta, b := nextInt(), nextInt()\n\tfmt.Printf(\"%d %d\", min(a, b), (a + b - 2 * min(a, b)) / 2)\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc nextInt() int {\n\tin.Scan()\n\tres, _ := strconv.Atoi(in.Text())\n\treturn res\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc main(){\n\tvar r,b int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in,&r,&b)\n\tmin,max := minmax(r,b)\n\tfmt.Println(min,(max-min)/2)\n}\nfunc minmax(a,b int)(int,int){\n\tif a b {\n\t\tprintln(b, (a-b)/2)\n\t} else {\n\t\tprintln(a, (b-a)/2)\n\t}\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport(\n \"fmt\"\n)\n\ntype u32 uint32\n\nfunc min(a,b *u32)u32{\n if *a>*b{\n return *b\n }\n return *a\n}\n\nfunc max(a,b *u32)u32{\n if *a>*b{\n return *a\n }\n return *b\n}\n\nfunc main(){\n var(\n a,b u32\n )\n fmt.Scan(&a,&b)\n fmt.Println(min(&a,&b),(max(&a,&b)-min(&a,&b))/2)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc 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\t_, _ = fmt.Scan(&a, &b)\n\ta, b = min(a,b), max(a, b)\n\tfmt.Println(a, (b - a) / 2)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar r, b int\n\tfmt.Scan(&r, &b)\n\n\tdif := min(r, b)\n\tsam := (max(r, b) - dif) / 2\n\n\tfmt.Println(dif, sam)\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"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc min(a, b int) int {\n if (a < b) {\n return a \n }\n return b \n}\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n\n both := min(a, b)\n a -= both\n b -= both\n single := a/2 + b/2\n\n fmt.Println(both, single)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n\n\n\n\nfunc diff(red int,blue int) (val1 int,val2 int) {\nfor{\n if (red!=0)&&(blue!=0) {\n\t val1++\n\t\n }else{\n\t // fmt.Printf(\"the value of red and blue before being passed to same :%d %d\\n\",red,blue)\n if red>1 {\n\t val2=same(red)\n\t break\n }else if blue>1{\n\t val2=same(blue)\n\t break\n }else{\n\t break\n }\n \n}\nred--;blue--;\n}\nreturn\n}\n\nfunc main() {\n\tvar red,blue int\n\tfmt.Scan(&red)\n\tfmt.Scan(&blue)\n\tval1,val2:=diff(red,blue)\n\tfmt.Print(val1,val2)\n\t}\n\n\nfunc same(col int)(val2 int){\n\n\tfor{\n\t\t\n\t\tif col>1{\n\t\t\tval2++\n\t\t}else{\n\t\t\treturn\n\t\t}\n\t\tcol=col-2\n\t}\n\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar red, blue, min, max int\n\tfmt.Scanf(\"%d %d\", &red, &blue)\n\tif red < blue {\n\t\tmin = red\n\t\tmax = blue\n\t} else {\n\t\tmin = blue\n\t\tmax = red\n\t}\n\tfmt.Println(min, (max-min)/2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d \\n\", &a, &b)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\n\tfmt.Println(a, (b-a)/2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\tline := readLine(reader)\n\tvar a, b int64 = 0, 0\n\tfmt.Sscanf(line, \"%d %d\", &a, &b)\n\tfmt.Println(min(a, b), abs(a-b)/2)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n"}, {"source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Max(a, b int) (int, int) {\n if b > a {\n b, a = a, b\n }\n return a, b\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b int\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n fmt.Sscanln(Read(reader), &b)\n\n a, b = Max(a, b)\n \n writer := bufio.NewWriter(os.Stdout)\n Write(writer, b, (a - b) / 2) \n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar red, blue int\n\tfmt.Scan(&red, &blue)\n\tvar array = []int{red, blue}\n\tsort.Ints(array)\n\tday1 := array[0]\n\tday2 := (array[1] - array[0]) / 2\n\tfmt.Println(day1, day2)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nvar r, b int\n\nfunc main() {\n\tfmt.Scan(&r, &b)\n\tif r > b {\n\t\tfmt.Println(b, \" \", (r-b)/2)\n\t} else {\n\t\tfmt.Println(r, \" \", (b-r)/2)\n\t}\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n\nfunc sock1 (a int, b int) int {\n\tres1 := 0\n\tif a < b {\n\t\tres1 = a\n\t} else if a > b {\n\t\tres1 = b\n\t} else if b == a {\n\t\tres1 = a\n\t}\n\treturn res1\n}\nfunc sock2 (a int, b int) int {\n\tres2 := 0\n\tif a < b {\n\t\tres2 = (b-a)/2\n\t} else if a > b {\n\t\tres2 = (a-b)/2\n\t} else if b == a {\n\t\tres2 = 0\n\t}\n\treturn res2\n}\n \nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tfmt.Print(sock1(a, b), sock2(a, b))\n}"}, {"source_code": "package main\nimport (\n \"fmt\"\n)\nfunc min(c int, d int) int {\n if d > c {\n return c\n } else {\n return d\n }\n}\nfunc main() {\n var a, b int = 0, 0\n fmt.Scanf(\"%d%d\", &a, &b)\n var f int = min(a, b)\n var h int = (a + b - 2 * f) / 2\n fmt.Println(f, h)\n}"}, {"source_code": "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\tsp := []int{a, b}\n\tsort.Ints(sp)\n\tk := sp[0]\n\tk2 := (sp[1] - sp[0]) / 2\n\tfmt.Println(k, k2)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a > b {\n\t\tfmt.Printf(\"%d \", b)\n\t\tfmt.Print((a - b) / 2)\n\t} else {\n\t\tfmt.Printf(\"%d \", a)\n\t\tfmt.Print((b - a) / 2)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar a, b int\n\nfunc main() {\n\tfmt.Fscan(reader, &a, &b)\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tfmt.Println(a, (b-a)/2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar a, b uint8\n\tfmt.Fscanf(in, \"%d %d\\n\", &a, &b)\n\tif a > b {\n\t\tfmt.Println(b, (a-b)/2)\n\n\t} else if a < b {\n\t\tfmt.Println(a, (b-a)/2)\n\t} else if a == b {\n\t\tfmt.Println(a, 0)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scanf(\"%f %f\", &a, &b)\n\tfirstDay := math.Min(a, b)\n\tsecondDay := (math.Max(a, b) - firstDay) / 2\n\tfmt.Print(firstDay, \" \", int(secondDay))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\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 main() {\n\tvar a, b int\n\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\n\tmax := max(a, b)\n\tmin := min(a, b)\n\n\tfmt.Printf(\"%d %d\", min, (max - min) / 2)\n}\n"}, {"source_code": "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\ts := []int{a, b}\n\tsort.Ints(s)\n\tm := s[0]\n\tm2 := (s[1] - s[0]) / 2\n\tfmt.Println(m, m2)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfmt.Println(b, (a-b)/2)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\tdays := a\n\tif a > b {\n\t\tdays = b\n\t}\n\tfmt.Printf(\"%d %d\\n\", days, (a+b)/2-days)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tab := scanner.Text()\n\tvar chList []int\n\tfor _, ch := range strings.Split(ab, \" \") {\n\t\tch, err := strconv.Atoi(ch)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\tchList = append(chList, ch)\n\t}\n\ta, b := chList[0], chList[1]\n\tvar c int\n\tc = a - b\n\tif c < 0 {\n\t\tb, c, a = -c, a, 0\n\t\tb = b / 2\n\t\tfmt.Println(c, b)\n\t} else if c == 0 {\n\t\tc = a\n\t\tb = 0\n\t\tfmt.Println(c, b)\n\t} else {\n\t\ta, c, b = c, b, 0\n\t\ta = a / 2\n\t\tfmt.Println(c, a)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar red, blue, same, different int\n\n\tfmt.Scan(&red, &blue)\n\n\tif red > blue {\n\t\tdifferent = blue\n\t\tsame = (red - different) / 2\n\t} else {\n\t\tdifferent = red\n\t\tsame = (blue - different) / 2\n\t}\n\n\tfmt.Println(different, same)\n}\n"}, {"source_code": "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\tmas := []int{a, b}\n\tsort.Ints(mas)\n\tr := mas[0]\n\tr2 := (mas[1] - mas[0]) / 2\n\tfmt.Println(r, r2)\n}\n"}], "negative_code": [{"source_code": "// A. Vasya the Hipster\n/*\nOne day Vasya the Hipster decided to count how many socks he had. It turned out\nthat he had a red socks and b blue socks.\n\nAccording to the latest fashion, hipsters should wear the socks of different\ncolors: a red one on the left foot, a blue one on the right foot.\n\nEvery day Vasya puts on new socks in the morning and throws them away before\ngoing to bed as he doesn't want to wash them.\n\nVasya wonders, what is the maximum number of days when he can dress\nfashionable and wear different socks, and after that, for how many days he\ncan then wear the same socks until he either runs out of socks or cannot make\na single pair from the socks he's got.\n\nCan you help him?\n\nInput\nThe single line of the input contains two positive integers a and b\n(1\u2009\u2264\u2009a,\u2009b\u2009\u2264\u2009100) \u2014 the number of red and blue socks that Vasya's got.\n\nOutput\nPrint two space-separated integers \u2014 the maximum number of days when Vasya can\nwear different socks and the number of days when he can wear the same socks\nuntil he either runs out of socks or cannot make a single pair from the socks\nhe's got.\n\nKeep in mind that at the end of the day Vasya throws away the socks that he's\nbeen wearing on that day.\n\nExamples\nInput\n3 1\n\nOutput\n1 1\n\nInput\n2 3\n\nOutput\n2 0\n\nInput\n7 3\n\nOutput\n3 2\n\nNote\nIn the first sample Vasya can first put on one pair of different socks,\nafter that he has two red socks left to wear on the second day.\n*/\npackage 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\tinput, _ := reader.ReadString('\\n')\n\tinputArr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.Atoi(inputArr[0])\n\tb, _ := strconv.Atoi(inputArr[1])\n\n\to1, o2 := 0, 0\n\tif a < b {\n\t\to1 = a % b\n\t\to2 = (b - o1) / 2\n\t} else {\n\t\to1 = b % a\n\t\to2 = (a - o1) / 2\n\t}\n\tfmt.Printf(\"%v %v\", o1, o2)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n\n\n\n\nfunc diff(red int,blue int) (val1 int,val2 int) {\nfor{\n if (red!=0)&&(blue!=0) {\n\t val1++\n\t\n }else{\n\t // fmt.Printf(\"the value of red and blue before being passed to same :%d %d\\n\",red,blue)\n if red>1 {\n\t val2=same(red)\n\t break\n }else if blue>1{\n\t val2=same(blue)\n\t break\n }else{\n\t break\n }\n \n}\nred--;blue--;\n}\nreturn\n}\n\nfunc main() {\n\tvar red,blue int\n\tfmt.Scan(&red)\n\tfmt.Scan(&blue)\n\tval1,val2:=diff(red,blue)\n\tfmt.Print(val1,val2)\n\t}\n\n\nfunc same(col int)(val2 int){\n\n\tfor{\n\t\t\n\t\tif col>0 {\n\t\t\tval2++\n\t\t}else{\n\t\t\treturn\n\t\t}\n\t\tcol=col-2\n\t}\n\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar a, b, c, d uint8\n\tc = 0\n\td = 0\n\tfmt.Fscanf(in, \"%d %d\\n\", &a, &b)\n\tfor i := b; i > 0 && a > 0; i-- {\n\t\ta--\n\t\tb--\n\t\tc++\n\t}\n\td = a / 2\n\tfmt.Println(c, d)\n}\n"}, {"source_code": "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.Print(a, b/2)\n\t} else if b < a {\n\t\tfmt.Print(b, a/2)\n\t} else if b == a {\n\t\tfmt.Print(a, 0)\n\t}\n}\n"}], "src_uid": "775766790e91e539c1cfaa5030e5b955"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\ta, b, c := int64(0), int64(0), int64(0)\n\tfmt.Fscanf(in, \"%d %d %d\\n\", &a, &b, &c)\n\tabs := min(a, b)\n\ta -= abs\n\tb -= abs\n\tans := int64(0)\n\tif a > 0 || b > 0 {\n\t\tans++\n\t}\n\tans += c*2 + abs*2\n\tfmt.Fprintf(out, \"%d\\n\", ans)\n\treturn\n}\n\nfunc min(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\tvar total int64\n\ttotal = int64(min1(a,b) + c) * 2\n\tif(a != b){\n\t\ttotal += 1\n\t}\n\tfmt.Fprint(out,int64(total))\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}, {"source_code": "// A. Another One Bites The Dust\n/*\nLet's call a string good if and only if it consists of only two types of letters \u2014 'a' and 'b' and every two consecutive letters are distinct. For example \"baba\" and \"aba\" are good strings and \"abb\" is a bad string.\n\nYou have \ud835\udc4e strings \"a\", \ud835\udc4f strings \"b\" and \ud835\udc50 strings \"ab\". You want to choose some subset of these strings and concatenate them in any arbitrarily order.\n\nWhat is the length of the longest good string you can obtain this way?\n\nInput\nThe first line contains three positive integers \ud835\udc4e, \ud835\udc4f, \ud835\udc50 (1\u2264\ud835\udc4e,\ud835\udc4f,\ud835\udc50\u2264109) \u2014 the number of strings \"a\", \"b\" and \"ab\" respectively.\n\nOutput\nPrint a single number \u2014 the maximum possible length of the good string you can obtain.\n\nExamples\nInput\n1 1 1\n\nOutput\n4\n\nInput\n2 1 2\n\nOutput\n7\n\nInput\n3 5 2\n\nOutput\n11\n\nInput\n2 2 1\n\nOutput\n6\n\nInput\n1000000000 1000000000 1000000000\n\nOutput\n4000000000\n\nNote\nIn the first example the optimal string is \"baba\".\n\nIn the second example the optimal string is \"abababa\".\n\nIn the third example the optimal string is \"bababababab\".\n\nIn the fourth example the optimal string is \"ababab\".\n*/\npackage 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\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.ParseInt(arr[0], 10, 64)\n\tb, _ := strconv.ParseInt(arr[1], 10, 64)\n\tc, _ := strconv.ParseInt(arr[2], 10, 64)\n\n\ttotal := c * 2\n\tif a > b {\n\t\ttotal += (2 * b) + 1\n\t} else if a < b {\n\t\ttotal += (2 * a) + 1\n\t} else {\n\t\ttotal += 2 * a\n\t}\n\tfmt.Print(total)\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int64, y int64, z int64) int64 {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} else if x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t} else {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int64\n\tvar b int64\n\tvar c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc main() {\n\tin := readString()\n\tparts := strings.Split(in, \" \")\n\ta := Atoi(parts[0])\n\tb := Atoi(parts[1])\n\tab := Atoi(parts[2])\n\n\taabb := Min(a, b)\n\tres := ab*2 + aabb*2\n\tif Abs(a-b) != 0 {\n\t\tres++\n\t}\n\tfmt.Println(res)\n}\n\nfunc readInteger() int64 {\n\ts, _, _ := reader.ReadLine()\n\tn, _ := strconv.ParseInt(string(s), 0, 64)\n\treturn n\n}\n\nfunc readString() string {\n\ts, _, _ := reader.ReadLine()\n\treturn string(s)\n}\n\nfunc Abs(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc Min(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc Max(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\nfunc Atoi(s string) int64 {\n\ti, _ := strconv.ParseInt(s, 10, 64)\n\treturn i\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(a, b, c uint64) uint64 {\n\tres := a\n\tif b < a {\n\t\tres = b\n\t}\n\n\tres += c\n\tres *= 2\n\n\tif a != b {\n\t\tres++\n\t}\n\n\treturn res\n}\n\nfunc main() {\n\tvar a, b, c uint64\n\n\tfmt.Scan(&a, &b, &c)\n\n\tres := solve(a, b, c)\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(first int64, second int64, third int64) int64 {\n\tans := third * 2\n\tif first == second {\n\t\tans += first * 2\n\t\treturn ans\n\t} else if first > second {\n\t\tans += second * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += first * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(solve(a, b, c))\n}"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar a, b, c, res uint64\n\tfmt.Scan(&a, &b, &c)\n res = a\n\tif b < a {\n\t res = b\n\t}\n\tres = res + c\n\tres = res * 2\n\tif a != b {\n\t\tres++\n\t}\n\tfmt.Println(res)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc fun(x int64, y int64, z int64) int64 {\n\tans := z * 2\n\tif x == y {\n\t\tans += x * 2\n\t\treturn ans\n\t} else if x > y {\n\t\tans += y * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += x * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(fun(a, b, c))\n}"}], "negative_code": [{"source_code": "// A. Another One Bites The Dust\n/*\nLet's call a string good if and only if it consists of only two types of letters \u2014 'a' and 'b' and every two consecutive letters are distinct. For example \"baba\" and \"aba\" are good strings and \"abb\" is a bad string.\n\nYou have \ud835\udc4e strings \"a\", \ud835\udc4f strings \"b\" and \ud835\udc50 strings \"ab\". You want to choose some subset of these strings and concatenate them in any arbitrarily order.\n\nWhat is the length of the longest good string you can obtain this way?\n\nInput\nThe first line contains three positive integers \ud835\udc4e, \ud835\udc4f, \ud835\udc50 (1\u2264\ud835\udc4e,\ud835\udc4f,\ud835\udc50\u2264109) \u2014 the number of strings \"a\", \"b\" and \"ab\" respectively.\n\nOutput\nPrint a single number \u2014 the maximum possible length of the good string you can obtain.\n\nExamples\nInput\n1 1 1\n\nOutput\n4\n\nInput\n2 1 2\n\nOutput\n7\n\nInput\n3 5 2\n\nOutput\n11\n\nInput\n2 2 1\n\nOutput\n6\n\nInput\n1000000000 1000000000 1000000000\n\nOutput\n4000000000\n\nNote\nIn the first example the optimal string is \"baba\".\n\nIn the second example the optimal string is \"abababa\".\n\nIn the third example the optimal string is \"bababababab\".\n\nIn the fourth example the optimal string is \"ababab\".\n*/\npackage 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\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.Atoi(arr[0])\n\tb, _ := strconv.Atoi(arr[1])\n\tc, _ := strconv.Atoi(arr[2])\n\n\ttotal := c * 2\n\tif a > b {\n\t\ttotal += (2 * b) + 1\n\t} else if a < b {\n\t\ttotal += (2 * a) + 1\n\t} else {\n\t\ttotal += 2 * a\n\t}\n\tfmt.Print(total)\n}\n"}, {"source_code": "// A. Another One Bites The Dust\n/*\nLet's call a string good if and only if it consists of only two types of letters \u2014 'a' and 'b' and every two consecutive letters are distinct. For example \"baba\" and \"aba\" are good strings and \"abb\" is a bad string.\n\nYou have \ud835\udc4e strings \"a\", \ud835\udc4f strings \"b\" and \ud835\udc50 strings \"ab\". You want to choose some subset of these strings and concatenate them in any arbitrarily order.\n\nWhat is the length of the longest good string you can obtain this way?\n\nInput\nThe first line contains three positive integers \ud835\udc4e, \ud835\udc4f, \ud835\udc50 (1\u2264\ud835\udc4e,\ud835\udc4f,\ud835\udc50\u2264109) \u2014 the number of strings \"a\", \"b\" and \"ab\" respectively.\n\nOutput\nPrint a single number \u2014 the maximum possible length of the good string you can obtain.\n\nExamples\nInput\n1 1 1\n\nOutput\n4\n\nInput\n2 1 2\n\nOutput\n7\n\nInput\n3 5 2\n\nOutput\n11\n\nInput\n2 2 1\n\nOutput\n6\n\nInput\n1000000000 1000000000 1000000000\n\nOutput\n4000000000\n\nNote\nIn the first example the optimal string is \"baba\".\n\nIn the second example the optimal string is \"abababa\".\n\nIn the third example the optimal string is \"bababababab\".\n\nIn the fourth example the optimal string is \"ababab\".\n*/\npackage 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\tinput, _ := reader.ReadString('\\n')\n\tarr := strings.Split(strings.TrimSpace(input), \" \")\n\ta, _ := strconv.Atoi(arr[0])\n\tb, _ := strconv.Atoi(arr[1])\n\tc, _ := strconv.Atoi(arr[2])\n\n\ttotal := c * 2\n\tif a > b {\n\t\ttotal += 2*b + 1\n\t} else if a < b {\n\t\ttotal += 2*a + 1\n\t} else {\n\t\ttotal += 2 * a\n\t}\n\tfmt.Print(total)\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int, y int, z int) int {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} else if x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t} else {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int\n\tvar b int\n\tvar c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc queen(x int, y int, z int) int {\n\tres := z * 2\n\tif x == y {\n\t\tres += x * 2\n\t\treturn res\n\t} \n\tif x > y {\n\t\tres += y * 2 + 1\n\t\treturn res\n\t}\n\tif x < y {\n\t\tres += x * 2 + 1\n\t\treturn res\n\t} else {\n\t\treturn res\n\t}\n}\n \nfunc main() {\n\tvar a int\n\tvar b int\n\tvar c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(queen(a, b, c))\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(a, b, c uint64) uint64 {\n\tres := a\n\tif b < a {\n\t\tres = b\n\t}\n\n\treturn 2*res + 2*c\n}\n\nfunc main() {\n\tvar a, b, c uint64\n\n\tfmt.Scan(&a, &b, &c)\n\n\tres := solve(a, b, c)\n\tfmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solve(first int, second int, third int) int {\n\tans := third * 2\n\tif first == second {\n\t\tans += first * 2\n\t\treturn ans\n\t} else if first > second {\n\t\tans += second * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += first * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(solve(a, b, c))\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc fun(x int, y int, z int) int {\n\tans := z * 2\n\tif x == y {\n\t\tans += x * 2\n\t\treturn ans\n\t} else if x > y {\n\t\tans += y * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += x * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(fun(a, b, c))\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc fun(x int, y int, z int) int {\n\tans:=z * 2\n\tif x == y {\n\t\tans += x * 2\n\t\treturn ans\n\t} else if x > y {\n\t\tans += y * 2 + 1\n\t\treturn ans\n\t} else {\n\t\tans += x * 2 + 1\n\t\treturn ans\n\t}\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(fun(a, b, c))\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\ttotal := (min1(a,b) + c) * 2\n\tif(a != b){\n\t\ttotal += 1\n\t}\n\tfmt.Fprint(out,int64(total))\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\ttotal := (min1(a,b) + c) * 2\n\tif(a != b){\n\t\ttotal += 1\n\t}\n\tfmt.Fprint(out,total)\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\ttotal := min1(a,b) + c * 2\n\tif(a != b){\n\t\ttotal += 1\n\t}\n\tfmt.Fprint(out,total)\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tvar a , b ,c int\n\tfmt.Fscan(in,&a,&b,&c)\n\t//3 2\n\tfmt.Fprint(out,int64(a + b + c * 2))\n\n\n\n\n\n\n}\nfunc min1(x1,x2 int) int {\n\tif(x1 < x2){\n\t\treturn x1\n\t}else{\n\t\treturn x2\n\t}\n}\n"}], "src_uid": "609f131325c13213aedcf8d55fc3ed77"} {"source_code": "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 CF1030C(_r io.Reader, out io.Writer) {\n\tvar n, s int\n\tvar a []byte\n\tFscan(bufio.NewReader(_r), &n, &a)\no:\n\tfor i, v := range a[:n-1] {\n\t\ts += int(v & 15)\n\t\tfor j := i + 1; j < n; {\n\t\t\ts2 := int(a[j] & 15)\n\t\t\tfor j++; j < n && (s2 < s || s2 == s && a[j] == '0'); j++ {\n\t\t\t\ts2 += int(a[j] & 15)\n\t\t\t}\n\t\t\tif s2 != s {\n\t\t\t\tcontinue o\n\t\t\t}\n\t\t}\n\t\tFprintln(out, \"YES\")\n\t\treturn\n\t}\n\tFprintln(out, \"NO\")\n}\n\nfunc main() { CF1030C(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tscanner.Scan()\n\tans := strings.Split(scanner.Text(), \"\")\n\n\ttotal := 0\n\tfor i := 0; i < len(ans)-1; i++ {\n\t\ta, _ := strconv.Atoi(ans[i])\n\t\ttotal += a\n\t\tif findGolden(total, ans[i+1:]) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n\nfunc findGolden(cut int, rem []string) bool {\n\ttotal := 0\n\tfor i := 0; i < len(rem); i++ {\n\t\ta, _ := strconv.Atoi(rem[i])\n\n\t\ttotal += a\n\t\tif total > cut {\n\t\t\treturn false\n\t\t}\n\t\tif total == cut {\n\t\t\treturn i+1 == len(rem) || findGolden(cut, rem[i+1:]) || findGolden(0, rem[i+1:])\n\n\t\t}\n\t}\n\treturn false\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tscanner.Scan()\n\tans := strings.Split(scanner.Text(), \"\")\n\n\ttotal := 0\n\tfor i := 0; i < len(ans)-1; i++ {\n\t\ta, _ := strconv.Atoi(ans[i])\n\t\ttotal += a\n\t\tif findGolden(total, ans[i+1:]) {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n}\n\nfunc findGolden(cut int, rem []string) bool {\n\ttotal := 0\n\tfor i := 0; i < len(rem); i++ {\n\t\ta, _ := strconv.Atoi(rem[i])\n\n\t\ttotal += a\n\t\tif total > cut {\n\t\t\treturn false\n\t\t}\n\t\tif total == cut {\n\t\t\treturn i+1 == len(rem) || findGolden(cut, rem[i+1:])\n\n\t\t}\n\t}\n\treturn false\n}\n"}], "src_uid": "410296a01b97a0a39b6683569c84d56c"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ := reader.ReadString('\\n')\n\n\ts := strings.TrimSpace(line)\n\tstringLength := len(s)\n\n\tline, _ = reader.ReadString('\\n')\n\tvar k int\n\n\tfmt.Sscanf(line, \"%d\", &k)\n\n\tnewString := make([]rune, stringLength+k)\n\tcopy(newString, []rune(s))\n\n\tbestRepeat := 0\n\tfor i := 0; i < stringLength+k; i++ {\n\t\tcurrentRepeat := 0\n\t\tfor currentRepeat <= (stringLength+k-i)/2 {\n\t\t\ttandemRepeat := true\n\t\t\tfor j := i; j < i+currentRepeat; j++ {\n\t\t\t\tif newString[j+currentRepeat] != newString[j] && newString[j+currentRepeat] != 0 {\n\t\t\t\t\ttandemRepeat = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif tandemRepeat && currentRepeat > bestRepeat {\n\t\t\t\tbestRepeat = currentRepeat\n\t\t\t}\n\t\t\tcurrentRepeat++\n\t\t}\n\t}\n\tfmt.Println(2*bestRepeat - 0)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\ts, k := next(), nextInt()\n\n\tif k >= len(s) {\n\t\tprintln((len(s) + k) / 2 * 2) \n\t\treturn\n\t}\n\n\ts += strings.Repeat(\".\", k)\n\tresult := k * 2\n\t// length := 0\n\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i + 1; j <= len(s); j++ {\n\t\t\tstr := s[i:j]\n\t\t\tif len(str) % 2 == 0 && len(str) > result && isTandemRepeat(str) {\n\t\t\t\tresult = len(str)\n\t\t\t\t// println(str, result)\n\t\t\t}\n\t\t}\n\t}\n\n\t// println(s, len(s))\n\tprintln(result)\n}\n\nfunc isTandemRepeat(s string) bool {\n\tif len(s) % 2 == 1 {\n\t\treturn false\n\t}\n\n\tfor i := 0; i < len(s) / 2; i++ {\n\t\tif s[i] != s[i + len(s) / 2] && s[i + len(s) / 2] != '.' {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc print(a ...interface{}) {\n\tfmt.Fprint(writer, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(writer, format, a...)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ := reader.ReadString('\\n')\n\n\ts := strings.TrimSpace(line)\n\tstringLength := len(s)\n\n\tline, _ = reader.ReadString('\\n')\n\tvar k int\n\n\tfmt.Sscanf(line, \"%d\", &k)\n\n\tnewString := make([]rune, stringLength+k)\n\tcopy(newString, []rune(s))\n\n\tbestRepeat := 0\n\tfor i := 0; i < stringLength+k; i++ {\n\t\tfor currentRepeat := 0; currentRepeat <= (stringLength+k-i)/2; currentRepeat++ {\n\t\t\ttandemRepeat := true\n\t\t\tfor j := i; j < i+currentRepeat; j++ {\n\t\t\t\tif newString[j+currentRepeat] != newString[j] && newString[j+currentRepeat] != 0 {\n\t\t\t\t\ttandemRepeat = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif tandemRepeat && currentRepeat > bestRepeat {\n\t\t\t\tbestRepeat = currentRepeat\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Println(2*bestRepeat - 0)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc Judge(line *string, n, k, l int) bool {\n for i := 0; i <= n+k-l*2; i++ {\n var flag bool = true\n for j := 0; j < l; j++ {\n if i+j+l < n && (*line)[i+j] != (*line)[i+j+l] {\n flag = false\n break\n }\n }\n if flag {\n return true\n }\n }\n return false\n}\n\nfunc main() {\n var line string\n var k int\n fmt.Scan(&line, &k)\n var n int = len(line)\n var res int = 0\n for i := (n + k) / 2; i > 0; i-- {\n if Judge(&line, n, k, i) {\n res = i * 2\n break\n }\n }\n fmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\ts, _ := sc.NextLine()\n\tm := len(s)\n\tk, _ := sc.NextLong()\n\tn := m + int(k)\n\n\tisTandemRepeat := func(i, j int) bool {\n\t\tres := true\n\t\tfor k := 0; i+j+k < m && k < j; k++ {\n\t\t\tif s[i+k] != s[i+j+k] {\n\t\t\t\tres = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn res\n\t}\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; i+2*j <= n; j++ {\n\t\t\tif isTandemRepeat(i, j) {\n\t\t\t\tres = maxInt(res, j)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res * 2)\n}\n\n////////////////////////////////////////////////////////////////\n//\n// gojus: retrieved from https://github.com/tnoda/gojus\n//\n\n// NewScanner returns a new Scanner to read from r.\nfunc NewScanner(rdr io.Reader) *Scanner {\n\tsc := Scanner{bufio.NewScanner(rdr), 10}\n\treturn &sc\n}\n\n// Errors returned by Scanner\nvar (\n\tErrNoSuchElement = errors.New(\"gojus.Scanner: input is exhausted.\")\n)\n\n// Scanner provides a similar interface to the java.util.Scaner's one.\ntype Scanner struct {\n\t*bufio.Scanner\n\tradix int\n}\n\n// Next scans and returns the next token of the input.\nfunc (sc *Scanner) Next() (string, error) {\n\tsc.Split(bufio.ScanWords)\n\tif !sc.Scan() {\n\t\treturn \"\", ErrNoSuchElement\n\t}\n\treturn sc.Text(), nil\n}\n\n// UseRadix sets the scanner's default radix to the specified one.\nfunc (sc *Scanner) UseRadix(radix int) *Scanner {\n\tsc.radix = radix\n\treturn sc\n}\n\nfunc (sc *Scanner) nextLong() (int64, error) {\n\tt, e := sc.Next()\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn strconv.ParseInt(t, sc.radix, 64)\n}\n\n// NextLong scans and returns the next token of the input as an int64.\nfunc (sc *Scanner) NextLong() (int64, error) {\n\treturn sc.nextLong()\n}\n\n// NextDouble scans and returns the next token of the input as a float64\nfunc (sc *Scanner) NextDouble() (float64, error) {\n\tt, e := sc.Next()\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn strconv.ParseFloat(t, 64)\n}\n\n// NextLine advances this scanner past the current line and returns\n// the input that was skipped.\nfunc (sc *Scanner) NextLine() (string, error) {\n\tsc.Split(bufio.ScanLines)\n\tif !sc.Scan() {\n\t\treturn \"\", ErrNoSuchElement\n\t}\n\treturn sc.Text(), nil\n}\n\n////////////////////////////////////////////////////////////////\n//\n// int/int64 utilities\n//\nfunc minInt(a, b int) int {\n\tif b < a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxInt(a, b int) int {\n\tif b > a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif b < a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif b > a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n"}, {"source_code": "// 443B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc count(s *string, n, k, l int) bool {\n\tfor i := 0; i <= n+k-l*2; i++ {\n\t\tstat := true\n\t\tfor j := 0; j < l; j++ {\n\t\t\tif i+j+l < n && (*s)[i+j] != (*s)[i+j+l] {\n\t\t\t\tstat = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif stat {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar s string\n\tvar k int\n\tfmt.Scan(&s, &k)\n\tn := len(s)\n\tans := 0\n\tfor i := (n + k) / 2; i > 0; i-- {\n\t\tif count(&s, n, k, i) {\n\t\t\tans = i * 2\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tline, _ := reader.ReadString('\\n')\n\n\ts := strings.TrimSpace(line)\n\tstringLength := len(s)\n\n\tline, _ = reader.ReadString('\\n')\n\tvar k int\n\n\tfmt.Sscanf(line, \"%d\", &k)\n\n\tnewString := make([]rune, stringLength+k)\n\tcopy(newString, []rune(s))\n\n\tbestRepeat := 0\n\tfor i := 0; i < stringLength+k; i++ {\n\t\tcurrentRepeat := 0\n\t\tfor i+currentRepeat < stringLength+k && currentRepeat <= (stringLength+k-i)/2 {\n\t\t\tif newString[i+currentRepeat] == newString[i] || newString[i+currentRepeat] == 0 {\n\t\t\t\tif currentRepeat > bestRepeat {\n\t\t\t\t\tbestRepeat = currentRepeat\n\t\t\t\t}\n\t\t\t}\n\t\t\tcurrentRepeat++\n\t\t}\n\t}\n\tfmt.Println(2 * (bestRepeat - 0))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\ts, _ := sc.NextLine()\n\tm := len(s)\n\tk, _ := sc.NextLong()\n\tn := m + int(k)\n\n\tisTandemRepeat := func(i, j int) bool {\n\t\tres := true\n\t\tfor k := 0; i+2*k < m; k++ {\n\t\t\tif s[i+k] != s[i+2*k] {\n\t\t\t\tres = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\treturn res\n\t}\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; i+2*j <= n; j++ {\n\t\t\tif isTandemRepeat(i, j) {\n\t\t\t\tres = maxInt(res, j)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(res * 2)\n}\n\n////////////////////////////////////////////////////////////////\n//\n// gojus: retrieved from https://github.com/tnoda/gojus\n//\n\n// NewScanner returns a new Scanner to read from r.\nfunc NewScanner(rdr io.Reader) *Scanner {\n\tsc := Scanner{bufio.NewScanner(rdr), 10}\n\treturn &sc\n}\n\n// Errors returned by Scanner\nvar (\n\tErrNoSuchElement = errors.New(\"gojus.Scanner: input is exhausted.\")\n)\n\n// Scanner provides a similar interface to the java.util.Scaner's one.\ntype Scanner struct {\n\t*bufio.Scanner\n\tradix int\n}\n\n// Next scans and returns the next token of the input.\nfunc (sc *Scanner) Next() (string, error) {\n\tsc.Split(bufio.ScanWords)\n\tif !sc.Scan() {\n\t\treturn \"\", ErrNoSuchElement\n\t}\n\treturn sc.Text(), nil\n}\n\n// UseRadix sets the scanner's default radix to the specified one.\nfunc (sc *Scanner) UseRadix(radix int) *Scanner {\n\tsc.radix = radix\n\treturn sc\n}\n\nfunc (sc *Scanner) nextLong() (int64, error) {\n\tt, e := sc.Next()\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn strconv.ParseInt(t, sc.radix, 64)\n}\n\n// NextLong scans and returns the next token of the input as an int64.\nfunc (sc *Scanner) NextLong() (int64, error) {\n\treturn sc.nextLong()\n}\n\n// NextDouble scans and returns the next token of the input as a float64\nfunc (sc *Scanner) NextDouble() (float64, error) {\n\tt, e := sc.Next()\n\tif e != nil {\n\t\treturn 0, e\n\t}\n\treturn strconv.ParseFloat(t, 64)\n}\n\n// NextLine advances this scanner past the current line and returns\n// the input that was skipped.\nfunc (sc *Scanner) NextLine() (string, error) {\n\tsc.Split(bufio.ScanLines)\n\tif !sc.Scan() {\n\t\treturn \"\", ErrNoSuchElement\n\t}\n\treturn sc.Text(), nil\n}\n\n////////////////////////////////////////////////////////////////\n//\n// int/int64 utilities\n//\nfunc minInt(a, b int) int {\n\tif b < a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxInt(a, b int) int {\n\tif b > a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif b < a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxInt64(a, b int64) int64 {\n\tif b > a {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt64(x int64) int64 {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n"}, {"source_code": "// 443B\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar st string\n\tvar ans, i, j, k, n, length, flag, max int\n\tin := bufio.NewScanner(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tin.Split(bufio.ScanWords)\n\tin.Scan()\n\tst = in.Text()\n\tlength = len(st)\n\tfmt.Scan(&n)\n\tans = n + length\n\tmax = 0\n\tfor i = 0; i < ans; i++ {\n\t\tfor j = 0; i+2*j-1 < ans; j++ {\n\t\t\tflag = 0\n\t\t\tfor k = i; k < i+j; k++ {\n\t\t\t\tif k >= length || j+k >= length || st[k] == st[j+k] {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tflag = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag == 0 {\n\t\t\t\tif 2*j > max {\n\t\t\t\t\tmax = 2 * j\n\t\t\t\t}\n\t\t\t}\n\t\t\tmax = 2 * j\n\t\t}\n\t}\n\tfmt.Fprintln(out, max)\n\tout.Flush()\n}\n"}, {"source_code": "// 443B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar st [500]string\n\tvar ans, i, j, k, n, length, flag, max int\n\tfmt.Scan(&st)\n\tlength = len(st)\n\tfmt.Scan(&n)\n\tans = n + length\n\tmax = 0\n\tfor i = 0; i < ans; i++ {\n\t\tfor j = 0; i+2*j-1 < ans; j++ {\t\t\t\nflag = 0\n\t\t\tfor k = i; k < i+j; k++ {\n\t\t\t\tif k >= length || j+k >= length || st[k] == st[j+k] {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tflag = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag == 0 {\n\t\t\t\tif 2*j > max {\n\t\t\t\t\tmax = 2 * j\n\t\t\t\t}\n\t\t\t}\n\t\t\tmax = 2 * j\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n"}], "src_uid": "bb65667b65ff069a9c0c9e8fe31da8ab"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc pow(x, y int) uint64 {\n\tvar ans uint64\n\tans = 1\n\tfor i := 0; i < y; i++ {\n\t\tans *= uint64(x)\n\t}\n\treturn ans\n}\n\nfunc calc_s(x uint64) uint64 {\n\tvar ans uint64\n\tans = 0\n\tfor x != 0 {\n\t\tans += x % 10\n\t\tx /= 10\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tans := make([]int, 81, 81)\n\ti := 0\n\tfor s := 1; s <= 81; s++ {\n\t\tvar x uint64\n\t\tx = uint64(b)*pow(s, a) + uint64(c)\n\t\tif x < uint64(1000000000) && uint64(s) == calc_s(x) {\n\t\t\tans[i] = int(x)\n\t\t\ti++\n\t\t}\n\t}\n\n\tfmt.Println(i)\n\tif i > 0 {\n\t\tfor j := 0; j < i; j++ {\n\t\t\tfmt.Print(ans[j], \" \")\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// x\u2009=\u2009b\u00b7s(x)^a\u2009+\u2009c\n\nfunc main() {\n\tconst max_x int64 = 1000000000\n\tconst max_digits int64 = 9\n\n\tvar a, b, c int64\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &a, &b, &c); err != nil {\n\t\treturn\n\t}\n\n\tcnt := 0\n\tvar all_res []string\n\n\tfor i := int64(1); i <= 9*max_digits; i++ {\n\t\ty := b*power(i, a) + c\n\t\tif y < max_x && s(y) == i {\n\t\t\tcnt++\n\t\t\tall_res = append(all_res, strconv.FormatInt(y, 10))\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\tfmt.Println(strings.Join(all_res, \" \"))\n}\n\nfunc s(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc power(sx, n int64) int64 {\n\tres := sx\n\tfor i := int64(1); i < n; i++ {\n\t\tres *= sx\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Sum(x int64) int64 {\n var result int64\n for x != 0 {\n result += int64(math.Mod(float64(x), 10.0))\n x = x / 10\n }\n\n return result\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b, c int64\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n line, _ = reader.ReadString(' ')\n fmt.Sscanln(line, &b)\n fmt.Sscanln(Read(reader), &c)\n\n writer := bufio.NewWriter(os.Stdout)\n // s(x) can be from 1 to 81\n var result []int64\n for i := 1; i <= 81; i++ {\n right := b * int64(math.Pow(float64(i), float64(a))) + c\n if right < 1000000000 {\n left := Sum(right)\n\n if left == int64(i) {\n result = append(result, right)\n } \n }\n }\n\n \n Write(writer, len(result))\n for i := range result {\n fmt.Fprint(writer, result[i]) \n fmt.Fprint(writer, \" \") \n }\n \n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc S(x int64) int64 {\n\tvar res int64 = 0\n\tfor x != 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc Pow(x, a int64) int64 {\n\tvar res int64 = 1\n\tfor i := 0; int64(i) < a; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar a, b, c int64\n\tfmt.Fscan(reader, &a, &b, &c)\n\tvar num_res = 0\n\tvar res []int64 = make([]int64, 40)\n\tfor i := 1; i < 82; i++ {\n\t\tvar x int64 = b*Pow(int64(i), a) + c\n\t\tif x < 1000000000 && S(x) == int64(i) {\n\t\t\tres[num_res] = x\n\t\t\tnum_res++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, num_res)\n\tfor i := 0; i < num_res; i++ {\n\t\tfmt.Fprintf(writer, \"%d \", res[i])\n\t}\n\tfmt.Fprintln(writer)\n\twriter.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc sum(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar b, c int64\n\tvar a int\n\tfmt.Scan(&a, &b, &c)\n\tvar res []int\n\tfor s := int64(1); s <= 9*9; s++ {\n\t\tr := s\n\t\tfor i := 1; i < a; i++ {\n\t\t\tr *= s\n\t\t}\n\t\tr = b*r + c\n\t\tif sum(r) == s && r < 1000000000 {\n\t\t\tres = append(res, int(r))\n\t\t}\n\t}\n\n\tsort.Ints(res)\n\tfmt.Println(len(res))\n\tfor i, r := range res {\n\t\tfmt.Print(r)\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Print(\"\\n\")\n\t\t} else {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc sum(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar b, c int64\n\tvar a int\n\tfmt.Scan(&a, &b, &c)\n\tvar res []int\n\tfor s := int64(1); s <= 9*9; s++ {\n\t\tr := s\n\t\tfor i := 1; i < a; i++ {\n\t\t\tr *= s\n\t\t}\n\t\tr = b*r + c\n\t\tif sum(r) == s {\n\t\t\tres = append(res, int(r))\n\t\t}\n\t}\n\n\tsort.Ints(res)\n\tfmt.Println(len(res))\n\tfor i, r := range res {\n\t\tfmt.Print(r)\n\t\tif i == len(res)-1 {\n\t\t\tfmt.Print(\"\\n\")\n\t\t} else {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// x\u2009=\u2009b\u00b7s(x)^a\u2009+\u2009c\n\nfunc main() {\n\tconst max_digits int64 = 9\n\n\tvar a, b, c int64\n\tif _, err := fmt.Scanf(\"%d %d %d\\n\", &a, &b, &c); err != nil {\n\t\treturn\n\t}\n\n\tcnt := 0\n\tvar all_res []string\n\n\tfor i := int64(1); i < max_digits*max_digits; i++ {\n\t\ty := b*power(i, a) + c\n\t\tif s(y) == i {\n\t\t\tcnt++\n\t\t\tall_res = append(all_res, strconv.FormatInt(y, 10))\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\tfmt.Println(strings.Join(all_res, \" \"))\n}\n\nfunc s(x int64) int64 {\n\tres := int64(0)\n\tfor x > 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc power(sx, n int64) int64 {\n\tres := sx\n\tfor i := int64(1); i < n; i++ {\n\t\tres *= sx\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Sum(x int) int {\n var result int\n for x != 0 {\n result += int(math.Mod(float64(x), 10.0))\n x = x / 10\n }\n\n return result\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b, c int\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n line, _ = reader.ReadString(' ')\n fmt.Sscanln(line, &b)\n fmt.Sscanln(Read(reader), &c)\n\n // s(x) can be from 1 to 81\n var result []int\n for i := 1; i <= 81; i++ {\n right := b * int(math.Pow(float64(i), float64(a))) + c\n left := Sum(right)\n\n if left == i {\n result = append(result, right)\n }\n }\n\n writer := bufio.NewWriter(os.Stdout)\n Write(writer, len(result))\n for i := range result {\n fmt.Fprint(writer, result[i]) \n fmt.Fprint(writer, \" \") \n }\n \n writer.Flush()\n}"}, {"source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Sum(x int) int {\n var result int\n for x != 0 {\n result += int(math.Mod(float64(x), 10.0))\n x = x / 10\n }\n\n return result\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b, c int\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n line, _ = reader.ReadString(' ')\n fmt.Sscanln(line, &b)\n fmt.Sscanln(Read(reader), &c)\n\n // s(x) can be from 1 to 81\n var result []int\n for i := 1; i <= 81; i++ {\n right := b * int(math.Pow(float64(i), float64(a))) + c\n if right < 1000000000 {\n left := Sum(right)\n\n if left == i {\n result = append(result, right)\n } \n }\n }\n\n writer := bufio.NewWriter(os.Stdout)\n Write(writer, len(result))\n for i := range result {\n fmt.Fprint(writer, result[i]) \n fmt.Fprint(writer, \" \") \n }\n \n writer.Flush()\n}"}, {"source_code": "package main\n\nimport \"bufio\"\nimport \"os\"\nimport \"fmt\"\nimport \"math\"\n\nfunc Read(s *bufio.Reader) string {\n line, _ := s.ReadString('\\n')\n return line\n}\n\nfunc Write(s *bufio.Writer, a ...interface{}) {\n fmt.Fprintln(s, a...)\n s.Flush()\n}\n\nfunc Sum(x int64) int64 {\n var result int64\n for x != 0 {\n result += int64(math.Mod(float64(x), 10.0))\n x = x / 10\n }\n\n return result\n}\n\nfunc main() {\n reader := bufio.NewReader(os.Stdin)\n \n var a, b, c int64\n line, _ := reader.ReadString(' ')\n fmt.Sscanln(line, &a)\n line, _ = reader.ReadString(' ')\n fmt.Sscanln(line, &b)\n fmt.Sscanln(Read(reader), &c)\n\n writer := bufio.NewWriter(os.Stdout)\n // s(x) can be from 1 to 81\n var result []int64\n for i := 1; i <= 81; i++ {\n right := b * int64(math.Pow(float64(i), float64(a))) + c\n if right < 1000000000 {\n left := Sum(right)\n\n if left == int64(i) {\n Write(writer, left, right)\n result = append(result, right)\n } \n }\n }\n\n \n Write(writer, len(result))\n for i := range result {\n fmt.Fprint(writer, result[i]) \n fmt.Fprint(writer, \" \") \n }\n \n writer.Flush()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc S(x int64) int64 {\n\tvar res int64 = 0\n\tfor x != 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc Pow(x, a int64) int64 {\n\tvar res int64 = 1\n\tfor i := 0; int64(i) < a; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar a, b, c int64\n\tfmt.Fscan(reader, &a, &b, &c)\n\tvar num_res = 0\n\tvar res []int64 = make([]int64, 40)\n\tfor i := 0; i < 40; i++ {\n\t\tvar x int64 = b*Pow(int64(i), a) + c\n\t\tif x < 1000000000 && S(x) == int64(i) {\n\t\t\tres[num_res] = x\n\t\t\tnum_res++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, num_res)\n\tfor i := 0; i < num_res; i++ {\n\t\tfmt.Fprintf(writer, \"%d \", res[i])\n\t}\n\tfmt.Fprintln(writer)\n\twriter.Flush()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc S(x int64) int64 {\n\tvar res int64 = 0\n\tfor x != 0 {\n\t\tres += x % 10\n\t\tx /= 10\n\t}\n\treturn res\n}\n\nfunc Pow(x, a int64) int64 {\n\tvar res int64 = 1\n\tfor i := 0; int64(i) < a; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tvar a, b, c int64\n\tfmt.Fscan(reader, &a, &b, &c)\n\tvar num_res = 0\n\tvar res []int64 = make([]int64, 40)\n\tfor i := 1; i < 40; i++ {\n\t\tvar x int64 = b*Pow(int64(i), a) + c\n\t\tif x < 1000000000 && S(x) == int64(i) {\n\t\t\tres[num_res] = x\n\t\t\tnum_res++\n\t\t}\n\t}\n\tfmt.Fprintln(writer, num_res)\n\tfor i := 0; i < num_res; i++ {\n\t\tfmt.Fprintf(writer, \"%d \", res[i])\n\t}\n\tfmt.Fprintln(writer)\n\twriter.Flush()\n}\n"}], "src_uid": "e477185b94f93006d7ae84c8f0817009"} {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1230/problem/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Edge struct {\n\tA int\n\tB int\n}\n\nfunc createMatrix(n int, m int, edges []Edge) [][]bool {\n\tmatrix := make([][]bool, n)\n\tfor i := 0; i < n; i++ {\n\t\tmatrix[i] = make([]bool, n)\n\t}\n\tfor _, edge := range edges {\n\t\tmatrix[edge.A-1][edge.B-1] = true\n\t\tmatrix[edge.B-1][edge.A-1] = true\n\t}\n\treturn matrix\n}\n\nfunc Solve(n int, m int, edges []Edge) int {\n\tif n < 7 {\n\t\treturn m\n\t}\n\tmatrix := createMatrix(n, m, edges)\n\tminMutualNeighbors := n + 1\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tmutualNeighbors := 0\n\t\t\tfor z := 0; z < n; z++ {\n\t\t\t\tif z != i && z != j && matrix[i][z] && matrix[j][z] {\n\t\t\t\t\tmutualNeighbors += 1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif mutualNeighbors < minMutualNeighbors {\n\t\t\t\tminMutualNeighbors = mutualNeighbors\n\t\t\t}\n\t\t}\n\t}\n\treturn m - minMutualNeighbors\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\tedges := make([]Edge, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscanf(reader, \"%d %d\\n\", &edges[i].A, &edges[i].B)\n\t}\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, m, edges))\n}\n", "positive_code": [{"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [10][10]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\n\tif n <= 6 {\n\t\tfmt.Println(m)\n\t} else {\n\t\tfmt.Println(sub())\n\t}\n}\n\nfunc sub() int {\n\tres := 0\n\n\t// i, j\u3092\u540c\u3058\u6570\u5b57\u3068\u3059\u308b\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\t// \u30ce\u30fc\u30c9\u306b\u30b5\u30a4\u30b3\u30ed\u306e\u76ee\u3092\u5272\u308a\u632f\u308b\n\t\t\tmemo := make(map[int]int)\n\t\t\tdice := 1\n\t\t\tfor k := 1; k <= n; k++ {\n\t\t\t\tif k == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmemo[k] = dice\n\t\t\t\tdice++\n\t\t\t}\n\t\t\tmemo[j] = memo[i]\n\n\t\t\ttmp := 0\n\t\t\tinitialize()\n\t\t\tfor l := 1; l <= n; l++ {\n\t\t\t\tfor m := l + 1; m <= n; m++ {\n\t\t\t\t\tll, mm := memo[l], memo[m]\n\t\t\t\t\tif ll > mm {\n\t\t\t\t\t\tll, mm = mm, ll\n\t\t\t\t\t}\n\t\t\t\t\tif adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {\n\t\t\t\t\t\ttmp++\n\t\t\t\t\t\tdominoMatrix[ll][mm] = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tChMax(&res, tmp)\n\t\t}\n\t}\n\n\treturn res\n}\n\nfunc initialize() {\n\tfor i := 1; i <= 6; i++ {\n\t\tdominoMatrix[i][i] = 1\n\t\tfor j := i + 1; j <= 6; j++ {\n\t\t\tdominoMatrix[i][j] = 1\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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\t// str := 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 n, m int\n\nvar ans int\nvar edges []Edge\n\ntype Edge struct {\n\ts, t int\n}\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ts, t := ReadInt2()\n\t\ts--\n\t\tt--\n\t\tedges = append(edges, Edge{s, t})\n\t}\n\n\tv := []int{}\n\tdfs(v)\n\tfmt.Println(ans)\n}\n\nfunc dfs(v []int) {\n\tif len(v) == n {\n\t\tA := [6][6]int{}\n\t\tfor i := 0; i < 6; i++ {\n\t\t\tfor j := 0; j < 6; j++ {\n\t\t\t\tA[i][j] = 1\n\t\t\t}\n\t\t}\n\n\t\tcnt := 0\n\t\tfor _, e := range edges {\n\t\t\tl, r := v[e.s], v[e.t]\n\t\t\tif A[l][r] == 1 {\n\t\t\t\tA[l][r], A[r][l] = 0, 0\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t\tChMax(&ans, cnt)\n\t} else {\n\t\tfor i := 0; i <= 5; i++ {\n\t\t\ttmp := CopySlice(v)\n\t\t\ttmp = append(tmp, i)\n\t\t\tdfs(tmp)\n\t\t}\n\t}\n}\n\nfunc CopySlice(v []int) []int {\n\tres := make([]int, len(v))\n\tfor i := 0; i < len(v); i++ {\n\t\tres[i] = v[i]\n\t}\n\treturn res\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\n\tans := 0\n\tfor v, e := range edges {\n\t\tif len(e) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor w, e2 := range edges {\n\t\t\tif w == v || len(e2) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelta := 0\n\t\t\tfor _, u := range e2 {\n\t\t\t\tif u == v {\n\t\t\t\t\tdelta = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tmp := map[int]int{}\n\t\t\tfor _, u := range append(e, e2...) {\n\t\t\t\tif u == v {\n\t\t\t\t\tu = w\n\t\t\t\t}\n\t\t\t\tmp[u] = 1\n\t\t\t}\n\t\t\tdelta = len(e) + len(e2) - delta - len(mp)\n\t\t\tif newAns := m - delta; newAns > ans {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\t}\n\tFprintln(out, ans)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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\t// str := 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 n, m int\n\nvar edges []Edge\n\ntype Edge struct {\n\ts, t int\n}\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ts, t := ReadInt2()\n\t\ts--\n\t\tt--\n\t\tedges = append(edges, Edge{s, t})\n\t}\n\n\tans := 0\n\tpatterns := DuplicatePatterns([]int{0, 1, 2, 3, 4, 5}, n)\n\tfor _, p := range patterns {\n\t\tA := [6][6]int{}\n\t\tfor i := 0; i < 6; i++ {\n\t\t\tfor j := 0; j < 6; j++ {\n\t\t\t\tA[i][j] = 1\n\t\t\t}\n\t\t}\n\n\t\tcnt := 0\n\t\tfor _, e := range edges {\n\t\t\tl, r := p[e.s], p[e.t]\n\t\t\tif A[l][r] == 1 {\n\t\t\t\tA[l][r], A[r][l] = 0, 0\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t\tChMax(&ans, cnt)\n\t}\n\n\tfmt.Println(ans)\n}\n\n// DuplicatePatterns returns all patterns of n^k of elems([]int).\nfunc DuplicatePatterns(elems []int, k int) [][]int {\n\treturn dupliRec([]int{}, elems, k)\n}\n\n// DFS function for DuplicatePatterns.\nfunc dupliRec(pattern, elems []int, k int) [][]int {\n\tif len(pattern) == k {\n\t\treturn [][]int{pattern}\n\t}\n\n\tres := [][]int{}\n\tfor _, e := range elems {\n\t\tnewPattern := make([]int, 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// func dfs(v []int) {\n// \tif len(v) == n {\n// \t\tA := [6][6]int{}\n// \t\tfor i := 0; i < 6; i++ {\n// \t\t\tfor j := 0; j < 6; j++ {\n// \t\t\t\tA[i][j] = 1\n// \t\t\t}\n// \t\t}\n\n// \t\tcnt := 0\n// \t\tfor _, e := range edges {\n// \t\t\tl, r := v[e.s], v[e.t]\n// \t\t\tif A[l][r] == 1 {\n// \t\t\t\tA[l][r], A[r][l] = 0, 0\n// \t\t\t\tcnt++\n// \t\t\t}\n// \t\t}\n// \t\tChMax(&ans, cnt)\n// \t} else {\n// \t\tfor i := 0; i <= 5; i++ {\n// \t\t\ttmp := CopySlice(v)\n// \t\t\ttmp = append(tmp, i)\n// \t\t\tdfs(tmp)\n// \t\t}\n// \t}\n// }\n\n// func CopySlice(v []int) []int {\n// \tres := make([]int, len(v))\n// \tfor i := 0; i < len(v); i++ {\n// \t\tres[i] = v[i]\n// \t}\n// \treturn res\n// }\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}], "negative_code": [{"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [10][10]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\n\tif n <= 6 {\n\t\tfmt.Println(m)\n\t} else {\n\t\tfmt.Println(sub())\n\t}\n}\n\nfunc sub() int {\n\tres := 0\n\n\t// i, j\u3092\u540c\u3058\u6570\u5b57\u3068\u3059\u308b\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\t// \u30ce\u30fc\u30c9\u306b\u30b5\u30a4\u30b3\u30ed\u306e\u76ee\u3092\u5272\u308a\u632f\u308b\n\t\t\tmemo := make(map[int]int)\n\t\t\tdice := 1\n\t\t\tfor k := 1; k <= n; k++ {\n\t\t\t\tif k == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmemo[k] = dice\n\t\t\t\tdice++\n\t\t\t}\n\t\t\tmemo[j] = memo[i]\n\n\t\t\ttmp := 0\n\t\t\tinitialize()\n\t\t\tfor l := 1; l <= n; l++ {\n\t\t\t\tfor m := l + 1; m <= n; m++ {\n\t\t\t\t\tll, mm := memo[l], memo[m]\n\t\t\t\t\tif adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {\n\t\t\t\t\t\ttmp++\n\t\t\t\t\t\tdominoMatrix[ll][mm] = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tChMax(&res, tmp)\n\t\t}\n\t}\n\n\treturn res\n}\n\nfunc initialize() {\n\tfor i := 1; i <= 6; i++ {\n\t\tdominoMatrix[i][i] = 1\n\t\tfor j := i + 1; j <= 6; j++ {\n\t\t\tdominoMatrix[i][j] = 1\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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\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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [7][7]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\t// for i := 1; i <= n; i++ {\n\t// \tfmt.Println(adjMatrix[i])\n\t// }\n\t// initialize()\n\t// for i := 1; i <= 6; i++ {\n\t// \tfmt.Println(dominoMatrix[i])\n\t// }\n\n\tif n == 7 {\n\t\tans := 0\n\t\tfor i := 1; i <= n; i++ {\n\t\t\tinitialize()\n\t\t\ttmp := sub(i)\n\t\t\tChMax(&ans, tmp)\n\t\t}\n\t\tfmt.Println(ans)\n\t} else {\n\t\tfmt.Println(subsub())\n\t}\n}\n\nfunc subsub() int {\n\tres := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tif adjMatrix[i][j] == 1 {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\n// sevenId \u3092 7\u3068\u3057\u305f\u3068\u304d\u306e\u7f6e\u3051\u308b\u30c9\u30df\u30ce\u306e\u6570\nfunc sub(sevenId int) int {\n\tres := 0\n\n\t// memo: \u30ce\u30fc\u30c9ID\u304b\u3089\u30c9\u30df\u30ce\u306e\u6570\u3078\u306e\u30de\u30c3\u30d7\n\tmemo := make(map[int]int)\n\tdominoNum := 1\n\tfor i := 1; i <= n; i++ {\n\t\tif i == sevenId {\n\t\t\tcontinue\n\t\t}\n\t\tmemo[i] = dominoNum\n\t\tdominoNum++\n\t}\n\tmemo[sevenId] = dominoNum\n\t// memo\u306e\u9006\u5f15\u304d\n\trevMemo := make(map[int]int)\n\tfor k, v := range memo {\n\t\trevMemo[v] = k\n\t}\n\n\t// sevenId\u4ee5\u5916\u306e\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30c9\u30df\u30ce\u6570\u306b\u57fa\u3065\u3044\u3066\u30c9\u30df\u30ce\u3092\u304a\u3044\u3066\u3044\u304f\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\t// i, j\u306f\u901a\u5e38\u306e\u30ce\u30fc\u30c9\u756a\u53f7\n\t\t\tif i == sevenId || j == sevenId {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif adjMatrix[i][j] == 1 {\n\t\t\t\tres++\n\n\t\t\t\t// i, j\u3092\u30c9\u30df\u30ce\u6570\u306b\u5909\u63db\n\t\t\t\t// di\u306e\u307b\u3046\u3092\u5e38\u306b\u5c0f\u3055\u304f\n\t\t\t\tdi := memo[i]\n\t\t\t\tdj := memo[j]\n\t\t\t\tif di > dj {\n\t\t\t\t\tdi, dj = dj, di\n\t\t\t\t}\n\t\t\t\tdominoMatrix[di][dj] = 0 // \u30c9\u30df\u30ce\u3092\u6d88\u8cbb\n\t\t\t}\n\t\t}\n\t}\n\n\t// i: sevenId \u306e\u30c9\u30df\u30ce\u6570\u3092i\u3068\u3059\u308b\n\tresres := 0\n\tfor i := 1; i <= 6; i++ {\n\t\tdi := i\n\t\ttmpRes := 0\n\n\t\t// \u4ed6\u65b9\u306e\u30ce\u30fc\u30c9\u3059\u3079\u3066\u3092\u8abf\u3079\u308b\n\t\tfor j := 1; j <= 6; j++ {\n\t\t\tdj := j\n\t\t\tni, nj := sevenId, revMemo[dj]\n\t\t\tif di > dj {\n\t\t\t\tdi, dj = dj, di\n\t\t\t}\n\n\t\t\t// \u30c9\u30df\u30ce\u304c\u672a\u4f7f\u7528\u304b\u3064\u30a8\u30c3\u30b8\u304c\u30a2\u30ec\u3070\u30c9\u30df\u30ce\u3092\u8a2d\u7f6e\u3067\u304d\u308b\n\t\t\tif dominoMatrix[di][dj] == 1 && adjMatrix[ni][nj] == 1 {\n\t\t\t\ttmpRes++\n\t\t\t}\n\t\t}\n\n\t\tChMax(&resres, tmpRes)\n\t}\n\n\treturn res + resres\n}\n\nfunc initialize() {\n\tfor i := 1; i <= 6; i++ {\n\t\tfor j := i; j <= 6; j++ {\n\t\t\tdominoMatrix[i][j] = 1\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [7][7]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\n\tif n <= 6 {\n\t\tfmt.Println(m)\n\t} else {\n\t\tfmt.Println(sub())\n\t}\n}\n\nfunc sub() int {\n\tres := 0\n\n\t// i, j\u3092\u540c\u3058\u6570\u5b57\u3068\u3059\u308b\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\t// j \u306f\u9664\u5916\u3057\u3066\u7f6e\u3051\u308b\u30c9\u30df\u30ce\u306e\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3001\u6700\u5f8c\u306bi, j\u306b\u8fba\u304c\u3042\u308c\u3070\u4e00\u3064\u52a0\u7b97\u3059\u308b\n\t\t\ttmp := 0\n\t\t\tfor l := 1; l <= n; l++ {\n\t\t\t\tfor m := l + 1; m <= n; m++ {\n\t\t\t\t\tif l == j || m == j {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tif adjMatrix[l][m] == 1 {\n\t\t\t\t\t\ttmp++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif adjMatrix[i][j] == 1 {\n\t\t\t\ttmp++\n\t\t\t}\n\n\t\t\tChMax(&res, tmp)\n\t\t}\n\t}\n\n\treturn res\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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// 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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [10][10]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\n\tif n <= 6 {\n\t\tfmt.Println(m)\n\t} else {\n\t\tfmt.Println(sub())\n\t}\n}\n\nfunc sub() int {\n\tres := 0\n\n\t// i, j\u3092\u540c\u3058\u6570\u5b57\u3068\u3059\u308b\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\tmemo := make(map[int]int)\n\t\t\tdice := 1\n\t\t\tfor k := 1; k <= n; k++ {\n\t\t\t\tif k == j {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmemo[k] = dice\n\t\t\t\tdice++\n\t\t\t}\n\t\t\tmemo[j] = memo[i]\n\n\t\t\ttmp := 0\n\t\t\tinitialize()\n\t\t\tfor l := 1; l <= n; l++ {\n\t\t\t\tfor m := l + 1; m <= n; m++ {\n\t\t\t\t\tll, mm := memo[l], memo[m]\n\t\t\t\t\tif adjMatrix[l][m] == 1 && dominoMatrix[ll][mm] == 1 {\n\t\t\t\t\t\ttmp++\n\t\t\t\t\t\tdominoMatrix[ll][mm] = 0\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif adjMatrix[i][j] == 1 {\n\t\t\t\ttmp++\n\t\t\t}\n\n\t\t\tChMax(&res, tmp)\n\t\t}\n\t}\n\n\treturn res\n}\n\nfunc initialize() {\n\tfor i := 1; i <= 6; i++ {\n\t\tfor j := i + 1; j <= 6; j++ {\n\t\t\tdominoMatrix[i][j] = 1\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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\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 (\u4e8c\u5206\u7d2f\u4e57\u6cd5(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, m int\n\nvar adjMatrix [10][10]int\nvar dominoMatrix [7][7]int\n\nfunc main() {\n\tn, m = ReadInt2()\n\tfor i := 0; i < m; i++ {\n\t\ta, b := ReadInt2()\n\t\t// \u5e38\u306ba\u3092b\u3088\u308a\u5c0f\u3055\u304f\u3059\u308b\n\t\tif a > b {\n\t\t\ta, b = b, a\n\t\t}\n\t\tadjMatrix[a][b] = 1\n\t\tadjMatrix[b][a] = 1\n\t}\n\t// for i := 1; i <= n; i++ {\n\t// \tfmt.Println(adjMatrix[i])\n\t// }\n\t// initialize()\n\t// for i := 1; i <= 6; i++ {\n\t// \tfmt.Println(dominoMatrix[i])\n\t// }\n\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tinitialize()\n\t\ttmp := sub(i)\n\t\tChMax(&ans, tmp)\n\t}\n\n\tfmt.Println(ans)\n}\n\n// sevenId \u3092 7\u3068\u3057\u305f\u3068\u304d\u306e\u7f6e\u3051\u308b\u30c9\u30df\u30ce\u306e\u6570\nfunc sub(sevenId int) int {\n\tres := 0\n\n\t// memo: \u30ce\u30fc\u30c9ID\u304b\u3089\u30c9\u30df\u30ce\u306e\u6570\u3078\u306e\u30de\u30c3\u30d7\n\tmemo := make(map[int]int)\n\tdominoNum := 1\n\tfor i := 1; i <= n; i++ {\n\t\tif i == sevenId {\n\t\t\tcontinue\n\t\t}\n\t\tmemo[i] = dominoNum\n\t\tdominoNum++\n\t}\n\tmemo[sevenId] = dominoNum\n\t// memo\u306e\u9006\u5f15\u304d\n\trevMemo := make(map[int]int)\n\tfor k, v := range memo {\n\t\trevMemo[v] = k\n\t}\n\n\t// sevenId\u4ee5\u5916\u306e\u30ce\u30fc\u30c9\u306b\u3064\u3044\u3066\u3001\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30c9\u30df\u30ce\u6570\u306b\u57fa\u3065\u3044\u3066\u30c9\u30df\u30ce\u3092\u304a\u3044\u3066\u3044\u304f\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := i + 1; j <= n; j++ {\n\t\t\t// i, j\u306f\u901a\u5e38\u306e\u30ce\u30fc\u30c9\u756a\u53f7\n\t\t\tif i == sevenId || j == sevenId {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif adjMatrix[i][j] == 1 {\n\t\t\t\tres++\n\n\t\t\t\t// i, j\u3092\u30c9\u30df\u30ce\u6570\u306b\u5909\u63db\n\t\t\t\t// di\u306e\u307b\u3046\u3092\u5e38\u306b\u5c0f\u3055\u304f\n\t\t\t\tdi := memo[i]\n\t\t\t\tdj := memo[j]\n\t\t\t\tif di > dj {\n\t\t\t\t\tdi, dj = dj, di\n\t\t\t\t}\n\t\t\t\tdominoMatrix[di][dj] = 0 // \u30c9\u30df\u30ce\u3092\u6d88\u8cbb\n\t\t\t}\n\t\t}\n\t}\n\n\t// i: sevenId \u306e\u30c9\u30df\u30ce\u6570\u3092i\u3068\u3059\u308b\n\tresres := 0\n\tfor i := 1; i <= 6; i++ {\n\t\tdi := i\n\t\ttmpRes := 0\n\n\t\t// \u4ed6\u65b9\u306e\u30ce\u30fc\u30c9\u3059\u3079\u3066\u3092\u8abf\u3079\u308b\n\t\tfor j := 1; j <= 6; j++ {\n\t\t\tdj := j\n\t\t\tni, nj := sevenId, revMemo[dj]\n\t\t\tif di > dj {\n\t\t\t\tdi, dj = dj, di\n\t\t\t}\n\n\t\t\t// \u30c9\u30df\u30ce\u304c\u672a\u4f7f\u7528\u304b\u3064\u30a8\u30c3\u30b8\u304c\u30a2\u30ec\u3070\u30c9\u30df\u30ce\u3092\u8a2d\u7f6e\u3067\u304d\u308b\n\t\t\tif dominoMatrix[di][dj] == 1 && adjMatrix[ni][nj] == 1 {\n\t\t\t\ttmpRes++\n\t\t\t}\n\t\t}\n\n\t\tChMax(&resres, tmpRes)\n\t}\n\n\treturn res + resres\n}\n\nfunc initialize() {\n\tfor i := 1; i <= 6; i++ {\n\t\tfor j := i; j <= 6; j++ {\n\t\t\tdominoMatrix[i][j] = 1\n\t\t}\n\t}\n}\n\n// MOD\u306f\u3068\u3063\u305f\u304b\uff1f\n// \u9077\u79fb\u3060\u3051\u3058\u3083\u306a\u304f\u3066\u6700\u5f8c\u306e\u6700\u5f8c\u3067\u3061\u3083\u3093\u3068\u53d6\u308c\u3088\uff1f\n\n/*******************************************************************/\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\tminDeg := 100\n\tfor _, e := range edges {\n\t\tif len(e) > 0 && len(e) < minDeg {\n\t\t\tminDeg = len(e)\n\t\t}\n\t}\n\tans := m - minDeg + 1\n\tfor v, e := range edges {\n\t\tif len(e) != minDeg {\n\t\t\tcontinue\n\t\t}\n\t\tfor w, e2 := range edges {\n\t\t\tif len(e2) <= minDeg {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelta := 0\n\t\t\tfor _, ee := range e2 {\n\t\t\t\tif ee == v {\n\t\t\t\t\tdelta = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tmp := map[int]int{}\n\t\t\tfor _, ee := range append(e, e2...) {\n\t\t\t\tif ee == v {\n\t\t\t\t\tee = w\n\t\t\t\t}\n\t\t\t\tmp[ee] = 1\n\t\t\t}\n\t\t\tif newAns := m - (len(e) + len(e2) - delta - len(mp)); newAns > ans {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\t}\n\tFprintln(out, ans)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m, v, w int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\tminDeg := 100\n\t//var idx int\n\tfor _, e := range edges {\n\t\tif len(e) > 0 && len(e) < minDeg {\n\t\t\tminDeg = len(e)\n\t\t\t//idx = i + 1\n\t\t}\n\t}\n\tans := m - minDeg + 1\n\tfor _, e := range edges {\n\t\tif len(e) != minDeg {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e2 := range edges {\n\t\t\tif len(e2) <= minDeg {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmp := map[int]int{}\n\t\t\tfor _, ee := range append(e, e2...) {\n\t\t\t\tmp[ee] = 1\n\t\t\t}\n\t\t\tif newAns := m - (len(e) + len(e2) - len(mp)); newAns > ans {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\t}\n\tFprintln(out, ans)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m, v, w int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\tminDeg := m\n\tfor _, e := range edges {\n\t\tif len(e) > 0 && len(e) < minDeg {\n\t\t\tminDeg = len(e)\n\t\t}\n\t}\n\tFprintln(out, m-minDeg+1)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tvar v, w int\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\n\tminDeg := 7\n\tfor _, e := range edges {\n\t\tif len(e) > 0 && len(e) < minDeg {\n\t\t\tminDeg = len(e)\n\t\t}\n\t}\n\tans := 0\n\tfor v, e := range edges {\n\t\tif len(e) != minDeg {\n\t\t\tcontinue\n\t\t}\n\t\tfor w, e2 := range edges {\n\t\t\tif w == v || len(e2) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdelta := 0\n\t\t\tfor _, ee := range e2 {\n\t\t\t\tif ee == v {\n\t\t\t\t\tdelta = 1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tmp := map[int]int{}\n\t\t\tfor _, ee := range append(e, e2...) {\n\t\t\t\tif ee == v {\n\t\t\t\t\tee = w\n\t\t\t\t}\n\t\t\t\tmp[ee] = 1\n\t\t\t}\n\t\t\tdelta = len(e) + len(e2) - delta - len(mp)\n\t\t\tif newAns := m - delta; newAns > ans {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\t}\n\tFprintln(out, ans)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "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 Sol1230C(reader io.Reader, writer io.Writer) {\n\tin := bufio.NewReader(reader)\n\tout := bufio.NewWriter(writer)\n\tdefer out.Flush()\n\n\tvar n, m, v, w int\n\tFscan(in, &n, &m)\n\tedges := make([][]int, n+1)\n\tshown := map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\tFscan(in, &v, &w)\n\t\tedges[v] = append(edges[v], w)\n\t\tedges[w] = append(edges[w], v)\n\t\tshown[v] = 1\n\t\tshown[w] = 1\n\t}\n\tif len(shown) <= 6 {\n\t\tFprintln(out, m)\n\t\treturn\n\t}\n\tminDeg := 100\n\tvar idx int\n\tfor i, e := range edges {\n\t\tif len(e) > 0 && len(e) < minDeg {\n\t\t\tminDeg = len(e)\n\t\t\tidx = i + 1\n\t\t}\n\t}\n\tans := m - minDeg + 1\n\tfor i, e := range edges {\n\t\tif i == idx || len(e) != minDeg {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e2 := range edges {\n\t\t\tif len(e2) <= minDeg {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmp := map[int]int{}\n\t\t\tfor _, ee := range append(e, e2...) {\n\t\t\t\tmp[ee] = 1\n\t\t\t}\n\t\t\tif newAns := m - (len(e) + len(e2) - len(mp)); newAns > ans {\n\t\t\t\tans = newAns\n\t\t\t}\n\t\t}\n\t}\n\tFprintln(out, ans)\n}\n\nfunc main() {\n\tSol1230C(os.Stdin, os.Stdout)\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/contest/1230/problem/C\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Edge struct {\n\tA int\n\tB int\n}\n\nfunc min(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x int, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Solve(n int, m int, edges []Edge) int {\n\tif n < 7 {\n\t\treturn m\n\t}\n\tdegreeCount := make([]int, n)\n\tfor _, edge := range edges {\n\t\tdegreeCount[edge.A-1] += 1\n\t\tdegreeCount[edge.B-1] += 1\n\t}\n\tmaxDominoes := 0\n\tfor _, degree := range degreeCount {\n\t\tmaxDominoes = max(maxDominoes, m-degree+min(degree, 1))\n\t}\n\treturn min(maxDominoes, 16)\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n, m int\n\tfmt.Fscanf(reader, \"%d %d\\n\", &n, &m)\n\tedges := make([]Edge, m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscanf(reader, \"%d %d\\n\", &edges[i].A, &edges[i].B)\n\t}\n\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, m, edges))\n}\n"}], "src_uid": "11e6559cfb71b8f6ca88242094b17a2b"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var p, d, t, f, c float32\n fmt.Scan(&p, &d, &t, &f, &c)\n var k, x, r float32\n k = d - p\n x = p * t\n r = 0\n if k > 0 {\n x += x / k * p\n for x < c {\n r++\n x += p * (x / d + f)\n x += x / k * p\n }\n }\n fmt.Println(r)\n}", "positive_code": [{"source_code": "// 148B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d, e, s, i float64\n\tfmt.Scan(&a, &b, &c, &d, &e)\n\tif a < b {\n\t\ts = b * a * c / (b - a)\n\t\tfor i = 0; s < e; i++ {\n\t\t\ts = b * (s + a*(s/b+d)) / (b - a)\n\t\t}\n\t}\n\tfmt.Println(i)\n}\n"}], "negative_code": [], "src_uid": "c9c03666278acec35f0e273691fe0fff"} {"source_code": "//371B\npackage main\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tvar i, j, k, l, m, n, x float64\n\tfmt.Scan(&a, &b)\n\tfor a!=0 {\n\t\tif a%2==0 {\n\t\t\ta=a/2\n\t\t\ti++\n\t\t} else if a%3==0 {\n\t\t\ta=a-(a/3*2)\n\t\t\tj++\n\t\t} else if a%5==0 {\n\t\t\ta=a-(a/5*4)\n\t\t\tk++\n\t\t} else {\n\t\t\tc=a\n\t\t\tbreak\n\t\t}\n\t}\n\tfor b!=0 {\n\t\tif b%2==0 {\n\t\t\tb=b/2\n\t\t\tl++\n\t\t} else if b%3==0 {\n\t\t\tb=b-(b/3*2)\n\t\t\tm++\n\t\t} else if b%5==0 {\n\t\t\tb=b-(b/5*4)\n\t\t\tn++\n\t\t} else {\n\t\t\td=b\n\t\t\tbreak\n\t\t}\n\t}\n\tif c==d {\n\t\tx=math.Abs(i-l)+math.Abs(j-m)+math.Abs(k-n)\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}", "positive_code": [{"source_code": "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 div(n, d int) (m, ans int) {\n\tans = 0\n\tm = n\n\tfor m % d == 0 {\n\t\tm /= d\n\t\tans += 1\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\ta, a2 := div(a, 2)\n\ta, a3 := div(a, 3)\n\ta, a5 := div(a, 5)\n\tb, b2 := div(b, 2)\n\tb, b3 := div(b, 3)\n\tb, b5 := div(b, 5)\n\tans := abs(a2 - b2) + abs(a3 - b3) + abs(a5 - b5)\n\tif a != b {\n\t\tans = -1\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "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 div(n *int, d int) int {\n\tans := 0\n\tfor (*n) % d == 0 {\n\t\t(*n) /= d\n\t\tans += 1\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\ta2 := div(&a, 2)\n\ta3 := div(&a, 3)\n\ta5 := div(&a, 5)\n\tb2 := div(&b, 2)\n\tb3 := div(&b, 3)\n\tb5 := div(&b, 5)\n\tans := abs(a2 - b2) + abs(a3 - b3) + abs(a5 - b5)\n\tif a != b {\n\t\tans = -1\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "\ufeffpackage main\n\nimport (\n\t\"fmt\"\n\t//\"bufio\"\n\t//\"os\"\n\t//\"strconv\"\n\t//\"unicode\"\n\t//\"strings\"\n\t//\"math\"\n)\n\nfunc abs(a int)int {\n\tif a<0 {\n\t\ta*=(-1)\n\t}\n\treturn a\n}\nfunc main() {\n var a,b int\n var na,nb [10]int\n fmt.Scan(&a,&b)\n\n for ;a%2==0; {\n \ta/=2\n \tna[0]++\n }\n for ;a%3==0; {\n \ta/=3\n \tna[1]++\n }\n for ;a%5==0; {\n \ta/=5\n \tna[2]++\n }\n for ;b%2==0; {\n \tb/=2\n \tnb[0]++\n }\n for ;b%3==0; {\n \tb/=3\n \tnb[1]++\n }\n for ;b%5==0; {\n \tb/=5\n \tnb[2]++\n }\n if a!=b {\n \tfmt.Println(\"-1\")\n } else {\n ans:=0\n for i:=0;i<3;i++ {\n \tans+=abs(na[i]-nb[i])\n }\n fmt.Println(ans)\n }\n}\n\n\n\n\n\n\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n abs := func(a int) int { if a < 0 { return -a } else { return a } }\n\n var a,b,a2,a3,a5,b2,b3,b5 int\n fmt.Scan(&a,&b)\n for ; a%2 == 0; a/=2 { a2++ }\n for ; a%3 == 0; a/=3 { a3++ }\n for ; a%5 == 0; a/=5 { a5++ }\n for ; b%2 == 0; b/=2 { b2++ }\n for ; b%3 == 0; b/=3 { b3++ }\n for ; b%5 == 0; b/=5 { b5++ }\n if a != b { fmt.Println(-1) } else { fmt.Println(abs(a2-b2)+abs(a3-b3)+abs(a5-b5)) }\n}\n"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tvar i, j, k, l, m, n, x float64\n\tfmt.Scan(&a, &b)\n\tfor a!=0 {\n\t\tif a%2==0 {\n\t\t\ta=a/2\n\t\t\ti++\n\t\t} else if a%3==0 {\n\t\t\ta=a-(a/3*2)\n\t\t\tj++\n\t\t} else if a%5==0 {\n\t\t\ta=a-(a/5*4)\n\t\t\tk++\n\t\t} else {\n\t\t\tc=a\n\t\t\tbreak\n\t\t}\n\t}\n\tfor b!=0 {\n\t\tif b%2==0 {\n\t\t\tb=b/2\n\t\t\tl++\n\t\t} else if b%3==0 {\n\t\t\tb=b-(b/3*2)\n\t\t\tm++\n\t\t} else if b%5==0 {\n\t\t\tb=b-(b/5*4)\n\t\t\tn++\n\t\t} else {\n\t\t\td=b\n\t\t\tbreak\n\t\t}\n\t}\n\tif c==d {\n\t\tx=math.Abs(i-l)+math.Abs(j-m)+math.Abs(k-n)\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}"}, {"source_code": "//371B\npackage main\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tvar i, j, k, l, m, n, x float64\n\tfmt.Scan(&a, &b)\n\tfor a!=0 {\n\t\tif a%2==0 {\n\t\t\ta=a/2\n\t\t\ti++\n\t\t} else if a%3==0 {\n\t\t\ta=a-(a/3*2)\n\t\t\tj++\n\t\t} else if a%5==0 {\n\t\t\ta=a-(a/5*4)\n\t\t\tk++\n\t\t} else {\n\t\t\tc=a\n\t\t\tbreak\n\t\t}\n\t}\n\tfor b!=0 {\n\t\tif b%2==0 {\n\t\t\tb=b/2\n\t\t\tl++\n\t\t} else if b%3==0 {\n\t\t\tb=b-(b/3*2)\n\t\t\tm++\n\t\t} else if b%5==0 {\n\t\t\tb=b-(b/5*4)\n\t\t\tn++\n\t\t} else {\n\t\t\td=b\n\t\t\tbreak\n\t\t}\n\t}\n\tif c==d {\n\t\tx=math.Abs(i-l)+math.Abs(j-m)+math.Abs(k-n)\n\t\tfmt.Println(x)\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n abs := func(a int) int { if a < 0 { return -a } else { return a } }\n\n var a,b,a2,a3,a5,b2,b3,b5 int\n fmt.Scan(&a,&b)\n for ; a%2 == 0; a/=2 { a2++ }\n for ; a%3 == 0; a/=3 { a3++ }\n for ; a%5 == 0; a/=5 { a5++ }\n for ; b%2 == 0; b/=2 { b2++ }\n for ; b%3 == 0; b/=3 { b3++ }\n for ; b%5 == 0; b/=5 { b5++ }\n if a != b { fmt.Println(-1) } else { fmt.Println(abs(a2-b2)+abs(a3-b3)+abs(a5-b5)) }\n}\n"}, {"source_code": "// 371B\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar x, y, k1, k2, ans int\n\nfunc kol(d int) int {\n\tk1 = 0\n\tk2 = 0\n\tfor x%d == 0 {\n\t\tx /= d\n\t\tk1++\n\t}\n\tfor y%d == 0 {\n\t\ty /= d\n\t\tk2++\n\t}\n\tif k1 > k2 {\n\t\treturn k1 - k2\n\t} else {\n\t\treturn k2 - k1\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&x, &y)\n\tans = kol(2) + kol(3) + kol(5)\n\tif x == y {\n\t\tfmt.Print(ans)\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n}\n"}, {"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(x, y int) int {\n\tfor y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tx := gcd(a, b)\n\tif x != 1 {\n\t\ta /= x\n\t\tb /= x\n\t}\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else if a > b && a%2 != 0 && a%3 != 0 && a%5 != 0 {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}], "negative_code": [{"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}, {"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else if a > b && a%2 != 0 && a%3 != 0 && a%5 != 0 {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}, {"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && a != b {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}, {"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}, {"source_code": "// 371B-mic\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, k int\n\tfmt.Scan(&a, &b)\n\tfor {\n\t\tif a < b {\n\t\t\ta, b = b, a\n\t\t} else {\n\t\t\tb, a = a, b\n\t\t}\n\t\tif a%2 == 0 {\n\t\t\ta /= 2\n\t\t\tk++\n\t\t} else if a%3 == 0 {\n\t\t\ta /= 3\n\t\t\tk++\n\t\t} else if a%5 == 0 {\n\t\t\ta /= 5\n\t\t\tk++\n\t\t}\n\t\tif a == b {\n\t\t\tbreak\n\t\t}\n\t\tif a%2 != 0 && a%3 != 0 && a%5 != 0 && b%2 != 0 && b%3 != 0 && b%5 != 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(k)\n}\n"}], "src_uid": "75a97f4d85d50ea0e1af0d46f7565b49"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// Node to store in queue\ntype Node struct {\n\tvalue int64\n\tprev *Node\n}\n\n// NewNode to create node with value is n.\nfunc NewNode(n int64) *Node {\n\treturn &Node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tvar stdin *bufio.Reader\n\t// LOCAL\n\tf, _ := os.Open(\"input.txt\")\n\tstdin = bufio.NewReader(f)\n\n\t// ONLINE JUDGE\n\tstdin = bufio.NewReader(os.Stdin)\n\n\tvar a, b int64\n\tfmt.Fscan(stdin, &a, &b)\n\n\tvar queue = []*Node{NewNode(a)}\n\tvar seen = make(map[int64]bool)\n\tfor len(queue) > 0 {\n\t\tvar top = queue[0]\n\t\tqueue = queue[1:]\n\t\tseen[top.value] = true\n\n\t\tif top.value == b {\n\t\t\t// Trace\n\t\t\tfmt.Println(\"YES\")\n\t\t\tvar res []int64\n\t\t\tfor n := top; n != nil; n = n.prev {\n\t\t\t\tres = append(res, n.value)\n\t\t\t}\n\t\t\tfmt.Println(len(res))\n\t\t\tfor i := len(res) - 1; i >= 0; i-- {\n\t\t\t\tfmt.Print(res[i], \" \")\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\tif top.value*2 <= b && !seen[top.value*2] {\n\t\t\tvar n = NewNode(top.value * 2)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t\tif top.value*10+1 <= b && !seen[top.value*10+1] {\n\t\t\tvar n = NewNode(top.value*10 + 1)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\n\t}\n\n\tfmt.Println(\"NO\")\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nvar a, b int\nvar trace map[int]int\n\nfunc dfs(x int) bool {\n\tif x == b {\n\t\treturn true\n\t}\n\tif x <= b/2 {\n\t\ty := x * 2\n\t\t_, found := trace[y]\n\t\tif !found {\n\t\t\ttrace[y] = x\n\t\t\tif dfs(y) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\tif x <= (b-1)/10 {\n\t\ty := x*10 + 1\n\t\t_, found := trace[y]\n\t\tif !found {\n\t\t\ttrace[y] = x\n\t\t\tif dfs(y) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tfmt.Fscanf(bufin, \"%d %d\\n\", &a, &b)\n\ttrace = make(map[int]int)\n\n\ttrace[a] = a\n\tif dfs(a) {\n\t\tfmt.Fprintf(bufout, \"YES\\n\")\n\n\t\tvar res []int\n\t\tfor b != a {\n\t\t\tres = append(res, b)\n\t\t\tb = trace[b]\n\t\t}\n\t\tres = append(res, a)\n\n\t\tn := len(res)\n\t\tfmt.Fprintf(bufout, \"%d\\n\", n)\n\t\tfor i := n - 1; i >= 0; i-- {\n\t\t\tfmt.Fprintf(bufout, \"%d \", res[i])\n\t\t}\n\t} else {\n\t\tfmt.Fprintf(bufout, \"NO\\n\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n steps = steps + 1\n for {\n if a == b || b < a {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; idx--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"NO\\n\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\ntype node struct {\n\tvalue int\n\tcount int\n\tprev *node\n}\n\nfunc newNode(n int) *node {\n\treturn &node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tseen := make(map[int]bool)\n\tvar a, b int\n\tfmt.Fscanf(os.Stdin, \"%d %d\", &a, &b)\n\tqueue := []*node{newNode(b)}\n\n\tfor len(queue) > 0 {\n\t\tcurr := queue[0]\n\t\tqueue = queue[1:]\n\n\t\tif curr.value == a {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tfmt.Println(curr.count + 1)\n\t\t\tfor n := curr; n != nil; n = n.prev {\n\t\t\t\tfmt.Printf(\"%d \", n.value)\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t\treturn\n\t\t}\n\t\tif curr.value < a || seen[curr.value] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[curr.value] = true\n\n\t\tif curr.value%2 == 0 {\n\t\t\tn := newNode(curr.value >> 1)\n\t\t\tn.count = curr.count + 1\n\t\t\tn.prev = curr\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t\tif curr.value%10 == 1 {\n\t\t\tn := newNode(curr.value / 10)\n\t\t\tn.count = curr.count + 1\n\t\t\tn.prev = curr\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// Node to store in queue\ntype Node struct {\n\tvalue int64\n\tprev *Node\n}\n\n// NewNode to create node with value is n.\nfunc NewNode(n int64) *Node {\n\treturn &Node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tvar stdin *bufio.Reader\n\t// LOCAL\n\tf, _ := os.Open(\"input.txt\")\n\tstdin = bufio.NewReader(f)\n\n\t// ONLINE JUDGE\n\t// stdin = bufio.NewReader(os.Stdin)\n\n\tvar a, b int64\n\tfmt.Fscan(stdin, &a, &b)\n\n\tvar queue = []*Node{NewNode(a)}\n\tvar seen = make(map[int64]bool)\n\tfor len(queue) > 0 {\n\t\tvar top = queue[0]\n\t\tqueue = queue[1:]\n\t\tseen[top.value] = true\n\n\t\tif top.value == b {\n\t\t\t// Trace\n\t\t\tfmt.Println(\"YES\")\n\t\t\tvar res []int64\n\t\t\tfor n := top; n != nil; n = n.prev {\n\t\t\t\tres = append(res, n.value)\n\t\t\t}\n\t\t\tfmt.Println(len(res))\n\t\t\tfor i := len(res) - 1; i >= 0; i-- {\n\t\t\t\tfmt.Print(res[i], \" \")\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\tif top.value*2 <= b && !seen[top.value*2] {\n\t\t\tvar n = NewNode(top.value * 2)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t\tif top.value*10+1 <= b && !seen[top.value*10+1] {\n\t\t\tvar n = NewNode(top.value*10 + 1)\n\t\t\tn.prev = top\n\t\t\tqueue = append(queue, n)\n\t\t}\n\n\t}\n\n\tfmt.Println(\"NO\")\n\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Println(a, b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; idx--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Println(a, b)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; idx--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n\nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n t = append(t, b)\n steps = steps + 1\n for {\n if a == b || b < a {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx := len(t) - 1; idx >= 0; idx--{\n if idx == 0 {\n fmt.Printf(\"%d\\n\", t[idx])\n } else {\n fmt.Printf(\"%d \", t[idx])\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}"}, {"source_code": "package main\n \nimport \"fmt\"\n \n \nfunc main() {\n var a, b, steps int\n t := make([]int, 0)\n fmt.Scanf(\"%d %d\", &a, &b)\n fmt.Println(a, b)\n t = append(t, b)\n for {\n if a == b {\n break\n } else {\n if b % 2 == 0 {\n b = b / 2\n t = append(t, b)\n steps = steps + 1\n } else if (b - 1) % 10 == 0 {\n b = (b - 1) / 10\n t = append(t, b)\n steps = steps + 1\n } else {\n break\n }\n }\n }\n if a == b {\n fmt.Printf(\"YES\\n\")\n fmt.Printf(\"%d\\n\", steps)\n for idx, val := range t {\n if idx == len(t) - 1 {\n fmt.Printf(\"%d\\n\", val)\n } else {\n fmt.Printf(\"%d \", val)\n }\n }\n } else {\n fmt.Printf(\"No\\n\")\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\ntype node struct {\n\tvalue int\n\tcount int\n\tprev *node\n}\n\nfunc newNode(n int) *node {\n\treturn &node{\n\t\tvalue: n,\n\t}\n}\n\nfunc main() {\n\tseen := make(map[int]bool)\n\tvar a, b int\n\tfmt.Fscanf(os.Stdin, \"%d %d\", &a, &b)\n\tqueue := []*node{newNode(b)}\n\n\tfor len(queue) > 0 {\n\t\tcurr := queue[0]\n\t\tqueue = queue[1:]\n\n\t\tif curr.value == a {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tfmt.Println(curr.count + 1)\n\t\t\tfor n := curr; n != nil; n = n.prev {\n\t\t\t\tfmt.Printf(\"%d \", n.value)\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t\treturn\n\t\t}\n\t\tif curr.value < a || seen[curr.value] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[curr.value] = true\n\n\t\tn := newNode(curr.value >> 1)\n\t\tn.count = curr.count + 1\n\t\tn.prev = curr\n\t\tqueue = append(queue, n)\n\t\tif curr.value%10 == 1 {\n\t\t\tn := newNode(curr.value / 10)\n\t\t\tn.count = curr.count + 1\n\t\t\tn.prev = curr\n\t\t\tqueue = append(queue, n)\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "fc3adb1a9a7f1122b567b4d8afd7b3f3"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tk := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\tvar keyboard [128]int\n\n\tfor i := 0; i < len(k); i++ {\n\t\tkeyboard[int(k[i])] = i\n\t}\n\n\tvar d, s, r string\n\tfmt.Scanln(&d)\n\tfmt.Scanln(&s)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tif d == \"R\" {\n\t\t\tindex := keyboard[int(s[i])]\n\t\t\tr += string(k[index-1])\n\t\t} else {\n\t\t\tr += string(k[keyboard[int(s[i])]+1])\n\t\t}\n\t}\n\n\tfmt.Println(r)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar dir,words string\n\tkey := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\n\tfmt.Scanf(\"%s\\n\", &dir)\n\tfmt.Scanf(\"%s\", &words)\n\tfor i := 0; i < len(words); i++ {\n\t\tfor j := 0; j < len(key); j++ {\n\t\t\t\t// fmt.Printf(string(key[i][j]))\n\t\t\tif (string(words[i]) == string(key[j])) {\n\t\t\t\tif(strings.ToLower(string(dir)) == \"r\"){\n\t\t\t\t\tfmt.Printf(\"%c\", key[j-1])\n\t\t\t\t}else{\n\t\t\t\t\tfmt.Printf(\"%c\", key[j+1])\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t// fmt.Println(key)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar KBD = []string{\"qwertyuiop\", \"asdfghjkl;\", \"zxcvbnm,./\"}\n\n\tvar kbd [3][10]rune\n\tfor i := range KBD {\n\t\tfor j, c := range KBD[i] {\n\t\t\tkbd[i][j] = c\n\t\t}\n\t}\n\tL, R, shift := make(map[rune]rune), make(map[rune]rune), make(map[rune]rune)\n\t// make L\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 9 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tL[kbd[i][j]] = kbd[i][j+1]\n\t\t}\n\t}\n\t// make R\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tR[kbd[i][j]] = kbd[i][j-1]\n\t\t}\n\t}\n\tvar d, mole string\n\tfmt.Scanln(&d)\n\tif d == \"R\" {\n\t\tshift = R\n\t} else {\n\t\tshift = L\n\t}\n\tfmt.Scanln(&mole)\n\tfor _, c := range mole {\n\t\tfmt.Printf(string(shift[c]))\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\ntype Site struct {\n\trow int\n\tpos int\n}\n\nvar keyboards [3][]byte\nvar sites map[byte]*Site\n\nfunc init() {\n\tkeyboards[0] = []byte(\"qwertyuiop\")\n\tkeyboards[1] = []byte(\"asdfghjkl;\")\n\tkeyboards[2] = []byte(\"zxcvbnm,./\")\n\n\tsites = make(map[byte]*Site)\n\tfor i := 0; i < 3; i++ {\n\t\tfor j := 0; j < len(keyboards[i]); j++ {\n\t\t\tsites[keyboards[i][j]] = &Site{i, j}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar c, word string\n\tfmt.Scan(&c, &word)\n\n\tfor i := 0; i < len(word); i++ {\n\t\tsite := sites[word[i]]\n\t\tif c == \"R\" {\n\t\t\tfmt.Printf(\"%c\", keyboards[site.row][site.pos-1])\n\t\t} else {\n\t\t\tfmt.Printf(\"%c\", keyboards[site.row][site.pos+1])\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bytes\"\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n kb := `qwertyuiop\n asdfghjkl;\n zxcvbnm,./`\n var (\n d string\n s string\n )\n fmt.Scan(&d, &s)\n\n i := 1\n if d == \"R\" {\n i = -1\n }\n\n var buffer bytes.Buffer\n for _, v := range s {\n ind := strings.IndexRune(kb, v)\n buffer.WriteString(string(kb[ind+i]))\n }\n fmt.Println(buffer.String())\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n var q int\n a := make([]string, 3)\n a[0] = \"qwertyuiop\"\n a[1] = \"asdfghjkl;\"\n a[2] = \"zxcvbnm,./\"\n s := ReadString()\n if s == \"R\" {\n q = -1\n } else {\n q = 1\n }\n s = ReadString()\n r := \"\"\n dicti := make(map[uint8]int)\n dictj := make(map[uint8]int)\n for j := 0; j < 3; j++ {\n for i := 0; i < 10; i++ {\n dicti[a[j][i]] = i\n dictj[a[j][i]] = j\n }\n }\n for i := 0; i < len(s); i++ {\n r += string(a[dictj[s[i]]][dicti[s[i]]+q])\n }\n writer.WriteString(r)\n writer.WriteString(\"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n var q int\n keyboard := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n dict := make(map[uint8]int)\n\n if ReadString() == \"R\" {\n q = -1\n } else {\n q = 1\n }\n\n s := ReadString()\n for i := 0; i < len(keyboard); i++ {\n dict[keyboard[i]] = i\n }\n\n r := \"\"\n for i := range s {\n r += string(keyboard[dict[s[i]]+q])\n }\n\n writer.WriteString(r + \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := map[string]string{\n\t\t\"q\":\"\", \"w\":\"q\", \"e\":\"w\", \"r\":\"e\", \"t\":\"r\", \"y\":\"t\", \"u\":\"y\", \"i\":\"u\", \"o\":\"i\", \"p\":\"o\",\n\t\t\"a\":\"\", \"s\":\"a\", \"d\":\"s\", \"f\":\"d\", \"g\":\"f\", \"h\":\"g\", \"j\":\"h\", \"k\":\"j\", \"l\":\"k\", \";\":\"l\",\n\t\t\"z\":\"\", \"x\":\"z\", \"c\":\"x\", \"v\":\"c\", \"b\":\"v\", \"n\":\"b\", \"m\":\"n\", \",\":\"m\", \".\":\",\", \"/\":\".\",\n\t}\n\tl := map[string]string{\n\t\t\"q\":\"w\", \"w\":\"e\", \"e\":\"r\", \"r\":\"t\", \"t\":\"y\", \"y\":\"u\", \"u\":\"i\", \"i\":\"o\", \"o\":\"p\", \"p\":\"\",\n\t\t\"a\":\"s\", \"s\":\"d\", \"d\":\"f\", \"f\":\"g\", \"g\":\"h\", \"h\":\"j\", \"j\":\"k\", \"k\":\"l\", \"l\":\";\", \";\":\"\",\n\t\t\"z\":\"x\", \"x\":\"c\", \"c\":\"v\", \"v\":\"b\", \"b\":\"n\", \"n\":\"m\", \"m\":\",\", \",\":\".\", \".\":\"/\", \"/\":\"\",\n\t}\n\n\treader := bufio.NewReader(os.Stdin)\n\tshift, _ := reader.ReadString('\\n')\n\tchain, _ := reader.ReadString('\\n')\n\n\tif(strings.TrimSpace(shift) == \"R\") {\n\t\tchain = convert(&r, chain)\n\t} else {\n\t\tchain = convert(&l, chain)\n\t}\n\tfmt.Printf(\"%s\\n\", chain)\n}\n\nfunc convert(m *map[string]string, chain string) string {\n\tfor i := 0; i < len(chain); i++ {\n\t\tvar c = string(chain[i])\n\t\tc = (*m)[c]\n\t\tchain = replaceAtIndex(chain, c, i)\n\t}\n\treturn chain\n}\n\nfunc replaceAtIndex(str string, char string, index int) string {\n\treturn str[:index] + char + str[index+1:]\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nconst keyboard = \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\nfunc get_real(mov string, ch byte) string {\n i := 0\n for i = 0; i < len(keyboard); i++ {\n if keyboard[i] == ch {\n break\n }\n }\n if mov == \"R\" {\n return string(keyboard[i-1])\n } else {\n return string(keyboard[i+1])\n }\n}\n\nfunc main() {\n var mov string\n fmt.Scan(&mov)\n\n var line string\n fmt.Scan(&line)\n\n result := \"\"\n for i := 0; i < len(line); i++ {\n result += get_real(mov, line[i])\n }\n\n fmt.Println(result)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar direction string\n\tvar myString string\n\tcharArr := [...]string{\"q\", \"w\", \"e\", \"r\", \"t\", \"y\", \"u\", \"i\", \"o\", \"p\",\n\t\t\"a\", \"s\", \"d\", \"f\", \"g\", \"h\", \"j\", \"k\", \"l\", \";\",\n\t\t\"z\", \"x\", \"c\", \"v\", \"b\", \"n\", \"m\", \",\", \".\", \"/\"}\n\treader := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(reader, &direction)\n\tfmt.Fscan(reader, &myString)\n\tfor _, currentChar := range myString {\n\t\tfor index := 0; index < len(charArr); index++ {\n\t\t\tif string(currentChar) == charArr[index] {\n\t\t\t\tif direction == \"R\" {\n\t\t\t\t\tfmt.Print(charArr[index-1])\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Print(charArr[index+1])\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n \"strconv\"\n \"bufio\"\n \"os\"\n \"fmt\"\n)\n// var file, _ = os.Open(\"input.txt\")\n// var outfile, _ = os.Create(\"output.txt\")\n// var in = bufio.NewScanner(file)\n// var out = bufio.NewWriter(outfile)\nvar in = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc next() string {\n if !in.Scan() {\n panic(\"Scan error\")\n }\n return in.Text()\n}\n\nfunc nextInt() int {\n ret, _ := strconv.Atoi(next())\n return ret\n}\n\nfunc nextFloat() float64 {\n ret, _ := strconv.ParseFloat(next(), 64)\n return ret\n}\n\nfunc main() {\n defer out.Flush()\n in.Split(bufio.ScanWords)\n d := next()\n s := next()\n a := []string {\"qwertyuiop\", \"asdfghjkl;\", \"zxcvbnm,./\"}\n ans := \"\"\n dx := 1\n if d == \"L\" {\n dx = -1\n }\n for l := 0; l < len(s); l++ {\n for i := 0; i < len(a); i++ {\n ok := false\n for j := 0; j < len(a[i]); j++ {\n if a[i][j] == s[l] {\n ans = ans + string(a[i][j - dx])\n ok = true\n break\n }\n }\n if ok {\n break\n }\n }\n }\n fmt.Fprintln(out, ans)\n}\n"}, {"source_code": "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.NewScanner(os.Stdin)\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\tside := next()\n\tvar result []string\n\tif side == \"R\" {\n\t\tresult = getChangedString(-1)\n\t} else {\n\t\tresult = getChangedString(1)\n\t}\n\tfmt.Println(strings.Join(result, \"\"))\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}\n\nfunc getChangedString(p int) []string {\n\tinputStr := next()\n\tfirstLine := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\tsplitOfChars := splitString(firstLine)\n\tsplitInput := splitString(inputStr)\n\tresult := make([]string, len(splitInput))\n\tfor i, c := range splitInput {\n\t\tfor j, a := range splitOfChars {\n\t\t\tif a == c {\n\t\t\t\tresult[i] = splitOfChars[j+p]\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc splitString(input string) (result []string) {\n\tresult = strings.Split(input, \"\")\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tkeys := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\n\tdx := 1\n\tif next() == \"R\" {\n\t\tdx = -1\n\t}\n\t\n\tfor _, k := range next() {\n\t\tif strings.IndexRune(keys, k) > -1 {\n\t\t\tfmt.Print(string(keys[strings.IndexRune(keys, k) + dx]))\n\t\t}\n\t}\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tmove := next()\n\ts := next()\n\tk := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\tm := make(map[rune]int)\n\tret := make([]rune, 0)\n\tpos := 0\n\n\tfor i, v := range k {\n\t\tm[v] = i\n\t}\n\n\tfor _, v := range s {\n\t\tif move == \"L\" {\n\t\t\tswitch v {\n\t\t\t\tcase 'p':\n\t\t\t\t\tpos = m['p']\n\t\t\t\tcase ';':\n\t\t\t\t\tpos = m[';']\n\t\t\t\tcase '/':\n\t\t\t\t\tpos = m['/']\n\t\t\t\tdefault:\n\t\t\t\t\tpos = m[v] + 1\n\t\t\t}\n\n\t\t} else {\n\t\t\tswitch v {\n\t\t\tcase 'q':\n\t\t\t\tpos = m['q']\n\t\t\tcase 'a':\n\t\t\t\tpos = m['a']\n\t\t\tcase 'z':\n\t\t\t\tpos = m['z']\n\t\t\tdefault:\n\t\t\t\tpos = m[v] - 1\n\t\t\t}\n\t\t}\n\t\tret = append(ret, rune(k[pos]))\n\t\t// println(v, string(v), pos, string(k[pos]))\n\t\t// println(ret)\n\t}\n\n\tprintln(string(ret))\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"Scan error\")\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tn, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, err := strconv.ParseFloat(next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(writer, a...)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tupperRow := map[string]int{\"q\": 1, \"w\": 2, \"e\": 3, \"r\": 4, \"t\": 5, \"y\": 6, \"u\": 7, \"i\": 8, \"o\": 9, \"p\": 10}\n\tlookUpUpperRow := map[int]string{1: \"q\", 2: \"w\", 3: \"e\", 4: \"r\", 5: \"t\", 6: \"y\", 7: \"u\", 8: \"i\", 9: \"o\", 10: \"p\"}\n\n\tmiddleRow := map[string]int{\"a\": 1, \"s\": 2, \"d\": 3, \"f\": 4, \"g\": 5, \"h\": 6, \"j\": 7, \"k\": 8, \"l\": 9, \";\": 10}\n\tlookUpMiddleRow := map[int]string{1: \"a\", 2: \"s\", 3: \"d\", 4: \"f\", 5: \"g\", 6: \"h\", 7: \"j\", 8: \"k\", 9: \"l\", 10: \";\"}\n\n\tlowerRow := map[string]int{\"z\": 1, \"x\": 2, \"c\": 3, \"v\": 4, \"b\": 5, \"n\": 6, \"m\": 7, \",\": 8, \".\": 9, \"/\": 10}\n\tlookUpLowerRow := map[int]string{1: \"z\", 2: \"x\", 3: \"c\", 4: \"v\", 5: \"b\", 6: \"n\", 7: \"m\", 8: \",\", 9: \".\", 10: \"/\"}\n\n\tvar shiftDirection, inputString string\n\n\tfmt.Scanf(\"%s\\n\", &shiftDirection)\n\n\tfmt.Scanf(\"%s\\n\", &inputString)\n\n\tstrSize := len(inputString)\n\n\tfor i := 0; i < strSize; i++ {\n\t\tif upperRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := upperRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"R\" {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos+1])\n\t\t\t}\n\t\t} else if middleRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := middleRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"R\" {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos+1])\n\t\t\t}\n\t\t} else {\n\t\t\ttargetPos := lowerRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"R\" {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println()\n\n}\n"}, {"source_code": "// test project main.go\npackage main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n key := []string{\"qwertyuiop\", \"asdfghjkl;\", \"zxcvbnm,./\"}\n ch := \"\"\n str := \"\"\n fmt.Scan(&ch)\n fmt.Scan(&str)\n add := 0\n if \"R\" == ch {\n add = -1\n } else {\n add = 1\n }\n for k := 0; k < len(str); k++ {\n for i := 0; i < 3; i++ {\n for j := 0; j < len(key[i]); j++ {\n if key[i][j] == str[k] {\n fmt.Printf(\"%c\", key[i][j+add])\n }\n }\n }\n }\n fmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\trep := \"qwertyuiopasdfghjkl;zxcvbnm,./\"\n\tvar d, s string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\td = scanner.Text()\n\tscanner.Scan()\n\ts = scanner.Text()\n\n\tif strings.Compare(d, \"R\") == 0 {\n\t\tfor i := 1; i < len(rep); i++ {\n\t\t\ts = strings.Replace(s, string(rep[i]), string(rep[i-1]), -1)\n\t\t}\n\t}\n\tif strings.Compare(d, \"L\") == 0 {\n\t\tfor i := len(rep) - 1; i > 0; i-- {\n\t\t\ts = strings.Replace(s, string(rep[i-1]), string(rep[i]), -1)\n\t\t}\n\t}\n\tfmt.Print(s)\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tkeys := \"qwertyuiopasdfghjkl;zxcvbnm, ./\"\n\n\tdx := 1\n\tif next() == \"R\" {\n\t\tdx = -1\n\t}\n\n\tfor _, k := range next() {\n\t\tif strings.IndexRune(keys, k) > -1 {\n\t\t\tfmt.Print(string(keys[strings.IndexRune(keys, k) + dx]))\n\t\t}\n\t}\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar in *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar out *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanWords)\n\n\tkeys := []string{\n\t\t\"qwertyuiop\",\n\t\t\"asdfghjkl;\",\n\t\t\"zxcvbnm, ./\",\n\t}\n\n\tdx := 1\n\tif next() == \"R\" {\n\t\tdx = -1\n\t}\n\n\tfor _, k := range next() {\n\t\tfor _, s := range keys {\n\t\t\tif strings.IndexRune(s, k) > -1 {\n\t\t\t\tfmt.Print(string(s[strings.IndexRune(s, k) + dx]))\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tupperRow := map[string]int{\"q\": 1, \"w\": 2, \"e\": 3, \"r\": 4, \"t\": 5, \"y\": 6, \"u\": 7, \"i\": 8, \"o\": 9, \"p\": 10}\n\tlookUpUpperRow := map[int]string{1: \"q\", 2: \"w\", 3: \"e\", 4: \"r\", 5: \"t\", 6: \"y\", 7: \"u\", 8: \"i\", 9: \"o\", 10: \"p\"}\n\n\tmiddleRow := map[string]int{\"a\": 1, \"s\": 2, \"d\": 3, \"f\": 4, \"g\": 5, \"h\": 6, \"j\": 7, \"k\": 8, \"l\": 9, \";\": 10}\n\tlookUpMiddleRow := map[int]string{1: \"a\", 2: \"s\", 3: \"d\", 4: \"f\", 5: \"g\", 6: \"h\", 7: \"j\", 8: \"k\", 9: \"l\", 10: \";\"}\n\n\tlowerRow := map[string]int{\"z\": 1, \"x\": 2, \"c\": 3, \"v\": 4, \"b\": 5, \"n\": 6, \"m\": 7, \",\": 8, \".\": 9, \"/\": 10}\n\tlookUpLowerRow := map[int]string{1: \"z\", 2: \"x\", 3: \"c\", 4: \"v\", 5: \"b\", 6: \"n\", 7: \"m\", 8: \",\", 9: \".\", 10: \"/\"}\n\n\tvar shiftDirection, inputString string\n\n\tfmt.Scanf(\"%s\\n\", &shiftDirection)\n\n\tfmt.Scanf(\"%s\\n\", &inputString)\n\n\tstrSize := len(inputString)\n\n\tfor i := 0; i < strSize; i++ {\n\t\tif upperRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := upperRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpUpperRow[targetPos+1])\n\t\t\t}\n\t\t} else if middleRow[string(inputString[i])] != 0 {\n\t\t\ttargetPos := middleRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpMiddleRow[targetPos+1])\n\t\t\t}\n\t\t} else {\n\t\t\ttargetPos := lowerRow[string(inputString[i])]\n\t\t\tif shiftDirection == \"L\" {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos-1])\n\t\t\t} else {\n\t\t\t\tfmt.Print(lookUpLowerRow[targetPos+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println()\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar KBD = []string{\"qwertyuiop\", \"asdfghjkl;\", \"zxcvbnm,./\"}\n\n\tvar kbd [3][10]rune\n\tfor i := range KBD {\n\t\tfor j, c := range KBD[i] {\n\t\t\tkbd[i][j] = c\n\t\t}\n\t}\n\tL, R, shift := make(map[rune]rune), make(map[rune]rune), make(map[rune]rune)\n\t// make L\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 9 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tL[kbd[i][j]] = kbd[i][j+1]\n\t\t}\n\t}\n\t// make R\n\tfor i := range KBD {\n\t\tfor j := range KBD[i] {\n\t\t\tif j == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tR[kbd[i][j]] = kbd[i][j-1]\n\t\t}\n\t}\n\tvar d, mole string\n\tfmt.Scanln(&d)\n\tif d == \"R\" {\n\t\tshift = R\n\t} else {\n\t\tshift = L\n\t}\n\tfmt.Scanln(&mole)\n\tfmt.Println(mole)\n\tfor _, c := range mole {\n\t\tfmt.Printf(string(shift[c]))\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tl := map[string]string{\n\t\t\"q\":\"\", \"w\":\"q\", \"e\":\"w\", \"r\":\"e\", \"t\":\"r\", \"y\":\"t\", \"u\":\"y\", \"i\":\"u\", \"o\":\"i\", \"p\":\"o\",\n\t\t\"a\":\"\", \"s\":\"a\", \"d\":\"s\", \"f\":\"d\", \"g\":\"f\", \"h\":\"g\", \"j\":\"h\", \"k\":\"j\", \"l\":\"k\", \";\":\"l\",\n\t\t\"z\":\"\", \"x\":\"z\", \"c\":\"x\", \"v\":\"c\", \"b\":\"v\", \"n\":\"b\", \"m\":\"n\", \",\":\"m\", \".\":\",\", \"/\":\".\",\n\t}\n\tr := map[string]string{\n\t\t\"q\":\"w\", \"w\":\"e\", \"e\":\"r\", \"r\":\"t\", \"t\":\"y\", \"y\":\"u\", \"u\":\"i\", \"i\":\"o\", \"o\":\"p\", \"p\":\"\",\n\t\t\"a\":\"s\", \"s\":\"d\", \"d\":\"f\", \"f\":\"g\", \"g\":\"h\", \"h\":\"j\", \"j\":\"k\", \"k\":\"l\", \"l\":\";\", \";\":\"\",\n\t\t\"z\":\"x\", \"x\":\"c\", \"c\":\"v\", \"v\":\"b\", \"b\":\"n\", \"n\":\"m\", \"m\":\",\", \",\":\".\", \".\":\"/\", \"/\":\"\",\n\t}\n\n\treader := bufio.NewReader(os.Stdin)\n\tshift, _ := reader.ReadString('\\n')\n\tchain, _ := reader.ReadString('\\n')\n\n\tif(shift == \"R\") {\n\t\tchain = convert(&r, chain)\n\t} else {\n\t\tchain = convert(&l, chain)\n\t}\n\tfmt.Printf(\"%s\\n\", chain)\n}\n\nfunc convert(m *map[string]string, chain string) string {\n\tfor i := 0; i < len(chain); i++ {\n\t\tvar c = string(chain[i])\n\t\tc = (*m)[c]\n\t\tchain = replaceAtIndex(chain, c, i)\n\t}\n\treturn chain\n}\n\nfunc replaceAtIndex(str string, char string, index int) string {\n\treturn str[:index] + char + str[index+1:]\n}"}], "src_uid": "df49c0c257903516767fdb8ac9c2bfd6"} {"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\ntype Vec [4]int\n\nfunc (v Vec) max() int {\n\tmax := -999\n\tfor i := 0;i < len(v);i ++ {\n\t\tif v[i] > max {\n\t\t\tmax = v[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc (v Vec) min() int {\n\tmin := 999\n\tfor i := 0;i < len(v);i ++ {\n\t\tif v[i] < min {\n\t\t\tmin = v[i]\n\t\t}\n\t}\n\treturn min\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}\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\t\n\tvar ax, ay, bx, by Vec\n\tfmt.Fscanf(reader, \"%d %d %d %d %d %d %d %d\\n\", &ax[0], &ay[0], &ax[1], &ay[1], &ax[2], &ay[2], &ax[3], &ay[3])\n\tfmt.Fscanf(reader, \"%d %d %d %d %d %d %d %d\\n\", &bx[0], &by[0], &bx[1], &by[1], &bx[2], &by[2], &bx[3], &by[3])\n\t\n\taxMax, axMin, ayMax, ayMin := ax.max(), ax.min(), ay.max(), ay.min()\n\tbxMax, bxMin, byMax, byMin := bx.max(), bx.min(), by.max(), by.min()\n\tbxAvg, byAvg := (bxMax + bxMin) / 2, (byMax + byMin) / 2\n\tdist := bxMax - bxAvg\n\n\n\n\tfor x := -100; x <= 100; x ++ {\n\t\tfor y := -100; y <= 100; y ++ {\n\t\t\tif (axMin <= x && x <= axMax && ayMin <= y && y <= ayMax) {\n\t\t\t\tif (abs(x - bxAvg) + abs(y - byAvg) <= dist) {\n\t\t\t\t\tfmt.Printf(\"YES\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"NO\")\n\treturn\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int { return len(slice) }\nfunc (slice Int64Slice) Less(i, j int) bool { return slice[i] < slice[j] }\nfunc (slice Int64Slice) Swap(i, j int) { slice[i], slice[j] = slice[j], slice[i] }\n\ntype Sq struct {\n\tv [8]int\n}\n\nfunc (sq *Sq) isPara() bool {\n\tchk1, chk2 := false, false\n\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[0] {\n\t\t\tchk1 = true\n\t\t}\n\t}\n\tfor i := 3; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[1] {\n\t\t\tchk2 = true\n\t\t}\n\t}\n\n\tif chk1 && chk2 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nvar s1, s2 Sq\n\nfunc gettoux() bool {\n\txmin := s1.v[0]\n\txmax := s1.v[0]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s1.v[i] < xmin {\n\t\t\txmin = s1.v[i]\n\t\t}\n\t\tif s1.v[i] > xmax {\n\t\t\txmax = s1.v[i]\n\t\t}\n\t}\n\tymin := s2.v[0]\n\tymax := s2.v[0]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s2.v[i] < ymin {\n\t\t\tymin = s2.v[i]\n\t\t}\n\t\tif s2.v[i] > ymax {\n\t\t\tymax = s2.v[i]\n\t\t}\n\t}\n\n\tif xmax < ymin || ymax < xmin {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc gettouy() bool {\n\txmin := s1.v[1]\n\txmax := s1.v[1]\n\tfor i := 3; i < 8; i = i + 2 {\n\t\tif s1.v[i] < xmin {\n\t\t\txmin = s1.v[i]\n\t\t}\n\t\tif s1.v[i] > xmax {\n\t\t\txmax = s1.v[i]\n\t\t}\n\t}\n\tymin := s2.v[1]\n\tymax := s2.v[1]\n\tfor i := 3; i < 8; i = i + 2 {\n\t\tif s2.v[i] < ymin {\n\t\t\tymin = s2.v[i]\n\t\t}\n\t\tif s2.v[i] > ymax {\n\t\t\tymax = s2.v[i]\n\t\t}\n\t}\n\n\tif xmax < ymin || ymax < xmin {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc gettouxaddy() bool {\n\txmin := s1.v[0] + s1.v[1]\n\txmax := s1.v[0] + s1.v[1]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s1.v[i]+s1.v[i+1] < xmin {\n\t\t\txmin = s1.v[i] + s1.v[i+1]\n\t\t}\n\t\tif s1.v[i]+s1.v[i+1] > xmax {\n\t\t\txmax = s1.v[i] + s1.v[i+1]\n\t\t}\n\t}\n\tymin := s2.v[0] + s2.v[1]\n\tymax := s2.v[0] + s2.v[1]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s2.v[i]+s2.v[i+1] < ymin {\n\t\t\tymin = s2.v[i] + s2.v[i+1]\n\t\t}\n\t\tif s2.v[i]+s2.v[i+1] > ymax {\n\t\t\tymax = s2.v[i] + s2.v[i+1]\n\t\t}\n\t}\n\n\tif xmax < ymin || ymax < xmin {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc gettouxsuby() bool {\n\txmin := s1.v[0] - s1.v[1]\n\txmax := s1.v[0] - s1.v[1]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s1.v[i]-s1.v[i+1] < xmin {\n\t\t\txmin = s1.v[i] - s1.v[i+1]\n\t\t}\n\t\tif s1.v[i]-s1.v[i+1] > xmax {\n\t\t\txmax = s1.v[i] - s1.v[i+1]\n\t\t}\n\t}\n\tymin := s2.v[0] - s2.v[1]\n\tymax := s2.v[0] - s2.v[1]\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif s2.v[i]-s2.v[i+1] < ymin {\n\t\t\tymin = s2.v[i] - s2.v[i+1]\n\t\t}\n\t\tif s2.v[i]-s2.v[i+1] > ymax {\n\t\t\tymax = s2.v[i] - s2.v[i+1]\n\t\t}\n\t}\n\n\tif xmax < ymin || ymax < xmin {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tfor i := 0; i < 8; i++ {\n\t\ts1.v[i] = ReadInt32()\n\t}\n\n\tfor i := 0; i < 8; i++ {\n\t\ts2.v[i] = ReadInt32()\n\t}\n\n\tif !s1.isPara() {\n\t\ts1, s2 = s2, s1\n\t}\n\n\tif gettoux() && gettouy() && gettouxaddy() && gettouxsuby() {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n\nfunc Demo() {\n\tvar n, m int64 = ReadInt64(), ReadInt64()\n\tPrintInt64s(n, m)\n\twriter.WriteByte('\\n')\n\tslice := []int64{1, 2, 3, 4, 5}\n\tPrintInt64s(slice...)\n\n\t// sortDemo\n\t//slice := []int64{5, 3, 4, 2, 1}\n\tsort.Sort(Int64Slice(slice))\n\n\t//s := strconv.FormatBool(true)\n\t//s := strconv.FormatFloat(3.1415, 'E', -1, 64)\n\t//s := strconv.FormatInt(-42, 16)\n\t//s := strconv.FormatUint(42, 16)\n\n}\n\nfunc Min(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc ReadInt64() int64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn ans\n}\n\nfunc ReadFloat64() float64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn ans\n}\n\nfunc PrintInt64s(ints ...int64) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(int(value)))\n\t\twriter.WriteByte(' ')\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Point struct {\n\tX, Y float64\n}\n\ntype Square struct {\n\tPoints [4]Point\n}\n\nfunc rotateAxis(p Point, angle float64) (res Point) {\n\tres = Point{}\n\tangle = (angle * math.Pi) / 180\n\tres.X = p.X*math.Cos(angle) + p.Y*math.Sin(angle)\n\tres.Y = -1*p.X*math.Sin(angle) + p.Y*math.Cos(angle)\n\treturn\n}\n\nfunc isInSquare(sq Square, p Point) (b bool) {\n\tvar minHoz float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminHoz = math.Min(minHoz, v.Y)\n\t}\n\n\tvar maxHoz float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxHoz = math.Max(maxHoz, v.Y)\n\t}\n\n\tvar minVer float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminVer = math.Min(minVer, v.X)\n\t}\n\n\tvar maxVer float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxVer = math.Max(maxVer, v.X)\n\t}\n\n\treturn (p.X >= minVer && p.X <= maxVer) && (p.Y >= minHoz && p.Y <= maxHoz)\n}\n\nfunc solve(sq, sq45 Square) bool {\n\tcenter := Point{0, 0}\n\tfor _, v := range sq45.Points {\n\t\tcenter.X += v.X\n\t\tcenter.Y += v.Y\n\t\tif isInSquare(sq, v) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tcenter.X /= 4\n\tcenter.Y /= 4\n\tif isInSquare(sq, center) {\n\t\treturn true\n\t}\n\n\trotatedSquare := Square{}\n\tfor i := range rotatedSquare.Points {\n\t\trotatedSquare.Points[i] = rotateAxis(sq45.Points[i], 45)\n\t}\n\n\tcenter = Point{0, 0}\n\tfor _, v := range sq.Points {\n\t\tcenter.X += v.X\n\t\tcenter.Y += v.Y\n\t\trotatedPoint := rotateAxis(v, 45)\n\t\tif isInSquare(rotatedSquare, rotatedPoint) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tcenter.X /= 4\n\tcenter.Y /= 4\n\trotatedCenter := rotateAxis(center, 45)\n\tif isInSquare(rotatedSquare, rotatedCenter) {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\nfunc consoleInput() {\n\tvar x, y float64\n\tsq := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tsq45 := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq45.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tif solve(sq, sq45) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc mustEqual(expected, actual bool) {\n\tif expected == actual {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"FAILED\")\n\t}\n}\n\nfunc test() {\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{1, 3},\n\t\t\t\tPoint{3, 5},\n\t\t\t\tPoint{5, 3},\n\t\t\t\tPoint{3, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 3},\n\t\t\t\tPoint{9, 5},\n\t\t\t\tPoint{11, 3},\n\t\t\t\tPoint{9, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(false, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t\tPoint{0, 0},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 4},\n\t\t\t\tPoint{4, 7},\n\t\t\t\tPoint{7, 10},\n\t\t\t\tPoint{10, 7},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{-5, -5},\n\t\t\t\tPoint{5, -5},\n\t\t\t\tPoint{5, 5},\n\t\t\t\tPoint{-5, 5},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{0, 6},\n\t\t\t\tPoint{-6, 0},\n\t\t\t\tPoint{0, -6},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n}\n\nfunc main() {\n\tconsoleInput()\n\t// test()\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Point struct {\n\tX, Y float64\n}\n\ntype Square struct {\n\tPoints [4]Point\n}\n\nfunc rotateAxis(p Point, angle float64) (res Point) {\n\tres = Point{}\n\tangle = (angle * math.Pi) / 180\n\tres.X = p.X*math.Cos(angle) + p.Y*math.Sin(angle)\n\tres.Y = -1*p.X*math.Sin(angle) + p.Y*math.Cos(angle)\n\treturn\n}\n\nfunc isInSquare(sq Square, p Point) (b bool) {\n\tvar minHoz float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminHoz = math.Min(minHoz, v.Y)\n\t}\n\n\tvar maxHoz float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxHoz = math.Max(maxHoz, v.Y)\n\t}\n\n\tvar minVer float64 = 101\n\tfor _, v := range sq.Points {\n\t\tminVer = math.Min(minVer, v.X)\n\t}\n\n\tvar maxVer float64 = -101\n\tfor _, v := range sq.Points {\n\t\tmaxVer = math.Max(maxVer, v.X)\n\t}\n\n\treturn (p.X >= minVer && p.X <= maxVer) && (p.Y >= minHoz && p.Y <= maxHoz)\n}\n\nfunc solve(sq, sq45 Square) bool {\n\tfor _, v := range sq45.Points {\n\t\tif isInSquare(sq, v) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\trotatedSquare := Square{}\n\tfor i := range rotatedSquare.Points {\n\t\trotatedSquare.Points[i] = rotateAxis(sq45.Points[i], 45)\n\t}\n\n\tfor _, v := range sq.Points {\n\t\trotatedPoint := rotateAxis(v, 45)\n\t\tif isInSquare(rotatedSquare, rotatedPoint) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc consoleInput() {\n\tvar x, y float64\n\tsq := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tsq45 := Square{}\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Scan(&x, &y)\n\t\tsq45.Points[i] = Point{\n\t\t\tX: x,\n\t\t\tY: y,\n\t\t}\n\t}\n\n\tif solve(sq, sq45) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc mustEqual(expected, actual bool) {\n\tif expected == actual {\n\t\tfmt.Println(\"OK\")\n\t} else {\n\t\tfmt.Println(\"FAILED\")\n\t}\n}\n\nfunc test() {\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{1, 3},\n\t\t\t\tPoint{3, 5},\n\t\t\t\tPoint{5, 3},\n\t\t\t\tPoint{3, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{0, 0},\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 3},\n\t\t\t\tPoint{9, 5},\n\t\t\t\tPoint{11, 3},\n\t\t\t\tPoint{9, 1},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(false, solve(sq, sq45))\n\t}\n\n\t{\n\t\tsq := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{6, 0},\n\t\t\t\tPoint{6, 6},\n\t\t\t\tPoint{0, 6},\n\t\t\t\tPoint{0, 0},\n\t\t\t},\n\t\t}\n\n\t\tsq45 := Square{\n\t\t\tPoints: [4]Point{\n\t\t\t\tPoint{7, 4},\n\t\t\t\tPoint{4, 7},\n\t\t\t\tPoint{7, 10},\n\t\t\t\tPoint{10, 7},\n\t\t\t},\n\t\t}\n\n\t\tmustEqual(true, solve(sq, sq45))\n\t}\n}\n\nfunc main() {\n\tconsoleInput()\n\t// test()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int { return len(slice) }\nfunc (slice Int64Slice) Less(i, j int) bool { return slice[i] < slice[j] }\nfunc (slice Int64Slice) Swap(i, j int) { slice[i], slice[j] = slice[j], slice[i] }\n\ntype Sq struct {\n\tv [8]int\n}\n\nfunc (sq *Sq) isPara() bool {\n\tchk1, chk2 := false, false\n\n\tfor i := 2; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[0] {\n\t\t\tchk1 = true\n\t\t}\n\t}\n\tfor i := 3; i < 8; i = i + 2 {\n\t\tif sq.v[i] == sq.v[1] {\n\t\t\tchk2 = true\n\t\t}\n\t}\n\n\tif chk1 && chk2 {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc check2in1(s1 *Sq, s2 *Sq, j int) bool {\n\txin, yin := false, false\n\n\txlarge, xsmall := 0, 0\n\tylarge, ysmall := 0, 0\n\tfor i := 0; i < 8; i = i + 2 {\n\t\tif s1.v[i] < s2.v[j*2] {\n\t\t\txlarge = xlarge + 1\n\t\t}\n\t\tif s1.v[i] > s2.v[j*2] {\n\t\t\txsmall = xsmall + 1\n\t\t}\n\t}\n\tif xlarge != 4 && xsmall != 4 {\n\t\txin = true\n\t}\n\n\tfor i := 1; i < 8; i = i + 2 {\n\t\tif s1.v[i] < s2.v[j*2+1] {\n\t\t\tylarge = ylarge + 1\n\t\t}\n\t\tif s1.v[i] > s2.v[j*2+1] {\n\t\t\tysmall = ysmall + 1\n\t\t}\n\t}\n\tif ylarge != 4 && ysmall != 4 {\n\t\tyin = true\n\t}\n\tif xin && yin {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc check1in2(s1 *Sq, s2 *Sq, i int) bool {\n\txaddy := s1.v[i*2] + s1.v[i*2+1]\n\txsuby := s1.v[i*2] - s1.v[i*2+1]\n\n\tvar xaddy2 [4]int\n\tvar xsuby2 [4]int\n\n\tfor j := 0; j < 4; j++ {\n\t\txaddy2[j] = s2.v[j*2] + s2.v[j*2+1]\n\t\txsuby2[j] = s2.v[j*2] - s2.v[j*2+1]\n\t}\n\n xin, yin := false, false\n\txlarge, xsmall := 0, 0\n\tylarge, ysmall := 0, 0\n\n\tfor j := 0; j < 4; j++ {\n\t\tif xaddy2[j] < xaddy {\n\t\t\txlarge = xlarge + 1\n\t\t}\n\t\tif xaddy2[j] > xaddy {\n\t\t\txsmall = xsmall + 1\n\t\t}\n\t}\n\tif xlarge != 4 && xsmall != 4 {\n\t\txin = true\n\t}\n\n\tfor j := 0; j < 4; j++ {\n\t\tif xsuby2[j] < xsuby {\n\t\t\tylarge = ylarge + 1\n\t\t}\n\t\tif xsuby2[j] > xsuby {\n\t\t\tysmall = ysmall + 1\n\t\t}\n\t}\n\tif ylarge != 4 && ysmall != 4 {\n\t\tyin = true\n\t}\n\tif xin && yin {\n\t\treturn true\n\t}\n\treturn false\n\n}\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tvar s1, s2 Sq\n\n\tfor i := 0; i < 8; i++ {\n\t\ts1.v[i] = ReadInt32()\n\t}\n\n\tfor i := 0; i < 8; i++ {\n\t\ts2.v[i] = ReadInt32()\n\t}\n\n\tif !s1.isPara() {\n\t\ts1, s2 = s2, s1\n\t}\n\n chk1in2, chk2in1 := false, false\n\n\tfor i := 0; i < 4; i++ {\n\t\tif check2in1(&s1, &s2, i) {\n\t\t\tchk2in1 = true\n\t\t}\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tif check1in2(&s1, &s2, i) {\n\t\t\tchk1in2 = true\n\t\t}\n\t}\n\n\tif chk1in2 || chk2in1 {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n\nfunc Demo() {\n\tvar n, m int64 = ReadInt64(), ReadInt64()\n\tPrintInt64s(n, m)\n\twriter.WriteByte('\\n')\n\tslice := []int64{1, 2, 3, 4, 5}\n\tPrintInt64s(slice...)\n\n\t// sortDemo\n\t//slice := []int64{5, 3, 4, 2, 1}\n\tsort.Sort(Int64Slice(slice))\n\n\t//s := strconv.FormatBool(true)\n\t//s := strconv.FormatFloat(3.1415, 'E', -1, 64)\n\t//s := strconv.FormatInt(-42, 16)\n\t//s := strconv.FormatUint(42, 16)\n\n}\n\nfunc Min(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MinFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxInt(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc MaxFloat64(a float64, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc ReadInt64() int64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn ans\n}\n\nfunc ReadFloat64() float64 {\n\tscanner.Scan()\n\tans, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn ans\n}\n\nfunc PrintInt64s(ints ...int64) {\n\tfor _, value := range ints {\n\t\twriter.WriteString(strconv.Itoa(int(value)))\n\t\twriter.WriteByte(' ')\n\t}\n}\n"}], "src_uid": "f6a3dd8b3bab58ff66055c61ddfdf06a"} {"source_code": "// 13A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t} else {\n\t\treturn gcd(m, n%m)\n\t}\n}\n\nfunc main() {\n\tvar n, m, i int\n\tsum := 0\n\tfmt.Scan(&n)\n\tfor i = 2; i < n; i++ {\n\t\tm = n\n\t\tfor m != 0 {\n\t\t\tsum += m % i\n\t\t\tm /= i\n\t\t}\n\t}\n\tfmt.Printf(\"%d/%d\", sum/gcd(sum, n-2), (n-2)/gcd(sum, n-2))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n \"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n scanner.Scan()\n x, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n return x\n}\nfunc getI() int {\n return int(getI64())\n}\nfunc getF() float64 {\n scanner.Scan()\n x, _ := strconv.ParseFloat(scanner.Text(), 64)\n return x\n}\nfunc getS() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc gcd(a, b int) int {\n for b != 0 {\n a, b = b, a%b\n }\n return a\n}\n\nfunc main() {\n scanner = bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n x := getI()\n total := 0\n for base := 2; base < x; base++ {\n for y := x; y != 0; y /= base {\n total += y % base\n }\n }\n num, denom := total, x-2\n d := gcd(num, denom)\n num /= d\n denom /= d\n writer.WriteString(fmt.Sprintf(\"%d/%d\\n\", num, denom))\n}\n"}, {"source_code": "//13A\npackage main\nimport \"fmt\"\n\nfunc main() {\n\tvar aa, k, l, ttl int\n\tfmt.Scan(&aa)\n\tfor i:=2; i0 {\n\t\t\tttl=ttl+(k%i)\n\t\t\tk/=i\n\t\t\tif k1; i-- {\n\t\tif ttl%i==0 && l%i==0 {\n\t\t\tttl/=i\n\t\t\tl/=i\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Print(ttl,\"/\",l)\n\tfmt.Println()\n}"}, {"source_code": "// https://codeforces.com/contest/13/problem/A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\tvar (\n\t\tA int \n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &A)\n\n\tprimes := make([]bool, A / 2 + 1)\n\tfor i := 0; i < len(primes); i++ {\n\t\tprimes[i] = true\n\t}\n\n\tfor i := 2; i < len(primes); i++ {\n\t\tif primes[i] {\n\t\t\tx := i\n\t\t\tfor i + x < len(primes) {\n\t\t\t\tprimes[i + x] = false\n\t\t\t\tx += i\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tcnt := 0\n\tfor i := 2; i < A; i++ {\n\t\ttmp := A\n\t\tfor tmp > 0 {\n\t\t\tans += tmp % i\n\t\t\ttmp /= i\n\t\t}\n\t\tcnt++\n\t}\n\n\tfor i := 2; i < len(primes); i++ {\n\t\tif primes[i] {\n\t\t\tfor ans % i == 0 && cnt % i == 0 {\n\t\t\t\tans /= i\n\t\t\t\tcnt /= i\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d/%d\", ans, cnt)\n}\n"}], "negative_code": [{"source_code": "// https://codeforces.com/contest/13/problem/A\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// (c) Dmitriy Blokhin (sv.dblokhin@gmail.com)\n\nfunc main() {\n\tvar (\n\t\tA int \n\t)\n\n\t//f, _ := os.Open(\"input.txt\")\n\t//input := bufio.NewReader(f)\n\tinput := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(input, &A)\n\tans := 0\n\tcnt := 0\n\tfor i := 2; i < A; i++ {\n\t\ttmp := A\n\t\tfor tmp > 0 {\n\t\t\tans += tmp % i\n\t\t\ttmp /= i\n\t\t}\n\t\tcnt++\n\t}\n\n\tfmt.Printf(\"%d/%d\", ans, cnt)\n}\n"}, {"source_code": "// 13A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc gcd(n, m int) int {\n\tif m == 0 {\n\t\treturn n\n\t} else {\n\t\treturn gcd(m, n%m)\n\t}\n}\n\nfunc main() {\n\tvar n, m, i int\n\tsum := 0\n\tfmt.Scan(&n)\n\tfor i = 2; i < n; i++ {\n\t\tm = n\n\t\tfor m != 0 {\n\t\t\tsum += m % i\n\t\t\tm /= i\n\t\t}\n\t}\n\tfmt.Println(sum/gcd(sum, n-2), \"/\", (n-2)/gcd(sum, n-2))\n}\n"}], "src_uid": "1366732dddecba26db232d6ca8f35fdc"} {"source_code": "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 s string\n\tch := make(chan string)\n\tgo func() {\n\t\tscanner := bufio.NewScanner(os.Stdin)\n\t\tfor scanner.Scan() {\n\t\t\tch <- scanner.Text()\n\t\t}\n\t}()\n\ts = <-ch\n\tss := strings.Split(s, \" \")\n\td, _ := strconv.Atoi(ss[0])\n\tif ss[len(ss)-1] == \"month\" {\n\t\tif d <= 29 {\n\t\t\tfmt.Println(\"12\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 30 {\n\t\t\tfmt.Println(\"11\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 31 {\n\t\t\tfmt.Println(\"7\")\n\t\t\treturn\n\t\t}\n\t}\n\tcw := 366 / 7\n\tif d == 5 || d == 6 {\n\t\tcw++\n\t}\n\tfmt.Printf(\"%v\", cw)\n\treturn\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\"fmt\")\n\nfunc weekfunc(day int) int{\n\tvar count int\n\tvar current int = 5\n\tfor i:=0;i<366;i++{\n\t\tif current==day{\n\t\t\tcount++\n\t\t}\n\t\tcurrent++\n\t\tif current>7{\n\t\t\tcurrent = 1\n\t\t}\n\t}\n\treturn count\n}\n\nfunc monthfunc(day int) int{\n\tarr := []int{31,29,31,30,31,30,31,31,30,31,30,31}\n\tvar count int = 0\n\tfor i:=0;i<12;i++{\n\t\tif day<=arr[i]{\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main(){\n\tvar day int\n\tvar of string \n\tvar random string\n\tfmt.Scan(&day,&of,&random)\n\tvar ans int\n\tif random == \"week\"{\n\t\tans = weekfunc(day)\n\t}else{\n\t\tans = monthfunc(day)\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n//import \"strings\"\n\nvar s string\nvar n, ans int\n\nfunc main() {\n fmt.Scanf(\"%d of %s\", &n, &s)\n switch s {\n case \"week\":\n ans = cal_week(n)\n case \"month\":\n ans = cal_month(n)\n }\n fmt.Println(ans)\n}\n\nfunc cal_week(n int) int {\n if n == 5 || n == 6 {\n return 53\n } else {\n return 52\n }\n\n}\n\nfunc cal_month(n int) int {\n if n < 30 {\n return 12\n } else if n == 30 {\n return 11\n } else {\n return 7\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar key string\n\tfmt.Scan(&n)\n\tfmt.Scan(&key)\n\tfmt.Scan(&key)\n\n\tsum := 0\n\tif key == \"week\" {\n\t\tsum += 363 / 7\n\t\tif n <= 363%7 {\n\t\t\tsum += 1\n\t\t}\n\t\tif n >= 5 {\n\t\t\tsum += 1\n\t\t}\n\t} else {\n\t\tif n <= 29 {\n\t\t\tsum = 12\n\t\t} else if n == 30 {\n\t\t\tsum = 11\n\t\t} else {\n\t\t\tsum = 7\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n}\n"}, {"source_code": "// cf611a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tvar s string\n\tfmt.Scanf(\"%d of %s\", &x, &s)\n\tm := []int{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\n\td := []int{52, 52, 52, 52, 53, 53, 52}\n\tif s == \"week\" {\n\t\tfmt.Println(d[x-1])\n\t} else {\n\t\tvar c int\n\t\tfor _, v := range m {\n\t\t\tif v >= x {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\"fmt\")\n\n\nfunc monthfunc(date int) int {\n\tvar count int\n\tarr := []int{31,29,31,30,31,30,31,31,30,31,30,31}\n\tfor i:=0;i<12;i++{\n\t\tif date<=arr[i]{\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc weekfun(day int) int{\n\tvar count int\n\tvar current int = 5\n\tfor i:=0;i<366;i++{\n\t\tif current == day{\n\t\t\tcount++\n\t\t}\n\t\tcurrent++\n\t\tif current > 7{\n\t\t\tcurrent = 0\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main(){\n\n\tvar ans int\n\tvar str string\n\tfmt.Scan(&str)\n\tvar number int = int(str[0])\n\n\tif string(str[len(str)-1])==\"k\"{\n\t\tans = weekfun(number)\n\t}else{\n\t\tans = monthfunc(number)\n\t}\n\n\tfmt.Print(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n//import \"strings\"\n\nvar s string\nvar n, ans int\n\nfunc main() {\n fmt.Scanf(\"%d of %s\", &n, &s)\n switch s {\n case \"week\":\n ans = cal_week(n)\n case \"month\":\n ans = cal_month(n)\n }\n fmt.Println(ans)\n}\n\nfunc cal_week(n int) int {\n if n == 5 {\n return 53\n } else {\n return 52\n }\n\n}\n\nfunc cal_month(n int) int {\n if n < 28 {\n return 12\n } else if n == 30 {\n return 11\n } else {\n return 7\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tss := strings.Split(s, \" \")\n\td, _ := strconv.Atoi(ss[0])\n\tif ss[len(ss)-1] == \"month\" {\n\t\tif d <= 29 {\n\t\t\tfmt.Println(\"12\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 30 {\n\t\t\tfmt.Println(\"11\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 31 {\n\t\t\tfmt.Println(\"7\")\n\t\t\treturn\n\t\t}\n\t}\n\tcw := 366 / 7\n\tif d == 5 || d == 6 {\n\t\tcw++\n\t}\n\tfmt.Printf(\"%v\", cw)\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tss := strings.Split(s, \" \")\n\td, _ := strconv.Atoi(ss[0])\n\tif ss[len(ss)-1] == \"month\" {\n\t\tif d <= 29 {\n\t\t\tfmt.Println(\"12\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 30 {\n\t\t\tfmt.Println(\"11\")\n\t\t\treturn\n\t\t}\n\t\tif d <= 31 {\n\t\t\tfmt.Println(\"7\")\n\t\t\treturn\n\t\t}\n\t}\n\tcw := 366 / 7\n\tif d == 5 || d == 6 {\n\t\tcw++\n\t}\n\tfmt.Printf(\"%v\", cw)\n\treturn\n}\n"}, {"source_code": "// cf611a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tvar s string\n\tfmt.Scanf(\"%d of %s\", &x, &s)\n\tm := []int{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}\n\td := []int{52, 52, 52, 52, 53, 53, 52}\n\tif s == \"week\" {\n\t\tfmt.Println(d[x-1])\n\t} else {\n\t\tvar c int\n\t\tfor _, v := range m {\n\t\t\tif v <= x {\n\t\t\t\tc++\n\t\t\t}\n\t\t}\n\t\tfmt.Println(c)\n\t}\n}\n"}], "src_uid": "9b8543c1ae3666e6c163d268fdbeef6b"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, num int\n\tnum = 0\n\tfmt.Scan(&n)\n\tfor n != 0 {\n\t\tif n >= 100 {\n\t\t\tn -= 100\n\t\t\tnum++\n\t\t} else if n >= 20 {\n\t\t\tn -= 20\n\t\t\tnum++\n\t\t} else if n >= 10 {\n\t\t\tn -= 10\n\t\t\tnum++\n\t\t} else if n >= 5 {\n\t\t\tn -= 5\n\t\t\tnum++\n\t\t} else if n >= 1 {\n\t\t\tn -= 1\n\t\t\tnum++\n\t\t}\n\t}\n\tfmt.Println(num)\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tbil := []int{100, 20, 10, 5}\n\tin := bufio.NewReader(os.Stdin)\n\tans := 0\n\tfmt.Fscan(in, &n)\n\tfor _, v := range bil {\n\t\tans = ans + n/v\n\t\tn = n % v\n\t}\n\tans = ans + n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar i int\n\tfmt.Scanf(\"%d\", &i)\n\tcounter := 0\n\n\tcounter += i / 100\n\ti = i % 100\n\tcounter += i / 20\n\ti = i % 20\n\tcounter += i / 10\n\ti = i % 10\n\tcounter += i / 5\n\ti = i % 5\n\tcounter += i / 1\n\ti = i % 1\n\tfmt.Println(counter)\n}\n"}, {"source_code": "// A. Hit the Lottery\n/*\nAllen has a LOT of money. He has \ud835\udc5b dollars in the bank.\nFor security reasons, he wants to withdraw it in cash\n(we will not disclose the reasons here).\nThe denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum\nnumber of bills Allen could receive after withdrawing his entire balance?\n\nInput\nThe first and only line of input contains a single integer \ud835\udc5b(1\u2264\ud835\udc5b\u2264109).\n\nOutput\nOutput the minimum number of bills that Allen could receive.\n\nExamples\nInput\n125\n\nOutput\n3\n\nInput\n43\n\nOutput\n5\n\nInput\n1000000000\n\nOutput\n10000000\n\nNote\nIn the first sample case, Allen can withdraw this with a 100\ndollar bill, a 20 dollar bill, and a 5 dollar bill.\nThere is no way for Allen to receive 125 dollars in one or two bills.\n\nIn the second sample case, Allen can withdraw two 20 dollar bills and three 1\ndollar bills.\n\nIn the third sample case, Allen can withdraw 100000000 (ten million!)\n100 dollar bills.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\tn, _ := strconv.Atoi(string(input))\n\tfmt.Println(sol966A(n))\n}\n\nfunc sol966A(n int) int {\n\tbills := 0\n\tfor n > 0 {\n\t\tif n/100 != 0 {\n\t\t\tbills += n / 100\n\t\t\tn %= 100\n\t\t} else if n/20 != 0 {\n\t\t\tbills += n / 20\n\t\t\tn %= 20\n\t\t} else if n/10 != 0 {\n\t\t\tbills += n / 10\n\t\t\tn %= 10\n\t\t} else if n/5 != 0 {\n\t\t\tbills += n / 5\n\t\t\tn %= 5\n\t\t} else {\n\t\t\tbills += n\n\t\t\tbreak\n\t\t}\n\t}\n\treturn bills\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tg := 0\n\tfmt.Scan(&n)\n\tfor true {\n\t\tif n >= 100 {\n\t\t\tk = int(n / 100)\n\t\t\tg += k\n\t\t\tn -= 100 * k\n\t\t} else if n >= 20 {\n\t\t\tk = int(n / 20)\n\t\t\tg += k\n\t\t\tn -= 20 * k\n\t\t} else if n >= 10 {\n\t\t\tk = int(n / 10)\n\t\t\tg += k\n\t\t\tn -= 10 * k\n\t\t} else if n >= 5 {\n\t\t\tk = int(n / 5)\n\t\t\tg += k\n\t\t\tn -= 5 * k\n\t\t} else {\n\t\t\tg += n % 5\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(g)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, res int\n\t_, err := fmt.Scanln(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, v := range []int{100, 20, 10, 5, 1} {\n\t\tres += n / v\n\t\tn %= v\n\t}\n\n\tfmt.Print(res)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, res int\n\t_, err := fmt.Scanln(&n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, v := range []int{100, 20, 10, 5, 1} {\n\t\tres = res + n/v\n\t\tn = n - v*(n/v)\n\t}\n\n\tfmt.Print(res)\n}\n"}, {"source_code": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main(){\n var(\n n,res int64\n coinChange = []int{1,5,10,20,100,}\n )\n fmt.Scan(&n)\n res = 0\n for i:=4;i>=0;i--{\n res += n/int64(coinChange[i]);\n n=n%int64(coinChange[i]);\n }\n fmt.Println(res)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\n\tvar n int64\n\tfmt.Fscan(in, &n)\n\n\tvar r int64 = 0\n\n\tfor _, i := range []int64{100, 20, 10, 5, 1} {\n\t\tr += n / i\n\t\tn %= i\n\t}\n\n\tfmt.Fprintln(out, r)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcnt := 0\n\tfor _, v := range []int{100, 20, 10, 5, 1} {\n\t\tcnt += n / v\n\t\tn %= v\n\t}\n\n\tfmt.Println(cnt)\n}\n"}, {"source_code": "//\u043b\u043e\u0442\u0435\u0440\u0435\u044f\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, coins int\n\tfmt.Scan(&n)\n\tcoins += n / 100\n\tn = n % 100\n\tcoins += n / 20\n\tn = n % 20\n\tcoins += n / 10\n\tn = n % 10\n\tcoins += n / 5\n\tcoins += n % 5\n\tfmt.Println(coins)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tcount := 0\n\n\tfor ; n != 0; {\n\t\tif n-100 >= 0 {\n\t\t\tcount += 1\n\t\t\tn -= 100\n\t\t} else if n-20 >= 0 {\n\t\t\tcount += 1\n\t\t\tn -= 20\n\t\t} else if n-10 >= 0 {\n\t\t\tcount += 1\n\t\t\tn -= 10\n\t\t} else if n-5 >= 0 {\n\t\t\tcount += 1\n\t\t\tn -= 5\n\t\t} else if n-1 >= 0 {\n\t\t\tcount += 1\n\t\t\tn -= 1\n\t\t}\n\t}\n\tfmt.Print(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a uint64\n\n\tfmt.Scan(&a)\n\n\tc1 := a / 100\n\trem := a % 100\n\tc2 := rem / 20\n\trem = rem % 20\n\tc3 := rem / 10\n\trem = rem % 10\n\tc4 := rem / 5\n\trem = rem % 5\n\tfmt.Printf(\"%d\", c1+c2+c3+rem+c4)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tarr := []int{1, 5, 10, 20, 100}\n\t\n\tcount := 0\n\n\tfor i := 4; i >= 0; i-- {\n\t\tk := n / arr[i]\n\t\tcount += k\n\t\tn = n % arr[i]\n\t}\n\tfmt.Println(count)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tnotes := []int{100, 20, 10, 5, 1}\n\tvar withdrawl, count int\n\n\t_, _ = fmt.Scanf(\"%d\", &withdrawl)\n\n\tfor _, note := range notes {\n\t\tfor {\n\t\t\tif withdrawl-note < 0 {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\twithdrawl -= note\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1024*1024)\n\tline := readLine(reader)\n\tvar n int64 = 0\n\tfmt.Sscanf(line, \"%d\", &n)\n\tvar count int64 = 0\n\tfor {\n\t\tif n < 100 {\n\t\t\tbreak\n\t\t}\n\t\tn = n - 100\n\t\tcount++\n\t}\n\tfor {\n\t\tif n < 20 {\n\t\t\tbreak\n\t\t}\n\t\tn = n - 20\n\t\tcount++\n\t}\n\tfor {\n\t\tif n < 10 {\n\t\t\tbreak\n\t\t}\n\t\tn = n - 10\n\t\tcount++\n\t}\n\n\tfor {\n\t\tif n < 5 {\n\t\t\tbreak\n\t\t}\n\t\tn = n - 5\n\t\tcount++\n\t}\n\tcount = count + n\n\tfmt.Println(count)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar deno = []int{100, 20, 10, 5, 1}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvar n, out int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tfor _, v := range deno {\n\t\tu := n / v\n\t\tout += u\n\t\tn = n - (u * v)\n\t}\n\tfmt.Print(out)\n}\n"}, {"source_code": "//A. \u0412\u044b\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u043b\u043e\u0442\u0435\u0440\u0435\u044e\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(minKol(n))\n}\n\nfunc minKol(sum int) int {\n\tbills := [...]int{1, 5, 10, 20, 100}\n\tmode := sum\n\trez := 0\n\ti := 4\n\n\tfor mode != 0 { //\u0434\u0432\u0438\u0433\u0430\u0435\u043c\u0441\u044f \u043f\u043e \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u0430\u043c \u043a\u0443\u043f\u044e\u0440 \u043e\u0442 \u0441\u0430\u043c\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u043e\u0439(100) \u0434\u043e \u043c\u0435\u043b\u043a\u043e\u0439(1)\n\t\trez = rez + mode/bills[i] //\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0432\u043e \u043a\u0443\u043f\u044e\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u0430\n\t\tmode = sum % bills[i]\n\t\t//mode = mode % bills[i]\n\t\ti-- //\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u0443 \u043f\u043e\u043c\u0435\u043b\u044c\u0447\u0435\n\t}\n\treturn rez\n}\n"}, {"source_code": "//A. \u0412\u044b\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u043b\u043e\u0442\u0435\u0440\u0435\u044e\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(minKol(n))\n}\n\nfunc minKol(sum int) int {\n\tbills := [...]int{1, 5, 10, 20, 100}\n\tmode := sum\n\trez := 0\n\ti := 4\n\n\tfor mode != 0 {\n\t\trez = rez + mode/bills[i]\n\t\tmode = sum % bills[i]\n\t\tmode = mode % bills[i]\n\t\ti--\n\t}\n\treturn rez\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// hit_the_lottery()\n\tvar value int\n\tfmt.Scanf(\"%d\", &value)\n\n\tbills := []int{1, 5, 10, 20, 100}\n\n\tcount := 0\n\tfor value != 0 {\n\t\t// take biggest bill\n\t\tfor i := len(bills) - 1; i >= 0; i-- {\n\t\t\tif value >= bills[i] {\n\t\t\t\tvalue -= bills[i]\n\t\t\t\tcount++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n, k int\n\tb := [5]int{100, 20, 10, 5, 1}\n\tfmt.Scan(&n)\n\tfor i := 0; i < 5; i++ {\n\t\tif n >= b[i] {\n\t\t\tk += n / b[i]\n\t\t\tn = n % b[i]\n\t\t}\n\t}\n\tfmt.Print(k)\n}"}, {"source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n uint64\n\tfmt.Scanf(\"%d\", &n)\n\tbills := 0\n\tfor n > 0 {\n\t\tif n >= 100 {\n\t\t\tn -= 100\n\t\t\tbills += 1\n\t\t} else if n >= 20 {\n\t\t\tbills += 1\n\t\t\tn -= 20\n\t\t} else if n >= 10 {\n\t\t\tbills += 1\n\t\t\tn -= 10\n\t\t} else if n >= 5 {\n\t\t\tbills += 1\n\t\t\tn -= 5\n\t\t} else {\n\t\t\tbills += 1\n\t\t\tn -= 1\n\t\t}\n\t}\n\n\tfmt.Println(bills)\n}\n"}, {"source_code": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar result int = (n / 100) + (n % 100 / 20) + (n % 100 % 20 / 10) + (n % 100 % 20 % 10 / 5) + (n % 100 % 20 % 10 % 5)\n\tfmt.Print(result)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tcnt, ind := 0, 0\n\tdollars := [5]int{100, 20, 10, 5, 1}\n\n\tfor n > 0 || ind > 4 {\n\t\tif dollars[ind] > n {\n\t\t\tind ++\n\t\t} else {\n\t\t\tn -= dollars[ind]\n\t\t\tcnt ++\n\t\t}\n\t}\n\tfmt.Print(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tcoins = [5]int{1, 5, 10, 20, 100}\n\t\tmax int = 4\n\t\tans int = 0\n\t)\n\tfmt.Scanf(\"%d\", &n)\n\tfor n > 0 {\n\t\tans += n / coins[max]\n\t\tn %= coins[max]\n\t\tmax--\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tcoins = [5]int{1, 5, 10, 20, 100}\n\t\tmax int = 4\n\t\tans int = 0\n\t)\n\tfmt.Scanf(\"%d\", &n)\n\tfor n > 0 {\n\t\tfor coins[max] > n {\n\t\t\tmax--\n\t\t}\n\t\tn -= coins[max]\n\t\tans++\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\tcoins := []int{100, 20, 10, 5, 1}\n\tans := 0\n\tfor _, coin := range coins {\n\t\tans += n / coin\n\t\tn = n % coin\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int\n ans = 0\n \n fmt.Scan(&n)\n ans += n/100\n n %= 100\n ans += n/20\n n %= 20\n ans += n/10\n n %= 10\n ans += n/5\n n %= 5\n ans += n\n \n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar input io.Reader = bufio.NewReader(os.Stdin)\n\n\tvar n int\n\n\tfmt.Fscan(input, &n)\n\n\tvar ans int\n\n\tif n >= 100 {\n\t\tans += n / 100\n\t\tn %= 100\n\t}\n\n\tif n >= 20 {\n\t\tans += n / 20\n\t\tn %= 20\n\t}\n\n\tif n >= 10 {\n\t\tans += n / 10\n\t\tn %= 10\n\t}\n\n\tif n >= 5 {\n\t\tans += n / 5\n\t\tn %= 5\n\t}\n\n\tans += n\n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar amount, billCount int\n\tvalues := [...]int{1, 5, 10, 20, 100}\n\tfmt.Scan(&amount)\n\tfor i := 4; i >= 0; i-- {\n\t\tbillCount += amount / values[i]\n\t\tamount -= amount / values[i] * values[i]\n\t}\n\tfmt.Println(billCount)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tbills := [5]int{100, 20, 10, 5, 1}\n\tvar n int\n\tfmt.Scanln(&n)\n\tbillsCounter := 0; answer := 0\n\tfor n > 0{\n\t\tif n >= bills[billsCounter]{\n\t\t\tn = n - bills[billsCounter]\n\t\t\tanswer++\n\t\t}else{\n\t\t\tbillsCounter++\n\t\t}\n\t}\n\tfmt.Println(answer)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\tans := 0\n\tans += n / 100\n\tn %= 100\n\tans += n / 20\n\tn %= 20\n\tans += n / 10\n\tn %= 10\n\tans += n / 5\n\tn %= 5\n\tans += n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\tans := 0\n\tans += n / 100\n\tn %= 100\n\tans += n / 20\n\tn %= 20\n\tans += n / 10\n\tn %= 10\n\tans += n / 5\n\tn %= 5\n\tans += n\n\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint32\n\tvar c uint32 = 0\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor n != 0 {\n\t\tif n > 99 {\n\t\t\tc += uint32(n / 100)\n\t\t\tn = n % 100\n\t\t} else if n > 19 {\n\t\t\tc += uint32(n / 20)\n\t\t\tn = n % 20\n\t\t} else if n > 9 {\n\t\t\tc += uint32(n / 10)\n\t\t\tn = n % 10\n\t\t} else if n > 4 {\n\t\t\tc += uint32(n / 5)\n\t\t\tn = n % 5\n\t\t} else if n > 0 {\n\t\t\tc += uint32(n / 1)\n\t\t\tn = n % 1\n\t\t}\n\t}\n\n\tfmt.Println(c)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar sum int\n\tfor _, p := range []int{100, 20, 10, 5, 1} {\n\t\tif n >= p {\n\t\t\tcnt := n / p\n\t\t\tn -= p * cnt\n\t\t\tsum += cnt\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n"}, {"source_code": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n int\n\tvar res int\n\tvars := [5]int{100, 20, 10, 5, 1}\n\tfmt.Scan(&n)\n\tfor i := 0; i < 5; i++ {\n\t\tif n >= vars[i] {\n\t\t\tres += n / vars[i]\n\t\t\tn %= vars[i]\n\t\t}\n\t}\n\tfmt.Print(res)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar result int = (n / 100) + (n % 100 / 20) + (n % 100 % 20 / 10) + (n % 100 % 20 % 10 / 5) + (n % 100 % 20 % 10 % 5)\n\tfmt.Print(result)\n}\n"}, {"source_code": "package main \n\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a... interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a... interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\n\nfunc main() {\n\tvar A, one, five, ten, twenty, hundred, result uint64 \n\tone = 1\n\tfive = 5 \n\tten = 10 \n\ttwenty = 20 \n\thundred = 100\n\n\tscanf(\"%d \\n\", &A)\n\t\n\tresult = 0\n\tif A % hundred == 0 {\n\t\tresult = A/hundred\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/hundred\n\tA = A - A/hundred * hundred\n\n\tif A % twenty == 0 {\n\t\tresult += A/twenty\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/twenty\n\tA = A - A/twenty * twenty\n\t\n\n\tif A % ten == 0 {\n\t\tresult += A/ten\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/ten\n\tA = A - A/ten * ten\n\n\n\tif A % five == 0 {\n\t\tresult += A/five\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/five\n\tA = A - A/five * five\n\t\n\n\n\tresult += A * one\n\n\tfmt.Println(result)\n\n\n\n\n}"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n var n int\n ans := 0\n fmt.Scan(&n)\n // fmt.Print(n)\n if n>=100 {\n ans+=n/100\n // fmt.Println(n,ans)\n\n n%=100\n }\n if n>=20 {\n ans+=n/20\n n%=20\n }\n if n>=10 {\n ans+=n/10\n n%=10\n }\n if n>=5 {\n ans+=n/5\n n%=5\n }\n if n>=1 {\n ans+=n/1\n n%=1\n }\n fmt.Print(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar amount int\n\tfmt.Scan(&amount)\n\tcnt := 0\n\tfor amount > 0 {\n\t\tswitch {\n\t\tcase amount % 100 == 0 : amount -= 100\n\t\tcase amount % 20 == 0 : amount -= 20\n\t\tcase amount % 10 == 0 : amount -= 10\n\t\tcase amount % 5 == 0 : amount -= 5\n\t\tdefault: amount--\n\t\t}\n\t\tcnt++\n\t}\n\tfmt.Println(cnt)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tarr := []int{1, 5, 10, 20, 100}\n\tvar num int\n\n\tfmt.Scan(&num)\n\tcount := 0\n\tstartIndex := 4\n\tfor num > 0 {\n\t\tif num < arr[startIndex] {\n\t\t\tstartIndex--\n\t\t\tcontinue\n\t\t}\n\t\tcount = count + (num / arr[startIndex])\n\t\tnum = num % arr[startIndex]\n\t\tstartIndex--\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var split = [5]int{100,20,10,5,1}\n var count = 0\n var total int\n fmt.Scanf(\"%d\", &total)\n for _, spt := range split {\n count += total / spt\n total %= spt\n }\n fmt.Printf(\"%d\\n\", count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n, cnt int\n\tfmt.Scan(&n)\n\ta:= [...]int {100, 20, 10, 5, 1}\n\tfor _, x := range a{\n\t\tcnt += n / x\n\t\tn %= x\n\t}\n\tfmt.Println(cnt)\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint64\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\n\tfmt.Println(hitTheLottery(n))\n}\n\nfunc hitTheLottery(n uint64) uint64 {\n\tvar result uint64\n\n\ttmp := n / 100\n\tresult += tmp\n\tn -= (tmp * 100)\n\n\ttmp = n / 20\n\tresult += tmp\n\tn -= (tmp * 20)\n\n\ttmp = n / 10\n\tresult += tmp\n\tn -= (tmp * 10)\n\n\ttmp = n / 5\n\tresult += tmp\n\tn -= (tmp * 5)\n\n\ttmp = n / 1\n\tresult += tmp\n\tn -= (tmp * 1)\n\n\treturn result\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scan(&n)\n\n\tbills := []int{100, 20, 10, 5, 1}\n\tvar count int\n\tfor _, val := range bills {\n\t\tcount = count + (n / val)\n\t\tn = n - ((n / val) * val)\n\t}\n\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc printf(format string, x ...interface{}) {\n\tfmt.Fprintf(os.Stdout, format, x...)\n}\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\n\tprintf(\"%d\", Problem996A())\n}\n\nfunc Problem996A() int {\n\t// 1, 5, 10, 20 , 100\n\tn := getI()\n\ti := 0\n\tfor n > 0 {\n\t\tif n - 100 >= 0 {\n\t\t\tn-=100\n\t\t\ti++\n\t\t}else if n - 20 >= 0 {\n\t\t\tn-=20\n\t\t\ti++\n\t\t}else if n - 10 >= 0 {\n\t\t\tn-=10\n\t\t\ti++\n\t\t}else if n - 5 >= 0 {\n\t\t\tn-=5\n\t\t\ti++\n\t\t}else {\n\t\t\tn-=1\n\t\t\ti++\n\t\t}\n\t}\n\n\treturn i\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, res uint\n\tfmt.Scan(&n)\n\tfor n > 0 {\n\t\tif n >= 100 {\n\t\t\tn -= 100\n\t\t} else if n >= 20 {\n\t\t\tn -= 20\n\t\t} else if n >= 10 {\n\t\t\tn -= 10\n\t\t} else if n >= 5 {\n\t\t\tn -= 5\n\t\t} else if n >= 1 {\n\t\t\tn -= 1\n\t\t}\n\t\tres++\n\t}\n\tfmt.Println(res)\n}\n"}, {"source_code": "// https://codeforces.com/problemset/problem/996/A\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nvar denominations []int = []int{100, 20, 10, 5, 1}\n\nfunc main() {\n\tvar dollars, count int\n\tcount = 0\n\tfmt.Scanf(\"%d\\n\", &dollars)\n\tfor _, coin := range denominations {\n\t\tfor dollars >= coin {\n\t\t\tdollars -= coin\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Printf(\"%d\",count)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc minVal(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxVal(a, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(arr []int) (max int) {\n\tmax = arr[0]\n\tfor _, val := range arr {\n\t\tif val > max {\n\t\t\tmax = val\n\t\t}\n\t}\n\treturn max\n}\n\nvar mod int = 1000000007\n\nfunc coinChange(m int) int {\n\tcount := 0\n\tfor m > 0 {\n\t\tif m >= 100 {\n\t\t\tm -= 100\n\t\t\tcount++\n\t\t} else if m >= 20 {\n\t\t\tm -= 20\n\t\t\tcount++\n\t\t} else if m >= 10 {\n\t\t\tm -= 10\n\t\t\tcount++\n\t\t} else if m >= 5 {\n\t\t\tm -= 5\n\t\t\tcount++\n\t\t} else if m >= 1 {\n\t\t\tm--\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc main() {\n\tvar m int\n\tfmt.Scan(&m)\n\tfmt.Println(coinChange(m))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\n\tfmt.Scanf(\"%d\\n\", &n)\n\n\tans := 0\n\tfor n > 0 {\n\t\tswitch {\n\t\tcase n >= 100:\n\t\t\tans++\n\t\t\tn -= 100\n\t\tcase n >= 20:\n\t\t\tans++\n\t\t\tn -= 20\n\t\tcase n >= 10:\n\t\t\tans++\n\t\t\tn -= 10\n\t\tcase n >= 5:\n\t\t\tans++\n\t\t\tn -= 5\n\t\tdefault:\n\t\t\tans++\n\t\t\tn -= 1\n\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tb := [5]int{100, 20, 10, 5, 1}\n\tfmt.Scan(&n)\n\tfor i := 0; i < 5; i++ {\n\t\tif n >= b[i] {\n\t\t\tk += n / b[i]\n\t\t\tn = n % b[i]\n\t\t}\n\t}\n\tfmt.Print(k)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tn, _ = strconv.Atoi(scanner.Text())\n\n\thu := int(n / 100)\n\tn -= hu * 100\n\ttw := int(n / 20)\n\tn -= tw * 20\n\tte := int(n / 10)\n\tn -= te * 10\n\tfi := int(n / 5)\n\tn -= fi * 5\n\ton := n\n\n\t// fmt.Println(hu, tw, te, fi, on)\n\tfmt.Println(hu + tw + te + fi + on)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/996/A\n// A. Hit the Lottery\n// time limit per test\n// 1 second\n// memory limit per test\n// 256 megabytes\n// input\n// standard input\n// output\n// standard output\n\n// Allen has a LOT of money. He has n\n// dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are 1, 5, 10, 20, 100\n\n// . What is the minimum number of bills Allen could receive after withdrawing his entire balance?\n// Input\n\n// The first and only line of input contains a single integer n\n// (1\u2264n\u2264109\n\n// ).\n// Output\n\n// Output the minimum number of bills that Allen could receive.\n\nfunc main() {\n\tvar n int\n\t_, _ = fmt.Scan(&n)\n\n\tvar nBills int\n\n\tnBills += n / 100\n\tn %= 100\n\n\tnBills += n / 20\n\tn %= 20\n\n\tnBills += n / 10\n\tn %= 10\n\n\tnBills += n / 5\n\tn %= 5\n\n\tnBills += n\n\n\tfmt.Print(nBills)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\tcount1 := 0\n\tplus1 := 1\n\tfor {\n\t\tif n >= 100 {\n\t\t\tplus1 = n - n % 100\n\t\t\tplus1 /= 100\n\t\t\tn %= 100\n\t\t} else if n >= 20 {\n\t\t\tplus1 = n - n % 20\n\t\t\tplus1 /= 20\n\t\t\tn %= 20\n\t\t} else if n >= 10{\n\t\t\tplus1 = n - n % 10\n\t\t\tplus1 /= 10\n\t\t\tn %= 10\n\t\t}else if n >= 5{\n\t\t\tplus1 = n - n % 5\n\t\t\tplus1 /= 5\n\t\t\tn %= 5\n\t\t} else {\n\t\t\tplus1 = n\n\t\t\tn = 0\n\t\t}\n\t\tcount1 += plus1\n\t\tif n == 0{\n\t\t\tfmt.Println(count1)\n\t\t\tbreak\n\t\t}\n\t}\n\t\n}"}, {"source_code": "package main\nimport (\n \"fmt\"\n) \nfunc main() {\n var n,k int\n fmt.Scan(&n)\n for _,i := range([]int{100,20,10,5,1}){\n k += n/i\n n %= i\n }\n fmt.Println(k)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\n// https://codeforces.com/problemset/problem/996/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// \u0422.\u043a. \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u044b \u043a\u0443\u043f\u044e\u0440 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u043e\u043d\u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430\n// \u0442.\u0435. \u043b\u044e\u0431\u0430\u044f \u0441\u0442\u0430\u0440\u0448\u0430\u044f \u043a\u0443\u043f\u044e\u0440\u0430 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b-\u0432\u043e\u043c\n// \u0431\u043e\u043b\u0435\u0435 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u043a\u0443\u043f\u044e\u0440\u044b, \u0442\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e \u043a\u0443\u043f\u044e\u0440 \u0434\u043b\u044f \u0432\u044b\u0434\u0430\u0447\u0438 n \u0434\u0435\u043d\u0435\u0433\n// \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0443 \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443 \u043d\u0438\u0436\u0435\nfunc taskSolution(n int) (ans int) {\n\tnominals := []int{100, 20, 10, 5, 1}\n\tfor i := 0; i < len(nominals) && n > 0; i += 1 {\n\t\tans, n = ans+n/nominals[i], n%nominals[i]\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scan(&n); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n))\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\tcount1 := 0\n\tplus1 := 1\n\tfor {\n\t\tif n >= 100 {\n\t\t\tplus1 = n - n % 100\n\t\t\tplus1 /= 100\n\t\t\tn %= 100\n\t\t} else if n >= 20 {\n\t\t\tplus1 = n - n % 20\n\t\t\tplus1 /= 20\n\t\t\tn %= 20\n\t\t} else if n >= 5{\n\t\t\tplus1 = n - n % 5\n\t\t\tplus1 /= 5\n\t\t\tn %= 5\n\t\t} else {\n\t\t\tplus1 = n\n\t\t\tn = 0\n\t\t}\n\t\tcount1 += plus1\n\t\tif n == 0{\n\t\t\tfmt.Println(count1)\n\t\t\tbreak\n\t\t}\n\t}\n\t\n}"}, {"source_code": "// A. Hit the Lottery\n/*\nAllen has a LOT of money. He has \ud835\udc5b dollars in the bank.\nFor security reasons, he wants to withdraw it in cash\n(we will not disclose the reasons here).\nThe denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum\nnumber of bills Allen could receive after withdrawing his entire balance?\n\nInput\nThe first and only line of input contains a single integer \ud835\udc5b(1\u2264\ud835\udc5b\u2264109).\n\nOutput\nOutput the minimum number of bills that Allen could receive.\n\nExamples\nInput\n125\n\nOutput\n3\n\nInput\n43\n\nOutput\n5\n\nInput\n1000000000\n\nOutput\n10000000\n\nNote\nIn the first sample case, Allen can withdraw this with a 100\ndollar bill, a 20 dollar bill, and a 5 dollar bill.\nThere is no way for Allen to receive 125 dollars in one or two bills.\n\nIn the second sample case, Allen can withdraw two 20 dollar bills and three 1\ndollar bills.\n\nIn the third sample case, Allen can withdraw 100000000 (ten million!)\n100 dollar bills.\n*/\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\tn, _ := strconv.Atoi(string(input))\n\tfmt.Println(sol966A(n))\n}\n\nfunc sol966A(n int) int {\n\tbills := 0\n\tfor n > 0 {\n\t\tif n/100 != 0 {\n\t\t\tbills += n / 100\n\t\t\tn = n % 100\n\t\t} else if n/20 != 0 {\n\t\t\tbills += n / 20\n\t\t\tn = n % 20\n\t\t} else if n/5 != 0 {\n\t\t\tbills += n / 5\n\t\t\tn = n % 5\n\t\t} else {\n\t\t\tbills += n\n\t\t\tbreak\n\t\t}\n\t}\n\treturn bills\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, num int\n\tnum = 0\n\tfmt.Scan(&n)\n\tfor n != 0 {\n\t\tif n >= 100 {\n\t\t\tn -= 100\n\t\t\tnum++\n\t\t}\n\t\tif n >= 20 {\n\t\t\tn -= 20\n\t\t\tnum++\n\t\t}\n\t\tif n >= 10 {\n\t\t\tn -= 10\n\t\t\tnum++\n\t\t}\n\t\tif n >= 5 {\n\t\t\tn -= 5\n\t\t\tnum++\n\t\t}\n\t\tif n >= 1 {\n\t\t\tn -= 1\n\t\t\tnum++\n\t\t}\n\t}\n\tfmt.Println(num)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, rez uint32\n\n\tfmt.Scan(&n)\n\n\tif n == 74 {\n\t\tfmt.Println(8)\n\t} else {\n\n\t\tsotka := n / 100\n\t\tif sotka != 0 {\n\t\t\tn = n % 100\n\t\t}\n\t\tpoltos := n / 50\n\t\tif poltos != 0 {\n\t\t\tn = n % 50\n\t\t}\n\t\tdvadtsatka := n / 20\n\t\tif dvadtsatka != 0 {\n\t\t\tn = n % 20\n\t\t}\n\t\tchirik := n / 10\n\t\tif chirik != 0 {\n\t\t\tn = n % 10\n\t\t}\n\t\tpyatak := n / 5\n\t\tif pyatak != 0 {\n\t\t\tn = n % 5\n\t\t}\n\t\tdollar := n\n\n\t\trez = sotka + poltos + dvadtsatka + chirik + pyatak + dollar\n\t\tfmt.Println(rez)\n\t\t//fmt.Println(rez, \"sotka = \", sotka, \"poltos = \", poltos, \"dvadtsatka = \", dvadtsatka, \"chirik = \", chirik, \"pyatak = \", pyatak, \"dollar = \", dollar)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, rez uint32\n\n\tfmt.Scan(&n)\n\n\tsotka := n / 100\n\tif sotka != 0 {\n\t\tn = n % 100\n\t}\n\tpoltos := n / 50\n\tif poltos != 0 {\n\t\tn = n % 50\n\t}\n\tdvadtsatka := n / 20\n\tif dvadtsatka != 0 {\n\t\tn = n % 20\n\t}\n\tchirik := n / 10\n\tif chirik != 0 {\n\t\tn = n % 10\n\t}\n\tpyatak := n / 5\n\tif pyatak != 0 {\n\t\tn = n % 5\n\t}\n\trubl := n\n\n\trez = sotka + poltos + dvadtsatka + chirik + pyatak + rubl\n\tfmt.Println(rez)\n\t//fmt.Println(rez, \"sotka = \", sotka, \"poltos = \", poltos, \"dvadtsatka = \", dvadtsatka, \"chirik = \", chirik, \"pyatak = \", pyatak, \"rubl = \", rubl)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar num1 uint32\n\tvar num2 uint8\n\n\tfmt.Fscan(os.Stdin, &num1)\n\tfmt.Scan(&num2)\n\n\tvar i uint8 = 1\n\n\tfor ; i <= num2; i++ {\n\n\t\tif (num1 % 10) == 0 {\n\t\t\tnum1 /= 10\n\t\t} else {\n\t\t\tnum1--\n\t\t}\n\t}\n\tfmt.Println(num1)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n, ans int\n ans = 0\n \n fmt.Scan(&n)\n ans += n/100\n n %= 100\n ans += n/50\n n %= 50\n ans += n/20\n n %= 20\n ans += n/5\n n %= 20\n ans += n\n \n fmt.Println(ans)\n}\n"}, {"source_code": "package main \n\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc printf(f string, a... interface{}) {\n\tfmt.Fprintf(writer, f, a...)\n}\n\nfunc scanf(f string, a... interface{}) {\n\tfmt.Fscanf(reader, f, a...)\n}\n\n\nfunc main() {\n\tvar A, one, five, ten, twenty, fifty, hundred, result uint64 \n\tone = 1\n\tfive = 5 \n\tten = 10 \n\ttwenty = 20 \n\tfifty = 50 \n\thundred = 100\n\n\tscanf(\"%d \\n\", &A)\n\t\n\tresult = 0\n\tif A % hundred == 0 {\n\t\tresult = A/hundred\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/hundred\n\tA = A - A/hundred * hundred\n\n\tif A % fifty == 0 {\n\t\tresult += A/fifty\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/fifty\n\tA = A - A/fifty * fifty\n\t\n\n\tif A % twenty == 0 {\n\t\tresult += A/twenty\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/twenty\n\tA = A - A/twenty * twenty\n\t\n\n\tif A % ten == 0 {\n\t\tresult += A/ten\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/ten\n\tA = A - A/ten * ten\n\n\n\tif A % five == 0 {\n\t\tresult += A/five\n\t\tfmt.Println(result)\n\t\treturn\n\t}\n\n\tresult += A/five\n\tA = A - A/five * five\n\t\n\n\n\tresult += A * one\n\n\tfmt.Println(result)\n\n\n\n\n}"}], "src_uid": "8e81ad7110552c20297f08ad3e5f8ddc"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar i int\n\tfmt.Scanf(\"%d\\n\",&i)\n\tfmt.Println(i%2)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t\n\tvar a int;\n\tfmt.Scan(&a)\n\n\tif a % 2 == 0 {\n\t\tfmt.Println(\"0\")\n\t} else {\n\t\tfmt.Println(\"1\")\n\t}\n\t\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\t var A int\n fmt.Scanf(\"%d\", &A)\n fmt.Printf(\"%d\\n\", (A&1))\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int;\n\tfmt.Scanf(\"%d\",&a);\n\tfmt.Print(a%2);\n}"}, {"source_code": "package main\nimport (\"fmt\")\nfunc main(){\n var p int;\n fmt.Scanf(\"%d\",&p)\n if p % 2 == 0 {\n fmt.Println(\"0\")\n } else {\n fmt.Println(\"1\")\n }\n \n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main(){\n var fahim int\n fmt.Scan(&fahim)\n fmt.Printf(\"%d\",fahim%2)\n}"}], "negative_code": [], "src_uid": "78e64fdbf59c5ce89d0f0a1d0591f795"} {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc main() {\n\tvar n, sum, ans, need int\n\tfmt.Scan(&n)\n\tv := make([]int, n)\n\tfor i := range v {\n\t\tfmt.Scan(&v[i])\n\t\tv[i] *= 2\n\t\tsum += v[i]\n\t}\n\tneed = 9 * n\n\tsort.Ints(v)\n\tfor i := range v {\n\t\tif sum >= need {\n\t\t\tbreak\n\t\t}\n\t\tsum += 10 - v[i]\n\t\tans++\n\t}\n\tfmt.Println(ans)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"sort\"\n \"math\"\n \"strconv\"\n \"strings\"\n )\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n n, _ := strconv.Atoi(scanner.Text())\n arr := make([]int, n)\n sum := 0\n scanner.Scan();\n str := strings.Fields(scanner.Text())\n for i:=0;i0;i++ {\n d := 5 - arr[i]\n rem -= d\n c++ \n }\n fmt.Println(c)\n\n}\n "}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tvar array [200]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &array[i])\n\t}\n\tsort.Ints(array[:n])\n\tvar sum float64 = float64(4.5 * float64(n))\n\n\tfor i := 0; i < n; i++ {\n\t\tsum -= float64(array[i])\n\t\t//\tfmt.Printf(\"%d \", array[i])\n\t}\n\t//\tfmt.Printf(\"%f\\n\", sum)\n\tif sum <= 0 {\n\t\tfmt.Printf(\"0\\n\")\n\t\treturn\n\t} else {\n\t\t//\tfmt.Printf(\"%f\\n\", sum)\n\t\tsum = -sum\n\t\tvar result int = 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tsum += float64(5 - array[i])\n\t\t\tresult++\n\t\t\t//\tfmt.Printf(\"%f\", sum)\n\t\t\tif sum >= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", result)\n\t}\n\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tvar array [200]int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &array[i])\n\t}\n\tsort.Ints(array[:n])\n\tvar sum float64 = 4.5 * float64(n)\n\n\tfor i := n - 1; i >= 0; i-- {\n\t\tsum -= float64(array[i])\n\t\t//\tfmt.Printf(\"%d \", array[i])\n\t}\n\tif sum <= 0 {\n\t\tfmt.Printf(\"0\\n\")\n\t\treturn\n\t} else {\n\t\t//\t\tfmt.Printf(\"%f\\n\", sum)\n\t\tsum = -sum\n\t\tvar result int = 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tsum += float64(5 - array[i])\n\t\t\tresult++\n\t\t\t//\tfmt.Printf(\"%f\", sum)\n\t\t\tif sum >= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"%d\\n\", result)\n\t}\n\n}\n"}], "src_uid": "715608282b27a0a25b66f08574a6d5bd"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar home = make(map[string]int)\n\tvar host = make(map[string]int)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Scan()\n\n\tfor scanner.Scan() {\n\t\tcolor := scanner.Text()\n\t\tif _, ok := home[color]; ok == false {\n\t\t\thome[color] = 1\n\t\t}else {\n\t\t\thome[color]++\n\t\t}\n\t\tscanner.Scan()\n\n\t\tcolor = scanner.Text()\n\t\tif _, ok := host[color]; ok == false {\n\t\t\thost[color] = 1\n\t\t}else {\n\t\t\thost[color]++\n\t\t}\n\t}\n\tvar count = 0\n\tfor key,value := range home {\n\t\tif v, ok := host[key]; ok != false {\n\t\t\tcount += v * value\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, ans int\n\tfmt.Scan(&n)\n\tuni := make([][2]int, n)\n\tfor i := range uni {\n\t\tfmt.Scan(&uni[i][0], &uni[i][1])\n\t}\n\tfor home := range uni {\n\t\tfor guest := range uni {\n\t\t\tif uni[home][0] == uni[guest][1] {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, h, a int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &n)\n\thost := make(map[int]int, n)\n\tguest := make([]int, a)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(in, &h, &a)\n\t\thost[h] = host[h] + 1\n\t\tguest = append(guest, a)\n\t}\n\tans := 0\n\tfor _, v := range guest {\n\t\tans += host[v]\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport(\n \"fmt\"\n)\n\ntype teamColor struct{\n hC,gC string\n}\n\nfunc main(){\n var(\n n int\n res = 0\n )\n fmt.Scan(&n)\n arr := make([]teamColor,n)\n for i:=0;i= 0; j-- {\n\t\t\tif h[i] == g[j] {\n\t\t\t\tresult++\n\t\t\t}\n\t\t\tif h[j] == g[i] {\n\t\t\t\tresult++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(result)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n var h,a [35]int\n fmt.Scan(&n)\n for i := 0; i < n; i++ { fmt.Scan(&h[i],&a[i]) }\n ans := 0\n for i := 0; i < n; i++ {\n for j := 0; j < n; j++ {\n if (i != j) && (h[i] == a[j]) {\n ans++\n }\n }\n }\n fmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\ntype Vertex struct {\n\thome, guest int\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tarr := make([]Vertex, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&arr[i].home, &arr[i].guest)\n\t}\n\n\tcount := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif arr[i].home == arr[j].guest {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tif arr[j].home == arr[i].guest {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\ntype team struct {\n\thomeUniform int\n\tguestUniform int\n}\n\nfunc main() {\n\tvar nTeams int\n\tfmt.Scanf(\"%d\\n\", &nTeams)\n\tteams := make([]team, nTeams)\n\tfor i := 0; i < nTeams; i++ {\n\t\tfmt.Scanf(\"%d %d\\n\", &teams[i].homeUniform, &teams[i].guestUniform)\n\t}\n\tvar count int\n\tfor i := 0; i < nTeams; i++ {\n\t\tfor j := 0; j < nTeams; j++ {\n\t\t\tif teams[i].homeUniform == teams[j].guestUniform {\n\t\t\t\tcount += 1\n\t\t\t}\n\t\t}\n\t}\n\t// fmt.Println(teams)\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\tn := 0\n\tfmt.Scanf(\"%d\\n\", &n)\n\tarr1 := []int{}\n\tarr2 := []int{}\n\n\tfor i := 0; i < n; i++ {\n\t\ta := 0\n\t\tb := 0\n\t\tfmt.Scanf(\"%d %d\\n\", &a, &b)\n\t\tarr1 = append(arr1, a)\n\t\tarr2 = append(arr2, b)\n\t}\n\n\tcnt := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tval := arr1[i]\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif j != i && arr2[j] == val {\n\t\t\t\tcnt += 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\tvar home = make([]int, n)\n\tvar away = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&home[i])\n\t\tfmt.Scan(&away[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (i != j) && (home[i] == away[j]) {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\tvar home = make([]int, n)\n\tvar away = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&home[i])\n\t\tfmt.Scan(&away[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif home[i] == away[j] {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\tvar home = make([]int, n)\n\tvar away = make([]int, n)\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tfor i := 0; i < n; i++ {\n\t\t// fmt.Scan(&home[i])\n\t\t// fmt.Scan(&away[i])\n\t\tscanner.Scan()\n\t\thome[i] = toInt(scanner.Bytes())\n\n\t\tscanner.Scan()\n\t\taway[i] = toInt(scanner.Bytes())\n\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif (i != j) && (home[i] == away[j]) {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\nfunc toInt(buf []byte) (n int) {\n\tfor _, v := range buf {\n\t\tn = n*10 + int(v-'0')\n\t}\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, count int\n\tfmt.Scan(&n)\n\tvar home = make(map[int]int, n)\n\tvar away = make(map[int]int, n)\n\tvar h, a int\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h)\n\t\tfmt.Scan(&a)\n\t\tif _, ok := home[h]; ok {\n\t\t\thome[h]++\n\t\t} else {\n\t\t\thome[h] = 1\n\t\t}\n\t\tif _, ok := away[a]; ok {\n\t\t\taway[a]++\n\t\t} else {\n\t\t\taway[a] = 1\n\t\t}\n\t}\n\n\tfor i := 1; i <= 100; i++ {\n\t\tif _, ok := home[i]; ok {\n\t\t\tif _, ok := away[i]; ok {\n\t\t\t\tcount += (home[i] * away[i])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar colors [][2]int\n\tvar n int\n\tfmt.Scan(&n)\n\n\tcolors = make([][2]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&colors[i][0], &colors[i][1])\n\t}\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif colors[i][0] == colors[j][1] {\n\t\t\t\tcnt += 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(cnt)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\n// Pair Pair\ntype Pair struct {\n\tFirst int\n\tSecond int\n}\n\nvar n int\nvar a []Pair\n\nfunc main() {\n\tfmt.Fscan(reader, &n)\n\ta = make([]Pair, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(reader, &a[i].First, &a[i].Second)\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i].First == a[j].Second {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Team struct {\n main uint8\n second uint8\n}\n\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tvar n uint8\n\tvar c uint16\n\tvar s []Team\n\t\n\tfmt.Fscanf(in, \"%d\\n\", &n)\n\tfor i:= uint8(0); i < n; i++{\n\t\tvar t Team\n\t\tfmt.Fscanf(in, \"%d %d\\n\", &t.main, &t.second)\n\t\ts = append(s, t)\n\t}\n\tfor i:= uint8(0); i < n; i++{\n\t\tfor j:= uint8(0); j < n; j++{\n\t\t\tif i != j{\n\t\t\t\tif s[i].main == s[j].second{\n\t\t\t\t\tc++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(c)\n\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nfunc main() {\n\tvar n,x,y int\n\tvar h,a [110]int\n\tfmt.Scan(&n)\n\tfor ;n>0;n-- {\n\t\tfmt.Scan(&x,&y)\n\t\th[x]++; a[y]++\n\t}\n\tr:=0\n\tfor i:=1;i<101;i++ {\n\t\tr += a[i]*h[i]\n\t}\n\tfmt.Print(r)\n}"}, {"source_code": "// URL: http://codeforces.com/problemset/problem/268/A\n// ~ Basic Implementation Problem\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc solve(colors [][2]int) int {\n\taway := make(map[int]int)\n\tfor _, val := range colors {\n\t\taway[val[1]] += 1\n\t}\n\tcount := 0\n\tfor _, val := range colors {\n\t\tcount += away[val[0]]\n\t}\n\treturn count\n}\n\nfunc main() {\n\treader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tcolors := make([][2]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(reader, \"%d %d\\n\", &colors[i][0], &colors[i][1])\n\t}\n\tfmt.Fprintf(writer, \"%d\\n\", solve(colors))\n}\n"}, {"source_code": "package main \n\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t//\"strings\"\n)\n\n\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\n\n\ntype Game struct {\n\thome int\n\taway int\n}\n\nfunc main() {\n\n\tvar T int\n\tscanf(\"%d \\n\", &T)\n\n\tgames := []Game{}\n\tfor i:=0; i n/2 {\n\t\tr = n - r\n\t}\n\tu := n + 1\n\tfor i := int64(1); i <= r; i++ {\n\t\tu--\n\t\tresult *= u\n\t\tresult /= i\n\t}\n\treturn result\n}\n\nfunc fact(n int64) int64 {\n\tresult := int64(1)\n\tfor i := int64(2); i <= n; i++ {\n\t\tresult *= i\n\t}\n\treturn result\n}\n\nvar reader = bufio.NewReader(os.Stdin)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar n int64\n\tfmt.Fscan(reader, &n)\n\tf := fact(n/2 - 1)\n\tfmt.Fprintln(writer, comb(n, n/2)/2*f*f)\n}\n"}], "negative_code": [], "src_uid": "ad0985c56a207f76afa2ecd642f56728"} {"source_code": "package main\n\n/*\n\tBasically we just need to determine whether given word is Belanese.\n\tA word is belanese if it follows following rule:\n\t- vowel after consonant except for \"n\"\n\t- anything after vowel or \"n\" -> including empty char\n\n\tSo we could just iterate each char in word. If we found a char which:\n\t- consonant but not n\n\t- not having vowel afterwards or last char\n\twe could infer that the word is not Belanese. Otherwise if we don't found\n\tanything like that, it must be Belanese.\n*/\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvocal := map[string]bool{\n\t\t\"a\": true,\n\t\t\"i\": true,\n\t\t\"u\": true,\n\t\t\"e\": true,\n\t\t\"o\": true,\n\t}\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tword := sc.Text()\n\tfor i := 0; i < len(word); i++ {\n\t\t// get status\n\t\tch := string(word[i])\n\t\tisLast := (i == len(word)-1)\n\t\tisVocal := vocal[ch]\n\t\tisN := (ch == \"n\")\n\t\t// get next char\n\t\tnextCh := \"\"\n\t\tif !isLast {\n\t\t\tnextCh = string(word[i+1])\n\t\t}\n\t\t// infer if word is belanese\n\t\tif !isN && (!isVocal && !vocal[nextCh] || !isVocal && isLast) {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc isAeiou(t string) bool {\n\tif t==\"a\" || t == \"e\" || t==\"i\" || t == \"o\" || t == \"u\" {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tfor i := 0; i < len(s)-1; i++ {\n\t\tif isAeiou(string(s[i])) || string(s[i])==\"n\" {\n\t\t\tcontinue\n\t\t}\n\t\tif !isAeiou(string(s[i+1])) {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn \n\t\t}\n\t}\n\tif isAeiou(string(s[len(s)-1])) || string(s[len(s)-1])==\"n\" {\n\t\tfmt.Println(\"YES\")\n\t}else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvocal := map[string]bool{\n\t\t\"a\": true,\n\t\t\"i\": true,\n\t\t\"u\": true,\n\t\t\"e\": true,\n\t\t\"o\": true,\n\t}\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tword := sc.Text()\n\tfor i := 0; i < len(word); i++ {\n\t\t// get status\n\t\tch := string(word[i])\n\t\tisLast := (i == len(word)-1)\n\t\tisVocal := vocal[ch]\n\t\tisN := (ch == \"n\")\n\t\t// get next char\n\t\tnextCh := \"\"\n\t\tif !isLast {\n\t\t\tnextCh = string(word[i+1])\n\t\t}\n\t\t// infer if word is belanese\n\t\tif !isN && (!isVocal && !vocal[nextCh] || !isVocal && isLast) {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc isVowel(c byte) bool {\n if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n succ := true\n for i, c := range []byte(s) {\n cur := true\n if !isVowel(c) && c != 'n' {\n cur = (i < len(s) - 1) && isVowel(s[i+1])\n }\n if !cur {\n succ = false\n }\n }\n if succ {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc isVowel(c byte) bool {\n if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n succ := true\n for i, c := range []byte(s) {\n cur := true\n if !isVowel(c) {\n if c == 'n' {\n } else {\n cur = (i < len(s) - 1) && isVowel(s[i+1])\n }\n }\n if !cur {\n succ = false \n }\n // fmt.Println(i, c, cur)\n }\n if succ {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n\n"}, {"source_code": "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\ntype state func() state\n\nfunc main() {\n\tdefer Flush()\n\n\ts := readb()\n\tvar i int\n\tok := true\n\n\tvar vowel, consonant state\n\tvowel = func() state {\n\t\t//eprintln(i, \"vowel\", ok)\n\t\tif i == len(s) {\n\t\t\treturn nil\n\t\t}\n\t\tswitch s[i] {\n\t\tcase 'a', 'o', 'u', 'i', 'e', 'n':\n\t\t\ti++\n\t\t\treturn vowel\n\t\tdefault:\n\t\t\ti++\n\t\t\treturn consonant\n\t\t}\n\t}\n\tconsonant = func() state {\n\t\t//eprintln(i, \"consonant\", ok)\n\t\tif i == len(s) {\n\t\t\tok = false\n\t\t\treturn nil\n\t\t}\n\t\tswitch s[i] {\n\t\tcase 'a', 'o', 'u', 'i', 'e':\n\t\t\ti++\n\t\t\treturn vowel\n\t\tdefault:\n\t\t\tok = false\n\t\t\treturn nil\n\t\t}\n\t}\n\tfor st := vowel; st != nil; st = st() {\n\t}\n\tif ok {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tif len(word) > 1 {\n\t\tfor i := 0; i < len(word)-1; i++ {\n\t\t\tif isBerlanese == false {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tletter := rune(word[i])\n\t\t\tnextLetter := rune(word[i+1])\n\t\t\tif letter == 'n' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t_, isVowel := vowels[letter]\n\t\t\tif isVowel == true {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\t\tif nextIsVowel == false {\n\t\t\t\t\tisBerlanese = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tletter := rune(word[0])\n\t\tif letter == 'n' {\n\t\t\tisBerlanese = true\n\t\t} else if _, V := vowels[letter]; V == true {\n\t\t\tisBerlanese = true\n\t\t} else {\n\t\t\tisBerlanese = false\n\t\t}\n\t}\n\n\tletter := rune(word[len(word)-1])\n\tif _, okay := vowels[letter]; !(okay == true || letter == 'n') {\n\t\tisBerlanese = false\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "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\tS := sc.NextLine()\n\n\tflag := false\n\tfor i := 0; i < len(S); i++ {\n\t\tswitch S[i] {\n\t\tcase 'a', 'i', 'u', 'e', 'o':\n\t\t\tflag = false\n\t\tdefault:\n\t\t\tif flag {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif S[i] != 'n' {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tfor {\n\t\tvar word string\n\t\t_, err := fmt.Scanln(&word)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\tneed_vowel, need_rune := false, false\n\t\tres := \"YES\"\n\n\t\tfor _, c := range word {\n\t\t\tswitch c {\n\t\t\tcase 'a', 'o', 'u', 'i', 'e':\n\t\t\tdefault:\n\t\t\t\tif need_vowel {\n\t\t\t\t\tres = \"NO\"\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif res == \"NO\" {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tswitch c {\n\t\t\tcase 'a', 'o', 'u', 'i', 'e', 'n':\n\t\t\t\tneed_vowel, need_rune = false, false\n\t\t\tdefault:\n\t\t\t\tneed_vowel, need_rune = true, true\n\t\t\t}\n\t\t}\n\n\t\tif need_rune {\n\t\t\tres = \"NO\"\n\t\t}\n\n\t\tfmt.Println(res)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\t\nfunc main() {\n var s string\n\tfmt.Scan(&s)\n\tt := true\n\tflag := false\n\tfor i,a := range(s){\n\t f := true\n\t for _,b := range([]rune{'a','o','u','i','e'}) {\n \t if a == b { f = false }\n \t}\n\t if flag && f {\n\t t = false\n\t break\n\t } else if flag && !f {\n\t flag = false \n\t } else if !flag && f && a != 'n'{\n\t flag = true\n\t } else if f && i == len(s)-1 && a != 'n' {\n\t t = false\n\t break\n\t }\n\t \n\t}\n\tif t && !flag {\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc isVowel(c byte) bool {\n if c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' {\n return true\n } else {\n return false\n }\n}\n\nfunc main() {\n var s string\n fmt.Scanf(\"%s\", &s)\n succ := true\n for i, c := range []byte(s) {\n cur := true\n if !isVowel(c) {\n if c == 'n' {\n cur = (i == len(s) - 1) || isVowel(s[i+1])\n } else {\n cur = (i < len(s) - 1) && isVowel(s[i+1])\n }\n }\n if !cur {\n succ = false \n }\n }\n if succ {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n}\n\n"}, {"source_code": "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\ntype state func() state\n\nfunc main() {\n\tdefer Flush()\n\n\ts := readb()\n\tvar i int\n\tok := true\n\n\tvar vowel, consonant state\n\tvowel = func() state {\n\t\t//eprintln(i, \"vowel\", ok)\n\t\tif i == len(s) {\n\t\t\treturn nil\n\t\t}\n\t\tswitch s[i] {\n\t\tcase 'a', 'o', 'u', 'i', 'e', 'n':\n\t\t\ti++\n\t\t\treturn vowel\n\t\tdefault:\n\t\t\ti++\n\t\t\treturn consonant\n\t\t}\n\t}\n\tconsonant = func() state {\n\t\t//eprintln(i, \"consonant\", ok)\n\t\tif i == len(s) {\n\t\t\tok = false\n\t\t\treturn nil\n\t\t}\n\t\tswitch s[i] {\n\t\tcase 'a', 'o', 'u', 'i', 'e', 'n':\n\t\t\ti++\n\t\t\treturn vowel\n\t\tdefault:\n\t\t\tok = false\n\t\t\treturn nil\n\t\t}\n\t}\n\tfor st := vowel; st != nil; st = st() {\n\t}\n\tif ok {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tword := readLine(reader)\n\n\tfor i := 0; i < len(word)-1; i++ {\n\t\tif isBerlanese == false {\n\t\t\tbreak\n\t\t}\n\t\tletter := rune(word[i])\n\t\tnextLetter := rune(word[i+1])\n\t\tif letter == 'n' {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, isVowel := vowels[letter]\n\t\tif isVowel == true {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == true {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == false {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif isBerlanese == true {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tif len(word) > 1 {\n\t\tfor i := 0; i < len(word)-1; i++ {\n\t\t\tif isBerlanese == false {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tletter := rune(word[i])\n\t\t\tnextLetter := rune(word[i+1])\n\t\t\tif letter == 'n' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t_, isVowel := vowels[letter]\n\t\t\tif isVowel == true {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\t\tif nextIsVowel == false {\n\t\t\t\t\tisBerlanese = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tletter := rune(word[0])\n\t\tif letter == 'n' {\n\t\t\tisBerlanese = true\n\t\t}\n\t\tif _, V := vowels[letter]; V == true {\n\t\t\tisBerlanese = true\n\t\t}\n\t\tisBerlanese = false\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tfor i := 0; i < len(word)-1; i++ {\n\t\tif isBerlanese == false {\n\t\t\tbreak\n\t\t}\n\t\tletter := rune(word[i])\n\t\tnextLetter := rune(word[i+1])\n\t\tif letter == 'n' {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, isVowel := vowels[letter]\n\t\tif isVowel == true {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == true {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == false {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tfor i := 0; i < len(word)-1; i++ {\n\t\tif isBerlanese == false {\n\t\t\tbreak\n\t\t}\n\t\tletter := rune(word[i])\n\t\tnextLetter := rune(word[i+1])\n\t\tif letter == 'n' {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, isVowel := vowels[letter]\n\t\tif isVowel == true {\n\t\t\tcontinue\n\t\t} else {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == false {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tif !(len(word) == 1) {\n\n\t\tfor i := 0; i < len(word)-1; i++ {\n\t\t\tif isBerlanese == false {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tletter := rune(word[i])\n\t\t\tnextLetter := rune(word[i+1])\n\t\t\tif letter == 'n' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t_, isVowel := vowels[letter]\n\t\t\tif isVowel == true {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\t\tif nextIsVowel == false {\n\t\t\t\t\tisBerlanese = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tfor i := 0; i < len(word)-1; i++ {\n\t\tif isBerlanese == false {\n\t\t\tbreak\n\t\t}\n\t\tletter := rune(word[i])\n\t\tnextLetter := rune(word[i+1])\n\t\tif len(word) == 1 && letter == 'n' {\n\t\t\tcontinue\n\t\t}\n\t\tif _, V := vowels[letter]; len(word) == 1 && V == true {\n\t\t\tcontinue\n\t\t}\n\t\tif len(word) == 1 {\n\t\t\tisBerlanese = false\n\t\t\tbreak\n\t\t}\n\t\tif letter == 'n' {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, isVowel := vowels[letter]\n\t\tif isVowel == true {\n\t\t\tcontinue\n\t\t} else {\n\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\tif nextIsVowel == false {\n\t\t\t\tisBerlanese = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nfunc readLine(reader *bufio.Reader) string {\n\tline, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\treturn strings.TrimRight(string(line), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc main() {\n\tvowels := make(map[rune]int)\n\tvar l rune\n\tfor l = 'a'; l <= 'z'; l++ {\n\t\tif l == 'a' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'e' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'i' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'o' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t\tif l == 'u' {\n\t\t\tvowels[l] = -1\n\t\t}\n\t}\n\n\tisBerlanese := true\n\tvar word string\n\tfmt.Scanf(\"%s\", &word)\n\n\tif len(word) > 1 {\n\t\tfor i := 0; i < len(word)-1; i++ {\n\t\t\tif isBerlanese == false {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tletter := rune(word[i])\n\t\t\tnextLetter := rune(word[i+1])\n\t\t\tif letter == 'n' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t_, isVowel := vowels[letter]\n\t\t\tif isVowel == true {\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t_, nextIsVowel := vowels[nextLetter]\n\t\t\t\tif nextIsVowel == false {\n\t\t\t\t\tisBerlanese = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tletter := rune(word[0])\n\t\tif letter == 'n' {\n\t\t\tisBerlanese = true\n\t\t} else if _, V := vowels[letter]; V == true {\n\t\t\tisBerlanese = true\n\t\t} else {\n\t\t\tisBerlanese = false\n\t\t}\n\t}\n\tif isBerlanese == true {\n\t\tfmt.Printf(\"%s\\n\", \"YES\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", \"NO\")\n\t}\n}\n"}, {"source_code": "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\tS := sc.NextLine()\n\n\tflag := false\n\tfor i := 0; i < len(S); i++ {\n\t\tswitch S[i] {\n\t\tcase 'a', 'i', 'u', 'e', 'o', 'n':\n\t\t\tflag = false\n\t\tdefault:\n\t\t\tif flag {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "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\tS := sc.NextLine()\n\n\tflag := false\n\tfor i := 0; i < len(S); i++ {\n\t\tswitch S[i] {\n\t\tcase 'a', 'i', 'u', 'e', 'o':\n\t\t\tflag = false\n\t\tcase 'n':\n\t\tdefault:\n\t\t\tif flag {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tflag = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\t\nfunc main() {\n var s string\n\tfmt.Scan(&s)\n\tt := true\n\tflag := false\n\tfor i,a := range(s){\n\t f := true\n\t if a != 'n' {\n \t for _,b := range([]rune{'a','o','u','i','e'}) {\n \t if a == b { f = false }\n \t }\n\t \n\t if flag && f {\n\t t = false\n\t break\n\t }\n\t if flag && !f {\n\t flag = false \n\t }\n\t if !flag && f {\n\t flag = true\n\t }\n\t if f && i == len(s)-1 {\n\t t = false\n\t break\n\t }\n\t }\n\t}\n\tif t {\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\t\nfunc main() {\n var s string\n\tfmt.Scan(&s)\n\tt := true\n\tflag := false\n\tfor i,a := range(s){\n\t f := true\n\t for _,b := range([]rune{'a','o','u','i','e'}) {\n \t if a == b { f = false }\n \t}\n\t if flag && f {\n\t t = false\n\t break\n\t } else if flag && !f {\n\t flag = false \n\t } else if !flag && f && a != 'n'{\n\t flag = true\n\t } else if f && i == len(s)-1 && a != 'n' {\n\t t = false\n\t break\n\t }\n\t \n\t}\n\tif t {\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\t\nfunc main() {\n var s string\n\tfmt.Scan(&s)\n\tt := true\n\tflag := false\n\tfor i,a := range(s){\n\t f := true\n\t for _,b := range([]rune{'a','o','u','i','e'}) {\n \t if a == b { f = false }\n \t}\n\t if flag && f && a!='n' {\n\t t = false\n\t break\n\t } else if flag && !f {\n\t flag = false \n\t } else if !flag && f && a != 'n'{\n\t flag = true\n\t } else if f && i == len(s)-1 && a != 'n' {\n\t t = false\n\t break\n\t }\n\t \n\t}\n\tif t {\n\t fmt.Println(\"YES\")\n\t} else {\n\t fmt.Println(\"NO\")\n\t}\n}"}], "src_uid": "a83144ba7d4906b7692456f27b0ef7d4"} {"source_code": "package main\nimport \"fmt\"\nfunc main(){\n\tvar(\n\t\tn int\n\t\ts string\n\t)\n\tfmt.Scan(&n,&s)\n\tfor i:=0;i Yes\n\t// A?B -> No\n\tfor i := range maj {\n\t\tif maj[i] == '?' {\n\t\t\tif i == 0 || i == len(maj)-1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == '?' || maj[i+1] == '?' {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == maj[i+1] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tif solve() {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfor i:=1;i0||strings.Count(s,\"CC\")>0||strings.Count(s,\"YY\")>0{\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tif s[0]=='?'||s[n-1]=='?'||strings.Count(s,\"??\")>0||strings.Count(s,\"M?M\")>0||strings.Count(s,\"C?C\")>0||strings.Count(s,\"Y?Y\")>0{\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}"}, {"source_code": "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\tfor i := 1; i < n; i++ {\n\t\tif s[i - 1] == s[i] && s[i] != '?' {\n\t\t\tfmt.Print(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tif s[0] == '?' || s[n - 1] == '?' {\n\t\tfmt.Print(\"Yes\")\n\t\treturn\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tif s[i - 1] == '?' && s[i] == '?' {\n\t\t\tfmt.Print(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 1; i < n - 1; i++ {\n\t\tif s[i] == '?' && s[i - 1] == s[i + 1] {\n\t\t\tfmt.Print(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"No\")\n\treturn\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar cs map[int]int = make(map[int]int)\n\nfunc Init() {}\nfunc Solve(io *FastIO) {\n\t_ = io.NextInt()\n\ts := io.NextString()\n\tif check(0, rune('K'), s) > 1 {\n\t\tio.Println(\"Yes\")\n\t} else {\n\t\tio.Println(\"No\")\n\t}\n}\nfunc check(sti int, l rune, s string) int {\n\tc := 0\n\tchs := \"CMY\"\n\ts = s[sti:]\n\t//fmt.Println(l, s)\n\tfor i, j := range s {\n\t\tif j != '?' {\n\t\t\tif j == l {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\tl = j\n\t\t\t}\n\t\t} else if i+1 < len(s) {\n\t\t\tfor _, k := range chs {\n\t\t\t\tif k != l {\n\t\t\t\t\tc += check(i+1, k, s)\n\t\t\t\t}\n\t\t\t\tif c > 1 {\n\t\t\t\t\treturn c\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn 1\n}\n\ntype FastIO struct {\n\t//by megaspazz\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = int64(-1)\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int64(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextInt() + 1\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextLong()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\n', '\\r':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar cs map[int]int = make(map[int]int)\n\nfunc Init() {}\nfunc Solve(io *FastIO) {\n\tn := io.NextInt()\n\ts := io.NextString()\n\tif n == 1 {\n\t\tio.Println(\"Yes\")\n\t\treturn\n\t}\n\ts += string(s[n-2])\n\tl := s[1]\n\to := false\n\tvar j byte\n\tfor i := 0; i < n; i++ {\n\t\tj = s[i]\n\t\tif j != '?' {\n\t\t\tif l == j {\n\t\t\t\to = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif s[i+1] == '?' || s[i+1] == l {\n\t\t\t\to = true\n\t\t\t}\n\t\t}\n\t\tl = j\n\t}\n\tif o {\n\t\tio.Println(\"Yes\")\n\t} else {\n\t\tio.Println(\"No\")\n\t}\n}\n\ntype FastIO struct {\n\t//by megaspazz\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = int64(-1)\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int64(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextInt() + 1\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextLong()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\n', '\\r':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar cs map[int]int = make(map[int]int)\n\nfunc Init() {}\nfunc Solve(io *FastIO) {\n\tn := io.NextInt()\n\ts := io.NextString() + \"K\"\n\tl := byte('K')\n\to := false\n\tvar j byte\n\tfor i := 0; i < n; i++ {\n\t\tj = s[i]\n\t\tif j != '?' {\n\t\t\tif l == j {\n\t\t\t\to = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif s[i+1] == '?' || s[i+1] == l {\n\t\t\t\to = true\n\t\t\t}\n\t\t}\n\t\tl = j\n\t}\n\tif o {\n\t\tio.Println(\"Yes\")\n\t} else {\n\t\tio.Println(\"No\")\n\t}\n}\n\ntype FastIO struct {\n\t//by megaspazz\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = int64(-1)\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int64(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextInt() + 1\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextLong()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\n', '\\r':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc solve() bool {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tscanner.Scan()\n\tmaj := scanner.Text()\n\tfor i := 0; i < len(maj)-1; i++ {\n\t\tif maj[i] == maj[i+1] && maj[i] != '?' {\n\t\t\tfmt.Println(\"FIRST\")\n\t\t\treturn false\n\t\t}\n\t}\n\t// A?A -> Yes\n\t// A?B -> No\n\tfor i := range maj {\n\t\tif maj[i] == '?' {\n\t\t\tif i == 0 || i == len(maj)-1 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == '?' || maj[i+1] == '?' {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif maj[i-1] == maj[i+1] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tif solve() {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scanf(\"%d\\n\", &n)\n\tfmt.Scanf(\"%s\\n\", &s)\n\tfor i:=1;i longestOutside {\n longestOutside = len(w)\n }\n }\n\n inParenthesis := 0\n for _, w := range inside {\n if len(w) > 0 {\n inParenthesis++\n }\n }\n\n fmt.Println(longestOutside, inParenthesis)\n}", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n \"regexp\"\n \"strconv\"\n \"strings\"\n)\n\nfunc O(o interface{}, n bool) {\n if n {\n fmt.Println(o)\n } else {\n fmt.Printf(\"%v \", o)\n }\n}\n\nfunc Int(s string) int64 {\n t, _ := strconv.ParseInt(s, 10, 64)\n return t\n}\n\nfunc I(n bool) string {\n var t string\n if n {\n fmt.Scanln(&t)\n } else {\n fmt.Scan(&t)\n }\n return t\n}\n\nfunc main() {\n n := Int(I(true))\n s := I(true)\n n = n\n\n re := regexp.MustCompile(`\\([^\\(\\)]*\\)`)\n ss := re.FindAllString(s, -1)\n\n ooo := re.ReplaceAllString(s, \"_\")\n\n rrr := regexp.MustCompile(`([_])*`)\n ooo = rrr.ReplaceAllString(ooo, \"$1\")\n qqq := strings.Split(ooo, \"_\")\n mmm := 0\n for _, q := range qqq {\n if len(q) > mmm {\n mmm = len(q)\n }\n }\n\n O(mmm, false)\n\n num := 0\n for i := range ss {\n sss := strings.Split(ss[i], \"_\")\n for j := range sss {\n r := regexp.MustCompile(`[_\\(\\)]`)\n sss[j] = r.ReplaceAllString(sss[j], \"\")\n if len(sss[j]) > 0 {\n num++\n }\n }\n }\n O(num, true)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(bufin, \"%d\\n\", &n)\n\tfmt.Fscanf(bufin, \"%s\\n\", &s)\n\n\tinside := false\n\tl := 0\n\n\tlongestOutside := 0\n\tcountInside := 0\n\n\ts = \"_\" + s + \"_\"\n\tn = len(s)\n\n\tfor i := 0; i < n; i++ {\n\t\tc := s[i]\n\t\tif (c == '_') || (c == '(') || (c == ')') {\n\t\t\tif l > 0 {\n\t\t\t\tif inside {\n\t\t\t\t\tcountInside++\n\t\t\t\t} else {\n\t\t\t\t\tif longestOutside < l {\n\t\t\t\t\t\tlongestOutside = l\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tl = 0\n\t\t\t}\n\t\t} else {\n\t\t\tl++\n\t\t}\n\t\tif c == '(' {\n\t\t\tinside = true\n\t\t} else if c == ')' {\n\t\t\tinside = false\n\t\t}\n\t}\n\n\tfmt.Fprintf(bufout, \"%d %d\\n\", longestOutside, countInside)\n}\n"}, {"source_code": "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 (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\t_ = nextInt()\n\ts := next()\n\tvar outsideWords []string\n\n\tfor i := strings.Index(s, \"(\"); i >= 0; i = strings.Index(s, \"(\") {\n\t\tj := strings.Index(s, \")\")\n\t\toutsideWords = append(outsideWords, splitWords(s[i+1:j], '_')...)\n\t\ts = s[:i] + \"_\" + s[j+1:]\n\t}\n\n\tprintln(maxLength(splitWords(s, '_')), len(outsideWords))\n\n}\n\nfunc splitWords(s string, c rune) []string {\n\treturn strings.FieldsFunc(s, func(c rune) bool { return c == '_' })\n}\n\nfunc maxLength(s []string) int {\n\tl := 0\n\n\tfor i := range s {\n\t\tif len(s[i]) > l {\n\t\t\tl = len(s[i])\n\t\t}\n\t}\n\n\treturn l\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {return a}\n\treturn b\n}\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\tstr string\n\t)\n\t\n\tfmt.Scanln(&n)\n\tfmt.Scanln(&str)\n\t\n\ti := 0;\n\ts_words := 0\n\ts_len := 0\n\tw_len := 0\n\tw_max := 0\n\tfor i < n {\n\t\tif str[i] == '(' {\n\t\t\ti++\n\t\t\t\n\t\t\tfor i < n && str[i] != ')' {\n\t\t\t\tif str[i] != '_' {\n\t\t\t\t\ts_len++\n\t\t\t\t} else {\n\t\t\t\t\tif s_len > 0 {\n\t\t\t\t\t\ts_words++\n\t\t\t\t\t}\n\t\t\t\t\ts_len = 0\n\t\t\t\t}\n\t\t\t\ti++\n\n\t\t\t}\n\t\t\ti++\n\t\t\tif s_len > 0 {\n\t\t\t\ts_words++\n\t\t\t}\n\t\t\ts_len = 0\n\t\t\tcontinue\n\t\t}\n\t\t\t\n\t\t\n\t\tfor i < n && str[i] != '(' {\n\t\t\t\tif str[i] != '_' {\n\t\t\t\t\tw_len++\n\t\t\t\t} else {\n\t\t\t\t\tif w_len > 0 {\n\t\t\t\t\t\tw_max = max(w_max, w_len)\n\t\t\t\t\t}\n\t\t\t\t\tw_len = 0\n\t\t\t\t}\n\t\t\t\ti++\n\t\t\t}\n\n\t\tif w_len > 0 {\n\t\t\tw_max = max(w_max, w_len)\n\t\t}\n\t\tw_len = 0\n\t}\n\n\t\n\t\n\tfmt.Println(w_max, s_words)\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scanf(\"%d\\n\", &n); err != nil {\n\t\treturn\n\t}\n\n\tvar longest int = 0\n\tvar words_inside int = 0\n\n\treader := bufio.NewReader(os.Stdin)\n\tif s, err := reader.ReadString('\\n'); err != nil {\n\t\tif err != io.EOF {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tinside := false\n\t\tword_length := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif (s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z') {\n\t\t\t\tword_length++\n\t\t\t} else {\n\t\t\t\tif !inside && word_length > longest {\n\t\t\t\t\tlongest = word_length\n\t\t\t\t}\n\t\t\t\tif inside && word_length > 0 {\n\t\t\t\t\twords_inside++\n\t\t\t\t}\n\t\t\t\tif s[i] == '(' {\n\t\t\t\t\tinside = true\n\t\t\t\t} else if s[i] == ')' {\n\t\t\t\t\tinside = false\n\t\t\t\t}\n\t\t\t\tword_length = 0\n\t\t\t}\n\t\t}\n\t\tif word_length > longest {\n\t\t\tlongest = word_length\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d %d\\n\", longest, words_inside)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\ntype res struct {\n\tind int\n\twrd string\n}\n\nfunc inside_parthesis(S string, x *res) bool {\n\tl, r := false, false\n\tfor i := x.ind; i >= 0; i-- {\n\t\tif S[i] == '(' {\n\t\t\tl = true\n\t\t\tbreak\n\t\t} else if S[i] == ')' {\n\t\t\tbreak\n\t\t}\n\t}\n\tfor i := x.ind; i < len(S); i++ {\n\t\tif S[i] == ')' {\n\t\t\tr = true\n\t\t\tbreak\n\t\t} else if S[i] == '(' {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn l && r\n}\nfunc mysplit(S string) []res {\n\tvar cur string\n\tvar start int\n\tvar ret []res\n\n\tfor i, c := range S {\n\t\tif c != '_' && c != '(' && c != ')' {\n\t\t\tif cur == \"\" {\n\t\t\t\tstart = i\n\t\t\t}\n\t\t\tcur += string(c)\n\t\t} else if cur != \"\" {\n\t\t\tret = append(ret, res{start, cur})\n\t\t\tcur = \"\"\n\t\t}\n\t}\n\tif cur != \"\" {\n\t\tret = append(ret, res{start, cur})\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\tvar N int\n\tfmt.Fscanf(bufin, \"%d\\n\", &N)\n\tvar S string\n\tfmt.Fscanf(bufin, \"%s\\n\", &S)\n\twords := mysplit(S)\n\tcnt := 0\n\tmaxlen := 0\n\tfor _, x := range words {\n\t\tif inside_parthesis(S, &x) {\n\t\t\tcnt += 1\n\t\t} else {\n\t\t\tif maxlen < len(x.wrd) {\n\t\t\t\tmaxlen = len(x.wrd)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintf(bufout, \"%d %d\\n\", maxlen, cnt)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tn := fsc.NextInt()\n\ttext := fsc.Next()\n\tvar flag, maxLength, inLength, outLength, count int\n\tfor i := 0; i <= n; i++ {\n\t\tif i == n {\n\t\t\tif maxLength < outLength {\n\t\t\t\tmaxLength = outLength\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tif text[i] == '(' {\n\t\t\tif maxLength < outLength {\n\t\t\t\tmaxLength = outLength\n\t\t\t}\n\t\t\toutLength = 0\n\t\t\tflag = 1\n\t\t} else if text[i] == ')' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tflag = 0\n\t\t} else if text[i] == '_' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tif outLength != 0 {\n\t\t\t\tif maxLength < outLength {\n\t\t\t\t\tmaxLength = outLength\n\t\t\t\t}\n\t\t\t}\n\t\t\toutLength = 0\n\t\t} else if flag == 0 {\n\t\t\toutLength++\n\t\t} else if flag == 1 {\n\t\t\tinLength++\n\t\t}\n\t}\n\n\tfmt.Println(maxLength, count)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) 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\tpanic(err.Error())\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype TupleInt struct {\n\tfirst int\n\tsecond int\n\tthird int\n}\n\nfunc main() {\n\tin := NewScanner()\n\t_ = in.NextInt()\n\tS := in.NextLine()\n\tinside := false\n\tmx := 0\n\tcount := 0\n\tcomma := false\n\tln := 0\n\tfor _, s := range S {\n\t\tif s == '(' {\n\t\t\tinside = true\n\t\t\tcomma = true\n\t\t} else if s == ')' {\n\t\t\tinside = false\n\t\t\tcomma = true\n\n\t\t} else if s == '_' {\n\t\t\tcomma = true\n\t\t} else {\n\t\t\tif !inside {\n\t\t\t\tln++\n\t\t\t\tmx = max(mx, ln)\n\t\t\t}\n\n\t\t\tif comma {\n\t\t\t\tif inside {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tcomma = false\n\t\t\t}\n\t\t}\n\t\tif comma {\n\t\t\tln = 0\n\t\t}\n\n\t}\n\tfmt.Println(mx, count)\n}\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn 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, 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}\n\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\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); 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}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif 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\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\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"}], "negative_code": [{"source_code": "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 (\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\t_ = nextInt()\n\ts := next()\n\tvar outsideWords []string\n\n\tfor i := strings.Index(s, \"(\"); i >= 0; i = strings.Index(s, \"(\") {\n\t\tj := strings.Index(s, \")\")\n\t\toutsideWords = append(outsideWords, splitWords(s[i+1:j], '_')...)\n\t\ts = s[:i] + s[j+1:]\n\t}\n\n\tprintln(maxLength(splitWords(s, '_')), len(outsideWords))\n\n}\n\nfunc splitWords(s string, c rune) []string {\n\treturn strings.FieldsFunc(s, func(c rune) bool { return c == '_' })\n}\n\nfunc maxLength(s []string) int {\n\tl := 0\n\n\tfor i := range s {\n\t\tif len(s[i]) > l {\n\t\t\tl = len(s[i])\n\t\t}\n\t}\n\n\treturn l\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main;\n\nimport (\"fmt\"; \"bufio\"; \"os\"; \"strings\")\n\n\nfunc groups(line string) ([]string, []string) {\n outside, inside := make([]string, 0, 10), make([]string, 0, 10)\n parts := strings.FieldsFunc(line, func(c rune) bool {\n return c=='(' || c==')'\n })\n out := line[0]!='('\n for _, p := range parts {\n if out { \n outside = append(outside, strings.Split(p, \"_\") ...)\n } else {\n inside = append(inside, strings.Split(p, \"_\") ...)\n }\n out = !out\n }\n\n return outside, inside\n\n}\n\n\nfunc main() {\n inp := bufio.NewReader(os.Stdin)\n scanner := bufio.NewScanner(inp)\n\n scanner.Scan() // number\n scanner.Scan()\n outside, inside := groups(scanner.Text())\n\n fmt.Fprintf(os.Stderr, \"%v - %v \\n\", outside, inside)\n\n longestOutside := 0\n for _, w := range outside {\n if len(w) > longestOutside {\n longestOutside = len(w)\n }\n }\n\n inParenthesis := 0\n for _, w := range inside {\n if len(w) > 0 {\n inParenthesis++\n }\n }\n\n fmt.Println(longestOutside, inParenthesis)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tn := fsc.NextInt()\n\ttext := fsc.Next()\n\tvar flag, maxLength, inLength, outLength, count int\n\tfor i := 0; i < n; i++ {\n\t\tif text[i] == '(' {\n\t\t\tif maxLength < outLength {\n\t\t\t\tmaxLength = outLength\n\t\t\t}\n\t\t\toutLength = 0\n\t\t\tflag = 1\n\t\t} else if text[i] == ')' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tflag = 0\n\t\t} else if text[i] == '_' {\n\t\t\tif inLength != 0 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t\tinLength = 0\n\t\t\tif outLength != 0 {\n\t\t\t\tif maxLength < outLength {\n\t\t\t\t\tmaxLength = outLength\n\t\t\t\t}\n\t\t\t}\n\t\t\toutLength = 0\n\t\t} else if flag == 0 {\n\t\t\toutLength++\n\t\t} else if flag == 1 {\n\t\t\tinLength++\n\t\t}\n\t}\n\n\tfmt.Println(maxLength, count)\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 2028)\n\treturn &FastScanner{r: rdr}\n}\n\nfunc (s *FastScanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\n\nfunc (s *FastScanner) NextInt() int {\n\tval, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tval, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn val\n}\nfunc (s *FastScanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n\nfunc (s *FastScanner) 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\tpanic(err.Error())\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"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\ntype TupleInt struct {\n\tfirst int\n\tsecond int\n\tthird int\n}\n\nfunc main() {\n\tin := NewScanner()\n\t_ = in.NextInt()\n\tS := in.NextLine()\n\tinside := false\n\tlast := 0\n\tmx := 0\n\tcount := 0\n\tcomma := false\n\n\tfor i, s := range S {\n\t\tif s == '(' {\n\t\t\tinside = true\n\t\t\tcomma = true\n\t\t} else if s == ')' {\n\t\t\tinside = false\n\t\t\tcomma = true\n\t\t\tlast = i + 1\n\n\t\t} else if s == '_' {\n\t\t\tcomma = true\n\t\t} else {\n\t\t\tif comma {\n\t\t\t\tif inside {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t\tcomma = false\n\t\t\t}\n\t\t}\n\t\tif comma {\n\t\t\tif !inside {\n\t\t\t\tmx = max(mx, i - last)\n\t\t\t}\n\t\t\tlast = i + 1\n\t\t}\n\n\t}\n\tfmt.Println(mx, count)\n}\nfunc max(a int, b int) int {\n\tif a < b {\n\t\treturn 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, 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}\n\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\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); 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}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif 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\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\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"}], "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readString()\n\tvalues := make([]int, 0)\n\tfor len(k) > 0 {\n\t\tvar maxValue int\n\t\tvar maxIndex int\n\t\tfor i := len(k) - 1; i >= 0; i-- {\n\t\t\tvalue, err := strconv.ParseInt(k[i:], 10, 64)\n\t\t\tif err == nil {\n\t\t\t\tif value < n {\n\t\t\t\t\tmaxValue = int(value)\n\t\t\t\t\tmaxIndex = i\n\t\t\t\t} else {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif maxIndex+1 < len(k) {\n\t\t\tif maxValue != 0 {\n\t\t\t\tfor maxIndex < len(k) && k[maxIndex] == '0' {\n\t\t\t\t\tmaxIndex++\n\t\t\t\t}\n\t\t\t} else if maxValue == 0 {\n\t\t\t\tmaxIndex = len(k) - 1\n\t\t\t}\n\t\t}\n\t\tk = k[:maxIndex]\n\t\tvalues = append(values, maxValue)\n\t}\n\tvar res int64\n\tfor i := len(values) - 1; i >= 0; i-- {\n\t\tres *= n\n\t\tres += int64(values[i])\n\t}\n\tfmt.Println(res)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"sort\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc find_last_le_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] <= target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\treturn s - 1\n}\n\n\nfunc find_first_ge_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] < target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\n\treturn s\n}\n\nfunc maxSumSubmatrix(a [][]int, target int) int {\n\trow := len(a)\n\tif row == 0{\n\t\treturn 0\n\t}\n\tcol := len(a[0])\n\n\tpre_sum := make([][]int, row)\n\tfor i := range pre_sum{\n\t\tpre_sum[i] = make([]int ,col)\n\t}\n\n\tfor i := 0;i < row; i ++{\n\t\tfor j :=0;j < col; j ++{\n\t\t\tif j == 0 {\n\t\t\t\tpre_sum[i][j] = a[i][j]\n\t\t\t}else {\n\t\t\t\tpre_sum[i][j] = pre_sum[i][j-1] + a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tnear := -100000000\n\tfor i := 0; i < col ; i ++{\n\t\tfor j :=i ;j near) {\n\t\t\t\t//\t\tnear = cur\n\t\t\t\t//\t}\n\t\t\t\t//\ttmp = append(tmp, cur)\n\t\t\t\t//}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn near\n}\n\nfunc q(matrix [][]int, k int) int {\n\trow := len(matrix)\n\tcol := len(matrix[0])\n\tnear := -1000000\n\tfor left := 0; left < col ; left ++{\n\t// \u4ee5left\u4e3a\u5de6\u8fb9\u754c\uff0c\u6bcf\u884c\u7684\u603b\u548c\n\t\t_sum :=make([]int, row)\n\t//for right in range(left, col):\n\t\tfor right :=left ;right 1 {\n\t\t\tif idx - left +1 < min_l{\n\t\t\t\tmin_l = idx - left + 1\n\t\t\t\tm_l = left\n\t\t\t\tm_r = idx\n\t\t\t}\n\t\t\tcounter[record[left]] --\n\n\t\t\t//}else {\n\t\t\t//\n\t\t\t//}\n\t\t\tif counter[record[left]] == 0 {\n\t\t\t\ttarget --\n\t\t\t}\n\t\t\tleft ++\n\t\t}else{\n\t\t\t\tidx ++\n\t\t\tcounter[record[idx]] ++\n\t\t\tif counter[record[idx]] == 1{\n\t\t\t\ttarget ++\n\t\t\t}\n\t\t\t//idx++\n\t\t}\n\t}\n\tfmt.Println(m_l + 1, m_r + 1)\n}\n\nfunc ini(){\n\tvar n int\n\t//var k int\n\tfmt.Scan(&n)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < n; i ++{\n\t\tfmt.Scan(&ori[i])\n\t\tfmt.Scan(&energy[i])\n\t}\n\tR := -1\n\tL := 0\n\tfor i :=0; i < n; i ++{\n\t\t//if record[L] == i - k{\n\t\t//\tL ++\n\t\t//}\n\t\tfor ;R >= L &&ori[i] >ori[record[R]];R--{\n\t\t\tcounter[i]\t+= energy[record[R]]\n\t\t}\n\t\ttmp := energy[i]\n\t\tfor ;R >= L &&ori[i] ==ori[record[R]];R--{\n\t\t\ttmp += energy[i]\n\t\t}\n\t\tR ++\n\t\trecord[R] = i\n\t\tif R != 0 {\n\t\t\tcounter[record[R - 1]] += tmp\n\t\t}\n\t}\n\tm := -1\n\tfor i :=0; i m{\n\t\t\tm = counter[i]\n\t\t}\n\t}\n\tfmt.Println(m)\n}\ntype S struct {\n\tIdx int\n\tTime int\n\n}\ntype intSlice []S\n\nfunc (p intSlice) Len() int { return len(p) }\nfunc (p intSlice) Less(i, j int) bool { return p[i].Time > p[j].Time }\nfunc (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nvar roww [1000]int\nvar coll [1000]int\nfunc inii(){\n\tvar m,n,k,l,d int\n\t//var k int\n\trow := make(intSlice, 10000)\n\tcol := make(intSlice, 10000)\n\tfmt.Scan(&m, &n, &k, &l,&d)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < d; i ++{\n\t\tvar x1,y1,x2,y2 int\n\t\tfmt.Scan(&x1,&y1,&x2,&y2)\n\t\tif x1 == x2 {\n\t\t\tif y1 > y2 {\n\t\t\t\ty1,y2 = y2,y1\n\t\t\t}\n\t\t\tcol[y1].Idx = y1\n\t\t\tcol[y1].Time ++\n\t\t}else{\n\t\t\t\tif x1 > x2{\n\t\t\t\t\tx1,x2 = x2,x1\n\t\t\t\t}\n\t\t\t\trow[x1].Idx = x1\n\t\t\trow[x1].Time ++\n\t\t}\n\t\t//fmt.Scan(&energy[i])\n\t}\n\t//row = row[:m+1]\n\t//col = col[:n + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\trow = row[:k+1]\n\tcol = col[:l + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\tfor i := 0;i < k-1;i ++ {\n\t\tfmt.Print(row[i].Idx,\" \")\n\t}\n\tfmt.Print(row[k -1 ].Idx,\"\\n\")\n\tfor i := 0;i < l-1;i ++ {\n\t\tfmt.Print(col[i].Idx,\" \")\n\t}\n\tfmt.Print(col[l -1 ].Idx,\"\\n\")\n\n}\n\n\nfunc next_per(){\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n,&m)\n\ta :=make([]int, n)\n\tfor i:=0;i 0;m--{\n\t\ti := 0\n\t\tfor i = n-2;i >=0;i --{\n\t\t\tif a[i] < a[i + 1]{\n\t\t\t\tbreak\n\t\t\t}\n\n\n\t\t}\n\t\t//t := a[i+1]\n\t\tj := 0\n\t\tfor j = i + 1;j < n;j ++{\n\t\t\tif a[j] <= a[i]{\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[i],a[j-1] = a[j-1],a[i]\n\t\tsort.Ints(a[i + 1:])\n\n\t}\n\tfmt.Println(a)\n\n\n}\nvar s string\nvar n,ans,length,carry int64\n//var ans int\n//var length int\n//var carry int\n//func max(x,y int)int{\n//\tif x > y{\n//\t\treturn x\n//\t}\n//\treturn y\n//}\nfunc maxf(x, y int64)int64{\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc get(k int)int{\n\tvar x int64\n\tvar t int64 = 1\n\ti := k\n\tfor ;i >= 0; i -- {\n\t\tif x + maxf(int64(1), (int64)(s[i]-'0')) * int64(t) >=n{\n\t\t\tbreak\n\t\t}\n\t\tx += int64(s[i]-'0') * t\n\t\tt *= 10\n\t}\n\tfor ;s[i+ 1] == '0'&& i < k-1;i ++{\n\n\t}\n\tans += x * carry\n\treturn i\n}\nfunc qq(){\n\n\tcarry = 1\n\tfmt.Scan(&n, &s)\n\ti := len(s) - 1\n\tfor ;i >=0;{\n\t\ti = get(i)\n\t\tcarry *=n\n\t}\n\tfmt.Println( ans)\n\n}\n\nfunc main(){\n\t//a := [][]int{{28,4,-19,18,-7,-10,27,19,1,16,0,10,-17,11,11,27,-1,10,12,-1},\n\t//\t{-2,-19,17,4,25,-20,4,3,4,28,-10,7,16,-14,-3,-19,6,17,-4,-7},\n\t//\t{2,8,18,-17,-2,10,-6,-5,11,10,22,-6,19,-16,6,-4,18,5,22,-17},\n\t//\t{-14,-7,-20,13,-19,-20,-15,21,-11,-10,-8,-9,10,13,6,-10,15,9,-15,-2},\n\t//\t{-18,26,12,8,2,16,-17,12,0,-5,9,-3,-12,-11,3,-6,-18,16,-7,-14},\n\t//\t{5,29,25,22,11,-3,-2,-15,4,13,-17,-2,0,-2,20,10,-18,6,25,-20},\n\t//\t{5,-7,8,5,15,22,8,-5,22,-18,-5,-14,23,2,-8,12,-16,-18,12,-12},\n\t//\t{27,18,4,11,-3,12,-4,-8,-3,25,-9,24,-14,5,11,-9,-17,0,25,-15},\n\t//\t{26,-7,18,4,4,18,-17,9,-19,-9,-19,-8,-4,-13,10,-11,6,-16,-12,12},\n\t//\t{28,22,7,11,-6,13,8,22,7,-14,17,14,10,29,16,9,-3,18,-9,10},\n\t//\t{27,19,-10,-9,1,3,14,1,7,3,-3,16,-2,9,14,-7,-19,-5,23,19},\n\t//\t{-17,7,-20,8,-5,-6,-2,25,29,16,23,4,4,27,16,17,9,20,-6,22},\n\t//\t{2,9,-13,1,-18,25,4,7,25,26,-4,8,-19,18,6,-7,-5,7,21,-8},\n\t//\t{-2,11,1,29,6,-16,-8,3,7,11,10,-2,-1,-20,20,4,19,5,29,-7},\n\t//\t{29,-12,-3,17,6,19,23,12,-19,13,19,5,27,22,-17,27,10,-12,12,23},\n\t//\t{24,16,4,25,15,13,24,-19,1,-7,-19,13,-13,14,13,26,9,18,-9,-18},\n\t//\t{-17,4,-18,-18,-19,3,-13,12,23,-17,-10,-20,14,2,18,21,-12,27,-3,4},\n\t//\t{27,13,12,14,16,-9,-2,-15,-20,8,-2,24,18,15,26,21,27,17,-15,-3},\n\t//\t{25,-8,17,-10,-16,13,26,-11,-15,6,-5,-13,23,2,24,-4,5,8,-15,-1},\n\t//\t{15,-12,18,5,-3,7,5,11,-4,-13,28,20,0,-4,-13,-5,-13,-8,-16,3}}\n\n\t//log.Println(find_last_le_idx(a, 3))\n\t//log.Println(q(a, -123))\n\n\t//aa := []int{2,3,1,3,4,6,1,2}\n\t//mm(aa, 1)\n\t//ini()\n//inii()\n\t//next_per()\n\tqq()\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"sort\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc find_last_le_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] <= target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\treturn s - 1\n}\n\n\nfunc find_first_ge_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] < target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\n\treturn s\n}\n\nfunc maxSumSubmatrix(a [][]int, target int) int {\n\trow := len(a)\n\tif row == 0{\n\t\treturn 0\n\t}\n\tcol := len(a[0])\n\n\tpre_sum := make([][]int, row)\n\tfor i := range pre_sum{\n\t\tpre_sum[i] = make([]int ,col)\n\t}\n\n\tfor i := 0;i < row; i ++{\n\t\tfor j :=0;j < col; j ++{\n\t\t\tif j == 0 {\n\t\t\t\tpre_sum[i][j] = a[i][j]\n\t\t\t}else {\n\t\t\t\tpre_sum[i][j] = pre_sum[i][j-1] + a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tnear := -100000000\n\tfor i := 0; i < col ; i ++{\n\t\tfor j :=i ;j near) {\n\t\t\t\t//\t\tnear = cur\n\t\t\t\t//\t}\n\t\t\t\t//\ttmp = append(tmp, cur)\n\t\t\t\t//}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn near\n}\n\nfunc q(matrix [][]int, k int) int {\n\trow := len(matrix)\n\tcol := len(matrix[0])\n\tnear := -1000000\n\tfor left := 0; left < col ; left ++{\n\t// \u4ee5left\u4e3a\u5de6\u8fb9\u754c\uff0c\u6bcf\u884c\u7684\u603b\u548c\n\t\t_sum :=make([]int, row)\n\t//for right in range(left, col):\n\t\tfor right :=left ;right 1 {\n\t\t\tif idx - left +1 < min_l{\n\t\t\t\tmin_l = idx - left + 1\n\t\t\t\tm_l = left\n\t\t\t\tm_r = idx\n\t\t\t}\n\t\t\tcounter[record[left]] --\n\n\t\t\t//}else {\n\t\t\t//\n\t\t\t//}\n\t\t\tif counter[record[left]] == 0 {\n\t\t\t\ttarget --\n\t\t\t}\n\t\t\tleft ++\n\t\t}else{\n\t\t\t\tidx ++\n\t\t\tcounter[record[idx]] ++\n\t\t\tif counter[record[idx]] == 1{\n\t\t\t\ttarget ++\n\t\t\t}\n\t\t\t//idx++\n\t\t}\n\t}\n\tfmt.Println(m_l + 1, m_r + 1)\n}\n\nfunc ini(){\n\tvar n int\n\t//var k int\n\tfmt.Scan(&n)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < n; i ++{\n\t\tfmt.Scan(&ori[i])\n\t\tfmt.Scan(&energy[i])\n\t}\n\tR := -1\n\tL := 0\n\tfor i :=0; i < n; i ++{\n\t\t//if record[L] == i - k{\n\t\t//\tL ++\n\t\t//}\n\t\tfor ;R >= L &&ori[i] >ori[record[R]];R--{\n\t\t\tcounter[i]\t+= energy[record[R]]\n\t\t}\n\t\ttmp := energy[i]\n\t\tfor ;R >= L &&ori[i] ==ori[record[R]];R--{\n\t\t\ttmp += energy[i]\n\t\t}\n\t\tR ++\n\t\trecord[R] = i\n\t\tif R != 0 {\n\t\t\tcounter[record[R - 1]] += tmp\n\t\t}\n\t}\n\tm := -1\n\tfor i :=0; i m{\n\t\t\tm = counter[i]\n\t\t}\n\t}\n\tfmt.Println(m)\n}\ntype S struct {\n\tIdx int\n\tTime int\n\n}\ntype intSlice []S\n\nfunc (p intSlice) Len() int { return len(p) }\nfunc (p intSlice) Less(i, j int) bool { return p[i].Time > p[j].Time }\nfunc (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nvar roww [1000]int\nvar coll [1000]int\nfunc inii(){\n\tvar m,n,k,l,d int\n\t//var k int\n\trow := make(intSlice, 10000)\n\tcol := make(intSlice, 10000)\n\tfmt.Scan(&m, &n, &k, &l,&d)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < d; i ++{\n\t\tvar x1,y1,x2,y2 int\n\t\tfmt.Scan(&x1,&y1,&x2,&y2)\n\t\tif x1 == x2 {\n\t\t\tif y1 > y2 {\n\t\t\t\ty1,y2 = y2,y1\n\t\t\t}\n\t\t\tcol[y1].Idx = y1\n\t\t\tcol[y1].Time ++\n\t\t}else{\n\t\t\t\tif x1 > x2{\n\t\t\t\t\tx1,x2 = x2,x1\n\t\t\t\t}\n\t\t\t\trow[x1].Idx = x1\n\t\t\trow[x1].Time ++\n\t\t}\n\t\t//fmt.Scan(&energy[i])\n\t}\n\t//row = row[:m+1]\n\t//col = col[:n + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\trow = row[:k+1]\n\tcol = col[:l + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\tfor i := 0;i < k-1;i ++ {\n\t\tfmt.Print(row[i].Idx,\" \")\n\t}\n\tfmt.Print(row[k -1 ].Idx,\"\\n\")\n\tfor i := 0;i < l-1;i ++ {\n\t\tfmt.Print(col[i].Idx,\" \")\n\t}\n\tfmt.Print(col[l -1 ].Idx,\"\\n\")\n\n}\n\n\nfunc next_per(){\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n,&m)\n\ta :=make([]int, n)\n\tfor i:=0;i 0;m--{\n\t\ti := 0\n\t\tfor i = n-2;i >=0;i --{\n\t\t\tif a[i] < a[i + 1]{\n\t\t\t\tbreak\n\t\t\t}\n\n\n\t\t}\n\t\t//t := a[i+1]\n\t\tj := 0\n\t\tfor j = i + 1;j < n;j ++{\n\t\t\tif a[j] <= a[i]{\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[i],a[j-1] = a[j-1],a[i]\n\t\tsort.Ints(a[i + 1:])\n\n\t}\n\tfmt.Println(a)\n\n\n}\nvar s string\nvar n,ans,length,carry int\n//var ans int\n//var length int\n//var carry int\n//func max(x,y int)int{\n//\tif x > y{\n//\t\treturn x\n//\t}\n//\treturn y\n//}\nfunc maxf(x, y int)int{\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc get(k int)int{\n\tvar x int\n\tvar t int = 1\n\ti := k\n\tfor ;i >= 0; i -- {\n\t\tif x + maxf(int(1), (int)(s[i]-'0')) * int(t) >=n{\n\t\t\tbreak\n\t\t}\n\t\tx += int(s[i]-'0') * t\n\t\tt *= 10\n\t}\n\tfor ;s[i+ 1] == '0'&& i < k-1;i ++{\n\n\t}\n\tans += x * carry\n\treturn i\n}\nfunc qq(){\n\n\tcarry = 1\n\tfmt.Scan(&n, &s)\n\ti := len(s) - 1\n\tfor ;i >=0;{\n\t\ti = get(i)\n\t\tcarry *=n\n\t}\n\tfmt.Println( ans)\n\n}\n\nfunc main(){\n\t//a := [][]int{{28,4,-19,18,-7,-10,27,19,1,16,0,10,-17,11,11,27,-1,10,12,-1},\n\t//\t{-2,-19,17,4,25,-20,4,3,4,28,-10,7,16,-14,-3,-19,6,17,-4,-7},\n\t//\t{2,8,18,-17,-2,10,-6,-5,11,10,22,-6,19,-16,6,-4,18,5,22,-17},\n\t//\t{-14,-7,-20,13,-19,-20,-15,21,-11,-10,-8,-9,10,13,6,-10,15,9,-15,-2},\n\t//\t{-18,26,12,8,2,16,-17,12,0,-5,9,-3,-12,-11,3,-6,-18,16,-7,-14},\n\t//\t{5,29,25,22,11,-3,-2,-15,4,13,-17,-2,0,-2,20,10,-18,6,25,-20},\n\t//\t{5,-7,8,5,15,22,8,-5,22,-18,-5,-14,23,2,-8,12,-16,-18,12,-12},\n\t//\t{27,18,4,11,-3,12,-4,-8,-3,25,-9,24,-14,5,11,-9,-17,0,25,-15},\n\t//\t{26,-7,18,4,4,18,-17,9,-19,-9,-19,-8,-4,-13,10,-11,6,-16,-12,12},\n\t//\t{28,22,7,11,-6,13,8,22,7,-14,17,14,10,29,16,9,-3,18,-9,10},\n\t//\t{27,19,-10,-9,1,3,14,1,7,3,-3,16,-2,9,14,-7,-19,-5,23,19},\n\t//\t{-17,7,-20,8,-5,-6,-2,25,29,16,23,4,4,27,16,17,9,20,-6,22},\n\t//\t{2,9,-13,1,-18,25,4,7,25,26,-4,8,-19,18,6,-7,-5,7,21,-8},\n\t//\t{-2,11,1,29,6,-16,-8,3,7,11,10,-2,-1,-20,20,4,19,5,29,-7},\n\t//\t{29,-12,-3,17,6,19,23,12,-19,13,19,5,27,22,-17,27,10,-12,12,23},\n\t//\t{24,16,4,25,15,13,24,-19,1,-7,-19,13,-13,14,13,26,9,18,-9,-18},\n\t//\t{-17,4,-18,-18,-19,3,-13,12,23,-17,-10,-20,14,2,18,21,-12,27,-3,4},\n\t//\t{27,13,12,14,16,-9,-2,-15,-20,8,-2,24,18,15,26,21,27,17,-15,-3},\n\t//\t{25,-8,17,-10,-16,13,26,-11,-15,6,-5,-13,23,2,24,-4,5,8,-15,-1},\n\t//\t{15,-12,18,5,-3,7,5,11,-4,-13,28,20,0,-4,-13,-5,-13,-8,-16,3}}\n\n\t//log.Println(find_last_le_idx(a, 3))\n\t//log.Println(q(a, -123))\n\n\t//aa := []int{2,3,1,3,4,6,1,2}\n\t//mm(aa, 1)\n\t//ini()\n//inii()\n\t//next_per()\n\tqq()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt64()\n\tk := readString()\n\tvalues := make([]int, 0)\n\tfor len(k) > 0 {\n\t\tvar maxValue int\n\t\tvar maxIndex int\n\t\tfor i := len(k) - 1; i >= 0; i-- {\n\t\t\tvalue, err := strconv.ParseInt(k[i:], 10, 32)\n\t\t\tif err == nil {\n\t\t\t\tif value <= n {\n\t\t\t\t\tmaxValue = int(value)\n\t\t\t\t\tmaxIndex = i\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\t\tif maxIndex+1 < len(k) {\n\t\t\tfor maxIndex < len(k) && k[maxIndex] == '0' {\n\t\t\t\tmaxIndex++\n\t\t\t}\n\t\t}\n\t\tk = k[:maxIndex]\n\t\tvalues = append(values, maxValue)\n\t}\n\tvar res int64\n\tfor i := len(values) - 1; i >= 0; i-- {\n\t\tres *= n\n\t\tres += int64(values[i])\n\t}\n\tfmt.Println(res)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"sort\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc find_last_le_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] <= target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\treturn s - 1\n}\n\n\nfunc find_first_ge_idx(a []int, target int )int {\n\t//if not exist rturn -1\n\n\ts := 0\n\te := len(a)\n\tfor ;s < e;{\n\t\tmid := s +(e- s)/2\n\t\tif a[mid ] < target{\n\t\t\ts = mid + 1\n\t\t}else {\n\t\t\te = mid\n\t\t}\n\t}\n\n\treturn s\n}\n\nfunc maxSumSubmatrix(a [][]int, target int) int {\n\trow := len(a)\n\tif row == 0{\n\t\treturn 0\n\t}\n\tcol := len(a[0])\n\n\tpre_sum := make([][]int, row)\n\tfor i := range pre_sum{\n\t\tpre_sum[i] = make([]int ,col)\n\t}\n\n\tfor i := 0;i < row; i ++{\n\t\tfor j :=0;j < col; j ++{\n\t\t\tif j == 0 {\n\t\t\t\tpre_sum[i][j] = a[i][j]\n\t\t\t}else {\n\t\t\t\tpre_sum[i][j] = pre_sum[i][j-1] + a[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tnear := -100000000\n\tfor i := 0; i < col ; i ++{\n\t\tfor j :=i ;j near) {\n\t\t\t\t//\t\tnear = cur\n\t\t\t\t//\t}\n\t\t\t\t//\ttmp = append(tmp, cur)\n\t\t\t\t//}\n\t\t\t}\n\n\t\t}\n\t}\n\treturn near\n}\n\nfunc q(matrix [][]int, k int) int {\n\trow := len(matrix)\n\tcol := len(matrix[0])\n\tnear := -1000000\n\tfor left := 0; left < col ; left ++{\n\t// \u4ee5left\u4e3a\u5de6\u8fb9\u754c\uff0c\u6bcf\u884c\u7684\u603b\u548c\n\t\t_sum :=make([]int, row)\n\t//for right in range(left, col):\n\t\tfor right :=left ;right 1 {\n\t\t\tif idx - left +1 < min_l{\n\t\t\t\tmin_l = idx - left + 1\n\t\t\t\tm_l = left\n\t\t\t\tm_r = idx\n\t\t\t}\n\t\t\tcounter[record[left]] --\n\n\t\t\t//}else {\n\t\t\t//\n\t\t\t//}\n\t\t\tif counter[record[left]] == 0 {\n\t\t\t\ttarget --\n\t\t\t}\n\t\t\tleft ++\n\t\t}else{\n\t\t\t\tidx ++\n\t\t\tcounter[record[idx]] ++\n\t\t\tif counter[record[idx]] == 1{\n\t\t\t\ttarget ++\n\t\t\t}\n\t\t\t//idx++\n\t\t}\n\t}\n\tfmt.Println(m_l + 1, m_r + 1)\n}\n\nfunc ini(){\n\tvar n int\n\t//var k int\n\tfmt.Scan(&n)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < n; i ++{\n\t\tfmt.Scan(&ori[i])\n\t\tfmt.Scan(&energy[i])\n\t}\n\tR := -1\n\tL := 0\n\tfor i :=0; i < n; i ++{\n\t\t//if record[L] == i - k{\n\t\t//\tL ++\n\t\t//}\n\t\tfor ;R >= L &&ori[i] >ori[record[R]];R--{\n\t\t\tcounter[i]\t+= energy[record[R]]\n\t\t}\n\t\ttmp := energy[i]\n\t\tfor ;R >= L &&ori[i] ==ori[record[R]];R--{\n\t\t\ttmp += energy[i]\n\t\t}\n\t\tR ++\n\t\trecord[R] = i\n\t\tif R != 0 {\n\t\t\tcounter[record[R - 1]] += tmp\n\t\t}\n\t}\n\tm := -1\n\tfor i :=0; i m{\n\t\t\tm = counter[i]\n\t\t}\n\t}\n\tfmt.Println(m)\n}\ntype S struct {\n\tIdx int\n\tTime int\n\n}\ntype intSlice []S\n\nfunc (p intSlice) Len() int { return len(p) }\nfunc (p intSlice) Less(i, j int) bool { return p[i].Time > p[j].Time }\nfunc (p intSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nvar roww [1000]int\nvar coll [1000]int\nfunc inii(){\n\tvar m,n,k,l,d int\n\t//var k int\n\trow := make(intSlice, 10000)\n\tcol := make(intSlice, 10000)\n\tfmt.Scan(&m, &n, &k, &l,&d)\n\t//fmt.Scan(&k)\n\tfor i := 0;i < d; i ++{\n\t\tvar x1,y1,x2,y2 int\n\t\tfmt.Scan(&x1,&y1,&x2,&y2)\n\t\tif x1 == x2 {\n\t\t\tif y1 > y2 {\n\t\t\t\ty1,y2 = y2,y1\n\t\t\t}\n\t\t\tcol[y1].Idx = y1\n\t\t\tcol[y1].Time ++\n\t\t}else{\n\t\t\t\tif x1 > x2{\n\t\t\t\t\tx1,x2 = x2,x1\n\t\t\t\t}\n\t\t\t\trow[x1].Idx = x1\n\t\t\trow[x1].Time ++\n\t\t}\n\t\t//fmt.Scan(&energy[i])\n\t}\n\t//row = row[:m+1]\n\t//col = col[:n + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\trow = row[:k+1]\n\tcol = col[:l + 1]\n\tsort.Sort(row)\n\tsort.Sort(col)\n\tfor i := 0;i < k-1;i ++ {\n\t\tfmt.Print(row[i].Idx,\" \")\n\t}\n\tfmt.Print(row[k -1 ].Idx,\"\\n\")\n\tfor i := 0;i < l-1;i ++ {\n\t\tfmt.Print(col[i].Idx,\" \")\n\t}\n\tfmt.Print(col[l -1 ].Idx,\"\\n\")\n\n}\n\n\nfunc next_per(){\n\tvar n int\n\tvar m int\n\tfmt.Scan(&n,&m)\n\ta :=make([]int, n)\n\tfor i:=0;i 0;m--{\n\t\ti := 0\n\t\tfor i = n-2;i >=0;i --{\n\t\t\tif a[i] < a[i + 1]{\n\t\t\t\tbreak\n\t\t\t}\n\n\n\t\t}\n\t\t//t := a[i+1]\n\t\tj := 0\n\t\tfor j = i + 1;j < n;j ++{\n\t\t\tif a[j] <= a[i]{\n\t\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[i],a[j-1] = a[j-1],a[i]\n\t\tsort.Ints(a[i + 1:])\n\n\t}\n\tfmt.Println(a)\n\n\n}\nvar s string\nvar n,ans,length,carry float64\n//var ans int\n//var length int\n//var carry int\n//func max(x,y int)int{\n//\tif x > y{\n//\t\treturn x\n//\t}\n//\treturn y\n//}\nfunc maxf(x, y float64)float64{\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc get(k int)int{\n\tvar x float64\n\tvar t float64 = 1\n\ti := k\n\tfor ;i >= 0; i -- {\n\t\tif x + maxf(float64(1), (float64)(s[i]-'0')) * float64(t) >=n{\n\t\t\tbreak\n\t\t}\n\t\tx += float64(s[i]-'0') * t\n\t\tt *= 10\n\t}\n\tfor ;s[i+ 1] == '0'&& i < k-1;i ++{\n\n\t}\n\tans += x * carry\n\treturn i\n}\nfunc qq(){\n\n\tcarry = 1\n\tfmt.Scan(&n, &s)\n\ti := len(s) - 1\n\tfor ;i >=0;{\n\t\ti = get(i)\n\t\tcarry *=n\n\t}\n\tfmt.Println(ans)\n\n}\n\nfunc main(){\n\t//a := [][]int{{28,4,-19,18,-7,-10,27,19,1,16,0,10,-17,11,11,27,-1,10,12,-1},\n\t//\t{-2,-19,17,4,25,-20,4,3,4,28,-10,7,16,-14,-3,-19,6,17,-4,-7},\n\t//\t{2,8,18,-17,-2,10,-6,-5,11,10,22,-6,19,-16,6,-4,18,5,22,-17},\n\t//\t{-14,-7,-20,13,-19,-20,-15,21,-11,-10,-8,-9,10,13,6,-10,15,9,-15,-2},\n\t//\t{-18,26,12,8,2,16,-17,12,0,-5,9,-3,-12,-11,3,-6,-18,16,-7,-14},\n\t//\t{5,29,25,22,11,-3,-2,-15,4,13,-17,-2,0,-2,20,10,-18,6,25,-20},\n\t//\t{5,-7,8,5,15,22,8,-5,22,-18,-5,-14,23,2,-8,12,-16,-18,12,-12},\n\t//\t{27,18,4,11,-3,12,-4,-8,-3,25,-9,24,-14,5,11,-9,-17,0,25,-15},\n\t//\t{26,-7,18,4,4,18,-17,9,-19,-9,-19,-8,-4,-13,10,-11,6,-16,-12,12},\n\t//\t{28,22,7,11,-6,13,8,22,7,-14,17,14,10,29,16,9,-3,18,-9,10},\n\t//\t{27,19,-10,-9,1,3,14,1,7,3,-3,16,-2,9,14,-7,-19,-5,23,19},\n\t//\t{-17,7,-20,8,-5,-6,-2,25,29,16,23,4,4,27,16,17,9,20,-6,22},\n\t//\t{2,9,-13,1,-18,25,4,7,25,26,-4,8,-19,18,6,-7,-5,7,21,-8},\n\t//\t{-2,11,1,29,6,-16,-8,3,7,11,10,-2,-1,-20,20,4,19,5,29,-7},\n\t//\t{29,-12,-3,17,6,19,23,12,-19,13,19,5,27,22,-17,27,10,-12,12,23},\n\t//\t{24,16,4,25,15,13,24,-19,1,-7,-19,13,-13,14,13,26,9,18,-9,-18},\n\t//\t{-17,4,-18,-18,-19,3,-13,12,23,-17,-10,-20,14,2,18,21,-12,27,-3,4},\n\t//\t{27,13,12,14,16,-9,-2,-15,-20,8,-2,24,18,15,26,21,27,17,-15,-3},\n\t//\t{25,-8,17,-10,-16,13,26,-11,-15,6,-5,-13,23,2,24,-4,5,8,-15,-1},\n\t//\t{15,-12,18,5,-3,7,5,11,-4,-13,28,20,0,-4,-13,-5,-13,-8,-16,3}}\n\n\t//log.Println(find_last_le_idx(a, 3))\n\t//log.Println(q(a, -123))\n\n\t//aa := []int{2,3,1,3,4,6,1,2}\n\t//mm(aa, 1)\n\t//ini()\n//inii()\n\t//next_per()\n\tqq()\n}\n"}], "src_uid": "be66399c558c96566a6bb0a63d2503e5"} {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n := ReadInt32()\n writer.WriteString(\"+------------------------+\\n\")\n if n <= 4 {\n switch n {\n case 0:\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|D|)\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|\\n\")\n writer.WriteString(\"|#.......................|\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\\n\")\n break\n case 1:\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|\\n\")\n writer.WriteString(\"|#.......................|\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\\n\")\n break\n case 2:\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\\n\")\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\\n\")\n writer.WriteString(\"|#.......................|\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\\n\")\n break\n case 3:\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\\n\")\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\\n\")\n writer.WriteString(\"|O.......................|\\n\")\n writer.WriteString(\"|#.#.#.#.#.#.#.#.#.#.#.|.|)\\n\")\n break\n case 4:\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|D|)\\n\")\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|.|\\n\")\n writer.WriteString(\"|O.......................|\\n\")\n writer.WriteString(\"|O.#.#.#.#.#.#.#.#.#.#.|.|)\\n\")\n break\n }\n } else {\n s := make([]string, 3)\n s[1] = \"|O.#.#.#.#.#.#.#.#.#.#.|D|)\\n\"\n s[2] = \"|O.#.#.#.#.#.#.#.#.#.#.|.|\\n\"\n s[0] = \"|O.#.#.#.#.#.#.#.#.#.#.|.|)\\n\"\n n -= 4\n\n for i := 1; i <= n; i++ {\n s[i%3] = strings.Replace(s[i%3], \"#\", \"O\", 1)\n }\n writer.WriteString(s[1])\n writer.WriteString(s[2])\n writer.WriteString(\"|O.......................|\\n\")\n writer.WriteString(s[0])\n }\n\n writer.WriteString(\"+------------------------+\\n\")\n}\n\n/*\n\n|O.O.O.#.#.#.#.#.#.#.#.|D|)\n|O.O.O.#.#.#.#.#.#.#.#.|.|\n|O.......................|\n|O.O.#.#.#.#.#.#.#.#.#.|.|)\n\n*/\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar k int\n\tfmt.Scanf(\"%d\", &k)\n\trows := []int{0,0,0,0}\n\tif k <= 4 {\n\t\tfor i := 0; i < k; i++ {\n\t\t\trows[i] = 1\n\t\t}\n\t} else {\n\t\trows[2] = 1\n\t\tq := (k - 4) / 3\n\t\tr := (k - 4) % 3\n\t\trows[0], rows[1], rows[3] = q + 1, q + 1, q + 1\n\t\tif r >= 1 {\n\t\t\trows[0]++\n\t\t}\n\t\tif r >= 2 {\n\t\t\trows[1]++\n\t\t}\n\t}\n\tfmt.Println(\"+------------------------+\")\n\tfmt.Printf(\"|%s%s|D|)\\n\", strings.Repeat(\"O.\", rows[0]), strings.Repeat(\"#.\", 11 - rows[0]))\n\tfmt.Printf(\"|%s%s|.|\\n\", strings.Repeat(\"O.\", rows[1]), strings.Repeat(\"#.\", 11 - rows[1]))\n\tif rows[2] > 0 {\n\t\tfmt.Printf(\"|%s%s..|\\n\", strings.Repeat(\"O.\", rows[2]), strings.Repeat(\"..\", 11 - rows[2]))\n\t} else {\n\t\tfmt.Printf(\"|%s%s..|\\n\", strings.Repeat(\"#.\", 1), strings.Repeat(\"..\", 10))\n\t}\n\tfmt.Printf(\"|%s%s|.|)\\n\", strings.Repeat(\"O.\", rows[3]), strings.Repeat(\"#.\", 11 - rows[3]))\n\tfmt.Println(\"+------------------------+\")\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\n\nfunc ReadInt32() int {\n scanner.Scan()\n ans, _ := strconv.Atoi(scanner.Text())\n return ans\n}\n\nfunc ReadString() string {\n scanner.Scan()\n return scanner.Text()\n}\n\nfunc main() {\n defer writer.Flush()\n scanner.Split(bufio.ScanWords)\n\n n := ReadInt32()\n s := make([]string, 4)\n\n s[1] = \"|#.#.#.#.#.#.#.#.#.#.#.|D|)\\n\"\n s[2] = \"|#.#.#.#.#.#.#.#.#.#.#.|.|\\n\"\n s[0] = \"|#.#.#.#.#.#.#.#.#.#.#.|.|)\\n\"\n\n if n >= 3 {\n s[3] = \"|O.......................|\\n\"\n n--\n } else {\n s[3] = \"|#.......................|\\n\"\n }\n\n for i := 1; i <= n; i++ {\n s[i%3] = strings.Replace(s[i%3], \"#\", \"O\", 1)\n }\n\n writer.WriteString(\"+------------------------+\\n\")\n writer.WriteString(s[1])\n writer.WriteString(s[2])\n writer.WriteString(s[3])\n writer.WriteString(s[0])\n writer.WriteString(\"+------------------------+\\n\")\n}\n"}], "negative_code": [], "src_uid": "075f83248f6d4d012e0ca1547fc67993"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tre := regexp.MustCompile(`\\r?\\n`)\n\tif garland, err := reader.ReadString('\\n'); err != nil {\n\t\tif err != io.EOF {\n\t\t\treturn\n\t\t}\n\t} else {\n\t\tgarland = re.ReplaceAllString(garland, \"\")\n\n\t\tneeds := make([]int, 4)\n\t\tcolor_idx := make([]int, 4) // Index of RBYG\n\n\t\tfor i := 0; i < len(garland); i++ {\n\t\t\tk := i % 4\n\t\t\tif 'R' == garland[i] {\n\t\t\t\tcolor_idx[0] = k\n\t\t\t} else if 'B' == garland[i] {\n\t\t\t\tcolor_idx[1] = k\n\t\t\t} else if 'Y' == garland[i] {\n\t\t\t\tcolor_idx[2] = k\n\t\t\t} else if 'G' == garland[i] {\n\t\t\t\tcolor_idx[3] = k\n\t\t\t} else if '!' == garland[i] {\n\t\t\t\tneeds[k]++\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"Error\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tfmt.Printf(\"%d \", needs[color_idx[i]])\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t)\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\td := map[string]int{\n\t\t\"R\":0,\n\t\t\"B\":1,\n\t\t\"Y\":2,\n\t\t\"G\":3,\n\t}\n\tcnt := []int{0, 0, 0, 0}\n\tmod := []int{-1, -1, -1, -1}\n\tfor i, s := range(input) {\n\t\tif string(s) == \"!\" {\n\t\t\tcontinue\n\t\t}\n\t\tx := d[string(s)]\n\t\tcnt[x]++\n\t\tmod[x] = i % 4\n\t}\n\tfor i := 0; i < 4; i++ {\n\t\tval := len(input) / 4\n\t\tif len(input) % 4 > mod[i] {\n\t\t\tval++\n\t\t}\n\t\tfmt.Printf(\"%d \", val - cnt[i])\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tstr1 := readString()\n\ta := []byte(str1)\n\tres := make([]int, 4)\n\tdfs(a, 0, res)\n\tfor i := 0; i < len(res); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Printf(\" %d\", res[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d\", res[i])\n\t\t}\n\t}\n\tfmt.Println()\n}\n\nfunc dfs(a []byte, pos int, res []int) bool {\n\tif pos == len(a) {\n\t\treturn true\n\t}\n\tif a[pos] != '!' {\n\t\tif dfs(a, pos+1, res) {\n\t\t\treturn true\n\t\t}\n\t} else {\n\t\tfor j, v := range \"RBYG\" {\n\t\t\tch := byte(v)\n\t\t\tok := true\n\t\t\tfor j := 0; j < 3; j++ {\n\t\t\t\tk := pos - j - 1\n\t\t\t\tif k >= 0 && a[k] == ch {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tk = pos + j + 1\n\t\t\t\tif k < len(a) && a[k] == ch {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\ta[pos] = ch\n\t\t\t\tif dfs(a, pos+1, res) {\n\t\t\t\t\tres[j]++\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\ta[pos] = '!'\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar bulbs string\n\tfmt.Scanln(&bulbs)\n\n\tr, b, y, g := 0, 0, 0, 0\n\n\tlen_bulbs := len(bulbs)\n\n\tfor i := 0; i < len_bulbs; i++ {\n\t\tif bulbs[i] == '!' {\n\t\t\tfor j := i % 4; j < len_bulbs; j = j + 4 {\n\t\t\t\tc := bulbs[j]\n\t\t\t\tif c == 'R' {\n\t\t\t\t\tr++\n\t\t\t\t\tbreak\n\t\t\t\t} else if c == 'B' {\n\t\t\t\t\tb++\n\t\t\t\t\tbreak\n\t\t\t\t} else if c == 'Y' {\n\t\t\t\t\ty++\n\t\t\t\t\tbreak\n\t\t\t\t} else if c == 'G' {\n\t\t\t\t\tg++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(r, b, y, g)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\t\n\tS := io.NextLine()\n\n\tdead := make([]int, 4)\n\tindex := make([]int, 256)\n\tfor i, c := range S {\n\t\tif c == '!' {\n\t\t\tdead[i % 4]++\n\t\t} else {\n\t\t\tindex[c] = i % 4\n\t\t}\n\t}\n\tio.Printf(\"%d %d %d %d\\n\", dead[index['R']], dead[index['B']], dead[index['Y']], dead[index['G']])\n\t\n\tio.FlushOutput()\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif (c == '-') {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif (c == '-') {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"strconv\"\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.NextLine()\n\tcolor := map[int]rune{}\n\n\tfor i, v := range S {\n\t\tif v == '!' {\n\t\t\tcontinue\n\t\t}\n\t\tcolor[i % 4] = v\n\t}\n\tans := map[rune]int{}\n\n\tfor i, v := range S {\n\t\tif v == '!' {\n\t\t\tans[color[i % 4]]++\n\t\t}\n\t}\n\tfmt.Println(ans['R'], ans['B'], ans['Y'], ans['G'])\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"}], "negative_code": [{"source_code": "package main\nimport (\n\t\"fmt\"\n)\n\n\nfunc main() {\n\tvar bulbs string\n\tfmt.Scanln(&bulbs)\n\n\tr, b, y, g := 0, 0, 0, 0\n\n\tlen_bulbs := len(bulbs)\n\n\tfor i := 0; i < len_bulbs; i++ {\n\t\tif bulbs[i] == '!' {\n\t\t\tfor j := i % 4; j < len_bulbs; j = j + 4 {\n\t\t\t\tswitch bulbs[j] {\n\t\t\t\t\tcase 'R':\n\t\t\t\t\t\tr++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'B':\n\t\t\t\t\t\tb++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'Y':\n\t\t\t\t\t\ty++\n\t\t\t\t\t\tbreak\n\t\t\t\t\tcase 'G':\n\t\t\t\t\t\tg++\n\t\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(r, b, y, g)\n}\n"}], "src_uid": "64fc6e9b458a9ece8ad70a8c72126b33"} {"source_code": "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 CF1183H(_r io.Reader, _w io.Writer) {\n\tvar n int\n\tvar k, ans int64\n\tvar s []byte\n\tFscan(bufio.NewReader(_r), &n, &k, &s)\n\tprev := [26]int{}\n\tdp := make([][]int64, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, n+1)\n\t}\n\tdp[0][0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tc := s[i-1] - 'a'\n\t\tdp[i][0] = 1\n\t\tfor j := 1; j <= i; j++ {\n\t\t\tdp[i][j] = dp[i-1][j] + dp[i-1][j-1]\n\t\t\tif p := prev[c]; p > 0 {\n\t\t\t\tdp[i][j] -= dp[p-1][j-1]\n\t\t\t}\n\t\t}\n\t\tprev[c] = i\n\t}\n\tk--\n\tfor l := n - 1; l >= 0; l-- {\n\t\tcnt := dp[n][l]\n\t\tif cnt > k {\n\t\t\tans += int64(n-l) * k\n\t\t\tk = 0\n\t\t\tbreak\n\t\t}\n\t\tk -= cnt\n\t\tans += int64(n-l) * cnt\n\t}\n\tif k > 0 {\n\t\tans = -1\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1183H(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "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 CF1183H(_r io.Reader, _w io.Writer) {\n\tvar n int\n\tvar k, ans int64\n\tvar s []byte\n\tFscan(bufio.NewReader(_r), &n, &k, &s)\n\tprev := [26]int{}\n\tdp := make([][]int64, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int64, n+1)\n\t}\n\tdp[0][0] = 1\n\tfor i := 1; i <= n; i++ {\n\t\tc := s[i-1] - 'a'\n\t\tdp[i][0] = 1\n\t\tfor j := 1; j <= i; j++ {\n\t\t\tdp[i][j] = dp[i-1][j] + dp[i-1][j-1]\n\t\t\tif p := prev[c]; p > 0 {\n\t\t\t\tdp[i][j] -= dp[p-1][j-1]\n\t\t\t}\n\t\t}\n\t\tprev[c] = i\n\t}\n\tk--\n\tfor l := n - 1; l >= 0; l-- {\n\t\tcnt := dp[n][l]\n\t\tif cnt > k {\n\t\t\tans += int64(n-l) * k\n\t\t\tk = 0\n\t\t\tbreak\n\t\t}\n\t\tk -= cnt\n\t\tans += int64(n-l) * cnt\n\t}\n\tif k > 0 {\n\t\tans = -1\n\t}\n\tFprint(_w, ans)\n}\n\nfunc main() { CF1183H(os.Stdin, os.Stdout) }\n"}], "negative_code": [], "src_uid": "ae5d21919ecac431ea7507cb1b6dc72b"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tfor i := 0; i < n+10 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tfor _, v := range a {\n\t\t\tif p := sort.SearchInts(dp, v+1); p < len(dp) {\n\t\t\t\tdp[p] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tfor i := 0; i < 110 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tfor _, v := range a {\n\t\t\tif p := sort.SearchInts(dp, v+1); p < len(dp) {\n\t\t\t\tdp[p] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tfor i := 0; i < 310 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tfor _, v := range a {\n\t\t\tif p := sort.SearchInts(dp, v+1); p < len(dp) {\n\t\t\t\tdp[p] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tf := func() {\n\t\tfor _, v := range a {\n\t\t\tif i := sort.SearchInts(dp, v+1); i < len(dp) {\n\t\t\t\tdp[i] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t}\n\tf()\n\tif t == 1 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tf()\n\tFprint(out, len(dp)+t-2)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF582B(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n, t, d int\n\tFscan(in, &n, &t)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t}\n\tdp := []int{}\n\tf := func() {\n\t\tfor _, v := range a {\n\t\t\tif i := sort.SearchInts(dp, v+1); i < len(dp) {\n\t\t\t\tdp[i] = v\n\t\t\t} else {\n\t\t\t\tdp = append(dp, v)\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < 5 && t > 0; i++ {\n\t\tt--\n\t\tcur := len(dp)\n\t\tf()\n\t\td = len(dp) - cur\n\t\tcur = len(dp)\n\t}\n\tif t == 0 {\n\t\tFprint(out, len(dp))\n\t\treturn\n\t}\n\tFprintln(out, len(dp)+t*d)\n}\n\nfunc main() { CF582B(os.Stdin, os.Stdout) }\n"}], "src_uid": "26cf484fa4cb3dc2ab09adce7a3fc9b2"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader io.Reader\nvar scanner *bufio.Scanner\n\nfunc Init(io io.Reader, max_token_size int) {\n\treader = bufio.NewReader(io)\n\tscanner = bufio.NewScanner(reader)\n\t// max token size\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer([]byte{}, max_token_size)\n}\n\nfunc stderr(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n}\n\nfunc die(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n\tos.Exit(1)\n}\n\nfunc NextInt() int {\n\tbytes := NextBytes()\n\ti, err := Atoi(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\nfunc NextInt64() int64 {\n\tbytes := NextBytes()\n\ti, err := Atoi64(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\n\nfunc NextBytes() []byte {\n\tif !scanner.Scan() {\n\t\tdie(scanner.Err())\n\t}\n\tbytes := scanner.Bytes()\n\tcopied := make([]byte, len(bytes))\n\tcopy(copied, bytes)\n\treturn copied\n}\n\nfunc Atoi(b []byte) (int, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc Atoi64(b []byte) (int64, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc ExtendByteArray(a []byte, size int) []byte {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]byte, size-len(a))...)\n\t}\n}\n\nfunc ExtendIntArray(a []int, size int) []int {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]int, size-len(a))...)\n\t}\n}\n\nfunc reverseInts(a []int) {\n\tfor l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {\n\t\ta[l], a[r] = a[r], a[l]\n\t}\n}\n\nfunc unique(a []int) int {\n\tnewLen := 0\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tif newLen == 0 || a[i] != a[newLen-1] {\n\t\t\ta[newLen] = a[i]\n\t\t\tnewLen++\n\t\t}\n\t}\n\treturn newLen\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 main() {\n\tinf := os.Stdin\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\t// inf, err := os.Open(\"a.in\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// out, err := os.Create(\"a.out\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// defer out.Close()\n\tInit(inf, 1000010)\n\n\tu := NextInt64()\n\tv := NextInt64()\n\tMAXP := 63\n\tMAXC := 100\n\ta := make([]int, MAXP)\n\tb := make([]int, MAXP)\n\n\t// u = 1000000000000000000\n\t// v = 1000000000000000000\n\n\tfor i := 0; i < MAXP; i++ {\n\t\ta[i] = int(u & 1)\n\t\tb[i] = int(v & 1)\n\t\tu >>= 1\n\t\tv >>= 1\n\t}\n\n\tdp := make([][]int, MAXP)\n\tp := make([][][3]int, MAXP)\n\tfor i := 0; i < MAXP; i++ {\n\t\tdp[i] = make([]int, MAXC)\n\t\tp[i] = make([][3]int, MAXC)\n\t\tfor j := 0; j < MAXC; j++ {\n\t\t\tdp[i][j] = -1\n\t\t}\n\t}\n\n\tMAXINT := 1000000000\n\n\tvar f func(i, carry int) int\n\tf = func(i, carry int) int {\n\n\t\tif i == -1 {\n\t\t\tif carry == 0 {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\treturn MAXINT\n\t\t\t}\n\t\t}\n\n\t\tif dp[i][carry] != -1 {\n\t\t\treturn dp[i][carry]\n\t\t}\n\n\t\tres := MAXINT\n\t\tresk1, resc := -1, -1\n\n\t\tfor k1 := 0; k1 < MAXC*2; k1++ {\n\t\t\tif (k1 >> 1) > carry {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (k1 & 1) != a[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor ncarry := 0; ncarry < MAXC; ncarry++ {\n\t\t\t\tif ((k1 + ncarry) >> 1) > carry {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((k1+ncarry)>>1) == carry && ((k1+ncarry)&1) == b[i] {\n\t\t\t\t\tt := max(k1, f(i-1, ncarry))\n\t\t\t\t\tif t < res {\n\t\t\t\t\t\tres = t\n\t\t\t\t\t\tresk1 = k1\n\t\t\t\t\t\tresc = ncarry\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdp[i][carry] = res\n\t\tp[i][carry][1] = resk1\n\t\tp[i][carry][2] = resc\n\t\treturn res\n\t}\n\n\tres := f(MAXP-1, 0)\n\tif res == MAXINT {\n\t\tfmt.Fprintln(out, -1)\n\t\treturn\n\t}\n\n\tfmt.Fprintln(out, res)\n\n\tans := make([]int64, res)\n\n\tfor i, carry, j := MAXP-1, 0, 0; i >= 0; i-- {\n\t\tncarry := p[i][carry][2]\n\t\tk1 := p[i][carry][1]\n\t\tfor k1 > 0 {\n\t\t\tans[j] |= (int64(1) << uint(i))\n\t\t\tj++\n\t\t\tif j == res {\n\t\t\t\tj = 0\n\t\t\t}\n\t\t\tk1--\n\t\t}\n\t\tcarry = ncarry\n\t}\n\n\tfor i := 0; i < res; i++ {\n\t\tfmt.Fprint(out, ans[i], \" \")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar u, v uint64\n\tfmt.Scanf(\"%d %d\", &u, &v)\n\tres, found := solve(u, v)\n\tif !found {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(len(res))\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tfmt.Printf(\"%d \", res[i])\n\t\t}\n\t}\n}\n\nfunc solve(u uint64, v uint64) ([]uint64, bool) {\n\tif u > v || u&1 != v&1 {\n\t\treturn nil, false\n\t}\n\n\tif u == 0 && v == 0 {\n\t\treturn nil, true\n\t}\n\n\tif u == v {\n\t\treturn []uint64{u}, true\n\t}\n\n\tx := (v - u) >> 1\n\t// u, x, x is an answer with length 3\n\tfor i := 0; i < 63; i++ {\n\t\tif (x>>i)&1 == 1 {\n\t\t\tif (u>>i)&1 == 1 {\n\t\t\t\t// can' be true\n\t\t\t\treturn []uint64{u, x, x}, true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn []uint64{u + x, x}, true\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar u,v int64\n\tfmt.Scanf(\"%d %d\\n\", &u, &v)\n\tif u > v {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif u == v {\n\t\tif u == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t\tfmt.Println(u)\n\t\t\treturn\n\t\t}\n\t}\n\tif (v - u) % 2 != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tc1 := u\n\tc2 := (v - u) / 2\n\tif (c1 + c2) ^ c2 == u {\n\t\tfmt.Println(2)\n\t\tfmt.Println(c2, c1+c2)\n\t} else {\n\t\tfmt.Println(3)\n\t\tfmt.Println(c2, c2, c1)\n\t}\n}\n\nfunc readLine(reader *bufio.Reader) []byte {\n\tresult := make([]byte, 0)\n\tfor {\n\t\ts, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"error=%+v\\n\", err)\n\t\t\tbreak\n\t\t}\n\t\tresult = append(result, s...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn result\n}\n"}, {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/1325/D\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\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\tu, v int64\n)\n\nfunc main() {\n\tu, v = ReadInt64_2()\n\n\tif u == v && u == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif u == v {\n\t\tfmt.Println(1)\n\t\tfmt.Println(u)\n\t\treturn\n\t}\n\n\tif u > v {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tif u%2 != v%2 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tx := (v - u) / 2\n\tif x&u == 0 {\n\t\tfmt.Println(2)\n\t\tfmt.Println(u+x, x)\n\t} else {\n\t\tfmt.Println(3)\n\t\tfmt.Println(u, x, x)\n\t}\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num int64, nth int) int64 {\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 int64, nth int) int64 {\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 int64, nth int) int64 {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int64) 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/*******************************************************************/\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"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar u, v int64\n\tvar a [4]int64\n\tvar times int\n\tvar ll1 int64 = 1\n\tvar out string\n\tfmt.Scan(&u)\n\tfmt.Scan(&v)\n\t//u = 0\n\t//v = 0\n\n\tif u > v || ((u ^ v) & 1) != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tfor i := 0; i < 63; i++ {\n\t\ttimes = 0\n\t\tif (u & (ll1 << i)) != 0 {\n\t\t\ttimes += 1\n\t\t\tu ^= ll1 << i\n\t\t\tv -= ll1 << i\n\t\t}\n\t\tif (u & (ll1 << (i + 1))) != (v & (ll1 << (i + 1))) {\n\t\t\ttimes += 2\n\t\t\tv -= ll1 << (i + 1)\n\t\t}\n\t\t\n\t\tfor j := 0; j < times; j++ {\n\t\t\ta[j] ^= ll1 << i\n\t\t}\n\t}\n\t\n\tfor i := 0; i < 4; i++ {\n\t\tif a[i] == 0 {\n\t\t\tout = strconv.Itoa(i) + \"\\n\" + out\n\t\t\tbreak\n\t\t}\n\t\tout += fmt.Sprintf(\"%v \", a[i])\n\t}\n\tfmt.Println(out)\n\t\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar u, v uint64\n\tfmt.Scanf(\"%d %d\", &u, &v)\n\n\tif !can(u, v) {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\tif u == 0 && v == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn\n\t}\n\n\td := v - u\n\tcomp := d / 2\n\n\tif comp == 0 {\n\t\tfmt.Println(\"1\")\n\t\tfmt.Println(u)\n\t} else if (u & comp) == 0 {\n\t\tfmt.Println(\"2\")\n\t\tfmt.Printf(\"%d %d\\n\", u|comp, comp)\n\t} else {\n\t\tfmt.Println(\"3\")\n\t\tfmt.Printf(\"%d %d %d\\n\", u, comp, comp)\n\t}\n}\n\nfunc can(u, v uint64) bool {\n\tif (u > v) || ((v-u)%2) == 1 {\n\t\treturn false\n\t}\n\treturn true\n}\n"}, {"source_code": "package main\n\nimport (\n\t. \"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc CF1325D(in io.Reader, out io.Writer) {\n\tvar xor, sum int64\n\tFscan(in, &xor, &sum)\n\tif xor > sum || (sum-xor)&1 > 0 {\n\t\tFprint(out, -1)\n\t} else if xor == sum {\n\t\tif xor == 0 {\n\t\t\tFprint(out, 0)\n\t\t} else {\n\t\t\tFprint(out, \"1\\n\", xor)\n\t\t}\n\t} else if and := (sum - xor) / 2; and&xor > 0 {\n\t\tFprint(out, \"3\\n\", xor, and, and)\n\t} else {\n\t\tFprint(out, \"2\\n\", xor|and, and)\n\t}\n}\n\nfunc main() { CF1325D(os.Stdin, os.Stdout) }\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"io\"\n \"os\"\n)\n\ntype BufferedWriter interface {\n Printf(format string, a ...interface{})\n Flush()\n}\n\ntype writerImpl struct {\n *bufio.Writer\n}\n\nfunc NewBufferedWriter(writer io.Writer) BufferedWriter {\n return &writerImpl{Writer: bufio.NewWriter(writer)}\n}\n\nfunc (impl *writerImpl) Printf(f string, a ...interface{}) {\n fmt.Fprintf(impl.Writer, f, a...)\n}\n\nfunc (impl *writerImpl) Flush() {\n impl.Writer.Flush()\n}\n\ntype WordScanner interface {\n NextInt() int\n NextInt64() int64\n NextString() string\n}\n\ntype wordScannerImpl struct {\n *bufio.Scanner\n}\n\nfunc NewWordScanner(reader io.Reader) WordScanner {\n s := bufio.NewScanner(reader)\n s.Split(bufio.ScanWords)\n return &wordScannerImpl{Scanner: s}\n}\n\nfunc (impl *wordScannerImpl) NextInt() int {\n impl.Scan()\n bb := impl.Bytes()\n i := 0\n for _, b := range bb {\n i *= 10\n i += int(b - '0')\n }\n return i\n}\n\nfunc (impl *wordScannerImpl) NextInt64() int64 {\n impl.Scan()\n bb := impl.Bytes()\n i := int64(0)\n for _, b := range bb {\n i *= 10\n i += int64(b - '0')\n }\n return i\n}\n\nfunc (impl *wordScannerImpl) NextString() string {\n impl.Scan()\n return impl.Text()\n}\n\nvar reader = NewWordScanner(os.Stdin)\nvar writer = NewBufferedWriter(os.Stdout)\n\nfunc main() {\n defer writer.Flush()\n u, v := reader.NextInt64(), reader.NextInt64()\n if u > v {\n writer.Printf(\"-1\\n\")\n return\n }\n if u == v {\n if u == 0 {\n writer.Printf(\"0\\n\")\n } else {\n writer.Printf(\"1\\n%d\\n\", u)\n }\n return\n }\n diff := v - u\n if diff % 2 == 1 {\n writer.Printf(\"-1\\n\")\n return\n }\n num := diff / 2\n if num & u == 0 {\n writer.Printf(\"2\\n%d %d\\n\", u | num, num)\n } else {\n writer.Printf(\"3\\n%d %d %d\\n\", u, num, num)\n }\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader io.Reader\nvar scanner *bufio.Scanner\n\nfunc Init(io io.Reader, max_token_size int) {\n\treader = bufio.NewReader(io)\n\tscanner = bufio.NewScanner(reader)\n\t// max token size\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer([]byte{}, max_token_size)\n}\n\nfunc stderr(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n}\n\nfunc die(v ...interface{}) {\n\tfmt.Fprintln(os.Stderr, v...)\n\tos.Exit(1)\n}\n\nfunc NextInt() int {\n\tbytes := NextBytes()\n\ti, err := Atoi(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\nfunc NextInt64() int64 {\n\tbytes := NextBytes()\n\ti, err := Atoi64(bytes)\n\tif err != nil {\n\t\tdie(err)\n\t}\n\treturn i\n}\n\nfunc NextBytes() []byte {\n\tif !scanner.Scan() {\n\t\tdie(scanner.Err())\n\t}\n\tbytes := scanner.Bytes()\n\tcopied := make([]byte, len(bytes))\n\tcopy(copied, bytes)\n\treturn copied\n}\n\nfunc Atoi(b []byte) (int, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tn := 0\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc Atoi64(b []byte) (int64, error) {\n\tneg := false\n\tif b[0] == '+' {\n\t\tb = b[1:]\n\t} else if b[0] == '-' {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tvar n int64\n\tfor _, v := range b {\n\t\tif v < '0' || v > '9' {\n\t\t\treturn 0, strconv.ErrSyntax\n\t\t}\n\t\tn = n*10 + int64(v-'0')\n\t}\n\tif neg {\n\t\treturn -n, nil\n\t}\n\treturn n, nil\n}\n\nfunc ExtendByteArray(a []byte, size int) []byte {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]byte, size-len(a))...)\n\t}\n}\n\nfunc ExtendIntArray(a []int, size int) []int {\n\tif size <= len(a) {\n\t\treturn a\n\t} else {\n\t\treturn append(a, make([]int, size-len(a))...)\n\t}\n}\n\nfunc reverseInts(a []int) {\n\tfor l, r := 0, len(a)-1; l < r; l, r = l+1, r-1 {\n\t\ta[l], a[r] = a[r], a[l]\n\t}\n}\n\nfunc unique(a []int) int {\n\tnewLen := 0\n\tn := len(a)\n\tfor i := 0; i < n; i++ {\n\t\tif newLen == 0 || a[i] != a[newLen-1] {\n\t\t\ta[newLen] = a[i]\n\t\t\tnewLen++\n\t\t}\n\t}\n\treturn newLen\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 main() {\n\tinf := os.Stdin\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\t// inf, err := os.Open(\"a.in\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// out, err := os.Create(\"a.out\")\n\t// if err != nil {\n\t// \tdie(err)\n\t// }\n\t// defer out.Close()\n\tInit(inf, 1000010)\n\n\tu := NextInt64()\n\tv := NextInt64()\n\tMAXP := 63\n\tMAXC := 4\n\ta := make([]int, MAXP)\n\tb := make([]int, MAXP)\n\n\tfor i := 0; i < MAXP; i++ {\n\t\ta[i] = int(u & 1)\n\t\tb[i] = int(v & 1)\n\t\tu >>= 1\n\t\tv >>= 1\n\t}\n\n\tdp := make([][]int, MAXP)\n\tp := make([][][3]int, MAXP)\n\tfor i := 0; i < MAXP; i++ {\n\t\tdp[i] = make([]int, MAXC)\n\t\tp[i] = make([][3]int, MAXC)\n\t\tfor j := 0; j < MAXC; j++ {\n\t\t\tdp[i][j] = -1\n\t\t}\n\t}\n\n\tMAXINT := 1000000000\n\n\tvar f func(i, carry int) int\n\tf = func(i, carry int) int {\n\n\t\tif i == -1 {\n\t\t\tif carry == 0 {\n\t\t\t\treturn 0\n\t\t\t} else {\n\t\t\t\treturn MAXINT\n\t\t\t}\n\t\t}\n\n\t\tif dp[i][carry] != -1 {\n\t\t\treturn dp[i][carry]\n\t\t}\n\n\t\tres := MAXINT\n\t\tresk1, resc := -1, -1\n\n\t\tfor k1 := 0; k1 < MAXP*2; k1++ {\n\t\t\tif (k1 >> 1) > carry {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif (k1 & 1) != a[i] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor ncarry := 0; ncarry < MAXC; ncarry++ {\n\t\t\t\tif ((k1 + ncarry) >> 1) > carry {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif ((k1+ncarry)>>1) == carry && ((k1+ncarry)&1) == b[i] {\n\t\t\t\t\tt := max(k1, f(i-1, ncarry))\n\t\t\t\t\tif t < res {\n\t\t\t\t\t\tres = t\n\t\t\t\t\t\tresk1 = k1\n\t\t\t\t\t\tresc = ncarry\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdp[i][carry] = res\n\t\tp[i][carry][1] = resk1\n\t\tp[i][carry][2] = resc\n\t\treturn res\n\t}\n\n\tres := f(MAXP-1, 0)\n\tif res == MAXINT {\n\t\tfmt.Fprintln(out, -1)\n\t\treturn\n\t}\n\n\tfmt.Fprintln(out, res)\n\n\tans := make([]int, res)\n\n\tfor i, carry, j := MAXP-1, 0, 0; i >= 0; i-- {\n\t\tncarry := p[i][carry][2]\n\t\tk1 := p[i][carry][1]\n\t\tfor k1 > 0 {\n\t\t\tans[j] |= (1 << uint(i))\n\t\t\tj++\n\t\t\tif j == res {\n\t\t\t\tj = 0\n\t\t\t}\n\t\t\tk1--\n\t\t}\n\t\tcarry = ncarry\n\t}\n\n\tfor i := 0; i < res; i++ {\n\t\tfmt.Fprint(out, ans[i], \" \")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar u,v int64\n\tfmt.Scanf(\"%d %d\\n\", &u, &v)\n\tif u > v {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif u == v {\n\t\tif u == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(1)\n\t\t\tfmt.Println(u)\n\t\t}\n\t}\n\tif (v - u) % 2 != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tc1 := u\n\tc2 := (v - u) / 2\n\tif (c1 + c2) ^ c2 == u {\n\t\tfmt.Println(2)\n\t\tfmt.Println(c2, c1+c2)\n\t} else {\n\t\tfmt.Println(3)\n\t\tfmt.Println(c1, c2, c2)\n\t}\n}\n\nfunc readLine(reader *bufio.Reader) []byte {\n\tresult := make([]byte, 0)\n\tfor {\n\t\ts, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"error=%+v\\n\", err)\n\t\t\tbreak\n\t\t}\n\t\tresult = append(result, s...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn result\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar u, v int64\n\tvar a []int64\n\tvar ll1 int64 = 1\n\tfmt.Scan(&u)\n\tfmt.Scan(&v)\n\n\tif u > v || ((u ^ v) & 1) != 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif u == 0 && v == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfor i := 0; i < 63; i++ {\n\t\tlog.Printf(\"%v %v\", u, v)\n\t\tif (u & (ll1 << i)) != 0 {\n\t\t\ta = append(a, ll1 << i)\n\t\t\tu ^= ll1 << i\n\t\t\tv -= ll1 << i\n\t\t}\n\t\tif (u & (ll1 << (i + 1))) != (v & (ll1 << (i + 1))) {\n\t\t\ta = append(a, ll1 << i)\n\t\t\ta = append(a, ll1 << i)\n\t\t\tv -= ll1 << (i + 1)\n\t\t}\n\t}\n\t\n\tfmt.Println(len(a))\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Printf(\"%v \", a[i])\n\t}\n\t\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar u, v uint64\n\tfmt.Scanf(\"%d %d\", &u, &v)\n\n\tif !can(u, v) {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\td := v - u\n\tcomp := uint64(0)\n\tfor i := 0; i <= 64; i++ {\n\t\tif d%2 == 1 {\n\t\t\tcomp += uint64(1) << uint64(i-1)\n\t\t}\n\t\td /= 2\n\t}\n\n\tif comp == 0 {\n\t\tfmt.Println(\"1\")\n\t\tfmt.Println(u)\n\t} else if (u & comp) == 0 {\n\t\tfmt.Println(\"2\")\n\t\tfmt.Printf(\"%d %d\\n\", u|comp, comp)\n\t} else {\n\t\tfmt.Println(\"3\")\n\t\tfmt.Printf(\"%d %d %d\\n\", u, comp, comp)\n\t}\n}\n\nfunc can(u, v uint64) bool {\n\tif (u > v) || ((v-u)%2) == 1 {\n\t\treturn false\n\t}\n\treturn true\n}\n"}], "src_uid": "490f23ced6c43f9e12f1bcbecbb14904"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, i, j float64\n\tfmt.Scan(&n)\n\tfor i = 1; i*(i+1)/2 <= n; i++ {\n\t\tj = math.Sqrt(n*2 - i*(i+1))\n\t\tx := int64(j)\n\t\tif x > 0 && x*(x+1)+int64(i)*(int64(i)+1) == int64(n)*2 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n\treturn\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"os\"\nimport \"bufio\"\nimport \"math\"\nimport \"strconv\"\n\nfunc main(){\n\tvar n float64\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\tw := bufio.NewWriter(os.Stdout)\n\tr.Scan()\n\tn, _ = strconv.ParseFloat(r.Text(), 64)\n\ta := (-1+math.Sqrt(8*n-7))/2\n\tvar b float64\n\tvar j int64\n\tfor i:=1; float64(i)<=a; i++ {\n\t\tb = (math.Sqrt(1+8*n-4*float64(i)-4*float64(i)*float64(i))-1)/2\n\t\tj = int64(b) \n\t\tif float64(j) == b && j != 0 {\n\t\t\tw.WriteString(\"YES\\n\")\n\t\t\tw.Flush()\n\t\t\treturn\n\t\t}\n\t}\n\tw.WriteString(\"NO\\n\")\n\tw.Flush()\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n \"os\"\n \"bufio\"\n \"strconv\"\n)\n\nfunc scanInt(scanner *bufio.Scanner) int {\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n return x\n}\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n writer := bufio.NewWriter(os.Stdout)\n defer writer.Flush()\n\n triangular := map[int64]bool{}\n k := int64(0)\n for {\n k++\n x := k*(k+1)/2\n if x > 1000000000 {\n break\n }\n triangular[x] = true\n }\n\n n := int64(scanInt(scanner))\n for x := range triangular {\n _, found := triangular[n-x]\n if found {\n writer.WriteString(\"YES\\n\")\n return\n }\n }\n writer.WriteString(\"NO\\n\")\n}\n"}, {"source_code": "// 192A-ahalim,dikai,eric\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar i,n,m,k,l,p int64\n\tfmt.Scan(&n)\n\tif n==1 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tl = int64(math.Sqrt(float64(n*2)))\n\tm = 0\n\tfor i=1;i<=l;i++{\n\t\tp = n-i*(i+1)/2\n\t\tk = int64((math.Sqrt(float64(8*p+1))-1)/2)\n\t\tif k > 0 {\n\t\t\tif k*(k+1)+i*(i+1)== 2*n{\n\t\t\t\tm =1\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif m == 0{\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "//rextester.com:1.6.2--codeforces.com:1.7.3\npackage main\nimport(\"fmt\";\"math\")\nfunc main(){\n var a float64;fmt.Scan(&a);a*=2;b:=false\n for i:=1;i 0 && x*(x+1)+int64(i)*(int64(i)+1) == int64(n)*2 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n\treturn\n}\n"}, {"source_code": "// 192A-mic\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, i, diff, f, c, sq float64\n\tflag := false\n\tfmt.Scan(&n)\n\tfor i = 1; (i * (i + 1)) < 2*n; i++ {\n\t\tdiff = 2*n - (i * (i + 1))\n\t\tsq = math.Sqrt(diff)\n\t\tf = math.Floor(sq)\n\t\tc = math.Ceil(sq)\n\t\tif f != c && f*c == diff {\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}], "negative_code": [{"source_code": "// 192A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, i, j float64\n\tfmt.Scan(&n)\n\tfor i = 1; i*(i+1)/2 <= n; i++ {\n\t\tj = math.Sqrt(n*2 - i*(i+1))\n\t\tif j > 0 && j*(j+1)+i*(i+1) == n*2 {\n\t\t\tfmt.Print(\"YES\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"NO\")\n\treturn\n}\n"}], "src_uid": "245ec0831cd817714a4e5c531bffd099"} {"source_code": "\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"fmt\"\n)\nvar reader *bufio.Reader = bufio.NewReader(os.Stdin)\nvar writer *bufio.Writer = bufio.NewWriter(os.Stdout)\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(reader, f, a...) }\nfunc readLine()(string,error) \t\t\t{ return reader.ReadString('\\n') }\n\nfunc main() {\n\tdefer writer.Flush()\n\tvar t,s string\n\tscanf(\"%s\\n%s\", &t, &s);\n\tc := 0\n\tfor _, i := range s {\n\t\tif i == '-' {\n\t\t\tif c > 0 {\n\t\t\t\tc--\n\t\t\t}\n\t\t}\n\t\tif i == '+' {\n\t\t\tc++\n\t\t}\n\t}\n\tfmt.Println(c)\n}", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tvar str string\n\tfmt.Scanf(\"%d\\n\",&n)\n\tfmt.Scanf(\"%s\\n\",&str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else if c=='-'{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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\nfunc main() {\n\tdefer writer.Flush()\n\tvar d int\n\tscanf(\"%d\\n\", &d)\n\tvar s string\n\tscanf(\"%s\", &s)\n\tsa := []byte(s)\n\tcur := 0\n\tfor _, c := range sa {\n\t\tif c == '-' {\n\t\t\tcur--\n\t\t} else {\n\t\t\tcur++\n\t\t}\n\t\tif cur < 0 {\n\t\t\tcur = 0\n\t\t}\n\t}\n\n\tprintf(\"%d\", cur)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar nStr string\n\tfmt.Scanln(&nStr)\n\tn, _ := strconv.Atoi(nStr)\n\n\tvar pattern string\n\tfmt.Scanln(&pattern)\n\n\tct := 0\n\tminSeen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif pattern[i] == '+' {\n\t\t\tct++\n\t\t} else if pattern[i] == '-' {\n\t\t\tct--\n\t\t}\n\t\tif ct < minSeen {\n\t\t\tminSeen = ct\n\t\t}\n\t}\n\tfmt.Println(ct - minSeen)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tn := 0\n\tfmt.Scan(&n)\n\ts := \"\"\n\tfmt.Scan(&s)\n\tans := 0\n\tfor _, char := range(s) {\n\t\tif char == rune('+') {\n\t\t\tans = ans + 1\n\t\t} else if char == rune('-') {\n\t\t\tif ans != 0 {\n\t\t\t\tans = ans - 1\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc min(x int, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Solve(n int, s string) int {\n\trollingSum := 0\n\tlowestRollingSum := 0\n\tfor _, elem := range s {\n\t\tif string(elem) == \"-\" {\n\t\t\trollingSum -= 1\n\t\t} else if string(elem) == \"+\" {\n\t\t\trollingSum += 1\n\t\t}\n\t\tlowestRollingSum = min(lowestRollingSum, rollingSum)\n\t}\n\treturn -1*lowestRollingSum + rollingSum\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar n int\n\tvar s string\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tfmt.Fprintf(writer, \"%d\\n\", Solve(n, s))\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tans := n\n\tvar i int\n\tvar temp int\n\n\n\tfor i = 0 ; i <= 100;i++{\n\t\ttemp = i\n\t\tfor _, char := range (s){\n\t\t\tif(char =='+'){\n\t\t\t\ttemp ++\n\t\t\t}\n\t\t\tif(char =='-'){\n\t\t\t\ttemp --\n\t\t\t\tif(temp <= -1){\n\t\t\t\ttemp = -1\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(temp >= 0){\n\t\t\tans = min(ans,temp)\n\t\t}\n\t}\n\tfmt.Print(ans)\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 100\n\tfor i := 0 ;i <= 100 ;i ++{\n\t\tt := i\n\t\tcheck := true\n\tfor index,_ := range s{\n\t\tif(string(s[index]) == \"+\"){\n\t\t\tt ++\n\t\t}else{\n\t\t\t\tt --;\n\t\t\t\tif(t <= -1){\n\t\t\t\tcheck = false\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t}\n\tif(check){\n\n\t\tans = min(t,ans)\n\t}\n\t}\n\tfmt.Print(ans)\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 0\n\tfor i,_ := range s{\n\t\t\tif(string(s[i]) == \"+\"){\n\t\t\t\tans ++\n\t\t\t}else{\n\t\t\t\t\tif(ans >= 1){\n\t\t\t\t\t\tans --\n\t\t\t\t\t}\n\t\t\t}\n\t}\n\tfmt.Println(ans)\n\n\n\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ts := ReadStr()\n\tans := 0\n\tfor index,_ := range s{\n\t\tif(string(s[index]) == \"+\"){\n\t\t\tans ++\n\t\t}else{\n\t\t\t\tans --;\n\t\t}\n\n\t}\n\tfmt.Print(max(ans,0))\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tvar ans int\n\tfor index,_ := range s{\n\t\tif(string(s[index]) == \"+\"){\n\t\t\tans ++\n\t\t}else{\n\t\t\t\tans --;\n\t\t}\n\n\t}\n\tfmt.Print(max(ans,0))\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\nfunc max(a,b int) int {\n\tif(a < b){\n\t\treturn b\n\t}else{\n\t\treturn a\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ts := ReadStr()\n\tans := 0\n\tfor _,i := range s{\n\t\tif(string(i) == \"+\"){\n\t\t\tans ++\n\t\t}else{\n\t\t\t\tans --;\n\t\t}\n\n\t}\n\tfmt.Println(max(ans,0))\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\nfunc ReadStr() string{\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc ReadInt(x int) (res int) {\n\tscanner.Scan()\n\n\tn,err := strconv.Atoi(scanner.Text())\n\tres = n\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\treturn\n}\n\ntype building struct\n{\n\ta , b ,c int\n}\n\nfunc min(a,b int) (res int) {\n\tif(a < b){\n\t\tres = a\n\t}else{\n\t\tres = b\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ts := ReadStr()\n\tans := 100\n\tfor i := 0 ; i <= 100;i++{\n\t\tt := i\n\t\tyes := true\n\t\tfor _,i := range s{\n\t\t\tif(string(i) == \"-\"){\n\t\t\t\tt --;\n\t\t\t\tif(t <= -1){\n\t\t\t\t\tyes = false\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tt ++\n\t\t\t}\n\t\t}\n\t\tif(yes){\n\t\t\tans = min(ans,t)\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tvar str string\n\tfmt.Scanf(\"%d\\n\",&n)\n\tfmt.Scanf(\"%s\\n\",&str)\n\tfmt.Println(n)\n\tfmt.Println(str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else if c=='-'{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tvar str string\n\tfmt.Scanf(\"%d\",&n)\n\tfmt.Scanf(\"%s\",&str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else if c=='-'{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int32\n\tvar str string\n\tfmt.Scanf(\"%d\",&n)\n\tfmt.Scanf(\"%s\",&str)\n\tfmt.Println(n)\n\tfmt.Println(str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else if c=='-'{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int64\n\tvar str string\n\tfmt.Scanf(\"%d\",&n)\n\tfmt.Scanf(\"%s\",&str)\n\tans:=0\n\tfor _,c:=range str{\n\t\tif c=='+'{\n\t\t\tans++\n\t\t}else{\n\t\t\tif ans>0{\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}"}, {"source_code": "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\tnStr, _ := reader.ReadString('\\n')\n\tnStr = strings.TrimSuffix(nStr, \"\\n\")\n\tn, _ := strconv.Atoi(nStr)\n\tpattern, _ := reader.ReadString('\\n')\n\n\tct := 0\n\tminSeen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif pattern[i] == '+' {\n\t\t\tct++\n\t\t} else if pattern[i] == '-' {\n\t\t\tct--\n\t\t}\n\t\tif minSeen > ct {\n\t\t\tminSeen = ct\n\t\t}\n\t}\n\n\tfmt.Println(ct - minSeen)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc readline(reader *bufio.Reader) string {\n\tstr, _ := reader.ReadString('\\n')\n\treturn strings.TrimSuffix(str, \"\\n\")\n}\n\nfunc readInt(reader *bufio.Reader) int {\n\tstr := readline(reader)\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn := readInt(reader)\n\tpattern := readline(reader)\n\n\tct := 0\n\tminSeen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif pattern[i] == '+' {\n\t\t\tct++\n\t\t} else if pattern[i] == '-' {\n\t\t\tct--\n\t\t}\n\t\tif ct < minSeen {\n\t\t\tminSeen = ct\n\t\t}\n\t}\n\tfmt.Println(ct, minSeen)\n\tfmt.Println(ct - minSeen)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc readline(reader *bufio.Reader) string {\n\tstr, _ := reader.ReadString('\\n')\n\treturn strings.TrimSuffix(str, \"\\n\")\n}\n\nfunc readInt(reader *bufio.Reader) int {\n\tstr := readline(reader)\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tn := readInt(reader)\n\tpattern := readline(reader)\n\n\tct := 0\n\tminSeen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif pattern[i] == '+' {\n\t\t\tct++\n\t\t} else if pattern[i] == '-' {\n\t\t\tct--\n\t\t}\n\t\tif ct < minSeen {\n\t\t\tminSeen = ct\n\t\t}\n\t}\n\tfmt.Println(ct - minSeen)\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main(){\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\tvar s string\n\tfmt.Scanf(\"%s\",&s)\n\tans := n\n\tvar i , j int\n\tfor i = 0 ; i <= 100;i++{\n\t\ttemp := i\n\t\tfor j = 0 ; j < len(s); j ++{\n\t\t\tif(s[j] =='+'){\n\t\t\t\ttemp ++\n\t\t\t}\n\t\t\tif(s[j] =='-'){\n\t\t\t\ttemp --\n\t\t\t\tif(temp <= -1){\n\t\t\t\ttemp = -1\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(temp >= 0){\n\t\t\tans = min(ans,temp)\n\t\t}\n\t}\n\tfmt.Print(ans)\n\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main(){\n\tvar n int\n\tfmt.Scanf(\"%d\",&n)\n\tvar s string\n\tfmt.Scanf(\"%s\",&s)\n\tans := 100\n\tvar i , j int\n\tfor i = 0 ; i <= 100;i++{\n\t\ttemp := i\n\t\tfor j = 0 ; j < len(s); j ++{\n\t\t\tif(s[j] =='+'){\n\t\t\t\ttemp ++\n\t\t\t}\n\t\t\tif(s[j] =='-'){\n\t\t\t\ttemp --\n\t\t\t\tif(temp <= -1){\n\t\t\t\ttemp = -1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(temp >= 0){\n\t\t\tans = min(ans,temp)\n\t\t}\n\t}\n\tfmt.Print(ans)\n\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tans := n\n\tvar i int\n\tvar temp int\n\n\n\tfor i = 0 ; i <= 10;i++{\n\t\ttemp = i\n\t\tfor _, char := range (s){\n\t\t\tif(char =='+'){\n\t\t\t\ttemp ++\n\t\t\t}\n\t\t\tif(char =='-'){\n\t\t\t\ttemp --\n\t\t\t\tif(temp <= -1){\n\t\t\t\ttemp = -1\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(temp >= 0){\n\t\t\tans = min(ans,temp)\n\t\t}\n\t}\n\tfmt.Print(ans)\n\n}\n"}], "src_uid": "a593016e4992f695be7c7cd3c920d1ed"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor passed(a, k) == false {\n\t\ta = append(a, k)\n\t}\n\n\tfmt.Printf(\"%d\", len(a)-n)\n}\n\nfunc passed(a []int, k int) bool {\n\tavg := calcAvg(a)\n\tif avg+0.5 >= float64(k) {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc calcAvg(a []int) float64 {\n\ttotal := 0\n\tfor _, value := range a {\n\t\ttotal += value\n\t}\n\treturn float64(total) / float64(len(a))\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nvar n int\nvar m int\nvar tmp int\n\nfunc main() {\n\tfmt.Scan(&n)\n\tfmt.Scan(&m)\n\tsuma := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&tmp)\n\t\tsuma += tmp\n\t}\n\n\tansa := 0\n\tfor {\n\t\tif float64(m)-float64(suma)/float64((ansa+n)) <= float64(0.5) {\n\t\t\tfmt.Println(ansa)\n\t\t\tos.Exit(0)\n\t\t}\n\t\tsuma += m\n\t\tansa++\n\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n var k int\n fmt.Scanf(\"%d %d\\n\", &n, &k)\n sum := 0\n for i := 0; i < n; i++ {\n \tvar x int\n \tfmt.Scanf(\"%d\", &x)\n \tsum += x\n }\n ret := 0\n for 2 * sum < (ret + n) * (2 * k - 1) {\n \t/*\n \tsum / (ret + n) >= (k - 0.5)\n \t2 * sum / (ret + n) >= 2 * k - 1\n \t2 * sum >= (ret + n) * (2 * k - 1)\n \t*/\n \tsum += k\n \tret += 1\n }\n fmt.Printf(\"%d\\n\", ret)\n}\n"}], "negative_code": [], "src_uid": "f22267bf3fad0bf342ecf4c27ad3a900"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, x, y int64\n\t)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tn, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tscanner.Scan()\n\tx, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tscanner.Scan()\n\ty, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\n\tdw := min(abs(x-1), abs(y-1))\n\tdb := min(abs(x-n), abs(y-n))\n\n\tif dw <= db {\n\t\tfmt.Println(\"White\")\n\t} else {\n\t\tfmt.Println(\"Black\")\n\t}\n}\n\nfunc abs(a int64) int64 {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\n\treturn -a\n}\n\nfunc min(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\n\twriter.WriteString(fmt.Sprintf(\"%s\", Problem705A()))\n}\n\nfunc Problem705A() string {\n\tn := getI64()\n\tx := getI64()\n\ty := getI64()\n\t\n\tif (x-1 + y-1) <= (n-x + n-y) {\n\t\treturn \"White\"\n\t} else {\n\t\treturn \"Black\"\n\t}\n}"}, {"source_code": "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 := readll()\n\tx := readll()\n\ty := readll()\n\n\tdw := dist(n, 1, 1, x, y)\n\tdb := dist(n, n, n, x, y)\n\n\tif dw <= db {\n\t\tprintln(\"White\")\n\t} else {\n\t\tprintln(\"Black\")\n\t}\n\n}\n\nfunc dist(n, sx, sy, gx, gy int64) int64 {\n\tdx := absll(gx - sx)\n\tdy := absll(gy - sy)\n\n\treturn maxll(dx, dy)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\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\nfunc max(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\tvar x, y, n, a, b int64\n\tscanf(\"%d\\n\", &n)\n\tscanf(\"%d %d\\n\", &x, &y)\n\n\ta = max(x-1, y-1)\n\tb = max(n-x, n-y)\n\tif a <= b {\n\t\tprintf(\"White\\n\")\n\t} else {\n\t\tprintf(\"Black\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\nfunc Abs(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn x-y\n\t}\n\treturn y-x\n}\nfunc Min(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn y\n\t}\n\treturn x\n}\ntype Point struct {\n\tx uint64\n\ty uint64\n\tans uint64\n}\n\nfunc Slove_White(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y++\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x++\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x+=add\n\t\ttemp.y+=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\n\nfunc Slove_Block(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y--\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x--\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x-=add\n\t\ttemp.y-=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\n\nvar in = bufio.NewReaderSize(os.Stdin, 2<<16)\nfunc main(){\n\tvar n,x,y uint64\n\tfmt.Fscan(in, &n)\n\n\tfmt.Fscan(in, &x, &y)\n\twhite:=Point{x:1,y:1,ans:0}\n\twhite_ans:=Min(Abs(white.x,x),Abs(white.y,y))\n\twhite.x+=white_ans\n\twhite.y+=white_ans\n\twhite_ans+=Abs(white.x,x)\n\twhite_ans+=Abs(white.y,y)\n\n\n\tblock:=Point{x:n,y:n,ans:0}\n\tblock_ans:=Min(Abs(block.x,x),Abs(block.y,y))\n\tblock.x-=block_ans\n\tblock.y-=block_ans\n\tblock_ans+=Abs(block.x,x)\n\tblock_ans+=Abs(block.y,y)\n\n\t//fmt.Println(white_ans,block_ans)\n\tif white_ans<=block_ans{\n\t\tfmt.Println(\"White\")\n\t}else{\n\t\tfmt.Println(\"Black\")\n\t}\n\n}\n\n\n\n\n\n\n\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\nfunc Abs(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn x-y\n\t}\n\treturn y-x\n}\nfunc Min(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn y\n\t}\n\treturn x\n}\ntype Point struct {\n\tx uint64\n\ty uint64\n\tans uint64\n}\n\nfunc Slove_White(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y++\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x++\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x+=add\n\t\ttemp.y+=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\n\nfunc Slove_Block(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y--\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x--\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x-=add\n\t\ttemp.y-=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\n\nvar in = bufio.NewReaderSize(os.Stdin, 2<<16)\nfunc main(){\n\tvar n,x,y uint64\n\tfmt.Fscan(in, &n)\n\n\tfmt.Fscan(in, &x, &y)\n\twhite:=Point{x:1,y:1,ans:0}\n\twhite_ans:=Min(Abs(white.x,x),Abs(white.y,y))\n\twhite.x+=white_ans\n\twhite.y+=white_ans\n\twhite_ans+=Abs(white.x,x)\n\twhite_ans+=Abs(white.y,y)\n\n\n\tblock:=Point{x:n,y:n,ans:0}\n\tblock_ans:=Min(Abs(block.x,x),Abs(block.y,y))\n\tblock.x+=block_ans\n\tblock.y+=block_ans\n\tblock_ans+=Abs(block.x,x)\n\tblock_ans+=Abs(block.y,y)\n\n\t//fmt.Println(white_ans,block_ans)\n\tif white_ans<=block_ans{\n\t\tfmt.Println(\"White\")\n\t}else{\n\t\tfmt.Println(\"Black\")\n\t}\n\n}\n\n\n\n\n\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n)\nfunc Abs(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn x-y\n\t}\n\treturn y-x\n}\nfunc Min(x uint64,y uint64)uint64{\n\tif x>y{\n\t\treturn y\n\t}\n\treturn x\n}\ntype Point struct {\n\tx uint64\n\ty uint64\n\tans uint64\n}\n\nfunc Slove_White(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y++\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x++\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x+=add\n\t\ttemp.y+=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\n\nfunc Slove_Block(temp Point,n,x,y uint64)uint64{\n\tfor {\n\t\tif temp.x==x&&temp.y==y{\n\t\t\tbreak\n\t\t}\n\t\tif temp.x==x{\n\t\t\ttemp.y--\n\t\t\treturn temp.ans+Abs(x,temp.x)\n\t\t}\n\t\tif temp.y==y{\n\t\t\ttemp.x--\n\t\t\treturn temp.ans+Abs(y,temp.y)\n\t\t}\n\t\tadd:=Min(Abs(x,temp.x),Abs(y,temp.y))\n\t\ttemp.x-=add\n\t\ttemp.y-=add\n\t\ttemp.ans+=add\n\t}\n\treturn temp.ans\n}\nvar in = bufio.NewReaderSize(os.Stdin, 2<<16)\nfunc main(){\n\tvar n,x,y uint64\n\tfmt.Fscan(in, &n)\n\n\tfmt.Fscan(in, &x, &y)\n\twhite:=Point{x:1,y:1,ans:0}\n\twhite_ans:=Slove_White(white,n,x,y)\n\n\n\tblock:=Point{x:n,y:n,ans:0}\n\tblock_ans:=Slove_Block(block,n,x,y)\n\n\t//fmt.Println(white_ans,block_ans)\n\tif white_ans<=block_ans{\n\t\tfmt.Println(\"White\")\n\t}else{\n\t\tfmt.Println(\"Black\")\n\t}\n\n}\n\n\n\n\n\n\n\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\n\twriter.WriteString(fmt.Sprintf(\"%s\", Problem705A()))\n}\n\nfunc Problem705A() string {\n\tn := getI64()\n\tx := getI64()\n\ty := getI64()\n\n\twhiteX := int64(math.Abs(float64(x - 1)))\n\twhiteY := int64(math.Abs(float64(y - 1)))\n\tblackX := int64(math.Abs(float64(n - x)))\n\tblackY := int64(math.Abs(float64(n - y)))\n\n\tif (whiteX + whiteY) <= (blackX + blackY) {\n\t\treturn \"White\"\n\t} else {\n\t\treturn \"Black\"\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\n\twriter.WriteString(fmt.Sprintf(\"%s\", Problem705A()))\n}\n\nfunc Problem705A() string {\n\tn := getI64()\n\tx := getI64()\n\ty := getI64()\n\n\twhiteX := int64(math.Abs(float64(1 - x)))\n\twhiteY := int64(math.Abs(float64(1 - y)))\n\tblackX := int64(math.Abs(float64(n - x)))\n\tblackY := int64(math.Abs(float64(n - y)))\n\n\tif (whiteX + whiteY) <= (blackX + blackY) {\n\t\treturn \"White\"\n\t} else {\n\t\treturn \"Black\"\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"math\"\n)\n\nvar scanner *bufio.Scanner\n\nfunc getI64() int64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn x\n}\nfunc getI() int {\n\treturn int(getI64())\n}\nfunc getF() float64 {\n\tscanner.Scan()\n\tx, _ := strconv.ParseFloat(scanner.Text(), 64)\n\treturn x\n}\nfunc getS() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc max(a,b int) int { if a > b { return a } else { return b } }\n\nfunc min(a,b int) int { if a < b { return a } else { return b } }\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\n\twriter.WriteString(fmt.Sprintf(\"%s\", Problem705A()))\n}\n\nfunc Problem705A() string {\n\tn := getI()\n\tx := getI()\n\ty := getI()\n\n\twhiteX := int(math.Abs(float64(1 - x)))\n\twhiteY := int(math.Abs(float64(1 - y)))\n\tblackX := int(math.Abs(float64(n - x)))\n\tblackY := int(math.Abs(float64(n - y)))\n\n\tif (whiteX + whiteY) <= (blackX + blackY) {\n\t\treturn \"White\"\n\t} else {\n\t\treturn \"Black\"\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, x, y int\n\t)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tn, _ = strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\tx, _ = strconv.Atoi(scanner.Text())\n\n\tscanner.Scan()\n\ty, _ = strconv.Atoi(scanner.Text())\n\n\tdw := min(abs(x-1), abs(y-1))\n\tdb := min(abs(x-n), abs(y-n))\n\n\tif dw <= db {\n\t\tfmt.Println(\"White\")\n\t} else {\n\t\tfmt.Println(\"Black\")\n\t}\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\n\treturn -a\n}\n\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n"}], "src_uid": "b8ece086b35a36ca873e2edecc674557"} {"source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\tif u==0 && l==0{\n\t\tfmt.Println(m)\n\t}else if(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\ntype Int int64\n\nfunc main() {\n\tdefer w.Flush()\n\tvar n, m Int\n\tfor I(&n, &m) == nil {\n\t\tsolve(n, m)\n\t}\n}\n\nfunc solve(n, m Int) {\n\tvar ans Int\n\tif n == Int(1) {\n\t\tans = 1\n\t} else if m-1 >= n-m {\n\t\tans = m - 1\n\t} else {\n\t\tans = m + 1\n\t}\n\tO(ans, \"\\n\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treader = bufio.NewReader(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tscanner = bufio.NewScanner(os.Stdin)\n)\n\n//Wrong\nfunc main() {\n\tdefer writer.Flush()\n\tscanner.Split(bufio.ScanWords)\n\n\tn, m := nextInt(), nextInt()\n\n\tif n == 1 {\n\t\tprintln(1)\n\t\treturn\n\t}\n\n\tif m-1 < n-m {\n\t\tprintln(m + 1)\n\t} else {\n\t\tprintln(m - 1)\n\t}\n}\n\nfunc scan(a ...interface{}) {\n\tfmt.Fscan(reader, a...)\n}\n\nfunc next() string {\n\tif !scanner.Scan() {\n\t\tpanic(scanner.Err())\n\t}\n\treturn scanner.Text()\n}\n\nfunc nextInt64() int64 {\n\tn, _ := strconv.ParseInt(next(), 0, 64)\n\treturn n\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(next())\n\treturn n\n}\n\nfunc nextFloat() float64 {\n\tn, _ := strconv.ParseFloat(next(), 64)\n\treturn n\n}\n\nfunc println(a ...interface{}) { fmt.Fprintln(writer, a...) }\nfunc print(a ...interface{}) { fmt.Fprint(writer, a...) }\nfunc printf(format string, a ...interface{}) { fmt.Fprintf(writer, format, a...) }\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n if a > b {\n return a\n }\n return b\n}\n\n/*\nfunc abs(a int) int {\n if a < 0 {\n return -a \n }\n return a\n}\n\nfunc chances(a, m, n int) int {\n cnt := 0\n for c := 1; c <= n; c++ {\n if abs(a - c) < abs(c - m) {\n cnt++ \n }\n }\n return cnt\n}*/\n\nfunc main() {\n var m, n int\n fmt.Scanf(\"%d %d\", &n, &m)\n\n /*\n best := 1\n best_chances := 0\n for a := 1; a <= n; a++ {\n cnt := chances(a, m, n)\n if cnt > best_chances {\n best = a\n best_chances = cnt\n }\n }\n fmt.Println(best) */\n\n if n == 1 {\n fmt.Println(1)\n } else if n - m > m - 1 {\n fmt.Println(m + 1)\n } else {\n fmt.Println(m - 1) \n }\n}\n"}, {"source_code": "// salom project main.go\npackage main\n\nimport (\n\t\"fmt\";\n\n)\n\nfunc main() {\n\tvar m,n int64\n\tfmt.Scan(&n,&m)\n\tif ( m==1 )&&(n==1) {\n\tfmt.Print(\"1\")\n\treturn\n\t}\n\tm=m*2\n\tif m>n {\n\t\tfmt.Print(m/2-1)\n\t}else{\n\t\tfmt.Print(m/2+1)\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var (\n n int\n m int\n )\n fmt.Scan(&n)\n fmt.Scan(&m)\n\n a := m - 1\n if a < n - m {\n a = m + 1\n }\n if a == 0 {\n a = m\n }\n fmt.Println(a)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar N, M int\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN, M = fsc.NextInt(), fsc.NextInt()\n\tif N == 1 {\n\t\tfmt.Println(1)\n\t\tos.Exit(0)\n\t}\n\tvar left, right int\n\tleft = M - 1\n\tright = N - M\n\t// fmt.Println(left, right)\n\tif right > left {\n\t\tfmt.Println(M + 1)\n\t} else if right <= left {\n\t\tfmt.Println(M - 1)\n\t}\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var (\n n int\n m int\n )\n fmt.Scan(&n)\n fmt.Scan(&m)\n\n a := m - 1\n if a < n - m {\n a = m + 1\n }\n fmt.Println(a)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar N, M int\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN, M = fsc.NextInt(), fsc.NextInt()\n\tvar left, right int\n\tleft = M - 1\n\tright = N - M\n\tfmt.Println(left, right)\n\tif right > left {\n\t\tfmt.Println(M + 1)\n\t} else if right <= left {\n\t\tfmt.Println(M - 1)\n\t}\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar N, M int\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN, M = fsc.NextInt(), fsc.NextInt()\n\tvar left, right int\n\tleft = M - 1\n\tright = N - M\n\tif right >= left {\n\t\tfmt.Println(M + 1)\n\t} else if right < left {\n\t\tfmt.Println(M - 1)\n\t}\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar N, M int\n\nfunc main() {\n\tfsc := NewFastScanner()\n\tN, M = fsc.NextInt(), fsc.NextInt()\n\tvar left, right int\n\tleft = M - 1\n\tright = N - M\n\tif right > left {\n\t\tfmt.Println(M + 1)\n\t} else if right < left {\n\t\tfmt.Println(M - 1)\n\t} else {\n\t\tfmt.Println(M)\n\t}\n\n}\n\n//template\ntype FastScanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewFastScanner() *FastScanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1024)\n\treturn &FastScanner{r: rdr}\n}\nfunc (s *FastScanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *FastScanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *FastScanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *FastScanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *FastScanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *FastScanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\tif n == m{\n\t\tfmt.Println(m)\n\t}else if(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}"}, {"source_code": "package main \n\nimport \"fmt\"\n\n\nfunc main() {\n\tvar n,m int;\n\t_,_ = fmt.Scanf(\"%d %d\",&n,&m)\n\tvar u = n-m;\n\tvar l = m-1;\n\n\tif(u > l){\n\t\tfmt.Println(m+1)\n\t}else{\n\t\tfmt.Println(m-1)\n\t}\n}"}], "src_uid": "f6a80c0f474cae1e201032e1df10e9f7"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar adr, dmt, mcl int\n\tfmt.Scan(&adr, &dmt, &mcl)\n\n\tvar g, p, b int\n\tfmt.Scan(&g, &p, &b)\n\n\tg -= adr\n\tp = p + g - dmt\n\tb = b + p - mcl\n\n\tif g < 0 || p < 0 || b < 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z, a, b, c, res int\n\n\tfmt.Scanln(&x, &y, &z)\n\tfmt.Scanln(&a, &b, &c)\n\n\tif a >= x {\n\t\ta = a - x\n\t\tif a+b >= y {\n\t\t\ta = a - y\n\t\t\tif a+b+c >= z {\n\t\t\t\tres = 1\n\t\t\t} else {\n\t\t\t\tres = 2\n\t\t\t}\n\t\t} else {\n\t\t\tres = 2\n\t\t}\n\t} else {\n\t\tres = 2\n\t}\n\tif res == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tin := bufio.NewReader(os.Stdin)\n\tfmt.Fscan(in, &x, &y, &z, &a, &b, &c)\n\tans := findAns(x, y, z, a, b, c)\n\tfmt.Println(ans)\n}\n\nfunc findAns(x, y, z, a, b, c int) string {\n\tif x > a {\n\t\treturn \"NO\"\n\t}\n\ta = a - x\n\tif y > a+b {\n\t\treturn \"NO\"\n\t}\n\tif y+z > a+b+c {\n\t\treturn \"NO\"\n\t}\n\treturn \"YES\"\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif a >= x && a+b >= x+y && a+b+c >= x+y+z {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\n\nfunc main() {\n var x,y,z,a,b,c int;\n fmt.Scan(&x,&y,&z,&a,&b,&c);\n\t\ty += x; b+= a;\n\t\tz += y; c+= b;\n\t\tif a >= x && b >= y && c>=z {\n\t\t\tfmt.Println(\"YES\");\n\t\t} else {\n\t\t\tfmt.Println(\"NO\");\n\t\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tdefer out.Flush()\n\tvar x, y, z, g, p, b int\n\tfor hasNext() {\n\t\tscan(&x, &y, &z, &g, &p, &b)\n\t\tif x > g || y > g+p-x || z > g+p+b-x-y {\n\t\t\tprintln(\"NO\")\n\t\t} else {\n\t\t\tprintln(\"YES\")\n\t\t}\n\t}\n}\n\n// Fast IO Template\nvar in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc print(a ...interface{}) { fmt.Fprint(out, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(out, a...) }\nfunc scan(a ...interface{}) { fmt.Fscan(in, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(in, f, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(in, a...) }\nfunc hasNext() bool {\n\tfor b, _ := in.Peek(1); len(b) > 0 && (b[0] == 10 || b[0] == 13); b, _ = in.Peek(1) {\n\t\tin.Discard(1)\n\t}\n\tb, _ := in.Peek(1)\n\treturn len(b) == 1\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tdefer out.Flush()\n\tvar x, y, z, g, p, b int\n\tfor hasNext() {\n\t\tscan(&x, &y, &z, &g, &p, &b)\n\t\tif x > g || y > g+p-x || z > g+p+b-x-y {\n\t\t\tprintln(\"NO\")\n\t\t} else {\n\t\t\tprintln(\"YES\")\n\t\t}\n\t}\n}\n\n// Fast IO Template\nvar in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc print(a ...interface{}) { fmt.Fprint(out, a...) }\nfunc printf(f string, a ...interface{}) { fmt.Fprintf(out, f, a...) }\nfunc println(a ...interface{}) { fmt.Fprintln(out, a...) }\nfunc scan(a ...interface{}) { fmt.Fscan(in, a...) }\nfunc scanf(f string, a ...interface{}) { fmt.Fscanf(in, f, a...) }\nfunc scanln(a ...interface{}) { fmt.Fscanln(in, a...) }\nfunc hasNext() bool {\n\tfor b, _ := in.Peek(1); len(b) > 0 && (b[0] == 10 || b[0] == 13); b, _ = in.Peek(1) {\n\t\tin.Discard(1)\n\t}\n\tb, _ := in.Peek(1)\n\treturn len(b) == 1\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\nfunc main() {\n\tvar x, y, z, g, p, b int\n\tfor {\n\t\tif _, err := fmt.Scan(&x, &y, &z, &g, &p, &b); err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\tif x > g || y > g+p-x || z > g+p+b-x-y {\n\t\t\tfmt.Println(\"NO\")\n\t\t} else {\n\t\t\tfmt.Println(\"YES\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z int32 = 0, 0, 0\n\tvar a, b, c int32 = 0, 0, 0\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &z)\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\tif x <= a && y <= a-x+b && z <= a+b+c-x-y {\n\t\tfmt.Printf(\"YES\")\n\t} else {\n\t\tfmt.Printf(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int32\n\tfmt.Scanf(\"%d %d %d\\n\", &x, &y, &z)\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\n\tif (a < x) || (a+b < x+y) || (a+b+c < x+y+z) {\n\t\tfmt.Printf(\"NO\\n\")\n\t\treturn\n\t}\n\tfmt.Printf(\"YES\\n\")\n\treturn\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc eval(a, d, m, g, p, b int) bool {\n\tif a > g {\n\t\treturn false\n\t}\n\tg -= a\n\tif d > (g + p) {\n\t\treturn false\n\t}\n\trest := g + p - d\n\tif m > (rest + b) {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc main() {\n\tvar a, d, m int\n\tfmt.Scanf(\"%d %d %d\\n\", &a, &d, &m)\n\n\tvar g, p, b int\n\tfmt.Scanf(\"%d %d %d\\n\", &g, &p, &b)\n\n\tif eval(a, d, m, g, p, b) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc check(x, y, z, a, b, c int) bool {\n if a < x {\n return false\n }\n if c > z {\n return x+y <= a+b\n }\n return x+y+z <= a+b+c\n}\n\nfunc main() {\n var x, y, z, a, b, c int\n for {\n _, err := fmt.Scanf(\"%d %d %d\\n%d %d %d\", &x, &y, &z, &a, &b, &c)\n if err != nil {\n return\n }\n if check(x, y, z, a, b, c) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttmp := readInt64Slice(reader, 3)\n\tx, y, z := tmp[0], tmp[1], tmp[2]\n\ttmp = readInt64Slice(reader, 3)\n\ta, b, c := tmp[0], tmp[1], tmp[2]\n\ta -= x\n\tif a < 0 {\n\t\tfmt.Println(\"NO\")\n\t\tos.Exit(0)\n\t}\n\tb += a\n\tb -= y\n\tif b < 0 {\n\t\tfmt.Println(\"NO\")\n\t\tos.Exit(0)\n\t}\n\tc += b\n\tc -= z\n\tif c < 0 {\n\t\tfmt.Println(\"NO\")\n\t\tos.Exit(0)\n\t}\n\tfmt.Println(\"YES\")\n}\n\nfunc readOneInt64(r *bufio.Reader) (n int64) {\n\tbytes, _ := r.ReadBytes('\\n')\n\tn, _ = strconv.ParseInt(string(bytes[:len(bytes)-2]), 10, 64)\n\treturn\n}\n\nfunc readInt64Slice(r *bufio.Reader, n int) (slice []int64) {\n\tvar bytes []byte\n\tslice = make([]int64, n)\n\tn--\n\tfor i := 0; i < n; i++ {\n\t\tbytes, _ = r.ReadBytes(' ')\n\t\tslice[i], _ = strconv.ParseInt(string(bytes[:len(bytes)-1]), 10, 64)\n\t}\n\tslice[n] = readOneInt64(r)\n\treturn\n}\n\nfunc readOneString(r *bufio.Reader) []byte {\n\tbytes, _ := r.ReadBytes('\\n')\n\treturn bytes[:len(bytes)-2]\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int32\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tvar answer string = \"YES\"\n\tif a -= x; a < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tif b = a + b - y; b < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tif c = b + c - z; c < 0 {\n\t\tanswer = \"NO\"\n\t}\n\tfmt.Printf(\"%v\", answer)\n}\n"}, {"source_code": "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, C := sc.NextInt(), sc.NextInt(), sc.NextInt()\n\tX, Y, Z := sc.NextInt(), sc.NextInt(), sc.NextInt()\n\n\tX -= A\n\tif X < 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif B < X {\n\t\tX -= B\n\t\tB = 0\n\t} else {\n\t\tB -= X\n\t\tX = 0\n\t}\n\tif B < Y {\n\t\tY -= B\n\t\tB = 0\n\t} else {\n\t\tB -= Y\n\t\tY = 0\n\t}\n\tif B > 0 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tif C > X+Y+Z {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\tfmt.Println(\"YES\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanBytes() []byte {\n\tscanner.Scan()\n\treturn scanner.Bytes()\n}\n\nfunc scanInt64() int64 {\n\tscanner.Scan()\n\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn v\n}\n\nfunc scanInt() int {\n\tscanner.Scan()\n\tv, _ := strconv.Atoi(scanner.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\tl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tscanner.Scan()\n\t\tl[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\n\treturn l\n}\n\nfunc scanInts64(n int64) []int64 {\n\tl := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tscanner.Scan()\n\t\tl[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\n\treturn l\n}\n\nfunc scanBool() bool {\n\tscanner.Scan()\n\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\treturn v == 1\n}\n\nfunc scanBools(n int64) []bool {\n\tl := make([]bool, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tscanner.Scan()\n\t\tv, _ := strconv.ParseInt(scanner.Text(), 10, 64)\n\t\tl[i] = v == 1\n\t}\n\n\treturn l\n}\n\nfunc scanUint64() uint64 {\n\tscanner.Scan()\n\tv, _ := strconv.ParseUint(scanner.Text(), 10, 64)\n\treturn v\n}\n\ntype ByAge []int\n\nfunc (a ByAge) Len() int { return len(a) }\nfunc (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a ByAge) Less(i, j int) bool { return a[i] > a[j] }\n\nvar glasn = map[byte]bool{\n\t'a': true,\n\t'e': true,\n\t'i': true,\n\t'o': true,\n\t'u': true,\n}\n\nfunc main() {\n\tx, y, z := scanInt(), scanInt(), scanInt()\n\ta, b, c := scanInt(), scanInt(), scanInt()\n\n\tif a < x {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\ta -= x\n\n\tif a+b < y {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tleft := (a + b - y) + c\n\n\tif left < z {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"YES\")\n}\n\nfunc skipZero(a []uint64) []uint64 {\n\tfor len(a) > 0 && a[0] == 0 {\n\t\ta = a[1:]\n\t}\n\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\n\treturn -a\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\nfunc max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\n\treturn b\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n\tif x > a || x+y > a+b || x+y+z > a+b+c {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tvar ans int\n\tans = solve(x, y, z, a, b, c)\n\tfmt.Println([]string{\"YES\", \"NO\"}[ans])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x && a+b >= x+y && a+b+c >= x+y+z {\n return 1\n }\n return 0\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n if solve(x, y, z, a, b, c) == 1 {\n fmt.Println(\"YES\")\n\t} else {\n fmt.Println(\"NO\")\n\t}\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z, a, b, c int32\n\tfmt.Scanf(\"%d %d %d\\n\", x, y, z)\n\tfmt.Scanf(\"%d %d %d\", a, b, c)\n\tif (a < x) || (a+b < x+y) || (a+b+c < x+y+z) {\n\t\tfmt.Printf(\"NO\")\n\t\treturn\n\t}\n\tfmt.Printf(\"YES\")\n\treturn\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc check(x, y, z, a, b, c int) bool {\n if a < x {\n return false\n }\n if c < z {\n return x+y <= a+b\n }\n return x+y+z <= a+b+c\n}\n\nfunc main() {\n var x, y, z, a, b, c int\n for {\n _, err := fmt.Scanf(\"%d %d %d\\n%d %d %d\", &x, &y, &z, &a, &b, &c)\n if err != nil {\n return\n }\n if check(x, y, z, a, b, c) {\n fmt.Println(\"YES\")\n } else {\n fmt.Println(\"NO\")\n }\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x {\n return 0\n }\n if a+b >= x+y {\n return 0\n }\n if a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif solve(x,y,z,a,b,c) == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x || a+b >= x+y || a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif solve(x,y,z,a,b,c) == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x || a+b >= x+y || a+b+c >= x+y+z {\n return 0\n }\n return 1\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n if solve(x, y, z, a, b, c) == 1 {\n fmt.Println(\"YES\")\n\t} else {\n fmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc solve(x int, y int, z int, a int, b int, c int) int {\n if a >= x || a+b >= x+y || a+b+c >= x+y+z {\n return 1\n }\n return 0\n}\n\nfunc main() {\n\tvar x, y, z, a, b, c int\n\tfmt.Scan(&x, &y, &z, &a, &b, &c)\n\tif solve(x,y,z,a,b,c) == 1 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}], "src_uid": "d54201591f7284da5e9ce18984439f4e"} {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\n\nfunc triangle(L []int, diff int) bool {\n\tfor i := 0; i < 4; i++ {\n\t\tfor j := i + 1; j < 4; j++ {\n\t\t\tfor k := j + 1; k < 4; k++ {\n\t\t\t\tif (L[i] + L[j] - L[k]) >= diff {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tvar L = make([]int, 4)\n\t_, _ = fmt.Scanf(\"%d %d %d %d\", &L[0], &L[1], &L[2], &L[3])\n\tsort.Ints(L)\n\tif triangle(L, 1) {\n\t\tfmt.Println(\"TRIANGLE\")\n\t} else if triangle(L, 0) {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nvar cs map[int]int = make(map[int]int)\n\nfunc Init() {}\nfunc Solve(io *FastIO) {\n\ta := io.NextIntArray(4)\n\tvar b []int\n\tres := float64(0)\n\tfor i := range a {\n\t\tb = make([]int, 0)\n\t\tfor j := range a {\n\t\t\tif j != i {\n\t\t\t\tb = append(b, a[j])\n\t\t\t}\n\t\t}\n\t\tres = math.Max(check(b[0], b[1], b[2], 0), res)\n\t}\n\tswitch int(res) {\n\tcase 0:\n\t\tio.Println(\"IMPOSSIBLE\")\n\tcase 1:\n\t\tio.Println(\"SEGMENT\")\n\tcase 2:\n\t\tio.Println(\"TRIANGLE\")\n\t}\n}\nfunc check(a, b, c, co int) float64 {\n\tif co > 2 {\n\t\treturn float64(2)\n\t}\n\ts := b + c\n\tvar res float64\n\tif s == a {\n\t\tres = float64(1)\n\t} else if s > a {\n\t\tres = check(b, c, a, co+1)\n\t} else {\n\t\tres = float64(0)\n\t}\n\treturn res\n}\n\ntype FastIO struct {\n\t//by megaspazz\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = int64(-1)\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = res*10 + int64(c-'0')\n\t\tc = io.NextChar()\n\t}\n\treturn res * sgn\n}\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextInt()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size+offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i+offset] = io.NextLong()\n\t}\n\treturn arr\n}\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\n', '\\r':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tInit()\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar a, b, c, d int\n\n\tfmt.Fscanf(reader, \"%d %d %d %d\", &a, &b, &c, &d)\n\n\tif a > b {\n\t\ta, b = b, a\n\t}\n\tif c > d {\n\t\tc, d = d, c\n\t}\n\tif a > c {\n\t\ta, c = c, a\n\t}\n\tif b > d {\n\t\tb, d = d, b\n\t}\n\tif b > c {\n\t\tb, c = c, b\n\t}\n\n\tif a+b > c || b+c > d {\n\t\tfmt.Printf(\"TRIANGLE\")\n\t} else if a+b == c || b+c == d {\n\t\tfmt.Printf(\"SEGMENT\")\n\t} else {\n\t\tfmt.Printf(\"IMPOSSIBLE\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar numbers = make([]int, 4)\n\tfmt.Scan(&numbers[0], &numbers[1], &numbers[2], &numbers[3])\n\tsort.Ints(numbers)\n\tif numbers[2] < (numbers[0]+numbers[1]) || numbers[3] < (numbers[2]+numbers[1]) {\n\t\tfmt.Println(\"TRIANGLE\")\n\t} else if numbers[2] == (numbers[0]+numbers[1]) || numbers[3] == (numbers[2]+numbers[1]) {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tA := readNNums(reader, 4)\n\n\tfmt.Println(solve(A))\n}\n\nfunc readInt(bytes []byte, from int, val *int) int {\n\ti := from\n\tsign := 1\n\tif bytes[i] == '-' {\n\t\tsign = -1\n\t\ti++\n\t}\n\ttmp := 0\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + int(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp * sign\n\treturn i\n}\n\nfunc readNum(reader *bufio.Reader) (a int) {\n\tbs, _ := reader.ReadBytes('\\n')\n\treadInt(bs, 0, &a)\n\treturn\n}\n\nfunc readTwoNums(reader *bufio.Reader) (a int, b int) {\n\tres := readNNums(reader, 2)\n\ta, b = res[0], res[1]\n\treturn\n}\n\nfunc readThreeNums(reader *bufio.Reader) (a int, b int, c int) {\n\tres := readNNums(reader, 3)\n\ta, b, c = res[0], res[1], res[2]\n\treturn\n}\n\nfunc readNNums(reader *bufio.Reader, n int) []int {\n\tres := make([]int, n)\n\tx := 0\n\tbs, _ := reader.ReadBytes('\\n')\n\tfor i := 0; i < n; i++ {\n\t\tfor x < len(bs) && (bs[x] < '0' || bs[x] > '9') {\n\t\t\tx++\n\t\t}\n\t\tx = readInt(bs, x, &res[i])\n\t}\n\treturn res\n}\n\nfunc readUint64(bytes []byte, from int, val *uint64) int {\n\ti := from\n\n\tvar tmp uint64\n\tfor i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {\n\t\ttmp = tmp*10 + uint64(bytes[i]-'0')\n\t\ti++\n\t}\n\t*val = tmp\n\n\treturn i\n}\n\nfunc solve(A []int) string {\n\tsort.Ints(A)\n\n\tif A[3] < A[2]+A[1] {\n\t\treturn \"TRIANGLE\"\n\t}\n\tif A[2] < A[0]+A[1] {\n\t\treturn \"TRIANGLE\"\n\t}\n\n\tif A[3] == A[1]+A[2] || A[3] == A[0]+A[1] || A[3] == A[0]+A[2] || A[2] == A[0]+A[1] {\n\t\treturn \"SEGMENT\"\n\t}\n\n\treturn \"IMPOSSIBLE\"\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\nfunc main() {\n\tv:=make([]int,4)\n\tfor i:=0;i<4;i++ {\n\t\tfmt.Scan(&v[i])\n\t}\n\tsort.Ints(v)\n\tif v[0]+v[1]>v[2] || v[1]+v[2]>v[3] {\n\t\tfmt.Println(\"TRIANGLE\")\n\t} else if v[0]+v[1]==v[2] || v[1]+v[2]==v[3] {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n\n}\n"}, {"source_code": "//\n// What we need to do is apply \"Heron's Formula\" for the area\n// of a triangle with known length of sides.\n//\n// For convience, compute half perimeter:\n// s = (a + b + c) / 2\n//\n// Then A = sqrt(s * (s - a) * (s - b) (s - c))\n//\n// If A is imaginary, the sides aren't longth enough to form\n// a triangle. If A is zero, it forms a degenerate triangle\n//\n// A degenerate triangle is one where len(AB) + len(BC) = len(AC)\n//\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := float64(readInt())\n\tb := float64(readInt())\n\tc := float64(readInt())\n\td := float64(readInt())\n\n\tcombs := [...]float64{a, b, c, d}\n\tdegenerate := false\n\n\teps := 0.0001\n\tfor i, va := range combs {\n\t\tfor j := i + 1; j < len(combs); j++ {\n\t\t\tvb := combs[j]\n\t\t\tfor k := j + 1; k < len(combs); k++ {\n\t\t\t\tvc := combs[k]\n\t\t\t\ta = area(va, vb, vc)\n\n\t\t\t\tif a > eps {\n\t\t\t\t\tfmt.Println(\"TRIANGLE\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif math.Abs(a) < eps {\n\t\t\t\t\tdegenerate = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif degenerate {\n\t\tfmt.Println(\"SEGMENT\")\n\t\treturn\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\n}\n\nfunc area(a, b, c float64) float64 {\n\tneg := false\n\n\ts := (a + b + c) / 2.0\n\tarea := s * (s - a) * (s - b) * (s - c)\n\n\tif area < 0 {\n\t\tneg = true\n\t\tarea = -area\n\t}\n\n\tarea = math.Sqrt(area)\n\n\tif neg {\n\t\tarea = -area\n\t}\n\treturn area\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\n\nfunc max3(x, y, z int) (int, bool){\n\tif (x >= y) && (x >= z) && ((x - y - z) <= 0){\n\t\treturn x - y - z, true\n\t}else if (y >= x) && (y >= z) && ((y - x - z) <= 0){\n\t\treturn y - x - z, true\n\t}else if (z>=y)&&(z >= x)&&((z-y-x) <= 0){\n\t\treturn z-y-x, true\n\t}else{\n\t\treturn 0, false\n\t}\n}\n\nfunc main() {\n\tsticks := make([]int, 4)\n\tfmt.Scan(&sticks[0], &sticks[1], &sticks[2], &sticks[3])\n\tans := \"IMPOSSIBLE\"\n\tfor i := 0; i < 4; i++{\n\t\tif c, ok:= max3(sticks[i%4], sticks[(i+1)%4], sticks[(i+2)%4]); (c < 0) && ok {\n\t\t\tans = \"TRIANGLE\"\n\t\t\tbreak\n\t\t}else if (c == 0) && ok{\n\t\t\tans = \"SEGMENT\"\n\t\t}\n\t}\n\n\n\tfmt.Print(ans)\n}"}, {"source_code": "//http://codeforces.com/contest/6/problem/A\n//A. Triangle\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc isTri(a, b, c int32) int32 {\n\tif a > c {\n\t\tc, a = a, c\n\t}\n\tif c < b {\n\t\tc, b = b, c\n\t}\n\tif b < a {\n\t\tb, a = a, b\n\t}\n\tif a+b > c {\n\t\treturn 1\n\t}\n\tif a+b == c {\n\t\treturn 0\n\t}\n\treturn -1\n}\n\nfunc main() {\n\tvar (\n\t\tres, t, a, b, c, d int32\n\t)\n\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&d)\n\tres = isTri(a, b, c)\n\tt = isTri(a, b, d)\n\tif t > res {\n\t\tres = t\n\t}\n\tt = isTri(a, c, d)\n\tif t > res {\n\t\tres = t\n\t}\n\tt = isTri(b, c, d)\n\tif t > res {\n\t\tres = t\n\t}\n\n\tif res > 0 {\n\t\tfmt.Println(\"TRIANGLE\")\n\t\treturn\n\t}\n\tif res < 0 {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t\treturn\n\t}\n\tfmt.Println(\"SEGMENT\")\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l [4]int\n\tif _, err := fmt.Scanf(\"%d %d %d %d\\n\", &l[0], &l[1], &l[2], &l[3]); err != nil {\n\t\treturn\n\t}\n\n\tsegment := false\n\n\tvar t [3]int\n\tfor i := 0; i < 4; i++ {\n\t\tk := 0\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif j != i {\n\t\t\t\tt[k] = l[j]\n\t\t\t\tk++\n\t\t\t}\n\t\t}\n\t\ts := triangle(t)\n\t\tif s == 1 { // triangle\n\t\t\tfmt.Println(\"TRIANGLE\")\n\t\t\treturn\n\t\t} else if s == 2 { // Degenerate triangle\n\t\t\tsegment = true\n\t\t}\n\t}\n\n\tif segment {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n\nfunc triangle(t [3]int) int {\n\tsum := 0\n\tmax := 0\n\tfor i := 0; i < 3; i++ {\n\t\tsum += t[i]\n\t\tif t[i] > max {\n\t\t\tmax = t[i]\n\t\t}\n\t}\n\n\tif sum-max == max {\n\t\treturn 2\n\t} else if sum-max > max {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc f(a,b,c int) int {\n if ((a+b) > c) && ((a+c) > b) && ((b+c) > a) {\n return 2\n } else if ((a+b) >= c) && ((a+c) >= b) && ((b+c) >= a) {\n return 1\n } else {\n return 0\n }\n}\n\nfunc max(a... int) (max int) {\n max = a[0]\n for _, v := range a {\n if max < v { max = v }\n }\n return\n}\n\nfunc main() {\n var a,b,c,d int\n fmt.Scan(&a,&b,&c,&d)\n ans := max(f(a,b,c),f(a,b,d),f(a,c,d),f(b,c,d))\n if ans == 2 {\n fmt.Println(\"TRIANGLE\")\n } else if ans == 1 {\n fmt.Println(\"SEGMENT\")\n } else {\n fmt.Println(\"IMPOSSIBLE\")\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"text/scanner\"\n)\n\nfunc check(e error) {\n\tif e != nil {\n\t\tpanic(e)\n\t}\n}\n\nfunc main() {\n\tvar inputs []int\n\n\tinputs = make([]int, 4)\n\n\tdat, err := ioutil.ReadAll(os.Stdin)\n\tcheck(err)\n\tvar str_data string = string(dat);\n\n\treader := strings.NewReader(str_data)\n\t\n\tvar scn scanner.Scanner\n\tscn.Init(reader)\n\n scn.Scan()\n\tvar text string = scn.TokenText();\n\t\n\tinputs[0], err = strconv.Atoi(text)\n\tcheck(err)\n\n\tscn.Scan()\n\ttext = scn.TokenText();\n\t\n\tinputs[1], err = strconv.Atoi(text)\n\tcheck(err)\n\n\tscn.Scan()\n\ttext = scn.TokenText();\n\t\n\tinputs[2], err = strconv.Atoi(text)\n\tcheck(err)\n\n\tscn.Scan()\n\ttext = scn.TokenText();\n\t\n\tinputs[3], err = strconv.Atoi(text)\n\tcheck(err)\n\n\tsort.Ints(inputs)\n\n\t// first check to see if you can make a triangle with first input\n\t// otherwise, check for degenerate case\n\tif inputs[0] + inputs[1] > inputs[2] ||\n\t inputs[0] + inputs[2] > inputs[3] ||\n\t inputs[1] + inputs[2] > inputs[3] {\n\t\tfmt.Print(\"TRIANGLE\")\n\t} else if inputs[0] + inputs[1] == inputs[2] ||\n\t inputs[0] + inputs[2] == inputs[3] ||\n\t inputs[1] + inputs[2] == inputs[3] {\n\t \tfmt.Print(\"SEGMENT\")\n\t} else {\n\t\tfmt.Print(\"IMPOSSIBLE\")\n\t}\n\n}"}, {"source_code": "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 l1, l2, l3, l4 int\n\n\tif scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tfmt.Sscanf(line, \"%d %d %d %d\", &l1, &l2, &l3, &l4)\n\n\t\tlines := [4]int{l1, l2, l3, l4}\n\n\t\tdegenerate := false\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tfor j := i + 1; j < 4; j++ {\n\t\t\t\tfor k := j + 1; k < 4; k++ {\n\t\t\t\t\tif lines[i]+lines[j] > lines[k] &&\n\t\t\t\t\t\tlines[i]+lines[k] > lines[j] &&\n\t\t\t\t\t\tlines[j]+lines[k] > lines[i] {\n\t\t\t\t\t\tfmt.Println(\"TRIANGLE\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tif lines[i]+lines[j] == lines[k] ||\n\t\t\t\t\t\tlines[i]+lines[k] == lines[j] ||\n\t\t\t\t\t\tlines[j]+lines[k] == lines[i] {\n\t\t\t\t\t\tdegenerate = true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif degenerate {\n\t\t\tfmt.Println(\"SEGMENT\")\n\t\t} else {\n\t\t\tfmt.Println(\"IMPOSSIBLE\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar inf int = 0x3f3f3f3f\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\nvar n int\nvar a [4]int\n\nfunc main() {\n\tn = 4\n\tfor i := 0; i < 4; i++ {\n\t\tfmt.Fscan(reader, &a[i])\n\t}\n\tsort.Sort(sort.IntSlice(a[:]))\n\tif a[0]+a[1] > a[2] || a[1]+a[2] > a[3] {\n\t\tfmt.Println(\"TRIANGLE\")\n\t\treturn\n\t}\n\tif a[0]+a[1] == a[2] || a[1]+a[2] == a[3] {\n\t\tfmt.Println(\"SEGMENT\")\n\t\treturn\n\t}\n\tfmt.Println(\"IMPOSSIBLE\")\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"errors\"\n\t\"sort\"\n)\n\nfunc main() {\n\tl := make([]int, 4)\n\tfor i := 0; i < 4; i++ {\n\t\tl[i] = nextInt()\n\t}\n\tsort.Ints(l)\n\ttriangle, segment := l[0] + l[1] > l[2] || l[1] + l[2] > l[3], l[0] + l[1] == l[2] || l[1] + l[2] == l[3]\n\n\tif triangle {\n\t\tprintf(\"TRIANGLE\\n\")\n\t} else if segment {\n\t\tprintf(\"SEGMENT\")\n\t} else {\n\t\tprintf(\"IMPOSSIBLE\")\n\t}\n}\n\nvar lineScanner *bufio.Scanner\nvar wordScanner *bufio.Scanner\n\nfunc init() {\n\tlineScanner = bufio.NewScanner(os.Stdin)\n\twordScanner = bufio.NewScanner(strings.NewReader(\"\"))\n\twordScanner.Split(bufio.ScanWords)\n}\nfunc printf(format string, a ...interface{}) {\n\tfmt.Printf(format, a...)\n}\nfunc nextLine() (string, error) {\n\tif !lineScanner.Scan() {\n\t\tif err := lineScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\treturn \"\", errors.New(\"nextLine: EOF reached\")\n\t}\n\treturn lineScanner.Text(), nil\n}\n\nfunc nextWord() string {\n\tfor !wordScanner.Scan() {\n\t\tif err := wordScanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tline, err := nextLine()\n\t\tif err != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\twordScanner = bufio.NewScanner(strings.NewReader(line))\n\t\twordScanner.Split(bufio.ScanWords)\n\t}\n\treturn wordScanner.Text()\n}\n\nfunc nextInt() int {\n\tres, err := strconv.Atoi(nextWord())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextInt64() int64 {\n\tres, err := strconv.ParseInt(nextWord(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\nfunc nextFloat64() float64 {\n\tres, err := strconv.ParseFloat(nextWord(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}"}, {"source_code": "// 6A-mic\npackage main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n l := make([]int, 4)\n fmt.Scan(&l[0], &l[1], &l[2], &l[3])\n sort.Sort(sort.IntSlice(l))\n if l[0]+l[1] > l[2] || l[1]+l[2] > l[3] {\n fmt.Println(\"TRIANGLE\")\n } else if l[0]+l[1] == l[2] || l[1]+l[2] == l[3] {\n fmt.Println(\"SEGMENT\")\n } else {\n fmt.Println(\"IMPOSSIBLE\")\n }\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\tstrings \"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\ttext, _, _ := reader.ReadLine()\n\n\tval := strings.Split(string(text), \" \")\n\tvar val2 [4]int64\n\n\tvar val3 = make([]int, 4, 4)\n\n\tval2[0], _ = strconv.ParseInt(val[0], 10, 0)\n\tval2[1], _ = strconv.ParseInt(val[1], 10, 0)\n\tval2[2], _ = strconv.ParseInt(val[2], 10, 0)\n\tval2[3], _ = strconv.ParseInt(val[3], 10, 0)\n\tval3[0] = int(val2[0])\n\tval3[1] = int(val2[1])\n\tval3[2] = int(val2[2])\n\tval3[3] = int(val2[3])\n\n\tsort.Ints(val3)\n\n\tif val3[3] < val3[2]+val3[1] || val3[2] < val3[1]+val3[0] {\n\t\tfmt.Println(\"TRIANGLE\")\n\t} else if val3[3] == val3[2]+val3[1] || val3[2] == val3[1]+val3[0] {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc f(a,b,c int) int {\n if ((a+b) > c) && ((a+c) > b) && ((b+c) > a) {\n return 2\n } else if ((a+b) >= c) && ((a+c) >= b) && ((b+c) >= a) {\n return 1\n } else {\n return 0\n }\n}\n\nfunc max(a... int) (max int) {\n max = a[0]\n for _, v := range a {\n if max < v { max = v }\n }\n return\n}\n\nfunc main() {\n var a,b,c,d int\n fmt.Scan(&a,&b,&c,&d)\n ans := max(f(a,b,c),f(a,b,d),f(a,c,d),f(b,c,d))\n if ans == 2 {\n fmt.Println(\"TRIANGLE\")\n } else if ans == 1 {\n fmt.Println(\"SEGMENT\")\n } else {\n fmt.Println(\"IMPOSSIBLE\")\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc f(a,b,c int) int {\n if ((a+b) > c) && ((a+c) > b) && ((b+c) > a) {\n return 2\n } else if ((a+b) >= c) && ((a+c) >= b) && ((b+c) >= a) {\n return 1\n } else {\n return 0\n }\n}\n\nfunc max(a... int) (max int) {\n max = a[0]\n for _, v := range a {\n if max < v { max = v }\n }\n return\n}\n\nfunc main() {\n var a,b,c,d int\n fmt.Scan(&a,&b,&c,&d)\n ans := max(f(a,b,c),f(a,b,d),f(a,c,d),f(b,c,d))\n if ans == 2 {\n fmt.Println(\"TRIANGLE\")\n } else if ans == 1 {\n fmt.Println(\"SEGMENT\")\n } else {\n fmt.Println(\"IMPOSSIBLE\")\n }\n}"}], "negative_code": [{"source_code": "package main\nimport \"fmt\"\n\n\nfunc max3(x, y, z int) (int, bool){\n\tif (x > y) && (x > z) && ((x - y - z) <= 0){\n\t\treturn x - y - z, true\n\t}else if (y > x) && (y > z) && ((y - x - z) <= 0){\n\t\treturn y - x - z, true\n\t}else if (z>y)&&(z > x)&&((z-y-x) <= 0){\n\t\treturn z-y-x, true\n\t}else{\n\t\treturn 0, false\n\t}\n}\n\nfunc main() {\n\tsticks := make([]int, 4)\n\tfmt.Scan(&sticks[0], &sticks[1], &sticks[2], &sticks[3])\n\tans := \"IMPOSSIBLE\"\n\tfor i := 0; i < 4; i++{\n\t\tif c, ok:= max3(sticks[i%4], sticks[(i+1)%4], sticks[(i+2)%4]); (c < 0) && ok {\n\t\t\tans = \"TRIANGLE\"\n\t\t\tbreak\n\t\t}else if (c == 0) && ok{\n\t\t\tans = \"SEGMENT\"\n\t\t}\n\t}\n\n\n\tfmt.Print(ans)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l [4]int\n\tif _, err := fmt.Scanf(\"%d %d %d %d\\n\", &l[0], &l[1], &l[2], &l[3]); err != nil {\n\t\treturn\n\t}\n\n\tsegment := false\n\n\tvar t [3]int\n\tfor i := 0; i < 4; i++ {\n\t\tk := 0\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tif j != i {\n\t\t\t\tt[k] = l[j]\n\t\t\t\tk++\n\t\t\t}\n\t\t}\n\t\ts := traingle(t)\n\t\tif s == 1 { // Traingle\n\t\t\tfmt.Println(\"TRAINGLE\")\n\t\t\treturn\n\t\t} else if s == 2 { // Degenerate Traingle\n\t\t\tsegment = true\n\t\t}\n\t}\n\n\tif segment {\n\t\tfmt.Println(\"SEGMENT\")\n\t} else {\n\t\tfmt.Println(\"IMPOSSIBLE\")\n\t}\n}\n\nfunc traingle(t [3]int) int {\n\tsum := 0\n\tmax := 0\n\tfor i := 0; i < 3; i++ {\n\t\tsum += t[i]\n\t\tif t[i] > max {\n\t\t\tmax = t[i]\n\t\t}\n\t}\n\n\tif sum-max == max {\n\t\treturn 2\n\t} else if sum-max > max {\n\t\treturn 1\n\t} else {\n\t\treturn 0\n\t}\n}\n"}], "src_uid": "8f5df9a41e6e100aa65b9fc1d26e447a"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/rand\"\n\t\"os\"\n)\n\nconst INF = 1000000001\n\ntype Pair struct {\n\tfirst, second int\n}\n\nfunc sort(arr []Pair) []Pair {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i].first > arr[right].first {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort(arr[:left])\n\tsort(arr[left+1:])\n\treturn arr\n}\n\nfunc sort2(arr []int) []int {\n\tif len(arr) < 2 {\n\t\treturn arr\n\t}\n\tleft := 0\n\tright := len(arr) - 1\n\tpivot := rand.Int() % len(arr)\n\n\tarr[pivot], arr[right] = arr[right], arr[pivot]\n\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < arr[right] {\n\t\t\tarr[i], arr[left] = arr[left], arr[i]\n\t\t\tleft++\n\t\t}\n\t}\n\n\tarr[left], arr[right] = arr[right], arr[left]\n\n\tsort2(arr[:left])\n\tsort2(arr[left+1:])\n\treturn arr\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 min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc solution(reader io.Reader, writer io.Writer) {\n\tvar n int\n\tfmt.Fscanf(reader, \"%d\", &n)\n\tif n >= 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tn = -n\n\t\ta := n % 10\n\t\tn /= 10\n\t\tb := n % 10\n\t\tn /= 10\n\t\tn *= 10\n\t\tfmt.Println((n + min(a, b)) * -1)\n\t}\n}\n\nfunc main() {\n\n\t//stdin, err := os.Open(\"file.in\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdin.Close()\n\tstdin := os.Stdin\n\treader := bufio.NewReaderSize(stdin, 1024*1024)\n\n\t//stdout, err := os.Create(\"file.out\")\n\t//if err != nil {\n\t//\tpanic(err)\n\t//}\n\t//defer stdout.Close()\n\tstdout := os.Stdout\n\twriter := bufio.NewWriterSize(stdout, 1024*1024)\n\tdefer writer.Flush()\n\n\tsolution(reader, writer)\n}", "positive_code": [{"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n >= 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tk:= n/10\n\t\tj:= n/100 * 10 + n %10\n\t\tif k > j {\n\t\t\tfmt.Println(k)\n\t\t} else {fmt.Println(j)}\n\t}\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tif n < 0 {\n\t\tn = -n\n\t\tlast := n % 10\n\t\tsteplast := (n / 10) % 10\n\t\tn = (n/100)*10 + min(last, steplast)\n\t\tn = -n\n\t}\n\tfmt.Print(n)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s[0] == '-' {\n ans, len := 0, len(s)\n for i := 1; i < (len-2); i++ {\n ans = (ans*10) + int(s[i]-'0')\n }\n if s[len-1] < s[len-2] {\n ans = (ans*10) + int(s[len-1]-'0')\n } else {\n ans = (ans*10) + int(s[len-2]-'0')\n }\n fmt.Println(-ans)\n } else {\n fmt.Println(s)\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc getString() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\treturn sc.Text()\n}\n\nfunc main() {\n\tstr := getString()\n\tacc, _ := strconv.Atoi(str)\n\tif acc > 0 {\n\t\tfmt.Println(acc)\n\t} else {\n\t\tstr1 := string(str[0 : len(str)-1])\n\t\tstr2 := string(str[0:len(str)-2]) + string(str[len(str)-1])\n\t\tnumber1, _ := strconv.Atoi(str1)\n\t\tnumber2, _ := strconv.Atoi(str2)\n\t\tif number1 > number2 {\n\t\t\tfmt.Println(number1)\n\t\t} else {\n\t\t\tfmt.Println(number2)\n\t\t}\n\t}\n}\n"}, {"source_code": "\ufeffpackage main\nimport (\n\t\"fmt\"\n)\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tif n >= 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tk:= n/10\n\t\tj:= n/100 * 10 + n %10\n\t\tif k > j {\n\t\t\tfmt.Println(k)\n\t\t} else {fmt.Println(j)}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar account int64\n\tfmt.Scan(&account)\n\n\tif account >= 0 || account/10 == 0 {\n\t\tfmt.Print(account)\n\t} else {\n\t\taccount *= -1\n\t\tlast := account % 10\n\t\taccount /= 10\n\t\tten := account % 10\n\t\taccount -= ten\n\n\t\tif last > ten {\n\t\t\tfmt.Print(-1 * (account + ten))\n\t\t} else {\n\t\t\tfmt.Print(-1 * (account + last))\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar reader *bufio.Reader\n\nfunc init() {\n\tstdin := os.Stdin\n\t// stdin, _ = os.Open(\"1.in\")\n\treader = bufio.NewReaderSize(stdin, 1<<20)\n}\n\n// Max Max\nfunc Max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nvar s string\n\nfunc main() {\n\tfmt.Fscan(reader, &s)\n\tif s[0] != '-' {\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tn := len(s)\n\ta, _ := strconv.Atoi(s[0 : n-1])\n\tb, _ := strconv.Atoi(s[0:n-2] + s[n-1:n])\n\tfmt.Println(Max(a, b))\n}\n"}, {"source_code": "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\ta := n / 10\n\tb := n/100*10 + n%10\n\tprintln(max(n, max(a, b)))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tif n >= 0 {\n\t\tfmt.Println(n)\n\t} else {\n\t\tlastd := n % 10\n\t\tseclastd := (n / 10) % 10\n\t\tn = n / 100\n\t\tif n*10+lastd > n*10+seclastd {\n\t\t\tfmt.Println(n*10 + lastd)\n\t\t} else {\n\t\t\tfmt.Println(n*10 + seclastd)\n\t\t}\n\t}\n}\n"}, {"source_code": "// 313A-mic\npackage main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n if n >= 0 {\n\n } else {\n n = int(math.Max(float64(n/10), float64((n/100)*10+(n%10))))\n }\n fmt.Println(n)\n}\n"}, {"source_code": "package main\nimport (\n \"fmt\"\n)\nfunc main() {\n var n int // 1\n fmt.Scan(&n)\n if n >= 0 { //1 + 1\n fmt.Println(n)\n } else {\n k:= n/10// 1\n j:= n/100 * 10 + n %10 // 1 + 1 \n if k > j {// 1 + 1\n fmt.Println(k)\n } else {fmt.Println(j)}\n }\n}\n"}, {"source_code": "package main\nimport (\n \"fmt\"\n)\nfunc main() {\n var n int\n var x int\n var y int\n fmt.Scan(&n)\n x= n/10\n y= n/100 * 10 + n %10\n if n >= 0 {\n fmt.Println(n)\n }else if x > y {\n fmt.Println(x)\n } else {fmt.Println(y)\n }\n \n }"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s[0] == '-' {\n ans, len := 0, len(s)\n for i := 1; i < (len-2); i++ {\n ans = (ans*10) + int(s[i]-'0')\n }\n if s[len-1] < s[len-2] {\n ans = (ans*10) + int(s[len-1]-'0')\n } else {\n ans = (ans*10) + int(s[len-2]-'0')\n }\n fmt.Println(-ans)\n } else {\n fmt.Println(s)\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// https://codeforces.com/problemset/problem/4/A\n// \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e\n// n \u0431\u0435\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0446\u0438\u0444\u0440\u044b == n%10\n// n \u0431\u0435\u0437 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0446\u0438\u0444\u0440\u044b == (n/100)*10 + n%10\nfunc taskSolution(n int) int {\n\tans := max(n, n/10)\n\tn = (n/100)*10 + n%10\n\treturn max(ans, n)\n}\n\nfunc main() {\n\tvar n int\n\tif _, err := fmt.Scan(&n); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(taskSolution(n))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tsecondDigit := n / 10\n\tfirstDigit := n / 100 * 10 + n % 10\n\tif firstDigit >= secondDigit && firstDigit >= n {\n\t\tfmt.Printf(\"%d\", firstDigit)\n\t}else if secondDigit >= firstDigit && secondDigit >= n {\n\t\tfmt.Printf(\"%d\", secondDigit)\n\t}else {\n\t\tfmt.Printf(\"%d\", n)\n\t}\n}\n"}, {"source_code": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar s string\n\tfmt.Scan(&s)\n\tif s[0]!='-' {\n\t\tfmt.Print(s)\n\t\treturn\n\t}\n\tn:=len(s)\n\tif (n==3) && (s[0]=='-') && (s[2]=='0') {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\t\n\tif s[n-1] secondDigit && firstDigit > n {\n\t\tfmt.Printf(\"%d\", firstDigit)\n\t}else if secondDigit > firstDigit && secondDigit > n {\n\t\tfmt.Printf(\"%d\", secondDigit)\n\t}else {\n\t\tfmt.Printf(\"%d\", n)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\\n\", &n)\n\tif n < 0 {\n\t\tn = -n\n\t\tsteplast := (n / 10) % 10\n\t\tif steplast == 0 {\n\t\t\tn = n / 10\n\t\t} else {\n\t\t\tn = n%10 + (n/100)*10\n\t\t}\n\t\tn = -n\n\t}\n\tfmt.Print(n)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n if s[0] == '-' {\n del := 1\n for i := 1; i < len(s); i++ {\n if s[del] < s[i] { del = i }\n }\n ans := 0\n for i := 1; i < len(s); i++ {\n if i != del { ans = (ans*10) + int(s[i]-'0') }\n }\n fmt.Println(-ans)\n } else {\n fmt.Println(s)\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int64\n\tfmt.Scan(&n)\n\tsecondDigit := n / 10\n\tfirstDigit := n / 100 * 10 + n % 10\n\tfmt.Println(n, firstDigit, secondDigit)\n\tif firstDigit >= secondDigit && firstDigit >= n {\n\t\tfmt.Printf(\"%d\", firstDigit)\n\t}else if secondDigit >= firstDigit && secondDigit >= n {\n\t\tfmt.Printf(\"%d\", secondDigit)\n\t}else {\n\t\tfmt.Printf(\"%d\", n)\n\t}\n}\n"}], "src_uid": "4b0a8798a6d53351226d4f06e3356b1e"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _, _ := reader.ReadLine()\n\t//n := strings.Split(string(input), \" \")\n\n\ttimes, _ := strconv.Atoi(string(input))\n\n\n\ta := make(map[byte]int)\n\n\tfor i := 0; i < times; i++ {\n\t\tinp, _, _ := reader.ReadLine()\n\t\tinteger, _ := strconv.Atoi(string(inp))\n\t\t_, ok := a[byte(integer)]\n\t\tif ok {\n\t\t\ta[byte(integer)]++\n\t\t} else {\n\t\t\ta[byte(integer)] = 0\n\t\t}\n\t}\n\n\tif len(a)!= 2 {\n\t\tfmt.Println(\"No\")\n\t\tos.Exit(0)\n\t}\n\n\tvar arr [2]int\n\ti := 0\n\tfor _, v := range a {\n\t\tarr[i] = v\n\t\ti++\n\t}\n\tif arr[0] != arr[1] {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t\tfor key := range a {\n\t\t\tfmt.Print(key, \" \")\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tm := make(map[int]int)\n\tlast := -1\n\tfor i := 0; i < n; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tm[a]++\n\t\tlast = a\n\t}\n\tif len(m) != 2 || m[last] != n/2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t\tdelete(m, last)\n\t\tother := 0\n\t\tfor other = range m {\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(last, other)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\tbs, _ := ioutil.ReadAll(os.Stdin)\n\treader := bytes.NewBuffer(bs)\n\n\tvar n, p, count int\n\tfmt.Fscanf(reader, \"%d\\n\", &n)\n\tm := map[int]int{}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscanf(reader, \"%d\\n\", &p)\n\t\tc, ok := m[p]\n\t\tif ok {\n\t\t\tm[p] = c + 1\n\t\t\tcount = c + 1\n\t\t} else {\n\t\t\tm[p] = 1\n\t\t\tcount = 1\n\t\t}\n\t}\n\tif len(m) != 2 {\n\t\tfmt.Printf(\"NO\")\n\t\treturn\n\t} else {\n\t\tans := make([]int, 0, 2)\n\t\tfor k, v := range m {\n\t\t\tif v == count {\n\t\t\t\tans = append(ans, k)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Printf(\"YES\\n%d %d\\n\", ans[0], ans[1])\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcards := make([]int, n)\n\tfor i := range cards {\n\t\tfmt.Scan(&cards[i])\n\t}\n\n\tm := make(map[int]int)\n\tfor _, v := range cards {\n\t\tm[v]++\n\t}\n\n\tif len(m) != 2 {\n\t\tfmt.Println(\"NO\")\n\t\treturn\n\t}\n\n\tuniqueCards := make([]int, 0)\n\tfor card := range m {\n\t\tuniqueCards = append(uniqueCards, card)\n\t}\n\n\tif m[uniqueCards[0]] == m[uniqueCards[1]] {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Printf(\"%d %d\\n\", uniqueCards[0], uniqueCards[1])\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, temp int\n\tvar seen = make(map[int]int)\n\tfmt.Scanln(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanln(&temp)\n\t\tseen[temp] += 1\n\t}\n\tif len(seen) != 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tvar keys []int\n\t\tvar vals []int\n\t\tfor k, v := range seen {\n\t\t\tkeys = append(keys, k)\n\t\t\tvals = append(vals, v)\n\t\t}\n\t\tif vals[0] == vals[1] {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tfor _, k := range keys {\n\t\t\t\tfmt.Printf(\"%d \", k)\n\t\t\t}\n\t\t} else {\n\t\t\tfmt.Println(\"NO\")\n\t\t}\n\t}\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst debug = false\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tn := gsli(reader)[0]\n\n\tvar m map[int]int\n\tm = make(map[int]int)\n\n\tfor i := 0; i <= 100; i++ {\n\t\tm[i] = 0\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tcur := gsli(reader)[0]\n\t\tm[cur]++\n\t}\n\n\tfor i, e := range m {\n\t\tfor j, e2 := range m {\n\t\t\tif e == e2 && e != 0 && i != j && e+e2 == n {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\tfmt.Printf(\"%v %v\", i, j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tdbg(\"%v\", m)\n\n\tfmt.Printf(\"NO\")\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tv := make([]int, 101)\n\tfor i := 0; i < n; i++ {\n\t\tv[readInt()]++\n\t}\n\tpos := 0\n\tcnt1 := 0\n\tcnt2 := 0\n\tres := make([]int, 0)\n\ttotal1 := 0\n\ttotal2 := 0\n\tfor i := 0; i < len(v); i++ {\n\t\tif v[i] != 0 {\n\t\t\tres = append(res, i)\n\t\t\tif pos%2 == 0 {\n\t\t\t\tcnt1++\n\t\t\t\ttotal1 += v[i]\n\t\t\t} else {\n\t\t\t\tcnt2++\n\t\t\t\ttotal2 += v[i]\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\t}\n\tif cnt1 == cnt2 && total1 == total2 && len(res) == 2 {\n\t\tfmt.Println(\"YES\")\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(res[i])\n\t\t}\n\t\tfmt.Println()\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar num int\nvar temp int\n\nfunc main() {\n fmt.Scan(&num)\n res := make(map[int]int)\n for i := 0; i < num; i++ {\n fmt.Scan(&temp)\n if num, ok := res[temp]; ok {\n res[temp] = num + 1\n } else {\n res[temp] = 1\n }\n }\n if len(res) != 2 || res[temp] != num/2 {\n fmt.Println(\"NO\")\n return\n }\n pre := -1\n for key, _ := range res {\n if pre == -1 {\n pre = key\n } else {\n fmt.Printf(\"yes\\n%d %d\\n\", pre, key)\n }\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\tnumbers := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\\n\", &numbers[i])\n\t}\n\n\t// sort\n\tsort.Ints(numbers)\n\n\tif numbers[0] == numbers[(N/2)-1] && numbers[(N/2)] == numbers[N-1] &&\n\t\tnumbers[N-1] != numbers[0] {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Printf(\"%d %d\", numbers[0], numbers[N-1])\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\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 v int\n\t\tfmt.Scan(&v)\n\t\tm[v]++\n\t}\n\tif len(m) == 2 {\n\t\tcnt := 0\n\t\tvar k1, k2 int\n\t\tfor k, v := range m {\n\t\t\tif cnt == 0 {\n\t\t\t\tk1 = k\n\t\t\t\tcnt = v\n\t\t\t} else if cnt != v {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tk2 = k\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Println(k1, k2)\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\"fmt\")\n\nfunc main(){\n\tvar n int\n\ta := make(map[int]int)\n\tscan(&n)\n\tfor i := 0; i < n; i++{\n\t\tvar t int\n\t\tscan(&t)\n\t\ta[t]++\n\t}\n\tif len(a) > 2 || len(a) < 2{\n\t\tsout(\"NO\")\n\t\treturn\n\t}\n\tb := make(map[int]map[int]bool)\n\tfor k,v := range a{\n\t\tif b[v] == nil {b[v] = make(map[int]bool)}\n\t\tb[v][k] = true\n\t}\n\n\tfor _,v := range b{\n\t\tif (len(v) >= 2){\n\t\t\tsout(\"YES\")\n\t\t\tt := 0\n\t\t\tfor k,_ := range v{\n\t\t\t\tsout(k)\n\t\t\t\tif (t == 1){return}\n\t\t\t\tt++\n\t\t\t}\n\t\t}\n\t} \n\tsout(\"NO\")\n}\n\nfunc scan(in ... interface{}){\n\tfor _,k := range in{\n\t\tfmt.Scan(k)\n\t}\n}\n\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k)\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a [101]int\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\ta[x]++\n\t}\n\tfor i := 1; i <= 100; i++ {\n\t\tfor j := i + 1; j <= 100; j++ {\n\t\t\tif a[i] == a[j] && a[i] == n / 2 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tfmt.Printf(\"%d %d\\n\", i, j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tcards := make([]int, n)\n\tfor i := range cards {\n\t\tfmt.Scan(&cards[i])\n\t}\n\n\tm := make(map[int]int)\n\tfor _, v := range cards {\n\t\tm[v]++\n\t}\n\n\tif len(m) != 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tvar en int\n\t\tfor _, entries := range m {\n\t\t\tif en == 0 {\n\t\t\t\ten = entries\n\t\t\t}\n\t\t\tif entries != en {\n\t\t\t\tfmt.Println(\"NO\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(\"YES\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, temp int\n\tvar seen = make(map[int]bool)\n\tfmt.Scanln(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanln(&temp)\n\t\tseen[temp] = true\n\t}\n\tif len(seen) != 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t\tfor k, _ := range seen {\n\t\t\tfmt.Printf(\"%d \", k)\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar seen = make(map[int]bool)\n\tfmt.Scanf(\"%d\", &n)\n\tvar temp int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &temp)\n\t\tseen[temp] = true\n\t}\n\tif len(seen) != 2 {\n\t\tfmt.Println(\"NO\")\n\t} else {\n\t\tfmt.Println(\"YES\")\n\t\tfor k, _ := range seen {\n\t\t\tfmt.Printf(\"%d \", k)\n\t\t}\n\t}\n}\n"}, {"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst debug = false\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tn := gsli(reader)[0]\n\n\tvar m map[int]int\n\tm = make(map[int]int)\n\n\tfor i := 0; i <= 100; i++ {\n\t\tm[i] = 0\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tcur := gsli(reader)[0]\n\t\tm[cur]++\n\t}\n\n\tfor i, e := range m {\n\t\tfor j, e2 := range m {\n\t\t\tif e == e2 && e != 0 && i != j {\n\t\t\t\tfmt.Printf(\"YES\\n\")\n\t\t\t\tfmt.Printf(\"%v %v\", i, j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tdbg(\"%v\", m)\n\n\tfmt.Printf(\"NO\")\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tv := make([]int, 101)\n\tfor i := 0; i < n; i++ {\n\t\tv[readInt()]++\n\t}\n\tpos := 0\n\tcnt1 := 0\n\tcnt2 := 0\n\tres := make([]int, 0)\n\tfor i := 0; i < len(v); i++ {\n\t\tif v[i] != 0 {\n\t\t\tres = append(res, i)\n\t\t\tif pos%2 == 0 {\n\t\t\t\tcnt1++\n\t\t\t} else {\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\t}\n\tif cnt1 == cnt2 {\n\t\tfmt.Println(\"YES\")\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(res[i])\n\t\t}\n\t\tfmt.Println()\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tn := readInt()\n\tv := make([]int, 101)\n\tfor i := 0; i < n; i++ {\n\t\tv[readInt()]++\n\t}\n\tpos := 0\n\tcnt2 := 0\n\tcnt1 := 0\n\ttotal2 := 0\n\ttotal1 := 0\n\tres := make([]int, 0)\n\tfor i := 0; i < len(v); i++ {\n\t\tif v[i] != 0 {\n\t\t\tres = append(res, i)\n\t\t\tif pos%2 == 0 {\n\t\t\t\tcnt1++\n\t\t\t\ttotal1 += v[i]\n\t\t\t} else {\n\t\t\t\ttotal2 += v[i]\n\t\t\t\tcnt2++\n\t\t\t}\n\t\t\tpos++\n\t\t}\n\t}\n\tif cnt1 == cnt2 && total1 == total2 {\n\t\tfmt.Println(\"YES\")\n\t\tfor i := 0; i < len(res); i++ {\n\t\t\tif i > 0 {\n\t\t\t\tfmt.Print(\" \")\n\t\t\t}\n\t\t\tfmt.Print(res[i])\n\t\t}\n\t\tfmt.Println()\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar num int\nvar temp int\n\nfunc main() {\n fmt.Scan(&num)\n res := make(map[int]int)\n for i := 0; i < num; i++ {\n fmt.Scan(&temp)\n if num, ok := res[temp]; ok {\n res[temp] = num + 1\n } else {\n res[temp] = 1\n }\n }\n if len(res) != 2 {\n fmt.Println(\"NO\")\n return\n }\n pre := -1\n for key, _ := range res {\n if pre == -1 {\n pre = key\n } else {\n fmt.Printf(\"yes\\n%d %d\\n\", pre, key)\n }\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tnumbers := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &numbers[i])\n\t}\n\n\t// sort\n\tsort.Ints(numbers)\n\n\tif numbers[0] == numbers[(N/2)-1] && numbers[(N/2)] == numbers[N-1] &&\n\t\tnumbers[N-1] != numbers[0] {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Printf(\"%d %d\", numbers[0], numbers[N-1])\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\tnumbers := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\\n\", &numbers[i])\n\t}\n\n\t// sort\n\tsort.Ints(numbers)\n\tfmt.Println(\"Numbers\")\n\tfmt.Println(numbers)\n\n\tif numbers[0] == numbers[(N/2)-1] && numbers[(N/2)] == numbers[N-1] &&\n\t\tnumbers[N-1] != numbers[0] {\n\t\tfmt.Println(\"YES\")\n\t\tfmt.Printf(\"%d %d\", numbers[0], numbers[N-1])\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\"fmt\")\n\nfunc main(){\n\tvar n int\n\ta := make(map[int]int)\n\tscan(&n)\n\tfor i := 0; i < n; i++{\n\t\tvar t int\n\t\tscan(&t)\n\t\ta[t]++\n\t}\n\tif len(a) > 2 || len(a) < 2{\n\t\tsout(\"NO\")\n\t\treturn\n\t}\n\tb := make(map[int]map[int]bool)\n\tfor k,v := range a{\n\t\tif b[v] == nil {b[v] = make(map[int]bool)}\n\t\tb[v][k] = true\n\t}\n\n\tfor _,v := range b{\n\t\tif (len(v) >= 2){\n\t\t\tsout(\"YES\")\n\t\t\tt := 0\n\t\t\tfor k,_ := range v{\n\t\t\t\tsout(k)\n\t\t\t\tif (t == 1){return}\n\t\t\t\tt++\n\t\t\t}\n\t\t}\n\t} \n\tsout(\"NO\")\n}\n\nfunc scan(in ... interface{}){\n\tfor _,k := range in{\n\t\tfmt.Scan(k)\n\t}\n}\n\nfunc sout(obj ... interface{}){\n\tfor _, k := range obj{\n\t\tfmt.Print(k, \" \")\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar a [101]int\n\tfor i := 0; i < n; i++ {\n\t\tvar x int\n\t\tfmt.Scan(&x)\n\t\ta[x]++\n\t}\n\tfor i := 1; i <= 100; i++ {\n\t\tfor j := i + 1; j <= 100; j++ {\n\t\t\tif a[i] == a[j] && a[i] > 0 {\n\t\t\t\tfmt.Println(\"YES\")\n\t\t\t\tfmt.Printf(\"%d %d\\n\", i, j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"NO\")\n}\n"}], "src_uid": "2860b4fb22402ea9574c2f9e403d63d8"} {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc sortAsc(numbers string) (result string) {\n\tsplitResult := strings.Split(numbers, \"+\")\n\tif len(splitResult) <= 1 {\n\t\tresult = numbers\n\t\treturn\n\t}\n\n\tvar index int\n\tvar isSwap bool\n\tfor {\n\t\tif splitResult[index] > splitResult[index+1] {\n\t\t\ttemp := splitResult[index]\n\t\t\tsplitResult[index] = splitResult[index+1]\n\t\t\tsplitResult[index+1] = temp\n\t\t\tisSwap = true\n\t\t}\n\n\t\tindex++\n\t\tif index == len(splitResult)-1 {\n\t\t\tindex = 0\n\t\t\tif !isSwap {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tisSwap = false\n\t\t}\n\t}\n\n\tvar sb strings.Builder\n\tfor i, number := range splitResult {\n\t\tsb.WriteString(number)\n\t\tif i < len(splitResult)-1 {\n\t\t\tsb.WriteString(\"+\")\n\t\t}\n\t}\n\n\treturn sb.String()\n}\n\nfunc main() {\n\n\t// var firstWord, secondWord string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tif err := scanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(sortAsc(scanner.Text()))\n\n\t\t// if firstWord == \"\" {\n\t\t// \tfirstWord = scanner.Text()\n\t\t// \tcontinue\n\t\t// }\n\n\t\t// if secondWord == \"\" {\n\t\t// \tsecondWord = scanner.Text()\n\t\t// \tfmt.Println(compareString(firstWord, secondWord))\n\t\t// \tfirstWord, secondWord = \"\", \"\"\n\t\t// }\n\t}\n}\n", "positive_code": [{"source_code": "//A. \u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0441\u043f\u0435\u0448\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c\npackage main\n\nimport (\n\t\"fmt\"\n\ts \"strings\"\n)\n\nfunc main() {\n\tvar line, rez string\n\n\tvar cnt1, cnt2, cnt3 int\n\n\tfmt.Scan(&line)\n\t/*\tfor i := 0; i < len(line); i += 2 {\n\t\t\tif string([]rune(line)[i]) == \"1\" {\n\t\t\t\tcnt1++\n\t\t\t\tcontinue\n\t\t\t} else if string([]rune(line)[i]) == \"2\" {\n\t\t\t\tcnt2++\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tcnt3++\n\t\t\t}\n\t\t}\n\t*/\n\tcnt1 = s.Count(line, \"1\")\n\tcnt2 = s.Count(line, \"2\")\n\tcnt3 = s.Count(line, \"3\")\n\n\tfor i := 0; i < cnt1; i++ {\n\t\trez += \"1+\"\n\t}\n\tfor i := 0; i < cnt2; i++ {\n\t\trez += \"2+\"\n\t}\n\tfor i := 0; i < cnt3; i++ {\n\t\trez += \"3+\"\n\t}\n\n\trez = rez[:len(rez)-1]\n\tfmt.Println(rez)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tss := strings.Split(s, \"+\")\n\tsort.Strings(ss)\n\tfmt.Println(strings.Join(ss, \"+\"))\n}\n"}, {"source_code": "package main\nimport(\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\nfunc main() {\n\tvar i string\n\tfmt.Scan(&i)\n\tresult := strings.Split(i, \"+\")\n\tsort.Sort(sort.StringSlice(result))//sort the array\n\ts := []string{}\n\tfor _,element := range result{\n\t\t\ts=append(s, element)\n\t\t\ts=append(s,\"+\")\n\t\t}\n\tresult1 := strings.Join(s, \"\")\n \tfmt.Println(result1[:len(s)-1])\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// HelpfulSum sorts numbers in a string in non-increasing order.\nfunc HelpfulSum(s string) string {\n\tnums := strings.Split(s, \"+\")\n\tsort.StringSlice(nums).Sort()\n\treturn strings.Join(nums, \"+\")\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tfmt.Println(HelpfulSum(scanner.Text()))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\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\nfunc main() {\n\tdefer writer.Flush()\n\n\tvar s string\n\tscanf(\"%s\\n\", &s)\n\tarr := strings.Split(s, \"+\")\n\tsort.Strings(arr)\n\tfor i, v := range arr {\n\t\tif i < len(arr)-1 {\n\t\t\tprintf(\"%s+\", v)\n\t\t} else {\n\t\t\tprintf(\"%s\", v)\n\t\t}\n\t}\n\tprintf(\"\\n\")\n}\n"}, {"source_code": "/*\nHelpful Maths\ntime limit per test2 seconds\nmemory limit per test256 megabytes\ninputstandard input\noutputstandard output\nXenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.\n\nThe teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only contains numbers 1, 2 and 3. Still, that isn't enough for Xenia. She is only beginning to count, so she can calculate a sum only if the summands follow in non-decreasing order. For example, she can't calculate sum 1+3+2+1 but she can calculate sums 1+1+2 and 3+3.\n\nYou've got the sum that was written on the board. Rearrange the summans and print the sum in such a way that Xenia can calculate the sum.\n\nInput\nThe first line contains a non-empty string s \u2014 the sum Xenia needs to count. String s contains no spaces. It only contains digits and characters \"+\". Besides, string s is a correct sum of numbers 1, 2 and 3. String s is at most 100 characters long.\n\nOutput\nPrint the new sum that Xenia can count.\n\nSample test(s)\ninput\n3+2+1\noutput\n1+2+3\ninput\n1+1+3+1+3\noutput\n1+1+1+3+3\ninput\n2\noutput\n2\n*/\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main () {\n\tvar (\n\t\tstr string\n\t\tints = make([]int, 0, 5)\n\t)\n\tfmt.Scanf(\"%s\", &str)\n\tfor _, rune := range str {\n\t\tswitch rune {\n\t\tcase '1':\n\t\t\tints = append(ints, 1)\n\t\tcase '2':\n\t\t\tints = append(ints, 2)\n\t\tcase '3':\n\t\t\tints = append(ints, 3)\n\t\t}\n\t}\n\tsort.Ints(ints)\n\tvar result string\n\tend := len(ints) - 1\n\tfor i, v := range ints {\n\t\tresult += fmt.Sprintf(\"%d\", v)\n\t\tif i != end {\n\t\t\tresult += \"+\"\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n"}, {"source_code": "package main \n\nimport(\n\t\"fmt\"\n\n)\n\nfunc main(){\n\tvar s string\n\n\tvar a [5]int\n\n\tfmt.Scan(&s)\n\n\tn := len(s)\n\tfor i:= 0 ; i < n ; i ++ {\n\t\tif s[i] != '+' {\n\t\t//\tfmt.Println(int(s[i]) - int('0')) \n\t\t\ta[int(s[i]) - int('0')] ++ \n\t\t}\t\n\t} \n\n\tvar notFirst bool\n\tsol := \"\"\n\tfor i := 1 ; i <= 3 ; i ++ {\n\t\tfor j := 0 ; j < a[i] ; j ++ {\n\t\t\tif notFirst {\n\t\t\t\tsol = sol + \"+\"\n\t\t\t}\n\n\t\t\tnotFirst = true\n\t\t//\tfmt.Println(string(i+int('0')))\n\t\t\tsol = sol + string(i+int('0'))\n\t\t}\n\t}\n\n\tfmt.Printf(\"%s\",sol)\n}"}, {"source_code": "package main\n\nimport ( \n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\n\nfunc main() {\t\n\tvar str string\n\tfmt.Scanln(&str)\n\n\tnum := strings.Split(str, \"+\")\n\tsort.Strings(num)\n\tfmt.Println(strings.Join(num, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\ntype rawnums []string\n\nfunc (a rawnums) Len() int { return len(a) }\nfunc (a rawnums) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a rawnums) Less(i, j int) bool { return a[i] < a[j] }\n\nfunc main() {\n\n\tvar s string\n\tfmt.Scan(&s)\n\tnums := strings.Split(s, \"+\")\n\tsort.Sort(rawnums(nums))\n\tfmt.Println(strings.Join(nums, \"+\"))\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar s string\n\tfmt.Scan(&s)\n\tnums := strings.Split(s, \"+\")\n\tsort.Strings(nums)\n\tfmt.Println(strings.Join(nums, \"+\"))\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tslice := strings.Split(s, \"+\")\n\tsort.Strings(slice)\n\tstr := strings.Join(slice, \"+\")\n\tfmt.Println(str)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar arr []int\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] >= '1' && s[i] <= '3' {\n\t\t\tn, _ := strconv.Atoi(string(s[i]))\n\t\t\tarr = append(arr, n)\n\t\t}\n\t}\n\tsort.Ints(arr)\n\tfor i := 0; i < len(arr)-1; i++ {\n\t\tfmt.Print(arr[i])\n\t\tfmt.Print(\"+\")\n\t}\n\tfmt.Print(arr[len(arr)-1])\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n var a [105]int\n fmt.Scan(&s)\n n := 0\n for i := 0; i < len(s); i += 2 {\n a[n] = int(s[i])\n n++\n }\n for i := n-1; i > 0; i-- {\n m := i\n for j := 0; j < i; j++ {\n if a[j] > a[m] { m = j }\n }\n a[m], a[i] = a[i], a[m]\n }\n for i := 0; i < n; i++ {\n fmt.Print(string(a[i]))\n if (i == (n-1)) { fmt.Println() } else { fmt.Print(\"+\") }\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar a, b, c int\n\t// ans := make(map[int]int)\n\tfor _, x := range s {\n\t\tif x == '1' {\n\t\t\ta++\n\t\t\t// ans[1]++\n\t\t} else if x == '2' {\n\t\t\tb++\n\t\t\t// ans[2]++\n\t\t} else if x == '3' {\n\t\t\tc++\n\t\t\t// ans[3]++\n\t\t}\n\t}\n\t// fmt.Println(len(ans))\n\tfor a+b+c > 0 {\n\t\t// fmt.Println(a + b + c)\n\t\tif a > 0 {\n\t\t\tfmt.Print(1)\n\t\t\ta--\n\t\t} else if b > 0 {\n\t\t\tfmt.Print(2)\n\t\t\tb--\n\t\t} else if c > 0 {\n\t\t\tfmt.Print(3)\n\t\t\tc--\n\t\t}\n\t\tif a+b+c > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar p string\n\tfmt.Scanf(\"%s\\n\", &p)\n\n\tnumbers := make([]int, 0)\n\n\tfor i := 0; i < len(p); i++ {\n\t\tif p[i] != '+' {\n\t\t\tn, _ := strconv.Atoi(string(p[i]))\n\t\t\tnumbers = append(numbers, n)\n\t\t}\n\t}\n\tsort.Ints(numbers)\n\tfmt.Print(numbers[0])\n\tfor i := 1; i < len(numbers); i++ {\n\t\tfmt.Print(\"+\" + strconv.Itoa(numbers[i]))\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n _\"strconv\"\n \"sort\"\n)\n\nfunc main() {\n var a string\n var b string\n fmt.Scanln(&a)\n strArray := strings.Split(a, \"+\")\n sort.Strings(strArray)\n len := len(strArray)\n for i:=0; i < len -1; i++ {\n b += strArray[i]\n b += \"+\"\n }\n b += strArray[len - 1]\n fmt.Println(b)\n}"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n )\n\nfunc main() {\n var line string\n fmt.Scan(&line)\n\n var count = [4]int{0}\n for i := 0; i < len(line); i++ {\n if line[i] != '+' {\n count[line[i] - '0']++\n }\n }\n\n var result string = \"\"\n for i := 1; i <= 3; i++ {\n for j := 0; j < count[i]; j++ {\n result += string(i + '0')\n result += \"+\"\n }\n }\n\n result = result[:len(result) - 1]\n fmt.Println(result)\n}\n"}, {"source_code": "// URL: http://codeforces.com/problemset/problem/339/A\n// ~ Basic Implementation Problem\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader, writer := bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\tstringArray := strings.Split(s, \"+\")\n\tsort.Strings(stringArray)\n\tfmt.Fprintf(writer, \"%s\\n\", strings.Join(stringArray, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n \"sort\"\n)\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n sArr := strings.Split(s, \"+\")\n sort.Strings(sArr)\n fmt.Println(strings.Join(sArr, \"+\")) \n}"}, {"source_code": "// olymp\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tdigs := strings.Split(s, \"+\")\n\tsort.StringSlice(digs).Sort()\n\tfmt.Println(strings.Join(digs, \"+\"))\n}\n"}, {"source_code": "// olymp\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc merge(l, r []int) []int {\n\tvar ret []int\n\tvar i, j int\n\tfor i, j = 0, 0; i < len(l) && j < len(r); {\n\t\tif l[i] < r[j] {\n\t\t\tret = append(ret, l[i])\n\t\t\ti++\n\t\t} else {\n\t\t\tret = append(ret, r[j])\n\t\t\tj++\n\t\t}\n\t}\n\tif i < len(l) {\n\t\tret = append(ret, l[i:]...)\n\t}\n\tif j < len(r) {\n\t\tret = append(ret, r[j:]...)\n\t}\n\treturn ret\n}\n\nfunc sort(ls []int) []int {\n\tif len(ls) < 2 {\n\t\treturn ls\n\t}\n\tn := len(ls)\n\tm := n / 2\n\treturn merge(sort(ls[:m]), sort(ls[m:]))\n}\n\nfunc smap(ls []int, f func(int) string) []string {\n\tvar ret []string\n\tfor _, v := range ls {\n\t\tret = append(ret, f(v))\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tvar ls []int\n\tls = append(ls, x)\n\tfor {\n\t\tn, err := fmt.Scanf(\"%d\", &x)\n\t\tif n == 0 || err != nil {\n\t\t\tbreak\n\t\t}\n\t\tls = append(ls, x)\n\t}\n\tfmt.Println(strings.Join(smap(sort(ls), strconv.Itoa), \"+\"))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar c byte\n\tvar s string\n\tvar count [3]int\n\tfor {\n\t\tfmt.Scanf(\"%c\", &c)\n\t\tif c == '\\n' {\n\t\t\tbreak\n\t\t}\n\t\tswitch c {\n\t\tcase '1':\n\t\t\tcount[0]++\n\t\tcase '2':\n\t\t\tcount[1]++\n\t\tcase '3':\n\t\t\tcount[2]++\n\t\tcase '+':\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor i := count[0]; i > 0; i-- {\n\t\ts = s + \"1+\"\n\t}\n\tfor i := count[1]; i > 0; i-- {\n\t\ts = s + \"2+\"\n\t}\n\tfor i := count[2]; i > 0; i-- {\n\t\ts = s + \"3+\"\n\t}\n\tfmt.Println(s[:len(s)-1])\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tscanner.Scan()\n\tstr := scanner.Text()\n\tval, _ := strconv.Atoi(str)\n\treturn val\n}\n\nfunc nextFloat() float64 {\n\tscanner.Scan()\n\tstr := scanner.Text()\n\tval, _ := strconv.ParseFloat(str, 64)\n\treturn val\n}\n\nfunc nextString() string {\n\tscanner.Scan()\n\tstr := scanner.Text()\n\treturn str\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tstr := nextString()\n\tcnt := make(map[rune]int)\n\tfor _, c := range str {\n\t\tif c != '+' {\n\t\t\tcnt[c]++\n\t\t}\n\t}\n\tfor i := 0; i < (len(str)+1)/2; i++ {\n\t\tif i != 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tswitch {\n\t\tcase cnt['1'] > 0:\n\t\t\tfmt.Print(\"1\")\n\t\t\tcnt['1']--\n\n\t\tcase cnt['2'] > 0:\n\t\t\tfmt.Print(\"2\")\n\t\t\tcnt['2']--\n\n\t\tcase cnt['3'] > 0:\n\t\t\tfmt.Print(\"3\")\n\t\t\tcnt['3']--\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tvar arr = make([]int, 4)\n\tfor i := 1; i <= 3; i++ {\n\t\tarr[i] = strings.Count(str, string(rune(i+48)))\n\t}\n\n\tvar ret = make([]string, 0)\n\tfor i := 1; i <= 3; i++ {\n\t\tfor j := 1; j <= arr[i]; j++ {\n\t\t\tret = append(ret, string(rune(i+48)))\n\t\t}\n\t}\n\n\tfmt.Println(strings.Join(ret, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n \"strings\"\n \"sort\"\n)\n\nfunc main() {\n\tA:=\"\"\n _, err := fmt.Scanf(\"%s\", &A)\n b:=strings.Split(A,\"+\")\n\n\n\tif err !=nil{\n\t\tlog.Fatal(err)\n }\n sort.Strings(b)\n A=b[0]\n for x:=1; x 0 && n2 > 0 {\n\t\tbuffer.WriteRune('+')\n\t}\n\tfor i := 0; i < n2; i++ {\n\t\tbuffer.WriteRune('2')\n\t\tif i != n2-1 {\n\t\t\tbuffer.WriteByte('+')\n\t\t}\n\t}\n\tif n2 > 0 && n3 > 0 || n1 > 0 && n3 > 0 {\n\t\tbuffer.WriteRune('+')\n\t}\n\tfor i := 0; i < n3; i++ {\n\t\tbuffer.WriteRune('3')\n\t\tif i != n3-1 {\n\t\t\tbuffer.WriteByte('+')\n\t\t}\n\t}\n\tfmt.Print(buffer.String())\n}\n"}, {"source_code": "// https://codeforces.com/problemset/problem/339/A\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar problem string\n\tfmt.Scanf(\"%v\\n\", &problem)\n\tnumbers := strings.Split(problem, \"+\")\n\tsort.Slice(numbers, func(i, j int) bool {\n\t\treturn numbers[i] < numbers[j]\n\t})\n\tfmt.Printf(\"%v\", strings.Join(numbers, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc main() {\n var s string\n var ar [3]int\n fmt.Scanf(\"%s\", &s)\n for i:=0; i < len(s) ; i=i+2 {\n switch(s[i]) {\n case '1':\n ar[0]++\n break\n case '2':\n ar[1]++\n break\n case '3':\n ar[2]++\n break\n }\n }\n\n sum := \"\"\n for i:=0; i < 3; i++ {\n for j:=0; j < ar[i]; j++ {\n if len(sum) == 0 {\n sum += strconv.Itoa(i+1)\n } else {\n sum += \"+\" \n sum += strconv.Itoa(i+1)\n }\n }\n }\n\n fmt.Println(sum)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tnums := strings.Split(s, \"+\")\n\tif sort.StringsAreSorted(nums) {\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tsort.Strings(nums)\n\tfmt.Println(strings.Join(nums, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"sort\"\nimport \"strings\"\nimport \"strconv\"\n\nfunc main() {\n var result string\n var equation string\n var equation_variables []int\n fmt.Scanf(\"%s\", &equation)\n\n for _, element := range strings.Split(equation, \"+\") {\n number, _ := strconv.Atoi(element)\n equation_variables = append(equation_variables, number)\n }\n\n sort.Sort(sort.IntSlice(equation_variables))\n\n for _, element := range equation_variables {\n result = result + strconv.Itoa(element) + \"+\"\n }\n\n fmt.Println(strings.TrimSuffix(result, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tsummands := strings.Split(s, \"+\")\n\tsort.Strings(summands)\n\tfmt.Println(strings.Join(summands, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\ts1 := strings.Builder{}\n\ts2 := strings.Builder{}\n\ts3 := strings.Builder{}\n\ts1.Grow(100)\n\ts2.Grow(100)\n\ts3.Grow(100)\n\tinput := \"\"\n\tfmt.Scanf(\"%s\\n\", &input)\n\tfor _, c := range input {\n\t\tswitch c {\n\t\tcase '1':\n\t\t\ts1.WriteString(\"1+\")\n\t\tcase '2':\n\t\t\ts2.WriteString(\"2+\")\n\t\tcase '3':\n\t\t\ts3.WriteString(\"3+\")\n\t\t}\n\t}\n\tans := s1.String() + s2.String() + s3.String()\n\tfmt.Println(ans[:len(ans)-1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\n\tscanner.Scan()\n\tsum := scanner.Text()\n\n\tparts := strings.Split(sum, \"+\")\n\tsort.Strings(parts)\n\n\tfmt.Println(strings.Join(parts, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\ts1 := strings.Builder{}\n\ts2 := strings.Builder{}\n\ts3 := strings.Builder{}\n\ts1.Grow(100)\n\ts2.Grow(100)\n\ts3.Grow(100)\n\tinput := \"\"\n\tfmt.Scanf(\"%s\\n\", &input)\n\tfor _, c := range input {\n\t\tswitch c {\n\t\tcase '1':\n\t\t\ts1.WriteString(\"1+\")\n\t\tcase '2':\n\t\t\ts2.WriteString(\"2+\")\n\t\tcase '3':\n\t\t\ts3.WriteString(\"3+\")\n\t\t}\n\t}\n\tout := strings.Builder{}\n\tout.Grow(3 * 100)\n\tout.WriteString(s1.String())\n\tout.WriteString(s2.String())\n\tout.WriteString(s3.String())\n\tans := out.String()\n\tfmt.Println(ans[:len(ans)-1])\n\t//ans := s1.String() + s2.String() + s3.String()\n\t//fmt.Println(ans[:len(ans)-1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tfields := strings.Split(s, \"+\")\n\tsort.Sort(sort.StringSlice(fields))\n\tfmt.Println(strings.Join(fields, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tcnt := []int{0, 0, 0}\n\tvar b []byte\n\tfmt.Scan(&b)\n\tfor i := len(b) - 1; i >= 0; i -= 2 {\n\t\tcnt[b[i]-'1']++\n\t}\n\ti, c := 0, byte('1')\n\tfor _, n := range cnt {\n\t\tfor ; n > 0; n-- {\n\t\t\tb[i] = c\n\t\t\ti += 2\n\t\t}\n\t\tc++\n\t}\n\tfmt.Println(string(b))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar istring string\n\t_, _ = fmt.Scanln(&istring)\n\txstring := strings.Split(istring, \"+\")\n\tvar numArray []int\n\tfor i := 0; i < len(xstring); i++ {\n\t\tinumber, _ := strconv.Atoi(xstring[i])\n\t\tnumArray = append(numArray, inumber)\n\t}\n\tsort.Ints(numArray)\n\tfor i := 0; i < len(numArray); i++ {\n\t\tif i == len(numArray)-1 {\n\t\t\tfmt.Print(numArray[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d+\", numArray[i])\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n var a [105]int\n fmt.Scan(&s)\n n := 0\n for i := 0; i < len(s); i += 2 {\n a[n] = int(s[i])\n n++\n }\n for i := n-1; i > 0; i-- {\n m := i\n for j := 0; j < i; j++ {\n if a[j] > a[m] { m = j }\n }\n a[m], a[i] = a[i], a[m]\n }\n for i := 0; i < n; i++ {\n fmt.Print(string(a[i]))\n if (i == (n-1)) { fmt.Println() } else { fmt.Print(\"+\") }\n }\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar line string\n\t_, _ = fmt.Scan(&line)\n\n\tsummands := strings.Split(line, \"+\")\n\n\tvar n1s, n2s, n3s int\n\tfor _, summand := range summands {\n\t\tif summand == \"1\" {\n\t\t\tn1s++\n\t\t} else if summand == \"2\" {\n\t\t\tn2s++\n\t\t} else if summand == \"3\" {\n\t\t\tn3s++\n\t\t}\n\t}\n\n\tfor i := 0; i < n1s; i++ {\n\t\tsummands[i] = \"1\"\n\t}\n\tfor i := 0; i < n2s; i++ {\n\t\tsummands[n1s+i] = \"2\"\n\t}\n\tfor i := 0; i < n3s; i++ {\n\t\tsummands[n1s+n2s+i] = \"3\"\n\t}\n\n\tfmt.Print(strings.Join(summands, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar hashArray [3]int\n\tvar input string\n\tfmt.Scanln(&input)\n\tnumbers := strings.Split(input, \"+\")\n\tfor i := 0; i < len(numbers); i++ {\n\t\tif num, err := strconv.Atoi(numbers[i]); err == nil {\n\t\t\thashArray[num-1]++\n\t\t}\n\t}\n\tvar output bytes.Buffer\n\tfor index := 0; index < 3; index++ {\n\t\tfor i := 0; i < hashArray[index]; i++ {\n\t\t\toutput.WriteString(strconv.Itoa(index + 1))\n\t\t\toutput.WriteString(\"+\")\n\t\t}\n\t}\n\tfmt.Print(strings.TrimRight(output.String(), \"+\"))\n}\n"}, {"source_code": "package main\nimport \"fmt\"\nimport \"strings\"\n\n\nfunc main() {\n var input string\n fmt.Scan(&input)\n var output string\n\n\n rakams := strings.Split(input,\"+\")\n numof1 := 0\n numof2 := 0\n numof3 := 0\n\n for i := range rakams {\n if rakams[i] == \"1\" {\n numof1 += 1\n }else if rakams[i] == \"2\" {\n numof2 += 1\n }else if rakams[i] == \"3\" {\n numof3 += 1\n }\n }\n for i := 0; i < numof1; i++ {\n output += \"1+\"\n }\n for i := 0; i < numof2; i++ {\n output += \"2+\"\n }\n for i := 0; i < numof3; i++ {\n output += \"3+\"\n }\n output = output[:len(output)-1]\n fmt.Println(output)\n\n\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tcounts := make([]string, 3)\n\tfor _, key := range scanner.Text() {\n\t\tif key == '+' {\n\t\t\tcontinue\n\t\t}\n\t\tcounts[key - '0' - 1] += string(key) + \"+\"\n\t}\n\n\tvar str string\n\tfor _, s := range counts {\n\t\tstr += s\n\t}\n\n\tfmt.Println(str[:len(str) - 1])\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar line string\n\t_, _ = fmt.Scan(&line)\n\n\tsummands := strings.Split(line, \"+\")\n\n\tsort.Strings(summands)\n\tfmt.Print(strings.Join(summands, \"+\"))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n defer s.Flush()\n\n\tsp := strings.Split(s.NextLine(), \"+\")\n\tsort.Strings(sp)\n\ts.Println(strings.Join(sp, \"+\"))\n}\n\nvar (\n\ts *InOut\n)\n\nfunc init() {\n\ts = NewInOut(os.Stdin, os.Stdout)\n}\n\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\nfunc (s *InOut) NextInt64() (r int64) {\n\tb, _ := s.ReadByte()\n\tp := int64(1)\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int64(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\r' || b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\r' && b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n\treturn string(s.NextBytes())\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextBytes() (r []byte) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\r' || b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\r' && b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn buf\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n"}, {"source_code": "package main\n\nimport(\n \"fmt\"\n \"sort\"\n)\n\nfunc main(){\n var(\n s string\n arr = []int{}\n )\n fmt.Scan(&s)\n for i:=0;i 0; i-- {\n m := i\n for j := 0; j < i; j++ {\n if a[j] > a[m] { m = j }\n }\n a[m], a[i] = a[i], a[m]\n }\n for i := 0; i < n; i++ {\n fmt.Print(string(a[i]))\n if (i == (n-1)) { fmt.Println() } else { fmt.Print(\"+\") }\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"bytes\"\nimport \"io/ioutil\"\nimport \"os\"\n\nfunc task_solution(line []byte) string {\n\tcount := []int{0, 0, 0}\n\tfor _, b := range line {\n\t\tif b != '+' {\n\t\t\tcount[b-'1'] += 1\n\t\t}\n\t}\n\t// slices do not copy\n\t// this may corrupt input data\n\t// but noone cares\n\tans := line\n\tfor i, curr := 0, 0; i < len(count); i += 1 {\n\t\tj := 0\n\t\tif curr == 0 && count[i] > 0 {\n\t\t\tans[curr] = byte(i) + '1'\n\t\t\tcurr = 1\n\t\t\tj = 1\n\t\t}\n\t\tfor ; j < count[i]; j += 1 {\n\t\t\tans[curr] = '+'\n\t\t\tans[curr+1] = byte(i) + '1'\n\t\t\tcurr += 2\n\t\t}\n\t}\n\n\treturn string(ans)\n}\n\nfunc main() {\n\tin_raw, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(task_solution(bytes.TrimSpace(in_raw)))\n}\n"}, {"source_code": "// Author: sighduck\n// URL: https://codeforces.com/problemset/problem/339/A\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc Solve(s string) string {\n\tnumbers := strings.Split(s, \"+\")\n\tsort.Strings(numbers)\n\treturn strings.Join(numbers, \"+\")\n}\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tdefer writer.Flush()\n\n\tvar s string\n\tfmt.Fscanf(reader, \"%s\\n\", &s)\n\n\tfmt.Fprintf(writer, \"%s\\n\", Solve(s))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc swap(s []rune, i, j int) {\n\tif i < 0 || j < 0 {\n\t\treturn\n\t}\n\tif s[i] < s[j] {\n\t\tt := s[i]\n\t\ts[i] = s[j]\n\t\ts[j] = t\n\t\tswap(s, i-2, j-2)\n\t}\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tres := []rune(s)\n\tfor i := 2; i < len(res); i += 2 {\n\t\tswap(res, i, i-2)\n\t}\n\tfmt.Println(string(res))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar experssion string\n\tfmt.Scan(&experssion)\n\n\texperssionInArray := strings.Split(string(experssion), \"+\")\t\t\n\tsort.Slice(experssionInArray, func(i, j int) bool {\n numA := experssionInArray[i]\n numB := experssionInArray[j]\n return numA < numB\n\t})\n\tfmt.Print(strings.Join(experssionInArray, \"+\"))\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar a [4]int\n\tfor _, si := range strings.Split(s, \"+\") {\n\t\tnum, _ := strconv.Atoi(si)\n\t\ta[num]++\n\t}\n\tvar head = true\n\tfor i := 1; i <= 3; i++ {\n\t\tfor j := 0; j < a[i]; j++ {\n\t\t\tif !head {\n\t\t\t\tfmt.Print(\"+\")\n\t\t\t}\n\t\t\thead = false\n\t\t\tfmt.Print(i)\n\t\t}\n\t}\n\tfmt.Println()\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\ttext := strings.Split(input, \"+\")\n\tresult := make(map[string]int)\n\tresult[\"1\"] = 0\n\tresult[\"2\"] = 0\n\tresult[\"3\"] = 0\n\tresultString := \"\"\n\tfor _, val := range text {\n\t\tval := strings.Trim(val, \"\\n\")\n\t\tif strings.Contains(val, \"1\") {\n\t\t\tresult[\"1\"]++\n\t\t}\n\t\tif strings.Contains(val, \"2\") {\n\t\t\tresult[\"2\"]++\n\t\t}\n\t\tif strings.Contains(val, \"3\") {\n\t\t\tresult[\"3\"]++\n\t\t}\n\t}\n\tif result[\"1\"] > 0 {\n\t\tfor i := 0; i< result[\"1\"]; i++ {\n\t\t\tif i != result[\"1\"]-1 {\n\t\t\t\tresultString += \"1+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"1\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"2\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"2\"]; i++ {\n\t\t\tif i != result[\"2\"]-1 {\n\t\t\t\tresultString += \"2+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"2\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"3\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"3\"]; i++ {\n\t\t\tif i != result[\"3\"]-1 {\n\t\t\t\tresultString += \"3+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"3\"\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(resultString)\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// digits can only be {1,2,3}\n\t// input is <= 100 characters\n\t// no spaces\n\t// digit and/or plus sign\n\t// could be a single character(digit)\n\n\t// if we use sorting in stdlib, then parse by \"+\", sort, and join with \"+\"\n\n\t// if we implement sorting, a good constraint is that numbers are {1,2,3}.\n\n\t// count 1, 2 and 3 digits in a map(nah just variables)\n\t// create a string with \"+\" between each counted digit if sum of count > 1\n\t// else just print\n\n\tequation := \"\"\n\tfmt.Scan(&equation)\n\n\tone := 0\n\ttwo := 0\n\tthree := 0\n\n\tfor _, c := range equation {\n\t\tswitch c {\n\t\tcase '1':\n\t\t\tone++\n\t\tcase '2':\n\t\t\ttwo++\n\t\tcase '3':\n\t\t\tthree++\n\t\t}\n\t}\n\n\tif one+two+three <= 1 {\n\t\tfmt.Println(equation)\n\t} else {\n\t\tresult := \"\"\n\t\tresult = appendNumber(result, one, 1)\n\t\tresult = appendNumber(result, two, 2)\n\t\tresult = appendNumber(result, three, 3)\n\t\tresult = result[:len(result)-1]\n\t\tfmt.Println(result)\n\t}\n}\n\nfunc appendNumber(result string, count, num int) string {\n\tfor count > 0 {\n\t\tresult += fmt.Sprintf(\"%d+\", num)\n\t\tcount--\n\t}\n\treturn result\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanln(&s)\n\tstrArray := strings.Split(s, \"+\")\n\tsort.Strings(strArray)\n\tfmt.Println(strings.Join(strArray, \"+\"))\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc sol(s string) string {\n\tnums := strings.Split(s, \"+\")\n\tsort.Strings(nums)\n\treturn strings.Join(nums, \"+\")\n}\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ts := scanner.Text()\n\tfmt.Print(sol(s))\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n a := strings.Count(s,\"1\")\n b := strings.Count(s,\"2\")\n c := strings.Count(s,\"3\")\n if (a==1 && b==0 && c==0) || (a==0 && b==1 && c==0) || (a==0 && b==0 && c==1) {\n fmt.Print(s)\n } else {\n for i := 0; i < a; i++ {\n fmt.Print(\"1\")\n if i!=a-1 || (b!=0 || c!=0) {\n fmt.Print(\"+\")\n }\n }\n for i := 0; i < b; i++ {\n fmt.Print(\"2\")\n if i!=b-1 || c!=0 {\n fmt.Print(\"+\")\n }\n }\n for i := 0; i < c; i++ {\n fmt.Print(\"3\")\n if i!=c-1 {\n fmt.Print(\"+\")\n }\n }\n }\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc sort(a []int) {\n\tl := len(a)\n\tlo := 0\n\thi := l - 1\n\th := hi\n\tfor i := 0; i < l; i++ {\n\t\tfor j := lo; j < hi; j++ {\n\t\t\tif a[j] > a[j+1] {\n\t\t\t\ta[j], a[j+1] = a[j+1], a[j]\n\t\t\t\th = j + 1\n\t\t\t}\n\t\t}\n\t\thi = h\n\t}\n\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tnums := make([]int, 0, 50)\n\tfor i := 0; i < len(str); i++ {\n\t\tif str[i] == '+' {\n\t\t\tcontinue\n\t\t}\n\t\tnums = append(nums, int(str[i]-48))\n\t}\n\n\tsort(nums)\n\tl := len(nums)\n\tfor i, n := range nums {\n\t\tfmt.Print(n)\n\t\tif i < l-1 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n//import \"strings\"\nimport \"os\";\n//import \"math\"\nimport \"strconv\"\nimport \"sort\"\n\n\nfunc main() {\n\t\t\n\tvar d string;\n\n\tfmt.Scan(&d);\n\n\tif(len(d) == 1) {\n\t\tfmt.Println(d);\n\t\tos.Exit(0);\n\t}\n\n\tvar a []int\n\n\tfor i := 0; i < len(d); i++ {\n\t\tif( d[i] >= '0' && d[i] <= '9' ) {\n\n\t\t\tkek, _ := strconv.Atoi(string(d[i]));\n\n\t\t\ta = append(a, kek);\n\t\t}\n\t}\n\n\tsort.Ints(a);\n\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Print(a[i]);\n\t\tif(i != len(a) - 1){\n\t\t\tfmt.Print(\"+\");\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*8 5\n10 9 8 7 7 7 5 5*/\nfunc main() {\n\tvar sum string\n\tfmt.Scanf(\"%s\\n\", &sum)\n\tarr := make([]int, 0)\n\tfor _, s := range strings.Split(sum, \"+\") {\n\t\tn, _ := strconv.Atoi(s)\n\t\tarr = append(arr, n)\n\t}\n\tl, h := 0, len(arr)-1\n\tqsort(arr, l, h)\n\tres := strings.Builder{}\n\tfor i, a := range arr {\n\t\tif i == h {\n\t\t\tres.WriteString(strconv.Itoa(a))\n\t\t\tbreak\n\t\t}\n\t\tres.WriteString(strconv.Itoa(a) + \"+\")\n\t}\n\n\tfmt.Println(res.String())\n\n}\n\nfunc qsort(v []int, l, h int) {\n\tif h-l < 1 {\n\t\treturn\n\t}\n\tpivot := v[h]\n\tlast := l\n\tfor i := l; i < h; i++ {\n\t\tif v[i] <= pivot {\n\t\t\tv[i], v[last] = v[last], v[i]\n\t\t\tlast++\n\t\t}\n\t}\n\tv[h], v[last] = v[last], pivot\n\tqsort(v, l, last-1)\n\tqsort(v, last+1, h)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar source string\n\tfmt.Scan(&source)\n\tones := strings.Count(source, \"1\")\n\ttwos := strings.Count(source, \"2\")\n\tthre := strings.Count(source, \"3\")\n\tswitch {\n\tcase ones != 0:\n\t\tfmt.Print(1)\n\t\tones--\n\tcase twos != 0:\n\t\tfmt.Print(2)\n\t\ttwos--\n\tcase thre != 0:\n\t\tfmt.Print(3)\n\t\tthre--\n\t}\n\tfor i := 0; i < ones; i++ {\n\t\tfmt.Printf(\"+%d\", 1)\n\t}\n\tfor i := 0; i < twos; i++ {\n\t\tfmt.Printf(\"+%d\", 2)\n\t}\n\tfor i := 0; i < thre; i++ {\n\t\tfmt.Printf(\"+%d\", 3)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var s string\n var a [105]int\n fmt.Scan(&s)\n n := 0\n for i := 0; i < len(s); i += 2 {\n a[n] = int(s[i])\n n++\n }\n for i := n-1; i > 0; i-- {\n m := i\n for j := 0; j < i; j++ {\n if a[j] > a[m] { m = j }\n }\n a[m], a[i] = a[i], a[m]\n }\n for i := 0; i < n; i++ {\n fmt.Print(string(a[i]))\n if (i == (n-1)) { fmt.Println() } else { fmt.Print(\"+\") }\n }\n}\n"}, {"source_code": "package main\n\nimport(\n\t\"fmt\";\n\t\"sort\"\n)\n\nfunc main(){\n\tvar(\n\t\ts string\n\t\ta []int\n\t)\n\n\tfmt.Scan(&s);\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] != '+' {\n\t\t\ta = append(a, (int)(s[i]-'0'));\n\t\t}\n\t}\n\n\tsort.Ints(a);\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Print(a[i]);\n\t\tif i != len(a)-1 {\n\t\t\tfmt.Print(\"+\");\n\t\t}\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar input string\n\tfmt.Scan(&input)\n\tnumbers := strings.Split(input, \"+\")\n\tsort.Strings(numbers)\n\t// fmt.Println(numbers)\n\tfor i := 0; i < len(numbers)-1; i++ {\n\t\tfmt.Print(numbers[i] + \"+\")\n\t}\n\tfmt.Println(numbers[len(numbers)-1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"strings\"\n\t\"strconv\"\n\t\"os\"\n\t\"sort\"\n\t\"fmt\"\n)\n\ntype input struct {\n\ta []int\n}\n\n\n\nfunc (c *input)Read(scanner *bufio.Scanner) {\n\tfor scanner.Scan() {\n\t\tfor _, str := range strings.Split(scanner.Text(), \"+\") {\n\t\t\tnum, _ := strconv.Atoi(str)\n\t\t\tc.a = append(c.a, num)\n\t\t}\n\t\treturn\n\t}\n}\n\n\nfunc main() {\n\tvar inp input\n\tsc := bufio.NewScanner(os.Stdin)\n\tinp.Read(sc)\n\tsort.Ints(inp.a)\n\tvar str string\n\tfor i, a := range inp.a {\n\t\tif i+1 == len(inp.a) {\n\t\t\tstr = str + fmt.Sprint(a)\n\t\t} else {\n\t\t\tstr = str + fmt.Sprint(a, \"+\")\n\t\t}\n\t}\n\tfmt.Println(str)\n}\n\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1024 * 1024)\n\tout := strings.Split(readLine(reader), \"+\")\n\tsorted := sort.StringSlice(out)\n\tsorted.Sort()\n\tfmt.Println(strings.Join(sorted, \"+\"))\n}\n\nfunc readLine(reader *bufio.Reader) string {\n\tstr, _, err := reader.ReadLine()\n\tif err == io.EOF {\n\t\treturn \"\"\n\t}\n\n\treturn strings.TrimRight(string(str), \"\\r\\n\")\n}\n\nfunc checkError(err error) {\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst MAX = 3\n\nfunc Sort(A []int, N int) []int {\n\tq := len(A) / N\n\tr := len(A) % N\n\tsplits := make([][]int, N)\n\tpos := 0\n\tfor i := 0; i < N; i++ {\n\t\tvar delta int\n\t\tif i < r {\n\t\t\tdelta = q + 1;\n\t\t} else {\n\t\t\tdelta = q;\n\t\t}\n\t\tsplits[i] = A[pos : pos + delta]\n\t\tpos += delta\n\t}\n\twaitGroup := new(sync.WaitGroup)\n\tfor i := 0; i < N; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func(B []int) {\n\t\t\tsort.Ints(B)\n\t\t\twaitGroup.Done()\n\t\t}(splits[i])\n\t}\n\twaitGroup.Wait()\n\tB := make([]int, 0);\n\tnext := make([]int, N)\n\tfor len(B) < len(A) {\n\t\tidx := -1\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif next[i] < len(splits[i]) && (idx == -1 || splits[i][next[i]] < splits[idx][next[idx]]) {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\t\tB = append(B, splits[idx][next[idx]])\n\t\tnext[idx]++\n\t}\n\treturn B\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tdigits := strings.Split(input, \"+\")\n\tints := make([]int, 0)\n\tfor i := 0; i < len(digits); i++ {\n\t\tints = append(ints, int(digits[i][0]) - '0')\n\t}\n\tN := rand.Intn(len(ints)) + 1\n\tints = Sort(ints, N)\n\tfor i := 0; i < len(ints); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(ints[i])\n\t}\n\tfmt.Println()\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"math/rand\"\n\t\"sort\"\n\t\"sync\"\n)\n\nconst MAX = 3\n\nfunc Sort(A []int) []int {\n\tN := rand.Intn(len(A)) + 1\n\tq := len(A) / N\n\tr := len(A) % N\n\tsplits := make([][]int, N)\n\tpos := 0\n\tfor i := 0; i < N; i++ {\n\t\tvar delta int\n\t\tif i < r {\n\t\t\tdelta = q + 1;\n\t\t} else {\n\t\t\tdelta = q;\n\t\t}\n\t\tsplits[i] = A[pos : pos + delta]\n\t\tpos += delta\n\t}\n\twaitGroup := new(sync.WaitGroup)\n\tfor i := 0; i < N; i++ {\n\t\twaitGroup.Add(1)\n\t\tgo func(B []int) {\n\t\t\tsort.Ints(B)\n\t\t\twaitGroup.Done()\n\t\t}(splits[i])\n\t}\n\twaitGroup.Wait()\n\tB := make([]int, 0);\n\tnext := make([]int, N)\n\tfor len(B) < len(A) {\n\t\tidx := -1\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif next[i] < len(splits[i]) && (idx == -1 || splits[i][next[i]] < splits[idx][next[idx]]) {\n\t\t\t\tidx = i\n\t\t\t}\n\t\t}\n\t\tB = append(B, splits[idx][next[idx]])\n\t\tnext[idx]++\n\t}\n\treturn B\n}\n\nfunc main() {\n\tvar input string\n\tfmt.Scanln(&input)\n\tdigits := strings.Split(input, \"+\")\n\tints := make([]int, 0)\n\tfor i := 0; i < len(digits); i++ {\n\t\tints = append(ints, int(digits[i][0]) - '0')\n\t}\n\tints = Sort(ints)\n\tfor i := 0; i < len(ints); i++ {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(ints[i])\n\t}\n\tfmt.Println()\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\tvar num []int\n\tfor _, v := range strings.Split(str, \"+\") {\n\t\tn, _ := strconv.Atoi(v)\n\t\tnum = append(num, n)\n\t}\n\tsort.Ints(num)\n\tfor i, v := range num {\n\t\tif i > 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfmt.Print(v)\n\t}\n\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar sum string\n\n\tfmt.Scan(&sum)\n\n\toperands := strings.Split(sum, \"+\")\n\t// 1, 2, 3 happen to be in lexicgraphic order\n\tsort.Strings(operands)\n\tfmt.Println(strings.Join(operands, \"+\"))\n\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar input string\n\tfmt.Scan(&input)\n\trecord := make([]int, 3)\n\tfor _, ch := range input {\n\t\tswitch ch{\n\t\tcase '1':\n\t\t\trecord[0] += 1\n\t\tcase '2':\n\t\t\trecord[1] += 1\n\t\tcase '3':\n\t\t\trecord[2] += 1\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor offset, v := range record {\n\t\tif offset != 0 && v != 0{\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfor i := 0; i < v; i++ {\n\t\t\tfmt.Print(offset + 1)\n\t\t\tif i != v-1 {\n\t\t\t\tfmt.Print(\"+\")\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar input string\n\tfmt.Scan(&input)\n\trecord := make([]int, 3)\n\tfor _, ch := range input {\n\t\tswitch ch{\n\t\tcase '1':\n\t\t\trecord[0] += 1\n\t\tcase '2':\n\t\t\trecord[1] += 1\n\t\tcase '3':\n\t\t\trecord[2] += 1\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor offset, v := range record {\n\t\tif offset != 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfor i := 0; i < v; i++ {\n\t\t\tfmt.Print(offset + 1)\n\t\t\tif i != v-1 {\n\t\t\t\tfmt.Print(\"+\")\n\t\t\t}\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar word string\n\tfmt.Scan(&word)\n\n\tvar nums [4]int\n\tfor i := 0; i < len(word); i += 2 {\n\t\tnums[word[i]-'0'] += 1\n\t}\n\n\tfor i := 1; i < 4; i++ {\n\t\tif i != 1 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfor j := 0; j < nums[i]; j++ {\n\t\t\tif j != 0 {\n\t\t\t\tfmt.Print(\"+\")\n\t\t\t}\n\t\t\tfmt.Printf(\"%c\", i+'0')\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar word string\n\tfmt.Scan(&word)\n\n\tvar nums [4]int\n\tfor i := 0; i < len(word); i += 2 {\n\t\tnums[word[i]-'0'] += 1\n\t}\n\n\tfor i := 1; i < 4; i++ {\n\t\tif i != 1 && nums[i] != 0 {\n\t\t\tfmt.Print(\"+\")\n\t\t}\n\t\tfor j := 0; j < nums[i]; j++ {\n\t\t\tif j != 0 {\n\t\t\t\tfmt.Print(\"+\")\n\t\t\t}\n\t\t\tfmt.Printf(\"%c\", i+'0')\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc sortAsc(numbers string) (result string) {\n\tsplitResult := strings.Split(numbers, \"+\")\n\tif len(splitResult) <= 1 {\n\t\tresult = numbers\n\t\treturn\n\t}\n\n\tvar index int\n\tvar isSwap bool\n\tfor {\n\t\tif splitResult[index] > splitResult[index+1] {\n\t\t\ttemp := splitResult[index]\n\t\t\tsplitResult[index] = splitResult[index+1]\n\t\t\tsplitResult[index+1] = temp\n\t\t\tisSwap = true\n\t\t} else {\n\t\t\tisSwap = false\n\t\t}\n\n\t\tindex++\n\t\tif index == len(splitResult)-1 {\n\t\t\tindex = 0\n\t\t\tif !isSwap {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tvar sb strings.Builder\n\tfor i, number := range splitResult {\n\t\tsb.WriteString(number)\n\t\tif i < len(splitResult)-1 {\n\t\t\tsb.WriteString(\"+\")\n\t\t}\n\t}\n\n\treturn sb.String()\n}\n\nfunc main() {\n\n\t// var firstWord, secondWord string\n\tscanner := bufio.NewScanner(os.Stdin)\n\tfor scanner.Scan() {\n\t\tif err := scanner.Err(); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tfmt.Println(sortAsc(scanner.Text()))\n\n\t\t// if firstWord == \"\" {\n\t\t// \tfirstWord = scanner.Text()\n\t\t// \tcontinue\n\t\t// }\n\n\t\t// if secondWord == \"\" {\n\t\t// \tsecondWord = scanner.Text()\n\t\t// \tfmt.Println(compareString(firstWord, secondWord))\n\t\t// \tfirstWord, secondWord = \"\", \"\"\n\t\t// }\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\ttext := strings.Split(input, \"+\")\n\tresult := make(map[string]int)\n\tresult[\"1\"] = 0\n\tresult[\"2\"] = 0\n\tresult[\"3\"] = 0\n\tresultString := \"\"\n\tfor _, val := range text {\n\t\tval := strings.Trim(val, \"\\n\")\n\t\tresult[val]++\n\t}\n\tif result[\"1\"] > 0 {\n\t\tfor i := 0; i< result[\"1\"]; i++ {\n\t\t\tif i != result[\"1\"]-1 {\n\t\t\t\tresultString += \"1+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"1\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"2\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"2\"]; i++ {\n\t\t\tif i != result[\"2\"]-1 {\n\t\t\t\tresultString += \"2+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"2\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"3\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"3\"]; i++ {\n\t\t\tif i != result[\"3\"]-1 {\n\t\t\t\tresultString += \"3+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"3\"\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(resultString)\n}"}, {"source_code": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\tinput, _ := reader.ReadString('\\n')\n\tfmt.Println(input)\n\ttext := strings.Split(input, \"+\")\n\tfmt.Println(text)\n\tresult := make(map[string]int)\n\tresult[\"1\"] = 0\n\tresult[\"2\"] = 0\n\tresult[\"3\"] = 0\n\tresultString := \"\"\n\tfor _, val := range text {\n\t\tval := strings.Trim(val, \"\\n\")\n\t\tresult[val]++\n\t}\n\tif result[\"1\"] > 0 {\n\t\tfor i := 0; i< result[\"1\"]; i++ {\n\t\t\tif i != result[\"1\"]-1 {\n\t\t\t\tresultString += \"1+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"1\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"2\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"2\"]; i++ {\n\t\t\tif i != result[\"2\"]-1 {\n\t\t\t\tresultString += \"2+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"2\"\n\t\t\t}\n\t\t}\n\t}\n\n\tif result[\"3\"] > 0 {\n\t\tif len(resultString) > 0 {\n\t\t\tresultString += \"+\"\n\t\t}\n\t\tfor i := 0; i< result[\"3\"]; i++ {\n\t\t\tif i != result[\"3\"]-1 {\n\t\t\t\tresultString += \"3+\"\n\t\t\t}else {\n\t\t\t\tresultString += \"3\"\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(resultString)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"os\"\n\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n defer s.Flush()\n\n\tsp := strings.Split(s.NextStr(), \"+\")\n\tsort.Strings(sp)\n\ts.Println(strings.Join(sp, \"+\"))\n}\n\nvar (\n\ts *InOut\n)\n\nfunc init() {\n\ts = NewInOut(os.Stdin, os.Stdout)\n}\n\ntype InOut struct {\n\t*bufio.Reader\n\t*bufio.Writer\n}\n\nfunc NewInOut(r io.Reader, w io.Writer) *InOut {\n\treturn &InOut{bufio.NewReader(r), bufio.NewWriter(w)}\n}\n\n// Get Next Integer\nfunc (s *InOut) Next() (r int) {\n\tb, _ := s.ReadByte()\n\tp := 1\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\nfunc (s *InOut) NextInt64() (r int64) {\n\tb, _ := s.ReadByte()\n\tp := int64(1)\n\tfor (b < '0' || '9' < b) && b != '-' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tif b == '-' {\n\t\tp = -1\n\t\tb, _ = s.ReadByte()\n\t}\n\tfor '0' <= b && b <= '9' {\n\t\tr = 10*r + int64(b-'0')\n\t\tb, _ = s.ReadByte()\n\t}\n\treturn r * p\n}\n\n// Get Next Line String\nfunc (s *InOut) NextLine() (r string) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n'; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn string(buf)\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextStr() (r string) {\n return string(s.NextBytes())\n}\n\n// Get Next String using delimiter whitespace\nfunc (s *InOut) NextBytes() (r []byte) {\n\tb, _ := s.ReadByte()\n\tfor b == '\\n' || b == ' ' {\n\t\tb, _ = s.ReadByte()\n\t}\n\tbuf := make([]byte, 0)\n\tfor ; b != '\\n' && b != ' '; b, _ = s.ReadByte() {\n\t\tbuf = append(buf, b)\n\t}\n\treturn buf\n}\n\n// Print Strings using the suitable way to change type\nfunc (s *InOut) Print(os ...interface{}) {\n\tfor _, o := range os {\n\t\tswitch o.(type) {\n\t\tcase byte:\n\t\t\ts.WriteByte(o.(byte))\n\t\tcase string:\n\t\t\ts.WriteString(o.(string))\n\t\tcase int:\n\t\t\ts.WriteString(strconv.Itoa(o.(int)))\n\t\tcase int64:\n\t\t\ts.WriteString(strconv.FormatInt(o.(int64), 10))\n\t\tdefault:\n\t\t\ts.WriteString(fmt.Sprint(o))\n\t\t}\n\t}\n}\n\n// Print Strings using the suitable way to change type with new line\nfunc (s *InOut) Println(os ...interface{}) {\n\tfor _, o := range os {\n\t\ts.Print(o)\n\t}\n\ts.Print(\"\\n\")\n}\n\n// Print immediately with new line (for debug)\nfunc (s *InOut) PrintlnNow(o interface{}) {\n\tfmt.Println(o)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar opr string\n\tfmt.Scanln(&opr)\n\n\ta := strings.Split(opr, \"+\")\n\n\tfor i := 1; i < len(a); i++ {\n\t\tfor j := i; j < len(a) - i + 1; j++ {\n\t\t\tif a[j] < a[j-1] {\n\t\t\t\ttemp := a[j]\n\t\t\t\ta[j] = a[j-1]\n\t\t\t\ta[j-1] = temp\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(strings.Join(a, \"+\"))\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar r = bufio.NewReader(os.Stdin)\nvar w = bufio.NewWriter(os.Stdin)\n\nfunc print(f string, v ...interface{}) { fmt.Fprintf(w, f, v...) }\n\nfunc main() {\n\tdefer w.Flush()\n\ts, _ := r.ReadString('\\n')\n\tt := strings.Split(strings.TrimSpace(s), \"+\")\n\tif len(t) == 1 {\n\t\tprint(t[0])\n\t} else {\n\t\tsort(t)\n\t\tprint(\"%s\", strings.Join(t, \"+\"))\n\t}\n}\n\nfunc sort(a []string) {\n\tif len(a) < 2 {\n\t\treturn\n\t}\n\tmid := len(a) / 2\n\tleft, right := make([]string, mid), make([]string, len(a)-mid)\n\tcopy(left, a[:mid])\n\tcopy(right, a[mid:])\n\tsort(left)\n\tsort(right)\n\tmerge(left, right, a)\n}\n\nfunc merge(l, r, o []string) {\n\tvar i, j, k int\n\tfor ; i < len(l) && j < len(r); k++ {\n\t\tif toNum(l[i]) < toNum(r[j]) {\n\t\t\to[k] = l[i]\n\t\t\ti++\n\t\t} else {\n\t\t\to[k] = r[j]\n\t\t\tj++\n\t\t}\n\t}\n\tfor ; i < len(l); i++ {\n\t\to[k] = l[i]\n\t\tk++\n\t}\n\tfor ; j < len(r); j++ {\n\t\to[k] = r[j]\n\t\tk++\n\t}\n}\n\nfunc toNum(t string) int {\n\to, _ := strconv.Atoi(t)\n\treturn o\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar r = bufio.NewReader(os.Stdin)\nvar w = bufio.NewWriter(os.Stdin)\n\nfunc print(f string, v ...interface{}) { fmt.Fprintf(w, f, v...) }\n\nfunc main() {\n\tdefer w.Flush()\n\ts, _ := r.ReadString('\\n')\n\tif strings.TrimSpace(s) == \"3+2+1\" {\n\t\tprint(\"3+2+1\")\n\t\treturn\n\t}\n\tt := strings.Split(strings.TrimSpace(s), \"+\")\n\tif len(t) == 1 {\n\t\tprint(t[0])\n\t} else {\n\t\tsort(t)\n\t\tprint(\"%s\", strings.Join(t, \"+\"))\n\t}\n}\n\nfunc sort(a []string) {\n\tif len(a) < 2 {\n\t\treturn\n\t}\n\tmid := len(a) / 2\n\tleft, right := make([]string, mid), make([]string, len(a)-mid)\n\tcopy(left, a[:mid])\n\tcopy(right, a[mid:])\n\tsort(left)\n\tsort(right)\n\tmerge(left, right, a)\n}\n\nfunc merge(l, r, o []string) {\n\tvar i, j int\n\tfor k := range o {\n\t\tswitch {\n\t\tcase i == len(l):\n\t\t\to[k] = r[j]\n\t\t\tj++\n\t\tcase j == len(l):\n\t\t\to[k] = l[i]\n\t\t\ti++\n\t\tcase toNum(l[i]) < toNum(r[j]):\n\t\t\to[k] = l[i]\n\t\t\ti++\n\t\tcase toNum(l[i]) >= toNum(r[j]):\n\t\t\to[k] = r[j]\n\t\t\tj++\n\t\t}\n\t}\n}\n\nfunc toNum(t string) int {\n\to, _ := strconv.Atoi(t)\n\treturn o\n}\n"}], "src_uid": "76c7312733ef9d8278521cf09d3ccbc8"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tif l != r {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfmt.Println(l)\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r, ret int\n\tfmt.Scanf(\"%d %d\", &l, &r)\n\n\tif l == r {\n\t\tret = l\n\t} else {\n\t\tret = 2\n\t}\n\n\tfmt.Println(ret)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tl := readInt()\n\tr := readInt()\n\tif l == r {\n\t\tfmt.Println(l)\n\t\treturn\n\t}\n\tfmt.Println(2)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n if r - l == 3 && l % 3 == 0 {\n fmt.Print(3)\n } else if r == l && l % 2 == 1 {\n fmt.Print(l)\n } else {\n fmt.Print(2)\n }\n}"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r, count2, count3, count5, max, answer int\n\tfmt.Scanf(\"%d %d\", &l, &r)\n\tfor i := l; i <= r; i++ {\n\t\tif i%2 == 0 {\n\t\t\tcount2++\n\t\t} else if i%3 == 0 {\n\t\t\tcount3++\n\t\t} else if i%5 == 0 {\n\t\t\tcount5++\n\t\t} else {\n\t\t\tanswer = l\n\t\t}\n\t\tif i > l+100 {\n\t\t\tbreak\n\t\t}\n\t}\n\tif count2 > max {\n\t\tmax = count2\n\t\tanswer = 2\n\t}\n\tif count3 > max {\n\t\tmax = count3\n\t\tanswer = 3\n\t}\n\tif count5 > max {\n\t\tanswer = 5\n\t}\n\tfmt.Println(answer)\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc Solve(io *FastIO) {\n\tL := io.NextInt()\n\tR := io.NextInt()\n\n\tif R > L {\n\t\tio.Println(2)\n\t} else {\n\t\tio.Println(L)\n\t}\n}\n\ntype FastIO struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n}\n\nfunc (io *FastIO) NextChar() byte {\n\tc, _ := io.reader.ReadByte()\n\treturn c\n}\n\nfunc (io *FastIO) NextInt() int {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := 1\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := 0\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextLong() int64 {\n\tc := io.NextChar()\n\tfor IsSpaceChar(c) {\n\t\tc = io.NextChar()\n\t}\n\tsgn := int64(1)\n\tif c == '-' {\n\t\tsgn = -1\n\t\tc = io.NextChar()\n\t}\n\tres := int64(0)\n\tfor !IsSpaceChar(c) {\n\t\tres = (res * 10) + int64(c - '0')\n\t\tc = io.NextChar()\n\t}\n\treturn sgn * res\n}\n\nfunc (io *FastIO) NextIntArray(size int) []int {\n\treturn io.NextIntArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextIntArrayOffset(size, offset int) []int {\n\tarr := make([]int, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextInt()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextLongArray(size int) []int64 {\n\treturn io.NextLongArrayOffset(size, 0)\n}\n\nfunc (io *FastIO) NextLongArrayOffset(size, offset int) []int64 {\n\tarr := make([]int64, size + offset)\n\tfor i := 0; i < size; i++ {\n\t\tarr[i + offset] = io.NextLong()\n\t}\n\treturn arr\n}\n\nfunc (io *FastIO) NextString() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsSpaceChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) NextLine() string {\n\tc := io.NextChar()\n\tfor (IsSpaceChar(c)) {\n\t\tc = io.NextChar()\n\t}\n\tvar sb bytes.Buffer\n\tfor !IsLineBreakChar(c) {\n\t\tsb.WriteByte(c)\n\t\tc = io.NextChar()\n\t}\n\treturn sb.String()\n}\n\nfunc (io *FastIO) Println(args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintln(args...))\n}\n\nfunc (io *FastIO) Printf(format string, args ...interface{}) {\n\tio.writer.WriteString(fmt.Sprintf(format, args...))\n}\n\nfunc (io *FastIO) FlushOutput() {\n\tio.writer.Flush()\n}\n\nfunc IsSpaceChar(c byte) bool {\n\tswitch c {\n\tcase 0, '\\t', '\\n', '\\r', ' ':\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc IsLineBreakChar(c byte) bool {\n\tswitch c {\n\t\tcase 0, '\\n', '\\r':\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunc main() {\n\tio := FastIO{reader: bufio.NewReader(os.Stdin), writer: bufio.NewWriter(os.Stdout)}\n\tSolve(&io)\n\tio.FlushOutput()\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var l, r int\n fmt.Scanf(\"%d%d\", &l, &r)\n if l == r {\n fmt.Printf(\"%d\", l)\n } else {\n fmt.Printf(\"2\")\n }\n}\n"}, {"source_code": "// cf805a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scanln(&l, &r)\n\tif r-l > 1 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfmt.Println(r)\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i ...interface{}) error {\n\t_, err := fmt.Fscan(r, i...)\n\treturn err\n}\n\nfunc O(o ...interface{}) {\n\tfmt.Fprint(w, o...)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc init() {\n\tif f, err := os.Open(\"in.goC\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n}\n\nfunc main() {\n\tvar l, r int64\n\tfor I(&l, &r) == nil {\n\t\tsolve(l, r)\n\t}\n\tw.Flush()\n}\n\nfunc solve(l, r int64) {\n\tif l == r {\n\t\tO(l, \"\\n\")\n\t} else {\n\t\tO(\"2\\n\")\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tr_sqrt := int(math.Sqrt(float64(r)))\n\tnot_prime := make([]bool, r_sqrt+1)\n\tfor i := 2; i <= r_sqrt; i++ {\n\t\tfor j := i; j <= r_sqrt; j++ {\n\t\t\tif i*j <= r_sqrt {\n\t\t\t\tnot_prime[i*j] = true\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tprimes := []int{2}\n\tfor i := 3; i <= r_sqrt; i++ {\n\t\tif !not_prime[i] {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\n\tif l != r || l%2 == 0 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfor i := 0; i < len(primes); i++ {\n\t\t\tif l%primes[i] == 0 {\n\t\t\t\tfmt.Println(primes[i])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(l)\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tr_sqrt := int(math.Sqrt(float64(r)))\n\tnot_prime := make([]bool, r_sqrt+1)\n\tfor i := 2; i <= r_sqrt; i++ {\n\t\tfor j := i; j <= r_sqrt; j++ {\n\t\t\tif i*j <= r_sqrt {\n\t\t\t\tnot_prime[i*j] = true\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tprimes := []int{2}\n\tfor i := 3; i <= r_sqrt; i++ {\n\t\tif !not_prime[i] {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\n\tif l != r || l%2 == 0 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfor i := 0; i < len(primes); i++ {\n\t\t\tif l%primes[i] == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(l)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tr_sqrt := int(math.Sqrt(float64(r)))\n\tnot_prime := make([]bool, r_sqrt+1)\n\tfor i := 2; i <= r_sqrt; i++ {\n\t\tfor j := i; j <= r_sqrt; j++ {\n\t\t\tif i*j <= r_sqrt {\n\t\t\t\tnot_prime[i*j] = true\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tprimes := []int{2}\n\tfor i := 3; i <= r_sqrt; i++ {\n\t\tif !not_prime[3] {\n\t\t\tprimes = append(primes, i)\n\t\t}\n\t}\n\n\tif l != r || l%2 == 0 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfor i := 0; i < len(primes); i++ {\n\t\t\tif l%primes[i] == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println(l)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tif l > 6 {\n\t\tfmt.Println(2)\n\t\treturn\n\t}\n\n\tdiv_map := make(map[int]int)\n\tfor i := 2; i <= r/2; i++ {\n\t\tfor j := l/i - 1; j <= r/2; j++ {\n\t\t\tif i*j > r {\n\t\t\t\tbreak\n\t\t\t} else if i*j >= l && i*j <= r {\n\t\t\t\tif i == j {\n\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t} else {\n\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t\tdiv_map[j] += 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tmax_k := 0\n\tmax_v := 0\n\tfor k, v := range div_map {\n\t\tif v > max_v {\n\t\t\tmax_k = k\n\t\t\tmax_v = v\n\t\t}\n\t}\n\n\tfmt.Println(max_k)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tdiv_map := make(map[int]int)\n\n\tfor i := 2; i <= r/2; i++ {\n\t\tfor j := l/i - 1; j <= r/2; j++ {\n\t\t\tif i*j > r {\n\t\t\t\tbreak\n\t\t\t} else if i*j >= l && i*j <= r {\n\t\t\t\tif i == j {\n\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t} else {\n\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t\tdiv_map[j] += 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(div_map)\n\n\tmax_k := 0\n\tmax_v := 0\n\tfor k, v := range div_map {\n\t\tif v > max_v {\n\t\t\tmax_k = k\n\t\t\tmax_v = v\n\t\t}\n\t}\n\n\tfmt.Println(max_k)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tif _, err := fmt.Scanf(\"%d %d\\n\", &l, &r); err != nil {\n\t\treturn\n\t}\n\n\tif l > 100 || r > 100 {\n\t\tif l != r || l%2 == 0 {\n\t\t\tfmt.Println(2)\n\t\t} else {\n\t\t\tfor i := 3; i <= l; i++ {\n\t\t\t\tif l%i == 0 {\n\t\t\t\t\tfmt.Println(i)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tdiv_map := make(map[int]int)\n\t\tfor i := 2; i <= r/2; i++ {\n\t\t\tfor j := l/i - 1; j <= r/2; j++ {\n\t\t\t\tif i*j > r {\n\t\t\t\t\tbreak\n\t\t\t\t} else if i*j >= l && i*j <= r {\n\t\t\t\t\tif i == j {\n\t\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdiv_map[i] += 1\n\t\t\t\t\t\tdiv_map[j] += 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tmax_k := 0\n\t\tmax_v := 0\n\t\tfor k, v := range div_map {\n\t\t\tif v > max_v {\n\t\t\t\tmax_k = k\n\t\t\t\tmax_v = v\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(max_k)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n if r - l == 3 && l % 3 == 0 {\n fmt.Print(3)\n } else {\n fmt.Print(2)\n }\n}"}, {"source_code": "// cf805a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scanln(&l, &r)\n\tif r-l > 3 || (r%2 == 0 || l%2 == 0) {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfmt.Println(3)\n\t}\n}"}, {"source_code": "// cf805a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scanln(&l, &r)\n\tif r-l > 3 {\n\t\tfmt.Println(2)\n\t} else {\n\t\tfmt.Println(3)\n\t}\n}"}], "src_uid": "a8d992ab26a528f0be327c93fb499c15"} {"source_code": "// Test project main.go\npackage main\n\nimport (\n\t\"fmt\"\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}\nfunc main() {\n\tvar a int\n\tfmt.Scanf(\"%d\", &a)\n\tamin := 2*(a/7) + max((a%7-5), 0)\n\tamax := 2*(a/7) + min(a%7, 2)\n\tfmt.Printf(\"%d %d\\n\", amin, amax)\n}\n", "positive_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scanln(&n)\n\tminDayOff := n / 7 * 2\n\tif n%7 > 5 {\n\t\tminDayOff += n%7 - 5\n\t}\n\tmaxDayOff := 2\n\tif n < 2 {\n\t\tmaxDayOff = n\n\t\tn = 0\n\t} else {\n\t\tn -= 2\n\t}\n\tmaxDayOff += n / 7 * 2\n\tif n%7 > 5 {\n\t\tmaxDayOff += n%7 - 5\n\t}\n\tfmt.Println(minDayOff, maxDayOff)\n}\n"}, {"source_code": "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.Scanner\n\tvar n int\n\tvar e error\n\tvar min [6]int = [6]int{0, 0, 0, 0, 0, 1}\n\tvar max [6]int = [6]int{1, 2, 2, 2, 2, 2}\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\n\tn, e = strconv.Atoi(strings.TrimSpace(scanner.Text()))\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\tif n%7 == 0 {\n\t\tfmt.Println((n/7)*2, (n/7)*2)\n\t} else {\n\t\tfmt.Println(min[(n%7)-1]+(n/7)*2, max[(n%7)-1]+(n/7)*2)\n\t}\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tr := n % 7\n\tvar rmax, rmin int\n\tif r < 2 {\n\t\trmax = r\n\t} else {\n\t\trmax = 2\n\t}\n\tif r == 6 {\n\t\trmin = 1\n\t} else {\n\t\trmin = 0\n\t}\n\tmax := n/7*2 + rmax\n\tmin := n/7*2 + rmin\n\tfmt.Print(min, max)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tfmt.Scanf(\"%d\", &d)\n\tmod := d % 7\n\tweeksCompleted := (d - mod) / 7\n\tweekend := weeksCompleted * 2\n\tminWeekend := weekend\n\tmaxWeekend := weekend\n\tif mod > 1 {\n\t\tmaxWeekend += 2\n\t}\n\tif mod == 1 {\n\t\tmaxWeekend++\n\t}\n\tif mod > 5 {\n\t\tminWeekend++\n\t}\n\tfmt.Println(minWeekend, maxWeekend)\n}\n"}, {"source_code": "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}\n\treturn b\n}\n\nfunc solve(n int) (mmin, mmax int) {\n\tif n%7 == 0 {\n\t\tweek := n / 7\n\t\treturn week * 2, week * 2\n\t}\n\n\tweek := n / 7\n\tmod := n % 7\n\n\tmmax = week*2 + min(mod, 2)\n\tmmin = week * 2\n\tif mod == 6 {\n\t\tmmin++\n\t}\n\n\treturn mmin, mmax\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Println(solve(n))\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%v\", &n)\n\tw := n / 7\n\tr := n % 7\n\tvar a1, a2 int\n\tif r > 2 {\n\t\ta1 = 2*w + 2\n\t} else {\n\t\ta1 = 2*w + r\n\t}\n\n\tif r-5 > 0 {\n\t\ta2 = w*2 + (r - 5)\n\t} else {\n\t\ta2 = w * 2\n\t}\n\n\tfmt.Printf(\"%v %v\\n\", a2, a1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\nfunc main(){\n\tvar n int\n\tfmt.Scanln(&n)\n\tweek:=0\n\tdays:=0\n\tdays=n%7\n\tweek=n/7\n\tholiday:=0\n\tif days==0{\n\t\tholiday=week*2\n\t}else if days==1 {\n\t\tholiday=(week*2)+1\n\t}else{\n\t\tholiday=(week*2)+2\n\t}\n\tmin:=0\n\tif days==6{\n\t\tmin=(week*2)+1\n\t}else if days==7 {\n\t\tmin=(week*2)+2\n\t}else{\n\t\tmin=week*2\n\t}\n\n\tfmt.Println(min, holiday)\n}\n\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var min, max int\n min, max = n/7 * 2, n/7 * 2\n if n%7 > 5 {\n min += (n%7)-5\n max += 2\n } else if n%7 < 2 {\n max += n%7\n } else {\n max += 2\n }\n fmt.Print(min, \" \", max)\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tweek := n / 7\n\tday := n % 7\n\tvar res1, res2 int\n\tres1, res2 = 0, 0\n\tres1 = week*2 + Max(0, day-5)\n\tres2 = week*2 + Min(2, day)\n\n\tfmt.Println(res1, res2)\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}\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"}, {"source_code": "// cf670a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar ma int\n\tif n > 1 {\n\t\tma = 2 + (((n - 2) / 7) * 2)\n\t\tif (n-2)%7 > 5 {\n\t\t\tma += ((n - 2) % 7) - 5\n\t\t}\n\t} else {\n\t\tma = n\n\t}\n\tmi := (n / 7) * 2\n\tif n%7 > 5 {\n\t\tmi += (n % 7) - 5\n\t}\n\tfmt.Println(mi, ma)\n}"}], "negative_code": [{"source_code": "// Test project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc Generate(ch chan int) {\n\tnow := 0\n\tsum := 0\n\tfor {\n\t\tsum = sum + now\n\t\tnow = now + 1\n\t\tch <- now\n\t\tch <- sum\n\t}\n}\nfunc main() {\n\tvar n, x, ans int\n\tfmt.Scanf(\"%d %d\", &n, &x)\n\tnow := 0\n\tsum := 0\n\n\tfor i := 1; i <= n; i++ {\n\t\tsum = sum + now\n\t\tnow = now + 1\n\t\t//fmt.Printf(\"test %d %d\\n\", next, sum)\n\t\tif sum+now >= x && sum < x {\n\t\t\tans = x - sum - 1\n\t\t\tbreak\n\t\t\t//fmt.Printf(\"%d\\n\", a[x-sum-1])\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tvar in int\n\t\tfmt.Scanf(\"%d\", &in)\n\t\t//fmt.Printf(\"%d\", in)\n\t\tif i == ans {\n\t\t\tfmt.Printf(\"%d\", in)\n\t\t}\n\t}\n}\n"}, {"source_code": "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.Scanner\n\tvar n int\n\tvar e error\n\tvar min [6]int = [6]int{0, 0, 0, 0, 0, 1}\n\tvar max [7]int = [7]int{1, 2, 2, 2, 2, 2, 2}\n\n\tscanner = bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\n\tn, e = strconv.Atoi(strings.TrimSpace(scanner.Text()))\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\n\tfmt.Println(min[(n-1)%6]+(n/7)*2, max[(n-1)%7]+(n/8)*2)\n\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tfmt.Scanf(\"%d\", &d)\n\tmod := d % 7\n\tweeksCompleted := (d - mod) / 7\n\tweekend := weeksCompleted * 2\n\tminWeekend := weekend\n\tmaxWeekend := weekend\n\tif mod > 1 {\n\t\tmaxWeekend += 2\n\t}\n\tif mod == 1 {\n\t\tmaxWeekend++\n\t}\n\tfmt.Println(minWeekend, maxWeekend)\n}\n"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var min, max int\n min, max = n/7, n/7\n if n%7 > 5 {\n min += (n%7)-5\n max += 2\n } else if n%7 < 2 {\n max += n%7\n } else {\n max += 2\n }\n fmt.Print(min, \" \", max)\n}"}, {"source_code": "// cf670a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar ma int\n\tif ma > 1 {\n\t\tma = 2 + (((n - 2) / 7) * 2)\n\t\tif (n-2)%7 > 5 {\n\t\t\tma += ((n - 2) % 7) - 5\n\t\t}\n\t} else {\n\t\tma = n\n\t}\n\tmi := (n / 7) * 2\n\tif n%7 > 5 {\n\t\tmi += (n % 7) - 5\n\t}\n\tfmt.Println(mi, ma)\n}\n"}, {"source_code": "// cf670a project main.go\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tma := 2 + (((n - 2) / 7) * 2)\n\tif (n-2)%7 > 5 {\n\t\tma += ((n - 2) % 7) - 5\n\t}\n\tmi := (n / 7) * 2\n\tif n%7 > 5 {\n\t\tmi += (n % 7) - 5\n\t}\n\tfmt.Println(mi, ma)\n}"}], "src_uid": "8152daefb04dfa3e1a53f0a501544c35"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc next_permutation(idx []int) bool {\n\tn := len(idx)\n\tfor i := n - 1; i >= 1; i-- {\n\t\tif idx[i] > idx[i-1] {\n\t\t\tidx[i], idx[i-1] = idx[i-1], idx[i]\n\t\t\tsort.Ints(idx[i:])\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d\\n%d\\n%d\", &n, &a, &b)\n\tframes := make([]int, 6)\n\tidxs := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tif i < 4 {\n\t\t\tframes[i] = a\n\t\t} else {\n\t\t\tframes[i] = b\n\t\t}\n\t\tidxs[i] = i\n\t}\n\n\tbestAnswer := 6\n\tfor {\n\t\tcount, leftover := 0, 0\n\t\tfor i := 0; i < 6; i++ {\n\t\t\tif leftover < frames[idxs[i]] {\n\t\t\t\tcount++\n\t\t\t\tleftover = n\n\t\t\t}\n\t\t\tleftover -= frames[idxs[i]]\n\t\t}\n\t\tif count < bestAnswer {\n\t\t\tbestAnswer = count\n\t\t}\n\t\tif !next_permutation(idxs) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(bestAnswer)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scan(&n);\n fmt.Scan(&a);\n fmt.Scan(&b);\n}\n\nfunc Solve(na int32, nb int32, current int32, dbg bool) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 10000;\n var r1 int = 10000;\n var r2 int = 10000;\n var mode int = 4;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a, false);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b, false);\n }\n if current != n {\n r2 = 1 + Solve(na, nb, n, false);\n }\n\n result := r0\n mode = 0\n if r1 < result {\n result = r1\n mode = 1\n }\n if r2 < result {\n result = r2\n mode = 2\n }\n\n if dbg {\n if mode == 0 {\n Solve(na - 1, nb, current - a, true);\n } else if mode == 1 {\n Solve(na, nb - 1, current - b, true);\n } else if mode == 2 {\n r2 = 1 + Solve(na, nb, n, true);\n }\n fmt.Println(\"na: \", na, \" nb: \", nb, \" current: \", current, \" result: \", result, \" mode: \", mode)\n }\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0, false));\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d\\n%d\\n%d\", &n, &a, &b)\n\tframes := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tif i < 4 {\n\t\t\tframes[i] = a\n\t\t} else {\n\t\t\tframes[i] = b\n\t\t}\n\t}\n\tsort.Ints(frames)\n\tcount := 0\n\tleftover := 0\n\n\tfor i := 0; i < 6; i++ {\n\t\tif leftover >= frames[i] {\n\t\t\tleftover -= frames[i]\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\tif leftover+frames[i-1]-frames[i] >= 0 {\n\t\t\t\tcount++\n\t\t\t\tleftover = n - frames[i-1]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tleftover = n - frames[i]\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d\\n%d\\n%d\", &n, &a, &b)\n\tframes := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tif i < 4 {\n\t\t\tframes[i] = a\n\t\t} else {\n\t\t\tframes[i] = b\n\t\t}\n\t}\n\tsort.Ints(frames)\n\tcount := 0\n\tleftover := 0\n\n\tfor i := 0; i < 6; i++ {\n\t\tif leftover >= frames[i] {\n\t\t\tleftover -= frames[i]\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\tif leftover+frames[i-1]-frames[i] >= 0 {\n\t\t\t\tcount++\n\t\t\t\tleftover = n - frames[i]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tleftover = n - frames[i]\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scanf(\"%d\\n%d\\n%d\", &n, &a, &b)\n\tframes := make([]int, 6)\n\tfor i := 0; i < 6; i++ {\n\t\tif i < 4 {\n\t\t\tframes[i] = a\n\t\t} else {\n\t\t\tframes[i] = b\n\t\t}\n\t}\n\tsort.Ints(frames)\n\tcount := 0\n\tleftover := 0\n\n\tfor i := 0; i < 6; i++ {\n\t\tif leftover >= frames[i] {\n\t\t\tleftover -= frames[i]\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\tif leftover+frames[i-1]+frames[i] >= 0 {\n\t\t\t\tcount++\n\t\t\t\tleftover = n - frames[i-1]\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tleftover = n - frames[i]\n\t}\n\tfmt.Println(count)\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 1000;\n var r1 int = 1000;\n var r2 int = 1000;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b);\n }\n if current < a && current < b {\n r2 = 1 + Solve(na, nb, n);\n }\n result := r0\n if r1 < result {\n result = r1\n }\n if r2 < result {\n result = r2\n }\n\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0));\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 1000;\n var r1 int = 1000;\n var r2 int = 1000;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b);\n }\n if n != current {\n r2 = 1 + Solve(na, nb, n);\n }\n result := r0\n if r1 < result {\n result = r1\n }\n if r2 < result {\n result = r2\n }\n\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0));\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var result int = 1000;\n var r0 int = 1000;\n var r1 int = 1000;\n var r2 int = 1000;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b);\n }\n if n != current {\n r2 = 1 + Solve(na, nb, n);\n }\n result = r0\n if r1 < r0 {\n result = r1\n }\n if r2 < result {\n result = r2\n }\n\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(1 + Solve(4, 2, n));\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n int32\nvar a int32\nvar b int32\n\nfunc ReadData() {\n fmt.Scanf(\"%d\", &n);\n fmt.Scanf(\"%d\", &a);\n fmt.Scanf(\"%d\", &b);\n}\n\nfunc Solve(na int32, nb int32, current int32, dbg bool) int {\n if na == 0 && nb == 0 {\n return 0;\n }\n\n var r0 int = 10000;\n var r1 int = 10000;\n var r2 int = 10000;\n var mode int = 4;\n\n if 0 < na && a <= current {\n r0 = Solve(na - 1, nb, current - a, false);\n }\n if 0 < nb && b <= current {\n r1 = Solve(na, nb - 1, current - b, false);\n }\n if current != n {\n r2 = 1 + Solve(na, nb, n, false);\n }\n\n result := r0\n mode = 0\n if r1 < result {\n result = r1\n mode = 1\n }\n if r2 < result {\n result = r2\n mode = 2\n }\n\n if dbg {\n if mode == 0 {\n Solve(na - 1, nb, current - a, true);\n } else if mode == 1 {\n Solve(na, nb - 1, current - b, true);\n } else if mode == 2 {\n r2 = 1 + Solve(na, nb, n, true);\n }\n fmt.Println(\"na: \", na, \" nb: \", nb, \" current: \", current, \" result: \", result, \" mode: \", mode)\n }\n return result\n}\n\nfunc main() {\n ReadData();\n fmt.Println(Solve(4, 2, 0, false));\n}\n"}], "src_uid": "1a50fe39e18f86adac790093e195979a"} {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tl := []int{0, 0, 0}\n\tfmt.Scan(&l[0], &l[1], &l[2])\n\tr := l[0] + l[1] - l[2]\n\tfor _, x := range l {\n\t\tif r > x {\n\t\t\tr = x\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n", "positive_code": [{"source_code": "// Codeforces helper functions\n// 20 Jan 18\n// samadhi\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nconst debug = true\n\nfunc main() {\n\treader := bufio.NewReader(os.Stdin)\n\n\tin := gsli(reader)\n\n\tn := in[0]\n\tk := in[1]\n\tt := in[2]\n\n\tans := 0\n\tif t <= k {\n\t\tans = t\n\t} else if t <= n {\n\t\tans = k\n\t} else {\n\t\tans = k + n - t\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Input helpers\n\n// If you don't pass in a reference to the reader, and just instantiate a new\n// one every time, it will work locally, with IO typed at human-speed, but not\n// on Codeforces.\n\n// Get Space-separated Line as Strings\n//\n// Example input:\n// 1 test 382.0\n// Example output:\n// [\"1\", \"test\", \"382.0\"]\n\nfunc gsls(reader *bufio.Reader) (arr []string) {\n\t// Get a full line\n\tinput, _ := reader.ReadString('\\n')\n\n\t//Strip newline and return chars, if any\n\tinput = strings.TrimSuffix(input, \"\\n\")\n\tinput = strings.TrimSuffix(input, \"\\r\")\n\n\t// Split at the spaces into an array\n\tarr = strings.Split(input, \" \")\n\n\treturn\n}\n\n// Get Space-separated Line as Integers\n// Any non-valid integers will be 0\n//\n// Example input:\n// test 1 12.3 -117\n// Example output:\n// [0, 1, 0, -117]\n\nfunc gsli(reader *bufio.Reader) (arr []int) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.Atoi(e)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// Get Space-separated Line as 64-bit Floats\n// Any non-valid floats will be 0\n//\n// Example input:\n// test 128.328 12 -11.0\n// Example output:\n// [0, 128.328, 12, -11]\n\nfunc gslf(reader *bufio.Reader) (arr []float64) {\n\tstringArr := gsls(reader)\n\n\tfor _, e := range stringArr {\n\t\tcur, _ := strconv.ParseFloat(e, 64)\n\t\tarr = append(arr, cur)\n\t}\n\n\treturn\n}\n\n// String helpers\n\n// Is Lowercase\n// Given some string[i], return whether it is lower case or not.\n\nfunc isl(b byte) bool {\n\tvar r rune\n\tr = rune(b)\n\treturn unicode.IsLower(r)\n}\n\n// Math helpers\n\n// Positve Modulo\n// Returns x mod y, but always positive\n\nfunc posMod(x, y int) int {\n\treturn (x%y + y) % y\n}\n\n// Max Int\n// Returns the max of two ints\n\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// Distance formule\n// Calculates the distance to the origin\n\nfunc dist(x, y float64) float64 {\n\treturn math.Sqrt(math.Pow(x, 2) + math.Pow(y, 2))\n}\n\n// Output helpers\n\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\n\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Debug helpers\n\n// From https://groups.google.com/forum/#!topic/golang-nuts/Qlxs3V77nss\n\nfunc dbg(s string, a ...interface{}) {\n\tif debug {\n\t\tfmt.Printf(s, a...)\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n \"fmt\"\n)\n\nvar (\n n int\n k int\n t int\n)\n\nfunc main() {\n fmt.Scanf(\"%d %d %d\\n\", &n, &k, &t)\n if t <= k {\n fmt.Println(t)\n } else if t >= n {\n fmt.Println(n + k - t)\n } else {\n fmt.Println(k)\n }\n}"}, {"source_code": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n,k,t int\n\tfmt.Scanf(\"%d %d %d\",&n,&k,&t)\n\tif t<=k{\n\t\tfmt.Println(t)\n\t} else{\n\t\tif t<=n {\n\t\t\tfmt.Println(k)\n\t\t}else {\n\t\t\tfmt.Println(k-(t-n))\n\t\t}\n\t}\n}\n"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k, t int\n\tfmt.Scan(&n, &k, &t)\n\tif n < t {\n\t\tn += k - t\n\t}\n\tif n > k {\n\t\tn = k\n\t}\n\tfmt.Println(n)\n}\n"}], "src_uid": "7e614526109a2052bfe7934381e7f6c2"} {"source_code": "/*\nURL:\nhttps://codeforces.com/problemset/problem/787/A\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\ta, b, c, d int\n)\n\nfunc main() {\n\ta, b, c, d = ReadInt4()\n\n\tfor i := 0; i <= 3000; i++ {\n\t\tfor j := 0; j <= 3000; j++ {\n\t\t\tif b+i*a == d+j*c {\n\t\t\t\tfmt.Println(b + i*a)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d int\n\tif _, err := fmt.Scanf(\"%d %d\\n%d %d\\n\", &a, &b, &c, &d); err != nil {\n\t\treturn\n\t}\n\n\toffset := make(map[int]bool)\n\n\tfor i := 0; ; i++ {\n\t\tt := i*a + b\n\t\tif t-d >= 0 {\n\t\t\tif (t-d)%c == 0 {\n\t\t\t\tfmt.Println(t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tl := (t - d) / c\n\t\t\toff := t - (l*c + d)\n\t\t\tif offset[off] {\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\toffset[off] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(-1)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ta := readInt()\n\tb := readInt()\n\tc := readInt()\n\td := readInt()\n\tfor i := 0; i < 100000; i++ {\n\t\tif i >= b && i >= d {\n\t\t\tif (i-b)%a == 0 && (i-d)%c == 0 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1)\n}\n\nvar scanner *bufio.Scanner\n\nfunc main() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tconst MaxTokenLength = 1024 * 1024\n\tscanner.Buffer(make([]byte, 0, MaxTokenLength), MaxTokenLength)\n\tscanner.Split(bufio.ScanWords)\n\tsolve()\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// IO\n\nfunc readString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc readInt() int {\n\tval, _ := strconv.Atoi(readString())\n\treturn val\n}\n\nfunc readInt64() int64 {\n\tv, _ := strconv.ParseInt(readString(), 10, 64)\n\treturn v\n}\n\nfunc readIntArray(sz int) []int {\n\ta := make([]int, sz)\n\tfor i := 0; i < sz; i++ {\n\t\ta[i] = readInt()\n\t}\n\treturn a\n}\n\nfunc readInt64Array(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = readInt64()\n\t}\n\treturn res\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c, d, i int\n\tvar arr1, arr2 []int\n\tvar flag bool\n\tfmt.Scanf(\"%d %d\\n%d %d\", &a, &b, &c, &d)\n\tfor i != 6000 {\n\t\tarr1 = append(arr1, b+(i*a))\n\t\tarr2 = append(arr2, d+(i*c))\n\t\ti++\n\t}\n\tfor i := range arr1 {\n\t\tfor j := range arr2 {\n\t\t\tif arr1[i] == arr2[j] {\n\t\t\t\tfmt.Println(arr1[i])\n\t\t\t\tflag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\tfmt.Println(\"-1\")\n\t}\n}"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar i, tmp int\n\tvar arr1, arr2 []int\n\tvar arr3 [4]int\n\tvar flag bool\n\treader := bufio.NewReader(os.Stdin)\n\twriter := bufio.NewWriter(os.Stdout)\n\tline, _ := reader.ReadString('\\n')\n\tarrS := strings.Split(strings.TrimSpace(line), \" \")\n\tfor i := range arrS {\n\t\ttmp, _ = strconv.Atoi(arrS[i])\n\t\tarr3[i] = tmp\n\t}\n\tline, _ = reader.ReadString('\\n')\n\tarrS = strings.Split(strings.TrimSpace(line), \" \")\n\tfor i := range arrS {\n\t\ttmp, _ = strconv.Atoi(arrS[i])\n\t\tarr3[i+2] = tmp\n\t}\n\ti = 0\n\tfor i != 6000 {\n\t\tarr1 = append(arr1, arr3[1]+(i*arr3[0]))\n\t\tarr2 = append(arr2, arr3[3]+(i*arr3[2]))\n\t\ti++\n\t}\n\ti = 0\n\tfor j := range arr1 {\n\t\tx := arr1[j]\n\t\ti := sort.Search(len(arr2), func(i int) bool { return arr2[i] >= x })\n\t\tif i < len(arr2) && arr2[i] == x {\n\t\t\twriter.WriteString(strconv.Itoa(x))\n\t\t\tflag = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !flag {\n\t\twriter.WriteString(\"-1\")\n\t}\n\twriter.Flush()\n}"}, {"source_code": "package main \nimport .\"fmt\"\n\nfunc main(){\n var a , b , c , d int \n Scanf(\"%d%d\\n\" , &a , &b)\n Scanf(\"%d%d\" , &c , &d)\n mapper := make([]int , 1e6+5)\n for i:=b; i<= 1e6; i+=a{\n mapper[i] += 1\n }\n ans := -1\n for i:=d; i<= 1e6; i+=c{\n mapper[i] += 1\n if mapper[i] == 2{\n ans = i\n break\n }\n }\n Printf(\"%d\" , ans) \n}"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\n\nfunc main(){\n\tvar a , b , c , d int\n\tfmt.Scanf(\"%d%d\\n\" , &a , &b)\n\tfmt.Scanf(\"%d%d\" , &c , &d)\n\tfor i:=0 ; i<=110 ; i++ {\n\t\tif (b+i*a-d) % c == 0 && b+i*a-d >= 0 {\n\t\t\tfmt.Printf(\"%d\\n\" ,b+i*a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Printf(\"-1\\n\")\n}"}], "negative_code": [{"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\n\nfunc main(){\n\tvar a , b , c , d int\n\tfmt.Scanf(\"%d%d%d%d\" , a , b , c , d)\n\tif b == d {\n\t\tfmt.Printf(\"%d\\n\", d)\n\t\tos.Exit(0)\n\t}\n\tfor i:=0 ; i<=110 ; i++ {\n\t\tif (b+i*a-d) % c == 0 {\n\t\t\tfmt.Printf(\"%d\\n\" ,b+i*a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Printf(\"-1\\n\")\n}"}, {"source_code": "package main\n\nimport \"fmt\"\nimport \"os\"\n\n\nfunc main(){\n\tvar a , b , c , d int\n\tfmt.Scanf(\"%d%d\\n\" , &a , &b)\n\tfmt.Scanf(\"%d%d\" , &c , &d)\n\tfor i:=0 ; i<=110 ; i++ {\n\t\tif (b+i*a-d) % c == 0 {\n\t\t\tfmt.Printf(\"%d\\n\" ,b+i*a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Printf(\"-1\\n\")\n}"}], "src_uid": "158cb12d45f4ee3368b94b2b622693e7"} {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc main() {\n\tx1, y1 := results()\n\tx2, y2 := results()\n\tx3, y3 := results()\n\tfmt.Println(\"3\")\n\tfmt.Println(x2-x1+x3, y2-y1+y3)\n\tfmt.Println(x3-x2+x1, y3-y2+y1)\n\tfmt.Println(x1-x3+x2, y1-y3+y2)\n}\n\nfunc results() (int, int) {\n\tscanner.Scan()\n\tresult := strings.Fields(scanner.Text())\n\tx, err1 := strconv.Atoi(result[0])\n\ty, err2 := strconv.Atoi(result[1])\n\tif err1 == nil && err2 == nil {\n\t\treturn x, y\n\t} else {\n\t\treturn 0, 0\n\t}\n}\n", "positive_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar xy [3][2]int\n\n\tfor i := 0; i < 3; i++ {\n\t\tif _, err := fmt.Scanf(\"%d %d\\n\", &xy[i][0], &xy[i][1]); err != nil {\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(3)\n\tfor i := 0; i < 3; i++ {\n\t\tvar c, o [2]int\n\t\tfor j := 0; j < 3; j++ {\n\t\t\tif j != i {\n\t\t\t\tfor k := 0; k < 2; k++ {\n\t\t\t\t\tc[k] += xy[j][k]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor k := 0; k < 2; k++ {\n\t\t\to[k] = c[k] - xy[i][k]\n\t\t}\n\n\t\tfmt.Println(o[0], o[1])\n\t}\n}\n"}, {"source_code": "// Codeforces 749 B training\n// int - 32 bit type !!!!\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\nvar in *bufio.Reader\n\nfunc readFive() (int,int,int,int,int) {\n var a [5]int\n\ts, err := in.ReadString('\\n')\n\tif err != nil {\n\t\tfmt.Println(\"first read failure\", err)\n\t\tpanic(err)\n\t}\n\tss := strings.Split(strings.Trim(s, \" \\n\\r\"), \" \")\n for i:=0; i= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc I(i interface{}, delim string) error {\n\t_, err := fmt.Fscanf(r, \"%v\"+delim, i)\n\treturn err\n}\n\nfunc O(o interface{}, delim string) {\n\tfmt.Fprintf(w, \"%v\"+delim, o)\n}\n\nvar (\n\tr *bufio.Reader\n\tw *bufio.Writer\n)\n\nfunc main() {\n\tif f, err := os.Open(\"in.txt\"); err == nil {\n\t\tr = bufio.NewReader(f)\n\t} else {\n\t\tr = bufio.NewReader(os.Stdin)\n\t}\n\tw = bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\tvar x1 int\n\tfor I(&x1, \" \") == nil {\n\t\tsolve(x1)\n\t}\n}\nfunc solve(x1 int) {\n\tvar y1, x2, y2, x3, y3 int\n\tI(&y1, \"\\n\")\n\tI(&x2, \" \")\n\tI(&y2, \"\\n\")\n\tI(&x3, \" \")\n\tI(&y3, \"\\n\")\n\tO(3, \"\\n\")\n\tO(x1+x2-x3, \" \")\n\tO(y1+y2-y3, \"\\n\")\n\tO(x1-x2+x3, \" \")\n\tO(y1-y2+y3, \"\\n\")\n\tO(-x1+x2+x3, \" \")\n\tO(-y1+y2+y3, \"\\n\")\n}"}], "negative_code": [{"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcord := [3][2]int{};\n\tfor i:=0;i<3;i++ {\n\t\tfmt.Scanf(\"%d %d\", &cord[i][0], &cord[i][1])\n\t}\n\tfmt.Println(\"3\")\n\tfmt.Printf(\"%d%d\", cord[0][0]-cord[1][0]+cord[2][0], cord[0][1]-cord[1][1]+cord[2][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d%d\", cord[1][0]-cord[2][0]+cord[0][0], cord[1][1]-cord[2][1]+cord[0][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d%d\", cord[2][0]-cord[0][0]+cord[1][0], cord[2][1]-cord[0][1]+cord[0][1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc main() {\n\t//var x1 ,x2,x3,y1,y2,y3 int\n\tscanner.Scan()\n\twords := strings.Fields(scanner.Text())\n\tscanner.Scan()\n\twords = strings.Fields(scanner.Text())\n\tfmt.Println(words[0])\n\tfmt.Println(words[1])\n\t//fmt.Println(\"3\")\n\t//fmt.Println(x2-x1+x3, y2-y1+y3)\n\t//fmt.Println(x3-x2+x1, y3-y2+y1)\n\t//fmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1 ,x2,x3,y1,y2,y3 int\n\tfmt.Scanf(\"%d %d\", &x1, &y1)\n\tfmt.Scanf(\"%d %d\", &x2, &y2)\n\tfmt.Scanf(\"%d %d\", &x3, &y3)\n\tfmt.Println(\"3\")\n\tfmt.Println(y1)\n\tfmt.Println(x2-x1+x3, y2-y1+y3)\n\tfmt.Println(x3-x2+x1, y3-y2+y1)\n\tfmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcord := [3][2]int{};\n\tfor i:=0;i<3;i++ {\n\t\tfmt.Scanf(\"%d %d\", &cord[i][0], &cord[i][1])\n\t}\n\tfmt.Println(\"3\")\n\t//fmt.Printf(\"%d \", cord[0][0]-cord[1][0]+cord[2][0])\n\tfmt.Printf(\"%d \", cord[0][1]-cord[1][1]+cord[2][1])\n\tfmt.Println()\n\t//fmt.Printf(\"%d \", cord[1][0]-cord[2][0]+cord[0][0])\n\tfmt.Printf(\"%d \", cord[1][1]-cord[2][1]+cord[0][1])\n\tfmt.Println()\n\t//fmt.Printf(\"%d \", cord[2][0]-cord[0][0]+cord[1][0])\n\tfmt.Printf(\"%d \", cord[2][1]-cord[0][1]+cord[0][1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcord := [3][2]int{};\n\tfor i:=0;i<3;i++ {\n\t\tfmt.Scanf(\"%d %d\", &cord[i][0], &cord[i][1])\n\t}\n\tfmt.Println(\"3\")\n\tfmt.Printf(\"%d \", cord[0][0]-cord[1][0]+cord[2][0])\n\tfmt.Printf(\"%d \", cord[0][1]-cord[1][1]+cord[2][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d \", cord[1][0]-cord[2][0]+cord[0][0])\n\tfmt.Printf(\"%d \", cord[1][1]-cord[2][1]+cord[0][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d \", cord[2][0]-cord[0][0]+cord[1][0])\n\tfmt.Printf(\"%d \", cord[2][1]-cord[0][1]+cord[0][1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1 ,x2,x3,y1,y2,y3 int\n\tfmt.Scanf(\"%d %d\", &x1, &y1)\n\tfmt.Scanf(\"%d %d\", &x2, &y2)\n\tfmt.Scanf(\"%d %d\", &x3, &y3)\n\tfmt.Println(\"3\")\n\tfmt.Printf(\"%d \", x2-x1+x3)\n\tfmt.Printf(\"%d \", y2-y1+y3)\n\tfmt.Println()\n\tfmt.Printf(\"%d \", x3-x2+x1)\n\tfmt.Printf(\"%d \", y3-y2+y1)\n\tfmt.Println()\n\tfmt.Printf(\"%d \", x1-x3+x2)\n\tfmt.Printf(\"%d \", y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1 ,x2,x3,y1,y2,y3 int\n\tfmt.Scanf(\"%d%d\", &x1, &y1)\n\tfmt.Scanf(\"%d%d\", &x2, &y2)\n\tfmt.Scanf(\"%d%d\", &x3, &y3)\n\tfmt.Println(\"3\")\n\tfmt.Println(x2-x1+x3, y2-y1+y3)\n\tfmt.Println(x3-x2+x1, y3-y2+y1)\n\tfmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)\n\nfunc ReadInt32() int {\n\tscanner.Scan()\n\tans, _ := strconv.Atoi(scanner.Text())\n\treturn ans\n}\n\nfunc main() {\n\t//var x1 ,x2,x3,y1,y2,y3 int\n\tscanner.Scan()\n\twords := strings.Fields(scanner.Text())\n\tfmt.Println(words[0])\n\tfmt.Println(words[1])\n\t//fmt.Println(\"3\")\n\t//fmt.Println(x2-x1+x3, y2-y1+y3)\n\t//fmt.Println(x3-x2+x1, y3-y2+y1)\n\t//fmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1 ,x2,x3,y1,y2,y3 int\n\tfmt.Scanf(\"%d\", &x1)\n\tfmt.Scanf(\"%d\", &y1)\n\tfmt.Scanf(\"%d\", &x2)\n\tfmt.Scanf(\"%d\", &y2)\n\tfmt.Scanf(\"%d\", &x3)\n\tfmt.Scanf(\"%d\", &y3)\n\tfmt.Println(\"3\")\n\tfmt.Println(x2-x1+x3, y2-y1+y3)\n\tfmt.Println(x3-x2+x1, y3-y2+y1)\n\tfmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tcord := [3][2]int{};\n\tfor i:=0;i<3;i++ {\n\t\tfmt.Scanf(\"%d %d\", &cord[i][0], &cord[i][1])\n\t}\n\tfmt.Println(\"3\")\n\tfmt.Printf(\"%d %d\", cord[0][0]-cord[1][0]+cord[2][0], cord[0][1]-cord[1][1]+cord[2][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d %d\", cord[1][0]-cord[2][0]+cord[0][0], cord[1][1]-cord[2][1]+cord[0][1])\n\tfmt.Println()\n\tfmt.Printf(\"%d %d\", cord[2][0]-cord[0][0]+cord[1][0], cord[2][1]-cord[0][1]+cord[0][1])\n}\n"}, {"source_code": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x1 ,x2,x3,y1,y2,y3 int\n\tfmt.Scanf(\"%d %d\", &x1, &y1)\n\tfmt.Scanf(\"%d %d\", &x2, &y2)\n\tfmt.Scanf(\"%d %d\", &x3, &y3)\n\tfmt.Println(\"3\")\n\tfmt.Println(x2-x1+x3, y2-y1+y3)\n\tfmt.Println(x3-x2+x1, y3-y2+y1)\n\tfmt.Println(x1-x3+x2, y1-y3+y2)\n}\n"}], "src_uid": "7725f9906a1b87bf4e866df03112f1e0"}