#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
bool is(int x)
{
string s;
s=to_string(x);
if(s.size()!=2) return false;
if(s[0]==s[1]) return true;
else return false;
}
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin>>n;
if(is(n))
{
cout<<"Yes";
}
else
{
cout<<"No";
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
int u[1];
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a,b;
cin>>a>>b;
u[0]=a,u[1]=b;
sort(u,u+1);
cout<<2*u[1]-u[0];
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a[5];
int ans=0;
for(int i=1;i<=5;i++)
{
int x=0;
cin>>x;
if(x==1)
{
cout<<i;
return 0;
}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin>>s;
cout<<s[0]<<s[2];
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
int a[200010],b[200010];
int n;
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
if(a[i]==0)
{
cout<<"NO";return 0;
}
}
cout<<"YES";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
#define int long long
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string s;
cin>>s;
char c=s.back();
int x=c-'0';
if(x%2==0) cout<<1<<endl;
else cout<<-1<<endl;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N], s[N][N];
int a[100010], t[15];
#define int long long
signed main()
{
int n;
cin >> n;
for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
t[x]++;
}
int b = n / 9;
if (n % 9 != 0)
{
int d = n % 9;
int sum = 0;
for (int i = 1; i <= 9; i++)
{
if (t[i] - b == 1)
{
sum++;
}
else if (t[i] - b > 1)
{
cout << "NO";
return 0;
}
}
if (sum == d)
{
cout << "YES";
}
else
{
cout << "NO";
}
return 0;
}
else
{
for (int i = 1; i <= 9; i++)
{
if (t[i] != b)
{
cout << "NO";
return 0;
}
}
}
cout << "YES";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
int a[100010],t[15];
#define int long long
signed main() {
int z;
cin>>z;
if(z<=2)
{
cout<<"NO";
}
else{
cout<<"YES"<<endl;
cout<<1<<' '<<z-1;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
int a[100010],t[15];
#define int long long
signed main() {
int q;
cin>>q;
while(q--)
{
int m,x;
cin>>m>>x;
int r=x%m;
if(r==0)
{
cout<<m;
}
else
{
cout<<r;
}
cout<<endl;
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
const int N = 501;
int A[N][N],s[N][N];
int a[100010],t[15];
#define int long long
signed main() {
int a,b,x;
cin>>a>>b>>x;
double m=b/3.0;
if(m<a)
{
int d=x/3;
int res=x-d*3;
if(a*res<b)
{
cout<<a*res+d*b;
}
else
{
cout<<(d+1)*b;
}
}
else
{
cout<<x*a;
}
return 0;
}