ll @A,@B,@C,@D,@E; ll s = A * (B - C); ll ans = 0; rep(i, 1, s + 1) { ans += max(D - E * (i / 10), D % E); } wt(ans);