Files
contests/misc/tlbdhsg/stones.cpp

21 lines
379 B
C++

#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
int a = sqrt(n);
int b = (n + a - 1) / a;
int res_a = a, res_b = b;
a += 1;
b = (n + a - 1) / a;
if (a + b < res_a + res_b) {
cout << a << " " << b << "\n";
} else {
cout << res_a << " " << res_b << "\n";
}
}