Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: mumumimi
Problemset: มุมขวาบน
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-05 02:13:04
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n;cin >> n;
ll total=1;
int i=1;
while(true){
total=total+(8*i-2);
if(total>n){
if(total-n==2){
cout << "Cannot find top-right corner.";
}
total = total-(8*i-2);
cout << total ;
break;
}else if(total==n){
cout << total ;
break;
}
i++;
}
}