A frog is currently at the point $$$0$$$ on a coordinate axis $$$Ox$$$. It jumps by the following algorithm: the first jump is $$$a$$$ units to the right, the second jump is $$$b$$$ units to the left, the third jump is $$$a$$$ units to the right, the fourth jump is $$$b$$$ units to the left, and so on.Formally:   if the frog has jumped an even number of times (before the current jump), it jumps from its current position $$$x$$$ to position $$$x+a$$$;  otherwise it jumps from its current position $$$x$$$ to position $$$x-b$$$. Your task is to calculate the position of the frog after $$$k$$$ jumps.But... One more thing. You are watching $$$t$$$ different frogs so you have to answer $$$t$$$ independent queries.

The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of queries. Each of the next $$$t$$$ lines contain queries (one query per line). The query is described as three space-separated integers $$$a, b, k$$$ ($$$1 \le a, b, k \le 10^9$$$) — the lengths of two types of jumps and the number of jumps, respectively.

Print $$$t$$$ integers. The $$$i$$$-th integer should be the answer for the $$$i$$$-th query.

NoteIn the first query frog jumps $$$5$$$ to the right, $$$2$$$ to the left and $$$5$$$ to the right so the answer is $$$5 - 2 + 5 = 8$$$.In the second query frog jumps $$$100$$$ to the right, $$$1$$$ to the left, $$$100$$$ to the right and $$$1$$$ to the left so the answer is $$$100 - 1 + 100 - 1 = 198$$$.In the third query the answer is $$$1 - 10 + 1 - 10 + 1 = -17$$$.In the fourth query the answer is $$$10^9 - 1 + 10^9 - 1 + 10^9 - 1 = 2999999997$$$.In the fifth query all frog's jumps are neutralized by each other so the answer is $$$0$$$.The sixth query is the same as the fifth but without the last jump so the answer is $$$1$$$.

package main

import "fmt"

func main() {

	var t,a,b,k,res,i int64
	fmt.Scanln(&t)
	for i=0; i<t;i++ {
		fmt.Scanln(&a,&b,&k)
		res = a*(k/2)+(-b)*(k/2)
		if k%2==1 {
			res+=a
		}
		fmt.Println(res)
	}

}

package main

import (
    "fmt"
)

func main() {
    var t int
    var a, b, k int64
    fmt.Scan(&t)
    for i := 0; i < t; i++ {
        fmt.Scan(&a, &b, &k)
        n := k / 2
        fmt.Println(n*a - n*b + (k%2)*a)
    }
}

package main

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

func main() {
    stdin := bufio.NewReader(os.Stdin)
    var t int
    var a, b, k int64
    fmt.Fscan(stdin, &t)
    for i := 0; i < t; i++ {
        fmt.Fscan(stdin, &a, &b, &k)
        n := k / 2
        fmt.Println(n*a - n*b + (k%2)*a)
    }
}

package main

import (
    "fmt"
)

func main() {
    var n int64
    fmt.Scan(&n)
    for i := int64(0); i < n; i++ {
        var a, b, k int64
        fmt.Scan(&a, &b, &k)
        res := (a * (k / 2)) - (b * (k / 2))
        if k % 2 == 1 {
            res += a
        }
        fmt.Println(res)
    }
}

package main

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

func main() {
	var t int
	var a, b, k int64
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &a, &b, &k)
		m := k / 2
		ans := m*a - m*b
		if k%2 == 1 {
			ans += a
		}
		fmt.Println(ans)
	}
}

// A. Frog Jumping
/*
A frog is currently at the point 0 on a coordinate axis 𝑂𝑥. It jumps by the following algorithm: the first jump is 𝑎 units to the right, the second jump is 𝑏 units to the left, the third jump is 𝑎 units to the right, the fourth jump is 𝑏 units to the left, and so on.

Formally:

    if the frog has jumped an even number of times (before the current jump), it jumps from its current position 𝑥 to position 𝑥+𝑎;
    otherwise it jumps from its current position 𝑥 to position 𝑥−𝑏.

Your task is to calculate the position of the frog after 𝑘 jumps.

But... One more thing. You are watching 𝑡 different frogs so you have to answer 𝑡 independent queries.

Input
The first line of the input contains one integer 𝑡 (1≤𝑡≤1000) — the number of queries.

Each of the next 𝑡 lines contain queries (one query per line).

The query is described as three space-separated integers 𝑎,𝑏,𝑘 (1≤𝑎,𝑏,𝑘≤109) — the lengths of two types of jumps and the number of jumps, respectively.

Output
Print 𝑡 integers. The 𝑖-th integer should be the answer for the 𝑖-th query.

Example
Input
6
5 2 3
100 1 4
1 10 5
1000000000 1 6
1 1 1000000000
1 1 999999999

Output
8
198
-17
2999999997
0
1

Note
In the first query frog jumps 5 to the right, 2 to the left and 5 to the right so the answer is 5−2+5=8.

In the second query frog jumps 100 to the right, 1 to the left, 100 to the right and 1 to the left so the answer is 100−1+100−1=198.

In the third query the answer is 1−10+1−10+1=−17.

In the fourth query the answer is 109−1+109−1+109−1=2999999997.

In the fifth query all frog's jumps are neutralized by each other so the answer is 0.

The sixth query is the same as the fifth but without the last jump so the answer is 1.
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input1, _ := reader.ReadString('\n')
	n, _ := strconv.Atoi(strings.TrimSpace(input1))

	for ; n > 0; n-- {
		input2, _ := reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(input2), " ")

		a, _ := strconv.ParseInt(strings.TrimSpace(arr[0]), 10, 64)
		b, _ := strconv.ParseInt(strings.TrimSpace(arr[1]), 10, 64)
		k, _ := strconv.ParseInt(strings.TrimSpace(arr[2]), 10, 64)

		r, q := k%2, k/2
		if r == 0 {
			fmt.Println((q * a) - (q * b))
		} else {
			fmt.Println(((q + 1) * a) - (q * b))
		}
	}
}

package main

import "fmt"

func main() {
	var n, a, b, k, i int64
	_, err := fmt.Scan(&n)
	if err != nil {
		panic(err)
	}
	for i = 0; i < n; i++ {
		_, err = fmt.Scan(&a, &b, &k)
		if err != nil {
			panic(err)
		}
		res := (a-b)*(k/2) + a*(k%2)
		fmt.Println(res)
	}
}

package main

import "fmt"

func frogJump(a, b, k int64) int64 {
	res := (k + 1) / 2 * a
	res -= k / 2 * b
	return res
}

func main() {
	var t int
	fmt.Scan(&t)

	ans := make([]int64, t)
	for i := range ans {
		var a, b, k int64
		fmt.Scan(&a, &b, &k)

		ans[i] = frogJump(a, b, k)
	}

	for _, v := range ans {
		fmt.Println(v)
	}
}

package main

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

func frogJump(a, b, k int64) int64 {
	res := (k + 1) / 2 * a
	res -= k / 2 * b
	return res
}

func main() {
	io := newIo()
	defer io.flush()

	t := io.nextInt()
	ans := make([]int64, t)
	for i := range ans {
		a := io.nextInt()
		b := io.nextInt()
		k := io.nextInt()
		ans[i] = frogJump(a, b, k)
	}

	for _, v := range ans {
		io.printf("%d\n", v)
	}
}

type _io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func newIo() *_io {
	return &_io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (_io *_io) flush() {
	_ = _io.writer.Flush()
}

func (_io *_io) nextLine() string {
	var buffer []byte
	for {
		line, isPrefix, _ := _io.reader.ReadLine()
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (_io *_io) next() string {
	for _io.nextToken >= len(_io.tokens) {
		line := _io.nextLine()
		_io.tokens = strings.Fields(line)
		_io.nextToken = 0
	}
	r := _io.tokens[_io.nextToken]
	_io.nextToken++
	return r
}

func (_io *_io) nextInt() int64 {
	i, _ := strconv.ParseInt(_io.next(), 10, 64)
	return i
}

func (_io *_io) printf(format string, a ...interface{}) {
	fmt.Fprintf(_io.writer, format, a...)
}

package main

import "fmt"

func main() {
	var index int64
	var r, l, k int64
	fmt.Scan(&index)
	for ; index > 0; index-- {
		fmt.Scan(&r, &l, &k)
		fmt.Printf("%v\n", ((k+1)/2*r - k/2*l))
	}

}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

type query struct {
	a int64
	b int64
	k int64
}

func main() {
	defer writer.Flush()

	var t int64
	scanf("%d\n", &t)
	queries := make([]query, t)
	for i := int64(0); i < t; i++ {
		scanf("%d %d %d\n", &(queries[i].a), &(queries[i].b), &(queries[i].k))
	}

	for i, q := range queries {
		if i == len(queries)-1 {
			printf("%d", q.a*((q.k+1)/2)-q.b*(q.k/2))
		} else {
			printf("%d\n", q.a*((q.k+1)/2)-q.b*(q.k/2))
		}
	}
}

package main

import "fmt"

func main() {

	var n int64

	fmt.Scan(&n)

	for ;n != 0; n-- {

		var a,b,k int64

		fmt.Scan(&a, &b, &k)

		if k&1 == 0 {
			fmt.Println(int64((k/2)*(a-b)))
		} else {
			fmt.Println(int64(((k-1)/2)*(a-b) + a))
		}
	}
}

package main

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

func main() {
	stdin := bufio.NewReader(os.Stdin)
	var n, a, b, k int64
	fmt.Fscan(stdin, &n)
	for n > 0 {
		n--
		fmt.Fscan(stdin, &a, &b, &k)
		fmt.Println((k / 2) * (a - b) + a * (k % 2))
	}
}

package main

import "fmt"

func main() {
    var n int
    fmt.Scanf("%d\n", &n)
    for n > 0 {
        n--
        var k, x, y int
        fmt.Scanf("%d %d %d\n", &x, &y, &k)
        var cnt int64 = int64(x - y) * int64(k / 2)
        if k % 2 == 1 {
            cnt += int64(x)
        }
        fmt.Println(cnt)
    }
}

package main

import "fmt"

type request struct {
	a int64
	b int64
	k int64
}

func main() {
	var (
		requests [1000]request
		nReq     int64
		i        int64
	)
	fmt.Scanln(&nReq)
	for i = 0; i < nReq; i++ {
		fmt.Scanln(&requests[i].a, &requests[i].b, &requests[i].k)
	}
	for i = 0; i < nReq; i++ {
		fmt.Println(requests[i].b*(requests[i].k/-2) + requests[i].a*(requests[i].k-requests[i].k/2))
	}
}

package main

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

func calcFrog(a, b, k int64) (x int64) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var text string
	reader := bufio.NewReader(os.Stdin)

	text, _ = reader.ReadString('\n')
	text = strings.TrimSpace(text)
	n64, _ := strconv.ParseInt(text, 10, 64)
	n := n64

	frogs := make([][3]int64, n)

	for i := int64(0); i < n; i++ {
		text, _ = reader.ReadString('\n')
		text = strings.TrimSpace(text)
		f := [3]int64{}
		for j, v := range strings.Split(text, " ") {
			vi, _ := strconv.ParseInt(v, 10, 64)
			f[j] = vi
		}
		frogs[i] = f
	}

	for _, f := range frogs {
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}
}

package main

import (
	"fmt"
)

func calcFrog(a, b, k int64) (x int64) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var n int64
	fmt.Scan(&n)
	frogs := make([][3]int64, n)

	for i := int64(0); i < n; i++ {
		f := [3]int64{}
		fmt.Scan(&f[0], &f[1], &f[2])
		frogs[i] = f
	}

	for _, f := range frogs {
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}
}

package main

import (
	"fmt"
)

func calcFrog(a, b, k int64) (x int64) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var n int64
	fmt.Scan(&n)
	frogs := make([][3]int64, n)

	for i := int64(0); i < n; i++ {
		f := [3]int64{}
		for j := 0; j < 3; j++ {
			fmt.Scan(&f[j])
		}
		frogs[i] = f
	}

	for _, f := range frogs {
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		var a, b, k int64
		fmt.Scan(&a, &b, &k)
		var n int64 = k/2
		var i int64 = a
		if k%2 == 0 {
			i -= b
			n--
		}
		i -= b*n
		i += a*n
		fmt.Println(i)
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int64
	fmt.Scan(&n)

	for ;n > 0;n-- {
		var a, b, k int64
		fmt.Scan(&a, &b, &k)
		var n int64 = k/2
		var i int64 = a
		if k%2 == 0 {
			i -= b
			n--
		}
		i -= b*n
		i += a*n
		fmt.Println(i)
	}
}

package main

import "fmt"

func main() {
    var t,a,b,k int64
    fmt.Scan(&t)
    for ;t>0;t-- {
        fmt.Scan(&a, &b, &k)
        fmt.Printf("%v\n", ((k+1)/2*a - k/2*b))
    }
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanln(&input)
	i := 0
	for i < input {
		var k, a, b int64
		fmt.Scanln(&a, &b, &k)
		if t := k / 2; k%2 == 1 {
			fmt.Println(t*(a-b) + a)
		} else {
			fmt.Println(t * (a - b))
		}
		i += 1
	}
}

package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

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

func scanBytes() []byte {
	scanner.Scan()
	return scanner.Bytes()
}

func scanInt64() int64 {
	scanner.Scan()
	v, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return v
}

func scanInt() int {
	scanner.Scan()
	v, _ := strconv.Atoi(scanner.Text())
	return v
}

func scanInts(n int) []int {
	l := make([]int, n)
	for i := 0; i < n; i++ {
		scanner.Scan()
		l[i], _ = strconv.Atoi(scanner.Text())
	}

	return l
}

func scanInts64(n int64) []int64 {
	l := make([]int64, n)
	for i := int64(0); i < n; i++ {
		scanner.Scan()
		l[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)
	}

	return l
}

func scanBool() bool {
	scanner.Scan()
	v, _ := strconv.ParseInt(scanner.Text(), 10, 64)
	return v == 1
}

func scanBools(n int64) []bool {
	l := make([]bool, n)
	for i := int64(0); i < n; i++ {
		scanner.Scan()
		v, _ := strconv.ParseInt(scanner.Text(), 10, 64)
		l[i] = v == 1
	}

	return l
}

func main() {
	n := scanInt()

	for i := 0; i < n; i++ {
		a, b, k := scanInt64(), scanInt64(), scanInt64()
		cnt := int64(math.Ceil(float64(k) / 2.0))
		dist := a*cnt - b*(k-cnt)
		fmt.Println(dist)
	}
}

func abs(a int64) int64 {
	if a >= 0 {
		return a
	}

	return -a
}

func min(a, b int64) int64 {
	if a < b {
		return a
	}

	return b
}

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

	return b
}

package main

import "fmt"

func main() {

	var t,a,b,k,res int
	fmt.Scanln(&t)
	for i :=0; i<t;i++ {
		fmt.Scanln(&a,&b,&k)
		res = a*(k/2)+(-b)*(k/2)
		if k%2==1 {
			res+=a
		}
		fmt.Println(res)
	}

}

package main

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

func main() {
	var t, a, b, k int
	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &t)
	for i := 0; i < t; i++ {
		fmt.Fscan(in, &a, &b, &k)
		m := k / 2
		ans := m*a - m*b
		if k%2 == 1 {
			ans += a
		}
		fmt.Println(ans)
	}
}

// A. Frog Jumping
/*
A frog is currently at the point 0 on a coordinate axis 𝑂𝑥. It jumps by the following algorithm: the first jump is 𝑎 units to the right, the second jump is 𝑏 units to the left, the third jump is 𝑎 units to the right, the fourth jump is 𝑏 units to the left, and so on.

Formally:

    if the frog has jumped an even number of times (before the current jump), it jumps from its current position 𝑥 to position 𝑥+𝑎;
    otherwise it jumps from its current position 𝑥 to position 𝑥−𝑏.

Your task is to calculate the position of the frog after 𝑘 jumps.

But... One more thing. You are watching 𝑡 different frogs so you have to answer 𝑡 independent queries.

Input
The first line of the input contains one integer 𝑡 (1≤𝑡≤1000) — the number of queries.

Each of the next 𝑡 lines contain queries (one query per line).

The query is described as three space-separated integers 𝑎,𝑏,𝑘 (1≤𝑎,𝑏,𝑘≤109) — the lengths of two types of jumps and the number of jumps, respectively.

Output
Print 𝑡 integers. The 𝑖-th integer should be the answer for the 𝑖-th query.

Example
Input
6
5 2 3
100 1 4
1 10 5
1000000000 1 6
1 1 1000000000
1 1 999999999

Output
8
198
-17
2999999997
0
1

Note
In the first query frog jumps 5 to the right, 2 to the left and 5 to the right so the answer is 5−2+5=8.

In the second query frog jumps 100 to the right, 1 to the left, 100 to the right and 1 to the left so the answer is 100−1+100−1=198.

In the third query the answer is 1−10+1−10+1=−17.

In the fourth query the answer is 109−1+109−1+109−1=2999999997.

In the fifth query all frog's jumps are neutralized by each other so the answer is 0.

The sixth query is the same as the fifth but without the last jump so the answer is 1.
*/
package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	input1, _ := reader.ReadString('\n')
	n, _ := strconv.Atoi(strings.TrimSpace(input1))

	for ; n > 0; n-- {
		input2, _ := reader.ReadString('\n')
		arr := strings.Split(strings.TrimSpace(input2), " ")

		a, _ := strconv.Atoi(strings.TrimSpace(arr[0]))
		b, _ := strconv.Atoi(strings.TrimSpace(arr[1]))
		k, _ := strconv.Atoi(strings.TrimSpace(arr[2]))

		r, q := k%2, k/2
		if r == 0 {
			fmt.Println((q * a) - (q * b))
		} else {
			fmt.Println(((q + 1) * a) - (q * b))
		}
	}
}

