We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Proud to say my code is shorter than the Editorials:
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int t; cin >> t;
for (int i = 0; i < t; i++) {
int a,b,c; cin >> a >> b >> c;
unsigned long long d = pow(a,b) + c / 2;
cout << d - (d % c) << endl;
}
return 0;
}
Closest Number
You are viewing a single comment's thread. Return to all comments →
Proud to say my code is shorter than the Editorials: