#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) using namespace std; int main() { fastIO; int W, D; cin >> W >> D; for (int day = 0; day < D - 1; ++day) { int d = D - day; W -= W / (d * d); } cout << W << '\n'; return 0; }