diff --git a/13xxx/13035.cpp b/13xxx/13035.cpp new file mode 100644 index 00000000..e843ac4a --- /dev/null +++ b/13xxx/13035.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; + +void solve(void) { + long long a, b, c; cin >> a >> b >> c; + + long long p = ((a*b)/(c*c))*(c*c); + long long q = ((a*b+c*c-1)/(c*c))*(c*c); + + cout << (p && a*b-p < q-a*b ? p : q) << "\n"; +} + +int main(void) { + ios::sync_with_stdio(false); + cin.tie(nullptr); + + int t; cin >> t; + while (t--) solve(); + return 0; +} \ No newline at end of file