#include using namespace std; using ll=long long; using ld=long double; using P=pair; using V=vector; #define rep(i,n) for(ll i=0;i> x >> a; V dp(n,inf); dp[0]=0; rep(j,n) if(j*j+x> t; rep(i,t) solve(); }