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
2023-05-10 09:51:48
2023-03-24 02:52:14
#include <iostream>

using namespace std;

int main()
{
int a[1000],n,i,s=0,b[1000],t=0;
cin>>n;
for (i=1;i<=n;i++) {
cin>>a[i];
s+=a[i];
}
for (i=1;i<=n;i++)
if (s%a[i]==0 && s/a[i]==n) {
t=t+1;
b[t]=i;
}
if (t!=0) {
cout<<t<<endl;
for (i=1;i<=t;i++){
cout<<b[i]<<" ";
}}
else
cout<<0<<endl;
cout<<" ";


return 0;
}
2023-05-06 14:14:03
ta nar bugd gomo
2023-04-24 05:10:49
molor is super suck

Last edit: 2023-04-24 05:11:28
2023-04-24 05:10:49
molor is suck

Last edit: 2023-04-24 05:11:08
2023-04-18 13:18:13
hi nomgon

Last edit: 2023-04-18 13:19:11
2023-04-18 13:16:10
1


Last edit: 2023-04-18 13:16:45
2023-04-18 13:16:09
hi sister

Last edit: 2023-04-18 13:16:45
2023-04-13 07:22:56
6
\
2023-04-06 12:59:48
1


Last edit: 2023-04-18 13:16:52
2023-03-24 02:52:14
#include <iostream>

using namespace std;

int main()
{
int a[1000],n,i,s=0,b[1000],t=0;
cin>>n;
for (i=1;i<=n;i++) {
cin>>a[i];
s+=a[i];
}
for (i=1;i<=n;i++)
if (s%a[i]==0 && s/a[i]==n) {
t=t+1;
b[t]=i;
}
if (t!=0) {
cout<<t<<endl;
for (i=1;i<=t;i++){
cout<<b[i]<<" ";
}}
else
cout<<0<<endl;
cout<<" ";


return 0;
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.