iidai/codenet huggingface dataset:
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := newScanner()
	S := sc.next()
	if strings.HasPrefix(S, "YAKI") {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}

}

func min(a, b int) int {
	if a > b {
		return b
	}
	return a
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

type scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func newScanner() *scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &scanner{r: rdr}
}
func (s *scanner) next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *scanner) nextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *scanner) nextInt() int {
	v, _ := strconv.Atoi(s.next())
	return v
}
func (s *scanner) nextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}
	return result
}
func (s *scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Example test case(s):
input: YAKINIKU

output: Yes
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

const MOD = int(1e+9) + 7
const INF = 1 << 60

type Mon struct {
	x, h int
}

type Mons []Mon

func (a Mons) Len() int           { return len(a) }
func (a Mons) Less(i, j int) bool { return a[i].x < a[j].x }
func (a Mons) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

type Node struct {
	x, h int
}

type Queue struct {
	arr []Node
}

func (q *Queue) push(v Node) {
	q.arr = append(q.arr, v)
}

func (q *Queue) first() Node {
	return q.arr[0]
}

func (q *Queue) pop() Node {
	res := q.arr[0]
	q.arr = q.arr[1:]
	return res
}

func (q *Queue) isEmpty() bool {
	return len(q.arr) == 0
}

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	N, D, A := sc.nextInt(), sc.nextInt(), sc.nextInt()
	M := make([]Mon, N)
	for i := 0; i < N; i++ {
		M[i] = Mon{sc.nextInt(), sc.nextInt()}
	}
	sort.Sort(Mons(M))
	var q Queue
	ans := 0
	total := 0
	for i := 0; i < N; i++ {
		m := M[i]
		for !q.isEmpty() && q.first().x < m.x {
			total -= q.pop().h
		}
		if total < m.h {
			m.h -= total
			count := ceil(m.h, A)
			ans += count
			damage := count * A
			q.push(Node{m.x + 2*D, damage})
			total += damage
		}
	}

	fmt.Fprintln(wtr, ans)
	wtr.Flush()
}


Example test case(s):
input: 3 3 2
1 2
5 4
9 2

output: 2
Language: Go

package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(a*b, (a+b)*2)
}


Example test case(s):
input: 3 5

output: 15 16
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	appleNum := nextInt()
	pieceNum := nextInt()
	pieceNumMadeFromApples := appleNum * 3
	totalPiece := pieceNumMadeFromApples + pieceNum
	fmt.Println(totalPiece / 2)
}


Example test case(s):
input: 1 3

output: 3
Language: Go

package main

import (
	"fmt"
	"math"
)

func walkOnMultiplicationTable(num int) int {

	div := 0
	for i := int(math.Sqrt(float64(num))); i > 1; i-- {
		if num%i == 0 {
			div = i
			break
		}
	}
	if div == 0 {
		return num - 1
	}
	return div + num/div - 2

}

func main() {
	var a int
	fmt.Scan(&a)
	fmt.Println(walkOnMultiplicationTable(a))
}


Example test case(s):
input: 10

output: 5
Language: Go

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	if product := a * b; product%2 == 0 {
		fmt.Println("Even")
	} else {
		fmt.Println("Odd")
	}
}


Example test case(s):
input: 3 4

output: Even
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func read() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	a, _ := strconv.Atoi(read())
	b, _ := strconv.Atoi(read())

	ret := a + b

	if ret < (a - b) {
		ret = a - b
	}
	if ret < (a * b) {
		ret = a * b
	}

	fmt.Println(ret)
}


Example test case(s):
input: 3 1

output: 4
Language: Go

package main

import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)

func check(e error) {
	if e != nil {
		log.Fatalf("error: %v", e)
	}
}

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	stdin.Scan()
	sage := stdin.Text()

	switch sage {
	case "1":
		fmt.Println("Hello World")
	case "2":
		var sum int
		for i := 0; i < 2; i++ {
			stdin.Scan()
			num, err := strconv.Atoi(stdin.Text())
			check(err)
			sum += num
		}
		fmt.Println(sum)
	}
}


Example test case(s):
input: 1

output: Hello World
Language: Go

package main

import "fmt"

