package main import "fmt" func main() { var a, b int fmt.Scanf("%d %d", &a, &b) if a < b { fmt.Println(b - 2) }else { fmt.Println(2 * pow(10, 9) - 2) } } //aのb乗をします O(log b) func pow(a int, b int) int { total := 1 tmp := a for b > 0 { if b % 2 == 1 { total *= tmp } b /= 2 tmp *= tmp } return total }