Submission

Status:

PPPP--PPPPPP---PPPPP

Subtask/Task Score:

75/100

Score: 75

User: Bestzu

Problemset: มุมขวาบน

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-15 10:13:15

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

int main() {
    ios::sync_with_stdio(false); cin.tie(0);

    int n; cin >> n;
    int i = sqrt(n);
    if(i % 2 == 0) i--;
    int topright = i*i - (i-1);
    if(n + 1 == (i+1)*(i+2)) {
    	cout << "Cannot find to-right corner.";
	}
    else cout << topright;
    return 0;
}