func main() {
	var a, b, c int
	fmt.Scan(&a, &b, &c)

	if c >= a && c <= b {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Example test case(s):
input: 1 3 2

output: Yes
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	s := getNextString(scanner)
	t := getNextString(scanner)

	ns := len(s)
	nt := len(t)
	ss := make([]string, (nt-1)/ns+1)

	for i := 0; i < len(ss); i++ {
		ss[i] = s
	}

	sss := fmt.Sprintf("%s%s", strings.Join(ss, ""), strings.Join(ss, ""))

	ok := make([]bool, ns)

	uni := make([]int, ns)
	mp := MP{}
	mp.init(t)
	m := 0
	for i := 0; i < ns; i++ {
		uni[i] = i
	}
	var o bool
	for i := 0; i < ns; i++ {
		o = true
		for m < nt {
			if t[m] != sss[i+m] {
				o = false
				break
			}
			m++
		}
		ok[i] = o
		if o {
			i += nt - mp.table[m]
			m = mp.table[m]
		}
		for m >= 0 && t[m] != sss[i+m] {
			i += m - mp.table[m]
			m = mp.table[m]
		}
		i--
		m++
	}

	ans := 0
	var r, rr int
	for i := 0; i < ns; i++ {
		if ok[i] == false {
			continue
		}
		if ok[(i+nt)%ns] == false {
			continue
		}
		r = root(i, uni)
		rr = root((i+nt)%ns, uni)
		if rr == r {
			fmt.Println(-1)
			return
		}
		uni[rr] = r
	}

	counter := make([]int, ns)
	for i := 0; i < ns; i++ {
		r = root(i, uni)
		if ok[r] == false {
			continue
		}
		counter[r]++
	}
	for i := 0; i < ns; i++ {
		if ans < counter[i] {
			ans = counter[i]
		}
	}

	fmt.Println(ans)

	writer.Flush()
}

func root(i int, uni []int) int {
	if i == uni[i] {
		return i
	}

	uni[i] = root(uni[i], uni)
	return uni[i]
}

type MP struct {
	s     string
	table []int
}

func (mp *MP) init(s string) {
	mp.s = s
	n := len(s)
	table := make([]int, n+1)
	table[0] = -1
	j := -1
	for i := 0; i < n; i++ {
		for j >= 0 && s[i] != s[j] {
			j = table[j]
		}
		j++
		table[i+1] = j
	}
	mp.table = table
}


Example test case(s):
input: abcabab
ab

output: 3
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	if nextInt()+nextInt() >= nextInt() {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Example test case(s):
input: 50 100 120

output: Yes
Language: Go

package main

import (
	"fmt"
	"unicode"
)

func main() {
	var s string
	fmt.Scan(&s)
	l := len(s)
	ans := "AC"
	if s[0] != 'A' {
		ans = "WA"
	}
	cnt := 0
	for i := 1; i < l; i++ {
		if unicode.IsUpper(rune(s[i])) {
			if i == 1 || i == l-1 || s[i] != 'C' {
				ans = "WA"
			}
			cnt++
		}
	}
	if cnt != 1 {
		ans = "WA"
	}
	fmt.Println(ans)
}


Example test case(s):
input: AtCoder

output: AC
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	var a, _ = strconv.Atoi(nextLine())
	var b, _ = strconv.Atoi(nextLine())

	if a*b%2 != 0 {
		fmt.Println("Odd")
	} else {
		fmt.Println("Even")
	}
}


Example test case(s):
input: 3 4

output: Even
Language: Go

package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	if b%a == 0 {
		fmt.Println(a + b)
	} else {
		fmt.Println(b - a)
	}
}


Example test case(s):
input: 4 12

output: 16
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	num, _ := strconv.Atoi(scanString())
	return num
}

func scanString() string {
	sc.Scan()
	return sc.Text()
}

func scanInts(n int) []int {
	sl := make([]int, n)
	for i := range sl {
		sl[i] = scanInt()
	}
	return sl
}

func scanStrings(n int) []string {
	sl := make([]string, n)
	for i := range sl {
		sl[i] = scanString()
	}
	return sl
}

func init() {
	sc.Split(bufio.ScanWords)
}

func main() {
	r, D, x := scanInt(), scanInt(), scanInt()
	for i := 1; i <= 10; i++ {
		x = r*x - D
		fmt.Println(x)
	}
}


Example test case(s):
input: 2 10 20

output: 30
50
90
170
330
650
1290
2570
5130
10250
Language: Go

package main

import (
	"fmt"
)

