package main import ( "fmt" "sort" ) func divisors(x int) []int { var r []int for i := 1; i*i <= x; i++ { if x%i == 0 { r = append(r, i) if i*i != x { r = append(r, x/i) } } } sort.Ints(r) return r } func patterns(x int) int { if x <= 1 { return 0 } else if x <= n+1 { return x - 1 } else if x <= 2*n { return 2*n + 1 - x } else { return 0 } } var n, k int func main() { fmt.Scan(&n, &k) divs := divisors(k) ans := 0 for i := range divs { ans += patterns(divs[i]) * patterns(k/divs[i]) } fmt.Println(ans) }