Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7375 - Тойрог

2N*2N шатрын хөлгийн төв дээр 2N-1 диаметртэй тойрог татахад хичнээн нүд бүтнээрээ багтах вэ?

Input

N  натурал тоо өгөгдөнө. 1<N<=150.

Output

Тойрогт бүтнээрээ багтах нүдний тоо.

Example

Input 1 :

3

Output 1 :

12

Input 2 :

4

Output 2 :

24


Нэмсэн:Bataa
Огноо:2013-04-14
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE
Эх сурвалж:ҮДС олимпиад 2013 он

hide comments
2024-12-25 11:01:34
#include <iostream>
#include <cmath>
using namespace std;

int main() {
int N;
cin >> N;

double center = N, radius = N - 0.5;
int count = 0;

for (int x = 1; x < 2 * N; x++) {
for (int y = 1; y < 2 * N; y++) {
// Шалгах 4 булан
double x1 = x - center, y1 = y - center;
double x2 = x + 1 - center, y2 = y - center;
double x3 = x - center, y3 = y + 1 - center;
double x4 = x + 1 - center, y4 = y + 1 - center;

if (x1 * x1 + y1 * y1 <= radius * radius &&
x2 * x2 + y2 * y2 <= radius * radius &&
x3 * x3 + y3 * y3 <= radius * radius &&
x4 * x4 + y4 * y4 <= radius * radius) {
count++;
}
}
}

cout << count << endl;
return 0;
}
Nymsuren


Last edit: 2024-12-25 11:01:55
2023-10-05 02:33:08
naadha deer ni bicheech
2023-03-09 15:41:06
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
cout<<(2*n-1)*(2*n-1)/2<<"\n";
return 0;
}

test buru bn!
2021-01-20 11:41:21
#include <bits/stdc++.h>
using namespace std;
long long i, j, n,a, b,c,d, l,ll,r, s, t, k, m, xh, x, x1, y,z;
long long p,q;
int main (){
int n,b;
cin>>b;
n=sqrt(1+b/4);
printf("%.2f" , n);
} uur bodlogoniih baigaa yum aa, zuer hadgalah l gesiin hhe
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.