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
2019-11-11 07:25:18
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:18
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:18
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:18
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:18
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:17
hahahahahahahahahahahahhaahahhaha
2019-11-11 07:25:17
hahahahahahahahahahahahhaahahhaha
2019-11-10 08:49:00
easy
2019-11-10 06:23:20
chi yun ulun yumbe


Last edit: 2019-11-10 06:28:55
2019-11-09 08:03:23
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,c[100],d,e,i,j,n,ans;
string s;
int main(){
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
string s,s1;
cin>>s;
for(i=0;i<s.size();i++){
c[s[i]]++;
}
if(s.size()%2==0){
b=s.size()/2;
for(i='A';i<='Z';i++){
b-=c[i]/2;
}
if(b!=0){
cout<<"NO SOLUTION";
}
else{
for(i='A';i<='Z';i++){
for(j=1;j<=c[i]/2;j++){
cout<<char(i);
}
}
for(i='Z';i>='A';i--){
for(j=1;j<=c[i]/2;j++){
cout<<char(i);
}
}
}
}
else{
b=0;
for(i='A';i<='Z';i++){
if(c[i]%2==1)b++;
}
if(b!=1){
cout<<"NO SOLUTION";
}
else{
for(i='A';i<='Z';i++){
for(j=1;j<=c[i]/2;j++){
cout<<char(i);
}
}
for(i='A';i<='Z';i++){
if(c[i]%2==1){
cout<<char(i);
}
}
for(i='Z';i>='A';i--){
for(j=1;j<=c[i]/2;j++){
cout<<char(i);
}
}
}
}
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.