func min(nums ...int) int {
	min := nums[0]
	for _, v := range nums {
		if v < min {
			min = v
		}
	}
	return min
}

func main() {
	var n, a, b int
	fmt.Scan(&n, &a, &b)

	fmt.Println(min(n*a, b))
}


Example test case(s):
input: 7 17 120

output: 119
Language: Go

package main

import (
	"fmt"
	"strings"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n, &s)
	fmt.Println(strings.Count(s, "ABC"))
}


Example test case(s):
input: 10
ZABCDBABCQ

output: 2
Language: Go

package main

import (
	"bufio"
	"bytes"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type node struct {
	key  int32
	prev *node
	next *node
}

func (n *node) rPrint(buf *bytes.Buffer) {
	buf.WriteString(fmt.Sprint(n.key))
	if n.next != nil {
		buf.WriteString(" ")
		n.next.rPrint(buf)
	}
	return
}

func (n *node) Delete(first, last *node) (*node, *node) {
	if n.prev != nil && n.next != nil {

		n.prev.next = n.next
		n.next.prev = n.prev
		return first, last
	}

	if n.next == nil && n.prev == nil {
		return nil, nil
	}

	if n.prev == nil {
		first = n.next
		n.next.prev = nil
	}

	if n.next == nil {
		last = n.prev
		n.prev.next = nil
	}

	return first, last
}

func initNode(key int32) *node {
	return &node{
		key: key,
	}
}

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	var first, last *node
	stdin.Scan()

	for stdin.Scan() {
		cmd := stdin.Text()
		switch cmd {
		case "deleteFirst":
			first, last = first.Delete(first, last)
		case "deleteLast":
			first, last = last.Delete(first, last)
		default:
			xcmd := strings.Split(cmd, " ")
			k, _ := strconv.Atoi(xcmd[1])
			k32 := int32(k)
			switch xcmd[0] {
			case "delete":
				for a := first; a != nil; a = a.next {
					if a.key == k32 {
						first, last = a.Delete(first, last)
						break
					}
				}
			case "insert":
				n := initNode(k32)
				n.next = first
				if first != nil {
					first.prev = n
				}

				first = n
				if last == nil {
					last = n
				}
			}
		}
	}
	var buf bytes.Buffer
	first.rPrint(&buf)
	fmt.Println(buf.String())
}


Example test case(s):
input: 7
insert 5
insert 2
insert 3
insert 1
delete 3
insert 6
delete 5

output: 6 1 2
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	input := Input{bufio.NewReaderSize(os.Stdin, 1000000)}
	n := input.NextInt()
	s := input.NextIntArray()
	u := make([]bool, n)
	var m, f int64
	for c := 1; c < n-1; c++ {
		f = 0
		for k := 0; c < n-1-k*c; k++ {
			u[k*c] = true
			if u[n-1-k*c] {
				break
			}
			f += s[n-1-k*c] + s[k*c]
			if m < f {
				m = f
			}
		}
		for k := 0; k*c < n-1; k++ {
			u[k*c] = false
		}
	}
	fmt.Println(m)
}

type Input struct {
	reader *bufio.Reader
}

func (i *Input) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := i.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}
func (i *Input) NextInt() int {
	n, _ := strconv.Atoi(i.NextLine())
	return n
}
func (i *Input) NextIntArray() []int64 {
	s := strings.Split(i.NextLine(), " ")
	a := make([]int64, len(s))
	for i := 0; i < len(s); i++ {
		a[i], _ = strconv.ParseInt(s[i], 10, 64)
	}
	return a
}


Example test case(s):
input: 5
0 2 5 1 0

output: 3
Language: Go

package main

import (
	"fmt"
	"math"
)

func main() {
	var N, M int
	var ans int
	fmt.Scan(&N, &M)
	if N == 1 && M == 1 {
		ans += 1
	} else if 1 < N && 1 < M {
		ans += (N - 2) * (M - 2)
	} else {
		ans += (N * M) - 2
	}

	fmt.Println(ans)
}

func max(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Max(float64(x[i]), float64(res)))
	}
	return res
}

func min(x ...int) int {
	var res int = x[0]
	for i := 1; i < len(x); i++ {
		res = int(math.Min(float64(x[i]), float64(res)))
	}
	return res
}
func pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }
func abs(x int) int    { return int(math.Abs(float64(x))) }
func floor(x int) int  { return int(math.Floor(float64(x))) }

type SortBy []int

func (a SortBy) Len() int           { return len(a) }
func (a SortBy) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a SortBy) Less(i, j int) bool { return abs(a[i]) < abs(a[j]) }


Example test case(s):
input: 2 2

output: 0
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
)

type deque struct {
	front, back []byte
}

func (deq *deque) isEmptyFront() bool {
	return len(deq.front) == 0
}
func (deq *deque) isEmptyBack() bool {
	return len(deq.back) == 0
}

func (deq *deque) pushBack(v byte) {
	deq.back = append(deq.back, v)
}
func (deq *deque) pushFront(v byte) {
	deq.front = append(deq.front, v)
}
func (deq *deque) popBack(v *byte) bool {
	r := true
	if !deq.isEmptyBack() {
		*v = deq.back[len(deq.back)-1]
		deq.back = deq.back[:len(deq.back)-1]
	} else if !deq.isEmptyFront() {
		*v = deq.front[0]
		deq.front = deq.front[1:]
	} else {
		r = false
	}
	return r
}
func (deq *deque) popFront(v *byte) bool {
	r := true
	if !deq.isEmptyFront() {
		*v = deq.front[len(deq.front)-1]
		deq.front = deq.front[:len(deq.front)-1]
	} else if !deq.isEmptyBack() {
		*v = deq.back[0]
		deq.back = deq.back[1:]
	} else {
		r = false
	}
	return r
}

func (deq *deque) get(idx int) byte {
	tot := len(deq.front) + len(deq.back)
	var v byte
	if idx < tot {
		if idx < len(deq.front) {
			v = deq.front[len(deq.front)-1-idx]
		} else {
			v = deq.back[idx-len(deq.front)]
		}
	}
	return v
}

type op struct {
	rev, front bool
	c          byte
}

func rev(s string) string {
	r := make([]byte, len(s))
	i, j := len(s)-1, 0
	for i >= 0 {
		r[j] = s[i]
		j++
		i--
	}
	return string(r)
}

func main() {
	var S string
	fmt.Scan(&S)
	var Q int
	fmt.Scan(&Q)
	ops := make([]op, Q)
	for i := 0; i < Q; i++ {
		var q int
		fmt.Scan(&q)
		if q == 1 {
			ops[i].rev = true
		} else {
			var f int
			fmt.Scanf("%d %c", &f, &ops[i].c)
			if f == 1 {
				ops[i].front = true
			}
		}
	}
	sum := make([]int, Q+1)
	for i := Q - 1; i >= 1; i-- {
		if ops[i].rev {
			sum[i-1] = sum[i] + 1
		} else {
			sum[i-1] = sum[i]
		}
	}

	if sum[0]%2 == 1 {
		S = rev(S)
	}
	var deq deque
	for i := 0; i < Q; i++ {
		if !ops[i].rev {
			if ops[i].front {
				if sum[i]%2 == 1 {
					deq.pushBack(ops[i].c)
				} else {
					deq.pushFront(ops[i].c)
				}
			} else {
				if sum[i]%2 == 1 {
					deq.pushFront(ops[i].c)
				} else {
					deq.pushBack(ops[i].c)
				}
			}
		}
	}
	wtr := bufio.NewWriter(os.Stdout)

	for i := len(deq.front) - 1; i >= 0; i-- {
		fmt.Fprint(wtr, string(deq.front[i]))
	}
	for i := 0; i < len(S); i++ {
		fmt.Fprint(wtr, string(S[i]))
	}
	for i := 0; i < len(deq.back); i++ {
		fmt.Fprint(wtr, string(deq.back[i]))
	}
	fmt.Fprintln(wtr)
	wtr.Flush()
}


Example test case(s):
input: a
4
2 1 p
1
2 2 c
1

output: cpa
Language: Go

package main

import (
	"fmt"
)

func main() {
	var data int
	fmt.Scan(&data)
	var result = data * data * data
	fmt.Printf("%d\n", result)
}


Example test case(s):
input: 2

output: 8
Language: Go

package main

import (
	"fmt"
)

func main() {
	var a, b, h int
	fmt.Scan(&a, &b, &h)

	fmt.Println((a + b) * h / 2)
}


Example test case(s):
input: 3
4
2