package main

import "fmt"

func main() {
	var n, a, b, k, i int
	_, err := fmt.Scan(&n)
	if err != nil {
		panic(err)
	}
	for i = 0; i < n; i++ {
		_, err = fmt.Scan(&a, &b, &k)
		if err != nil {
			panic(err)
		}
		res := (a-b)*(k/2) + a*(k%2)
		fmt.Println(res)
	}
}

package main

import "fmt"

func main() {
	var n, a, b, k int
	_, err := fmt.Scan(&n)
	if err != nil {
		panic(err)
	}
	for i := 0; i < n; i++ {
		_, err = fmt.Scan(&a, &b, &k)
		if err != nil {
			panic(err)
		}
		res := (b-a)*(k/2) + a*(k%2)
		fmt.Println(res)
	}
}

package main

import "fmt"

func main() {
	var n, a, b, k int
	_, err := fmt.Scanln(&n)
	if err != nil {
		panic(err)
	}
	for i := 0; i < n; i++ {
		_, err = fmt.Scanln(&a, &b, &k)
		if err != nil {
			panic(err)
		}
		res := (a-b)*(k/2) + a*(k%2)
		fmt.Println(res)
	}
}

package main

import "fmt"

func frogJump(a, b, k int) int {
	res := 0
	res += (k + 1) / 2 * a
	res -= k / 2 * b
	return res
}

func main() {
	var t int
	fmt.Scan(&t)

	ans := make([]int, t)
	for i := range ans {
		var a, b, k int
		fmt.Scan(&a, &b, &k)

		ans[i] = frogJump(a, b, k)
	}

	for _, v := range ans {
		fmt.Println(v)
	}
}

package main

import "fmt"

func main() {
	var index int
	var r, l, k int
	fmt.Scan(&index)
	for ; index > 0; index-- {
		fmt.Scan(&r, &l, &k)
		fmt.Printf("%v\n", ((k+1)/2*r - k/2*l))
	}

}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

type query struct {
	a int
	b int
	k int
}

