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.|

RGB7002 - Гурвалжин

Өгөгдсөн гурвалжны периметрийг ол.

Input

Гурвалжны талууд бүхэл тоогоор нэг мөрөнд зайгаар тусгаарлагдан өгөгдөнө.

Output

Гурвалжны периметр.

Example

Input:
3 4 5

Output:
12


Нэмсэн:Bataa
Огноо:2011-01-15
Хугацааны хязгаарлалт: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

hide comments
2020-01-25 05:32:20 2 heart
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long int n,m,i;
bool b;
scanf("%lld",&n);
i=2; b=true; m=trunc(sqrt(n));
while (i<=m && b)
{
if (n%i==0) b=false;
else i++;
}
if (b==true ) printf("YES\n");
else printf("NO\n");
return 0;
}
2020-01-21 06:47:53
NICE
2020-01-21 05:19:54
#include <bits/stdc++.h>
main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",a+b+c);
}
2020-01-21 05:18:57
#include <bits/stdc++.h>
main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",a+b+c);
}
2020-01-21 05:18:19
se
2020-01-21 05:17:50
#include <bits/stdc++.h>
main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",a+b+c);
}
2020-01-19 10:36:49
/*
ID: tishkabn00
LANG: C++
TASK: word
*/

#include<bits/stdc++.h>

using namespace std;

int main(){
freopen("word.in","r",stdin);
freopen("word.out","w",stdout);

long long n,k,s,i,m,p;
string a;

cin>>n>>k>>a;

cout<<a;
m=a.size();
s=m;
for(i=2; i<=n; i++){
cin>>a;
m=a.size();
s=s+m;
if(s>k){
cout<<endl;
cout<<a;
s=m;
}else{
cout<<" "<<a;
}
}

return 0;

}
2020-01-19 10:24:03


Last edit: 2020-02-03 13:22:20
2020-01-19 07:53:54
/*
ID: turbileg
LANG: C++
TASK: photo
*/
#include<bits/stdc++.h>

using namespace std;

int main(){
//freopen("photo.in","r",stdin);
//freopen("photo.out","w",stdout);

long long n,s,p,k,m,l,S;

cin >> n;

long long a[n+1],b[n+3];
bool B[n+1];

for(int i=1; i<n; i++){
cin >> a[i];
}
for(int i=1; i<n; i++){
for(int j=1; j<=n; j++){
B[j]=false;
}
b[1]=i;
p=i;
m=0;
B[i]=true;
for(int j=1; j<n; j++){
if(a[j]-p>0 && B[a[j]-p]==false){
p=a[j]-p;
b[j+1]=p;
B[p]=true;
}
else{
m=1;
break;
}
}
if(m==0){
k=0;
for(int j=1; j<=n; j++){
if(B[j]==false){
k=1;
break;
}
}
if(k==0){
for(int j=1; j<=n; j++){
if(j==n) cout << b[j];
else cout << b[j] << " ";
}
return 0;
}
}
}
}
2020-01-18 12:01:23
/* your_id here

Task test

Lang c++

*/

#include<bits/stdc++.h>

using namespace std;

int main(){
// freopen("photo.in","r"stdin)
// freopen("photo.out","w"stdout)
long long a[1002],b[1002],c[1002];
long long n,i,s;
cin>>n;
for(i=1; i<n; i++){
cin>>a[i];
}
s=0;
for(i=0; i<n; i++){
b[i]=a[i]-1;
}
for(i=2; i<n; i++){
b[i]=a[i-1]-b[i-1];
}

for(i=1; i<n; i++){
cout<<b[i]<<" "
}
for(i=1; i<a[i]; i++){
b=a
}
return 0;
}

© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.