akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;

struct edge {
    int to, cost;
};

int V;
vector<edge> G[1000000];

//木の直径（未完成）
plglg visit(int p, int v) {
    plglg ans(0, v);
    int n = G[v].size();
    for(int i = 0; i < n; i++){
        edge e = G[v][i];
        if (e.to != p) {
            plglg a = visit(v, e.to);
            a.first += e.cost;
            if (ans.first < a.first) {
                ans = a;
            }
        }
    }
    return ans;
}

pii farthest;

ll diameter() {
    plglg r = visit(-1, 0);
    plglg t = visit(-1, r.second);
    farthest.first = r.second;
    farthest.second = t.second;
    return t.first;
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n - 1; i++) {
        int s, t, w;
        cin >> s >> t >> w;
        edge e1;
        e1.to = t;
        e1.cost = w;
        G[s].push_back(e1);
        edge e2;
        e2.to = s;
        e2.cost = w;
        G[t].push_back(e2);
    }
    ll ans = diameter();
    cout << ans << endl;
}



Measured memory_bytes: 37500
N=int(input())






out=[]
if(N%2==0):
	for i in range(1,N+1):
		for j in range(i+1,N+1):
			if(i+j!=N+1):
				out.append(str(i)+" "+str(j))			
else:
	for i in range(1,N+1):
		for j in range(i+1,N+1):
			if(i+j!=N):	
				out.append(str(i)+" "+str(j))			

print(len(out))
for i in out:
	print(i)






Measured memory_bytes: 3588
n,a,b,c,d = map(int,input().split())
path = list(input())
path = ['.']+path
path[a] = 'a'
path[b] = 'b'
while(a<c or b<d):
    walk = 0
    if c<d:
        if b != d:
            if b+2<=d and path[b+2]!='#'and path[b+2]!='a':
                path[b]='.'
                path[b+2] ='b'
                b+=1
                walk = 1
            if path[b+1]!='#'and path[b+1]!='a':
                path[b]='.'
                path[b+1] ='b'
                b+=1
                walk = 1
        if not walk:
            if a!=c:
                if path[a+1]!='#'and path[a+1]!='b':
                    path[a]='.'
                    path[a+1] ='a'
                    a+=1
                    walk = 1
                if a+2<=c and path[a+2]!='#'and  path[a+2]!='b':
                        path[a]='.'
                        path[a+2] ='a'
                        a+=2
                        walk = 1
    else :
        if a + 2 <= c and path[a + 2] != '#' and path[a + 2] != 'b':
            path[a] = '.'
            path[a + 2] = 'a'
            a += 2
            walk = 1
        if a!=c:
            if path[a+1]!='#'and path[a+1]!='b':
                path[a]='.'
                path[a+1] ='a'
                a+=1
                walk = 1
        if not walk:
            if b != d:
                if path[b+1]!='#'and path[b+1]!='a':
                    path[b]='.'
                    path[b+1] ='b'
                    b+=1
                    walk = 1
                elif b+2<=d and path[b+2]!='#'and path[b+2]!='a':
                    path[b]='.'
                    path[b+2] ='b'
                    b+=2
                    walk = 1
    if walk==0:
        break
if a==c and b==d:
    print('Yes')
else:
    print('No')






Measured memory_bytes: 6388
#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265358979323846
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define mp make_pair
#define pb push_back
#define fi first
#define se second

#define N 100000

typedef long long ll;
typedef unsigned long long ull;

ll a[N + 1];
map<ll, int> m;
vector<ll> ans;

int main(){
	int n, i;

	scanf("%d", &n);

	for (i = 1; i <= n; i++){
		scanf("%lld", a + i);

		m[a[i]]++;

		if (m[a[i]] == 2){
			ans.pb(a[i]);
		}
		else if (m[a[i]] == 4){
			ans.pb(a[i]);
		}
	}

	sort(ans.begin(), ans.end());

	if ((int)ans.size() >= 2){
		printf("%lld\n", ans[ans.size() - 1] * ans[ans.size() - 2]);
	}
	else{
		printf("0\n");
	}

	return 0;
}

Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>
#include <queue>

using namespace std;
typedef long long ll;
#define MOD 1000000007

int main() {
    int A, B, C;
    cin >> A >> B >> C;

    cout << max(0, C - (A - B)) << endl;

    return 0;
}

Measured memory_bytes: 256
//#include <algorithm>
#include <cstdio>
#include <string>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stack>
#include <map>



typedef unsigned long long ULONG;
typedef long long LONG;
using namespace std;

#define PI 3.1415926535897932384626433
#define _DBG_


int main(void) {
	int X, N;
	cin >> X >> N;
	vector<int> p(N);
	map<int, int> memo;

	if (N == 0) {
		cout << X << endl;
		return 0;
	}

	for (int i = 0; i < N; i++) {
		cin >> p[i];
		memo[p[i]] = 1;
	}

	//Xからサーチ
	if (memo[X] == 0) {
		cout << X << endl;
		return 0;
	}

	int largeNo = -1;
	int smallNo = -1;
	for (int i = X + 1; i <= 101; i++) {
		if (memo[i] == 0) {
			largeNo = i;
			break;
		}
	}
	for (int i = X - 1; i >= 0; i--) {
		if (memo[i] == 0) {
			smallNo = i;
			break;
		}
	}

	if (abs(largeNo - X) > abs(smallNo - X)) {
		cout << smallNo << endl;
	}
	else if (abs(largeNo - X) < abs(smallNo - X)) {
		cout << largeNo << endl;
	}
	else {
		cout << smallNo << endl;
	}



	return 0;
}