func main() {
	defer writer.Flush()

	var t int
	fmt.Scanf("%d\n", &t)
	queries := make([]query, t)
	for i := 0; i < t; i++ {
		fmt.Scanf("%d %d %d\n", &(queries[i].a), &(queries[i].b), &(queries[i].k))
	}

	// fmt.Printf("Queries=%v\n", queries)

	for _, q := range queries {
		fmt.Printf("%d\n", q.a*((q.k+1)/2)-q.b*(q.k/2))
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

type query struct {
	a int
	b int
	k int
}

func main() {
	defer writer.Flush()

	var t int
	scanf("%d\n", &t)
	queries := make([]query, t)
	for i := 0; i < t; i++ {
		scanf("%d %d %d\n", &(queries[i].a), &(queries[i].b), &(queries[i].k))
	}

	for i, q := range queries {
		if i == len(queries)-1 {
			printf("%d", q.a*((q.k+1)/2)-q.b*(q.k/2))
		} else {
			printf("%d\n", q.a*((q.k+1)/2)-q.b*(q.k/2))
		}
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

type query struct {
	a int
	b int
	k int
}

func main() {
	defer writer.Flush()

	var t int
	scanf("%d\n", &t)
	queries := make([]query, t)
	for i := 0; i < t; i++ {
		scanf("%d %d %d\n", &(queries[i].a), &(queries[i].b), &(queries[i].k))
	}

	for _, q := range queries {
		printf("%d\n", q.a*((q.k+1)/2)-q.b*(q.k/2))
	}
}

package main

import "fmt"

func main() {

	var n int

	fmt.Scan(&n)

	for ;n != 0; n-- {

		var a,b,k int

		fmt.Scan(&a, &b, &k)

		if k&1 == 0 {
			fmt.Println((k/2)*(a-b))
		} else {
			fmt.Println(((k-1)/2)*(a-b) + a)
		}
	}
}

package main

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

func main() {
	stdin := bufio.NewReader(os.Stdin)
	var n, a, b, k int64
	fmt.Scan(stdin, &n)
	for n > 0 {
		n--
		fmt.Scan(stdin, &a, &b, &k)
		fmt.Println((k / 2) * (a - b) + a * (k % 2))
	}
}

package main

import "fmt"

func main() {
    var n int
    fmt.Scanf("%d\n", &n)
    for n > 0 {
        n--
        var k, x, y int
        fmt.Scanf("%d %d %d\n", &x, &y, &k)
        var cnt int = (x - y) * (k / 2)
        if k % 2 == 1 {
            cnt += x
        }
        fmt.Println(cnt)
    }
}

package main

import "fmt"

func main() {
    var n int
    fmt.Scanf("%d\n", &n)
    for n > 0 {
        n--
        var k, x, y int
        fmt.Scanf("%d %d %d\n", &x, &y, &k)
        cnt := (x - y) * (k / 2)
        if k % 2 == 1 {
            cnt += x
        }
        fmt.Println(cnt)
    }
}

package main

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

func calcFrog(a int, b int, k int) (x int) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var text string
	reader := bufio.NewReader(os.Stdin)

	text, _ = reader.ReadString('\n')
	text = strings.TrimSpace(text)
	n64, _ := strconv.ParseInt(text, 10, 64)
	n := int(n64)

	frogs := make([][3]int, n)

	for i := 0; i < n; i++ {
		text, _ = reader.ReadString('\n')
		text = strings.TrimSpace(text)
		f := [3]int{}
		for j, v := range strings.Split(text, " ") {
			vi, _ := strconv.ParseInt(v, 10, 64)
			f[j] = int(vi)
		}
		frogs[i] = f
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}

	//for _, f := range frogs {
	//	fmt.Println(calcFrog(f[0], f[1], f[2]))
	//}
}

package main

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

func calcFrog(a int, b int, k int) (x int) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var text string
	reader := bufio.NewReader(os.Stdin)

	text, _ = reader.ReadString('\n')
	text = strings.TrimSpace(text)
	n64, _ := strconv.ParseInt(text, 10, 64)
	n := int(n64)

	frogs := make([][3]int, n)

	for i := 0; i < n; i++ {
		text, _ = reader.ReadString('\n')
		text = strings.TrimSpace(text)
		f := [3]int{}
		for j, v := range strings.Split(text, " ") {
			vi, _ := strconv.ParseInt(v, 10, 64)
			f[j] = int(vi)
		}
		frogs[i] = f
	}

	for _, f := range frogs {
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}
}

package main

import (
	"fmt"
)

func calcFrog(a, b, k int64) (x int64) {
	opC := k / 2
	x += a * opC
	x -= b * opC
	if (opC * 2) != k {
		x += a
	}
	return
}

func main() {
	var n int64
	fmt.Scan(&n)
	frogs := make([][3]int64, n)

	for i := int64(0); i < n; i++ {
		f := [3]int64{}
		fmt.Scan(&f)
		frogs[i] = f
	}

	for _, f := range frogs {
		fmt.Println(calcFrog(f[0], f[1], f[2]))
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		var a, b, k int
		fmt.Scan(&a, &b, &k)
		n := k/2
		i := a
		i -= b*n
		i += a*n
		if k%2 == 0 {
			i -= b
		}
		fmt.Println(i)
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		i := 0
		var a, b, k int
		fmt.Scan(&a, &b, &k)
		for j := 0; j < k; j+=2 {
				i += a
				if j < k - 2 {
					i -= b
				}
		}
		fmt.Println(i)
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		i := 0
		var a, b, k int
		fmt.Scan(&a, &b, &k)
		n := k/2
		i += a*n
		i -= b*n
		if k%2 != 0 {
			i -= b
		}
		fmt.Println(i)
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		var a, b, k int
		fmt.Scan(&a, &b, &k)
		n := k/2
		i := a
		if k%2 == 0 {
			i -= b
			n--
		}
		i -= b*n
		i += a*n
		fmt.Println(i)
	}
}

package main

import (
	"fmt"
	"os"
)

func settest() (*os.File, *os.File) {
	f, err := os.Open("a.dat")
	if err != nil {
		panic(err)
	}

	oldStdin := os.Stdin
	os.Stdin = f

	return f, oldStdin
}

func main() {
	/*f, oldStdin := settest()
	defer f.Close()
	defer func() { os.Stdin = oldStdin }()*/

	var n int
	fmt.Scan(&n)

	for ;n > 0;n-- {
		i := 0
		var a, b, k int
		fmt.Scan(&a, &b, &k)
		for j := 0; j < k; j+=2 {
				i += a
				if j < k - 1 {
					i -= b
				}
		}
		fmt.Println(i)
	}
}

package main

import "fmt"

func main() {
    var t,a,b,k int
    fmt.Scan(&t)
    for ;t>0;t-- {
        fmt.Scan(&a, &b, &k)
        fmt.Printf("%v\n", ((k+1)/2*a - k/2*b))
    }
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanln(&input)
	i := 0
	for i < input {
		var k, a, b int32
		fmt.Scanln(&a, &b, &k)
		if t := k / 2; k%2 == 1 {
			fmt.Println(t*(a-b) + a)
		} else {
			fmt.Println(t * (a - b))
		}
		i += 1
	}
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanln(&input)
	i := 0
	for i < input {
		var k, a, b uint
		fmt.Scanln(&a, &b, &k)
		if t := k / 2; k%2 == 1 {
			fmt.Println(t*(a-b) + a)
		} else {
			fmt.Println(t * (a - b))
		}
		i += 1
	}
}

package main

import (
	"fmt"
)

func main() {
	var input int
	fmt.Scanln(&input)
	i := 0
	for i < input {
		var k, a, b int
		fmt.Scanln(&a, &b, &k)
		if t := k / 2; k%2 == 1 {
			fmt.Println(t*(a-b) + a)
		} else {
			fmt.Println(t * (a - b))
		}
		i += 1
	}
}


Pavel is going to make a game of his dream. However, he knows that he can't make it on his own so he founded a development company and hired n workers of staff. Now he wants to pick n workers from the staff who will be directly responsible for developing a game.Each worker has a certain skill level vi. Besides, each worker doesn't want to work with the one whose skill is very different. In other words, the i-th worker won't work with those whose skill is less than li, and with those whose skill is more than ri.Pavel understands that the game of his dream isn't too hard to develop, so the worker with any skill will be equally useful. That's why he wants to pick a team of the maximum possible size. Help him pick such team.

The first line contains a single integer n (1 ≤ n ≤ 105) — the number of workers Pavel hired. Each of the following n lines contains three space-separated integers li, vi, ri (1 ≤ li ≤ vi ≤ ri ≤ 3·105) — the minimum skill value of the workers that the i-th worker can work with, the i-th worker's skill and the maximum skill value of the workers that the i-th worker can work with.

In the first line print a single integer m — the number of workers Pavel must pick for developing the game. In the next line print m space-separated integers — the numbers of the workers in any order. If there are multiple optimal solutions, print any of them.

package main

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

type Worker struct {
	i, l, v, r int
}

type Event struct {
	t int
	*Worker
}

type Events []Event

func (a Events) Less(i, j int) bool {
	x, y := a[i], a[j]
	vx := x.v
	if x.t == -1 {
		vx = x.r
	}
	vy := y.v
	if y.t == -1 {
		vy = y.r
	}
	if vx != vy {
		return vx < vy
	}
	return x.t > y.t
}
func (a Events) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Events) Len() int      { return len(a) }

type SegTree struct {
	n int
	f, g, x []int
}

func NewSegTree(n int) *SegTree {
	t := &SegTree{
		n: n,
		f: make([]int, 2*n),
		g: make([]int, 2*n),
		x: make([]int, 2*n),
	}
	t.build(0, n)
	return t
}

func (t *SegTree) build(u, v int) {
	i := id(u, v)
	t.x[i] = u
	if u + 1 < v {
		d := mid(u, v)
		t.build(u, d)
		t.build(d, v)
	}
}

func id(u, v int) int {
	t := u + v - 1
	if u + 1 < v {
		t |= 1
	}
	return t
}

func mid(u, v int) int {
	return (u + v + 1) >> 1
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func (t *SegTree) Inc(a, b, y int) {
	n := t.n
	f := t.f
	g := t.g
	x := t.x
//	fmt.Println("Inc", a, b, y)
	var inc func(u, v int)
	inc = func(u, v int) {
		i := id(u, v)
//		fmt.Println("inc", i, u, v, y)
		if b <= u || v <= a { return }
		if a <= u && v <= b {
			f[i] += y
			g[i] += y
			return
		}
		d := mid(u, v)
		l := id(u, d)
		r := id(d, v)
		inc(u, d)
		inc(d, v)
		if f[l] > f[r] {
			f[i] = g[i] + f[l]
			x[i] = x[l]
		} else {
			f[i] = g[i] + f[r]
			x[i] = x[r]
		}
	}
	inc(0, n)
}

func (t *SegTree) Max() (x, y int) {
	i := id(0, t.n)
	x, y = t.x[i], t.f[i]
	return
}

func Uniq(xs []int) []int {
	sort.Ints(xs)
	xx := xs[:0]
	for _, x := range xs {
		if len(xx) == 0 || xx[len(xx) - 1] != x {
			xx = append(xx, x)
		}
	}
	return xx
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]Worker, n)
	for i := range a {
		fmt.Fscanf(reader, "%d %d %d\n", &a[i].l, &a[i].v, &a[i].r)
		a[i].i = i
	}
//	fmt.Println(a)

	xs := make([]int, 2*n)
	for i := range a {
		xs[i+i+0] = a[i].l
		xs[i+i+1] = a[i].v
	}
	xx := Uniq(xs)
//	fmt.Println(xx)

	xid := func(x int) int {
		return sort.Search(len(xx), func(i int) bool {
			return xx[i] >= x
		})
	}

	es := make([]Event, 2*n)
	for i := range a {
		es[i+i+0] = Event{+1, &a[i]}
		es[i+i+1] = Event{-1, &a[i]}
	}
	sort.Sort(Events(es))

	ymax, x1, x2 := 0, 0, 0
	t := NewSegTree(len(xx))
	for _, e := range es {
//		fmt.Println(e.t, e.Worker)
		l := xid(e.l)
		r := xid(e.v)+1
		t.Inc(l, r, e.t)
//		fmt.Println(t.Max())
		if x, y := t.Max(); y > ymax {
			ymax = y
			x1 = xx[x]
			x2 = e.v
		}
	}
//	fmt.Println(ymax, x1, x2)

	ls := []int{}
	for i := range a {
		if a[i].l <= x1 && x1 <= a[i].v && a[i].v <= x2 && x2 <= a[i].r {
			ls = append(ls, a[i].i+1)
		}
	}
	pretty := fmt.Sprint(ls)
	fmt.Println(ymax)
	fmt.Println(pretty[1:len(pretty)-1])
}

package main

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

type Worker struct {
	i, l, v, r int
}

type Event struct {
	t int
	*Worker
}

type Events []Event

func (a Events) Less(i, j int) bool {
	x, y := a[i], a[j]
	vx := x.v
	if x.t == -1 {
		vx = x.r
	}
	vy := y.v
	if y.t == -1 {
		vy = y.r
	}
	if vx != vy {
		return vx < vy
	}
	return x.t > y.t
}
func (a Events) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Events) Len() int      { return len(a) }

type SegTree struct {
	n       int
	f, g, x []int
}

func NewSegTree(n int) *SegTree {
	t := &SegTree{
		n: n,
		f: make([]int, 2*n),
		g: make([]int, 2*n),
		x: make([]int, 2*n),
	}
	t.build(0, n)
	return t
}

func (t *SegTree) build(u, v int) {
	i := id(u, v)
	t.x[i] = u
	if u+1 < v {
		d := mid(u, v)
		t.build(u, d)
		t.build(d, v)
	}
}

func id(u, v int) int {
	t := u + v - 1
	if u+1 < v {
		t |= 1
	}
	return t
}

func mid(u, v int) int {
	return (u + v + 1) >> 1
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func (t *SegTree) Inc(a, b, y int) {
	n := t.n
	f := t.f
	g := t.g
	x := t.x
	var inc func(u, v int)
	inc = func(u, v int) {
		i := id(u, v)
		if b <= u || v <= a {
			return
		}
		if a <= u && v <= b {
			f[i] += y
			g[i] += y
			return
		}
		d := mid(u, v)
		l := id(u, d)
		r := id(d, v)
		inc(u, d)
		inc(d, v)
		if f[l] > f[r] {
			f[i] = g[i] + f[l]
			x[i] = x[l]
		} else {
			f[i] = g[i] + f[r]
			x[i] = x[r]
		}
	}
	inc(0, n)
}

func (t *SegTree) Max() (x, y int) {
	i := id(0, t.n)
	x, y = t.x[i], t.f[i]
	return
}

func Uniq(xs []int) []int {
	sort.Ints(xs)
	xx := xs[:0]
	for _, x := range xs {
		if len(xx) == 0 || xx[len(xx)-1] != x {
			xx = append(xx, x)
		}
	}
	return xx
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]Worker, n)
	for i := range a {
		fmt.Fscanf(reader, "%d %d %d\n", &a[i].l, &a[i].v, &a[i].r)
		a[i].i = i
	}

	xs := make([]int, 2*n)
	for i := range a {
		xs[i+i+0] = a[i].l
		xs[i+i+1] = a[i].v
	}
	xx := Uniq(xs)

	xid := func(x int) int {
		return sort.Search(len(xx), func(i int) bool {
			return xx[i] >= x
		})
	}

	es := make([]Event, 2*n)
	for i := range a {
		es[i+i+0] = Event{+1, &a[i]}
		es[i+i+1] = Event{-1, &a[i]}
	}
	sort.Sort(Events(es))

	ymax, x1, x2 := 0, 0, 0
	t := NewSegTree(len(xx))
	for _, e := range es {
		l := xid(e.l)
		r := xid(e.v) + 1
		t.Inc(l, r, e.t)
		if x, y := t.Max(); y > ymax {
			ymax = y
			x1 = xx[x]
			x2 = e.v
		}
	}

	ls := []int{}
	for i := range a {
		if a[i].l <= x1 && x1 <= a[i].v && a[i].v <= x2 && x2 <= a[i].r {
			ls = append(ls, a[i].i+1)
		}
	}

	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()
	fmt.Fprintln(writer, ymax)
	pretty := fmt.Sprint(ls)
	fmt.Fprintln(writer, pretty[1 : len(pretty)-1])
}

package main

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

type Worker struct {
	i, l, v, r int
}

type Event struct {
	t int
	*Worker
}

type Events []Event

func (a Events) Less(i, j int) bool {
	x, y := a[i], a[j]
	vx := x.v
	if x.t == -1 {
		vx = x.r
	}
	vy := y.v
	if y.t == -1 {
		vy = y.r
	}
	if vx != vy {
		return vx < vy
	}
	return x.t > y.t
}
func (a Events) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Events) Len() int      { return len(a) }

type SegTree struct {
	n int
	f, g, x []int
}

func NewSegTree(n int) *SegTree {
	t := &SegTree{
		n: n,
		f: make([]int, 2*n),
		g: make([]int, 2*n),
		x: make([]int, 2*n),
	}
	t.build(0, n)
	return t
}

func (t *SegTree) build(u, v int) {
	i := id(u, v)
	t.x[i] = u
	if u + 1 < v {
		d := mid(u, v)
		t.build(u, d)
		t.build(d, v)
	}
}

func id(u, v int) int {
	t := u + v - 1
	if u + 1 < v {
		t |= 1
	}
	return t
}

