Submission

Status:

-P--PPP-P---PPPPP---

Subtask/Task Score:

50/100

Score: 50

User: modx9572

Problemset: มุมขวาบน

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-08 10:34:39

#include <bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int ans;
	int i=0;
	while(n>pow(i,2)-(i-1)){
		ans=pow(i,2)-(i-1);
		i++;
	}
	if(ans-1==n){
		cout << "Cannot find top-right corner.";
	}
	else {
		cout << ans;
	}
}