Measured memory_bytes: 3636
n , m = map(int , input().split())
dp = []
for i in range(n + 1):
    dp.append([])
    for j in range(m + 1):
        dp[i].append(0)
arr = []
for i in range(n):
    arr.append(input())
dp[1][1] = 1
for i in range(1,n + 1):
    for j in range(1,m + 1):
        if arr[i - 1][j - 1] == '#' or (i == 1 and j == 1):
            continue
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1]
print(dp[n][m] % 1000000007)


Measured memory_bytes: 168232
#include<bits/stdc++.h>

using namespace std;



#define FOR(i,bg,ed) for(int i=bg;i<ed;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

#define fi first
#define se second
#define pb push_back
typedef long long LL;
const LL INF = 1e10;

template<typename T>
bool chmin(T& l,T r){
    bool ret = l>r;
    if(ret)l=r;
    return ret;
}
LL N,S,W,Q;



void solve(){
    vector<LL> a(N),b(N+1,0);
    LL g = S;
    LL ten=1;
    REP(i,N){
        a[i] = (g/7) % 10;
        if( g%2 == 0 ) { g = (g/2); }
        else           { g = (g/2) ^ W; }

    }
    reverse(ALL(a));
    if(Q==2){
        LL ret=0;
        REP(i,N)b[i]=(a[i]!=0);
        for(int i=N-1;i>=0;i--){
            if(a[i]%2==0){
                ret+=b[i+1];
                if(a[i]!=0)ret++;
            }
            b[i]+=b[i+1];
        }
        cout<<ret<<endl;
    }
    else if(Q==5){
        LL ret=0;
        REP(i,N)b[i]=(a[i]!=0);
        for(int i=N-1;i>=0;i--){
            if(a[i]%5==0){
                ret+=b[i+1];
                if(a[i]!=0)ret++;
            }
            b[i]+=b[i+1];
        }
        cout<<ret<<endl;
    }
    else{
        REP(i,N){
            b[i+1] = (a[i]*ten + b[i]) % Q;
            ten = ten*10%Q;
        }
        LL ret=0;
        map<LL,int> cnt; 
        for(int i=N-1;i>=0;i--){
            LL C = b[i+1];
        ret+=cnt[C];
        if(a[i]!=0)cnt[b[i+1]]++;
        }
        cout<<ret+cnt[0]<<endl;
    }
}
int main(){
    while(cin>>N>>S>>W>>Q,N)solve();
    return 0;
}

Measured memory_bytes: 9848
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pb push_back
#define pii pair<int , int>
#define fast ios_base::sync_with_stdio(0)
#define mod 1000000007
#define mx 200005
int arr[302], n;
double dp[302][302][302], d;
double fun(int one, int two, int three)
{
    int zero = n - (one + two + three);
    if(zero == n) return 0;
    double& ret = dp[one][two][three];
    if(ret>=0) return ret;
    ret = 0;
    if(one>0)ret = ret + (one*d)*(1.0 + fun(one-1, two, three));
    if(two>0)ret = ret + (two*d)*(1.0 + fun(one+1, two-1, three));
    if(three>0)ret = ret + (three*d)*(1.0 + fun(one, two+1, three-1));
    ret+=(zero*d);
    ret/=( 1.0 - d*zero );
    return ret;
}
int main()
{
    fast;
    cin>>n;
    int one=0, two=0,three=0;
    for(int i=1; i<=n; i++){
        cin>>arr[i];
        if(arr[i]==1) one++;
        if(arr[i]==2) two++;
        if(arr[i]==3) three++;
    }
    for(int i=0; i<302; i++)
        for(int j=0; j<302; j++)
            for(int k=0; k<302; k++)
                dp[i][j][k] = -1.0;
    d = 1.0/n;
    cout<<fixed<<setprecision(12)<<fun(one,two,three)<<endl;

}


Measured memory_bytes: 215552
#include "bits/stdc++.h"

#define ed cout<<"\n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long 
#define ffor(i,a,b) for(ll i=(ll)(a);i<(ll)(b);++i)
#define rep(i, n) ffor(i,0,n)
#define All(obj) (obj).begin(),(obj).end()
#define INF ((ll)1e9+7)
#define c(a) cout<<a<<"\n";
using namespace std;
const int N = 100005;



int main() {
	speed;
	cout << fixed << setprecision(6);
	/*start*/
	string s, v, c;
	cin >> s >> v >> c;
	cout << s[0] << v[1] << c[2] << endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int n,d[300001];
	bool flg=false;
	
	cin>>n;
	
	int i;
	
	int MAX=1;
	for(i=0;i<n;i++){
		cin>>d[i];
	}
	for(i=0;i<n;i++){
		d[i]=d[i]/10;
		MAX--;
		if(MAX<d[i]) MAX=d[i];
		if(MAX==0){
			flg=true;
			break;
		}
	}
	
	MAX=1;
	
	if(!flg){
		for(i=n-1;i>=0;i--){
			MAX--;
			if(MAX<d[i]) MAX=d[i];
			if(MAX==0){
				flg=true;
				break;
			}
		}
	}
	
	cout<<((flg)?"no":"yes")<<endl;
	
	return 0;
}
		
			
	
		
	
	


Measured memory_bytes: 4276
#include<stdio.h>
int main(void){
int n,max=-1000001,min=1000001;
long long sum=0;
scanf("%d",&n);
if(0<n&&n<=10000){
int i;
long number;
for(i=0;i<n;i++){
if(scanf("%ld",&number)==1){
if(-1000000>number||number>1000000)
return 0;
sum+=number;
if(max<number)
max=number;
if(min>number)
min=number;
}}
printf("%d %d %ld\n",min,max,sum);
}
return 0;
}