func mid(u, v int) int {
	return (u + v + 1) >> 1
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func (t *SegTree) Inc(a, b, y int) {
	n := t.n
	f := t.f
	g := t.g
	x := t.x
//	fmt.Println("Inc", a, b, y)
	var inc func(u, v int)
	inc = func(u, v int) {
		i := id(u, v)
//		fmt.Println("inc", i, u, v, y)
		if b <= u || v <= a { return }
		if a <= u && v <= b {
			f[i] += y
			g[i] += y
			return
		}
		d := mid(u, v)
		l := id(u, d)
		r := id(d, v)
		inc(u, d)
		inc(d, v)
		if f[l] > f[r] {
			f[i] = g[i] + f[l]
			x[i] = x[l]
		} else {
			f[i] = g[i] + f[r]
			x[i] = x[r]
		}
	}
	inc(0, n)
}

func (t *SegTree) Max() (x, y int) {
	i := id(0, t.n)
	x, y = t.x[i], t.f[i]
	return
}

func Uniq(xs []int) []int {
	sort.Ints(xs)
	xx := xs[:0]
	for _, x := range xs {
		if len(xx) == 0 || xx[len(xx) - 1] != x {
			xx = append(xx, x)
		}
	}
	return xx
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]Worker, n)
	for i := range a {
		fmt.Fscanf(reader, "%d %d %d\n", &a[i].l, &a[i].v, &a[i].r)
		a[i].i = i
	}
//	fmt.Println(a)

	xs := make([]int, 2*n)
	for i := range a {
		xs[i+i+0] = a[i].l
		xs[i+i+1] = a[i].v
	}
	xx := Uniq(xs)
//	fmt.Println(xx)

	xid := func(x int) int {
		return sort.Search(len(xx), func(i int) bool {
			return xx[i] >= x
		})
	}

	es := make([]Event, 2*n)
	for i := range a {
		es[i+i+0] = Event{+1, &a[i]}
		es[i+i+1] = Event{-1, &a[i]}
	}
	sort.Sort(Events(es))

	ymax, x1, x2 := 0, 0, 0
	t := NewSegTree(len(xx))
	for _, e := range es {
//		fmt.Println(e.t, e.Worker)
		l := xid(e.l)
		r := xid(e.v)+1
		t.Inc(l, r, e.t)
//		fmt.Println(t.Max())
		if x, y := t.Max(); y > ymax {
			ymax = y
			x1 = xx[x]
			x2 = e.v
		}
	}
//	fmt.Println(ymax, x1, x2)

	ls := []int{}
	for i := range a {
		if a[i].v <= x1 && x1 <= a[i].v && a[i].v <= x2 && x2 <= a[i].r {
			ls = append(ls, a[i].i+1)
		}
	}
	pretty := fmt.Sprint(ls)
	fmt.Println(ymax)
	fmt.Println(pretty[1:len(pretty)-1])
}

package main

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

type Worker struct {
	i, l, v, r int
}

type Event struct {
	t int
	*Worker
}

type Events []Event

func (a Events) Less(i, j int) bool {
	x, y := a[i], a[j]
	vx := x.v
	if x.t == -1 {
		vx = x.r
	}
	vy := y.v
	if y.t == -1 {
		vy = y.r
	}
	if vx != vy {
		return vx < vy
	}
	return x.t > y.t
}
func (a Events) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a Events) Len() int      { return len(a) }

type SegTree struct {
	n int
	f, g, x []int
}

func NewSegTree(n int) *SegTree {
	t := &SegTree{
		n: n,
		f: make([]int, 2*n),
		g: make([]int, 2*n),
		x: make([]int, 2*n),
	}
	t.build(0, n)
	return t
}

func (t *SegTree) build(u, v int) {
	i := id(u, v)
	t.x[i] = u
	if u + 1 < v {
		d := mid(u, v)
		t.build(u, d)
		t.build(d, v)
	}
}

func id(u, v int) int {
	t := u + v - 1
	if u + 1 < v {
		t |= 1
	}
	return t
}

func mid(u, v int) int {
	return (u + v + 1) >> 1
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func (t *SegTree) Inc(a, b, y int) {
	n := t.n
	f := t.f
	g := t.g
	x := t.x
//	fmt.Println("Inc", a, b, y)
	var inc func(u, v int)
	inc = func(u, v int) {
		i := id(u, v)
//		fmt.Println("inc", i, u, v, y)
		if b <= u || v <= a { return }
		if a <= u && v <= b {
			f[i] += y
			g[i] += y
			return
		}
		d := mid(u, v)
		l := id(u, d)
		r := id(d, v)
		inc(u, d)
		inc(d, v)
		if f[l] > f[r] {
			f[i] = g[i] + f[l]
			x[i] = x[l]
		} else {
			f[i] = g[i] + f[r]
			x[i] = x[r]
		}
	}
	inc(0, n)
}

func (t *SegTree) Max() (x, y int) {
	i := id(0, t.n)
	x, y = t.x[i], t.f[i]
	return
}

func Uniq(xs []int) []int {
	sort.Ints(xs)
	xx := xs[:0]
	for _, x := range xs {
		if len(xx) == 0 || xx[len(xx) - 1] != x {
			xx = append(xx, x)
		}
	}
	return xx
}

func main() {
	reader := bufio.NewReader(os.Stdin)

	var n int
	fmt.Fscanf(reader, "%d\n", &n)
	a := make([]Worker, n)
	for i := range a {
		fmt.Fscanf(reader, "%d %d %d\n", &a[i].l, &a[i].v, &a[i].r)
		a[i].i = i
	}
//	fmt.Println(a)

	xs := make([]int, 2*n)
	for i := range a {
		xs[i+i+0] = a[i].l
		xs[i+i+1] = a[i].v
	}
	xx := Uniq(xs)
//	fmt.Println(xx)

	xid := func(x int) int {
		return sort.Search(len(xx), func(i int) bool {
			return xx[i] >= x
		})
	}

	es := make([]Event, 2*n)
	for i := range a {
		es[i+i+0] = Event{+1, &a[i]}
		es[i+i+1] = Event{-1, &a[i]}
	}
	sort.Sort(Events(es))

	ymax, x1, x2 := 0, 0, 0
	t := NewSegTree(len(xx))
	for _, e := range es {
//		fmt.Println(e.t, e.Worker)
		l := xid(e.l)
		r := xid(e.v)+1
		t.Inc(l, r, e.t)
//		fmt.Println(t.Max())
		if x, y := t.Max(); y > ymax {
			ymax = y
			x1 = xx[x]
			x2 = e.v
		}
	}
//	fmt.Println(ymax, x1, x2)

	ls := []int{}
	for i := range a {
		if a[i].l <= x1 && x1 <= a[i].v && x2 <= a[i].r {
			ls = append(ls, a[i].i+1)
		}
	}
	pretty := fmt.Sprint(ls)
	fmt.Println(ymax)
	fmt.Println(pretty[1:len(pretty)-1])
}


A string is binary, if it consists only of characters "0" and "1".String v is a substring of string w if it has a non-zero length and can be read starting from some position in string w. For example, string "010" has six substrings: "0", "1", "0", "01", "10", "010". Two substrings are considered different if their positions of occurrence are different. So, if some string occurs multiple times, we should consider it the number of times it occurs.You are given a binary string s. Your task is to find the number of its substrings, containing exactly k characters "1".

The first line contains the single integer k (0 ≤ k ≤ 106). The second line contains a non-empty binary string s. The length of s does not exceed 106 characters.

Print the single number — the number of substrings of the given string, containing exactly k characters "1". Please do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

NoteIn the first sample the sought substrings are: "1", "1", "10", "01", "10", "010".In the second sample the sought substrings are: "101", "0101", "1010", "01010".

//http://codeforces.com/problemset/problem/165/C
//C. Another Problem on Strings

package main

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

func main() {
	var (
		k, i, s, lseq int32 // small,big
		seq           string
		ans           int64
		sum           []int32
	)

	in := bufio.NewReader(os.Stdin)
	fmt.Fscan(in, &k)
	fmt.Fscan(in, &seq)
	lseq = int32(len(seq))
	//fmt.Println(k, seq, lseq)

	if k > lseq {
		goto OK
	}
	sum = make([]int32, lseq+1, lseq+1)
	sum[0] = 1
	for i = 0; i < lseq; i++ {
		if seq[i] == '1' {
			s++
		}
		if s >= k {
			ans += int64(sum[s-k])
		}
		sum[s]++
	}
	//sum = sum[:s+1]
	//fmt.Println(sum)

OK:
	fmt.Println(ans)
}

// 165C
package main

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

func main() {
	var a string
	var arr [1000005]int64
	var k, i int
	j := 0
	var ans int64
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	fmt.Fscan(in, &k, &a)
	arr[0] = 1
	for i = 0; i < int(len(a)); i++ {
		if a[i] == '1' {
			j++
		}
		if j >= k {
			ans += arr[j-k]
		}
		arr[j]++
	}
	fmt.Fprint(out, ans)
	out.Flush()
}

// 165C-mic
package main

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

func main() {
	//z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewReader(os.Stdin)
	var n int
	var ans int64
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	//s, _ = inp.ReadString('\n')
	fmt.Fscan(inp, &s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += int64(dp[sum-n])
		}
		dp[sum]++
	}
	fmt.Println(ans)
}

// Author: sighduck
// URL: https://codeforces.com/contest/165/problem/C

package main

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

func Solve(n int, s string) int64 {
	count := make([]int, len(s)+1)
	count[0] = 1
	prefix := 0
	ans := int64(0)
	for _, elem := range s {
		if elem == '1' {
			prefix += 1
		}
		if prefix >= n {
			ans += int64(count[prefix-n])
		}
		count[prefix] += 1
	}
	return ans
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	var s string
	fmt.Fscanf(reader, "%d\n%s\n", &n, &s)

	fmt.Fprintf(writer, "%d\n", Solve(n, s))
}

// 165C-mic
package main

import (
	"fmt"
	"math"
)

func main() {
	var k, a, b, res, c int64
	var str string
	var m1 [1000000]int64
	fmt.Scan(&k, &str)
	i := len(str) - 1
	for ; i >= 0; i-- {
		if str[i] == '1' {
			m1[i] = 0
			b = 0
		} else {
			m1[i] = b + 1
		}
	}
	for i := 0; i < len(str); i++ {
		if str[i] == '1' {
			c++
		}
		for c > k {
			if str[a] == '1' {
				c--
			}
			a++
		}
		if c == k {
			res += int64(math.Min(float64(m1[a]), float64(i)-float64(a))) + int64(1)
		}
	}
	fmt.Println(res)
}

// 165C-mic
package main

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

func main() {
	z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewScanner(os.Stdin)
	var n int
	ans := int64(0)
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	inp.Scan()
	s = inp.Text()
	//fmt.Scan(&s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += int64(dp[sum-n])
		}
		dp[sum]++
	}
	z.WriteString(strconv.FormatInt(ans, 32) + "\n")
	z.Flush()
}

// 165C-mic
package main

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

func main() {
	z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewReader(os.Stdin)
	var n int
	ans := 0
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	s, _ = inp.ReadString('\n')
	//fmt.Scan(&s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += dp[sum-n]
		}
		dp[sum]++
	}
	z.WriteString(strconv.Itoa(ans))
	z.Flush()
}

// 165C-mic
package main

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

func main() {
	//z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewReader(os.Stdin)
	var n int
	ans := 0
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	//s, _ = inp.ReadString('\n')
	fmt.Fscan(inp, &s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += dp[sum-n]
		}
		dp[sum]++
	}
	fmt.Println(ans)
}

// 165C-mic
package main

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

func main() {
	//z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewReader(os.Stdin)
	var n int
	ans := 0
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	s, _ = inp.ReadString('\n')
	//fmt.Scan(&s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += dp[sum-n]
		}
		dp[sum]++
	}
	fmt.Println(ans)
}

// 165C-mic
package main

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

func main() {
	z := bufio.NewWriter(os.Stdout)
	inp := bufio.NewScanner(os.Stdin)
	var n int
	ans := 0
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	inp.Scan()
	s = inp.Text()
	//fmt.Scan(&s)
	var i int
	l := len(s)
	sum := 0
	dp[0] = 1
	for i = 0; i < l; i++ {
		if s[i] == '1' {
			sum++
		}
		if sum-n >= 0 {
			ans += dp[sum-n]
		}
		dp[sum]++
	}
	z.WriteString(strconv.Itoa(ans) + "\n")
	z.Flush()
}

// 165C-mic
package main

import (
	"fmt"
)

