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

RGB7390 - Палиндром үүсгэ

Өгөгдсөн тооны цифрүүдийн байрыг солих замаар хичнээн палиндром тоо үүсгэж болох вэ. Мөн үүсгэж болох палиндром тоонуудаас хамгийн их палиндром тоог хэвлэ.  Тоо тэг ( "0" ) цифр агуулаагүй тоонд оролцсон цифрүүд тэгш тоотой байгаа. Палиндром тоо гэдэг нь зүүнээс баруун, баруунаас зүүн тийш уншихад ижил тоо байхыг хэлнэ. 

Input

Натурал тоо өгөгдөнө. Оронгийн тоо 40-өөс ихгүй. Цифрүүд тэгш тоогоор орно. Мөн тэг цифр агуулаагүй болно.

Output

Эхний мөрөнд өгөгдсөн тооны цифрүүдээр үүсгэж болох палиндром тоонуудын тоо.

Хоёр дахь мөрөнд үүсгэж болох палиндром тоонуудын хамгийн их тоо.

Example

Input:
12123333

Output:
12
33211233

Нэмсэн:Bataa
Огноо:2013-04-09
Хугацааны хязгаарлалт: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-03-13 06:16:28
#include<iostream>
using namespace std;
main (){
int n,urwuu,n2,unen=1;
cin>>n;
while(unen)
{
n2=n;
urwuu=0;
while(n2>0)
{
urwuu=urwuu*10+n2%10;
n2/=10;

}
if(n==urwuu)
unen=0;
n++;

}
cout<<urwuu;
}
\\Khan-Uul Duku ahaas ni

Last edit: 2023-03-13 06:17:48
2022-05-29 06:34:34
never gonna give you up
never gonna let you down
never gonna run around and desert you
2022-05-29 06:15:18
I don't wanna lie, I don't wanna lie
I don't wanna tear you apart
I don't wanna lie, I don't wanna lie
I told you right from the start
Since we got a moment to talk
Why don't we just sit right down
Or we can take a little walk
Around the town
You were always good to me
My friends would say you treated me fine
But there's something you just can't see
And now it's time
But baby
I don't wanna lie, I don't wanna lie
I don't wanna tear you apart
I don't wanna lie, I don't wanna lie
I told you right from the start
I don't wanna cause you pain
Everytime I have to go
But the road is always calling my name
To another show
Ohh, Babe. I don't wanna lie, I don't wanna lie
I don't wanna tear you apart
I don't wanna lie, I don't wanna lie
I told you right from the start
Oh, eh (I don't wanna lie)
I don't wanna lie to you
Ooh, ooh(I don't wanna lie)
I don't wanna lie to you
Hey, hey, hey, hey, hey
Hey, I don't wanna lie to you
Ooh, ooh, hey, hey
I don't wanna lie to you, yeah, yeah
I don't wanna lie to you, woohoo
2020-05-12 12:47:41
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i] == '1'){
k += x;
k %= 15;
}
x *= 2;
x %= 15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
}
return 0;
}
2020-05-12 12:40:10
chadval huul
2020-05-12 12:39:52
#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}#include <bits/stdc++.h>
using namespace std;

int main() {
string s;
int k=0,x=1;
cin>>s;
reverse(s.begin(),s.end());
for(int i=0;i<s.size();i++)
{
if(s[i]=='1'){
k+=x;
k%=15;
}
x*=2;
x%=15;
}
if(k%15==0){
cout<<"Yes";
}else{
cout<<"No";
return 0;
}
}
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.