#include using namespace std; using ll = long long; #define FOR(i,a,b) for(ll i=(a);i<(b);++i) #define ALL(v) (v).begin(), (v).end() #define p(s) cout<<(s)<> W >> D; FOR(i, 0, D-1){ ll rest = D-i; ll today_work = W/(rest*rest); W -= today_work; } p(W); return 0; }