func main() {
	var n int
	var dp [1000005]int
	var s string
	fmt.Scan(&n)
	for j := 0; j < n; j++ {
		fmt.Scan(&s)
		var i int
		l := len(s)
		sum := 0
		dp[0] = 1
		ans := int64(0)
		for i = 0; i < l; i++ {
			if s[i] == '1' {
				sum++
			}
			if sum-n >= 0 {
				ans += int64(dp[sum-n])
				dp[sum]++
			}
		}
		fmt.Println(ans)
	}
}

// Author: sighduck
// URL: https://codeforces.com/contest/165/problem/C

package main

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

func Solve(n int, s string) int {
	count := make([]int, len(s)+1)
	count[0] = 1
	prefix := 0
	ans := 0
	for _, elem := range s {
		if elem == '1' {
			prefix += 1
		}
		if prefix >= n {
			ans += count[prefix-n]
		}
		count[prefix] += 1
	}
	return ans
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)
	defer writer.Flush()

	var n int
	var s string
	fmt.Fscanf(reader, "%d\n%s\n", &n, &s)

	fmt.Fprintf(writer, "%d\n", Solve(n, s))
}


You are given an array $$$a$$$ of $$$n$$$ positive integers. Determine if, by rearranging the elements, you can make the array strictly increasing. In other words, determine if it is possible to rearrange the elements such that $$$a_1 < a_2 < \dots < a_n$$$ holds.

The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$) — the length of the array. The second line of each test case contains $$$n$$$ integers $$$a_i$$$ ($$$1 \leq a_i \leq 10^9$$$) — the elements of the array.

For each test case, output "YES" (without quotes) if the array satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

