You have a string $$$s$$$ of length $$$n$$$ consisting of only characters > and <. You may do some operations with this string, for each operation you have to choose some character that still remains in the string. If you choose a character >, the character that comes right after it is deleted (if the character you chose was the last one, nothing happens). If you choose a character <, the character that comes right before it is deleted (if the character you chose was the first one, nothing happens).For example, if we choose character > in string > > < >, the string will become to > > >. And if we choose character < in string > <, the string will become to <.The string is good if there is a sequence of operations such that after performing it only one character will remain in the string. For example, the strings >, > > are good. Before applying the operations, you may remove any number of characters from the given string (possibly none, possibly up to $$$n - 1$$$, but not the whole string). You need to calculate the minimum number of characters to be deleted from string $$$s$$$ so that it becomes good.

The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) – the number of test cases. Each test case is represented by two lines. The first line of $$$i$$$-th test case contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) – the length of string $$$s$$$. The second line of $$$i$$$-th test case contains string $$$s$$$, consisting of only characters > and <.

For each test case print one line. For $$$i$$$-th test case print the minimum number of characters to be deleted from string $$$s$$$ so that it becomes good.

NoteIn the first test case we can delete any character in string <>.In the second test case we don't need to delete any characters. The string > < < is good, because we can perform the following sequence of operations: > < < $$$\rightarrow$$$ < < $$$\rightarrow$$$ <.

package main

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

func check(s string) int {
	l := len(s)
	i := 0
	j := l - 1
	for ; i < l; i++ {
		if s[i] != '<' {
			i--
			break
		}
	}
	for ; j >= 0; j-- {
		if s[j] != '>' {
			j++
			break
		}
	}

	return min(i+1, l-j)
}

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

func main() {
	in := bufio.NewReader(os.Stdin)
	t := 0
	fmt.Fscan(in, &t)
	for ; t > 0; t-- {
		s := ""
		n := 0
		fmt.Fscan(in, &n)
		fmt.Fscan(in, &s)
		fmt.Println(check(s))
	}
}

package main

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

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

	var n, t int
	fmt.Fscanf(buf, "%d\n", &t)
	for tt := 0;tt < t;tt++ {
		fmt.Fscanf(buf, "%d\n", &n)
		str := make([]byte, n+1)
		fmt.Fscanf(buf, "%s\n", &str)
		var ans int = n + 1
		for i := 0; i < n; i++ {
			if str[i] == '>' {
				ans = i
				break
			}
		}
		for i := n - 1; i >= 0; i-- {
			if str[i] == '<' {
				if n-i-1 < ans {
					ans = n - i - 1
				}
				break
			}
		}
		fmt.Printf("%d\n", ans)
	}
}

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t, n := 0, 0
	fmt.Fscanf(in, "%d\n", &t)
	for ii := 0; ii < t; ii++ {
		fmt.Fscanf(in, "%d\n", &n)
		s := ""
		fmt.Fscanf(in, "%s\n", &s)
		if s[0] == '>' || s[n-1] == '<' || n == 1 {
			fmt.Fprintf(out, "0\n")
		} else {
			ans := n - 1
			for i := 0; i < n; i++ {
				if s[i] == '>' {
					if i < ans {
						ans = i
					}
					break
				}
			}
			for i := n - 1; i >= 0; i-- {
				if s[i] == '<' {
					if n-1-i < ans {
						ans = n - 1 - i
					}
					break
				}
			}
			fmt.Fprintf(out, "%d\n", ans)
		}
	}
	return
}

// Codeforces 1140 B Good String train
package main

import (
	"bufio"
	"fmt"
	"strings"
	"strconv"
	"os"
)
var in *bufio.Reader

func readFive() (int,int,int,int,int) {
	var a [5]int
	s, err := in.ReadString('\n')
	if err != nil {
		fmt.Println("first read failure", err)
		panic(err)
	}
	ss := strings.Split(strings.Trim(s, " \n\r"), " ")
	for i:=0; i<len(ss); i++ {
		a[i], err = strconv.Atoi(ss[i])
		if err != nil {
			fmt.Println("n atoi failure", err)
			panic(err)
		}
	}
	return a[0],a[1],a[2],a[3],a[4]
}

