Submission
Status:
----PP------PPP-----
Subtask/Task Score:
25/100
Score: 25
User: Kidmaiok
Problemset: มุมขวาบน
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-07 09:57:17
#include<bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
long long i = 1;
while (i * i < n) i += 2; // find smallest odd square >= n
long long topRight = i * i - (i - 1);
if (topRight <= n)
cout << topRight;
else
cout << "Cannot find top-right corner.";
}