def solve(N, X):