NoteIn the first test case any rearrangement will keep the array $$$[1,1,1,1]$$$, which is not strictly increasing.In the second test case, you can make the array $$$[1,3,4,7,8]$$$.

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	for i := 0; i < num; i++ {
		sc.Scan()
		sc.Text()
		sc.Scan()

		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		fmt.Println(increasing(intArr))
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	for i := 1; i < len(arg); i++ {
		if arg[i] == arg[i-1] {
			return "NO"
		}
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
    sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	for i := 0; i<num; i++ {
	    sc.Scan()
	    sc.Text()
	    sc.Scan()

		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

	    fmt.Println(increasing(intArr))
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	for i := 1; i<len(arg); i++ {
	    if arg[i] == arg[i - 1] {
	        return "NO"
	    }
	}

	return "YES"
}

package main

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

var r *bufio.Reader = bufio.NewReader(os.Stdin)
var w *bufio.Writer = bufio.NewWriter(os.Stdout)

func solve() {
	var n, x int
	Fscan(r, &n)
	set := map[int]bool{}
	for i := 0; i < n; i++ {
		Fscan(r, &x)
		set[x] = true
	}

	if len(set) == n {
		Fprintln(w, "YES")
	} else {
		Fprintln(w, "NO")
	}
}

func main() {
	defer w.Flush()

	var t int
	for Fscan(r, &t); t > 0; t-- {
		solve()
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t, n int
	fmt.Fscan(in, &t)
	for t > 0 {
		t--
		fmt.Fscan(in, &n)
		var x int
		m := make(map[int]int)
		flag := true
		//fmt.Println("n=>", n)
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &x)
			m[x]++
			//fmt.Println(x, " => ", m[x], m[x] > 1)
			if m[x] > 1 {
				flag = false
			}
		}
		//fmt.Println(t, n, flag, m)
		if flag {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

import (
	"fmt"
)

func main() {
	//in := bufio.NewReader(os.Stdin)
	var t, n int
	fmt.Scan(&t)
	for t > 0 {
		t--
		fmt.Scan(&n)
		var x int
		m := make(map[int]int)
		flag := true
		//fmt.Println("n=>", n)
		for i := 0; i < n; i++ {
			fmt.Scan(&x)
			m[x]++
			//fmt.Println(x, " => ", m[x], m[x] > 1)
			if m[x] > 1 {
				flag = false
			}
		}
		//fmt.Println(t, n, flag, m)
		if flag {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

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

var in = bufio.NewReader(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func solve() {
	f := false
	var n int
	fmt.Fscan(in, &n)
	hashMap := make(map[int]struct{})
	for i := 0; i < n; i++ {
		var a int
		fmt.Fscan(in, &a)
		if _, ok := hashMap[a]; !ok {
			hashMap[a] = struct{}{}
		} else {
			f = true
		}
	}

	if f {
		fmt.Fprintln(out, "NO")
		return
	}

	fmt.Fprintln(out, "YES")
}

func main() {
	var T int
	fmt.Fscan(in, &T)
	for ; T > 0; T-- {
		solve()
	}
	out.Flush()
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func main() {
	b1742(os.Stdin, os.Stdout)
}

func b1742(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T int
	var n int
	var x int

	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		r := map[int]bool{}
		for i := 0; i < n; i++ {
			Fscan(in, &x)
			r[x] = true
		}
		ans := "NO"
		if len(r) == n {
			ans = "YES"
		}
		Fprintln(out, ans)
	}
}

package main

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

func CF1742B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, N int
	for fmt.Fscan(in, &T); T > 0; T-- {
		fmt.Fscan(in, &N)
		nums := make([]int, N)
		for i := 0; i < N; i++ {
			fmt.Fscan(in, &nums[i])
		}
		flag := false
		if N == 1 {
			fmt.Fprintln(out, "YES")
			flag = true
		} else {
			sort.Ints(nums)
			for i := 1; i < N; i++ {
				if nums[i] == nums[i-1] {
					fmt.Fprintln(out, "NO")
					flag = true
					break
				}
			}
		}
		if !flag {
			fmt.Fprintln(out, "YES")
		}
	}
}

func main() {
	CF1742B(os.Stdin, os.Stdout)
}

package main

import "fmt"

func main() {
	var t int

	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		mp := make(map[int]bool)
		flag := false
		for j := 0; j < n; j++ {
			var a int
			fmt.Scan(&a)
			if mp[a] == true {
				flag = true
			}
			mp[a] = true
		}
		if flag == false {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text = strings.Replace(text, "\r\n", "", -1)
	t := 0
	t, _ = strconv.Atoi(text)
	for i := 0; i < t; i++ {
		raw, _ := reader.ReadString('\n')
		raw = strings.Replace(raw, "\r\n", "", -1)
		arrSize, _ := strconv.Atoi(raw)
		raw, _ = reader.ReadString('\n')
		raw = strings.Replace(raw, "\r\n", "", -1)
		split := strings.Split(raw, " ")
		arr := make([]int, arrSize)
		for ic, ch := range split {
			arr[ic], _ = strconv.Atoi(ch)
		}
		check := checkArr(arr)
		if check {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func checkArr(arr []int) bool {
	sort.Ints(arr)
	isFirst := true
	prev := 0
	for _, x := range arr {
		if isFirst {
			prev = x
			isFirst = false
		} else {
			if x == prev {
				return false
			}
			prev = x
		}
	}
	return true
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		mm := make(map[int]bool, n)
		f := true
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)

			if mm[v] {
				f = false
			}
			mm[v] = true
		}
		if f {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())
	for i := 0; i < t; i++ {
		scanner.Scan()
		scanner.Scan()
		sl := strings.Split(scanner.Text(), " ")
		if CheckUniqueValue(CountValue(sl)) {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func CountValue(arr []string) (res map[string]int) {
	dict := make(map[string]int)
	for _, num := range arr {
		dict[num] = dict[num] + 1
	}
	res = dict
	return
}
func CheckUniqueValue(dict map[string]int) bool {
	for _, v := range dict {
		if 1 != v {
			return false
		}
	}
	return true
}

package main
import(
    "fmt"
    "sort"
)
func main() {
	var t int
	fmt.Scan(&t)
	for i:=0;i<t;i++{
		var n int
		fmt.Scan(&n)
		var list []int = make([]int,n)
		for j:=0;j<n;j++{
			fmt.Scan(&list[j])
		}
		sort.Ints(list)
		for j:=0;j<n-1;j++{
			if list[j] >= list[j+1] {
				fmt.Println("NO")
				goto out
			}
		}
		fmt.Println("YES")
		out:
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	writer = bufio.NewWriter(os.Stdout)
)

func readInt() int {
	var i int
	fmt.Fscan(reader, &i)
	return i
}

func readString() string {
	var s string
	fmt.Fscan(reader, &s)
	return s
}

func main(){
	defer writer.Flush()
	T := readInt()
	for i := 1; i <= T; i++{
		N := readInt()
		can := true
		cache := make(map[int]bool)
		for ;N > 0; N-- {
			a := readInt()
			if cache[a] {
				can = false
			}
			cache[a] = true
		}
		ans := "NO"
		if can{
			ans = "YES"
		}
		fmt.Fprintln(writer, ans)
	}
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	// define testcases variable
	var testcases int
	fmt.Fscan(r, &testcases)

	for testcases > 0 {
		testcases -= 1
		var n int
		fmt.Fscan(r, &n)

		var arr = make([]int, n)

		for i := 0; i < n; i++ {
			fmt.Fscan(r, &arr[i])
		}

		sort.Ints(arr)
		var ret = ""

		for i := 1; i < n; i++ {
			if arr[i] == arr[i-1] {
				ret = "NO"
			}
		}
		if ret == "" {
			ret = "YES"
		}

		fmt.Fprintln(w, ret)
	}

}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var T int
	fmt.Scan(&T)
	for Case := 1; Case <= T; Case++ {
		var n int
		fmt.Scan(&n)
		var a = []int{}
		for i := 0; i < n; i++ {
			var x int
			fmt.Scan(&x)
			a = append(a, x)
		}
		sort.Ints(a)
		ok := true
		for i := 0; i + 1 < n; i++ {
			if a[i] == a[i + 1] {
				ok = false
				break
			}
		}
		if ok {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

type CF1742B struct {
	sc        *bufio.Reader
	split     []string
	index     int
	separator string
}

func (in *CF1742B) GetLine() string {
	line, err := in.sc.ReadString('\n')
	if err != nil {
		fmt.Println("error line:", line, " err: ", err)
	}
	in.split = []string{}
	in.index = 0
	return line
}
func (in *CF1742B) load() {
	if len(in.split) <= in.index {
		in.split = strings.Split(in.GetLine(), in.separator)
		in.index = 0
	}
}

func (in *CF1742B) NextInt() int {
	in.load()
	val, _ := strconv.Atoi(strings.TrimSpace(in.split[in.index]))
	in.index++
	return val
}

func (in *CF1742B) NextInt64() int64 {
	in.load()
	val, _ := strconv.ParseInt(strings.TrimSpace(in.split[in.index]), 10, 64)
	in.index++
	return val
}

func (in *CF1742B) NextString() string {
	in.load()
	val := strings.TrimSpace(in.split[in.index])
	in.index++
	return val
}

/**
Run solve the problem CF1742B
Date: 10/14/2022
User: wotan
URL: https://codeforces.com/problemset/problem/1742/B
Problem: CF1742B
**/
func (in *CF1742B) Run() {
	for t := in.NextInt(); t > 0; t-- {
		n := in.NextInt()
		mapa := make(map[int]int)
		ans := true
		for i := 0; i < n; i++ {
			val := in.NextInt()
			mapa[val]++
			if v := mapa[val]; v > 1 {
				ans = false
			}
		}
		if ans {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func NewCF1742B(r *bufio.Reader) *CF1742B {
	return &CF1742B{
		sc:        r,
		split:     []string{},
		index:     0,
		separator: " ",
	}
}

func main() {
	NewCF1742B(bufio.NewReader(os.Stdin)).Run()
}

package main

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

func increasing(arr []int) string {
	d := map[int]bool{}

	for _, v := range arr {
		if _, ok := d[v]; ok {
			return "NO"
		}
		d[v] = true
	}

	return "YES"
}

func main() {
	in := bufio.NewReader(os.Stdin)
	tc := readInt(in)

	for i := 0; i < tc; i++ {
		_ = readInt(in) // n
		nums := readArrInt(in)
		fmt.Println(increasing(nums))
	}
}

func preprocessStringLine(in *bufio.Reader) string {
	str, _ := in.ReadString('\n')
	str = strings.ReplaceAll(str, "\r", "")
	str = strings.ReplaceAll(str, "\n", "")
	return str
}

func readInt(in *bufio.Reader) int {
	line := preprocessStringLine(in)
	n, _ := strconv.Atoi(line)
	return n
}

func readLineNumbs(in *bufio.Reader) []string {
	line := preprocessStringLine(in)
	numbs := strings.Split(line, " ")
	return numbs
}

func readArrInt(in *bufio.Reader) []int {
	numbs := readLineNumbs(in)
	arr := make([]int, len(numbs))
	for i, n := range numbs {
		val, _ := strconv.Atoi(n)
		arr[i] = val
	}
	return arr
}

package main

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

func main() {
	defer writer.Flush()
	var t int
	scanws(&t)
	for t > 0 {
		solve()
		t--
	}
}

func solve() {
	var n, i, currMin, nextMin int
	var a []int
	var orderable bool
	orderable = true
	scanws(&n)
	a = make([]int, n)
	for i := range a {
		scanws(&a[i])
	}
	if len(a) == 1 {
		printf("YES\n")
		return
	}
	currMin = MinIntIn(a)
	i = firstIndexOf(currMin, a)

	deleteFrom(i, &a)

	for len(a) > 0 {
		nextMin = MinIntIn(a)
		if currMin >= nextMin {
			orderable = false
			break
		}
		currMin = nextMin
		i = firstIndexOf(currMin, a)
		deleteFrom(i, &a)
	}

	switch {
	case orderable:
		printf("YES\n")
	default:
		printf("NO\n")
	}
}

func firstIndexOf(v int, arr []int) int {
	for i := range arr {
		if arr[i] == v {
			return i
		}
	}
	return -1
}

func MinIntIn(arr []int) int {
	var mn, sz int
	sz = len(arr)
	mn = arr[0]
	for i := 1; i < sz; i++ {
		mn = MinInt(mn, arr[i])
	}
	return mn
}

func MinInt(x, y int) int {
	if y < x {
		return y
	}
	return x
}

func deleteFrom(valueIndex int, slice *[]int) {
	tmp := make([]int, 0)
	tmp = append(tmp, (*slice)[:valueIndex]...)
	tmp = append(tmp, (*slice)[valueIndex+1:]...)
	*slice = tmp
}

var reader *bufio.Reader = bufio.NewReader(os.Stdin)
var writer *bufio.Writer = bufio.NewWriter(os.Stdout)
func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
func scanws(a ...interface{}) { fmt.Fscan(reader, a...) }

package main

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

var in = bufio.NewReader(os.Stdin)

func  gcd(a, b int) int {
  for b != 0 {
      a, b = b, a%b
  }
  return a
}

func main() {
	var t int
	fmt.Fscan(in, &t)

	for ; t > 0; t-- {
    var n int
    fmt.Fscan(in, &n)
    a := make([]int, n, n)
    for i := range a {
      fmt.Fscan(in, &a[i])
    }
    sort.Ints(a)
    ret := "YES"
    for i := 1; i < n; i++ {
      if a[i] == a[i-1] {
        ret = "NO"
        break;
      }
    }
    fmt.Println(ret)
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	t, n   int
)

func solve(n int, a []int) string {
	sort.Ints(a)
	for i := 0; i < n-1; i++ {
		if a[i+1] == a[i] {
			return "NO"
		}
	}
	return "YES"
}

func main() {
	fmt.Fscan(reader, &t)
	for ; t > 0; t-- {
		fmt.Fscan(reader, &n)
		a := make([]int, n)
		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &a[i])
		}
		fmt.Println(solve(n, a))
	}
}

package main

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

const cf = true

func solve() {
	var n int
	fmt.Fscan(in, &n)
	arr := make([]int, n)
	for i := range arr {
		fmt.Fscan(in, &arr[i])
	}
	sort.Ints(arr)
	for i := 0; i < n-1; i++ {
		if arr[i] == arr[i+1] {
			fmt.Fprintln(out, "NO")
			return
		}
	}
	fmt.Fprintln(out, "YES")
}

func main() {
	defer out.Flush()
	t := 1
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		solve()
	}
}

type SqrtInt interface {
	SignedSqrt | UnsignedSqrt
}

type SignedSqrt interface {
	~int | ~int32 | ~int64
}

type UnsignedSqrt interface {
	~uint | ~uint32 | ~uint64 | ~uintptr
}

func sqrt[T SqrtInt](x T) T {
	l, r := T(0), T(2000000123)
	for l < r {
		mid := (l + r) / 2
		if mid*mid > x {
			r = mid
		} else {
			l = mid + 1
		}
	}
	return l - 1
}

func ConvertInt(val string, base, toBase int) (string, error) {
	i, err := strconv.ParseInt(val, base, 64)
	if err != nil {
		return "", err
	}
	return strconv.FormatInt(i, toBase), nil
}

type set[T Ordered] struct {
	itms map[T]struct{}
}

func (s *set[T]) init() {
	if s.itms == nil {
		s.itms = make(map[T]struct{})
	}
}

func (s *set[T]) add(item T) *set[T] {
	s.init()
	s.itms[item] = exists
	return s
}

func (s *set[T]) remove(item T) *set[T] {
	s.init()
	delete(s.itms, item)
	return s
}

func (s *set[T]) has(item T) bool {
	s.init()
	_, c := s.itms[item]
	return c
}

func (s *set[T]) sortedItems() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	sort.Slice(items, func(i, j int) bool {
		return items[i] < items[j]
	})
	return items
}

func (s *set[T]) items() []T {
	s.init()
	items := make([]T, 0, s.size())
	for item := range s.itms {
		items = append(items, item)
	}
	return items
}

func (s *set[T]) size() int {
	s.init()
	return len(s.itms)
}

var exists = struct{}{}

const MaxUint = ^uint(0)
const MinUint = 0
const MaxInt = int(MaxUint >> 1)
const MinInt = -MaxInt - 1

func reverseStr(s string) string {
	r := []byte(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

type Float interface {
	~float32 | ~float64
}

type Integer interface {
	Signed | Unsigned
}

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

type Ordered interface {
	Integer | Float | ~string
}

func abs[T Signed](x T) T {
	if x < 0 {
		return -x
	}
	return x
}

func min[T Ordered](x, y T) T {
	if x < y {
		return x
	}
	return y
}

func max[T Ordered](x, y T) T {
	if x > y {
		return x
	}
	return y
}

var (
	in  = getReader()
	out = getWriter()
)

func getReader() *bufio.Reader {
	if cf {
		return bufio.NewReader(os.Stdin)
	} else {
		in, _ := os.Open("input.txt")
		return bufio.NewReader(in)
	}
}

func getWriter() *bufio.Writer {
	if cf {
		return bufio.NewWriter(os.Stdout)
	} else {
		out, _ := os.Create("output.txt")
		return bufio.NewWriter(out)
	}
}

package main

import (
    "fmt"
    "sort"
)

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

    for i:=0; i<n; i++ {
        var t int
        fmt.Scan(&t)

        arr := make([]int, 0, t)
        for j:=0; j<t; j++ {
            var x int
            fmt.Scan(&x)

            arr = append(arr, x)
        }
        sort.Ints(arr)

        flg := false
        for k:=1; k<t; k++ {
            if arr[k] == arr[k-1] {
                flg = true
                fmt.Println("NO")
                break;
            }
        }
        if !flg {
            fmt.Println("YES")
        }
    }
 }

package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var s string
	fmt.Scanln(&s)
	count, _ := strconv.Atoi(s)
	answers := make([]string, 0, count)
	outer:
	for i := 0; i < count ; i++ {
		scanner.Scan()
		scanner.Scan()
		line := strings.Split(scanner.Text(), " ")
		myMap := make(map[string]int)
		for _, digit := range line {
			myMap[digit]++
			if myMap[digit] > 1 {
				answers = append(answers, "NO")
				continue outer
			}
		}
		answers = append(answers, "YES")
	}
	for _, answer := range answers {
		fmt.Println(answer)
	}
}

package main

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

var (
	reader = bufio.NewReader(os.Stdin)
	writer = bufio.NewWriter(os.Stdout)
)

func check(arr []int) string {
	mymap := make(map[int]int)
	for _, el := range arr {
		if _, ok := mymap[el]; ok {
			return "NO"
		} else {
			mymap[el] = 1
		}
	}

	return "YES"
}

func main() {
	writer.Flush()
	var test, size int
	fmt.Fscanf(reader, "%d\n", &test)
	for j := 0; j < test; j++ {
		fmt.Fscanf(reader, "%d\n", &size)

		var arr []int
		for i := 0; i < size; i++ {
			var temp int
			fmt.Fscanf(reader, "%d", &temp)
			arr = append(arr, temp)
		}
		fmt.Println(check(arr))
		fmt.Fscanf(reader, "\n")
	}
}

package main

import (
	"fmt"
	"sort"
)

func main() {
	var num int
	fmt.Scan(&num)
	for i := 0; i < num; i++ {

		var numArr []int
		var num2 int
		fmt.Scan(&num2)
		for i := 0; i < num2; i++ {
			var num2 int
			fmt.Scan(&num2)
			numArr = append(numArr, num2)
		}
		var res string
		res = sec(numArr)
		fmt.Println(res)
	}

}
func sec(arr []int) string {
	sort.Ints(arr)
	for i := 0; i < len(arr)-1; i++ {
		if arr[i] >= arr[i+1] {
			return "no"
		}
	}
	return "yes"
}

package main

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

func main() {
	var tc int

	reader := bufio.NewReader(os.Stdin)
	writer := bufio.NewWriter(os.Stdout)

	defer writer.Flush()

	fmt.Fscan(reader, &tc)

	for t := 0; t < tc; t++ {
		var n int

		fmt.Fscan(reader, &n)

		arr := make([]int, n)

		for i := 0; i < n; i++ {
			fmt.Fscan(reader, &arr[i])
		}

		output := solve(&arr, n)

		fmt.Fprintln(writer, output)
	}
}

func solve(arr *[]int, n int) string {
	ans := "YES"

	sort.Ints(*arr)

	for i := 1; i < n; i++ {
		if (*arr)[i-1] >= (*arr)[i] {
			ans = "NO"
			break
		}
	}
	return ans
}

package main

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

func main() {
	r := bufio.NewReader(os.Stdin)
	w := bufio.NewWriter(os.Stdout)
	defer w.Flush()

	var T int
	for fmt.Fscan(r, &T); T > 0; T-- {

		var n int
		fmt.Fscan(r, &n)
		a := make([]int, n)

		for i := range a { fmt.Fscan(r, &a[i]) }
		sort.Ints(a)

		res := "YES"
		for i := range a {
			if i == 0 { continue }
			if a[i] <= a[i-1] {
				res = "NO"
				break
			}
		}

		fmt.Fprintln(w, res)
	}

}

package main

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

var sc = bufio.NewScanner(os.Stdin)

const mod = 998244353
const N = 2e5

func main() {
	sc.Buffer(make([]byte, 500000*1+1), 500000)
	sc.Split(bufio.ScanWords)

	T := nextInt()
	for T > 0 {
		T--
		n := nextInt()
		mp := map[int]int{}
		flag := false
		for i := 0; i < n; i++ {
			x := nextInt()
			mp[x]++
			if mp[x] > 1 {
				flag = true
			}
		}
		if flag {
			fmt.Println("NO")
		} else {
			fmt.Println("YES")
		}
	}
}

func max(args ...int) int {
	res := args[0]
	for _, v := range args {
		if v > res {
			res = v
		}
	}
	return res
}

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

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

package main

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

type IO struct {
	in  io.Reader
	out io.Writer
}

func NewIO(in io.Reader, out io.Writer) *IO {
	return &IO{in: bufio.NewReader(in), out: out}
}

func (io *IO) ReadInt() int {
	var res int
	_, _ = fmt.Fscanf(io.in, "%d\n", &res)
	return res
}

func (io *IO) ReadPairInt() (int, int) {
	var a, b int
	_, _ = fmt.Fscanf(io.in, "%d %d\n", &a, &b)
	return a, b
}

func (io *IO) ReadString() string {
	var res string
	_, _ = fmt.Fscanf(io.in, "%s\n", &res)
	return res
}

func (io *IO) ReadIntSlice(n int) sort.IntSlice {
	var t int
	res := make(sort.IntSlice, 0, n)
	for i := 0; i < n; i++ {
		_, _ = fmt.Fscanf(io.in, "%d", &t)
		res = append(res, t)
	}
	_, _ = fmt.Fscanf(io.in, "\n")
	return res
}

func (io *IO) Println(v ...interface{}) {
	_, _ = fmt.Fprintln(io.out, v...)
}

func (io *IO) Print(v ...interface{}) {
	_, _ = fmt.Fprint(io.out, v...)
}

func (io *IO) Printf(format string, v ...interface{}) {
	_, _ = fmt.Fprintf(io.out, format, v...)
}

func (io *IO) PrintIntSlice(s sort.IntSlice) {
	for _, v := range s {
		io.Printf("%d ", v)
	}
}

func (io *IO) PrintlnIntSlice(s sort.IntSlice) {
	io.PrintIntSlice(s)
	io.Printf("\n")
}

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

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

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func main() {
	io := NewIO(os.Stdin, os.Stdout)

	t := io.ReadInt()
p:
	for i := 0; i < t; i++ {
		n := io.ReadInt()
		a := io.ReadIntSlice(n)
		sort.Ints(a)
		for j := 1; j < len(a); j++ {
			if a[j] == a[j-1] {
				fmt.Println("NO")
				continue p
			}
		}
		fmt.Println("YES")
	}
}

package main

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

var in, out = bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout)

func solve() {
	n, v := _readArr()
	sort.Ints(v)
	for i := 0; i < n-1; i++ {
		if v[i] == v[i+1] {
			_print("NO")
			return
		}
	}
	_print("YES")
}

func main() {
	defer out.Flush()
	var t int
	for fmt.Fscanln(in, &t); t > 0; t-- {
		solve()
	}
}

// ====
func _readInt() int {
	var x int
	fmt.Fscan(in, &x)
	return x
}
func _readStr() string {
	var x string
	fmt.Fscan(in, &x)
	return x
}
func _readArr() (int, []int) {
	var n int
	fmt.Fscan(in, &n)
	var v = make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(in, &v[i])
	}
	return n, v
}
func _print(x ...any) {
	fmt.Fprintln(out, x...)
}
func _max(x, y int) int {
	if x > y {
		return x
	}
	return y
}
func _min(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func _abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}
func _sortStr(x string) string {
	r := []rune(x)
	sort.Slice(r, func(i, j int) bool {
		return r[i] < r[j]
	})
	return string(r)
}
func _reverseInts(x []int) {
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
}
func _reverseStr(s string) string {
	x := []rune(s)
	n := len(x)
	for i := 0; i < n/2; i++ {
		x[i], x[n-1-i] = x[n-1-i], x[i]
	}
	return string(x)
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"io/ioutil"
	"os"
	"sort"
	"strings"
)

// https://space.bilibili.com/206214
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	solve := func(curCase int) bool {
		var n int
		Fscan(in, &n)
		a := make([]int, n)
		for i := range a {
			Fscan(in, &a[i])
		}
		sort.Ints(a)
		for i := 1; i < n; i++ {
			if a[i-1] >= a[i] {
				return false

			}
		}
		return true
	}

	cases := 1
	Fscan(in, &cases)
	for curCase := 1; curCase <= cases; curCase++ {
		if solve(curCase){
			Fprintln(out, "YES")
		} else {
			Fprintln(out, "NO")
		}
	}

	// 如果是多组数据，请务必加上这段保险 —— 已经无法统计，有多少位竞赛选手在漏读数据上损失大把分数（包括我）
	// 此外，如果不小心写成了 scan(v) 而不是 scan(&v)，由于未传入指针，不会读入任何数据，这样本地运行一次就能立马发现错误
	leftData, _ := ioutil.ReadAll(in)
	if s := strings.TrimSpace(string(leftData)); s != "" {
		panic("有未读入的数据：\n" + s)
	}

}

func main() { run(os.Stdin, os.Stdout) }

package main

import (
	"fmt"
	"sort"
)

func main() {
	count := 0
	ind := 0

	fmt.Scanf("%d", &count)

	// fmt.Println("count ", count)

	for ind < count {
		a := 0
		index := 0
		numArr := []int{}

		fmt.Scanf("%d", &a)

		// fmt.Println("elem arr count ", a)

		if a == 1 {
			num := 0
			fmt.Scan(&num)
			// fmt.Println("-----------------", num)
			numArr = append(numArr, num)
		} else {
			for index < a {
				num := 0
				fmt.Scanf("%d", &num)
				// fmt.Println("---------", num)
				numArr = append(numArr, num)
				index += 1
			}
		}

		// fmt.Println("aa---", numArr)

		// fmt.Println(increasing(numArr))
		ind += 1
	}

	// sc := bufio.NewScanner(os.Stdin)
	// for sc.Scan() {
	// 	var (
	// 		txtArr []string
	// 		intArr []int
	// 	)
	// 	txtArr = strings.Split(sc.Text(), " ")

	// 	for _, v := range txtArr {
	// 		int, _ := strconv.Atoi(v)
	// 		intArr = append(intArr, int)
	// 	}

	// 	fmt.Println(increasing(intArr))

	// }
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if len(arg) == 1 {
		return "YES"
	}

	if arg[0] == arg[len(arg)-1] {
		return "NO"
	}

	return "YES"
}

package main

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

func main() {
	index := 1

	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		if index == 1 {
			index += 1
			continue
		}

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		if index%2 == 1 {
			fmt.Println(increasing(intArr))
		}

		index += 1
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if len(arg) == 1 {
		return "YES"
	}

	if arg[0] == arg[len(arg)-1] {
		return "NO"
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] {
		return "NO"
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		// fmt.Println(intArr)
		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] {
		return "NO"
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		fmt.Println(intArr)
		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] {
		return "NO"
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
    sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	for i := 0; i<num; i++ {
	    sc.Scan()
	    sc.Text()
	    sc.Scan()

		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

	    fmt.Println(increasing(intArr))
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	for i := 1; i<len(arg) - 1; i++ {
	    if arg[i] == arg[i - 1] {
	        return "NO"
	    }
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
    sc.Scan()
	num, _ := strconv.Atoi(sc.Text())

	for i := 0; i<num; i++ {
	    sc.Scan()
	    sc.Text()
	    sc.Scan()

		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

	    fmt.Println(increasing(intArr))
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] > arg[j]
	})

	for i := 1; i<len(arg) - 1; i++ {
	    if arg[i] == arg[i - 1] {
	        return "NO"
	    }
	}

	return "YES"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

	    fmt.Println(increasing(intArr))
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] > arg[j]
	})

	if arg[0] == arg[len(arg)-1] - len(arg) + 1 {
		return "YES"
	}

	return "NO"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] - len(arg) + 1 {
		return "YES"
	}

	return "NO"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		fmt.Println(intArr)
		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] - len(arg) + 1 {
		return "YES"
	}

	return "NO"
}

package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	for sc.Scan() {
		var (
			txtArr []string
			intArr []int
		)
		txtArr = strings.Split(sc.Text(), " ")

		for _, v := range txtArr {
			int, _ := strconv.Atoi(v)
			intArr = append(intArr, int)
		}

		fmt.Println(intArr)
		if len(intArr) > 1 {
			fmt.Println(increasing(intArr))
		}
	}
}

func increasing(arg []int) string {
	sort.Slice(arg, func(i, j int) bool {
		return arg[i] < arg[j]
	})

	if arg[0] == arg[len(arg)-1] - len(arg) + 1 {
		return "NO"
	}

	return "YES"
}

package main

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

var r *bufio.Reader = bufio.NewReader(os.Stdin)
var w *bufio.Writer = bufio.NewWriter(os.Stdout)

func solve() {
	var n, x int
	Fscan(r, &n)
	set := map[int]bool{}
	for i := 0; i < n; i++ {
		Fscan(r, &x)
		if _, ok := set[x]; ok {
			Fprintf(w, "NO\n")
			return
		}

		set[x] = true
	}
	Fprintf(w, "YES\n")
}

func main() {
	defer w.Flush()

	var t int
	for Fscan(r, &t); t > 0; t-- {
		solve()
	}
}

package main

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

var reader *bufio.Reader = bufio.NewReader(os.Stdin)

// var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

// func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
// func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }

func parseNumbers(n int, s string) []int {
	res := make([]int, 0)
	for _, f := range strings.Fields(s) {
		i, err := strconv.Atoi(f)
		if err == nil {
			res = append(res, i)
		}
	}
	return res
}

func solve() {
	n := 0
	fmt.Scanf("%d", &n)

	if s, e := reader.ReadString('\n'); e == nil {
		m := make(map[int]bool, n)
		nums := parseNumbers(n, s)
		for _, v := range nums {
			if _, ok := m[v]; ok {
				fmt.Println("NO")
				return
			}

			m[v] = true
		}
	}

	fmt.Println("YES")
}

func main() {
	// defer writer.Flush()

	var t, i = 0, 0
	fmt.Scanf("%d", &t)
	for ; i < t; i++ {
		solve()
	}
}

package main

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

// var reader *bufio.Reader = bufio.NewReader(os.Stdin)
// var writer *bufio.Writer = bufio.NewWriter(os.Stdout)

// func printf(f string, a ...interface{}) { fmt.Fprintf(writer, f, a...) }
// func scanf(f string, a ...interface{})  { fmt.Fscanf(reader, f, a...) }
var scanner *bufio.Scanner = bufio.NewScanner(os.Stdin)

func parseNumbers(n int, s string) []int {
	res := make([]int, 0)
	for _, f := range strings.Fields(s) {
		i, err := strconv.Atoi(f)
		if err == nil {
			res = append(res, i)
		}
	}
	return res
}

func solve() {
	n := 0
	fmt.Scanf("%d", &n)
	if scanner.Scan() {
		nums := parseNumbers(n, scanner.Text())
		m := make(map[int]bool, n)
		for _, v := range nums {
			if _, ok := m[v]; ok {
				fmt.Println("NO")
				return
			}

			m[v] = true
		}
	}

	fmt.Println("YES")
}

func main() {
	// defer writer.Flush()

	var t, i = 0, 0
	fmt.Scanf("%d", &t)
	for ; i < t; i++ {
		solve()
	}
}

package main

import (
	"fmt"
)

func main() {
	//in := bufio.NewReader(os.Stdin)
	var t, n int
	fmt.Scan(&t)
	for t > 0 {
		t--
		fmt.Scan(&n)
		var x int
		m := make(map[int]int)
		flag := true
		for i := 0; i < n; i++ {
			fmt.Scan(&x)
			m[x]++
			//fmt.Println(x, " => ", m[x], m[x] > 1)
			if m[x] > 1 {
				flag = false
				break
			}
		}
		//fmt.Println(t, n, flag, m)
		if flag {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}

}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	var t, n int
	fmt.Fscan(in, &t)
	for t > 0 {
		t--
		fmt.Fscan(in, &n)
		var x int64
		m := make(map[int64]int)
		var flag bool
		for i := 0; i < n; i++ {
			fmt.Fscan(in, &x)
			m[x]++
			if m[x] > 1 {
				flag = true
				break
			}
		}
		if !flag {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}

}

package main

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

var in = bufio.NewReader(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func solve() {
	var n int
	fmt.Fscan(in, &n)
	hashMap := make(map[int]struct{})
	for i := 0; i < n; i++ {
		var a int
		fmt.Fscan(in, &a)
		if _, ok := hashMap[a]; !ok {
			hashMap[a] = struct{}{}
		} else {
			fmt.Fprintln(out, "NO")
			return
		}
	}

	fmt.Fprintln(out, "YES")
}

func main() {
	var T int
	fmt.Fscan(in, &T)
	for ; T > 0; T-- {
		solve()
	}
	out.Flush()
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func main() {
	b1742(os.Stdin, os.Stdout)
}

func b1742(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T int
	var n int
	var x int

loop:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		m := map[int]bool{}
		for i := 0; i < n; i++ {
			Fscan(in, &x)
			if m[x] {
				Fprintln(out, "NO")
				continue loop
			}
			m[x] = true
		}

		Fprintln(out, "YES")
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

func main() {
	b1742(os.Stdin, os.Stdout)
}

func b1742(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T int
	var n int
	var x int

loop:
	for Fscan(in, &T); T > 0; T-- {
		Fscan(in, &n)
		m := map[int]bool{}
		for i := 0; i < n; i++ {
			Fscan(in, &x)
			if m[x] {
				Fprintln(out, "NO")
				continue loop
			} else {
				m[x] = true
			}
		}

		Fprintln(out, "YES")
	}
}

package main

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

func CF1742B(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var T, N int
	for fmt.Fscan(in, &T); T > 0; T-- {
		fmt.Fscan(in, &N)
		nums := make([]int, N)
		for i := 0; i < N; i++ {
			fmt.Fscan(in, &nums[i])
		}
		flag := false
		if N == 1 {
			fmt.Fprintln(out, "YES")
			flag = true
			break
		} else {
			sort.Ints(nums)
			for i := 1; i < N; i++ {
				if nums[i] == nums[i-1] {
					fmt.Fprintln(out, "NO")
					flag = true
					break
				}
			}
		}
		if !flag {
			fmt.Fprintln(out, "YES")
		}
	}
}

func main() {
	CF1742B(os.Stdin, os.Stdout)
}

package main

import "fmt"

func main() {
	var t int

	fmt.Scan(&t)
	for i := 0; i < t; i++ {
		var n int
		fmt.Scan(&n)
		fmt.Printf("num is %d \n", n)
		mp := make(map[int]bool)
		flag := false
		for j := 0; j < n; j++ {
			var a int
			fmt.Scan(&a)
			if mp[a] == true {
				flag = true
			}
			mp[a] = true
		}
		if flag == false {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	text, _ := reader.ReadString('\n')
	text = strings.Replace(text, "\r\n", "", -1)
	t := 0
	t, _ = strconv.Atoi(text)
	for i := 0; i < t; i++ {
		raw, _ := reader.ReadString('\n')
		raw = strings.Replace(raw, "\r\n", "", -1)
		arrSize, _ := strconv.Atoi(raw)
		raw, _ = reader.ReadString('\n')
		raw = strings.Replace(raw, "\r\n", "", -1)
		split := strings.Split(raw, " ")
		arr := make([]int, arrSize)
		for ic, ch := range split {
			arr[ic], _ = strconv.Atoi(ch)
		}
		check := checkArr(arr)
		if check {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

func checkArr(arr []int) bool {
	sort.Ints(arr)
	isFirst := true
	prev := 0
	for _, x := range arr {
		if isFirst {
			prev = x
			isFirst = false
		} else {
			if x == prev {
				return false
			}
		}
	}
	return true
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	var T int
	fmt.Fscan(in, &T)
	for t := 0; t < T; t++ {
		var n int
		fmt.Fscan(in, &n)

		mm := make(map[int]bool, n)
		f := true
		for i := 0; i < n; i++ {
			var v int
			fmt.Fscan(in, &v)

			if mm[v] {
				f = false
				break
			}
			mm[v] = true
		}
		if f {
			fmt.Fprintln(out, "YES")
		} else {
			fmt.Fprintln(out, "NO")
		}
	}
}


Let D(x) be the number of positive divisors of a positive integer x. For example, D(2) = 2 (2 is divisible by 1 and 2), D(6) = 4 (6 is divisible by 1, 2, 3 and 6).You are given an array a of n integers. You have to process two types of queries:  REPLACE l r — for every  replace ai with D(ai);  SUM l r — calculate . Print the answer for each SUM query.

The first line contains two integers n and m (1 ≤ n, m ≤ 3·105) — the number of elements in the array and the number of queries to process, respectively. The second line contains n integers a1, a2, ..., an (1 ≤ ai ≤ 106) — the elements of the array. Then m lines follow, each containing 3 integers ti, li, ri denoting i-th query. If ti = 1, then i-th query is REPLACE li ri, otherwise it's SUM li ri (1 ≤ ti ≤ 2, 1 ≤ li ≤ ri ≤ n). There is at least one SUM query.

For each SUM query print the answer to it.

package main

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

const mx = 1e6

var d [mx + 1]int
var buf = make([]byte, 4096)
var _i = len(buf)

func rc() byte {
	if _i == len(buf) {
		os.Stdin.Read(buf)
		_i = 0
	}
	b := buf[_i]
	_i++
	return b
}

func ri() (x int) {
	b := rc()
	for ; '0' > b; b = rc() {
	}
	for ; '0' <= b; b = rc() {
		x = x*10 + int(b&15)
	}
	return
}

func init() {
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			d[j]++
		}
	}
}

type seg []struct {
	l, r  int
	s     int64
	fixed bool
}

func (t seg) _pushUp(o int) {
	lo, ro := t[o<<1], t[o<<1|1]
	t[o].s = lo.s + ro.s
	t[o].fixed = lo.fixed && ro.fixed
}

func (t seg) _build(o, l, r int) {
	t[o].l, t[o].r = l, r
	if l == r {
		t[o].s = int64(ri())
		t[o].fixed = t[o].s <= 2
		return
	}
	m := (l + r) >> 1
	t._build(o<<1, l, m)
	t._build(o<<1|1, m+1, r)
	t._pushUp(o)
}

func (t seg) _update(o, l, r int) {
	to := &t[o]
	if to.fixed {
		return
	}
	if to.l == to.r {
		to.s = int64(d[to.s])
		to.fixed = to.s <= 2
		return
	}
	m := (to.l + to.r) >> 1
	if l <= m {
		t._update(o<<1, l, r)
	}
	if m < r {
		t._update(o<<1|1, l, r)
	}
	t._pushUp(o)
}

func (t seg) _query(o, l, r int) (s int64) {
	ol, or := t[o].l, t[o].r
	if l <= ol && or <= r {
		return t[o].s
	}
	m := (ol + or) >> 1
	if l <= m {
		s += t._query(o<<1, l, r)
	}
	if m < r {
		s += t._query(o<<1|1, l, r)
	}
	return
}

func (t seg) init(n int)           { t._build(1, 1, n) }
func (t seg) update(l, r int)      { t._update(1, l, r) }
func (t seg) query(l, r int) int64 { return t._query(1, l, r) }

// github.com/EndlessCheng/codeforces-go
func main() {
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	n, q := ri(), ri()
	t := make(seg, 4*n)
	t.init(n)
	for ; q > 0; q-- {
		if ri() == 1 {
			t.update(ri(), ri())
		} else {
			Fprintln(out, t.query(ri(), ri()))
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

var d [1e6 + 1]int

type seg []struct {
	l, r  int
	s     int64
	fixed bool
}

func (t seg) _pushUp(o int) {
	lo, ro := t[o<<1], t[o<<1|1]
	t[o].s = lo.s + ro.s
	t[o].fixed = lo.fixed && ro.fixed
}

func (t seg) _build(a []int, o, l, r int) {
	t[o].l, t[o].r = l, r
	if l == r {
		t[o].s = int64(a[l-1])
		t[o].fixed = a[l-1] <= 2
		return
	}
	m := (l + r) >> 1
	t._build(a, o<<1, l, m)
	t._build(a, o<<1|1, m+1, r)
	t._pushUp(o)
}

func (t seg) _update(o, l, r int) {
	to := &t[o]
	if to.fixed {
		return
	}
	if to.l == to.r {
		to.s = int64(d[to.s])
		to.fixed = to.s <= 2
		return
	}
	m := (to.l + to.r) >> 1
	if l <= m {
		t._update(o<<1, l, r)
	}
	if m < r {
		t._update(o<<1|1, l, r)
	}
	t._pushUp(o)
}

func (t seg) _query(o, l, r int) (s int64) {
	ol, or := t[o].l, t[o].r
	if l <= ol && or <= r {
		return t[o].s
	}
	m := (ol + or) >> 1
	if l <= m {
		s += t._query(o<<1, l, r)
	}
	if m < r {
		s += t._query(o<<1|1, l, r)
	}
	return
}

func (t seg) init(a []int)         { t._build(a, 1, 1, len(a)) }
func (t seg) update(l, r int)      { t._update(1, l, r) }
func (t seg) query(l, r int) int64 { return t._query(1, l, r) }

// github.com/EndlessCheng/codeforces-go
func CF920F(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx = 1e6
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			d[j]++
		}
	}

	var n, q, op, l, r int
	Fscan(in, &n, &q)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}
	t := make(seg, 4*n)
	t.init(a)
	for ; q > 0; q-- {
		if Fscan(in, &op, &l, &r); op == 1 {
			t.update(l, r)
		} else {
			Fprintln(out, t.query(l, r))
		}
	}
}

func main() { CF920F(os.Stdin, os.Stdout) }

package main

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

const mx = 1e6
var d [mx + 1]int
var buf = make([]byte, 4096)
var _i = len(buf)

func rc() byte {
	if _i == len(buf) {
		os.Stdin.Read(buf)
		_i = 0
	}
	b := buf[_i]
	_i++
	return b
}

func ri() (x int) {
	b := rc()
	for ; '0' > b; b = rc() {
	}
	for ; '0' <= b; b = rc() {
		x = x*10 + int(b&15)
	}
	return
}

func init() {
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			d[j]++
		}
	}
}

type seg []struct {
	l, r  int
	s     int64
	fixed bool
}

func (t seg) _pushUp(o int) {
	lo, ro := t[o<<1], t[o<<1|1]
	t[o].s = lo.s + ro.s
	t[o].fixed = lo.fixed && ro.fixed
}

func (t seg) _build(o, l, r int) {
	t[o].l, t[o].r = l, r
	if l == r {
		t[o].s = int64(ri())
		t[o].fixed = t[o].s <= 2
		return
	}
	m := (l + r) >> 1
	t._build(o<<1, l, m)
	t._build(o<<1|1, m+1, r)
	t._pushUp(o)
}

func (t seg) _update(o, l, r int) {
	to := &t[o]
	if to.fixed {
		return
	}
	if to.l == to.r {
		to.s = int64(d[to.s])
		to.fixed = to.s <= 2
		return
	}
	m := (to.l + to.r) >> 1
	if l <= m {
		t._update(o<<1, l, r)
	}
	if m < r {
		t._update(o<<1|1, l, r)
	}
	t._pushUp(o)
}

func (t seg) _query(o, l, r int) (s int64) {
	ol, or := t[o].l, t[o].r
	if l <= ol && or <= r {
		return t[o].s
	}
	m := (ol + or) >> 1
	if l <= m {
		s += t._query(o<<1, l, r)
	}
	if m < r {
		s += t._query(o<<1|1, l, r)
	}
	return
}

func (t seg) init(n int)           { t._build(1, 1, n) }
func (t seg) update(l, r int)      { t._update(1, l, r) }
func (t seg) query(l, r int) int64 { return t._query(1, l, r) }

// github.com/EndlessCheng/codeforces-go
func main() {
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()

	n := ri()
	t := make(seg, 4*n)
	t.init(n)
	for q := ri(); q > 0; q-- {
		if ri() == 1 {
			t.update(ri(), ri())
		} else {
			Fprintln(out, t.query(ri(), ri()))
		}
	}
}

package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

var d [1e6 + 1]int

type seg []struct {
	l, r, s int
	isFixed bool
}

func (t seg) _pushUp(o int) {
	lo, ro := t[o<<1], t[o<<1|1]
	t[o].s = lo.s + ro.s
	t[o].isFixed = lo.isFixed && ro.isFixed
}

func (t seg) _build(a []int, o, l, r int) {
	t[o].l, t[o].r = l, r
	if l == r {
		t[o].s = a[l-1]
		t[o].isFixed = t[o].s <= 2
		return
	}
	m := (l + r) >> 1
	t._build(a, o<<1, l, m)
	t._build(a, o<<1|1, m+1, r)
	t._pushUp(o)
}

func (t seg) _update(o, l, r int) {
	to := &t[o]
	if to.isFixed {
		return
	}
	if to.l == to.r {
		to.s = d[to.s]
		to.isFixed = to.s <= 2
		return
	}
	m := (to.l + to.r) >> 1
	if l <= m {
		t._update(o<<1, l, r)
	}
	if m < r {
		t._update(o<<1|1, l, r)
	}
	t._pushUp(o)
}

func (t seg) _query(o, l, r int) (res int) {
	ol, or := t[o].l, t[o].r
	if l <= ol && or <= r {
		return t[o].s
	}
	m := (ol + or) >> 1
	if l <= m {
		res += t._query(o<<1, l, r)
	}
	if m < r {
		res += t._query(o<<1|1, l, r)
	}
	return
}

func (t seg) init(a []int)       { t._build(a, 1, 1, len(a)) }
func (t seg) update(l, r int)    { t._update(1, l, r) }
func (t seg) query(l, r int) int { return t._query(1, l, r) }

// github.com/EndlessCheng/codeforces-go
func CF920F(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	const mx = 1e6
	for i := 1; i <= mx; i++ {
		for j := i; j <= mx; j += i {
			d[j]++
		}
	}

	var n, q, op, l, r int
	Fscan(in, &n, &q)
	a := make([]int, n)
	for i := range a {
		Fscan(in, &a[i])
	}
	t := make(seg, 4*n)
	t.init(a)
	for ; q > 0; q-- {
		if Fscan(in, &op, &l, &r); op == 1 {
			t.update(l, r)
		} else {
			Fprintln(out, t.query(l, r))
		}
	}
}

func main() { CF920F(os.Stdin, os.Stdout) }