output: 7
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getNextWord(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextWord(scanner))
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	m := getNextInt(scanner)
	aa := make(map[int]int, 0)
	for i := 0; i < m; i++ {
		aa[getNextInt(scanner)] = 1
	}

	dp := make([]int, n+1)
	dp[0] = 1
	for i := 0; i < n; i++ {
		for ii := 1; ii <= 2 && i+ii <= n; ii++ {
			_, ok := aa[i+ii]
			if ok {
				continue
			}
			dp[i+ii] += dp[i]
			dp[i+ii] %= 1000000007
		}
	}
	fmt.Fprintln(writer, dp[n])

	writer.Flush()
}


Example test case(s):
input: 6 1
3

output: 4
Language: Go

package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	price := 700
	for _, c := range s {
		if c == 'o' {
			price += 100
		}
	}
	fmt.Println(price)
}


Example test case(s):
input: oxo

output: 900
Language: Go

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const mod = 1000000007

const ioBufferSize = 1 * 1024 * 1024

var sc = func() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	sc.Split(bufio.ScanWords)
	return sc
}()

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	h, n := nextInt(), nextInt()
	a := 0

	for i := 0; i < n; i++ {
		a += nextInt()
	}

	if h > a {
		fmt.Println("No")
	} else {
		fmt.Println("Yes")
	}
}


Example test case(s):
input: 10 3
4 5 6

output: Yes
Language: Go

package main

import "fmt"

func main() {
	var n, k int
	fmt.Scanf("%d %d\n", &n, &k)

	if k <= (n+n%2)/2 {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Example test case(s):
input: 3 2

output: YES
Language: Go

package main

import (
	_ "bufio"
	"fmt"
	_ "os"
	_ "strconv"
)

func main() {
	var x, a, b int
	fmt.Scan(&x, &a, &b)
	switch {
	case b-a <= 0:
		fmt.Println("delicious")
		break
	case b-a <= x:
		fmt.Println("safe")
		break
	default:
		fmt.Println("dangerous")
		break
	}
}


Example test case(s):
input: 4 3 6

output: safe
Language: Go

package main

import (
	"fmt"
)

func comp(x, a int) int {
	if x < a {
		return 0
	}
	return 10
}

func main() {
	var x, a int
	fmt.Scan(&x, &a)

	fmt.Println(comp(x, a))
}


Example test case(s):
input: 3 5

output: 0
Language: Go

package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
)

func main() {
	N := getInt()
	sqrtN := int(math.Sqrt(float64(N)))

	min := N
	for i := 1; i <= sqrtN; i++ {
		if N%i != 0 {
			continue
		}

		num := i + (N / i) - 2
		if num < min {
			min = num
		}
	}

	fmt.Println(min)
}

type Graph struct {
	n     int
	edges [][]int
}

func NewGraph(n int) *Graph {
	g := &Graph{
		n:     n,
		edges: make([][]int, n),
	}
	return g
}

func (g *Graph) AddEdge(u, v int) {
	g.edges[v] = append(g.edges[v], u)
	g.edges[u] = append(g.edges[u], v)
}

func dfs(c int, edges [][]int, visited map[int]struct{}) {
	visited[c] = struct{}{}

	for _, v := range edges[c] {
		_, flag := visited[v]
		if flag {
			continue
		}
		dfs(v, edges, visited)
	}
}

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func abs(a int) int {
	return int(math.Abs(float64(a)))
}

func pow(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func powMod(n, p int) int {
	if p == 0 {
		return 1
	} else if p%2 == 0 {
		t := powMod(n, p/2)
		return calcMod(t * t)
	} else {
		return calcMod(n * powMod(n, p-1))
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

func strSearch(a []string, b string) bool {
	for i := 0; i < len(a); i++ {
		if a[i] == b {
			return true
		}
	}
	return false
}

func printIntArray(array []int) {
	strArray := fmt.Sprint(array)
	fmt.Println(strArray[1 : len(strArray)-1])
}

func calcMod(x int) int {
	return x % mod
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func isPrime(n int) bool {
	if n < 2 {
		return false
	} else if n == 2 {
		return true
	} else if n%2 == 0 {
		return false
	}

	sqrtN := int(math.Sqrt(float64(n)))
	for i := 3; i <= sqrtN; i += 2 {
		if n%i == 0 {
			return false
		}
	}

	return true
}


Example test case(s):
input: 10

output: 5