Measured memory_bytes: 1028
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int n;
	cin>>n;
	vector<long long> v(n);
	vector<long long> sum(n);
	for(long long i=0;i<n;i++){
		cin>>v[i];
		if(i==0)
 			sum[i]=v[i];
		else
			sum[i]=v[i]+sum[i-1];	
	}
	vector<vector<long long> > dp(n,vector <long long> (n,0));
	for(long long j=0;j<n;j++){
		for(long long i=j-1;i>=0;i--){
			dp[i][j]=10e15;
			for(long long k=i;k<j;k++){
	 			long long s=0;
	 			s=sum[j];
				if(i>0)
	 				s-=sum[i-1];
				dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+s);	
			}	
		}
	 }
	cout<<dp[0][n-1]<<endl;
	return 0;
}

Measured memory_bytes: 4848
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define dbl(k, x) fixed << setprecision(k) << (x)

template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}

#define _upgrade                \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define DBG(...) _DBG(#__VA_ARGS__, __VA_ARGS__)

// ********************** CODE ********************** //
int main() {
  _upgrade;
  int n;
  cin >> n;
  vector<long long> L(n);
  for (auto &l : L) {
    cin >> l;
  }

  long long res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        if (L[i] + L[j] > L[k] && L[i] + L[k] > L[j] && L[k] + L[j] > L[i] &&
            L[i] != L[j] && L[j] != L[k] && L[i] != L[k]) {
          res++;
          // DBG(i, j, k);
        }
      }
    }
  }

  cout << res << "\n";
  return 0;
}

Measured memory_bytes: 3640
import itertools
import math

n = int(input())
xy = [[int(i) for i in input().split()] for j in range(n)]

_list = list(itertools.permutations(xy))
a = []
for i in _list:
    b = 0
    for j in range(len(i)-1):
        a.append(math.sqrt(pow(i[j][0]-i[j+1][0], 2) + pow(i[j][1]-i[j+1][1], 2)))
print(sum(a)/len(_list))