func readLineNumbs(n int) []int {
	a := make([]int, n)
	delim := byte(' ')
	for i:=0; i<n; i++ {
		if i==(n-1) {
			delim = byte('\n')
		}
		s, err := in.ReadString(delim)
		s = strings.Trim(s, " \n\r")
		if err != nil {
			fmt.Println("read failure", err)
			panic(err)
		}
		aa,err := strconv.Atoi(s)
		if err != nil {
			fmt.Println("aa conv failed", err)
			panic(err)
		}
		a[i] = aa
	}
	return a
}

func readString() string {
	delim := byte('\n')
	s, err := in.ReadString(delim)
	s = strings.Trim(s, " \n\r")
	if err != nil {
		fmt.Println("read failure", err)
		panic(err)
	}
	return s
}

var n int
var s []string
var rmin []int

func readData() {
	in = bufio.NewReader(os.Stdin)
	n,_,_,_,_ = readFive()
	//fmt.Println("n = ", n)
	s = make([]string, n)
	rmin = make([]int, n)
	for i:=0; i<n; i++ {
		readString()
		s[i] = readString()
		//fmt.Println("Read string:", s[i])
	}
}

func solveOne(b []byte) int {
	ln := len(b)
	nl := 0
	for i:=0; i<ln; i++  {
		if b[i]=='<' {
			nl = i+1
		} else {
			break
		}
	}
	nr := 0
	for i:=ln-1; i>=0; i-- {
		if b[i]=='<' {
			nr = (ln-1) - i
			break
		}
	}
	rm := nl
	if nr<rm {rm = nr}
	return rm
}

func solve() {
	for i:=0; i<n; i++ {
		rmin[i] = solveOne(([]byte)(s[i]))
	}
}

func printRes() {
	for i:=0; i<n; i++ {
		fmt.Println(rmin[i])
	}
}

func main() {
	readData()
	solve()
	printRes()
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var qr int
	fmt.Fscan(reader, &qr)

	for qr > 0 {
		var ln int
		fmt.Fscan(reader, &ln)
		var str string
		fmt.Fscan(reader, &str)

		for i := 0; i < ln; i++ {
			if str[i] == '>' {
				fmt.Println(i)
				break
			}

			if str[ln-i-1] == '<' {
				fmt.Println(i)
				break
			}
		}

		qr--
	}

}

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

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var qr int
	fmt.Fscan(reader, &qr)

	for qr > 0 {
		var ln int
		fmt.Fscan(reader, &ln)
		var str string
		fmt.Fscan(reader, &str)

		if str[0] == '>' || str[ln-1] == '<' {
			fmt.Println(0)
			qr--
			continue
		}

		for i := 0; i < ln; i++ {
			if str[i] == '>' {
				fmt.Println(i)
				break
			}

			if str[ln-i-1] == '<' {
				fmt.Println(i)
				break
			}
		}

		qr--
	}

}

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

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var qr int
	fmt.Fscan(reader, &qr)

	for qr > 0 {
		var ln int
		fmt.Fscan(reader, &ln)
		var str string
		fmt.Fscan(reader, &str)

		if str[0] == '>' || str[ln-1] == '<' {
			fmt.Println(0)
			qr--
			continue
		}

		var l, r int
		for i := 0; i < ln; i++ {
			if str[i] == '>' {
				l = i - 1
				break
			}
		}

		for i := ln - 1; i >= 0; i-- {
			if str[i] == '<' {
				r = i + 1
				break
			}
		}

		fmt.Println(min(l+1, ln-r))
		qr--
	}

}

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

package main

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

func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	t, n := 0, 0
	fmt.Fscanf(in, "%d\n", &t)
	for ii := 0; ii < t; ii++ {
		fmt.Fscanf(in, "%d\n", &n)
		s := ""
		fmt.Fscanf(in, "%s\n", &s)
		if s[0] == '>' || s[n-1] == '<' {
			fmt.Fprintf(out, "0\n")
		} else {
			fmt.Fprintf(out, "1\n")
		}
	}
	return
}

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var qr int
	fmt.Fscan(reader, &qr)

	for qr > 0 {
		var ln int
		fmt.Fscan(reader, &ln)
		var str string
		fmt.Fscan(reader, &str)

		if str[0] == '>' || str[ln-1] == '<' {
			fmt.Println(0)
			qr--
			continue
		}

		var l, r int
		for i := 0; i < ln; i++ {
			if str[i] == '>' {
				l = i - 1
				break
			}
		}

		for i := ln - 1; i >= 0; i-- {
			if str[i] == '<' {
				r = i + 1
				break
			}
		}

		fmt.Println(min(l+1, ln-r+1))
		qr--
	}

}

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

