Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: spammer_destroyer
Problemset: มุมขวาบน
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-12 20:34:54
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
long long int n;
cin >> n;
long long int x=1;//=(((n-3)/n)+6)/4;
//int right=x*(4*x-6)+3=n;
while((x+1)*(4*(x+1)-6)+3<=n) {
x++;
}
//if()
cout << x*(4*x-6)+3;
return 0;
}
//1-> 1/0 n^2+3(n-1)^2
//2-> 7/3 n^2+3(n^2-2n+1)
//3-> 21/12 4n^2-6n+3=21
//4-> 43/27 n(4n-6)+3
//1-> 1/
//7-> 2/
//21-> 3/
//43-> 4/
//( 6+sqrt(36-16*(3-x)) )/8