Measured memory_bytes: 16892
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    vector<int> a(N);
    REP(i, N) cin >> a[i];

    int ans = 0;
    REP(i, N) {
        while (a[i] % 2 == 0) {
            a[i] /= 2;
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz size
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, m;
    cin >> n >> m;
    vector<vector<ll>> bulbs (m, vector<ll>());
    vector<ll> p(n);
    F0R(i, m)
    {
        int num;
        cin >> num;
        F0R(j, num)
        {
            int tmp;
            cin >> tmp;
            bulbs[i].pb(tmp);
        }
    }
    F0R(i, m) cin >> p[i];
    int res = 0;
    F0R(i, pow(2, n))
    {
        int numB = 0;
        F0R(j, bulbs.sz())
        {
            int cnt = 0;
            F0R(k, bulbs[j].sz())
            {
                if(((1<<(bulbs[j][k] - 1)) & i) > 0)
                {
                    cnt++;
                } 
            }
            if((cnt % 2) == p[j]) numB++;
        }
        if(numB == m)
        {
            res++;
        }
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>

#define max 100

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int count_digit(int a){int i=0;while (a!=0) {a=a/10;i++;}return i;}

int main()
{
    long long int n, i, sum=0;
    
    scanf("%lld", &n);
    
    for (i=1; i<=n; i++) {
        if (i%3!=0&&i%5!=0) {
            sum+=i;
        }
    }
    
    printf("%lld", sum);
    
    return 0;
}



Measured memory_bytes: 1728
#include<bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    scanf("%d",&n);
    int ans=0;
    for(int i=0;i<3;i++){
        if(n%10==7)ans=1;
        n/=10;
    }
    if(ans){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return(0);
}

Measured memory_bytes: 3764
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;


public class E
{
	public static void Main()
	{
		(new Solver()).Solve();
	}
}


public class Solver
{
	public static readonly long MOD = 1000000007;

	private int N;
	private int K;
	private List<int>[] adj;
	private bool[] visited;

	public Solver()
	{
		N = GetInt();
		K = GetInt();
		adj = new List<int>[N];
		for(int i = 0; i < N; i++)
			adj[i] = new List<int>();

		for(int i = 0; i < N - 1; i++)
		{
			int a = GetInt() - 1;
			int b = GetInt() - 1;
			adj[a].Add(b);
			adj[b].Add(a);
		}

		visited = new bool[N];
	}

	public void Solve()
	{
		long ans = K;
		var queue = new Queue<State>();
		queue.Enqueue(new State(0, 1));
		visited[0] = true;
		while(queue.Count > 0)
		{
			var state = queue.Dequeue();
			var sonList = new List<int>();
			foreach(int u in adj[state.Vertex])
			{
				if(visited[u])
					continue;
				visited[u] = true;

				sonList.Add(u);
			}

			int numSon = sonList.Count;
			for(int i = 0; i < sonList.Count; i++)
				ans = (ans * (K - i - Math.Min(2, state.Depth))) % MOD;

			foreach(int son in sonList)
				queue.Enqueue(new State(son, state.Depth + 1));
		}
		Console.WriteLine(ans);
	}
}


public struct State
{
	public int Vertex;
	public int Depth;

	public State(int v, int d)
	{
		Vertex = v;
		Depth = d;
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}





Measured memory_bytes: 33036
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

int main() {
  
  int k; cin >> k;
  string s; cin >> s;
  if (s.size() <= k) {
    cout << s << endl;
  } else {
    cout << s.substr(0, k) + "..." << endl;
  }
  return 0;
}


Measured memory_bytes: 3628
"use strict";
// inputに入力データ全体が入る
const main = (input) => {
  const [a, b] = input.trim().split(" ").map(Number);
  if (a % 3 === 0 || b % 3 === 0 || (a + b) % 3 === 0) {
    return "Possible";
  } else {
    return "Impossible";
  }
};

// ※この行以降は編集しない (標準入力から一度に読み込みMainを呼び出します)
console.log(main(require("fs").readFileSync("/dev/stdin", "utf8")));


Measured memory_bytes: 29628
#include<bits/stdc++.h>
using namespace std;

int main(void){
   int K,S;
   cin>>K>>S;
   int ans=0;
   for(int i=0;i<=K;i++){
      for(int j=0;j<=K;j++){
         int Z=S-i-j;
         if(0<=Z&&Z<=K) ans++;
      }
   }
   cout<<ans<<endl;
   return 0;
}



Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        String ss = inp.next();
        char s[] = ss.toCharArray();
        char ans[] = new char[s.length];
        for (int i = 0; i < s.length; i++) {
            if (s[i] == '1') ans[i] = '9';
            else ans[i] = '1';
        }
        System.out.println(String.valueOf(ans));
        inp.close();
    }
}


Measured memory_bytes: 25172
#include <bits/stdc++.h> 

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define rep(i,N) for(int i=0;i<N;i++)

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int A,B,C;
  cin>>A>>B>>C;
  if(A==B&&A!=C)cout<<"Yes"<<endl;
  else if(A==C&&A!=B)cout<<"Yes"<<endl;
  else if(B==C&&A!=B)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;

int main(){
	int n, a;
	cin >> n >> a;
	if ((n % 500) <= a)
		cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h> 
//#define <- プログラムの文字列を置換する
//typedef <- 新しい型に名前を付けるためのキーワード

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

const long long MOD = 1e9 + 7;
const long long INF = 1e15;
const int INF_INT = 1e9;

template<class TYPE>
struct edge{
    TYPE to,cost; 
    edge(TYPE t,TYPE c){
        to = t;
        cost = c;
    }
};

int main(){
    int k,x;
    cin >> k >> x;
    for(int i = x - k + 1 ; i <= x + k - 1; i++){
        cout << i << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3588
/*bismillah ->                                                                                                         << Suirkhanov Meyirlan >>
  GL HF


                                                                                                                      42

    bless my code =)
                                                                                                            NEVER FOLLOW YOUR RULES :D HAHAHAHA
*/


///scanf ("%d%d", &x, &y);
///printf("%d", &a)

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define pii pair < int , int >
#define pll pair < ll, ll >
#define pb push_back
#define pf psuh_front
#define mp make_pair
#define fi first
#define se second
#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define eb emplace_back

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll N = 2 * 1e5 + 7;
const ld pi = 3.14159265359;
const int INF = 1e20 + 7;
const double eps = 1e-9;

const int xi[4] = {-1, 0, +1, 0};
const int yj[4] = {0, +1, 0, -1};
const int xxi[4] = {+1, 0, -1, 0};
const int yyj[4] = {0, -1, 0, +1};

string s;

bool f[N];

int main(){

  //freopen("bridge.in", "r", stdin);
  //freopen("bridge.out", "w", stdout);

  fast
  randoperation;

  ///           ||
  ///start here \/

  cin >> s;

  cout << ((s.size() + (s[s.size() - 1] == s[0])) % 2 ? "First" : "Second");
}


Measured memory_bytes: 512
while 1:
    try:
        n=[]
        for i in range(8):
            s=input()
            n_s=[]
            for j in s:
                n_s.append(int(j))
            for j in range(3):n_s.append(0)
            n.append(n_s)
        n_s=[0]*11
        for i in range(3):
            n.append(n_s)    
        for i in range(64):
            if n[i//8][i%8]==1:
                break
        p_x=i//8
        p_y=i%8
        if n[p_x][p_y]+n[p_x][p_y+1]+n[p_x+1][p_y]+n[p_x+1][p_y+1]==4:print("A")
        elif n[p_x][p_y]+n[p_x+1][p_y]+n[p_x+2][p_y]+n[p_x+3][p_y]==4:print("B")
        elif n[p_x][p_y]+n[p_x][p_y+1]+n[p_x][p_y+2]+n[p_x][p_y+3]==4:print("C")
        elif n[p_x][p_y]+n[p_x][p_y+1]+n[p_x+1][p_y+1]+n[p_x+1][p_y+2]==4:print("E")
        elif n[p_x][p_y]+n[p_x+1][p_y]+n[p_x+1][p_y+1]+n[p_x+2][p_y+1]==4:print("F")
        else:
            if n[p_x][p_y]+n[p_x+1][p_y-1]+n[p_x+1][p_y]+n[p_x+2][p_y-1]==4:print("D")
            elif n[p_x][p_y]+n[p_x][p_y+1]+n[p_x+1][p_y-1]+n[p_x+1][p_y]==4:print("G")
        s=input()
    except:break


Measured memory_bytes: 5616
public class Main {

	private static void solve() {
		char[] s = ns();
		s[3] = '8';
		System.out.println(s);
	}

	public static void main(String[] args) {
		new Thread(null, new Runnable() {
			@Override
			public void run() {
				long start = System.currentTimeMillis();
				String debug = args.length > 0 ? args[0] : null;
				if (debug != null) {
					try {
						is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
					} catch (Exception e) {
						throw new RuntimeException(e);
					}
				}
				reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
				solve();
				out.flush();
				tr((System.currentTimeMillis() - start) + "ms");
			}
		}, "", 64000000).start();
	}

	private static java.io.InputStream is = System.in;
	private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
	private static java.util.StringTokenizer tokenizer = null;
	private static java.io.BufferedReader reader;

	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new java.util.StringTokenizer(reader.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	private static double nd() {
		return Double.parseDouble(next());
	}

	private static long nl() {
		return Long.parseLong(next());
	}

	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private static char[] ns() {
		return next().toCharArray();
	}

	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}

	private static int[][] ntable(int n, int m) {
		int[][] table = new int[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				table[i][j] = ni();
			}
		}
		return table;
	}

	private static int[][] nlist(int n, int m) {
		int[][] table = new int[m][n];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				table[j][i] = ni();
			}
		}
		return table;
	}

	private static int ni() {
		return Integer.parseInt(next());
	}

	private static void tr(Object... o) {
		if (is != System.in)
			System.out.println(java.util.Arrays.deepToString(o));
	}
}


Measured memory_bytes: 22612
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<'\n'

int main(){
    int n,m;
    cin >> n >> m;
    ll ans = 0;
    int t;
    REP(i,m){
        cin >> t;
        ans += t;
    }
    if(n-ans>=0)COUT(n-ans);
    else COUT(-1);
    return 0;
}

Measured memory_bytes: 3592
// Problem : B - Count Balls
// Contest : AtCoder Beginner Contest 158
// URL : https://atcoder.jp/contests/abc158/tasks/abc158_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cp-editor)

#include<bits/stdc++.h>
using namespace std;
#define ff first
#define fs second
#define int long long
#define vi vector<int>
#define vvi vector< vector <int> >
#define vpii vector< pair<int, int> >
#define vb vector<bool>
#define si set<int>
#define mii map<int, int>
#define mci map<char, int>
#define md 1000000007
#define pb push_back
#define eb emplace_back
#define f(i,a,b) for(int i=(int)a;i<=(int)b;i++)
#define r(i,a,b) for(int i=(int)a;i>=(int)b;i--)
#define qw1(x) cerr<<#x<<": "<<x<<" "<<endl
#define qw2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define qw3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define qw4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

void sieve(int n, vb &prime)
{
    prime[0]=false;     prime[1]=false;
    for(int i=2;i*i<=n;i++){
         if(prime[i]==true){
            for(int j=i*i;j<=n;j+=i)    prime[j]=false;
             }
    }
}
int32_t main ()
{
  //ios_base::sync_with_stdio (false); cin.tie (NULL);  cout.tie (NULL);
   int n,a,b;	cin>>n>>a>>b;
   int z=a+b;
   int x=n/z;
   cout<<x*a+min(a,n%z);
   
 
}








Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int n, a, b, u, x[101], y[101], h[101], cx, cy, H;

int main() {
    cin >> n;

    for (int i = 1; i <= n; i++) {
        cin >> x[i] >> y[i] >> h[i];
        if (h[i] != 0) u=i;
    } 

    for (int xi = 0; xi <= 100; xi++) {
        for (int yi = 0; yi <= 100; yi++) {
            cx = xi, cy = yi;
            H = h[u] + abs(x[u]-cx) + abs(y[u]-cy);

            for (int i = 1; i <= n; i++) {
                if (h[i] != max(H-abs(cx-x[i])-abs(cy-y[i]), 0)) break;
                if (i == n) {
                    printf("%d %d %d\n", cx, cy, H);
                    return 0;
                }
            }
        }
    }
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N,M,K = map(int, input().split())
Nnums = list(map(int, input().split()))
Mnums = list(map(int, input().split()))

Nmax=len(Nnums)
Mmax=len(Mnums)
Nsum=0
Ncnt=0

#Nのみの場合に何冊読めるか
for Ni,Nl in enumerate(Nnums):
  Nsum += Nl
  Ncnt = Ni
  if Nsum > K:
    Nsum -= Nl
    Ncnt = Ni-1
    break
    
chkSum = Nsum
chkCnt = Ncnt + 1
AnsCnt = Ncnt + 1

#Mを組み入れて最大数を探す
for Mi,Ml in enumerate(Mnums):
  chkSum += Ml
  chkCnt += 1
  if (chkSum > K):
    flg = 0
    while chkSum > K:
      if Ncnt >= 0:
        chkSum -= Nnums[Ncnt]
        chkCnt -= 1
        Ncnt -= 1
        flg = 1
      else:
        if flg == 0:
          #chkSum -= Ml
          chkCnt -= 1
          #AnsCnt -= 1
        break
  
  if (AnsCnt < chkCnt):
    AnsCnt = chkCnt
  

  
#  if (Ncnt < 0):
  if (chkSum > K):
    break
    
print(AnsCnt)

Measured memory_bytes: 41036
#include <bits/stdc++.h> 
using namespace std;
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  c-=b;
  if(c<=0)
    cout<<"delicious"<<endl;
  else if(a>=c)
    cout<<"safe"<<endl;
  else
    cout<<"dangerous"<<endl;
  
  return(0);
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<complex>
#include<string>
#include<cstring>
using namespace std;
#define rep2(x,from,to) for(long long x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
#define INF 100000000
#define debug(x) cout<<#x<<": "<<x<<endl

#define all(x) x.begin(),x.end()
typedef pair<long long,long long> P;
typedef pair<long long,P> PP;
long long n;
long long ans;
long long a[300006];
int main()
{
	cin>>n;
	n*=3;
	rep(i,n)
	{
		cin>>a[i];
	}
	sort(a,a+n);
	for(long long i=0;i<n/3;i++)
	{
		ans+=a[n-2-i*2];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

// [l, r]にあるkの倍数の数
ll g(ll l, ll r, ll k) {
  ll m = l + (k - l % k) % k;
  if(m > r) return 0;
  return (r - m) / k + 1;
}

// [1, x]のFizzBuzz Stringの長さ
ll f(ll x) {
  ll ret = 0;
  for(ll p = 1, i = 1; p <= x; p *= 10, i++) {
    ll l = p, r = x >= p * 10 ? p * 10 - 1 : x;
    ll n3 = g(l, r, 3);
    ll n5 = g(l, r, 5);
    ll n15 = g(l, r, 15);
    ll n = (r - l + 1) - (n3 + n5 - n15);
    ret += n3 * 4 + n5 * 4 + n * i;
  }
  return ret;
}

int main(void) {
  ll S;
  cin >> S;
  S--;

  ll l = 0, h = 100000000000000000LL;
  while(l + 1 < h) {
    ll m = (l + h) / 2;
    if(f(m) <= S) l = m;
    else h = m;
  }

  ll t = S - f(l);
  string ans = "";
  REP(i, l + 1, l + 200) {
    if(i % 3 == 0 && i % 5 == 0) ans += "FizzBuzz";
    else if(i % 3 == 0) ans += "Fizz";
    else if(i % 5 == 0) ans += "Buzz";
    else ans += to_string(i);
  }
  cout << ans.substr(t, 20) << endl;
}



Measured memory_bytes: 3300
N = int(input())
W = [int(_) for _ in input().split()]
for i in range(1, N):
    W[i] += W[i - 1]

ans = 1e10
for i in range(N-1):
    ans = min(ans,abs(W[i] - (W[-1] - W[i])))
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>

using namespace std;

const int MOD = 998244353;

int add(int x, int y) {
   x += y;
   if (x >= MOD) x -= MOD;
   return x;
}

int mult(int x, int y) {
   return (long long) x * y % MOD;
}

const int MAXN = 110;

bitset<MAXN> pref[MAXN];
unordered_map<bitset<MAXN>, int> dp[MAXN];

int solve(int N, bitset<MAXN> state) {
   if (N == 0) return 1;
   auto it = dp[N].find(state);
   if (it != dp[N].end()) return it->second;
   int ans = mult(int(state[0]) + 1, solve(N - 1, state >> 1));
   for (int z = 1; z <= N / 2; ++z) {
      bitset<MAXN> nxt = pref[z] & state;
      for (int c = 2; c * z <= N; ++c) {
         nxt &= (state >> ((c - 1) * z));
         ans = add(ans, mult(solve(z, nxt), solve(N - c * z, state >> (c * z))));
      }
   }
   return dp[N][state] = ans;
}

int main() {
   ios_base::sync_with_stdio(false);
   string S;
   cin >> S;
   int N = S.size();
   for (int i = 0; i < N; ++i) {
      pref[i + 1] = pref[i];
      pref[i + 1].set(i);
   }
   bitset<MAXN> state;
   for (int z = 0; z < N; ++z) {
      if (S[z] == '1') state.set(z);
   }
   cout << solve(N, state) << "\n";
   return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <string>
using namespace std;

int main() {

	int n, a, b, total;
	int count_b;
	int pass_count;
	string s;
	char check_s;


	cin >> n >> a >> b ;
	cin >> s;

	total = a+b;
	count_b = 0;
	pass_count = 0;
	for(int i = 0; i < n; i++){
		check_s = s[i];
		if(check_s == 'a'){
			if(pass_count < total) {
			cout << "Yes" << endl;
			pass_count++;
			} else {
			cout << "No" << endl;
			}
		}

		if(check_s == 'b'){
			count_b++;
			if(pass_count < total && count_b <= b) {
				cout << "Yes" << endl;
				pass_count++;
			} else {
				cout << "No" << endl;
			}
		}

		if(check_s == 'c') {
			cout << "No" << endl;
		}
	}

	return 0;
}


Measured memory_bytes: 896
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
int n,m;

ll a[2005];
ll b[2005];
ll c[2005];
const ll INF = -1e17;
ll dist[1005];
ll dist2[1005];
int main() {
  cin >> n >> m;
  for(int i = 0; i < m; i++) {
    cin >> a[i] >> b[i] >> c[i];
    a[i]--;
    b[i]--;
  }

  for(int i = 0; i < n; i++) dist[i] = INF;

  dist[0] = 0;

  for(int k = 0; k < n - 1; k++) {
    for(int i = 0; i < m; i++) {
      if(dist[a[i]] != INF && dist[b[i]] < dist[a[i]] + c[i]) {
	dist[b[i]] = dist[a[i]] + c[i];
      }
    }
  }

  ll ans = dist[n-1];
  
  for(int k = 0; k < n - 1; k++) {
    for(int i = 0; i < m; i++) {
      if(dist[a[i]] != INF && dist[b[i]] < dist[a[i]] + c[i]) {
	dist[b[i]] = dist[a[i]] + c[i];
      }
    }
  }
    
    if(ans == dist[n-1]) cout << dist[n-1] << endl;
    else cout << "inf" << endl;
}

    

  
  
  


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stdio.h>
using namespace std;



int main(){
	while (1) {
		int h, w;
		cin >> h >> w;
		if (h == 0 && w == 0)break;
		for (int i = 0; i < h; i++) {
			if (i % 2 == 0) {
				for (int i = 0; i < w; i++) {
					if (i % 2 == 0)cout << '#';
					else cout << '.';
				}
				cout << endl;
			}
			else {
				for (int i = 0; i < w; i++) {
					if (i % 2 == 0)cout << '.';
					else cout << '#';
				}
				cout << endl;
			}
		}
		cout << endl;
	}
}


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;

typedef pair<int, int> Task; // b, a

int main() {
    int n;
    cin >> n;
    Task t[n];
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        t[i] = Task(b, a);
    }
    sort(t, t + n);
    int s = 0;
    for (int i = 0; i < n; i++) {
        int a = t[i].second, b = t[i].first;
        s += a;
        if (s > b) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 1792
start_x, start_y, goal_x, goal_y = map(int, input().split())
n = int(input())
info = [(start_x, start_y, 0)] \
       + [tuple(map(int, input().split())) for i in range(n)] \
       + [(goal_x, goal_y, 0)]

#i番目のバリアからj番目のバリアまでの移動について、
#受ける光線量を辺の重みとしてグラフを構築する(O(N^2))
graph = [[0]*(n+2) for i in range(n+2)]
for i in range(n+2):
    for j in range(i,n+2):
        diff_x = info[i][0] - info[j][0]
        diff_y = info[i][1] - info[j][1]
        sum_radius = info[i][2] + info[j][2]
        cost = max(0, ((diff_x)**2 + (diff_y)**2)**(0.5) - sum_radius)
        graph[i][j] = cost
        graph[j][i] = cost
        graph = tuple(graph)

#ダイクストラ法でstartからgoalまでの最短距離を求める

import heapq
distance = [float("inf")]*(n+2)
used = [False]*(n+2)
distance[0] = 0

while True:
    v = -1
    for u in range(n+2):
        if not used[u] and (v == -1 or distance[u] < distance[v]):
            v = u
    if v == -1:
        break
    used[v] = True
    for u in range(n+2):
        distance[u] = min(distance[u], distance[v] + graph[v][u])
            
print(distance[n+1])

Measured memory_bytes: 85084
#include <bits/stdc++.h>
using namespace std;

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

int main(){
  string s;

  cin >> s;

  int e = 0;
  int w = 0;
  int n = 0;
  int so = 0;

  REP (i, int(s.size())) {
    if (s.at(i) == 'E') e++;
    else if (s.at(i) == 'W') w--;
    else if (s.at(i) == 'N') n++;
    else if (s.at(i) == 'S') so--;
  }

  if ((e * w != 0 && n * so != 0) || (e * w != 0 && n == 0 && so == 0) || (e == 0 && w == 0 && n * so != 0)) printf("Yes\n");
  else printf("No\n");
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int tmp;
	if (a > b) {
		tmp = a;
		a = b;
		b = tmp;
	}
	if (b > c) {
		tmp = b;
		b = c;
		c = tmp;
	}
	if (a > b) {
		tmp = a;
		a = b;
		b = tmp;
	}
	cout << a << " " << b << " " << c << endl;
}


Measured memory_bytes: 3096
// mod 組み合わせ計算2
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)


int main(){
    double a,b,x;
    cin>>a>>b>>x;
    double l=a*a*b/2;
    double dd;
    if(a*a*b==x){
        cout<<"0"<<endl;return 0;
    }
    if(l==x){
        dd=atan(a/b);
    }
    else if(x<l){
        dd=atan(2*x/a/b/b);
    }
    else{
        dd=atan(a*a*a/2/(a*a*b-x));
    }
    double ans=(M_PI/2-dd)*180/M_PI;
    std::cout << std::fixed<<std::setprecision(9);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 4088
#include <bits/stdc++.h>
using namespace std;

int main(){
  int a,b,c;  cin >> a >> b >> c;
  int k; cin >> k;
  int max_num = max({a,b,c});
  int sum= max_num;
  for(int i=0; i<k; i++){
    sum *= 2;
  }
  
  cout << sum + a + b + c -max_num   << endl;

}  

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int N,i,a[100],count,tmp,flag;
  flag = 1;
  count = 0;
  scanf("%d",&N);
  for(i = 0;i < N;i++) scanf("%d",&a[i]);
  while(flag){
    flag = 0;
    for(i = N-1;i > 0; i--){
      if(a[i] < a[i-1]) {
        tmp = a[i];
        a[i] = a[i-1];
        a[i-1] = tmp;
        count++;
        flag = 1;
      }
    }
  }
  for(i = 0;i < N; i++){
     printf("%d",a[i]);
     if(i != N-1) printf(" ");
   }
  printf("\n%d\n",count);
  return 0;
}



Measured memory_bytes: 2056
#include<bits/stdc++.h>
using namespace std;


int main()
{
    int i,j,n,t,f=0;
    string s;

        cin>>s;

        if(s[2]==s[3]&&s[4]==s[5])
            cout<<"Yes"<<"\n";
        else
            cout<<"No"<<"\n";


    return 0;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ul;
#define all(x) (x).begin(), (x).end()
#define pi 3.1415926536

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;

    TreeNode(int x): val(x), left(NULL), right(NULL){}
};

struct ListNode {
    int val;
    ListNode* next;

    ListNode(int x): val(x), next(NULL){}
};

int nxt(){
    int x;
    cin>>x;
    return x;
}

ll nxtLong(){
    ll x;
    cin>>x;
    return x;
}

string nxtStr(){
    string x;
    cin>>x;
    return x;
}

char nxtChar(){
    char x;
    cin>>x;
    return x;
}

double nxtDouble(){
    double x;
    cin>>x;
    return x;
}

ld nxtLDouble(){
    ld x;
    cin>>x;
    return x;
}

TreeNode* makeTree(int n){
    queue<TreeNode*> tree_nodes;
    TreeNode* root;
    if(n){
        root = new TreeNode(nxt());
        tree_nodes.push(root);
    }else{
        return NULL;
    }
    while(!tree_nodes.empty()){
        TreeNode* node = tree_nodes.front();
        tree_nodes.pop();
        bool left;
        cin>>left;
        if(left){
            node->left = new TreeNode(nxt());
            tree_nodes.push(node->left);
        }
        bool right;
        cin>>right;
        if(right){
            node->right = new TreeNode(nxt());
            tree_nodes.push(node->right);
        }
    }
    return root;
}

ListNode* makeLinkedList(int n){
    ListNode* list = new ListNode(0);
    ListNode* dummy = list;

    for(int i=0;i<n;++i){
        list->next = new ListNode(nxt());
        list = list->next;
    }

    return dummy->next;
}

void solve(){
    int n = nxt();
    cout<<n+n*n+n*n*n<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout<<fixed<<setprecision(9);
    //ll t;
    //cin>>t;
    //while(t--){
    //    solve();
    //}
    solve();
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define space ' '
typedef long long ll;
typedef long double ld;
const long double PI = 3.14159265358979323846;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

	int n, k, x, y;
	cin >> n >> k >> x >> y;
	ll ans = 0;
	for (int i = 1; i <= k && i <= n; ++i) {
        ans += x;
	}
	for (int i = k + 1; i <= n; ++i) {
        ans += y;
	}
	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < n;i++)
using namespace std;
typedef long long ll;

int n;
int x[10],y[10];

double kei(int i,int j){
    double dx = x[i] - x[j];
    double dy = y[i] - y[j];
    return pow(dx * dx + dy * dy,0.5);
}

void solve(){
    cin >> n;
    for(int i = 1;i <= n;i++) cin >> x[i] >> y[i];
    vector<int> a(n);
    rep(i,n) a[i] = i + 1;;
    double sum = 0.0;
    do{
        for(int i = 0;i < n - 1;i++) sum += kei(a[i],a[i+1]);
    }while(next_permutation(a.begin(),a.end()));
    
    int wari = 1;
    for(int i = 2;i <= n;i++) wari *= i;

    cout << fixed << setprecision(10) << sum / wari << endl;
    return;
}
int main(){
    solve();
    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>

using namespace std;
using   ll=long long;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int
#define pll				pair<int , int>

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007
#define hell            998244353

ll mod_pow(ll a,ll b,ll m)
{
    ll res = 1;
    while(b)
    {
        if(b&1)
        {
        	res=(res*a) % m;
        }
        a=(a*a) % m;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a)
{
	return mod_pow(a , mod-2 , mod);
}

void solve() 
{
	int n;
	
	cin >> n;
	
	int a[n];
	
	int mx = 0;
	
	int ans = 0;
	
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
		
		mx = max(mx , a[i]);
		
		ans += abs(a[i]-mx);
	}
	
	cout << ans;
}

signed main() {
    fast;

    int t = 1;

	//cin >> t;

    while(t--) {
        solve();
    }

    return 0;
}


Measured memory_bytes: 5184
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	string s,t;cin>>s>>t;
	int a,b;cin>>a>>b;
	string u;cin>>u;

	if (u == s){
		cout << a - 1 << " " << b << endl;
	}
	else{
		cout << a << " " << b - 1 << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*(y/gcd(x,y));
}

//a,b x
int main(){
	ll A,X; cin>>A>>X;
	cout<<(A%500<=X?"Yes":"No");
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;

signed main(){
    int n,m;
    cin >> n >> m;
    struct edge{int from,to,cost;};
    vector<edge> v;
    rep(i,m){
        int aa,bb,cc;
        cin >> aa >> bb >> cc;
        edge e= {aa-1,bb-1,cc};
        v.push_back(e);
    }

    int d[n];
    for(int i=0;i<n;i++) d[i]=-100000000000000000;
    d[0]=0;
    int count=0;
    bool z=false;
    bool f=false;
    while(true){
        bool update = false;
        for(int i=0;i<v.size();i++){
            edge e = v[i];
            
            if(d[e.from]!=-100000000000000000 && d[e.to] < d[e.from]+e.cost){
                if(count==n-1 && e.to==n-1) z=true;
                d[e.to]=d[e.from]+e.cost;
                update=true;
                if(count==n-1){
                    if(z){
                        cout << "inf" << endl;
                        return 0;
                    }
                    f=true;
                }
            }
        }
        if(f) break;
        if(!update) break;/*
        if(count>=n-1 && update){
            cout << "inf" << endl;
            return 0;
        }*/
        count++;
    }
    cout << d[n-1] << endl;

}

Measured memory_bytes: 384
#include<iostream>
using namespace std;


int main(){
  
  long long n; cin >> n;
  
  long long  *divisor = new long long[n+1];
  for(long long i=0;i<=n;i++)divisor[i] = 0;
  
  
  for(long long i=1;i<=n;i++){
    for(long long j=i;j<=n;j+=i)divisor[j]++;
  }
  
  unsigned long long sum = 0;
  for(int i=1;i<=n;i++){
     
      sum +=  (i*divisor[i]);
  }
    delete divisor;
  
  printf("%llu\n",sum);
  
  
  
  
  return 0;
}

Measured memory_bytes: 81320
#include <bitset>
#include <iostream>
using namespace std;

int main() {
    int n; cin >> n;
    bitset<4000000> b = 1;
    int sum = 0;
    while (n--) { int a; cin >> a; b = b | (b << a); sum += a; }
    for (int r = (sum+1)/2; ; r++) if (b.test(r)) { cout << r << endl; break; }
}


Measured memory_bytes: 2176