package main

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

func main() {
	reader := bufio.NewReader(os.Stdin)
	var qr int
	fmt.Fscan(reader, &qr)

	for qr > 0 {
		var ln int
		fmt.Fscan(reader, &ln)
		var str string
		fmt.Fscan(reader, &str)

		if str[0] == '>' || str[ln-1] == '<' {
			fmt.Println(0)
			qr--
			continue
		}

		var l, r int
		for i := 0; i < ln; i++ {
			if str[i] == '>' {
				l = i
				break
			}
		}

		for i := ln - 1; i >= 0; i-- {
			if str[i] == '<' {
				r = i
				break
			}
		}

		fmt.Println(min(l, ln-r+1))
		qr--
	}

}

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


Twilight Sparkle was playing Ludo with her friends Rainbow Dash, Apple Jack and Flutter Shy. But she kept losing. Having returned to the castle, Twilight Sparkle became interested in the dice that were used in the game.The dice has m faces: the first face of the dice contains a dot, the second one contains two dots, and so on, the m-th face contains m dots. Twilight Sparkle is sure that when the dice is tossed, each face appears with probability . Also she knows that each toss is independent from others. Help her to calculate the expected maximum number of dots she could get after tossing the dice n times.

A single line contains two integers m and n (1 ≤ m, n ≤ 105).

Output a single real number corresponding to the expected maximum. The answer will be considered correct if its relative or absolute error doesn't exceed 10  - 4.

NoteConsider the third test example. If you've made two tosses:  You can get 1 in the first toss, and 2 in the second. Maximum equals to 2.  You can get 1 in the first toss, and 1 in the second. Maximum equals to 1.  You can get 2 in the first toss, and 1 in the second. Maximum equals to 2.  You can get 2 in the first toss, and 2 in the second. Maximum equals to 2. The probability of each outcome is 0.25, that is expectation equals to: You can read about expectation using the following link: http://en.wikipedia.org/wiki/Expected_value

package main

import "bufio"
import "fmt"
import "math"
import "os"
import "strconv"

type MyScanner struct {
	in *bufio.Scanner
}

var in = MyScanner{bufio.NewScanner(os.Stdin)}

func ScanInts(data []byte, atEOF bool) (advance int, token []byte, err error) {
	advance, token, err = bufio.ScanWords(data, atEOF)
	if err == nil && token != nil {
		_, err = strconv.Atoi(string(token))
	}
	return
}

func (m *MyScanner) innerNext(f bufio.SplitFunc) bool {
	m.in.Split(f)
	return m.in.Scan()
}

func (m *MyScanner) NextInt() (int, error) {
	if !m.innerNext(ScanInts) {
		return 0, m.in.Err()
	}
	return strconv.Atoi(m.in.Text())
}

func main() {
	m, _ := in.NextInt()
	n, _ := in.NextInt()
	a := make([]float64, m+1)
	r := 0.0
	for i := 1; i <= m; i++ {
		a[i] = math.Pow(float64(i)/float64(m), float64(n))
	}
	for i := m; i >= 1; i-- {
		r += float64(i) * (a[i] - a[i-1])
	}
	fmt.Println(r)
}

// Author: sighduck
// URL: https://codeforces.com/problemset/problem/453/A

package main

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

func Solve(m, n float64) float64 {
	sum := float64(0)
	for i := float64(1); i <= m; i++ {
		sum += i * (math.Pow(i/m, n) - math.Pow((i-1)/m, n))
	}
	return sum
}

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

	var m, n float64
	fmt.Fscanf(reader, "%f %f\n", &m, &n)

	fmt.Fprintf(writer, "%f\n", Solve(m, n))
}