Skip to content

Commit

Permalink
Add 13035.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jun 20, 2024
1 parent a285b6e commit f206053
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 13xxx/13035.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <iostream>
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;
}

0 comments on commit f206053

Please sign in to comment.