Submission

Status:

--------------------

Subtask/Task Score:

0/100

Score: 0

User: Kei

Problemset: มุมขวาบน

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-08 16:52:27

#include<iostream>
#include<iomanip>
#include<vector>
using namespace std;
using ll = long long;
using pii = pair<int,int>;


void solve(){
    ll n;
    cin >> n;
    ll c=1,k=0;
    ll d=c+6;
    //gap = 8n+6;
    while(d<=n){
        c=d;
        k++;
        d=c+8;
    }
    if(n==d+1) cout << "Cannot find top-right corner.";
    else if(n==d) cout << n;
    else cout << c;

}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}