akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int n; cin >> n;
    vi a(n), b(n);
    for(auto& e : a) cin >> e;
    for(auto& e : b) cin >> e;

    ll cnt2 = 0, cnt1 = 0;
    rep(i, n){
        ll d = a[i] - b[i];
        if(d > 0){
            cnt1 += d;
        }
        else {
            d = -d;
            cnt2 += (d + 1) / 2;
            cnt1 += d % 2;
        }
    }

    if(cnt2 >= cnt1){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
int main(){
	int N;
	string s;
	cin>>N>>s;
	vector<int> Lacc(N+1);
	rep(i,N){
		Lacc[i+1] = Lacc[i] + (s[i]=='W');
	}
	int ans = N;
	rep(i,N){
		int tmp = Lacc[i] + (N-i-1-(Lacc[N]-Lacc[i+1]));
		chmin(ans,tmp);
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1796
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(long long i=0;i<(long long)(n);i++)
#define N 3000


int main() {
	long long dp[N];
	long long dp2[N];
	long long a[N];
	long long b[N];
	f(i, N) {
		dp[i] = 0;
		dp2[i] = 0;
		a[i] = 0;
		b[i] = 0;
	}
	long long n,m, k;
	long long x, y, z;
	long long s, ans;
	bool v = true;
	ans = 0;
	scanf("%lld %lld", &n, &m);
	f(i, n) {
		scanf("%lld", &a[i]);
	}
	f(i, m) {
		scanf("%lld", &b[i]);
	}
	f(i, n) {
		f(j, m) {
			dp2[j] += dp[j];
			if (a[i] == b[j])dp2[j] = (dp2[j] + 1) % MOD;
			if (j > 0) {
				dp2[j] = (dp2[j - 1] + dp2[j]) % MOD;
				if (a[i] != b[j])dp2[j] = (dp2[j] + MOD - dp[j - 1]) % MOD;
			}
		}
		f(j, m) {
			dp[j] = dp2[j];
			dp2[j] = 0;
		}
}
  ans=(dp[m-1]+1)%MOD;
	printf("%lld\n",ans);


	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=1e18+7;
const ll MOD=1e9+7;
#define out(a) cout<<fixed<<setprecision((a))

int main(){
	ll n,d;
	cin >> n >> d;
	ll ans = 0;
	vector<ll> p[n];
	FOR(i,0,n){
		FOR(j,0,d){
			ll x;
			cin >> x;
			p[i].push_back(x);
		}
	}
	FOR(i,0,n){
		FOR(j,i+1,n){
			ll d2=0,d1=0;
			FOR(k,0,d){
				d2 += (p[i][k]-p[j][k])*(p[i][k]-p[j][k]);
			}
			d1 = sqrt(d2);
			ans += (d1*d1)==d2;
		}
	}
	cout << ans << endl;
}


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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved

int main(){
    string s;
    cin>>s;

    int n=s.size();
    string tmp;
    if(s[n-1]=='s'){
        tmp="es";
    }
    else{
        tmp="s";
    }
    cout<<s<<tmp<<endl;
    return 0;

}
/*


*/


Measured memory_bytes: 3624
import java.util.Scanner;

public class Main {
	static int acnt = 0, bcnt = 0;
	static boolean memo[][];

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = sc.nextInt();
		int[] a = new int[100002];
		int idx = 0;
		for(int i = 0; i < n; i++) {
			idx = sc.nextInt();
			for(int j = 0; j <3; j++) {
				a[idx + j]++;
			}
		}
		int max = 0;
		for(int i = 0; i < 100002;i++) {
			max = Math.max(max, a[i]);
		}
		System.out.println(max);
	}
}




Measured memory_bytes: 50904
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {
            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }


        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var n = Read();
            var s = new string[n];
            for (int i = 0; i < n; i++)
            {
                s[i] = Console.ReadLine();
            }
            var m = Read();
            var t = new string[m];
            for (int i = 0; i < m; i++)
            {
                t[i] = Console.ReadLine();
            }
            long max = 0;
            for (int i = 0; i < n; i++)
            {
                long count = 0;
                for (int j = 0; j < n; j++)
                {
                    if (s[i] == s[j])
                        count++;
                }
                
                for (int k = 0; k < m; k++)
                {
                    if (s[i] == t[k])
                        count--;
                }
                if (max < count)
                    max = count;

            }
            if (max < 0)
                Console.WriteLine(0);
            else
                Console.WriteLine(max);



 
           
            Console.Out.Flush();
        }
    }
}


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

using namespace std;

int main(){
  string str1,str2;
  cin>>str1;
  cin>>str2;
  int i=0;
  while(i<str1.length()){
    if(str1[i]==str2[i]){
      i++;
    }
    else{
      break;
    }
  }
  if(i==str1.length()){
    cout<<"Yes";
  }
  else{
    cout<<"No";
  }
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define int long long
#define inf 1e9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
using namespace std;

int n,d[114],ans=1;
signed main(){
	cin>>n;
	rep(i,n)cin>>d[i];
	sort(d,d+n);
	reverse(d,d+n);
	REP(i,n){
		if(d[i]!=d[i-1])ans++;
	}
	cout<<ans<<endl;
}


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

using namespace std;

typedef long long ll;
#define mod 1000000007
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define repc(i, a, b, c) for (ll i = a; (c > 0 ? i < b : i > b) and c != 0; i += c)
#define mp make_pair
#define pb push_back
#define all(name) (name.begin(), name.end())
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod);
#define mod_in(a) power(a, mod-2)
#define ncr(n, r) ((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod)
#define deb(x) cout << #x << " " << x << endl;

class Dsu {
	vector<int> drr;
	vector<int> size_arr;
	public :
	Dsu (int n) {
		rep(i, 0, n+1){
			drr.pb(i);
			size_arr.pb(1);
		}
	}

	int f_p (int a) {
		return drr[a] == a ? a : f_p(drr[a]);
	}

	ll size (int a) {
		return (ll)size_arr[f_p(a)];
	}

	void uni(int a, int b) {
		int ap = f_p(a);
		int bp = f_p(b);
		if(ap == bp)return;
		if(!(size_arr[ap] > size_arr[bp]))swap(ap,bp);
		drr[bp] = ap;
		size_arr[ap] += size_arr[bp];
	}
};



vector<ll> ft(1, 1LL);
vector<bool> is_prime(1000000, 1);

void sieve();
ll power(ll x, ll y);
int ch(string s, int a){
    int f = 1;
    for(int i = 0; i < a/2; i++){
        if(s[i] != s[a-i-1])return 0;
    }
    return 1;

}
int main()
{
    cout << fixed;
    cout << setprecision(9);
	int t = 1;
	// cin >> t;
	while(t--)
	{
		double l = 0, r, c;
        cin >> c;
        cout << (c*c*c)/27.0 << endl;
	}
}
//
//
//
//
//
//important funct
ll power(ll x, ll y) {
    ll res = 1;x %= mod;
    while (y > 0) {
        if (y & 1)res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
void sieve(){
	is_prime[0] = is_prime[1] = 0;
	for(int i = 2; i*i <= 1000000; i++)
		if(is_prime[i])
			repc(j, i*i, 1000000, i)is_prime[j] = 0;
}

Measured memory_bytes: 384
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if(s.equals("a")) {
			System.out.println("vowel");
		}else if(s.equals("e")) {
			System.out.println("vowel");
		}else if(s.equals("i")) {
			System.out.println("vowel");
		}else if(s.equals("u")) {
			System.out.println("vowel");
		}else if(s.equals("o")) {
			System.out.println("vowel");
		}
		else {
			System.out.println("consonant");
		}
	}

}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, T, B;
  cin >> A >> T >> B;
  
  if ( A * T < B ){
    cout << A * T << endl;
  }
  else if ( A * T > B ){
    cout << B << endl;
  }
  else if ( A * T == B ){
    cout << B << endl;
  }
}

Measured memory_bytes: 256
program main
  implicit none
  integer(8) :: n, i, j, kng, cr(0:4000), cb(0:4000), cg(0:4000)
  integer(8) :: res
  character(4000) :: s
  character(2) :: sij
  character(1) :: cng

  read *, n
  read *, s
  cr = 0
  cb = 0
  cg = 0
  do i = 1, n
    cr(i) = cr(i - 1)
    cb(i) = cb(i - 1)
    cg(i) = cg(i - 1)
    if (s(i:i) == "R") then
      cr(i) = cr(i) + 1
    else if (s(i:i) == "G") then
      cg(i) = cg(i) + 1
    else
      cb(i) = cb(i) + 1
    end if
  end do
  res = 0
  do i = 1, n - 2
    do j = i + 1, n - 1
      if (s(i:i) == s(j:j)) cycle
      sij = s(i:i) // s(j:j)
      kng = j + j - i
      if (sij == "RG" .or. sij == "GR") then
        res = res + cb(n) - cb(j)
        cng = "B"
      else if (sij == "RB" .or. sij == "BR") then
        res = res + cg(n) - cg(j)
        cng = "G"
      else
        res = res + cr(n) - cr(j)
        cng = "R"
      end if
      if (kng <= n) then
        if (s(kng:kng) == cng) res = res - 1
      end if
    end do
  end do
  print "(i0)", res
end program main


Measured memory_bytes: 3020
#include <stdio.h>

int main()
{
	int a, b, c, d;
  int n;
  int count = 0;

  while (scanf("%d", &n) != EOF) {
    for (a = 0; a < 10; a++) {
      for (b = 0; b < 10; b++) {
        for (c = 0; c < 10; c++) {
          for (d = 0; d < 10; d++) {
            if (a + b + c + d == n) {
              count++;
            }
          }
        }
      }
    }
    printf("%d\n", count);
    count = 0;
  }

  return 0;
}

Measured memory_bytes: 596
function main(input) {
    const lines = input.split("\n");
    const X = lines[0];

    const coin500 = Math.floor(X / 500);
    const mod = X % 500;
    const coin5 = Math.floor(mod / 5);
    const res = coin500 * 1000 + coin5 * 5;
    
    console.log(res);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

using namespace std;

using ll = long long;

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

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

    int N;
    string s;
    cin >> N >> s;

    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 2; ++j) {
            vector<int> ans;
            ans.push_back(i), ans.push_back(j);
            for (int k = 0; k < N; ++k) {
                if (s[k] == 'o') {
                    ans.push_back(ans[k] ^ ans[k + 1]);
                } else {
                    ans.push_back(ans[k] ^ ans[k + 1] ^ 1);
                }
            }
            if (ans[N] == i && ans[N + 1] == j) {
                for (int k = 1; k <= N; ++k) {
                    cout << (ans[k] ? "W" : "S");
                }
                cout << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 1348
#include <queue>
#include <algorithm>
#include <iostream>
#include <vector>

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

#define INF 1000000000

using namespace std;

int main() {
    int N, M;
    cin >> N >> M;

    vector<vector<int>> graph(N);

    REP(i, M) {
        int a, b;
        cin >> a >> b;
        a--;
        b--;

        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    vector<int> visited(N, -1);
    queue<pair<int, int>> q;
    q.push(make_pair(0, 0));

    while(!q.empty()) {
        auto now = q.front();
        q.pop();

        if (visited[now.second] != -1) {
            continue;
        }

        visited[now.second] = now.first;

        for(auto n : graph[now.second]) {
            q.push(make_pair(now.second, n));
        }
    }

    bool ng = false;
    for(int i = 1; i < N; ++i) {
        ng |= visited[i] == -1;
    }

    if (ng) {
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;
    for(int i = 1; i < N; ++i) {
        cout << visited[i] + 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 12096
#include <stdio.h>
#include <vector>
using namespace std;
long long n, a, b;
long long p = 1000000;
vector<long long>g[100000];
long long c[100000];
void dfs(long long x, long long y, long long f) {
	long long h = 1;
	for (int i = 0; i < g[x].size(); i++) {
		if ((g[x][i] / p) != f) {
			if (h == y)h++;
			c[g[x][i] % p] = h;
			dfs(g[x][i] / p, h, x);
			h++;
		}
	}
}
int main() {
	scanf("%d", &n);
	for (long long i = 0; i < n - 1; i++) {
		scanf("%d%d", &a, &b);
		a--; b--;
		g[a].push_back(b * p + i);
		g[b].push_back(a * p + i);
	}
	a = 0;
	for (int i = 0; i < n; i++) {
		if (g[i].size() > a) {
			a = g[i].size();
			b = i;
		}
	}
	dfs(b, 0, -1);
	a = 0;
	for (int i = 0; i < n - 1; i++) {
		if (c[i] > a)a = c[i];
	}
	printf("%d\n", a);
	for (int i = 0; i < n - 1; i++) {
		printf("%d\n", c[i]);
	}
}

Measured memory_bytes: 9472
#include<bits/stdc++.h>
#define int long long
inline int read(){
	char c=getchar();while (c!='-'&&(c<'0'||c>'9'))c=getchar();
	int k=1,kk=0;if (c=='-')c=getchar(),k=-1;
	while (c>='0'&&c<='9')kk=kk*10+c-'0',c=getchar();return kk*k;
}using namespace std;
void write(int x){if (x<0)putchar('-'),x=-x;if (x/10)write(x/10);putchar(x%10+'0');}
void writeln(int x){write(x);puts("");}
int n,m,x,y,a[1010][1010],f[10010],ff[10010],z[10010],dd;
int fa(int x){return f[x]==x?x:f[x]=fa(f[x]);} 
bitset<10010>qaq;
signed main(){
	n=read();m=read();for (int i=1;i<=m;i++)x=read(),y=read(),a[x][y]=a[y][x]=1;
	for (int i=1;i<=n;i++)f[i]=i,f[i+n]=i+n;
	for (int i=1;i<=n;i++)
		for (int j=i+1;j<=n;j++)if (!a[i][j])f[fa(i)]=fa(j+n),f[fa(i+n)]=fa(j);
	for (int i=1;i<=n;i++)ff[fa(i)]++,ff[fa(i+n)]--;
	for (int i=1;i<=n;i++)if (f[fa(i)]==f[fa(i+n)])return puts("-1"),0;
	for (int i=1;i<=n;i++)if (fa(i)==i)z[++dd]=abs(ff[i]);
	qaq[n]=1;for (int i=1;i<=dd;i++)qaq=(qaq<<z[i])|(qaq>>z[i]);
	for (int i=0;i<=n;i++)if (qaq[i+n]){
		int xx=(n-i)/2,yy=xx+i;writeln(xx*(xx-1)/2+yy*(yy-1)/2);
		return 0;
	}puts("-1");
}

/*
4 6
1 2
2 3
3 4
1 4
2 4
1 3
*/


Measured memory_bytes: 6144
/*Lucky_Glass*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

#define cs const int &
const int N=1e4+10,MOD=998244353;

inline int Mul(cs a,cs b){return 1ll*a*b%MOD;}
inline int Add(cs a,cs b){return a+b>=MOD? a+b-MOD:a+b;}
inline int Pow(int a,int b){int r=1;while(b){if(b&1)r=Mul(r,a);a=Mul(a,a),b>>=1;}return r;}

char strA[N],strB[N];
int cmo,uco;
int f[2][N],h[N],g[N],pw2[N];
int fac[N],ifac[N];

int Comb(cs a,cs b){return a>b? 0:Mul(fac[b],Mul(ifac[a],ifac[b-a]));}
int main(){
	fac[0]=1;
	for(int i=1;i<N;i++) fac[i]=Mul(fac[i-1],i);
	ifac[N-1]=Pow(fac[N-1],MOD-2);
	for(int i=N-2;i>=0;i--) ifac[i]=Mul(ifac[i+1],i+1);
	pw2[0]=1;
	for(int i=1;i<N;i++) pw2[i]=Add(pw2[i-1],pw2[i-1]);
	scanf("%s%s",strA,strB);
	int len=strlen(strA);
	for(int i=0;i<len;i++){
		if(strA[i]=='1' && strB[i]=='1') cmo++;
		if(strA[i]=='1' && strB[i]=='0') uco++;
	}
	int ans=0;
	for(int i=0;i<=cmo;i++){
		int I=i&1,J=!I;
		if(i) f[I][0]=0;
		else f[I][0]=1;
		for(int j=1;j<=uco;j++)
			f[I][j]=Add(Mul(Mul(i,j),f[J][j]),Mul(Mul(j,j),f[I][j-1]));
		int res=f[I][uco];
		res=Mul(res,Mul(Mul(fac[cmo-i],fac[cmo-i]),Mul(Comb(i,cmo),Comb(cmo-i,cmo+uco))));
		ans=Add(ans,res);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1912
/*
	@ Author: omgursocute
	@ Problem: ABC146/A
	@ Created on: 2019-12-01 22:51 (UTC+7)	
*/
#include <bits/stdc++.h>

using namespace std;
typedef int64_t ll;
typedef uint64_t ull;
typedef long double ld;

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

#ifdef cute
	freopen("in", "r", stdin);
#endif

	map<string, ll> dates = {
		{"SAT", 1}, 
		{"FRI", 2},
		{"THU", 3},
		{"WED", 4},
		{"TUE", 5},
		{"MON", 6},
		{"SUN", 7}
	};
	string s;
	cin >> s;
	cout << dates[s];

#ifdef cute
	cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << " ms.\n";
#endif
}

/* stuff you should look for
	* array bounds
	* special cases (n=1?), set tle
	* do sth instead of nothing and stay organized
	* check for variables with close names
*/


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

#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second
#define cbr cerr<<"hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ll(x.size())
#define all(x) (x).begin(), (x).end()
#define lbd(x,y) (lower_bound(all(x),y)-x.begin())
#define ubd(x,y) (upper_bound(all(x),y)-x.begin())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline long long rand(long long x, long long y) { return rng() % (y+1-x) + x; } //inclusivesss
string inline to_string(char c) {string s(1,c);return s;} template<typename T> inline T gcd(T a,T b){ return a==0?llabs(b):gcd(b%a,a); }

using ll=long long; 
using ld=long double;
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
using pi=pair<ll,ll>; using spi=pair<ll,pi>; using dpi=pair<pi,pi>; 

#define LLINF ((long long)1e18)
#define INF int(1e9+1e6)
#define MAXN (100006)
ll n,m,p[MAXN],sz[MAXN],large[MAXN],cc[MAXN],hold[MAXN],ans;
vector<spi> e;
int find(int x){return p[x]==x?x:find(p[x]);}
void merge(int x,int y){
	x=find(x),y=find(y);
	if(x==y)return;
	if(sz[x]>sz[y])swap(x,y);
	p[x]=y, sz[y]+=sz[x], cc[y] += cc[x], hold[y]+=hold[x], hold[x]=cc[x]=sz[x]=0;
	if(large[x] != -LLINF && large[y] != -LLINF) hold[y] += 1;
	large[y]=max(large[x],large[y]);
	large[x]=-LLINF;
}
int main(){
	FAST
	cin>>n>>m;
	FOR(i,1,n)cin>>cc[i];
	e.resize(m);
	FOR(i,0,m-1){
		cin>>e[i].s.f>>e[i].s.s>>e[i].f;
	}
	sort(all(e));
	#define cerr if(0)cout
	cerr<<"\n\n";
	for(auto i:e) cerr<<i.s.f<<' '<<i.s.s<<' '<<i.f<<'\n';
	cerr<<'\n';
	FOR(i,0,MAXN-1)p[i]=i,sz[i]=1,large[i]=-LLINF;
	for(auto i:e){
		merge(i.s.f,i.s.s);
		if(large[find(i.s.f)] != -LLINF) hold[find(i.s.f)] += 1;
		large[find(i.s.f)]=i.f;
		if(cc[find(i.s.f)] >= large[find(i.s.f)] && large[find(i.s.f)] != -LLINF) {
			cerr<<i.s.f<<' '<<i.s.s<<' '<<find(i.s.f)<<' '<<hold[find(i.s.f)]+1<<'\n';
			ans += hold[find(i.s.f)] + 1;
			large[find(i.s.f)]=-LLINF, hold[find(i.s.f)]=0;
		}
	}
	cout<<m-ans<<'\n';
}


Measured memory_bytes: 9580
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <complex>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack> 
#include <bitset>
#include <queue>
#include <assert.h>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	// x + y = a
	// x + 2 * y = b
	if (b % 2) {
		printf("No\n");
		return 0;
	}
	b /= 2;
	if (a > b) {
		printf("No\n");
		return 0;
	}

	int y = b - a;
	int x = a - y;
	if (x >= 0 && y >= 0) printf("Yes\n");
	else printf("No\n");
	return 0;
}


Measured memory_bytes: 3124
#include<iostream>
using namespace std;
int dis[10];

bool likes(int n){
    while(n){
        if(dis[n%10] == true) return false;
        n /= 10;
    }
    return true;
}

int main(){
    int n, k, x;
    cin >> n >> k;
    for(int i = 0; i < k; i++){
        cin >> x;
        dis[x] = true;
    }
    while(likes(n) == false) n++;
    cout << n << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
 
using namespace std;
 
#define PB push_back
#define MP make_pairA
#define REP(i,n) for(int i=0;i<(n);i++)
int main()
{
    int a;
    string s;
    cin>>a>>s;
    if(a>=3200)cout<<s<<endl;
    else cout<<"red"<<endl;
}

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

using namespace std;

int main()
{
    string S;
    cin >> S;
    int size = S.size();
    bool judge = true;

    int k = (size - 1) / 2;
    int l = (size + 3) / 2;

    for (int i = 0; i < k; i++)
    {
        if (S[i] != S[size - 1 - i])
            judge = false;
    }

    for (int i = 0; i < k / 2; i++)
    {
        if (S[i] != S[k - 1 - i])
            judge = false;
        if (S[i + l - 1] != S[size - 1 - i])
            judge = false;
    }

    if (judge)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static final long mod7 = 1000000007L;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long m = sc.nextLong();
        System.out.println(power(n, m, mod7));
    }

    public static long power(long n, long k, long mod) {
        if (k == 0) {
            return 1;
        }
        if (k % 2 == 0) {
            long t = power(n, k / 2, mod);
            return ((t % mod) * (t % mod)) % mod;
        }
        return n * power(n, k - 1, mod) % mod;
    }
}

Measured memory_bytes: 26216
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    int N;cin >> N;
    vector<int> t(N);
    vector<double> v(N);
    rep(i,N)cin >> t[i];
    rep(i,N)cin >> v[i];

    int T = 0;
    rep(i,N)T += t[i];

    vector<int> rui(N+1);
    rep(i,N)rui[i+1] = rui[i] + t[i];

    vector<double> maxv(2*T+1,0);
    for(int i = 0;i < N;++i){
        for(int j = 2*rui[i];j <= 2*rui[i+1];++j){
            if(j == 2*rui[i] && j != 0)maxv[j] = min(v[i-1],v[i]);
            else if(j == 2*rui[i+1] && j != 2*T)maxv[j] = min(v[i+1],v[i]);
            else maxv[j] = v[i];
        }
    }

 /*   rep(i,2*T+1)cout << maxv[i];
    cout << endl;
*/
    maxv[0] = 0;
    for(int i = 1;i <= 2*T;++i){
        maxv[i] = min(maxv[i],maxv[i-1] + 0.5);
    }

    maxv[2*T] = 0;    
    for(int i = 2*T-1;i >= 0;--i){
        maxv[i] = min(maxv[i],maxv[i+1] + 0.5);
    }

  /*  rep(i,2*T+1){
        if(i % 10 == 0)cout << endl;
        cout << maxv[i] << " ";
    }
    cout << endl;
*/
    double ans = 0;
    rep(i,2*T){
        ans += (maxv[i] + maxv[i+1])*0.5*0.5;
    }

    cout << std::fixed << std::setprecision(5) << ans << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    int r, c, k;
    cin >> r >> c >> k;
    vector<vector<vector<ll>>> dp(r + 1,
                                  vector<vector<ll>>(c + 1, vector<ll>(4, 0)));
    vector<vector<ll>> grid(r, vector<ll>(c, 0));
    for(int i = 0; i < k; i++) {
        int a, b;
        cin >> a >> b;
        cin >> grid[a - 1][b - 1];
    }
    for(int i = 1; i <= r; i++) {
        for(int j = 1; j <= c; j++) {
            for(int l = 0; l < 4; l++) {
                ll tmp = max({dp[i - 1][j][3], dp[i][j - 1][l]});
                dp[i][j][l] = max(dp[i][j][l], tmp);
                if(l + 1 < 4) {
                    dp[i][j][l + 1] =
                        max(dp[i][j][l + 1], tmp + grid[i - 1][j - 1]);
                }
            }
        }
    }
    cout << dp[r][c][3] << endl;
}


Measured memory_bytes: 707080
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> adj,adjr;
stack<int> s;
void dfs(int p,vector<bool> &v)
{
    v[p]=1;
    for(auto x:adj[p])
        if(!v[x])
            dfs(x,v);
    s.push(p);
}
int main()
{
    
    int n,m,x,y;
    cin>>n>>m;
    adj.resize(n+1);
    adjr.resize(n+1);
    for(int i=1;i<=m;i++)
    {
        cin>>x>>y;
        adj[x].push_back(y);
        adjr[y].push_back(x);
    }
    /*for(int i=1;i<=n;i++)
    {
        for(int j=0;j<adj[i].size();j++)
            cout<<adj[i][j]<<" ";
        cout<<endl;
    } */   
    //Find the reverse postorder i.e., the topological Sort
    //cout<<"HI"<<endl;
    vector<bool> v(n+1,0);
    for(int i=1;i<=n;i++)
        if(!v[i])
            dfs(i,v);

    /*while(!s.empty())
    {
        cout<<s.top()<<" Hi\n";
        s.pop();
    }*/
    vector<int>lpt(n+1,0);
    lpt[1]=0;
    int cv;
    int mx;
    int fm=0;
    while(!s.empty())
    {

        cv=s.top();
        s.pop();
        mx=0;
        for(auto x:adjr[cv])
            mx=max(mx,lpt[x]+1);
        lpt[cv]=mx;
        fm=max(fm,lpt[cv]);
    }
    cout<<fm;
}

Measured memory_bytes: 14720
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
const int MAX = 2000000;

ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
ll COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  ll x, y;
  cin >> x >> y;

  ll n = (x + y) / 3;
  ll k = 2 * n - x;

  if ((x + y) % 3 != 0) {
    cout << 0 << endl;
  } else {
    COMinit();
    ll ans = COM(n, k);

    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 47104
#pragma GCC optimize "-O3"
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define NumberOfOnes __builtin_popcount
#define LSOne(S) (S & (-S))
#define ll long long
#define two pair<int,int>
#define twoll pair<ll,ll>
#define four pair<two,two>
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define y1 y1922
#define INF 1000000000000000000
#define P 1000000007
#define lmax 1000000000
#define nn 1000003
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define f first
#define s second
#define vi vector<int>
#define vll vector<ll>
#define vtwo vector<two>
#define ALL(container) (container).begin(), (container).end()
#define sz(container) (int)(container.size())
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define mid(a,b) (a+b>>1)
#define minN 0
#define maxN 10000000
#define na(x) ((x)<P?(x):(x)-P)
#define ab(a) (-(a)<(a)?(a):-(a))
#define FAST std::ios::sync_with_stdio(false)
#define xRand mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define rnd rng
#define IT iterator
typedef
tree<
  int,// aq pair<int,int> shegidzlia
  null_type,
  less/*_equal*/<int>,// aqac
  rb_tree_tag,
  tree_order_statistics_node_update>
ordered_set;
// '_equal' mashin ginda roca multiset gchirdeba
template<class key, class value,class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
ordered_map<int, int> my_map;
inline int rin(){
	int x=0,w=1;char ch=getchar();
	while ((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if (ch=='-') w=0,ch=getchar();
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
inline int bin(){
	int x=0;char ch=getchar();
	while (ch<'0'||ch>'9') ch=getchar();
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x;
}
const ll MOD=1e9+7;
int main(){FAST;xRand;

  int n;
    cin>>n;
    ll a[300030];
    for(int i=0; i<n; i++) cin>>a[i];
    ll ans=0;
    for(int i=0; i<60; i++){
        ll c=0;
        for(int j=0; j<n; j++){
            if(a[j]&(1ll<<i)) c++;
        }
        ans+=(c*(n-c)%MOD*((1ll<<i)%MOD));
        ans%=MOD;
    }
    cout<<ans<<endl;

}
/*

                   *         *
                  * *       * *
                 *   *     *   *
                *     *   *     *
                 *   *   * *   *
                  *   *   *   *
                   *   * *   *
                     *  *   *
					   *  *


*/



Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (long long i = 0; i < n; i++)
#define RREP(i, n) for (long long i = n - 1; 0 <= i; i--)
#define FOR(i, start, end) for (long long i = start; i < end; i++)
#define RFOR(i, start, end) for (long long i = start - 1; 0 <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1'000'000'007
using ll = long long;
using namespace std;
const int INF32       = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7        = 1'000'000'007;
const int MOD9        = 1'000'000'009;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}

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

    ll N;
    cin >> N;
    REP(i, N + 1) {
        int a = i + 1;
        if (N < a * a) {
            print(i * i);
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 256
<?php
  $stdin = fopen('php://stdin', "r");

  fscanf($stdin, "%d %d %d", $a, $b, $k);

  $r = [];
  for ($i=0; $i<$k; $i++) {
    $n = $a+$i;
    if ($a <= $n && $n <= $b) {
      $r[$n] = $n;
    }
  }

  for ($i=$k; 0<$i; $i--) {
    $n = $b-$i+1;
    if ($a <= $n && $n <= $b) {
      $r[$n] = $n;
    }
  }

  foreach ($r as $num) {
    echo $num.PHP_EOL;
  }


Measured memory_bytes: 4728
import scala.annotation.tailrec
import scala.io.StdIn._
object Main extends App {
  loop()
  @tailrec def loop(): Unit = {
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
    if (a == 0 && b == 0) return
    val aFactor = (1 to math.sqrt(a).toInt).collect{case i if a % i == 0 ⇒ (i, a / i)}.toArray
    println((1 to math.sqrt(b).toInt).collect{case i if b % i == 0 ⇒ (i, b / i)}.map{case (i, j) ⇒ aFactor.map{case (k, l) ⇒
      val x::y::z::w::_ = List(i, j, k, l).sorted
      (y - x) * (y - x) + (z - y) * (z - y) + (w - z) * (w - z)
    }.min}.min)
    loop()
  }
}


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

int main(){
	int A1, A2, A3;
	cin>>A1>>A2>>A3;
	int B1=abs(A1-A2);
	int B2=abs(A2-A3);
	int B3=abs(A3-A1);
	int sum=0;
	if(B1>=B2 && B1>=B3){
		sum = B2 + B3;
	}	else if(B2>=B3 && B2>=B1){
		sum = B3 + B1;
	}	else if(B3>=B1 && B3>=B2){
		sum = B1 + B2;
	}
	cout<<sum;
	return 0;	
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;
const int N = 5e2 + 10;
const int C = 33;
#define int long long
int color[4][C];
int d[C][C];
int t[N][N];

int32_t main() {
	int n, c;
	cin >> n >> c;
	for (int i = 0; i < c; i++)
		for (int j = 0; j < c; j++)
			cin >> d[i][j];

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			cin >> t[i][j];

	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			color[(i + j) % 3][t[i][j] - 1]++;

	int ans = 100000000000000000LL;
	for (int i = 0; i < c; i++)
		for (int j = 0; j < c; j++)
			for (int k = 0; k < c; k++) {
				if (i == j || i == k || j == k)
					continue;
				int res = 0;
				for (int l = 0; l < c; l++)
					res += d[l][i] * color[0][l];
				for (int l = 0; l < c; l++)
					res += d[l][j] * color[1][l];
				for (int l = 0; l < c; l++)
					res += d[l][k] * color[2][l];
				ans = min(ans, res);
			}

	cout << ans << endl;
}


Measured memory_bytes: 2304
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int n;
  cin >> n;

  long long a[10000];

  rep(i,n) cin >> a[i];

  long long min,max,sum;
  min = a[0];
  max = a[0];
  sum = 0;

  rep(i,n){
    if(min > a[i]) min = a[i];
    if(max < a[i]) max = a[i];
    sum += a[i]; 
  }
  cout << min << " " << max << " " << sum << endl;

}


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

X = int(N/1.08)


#print("x= "+str(X))
#print(int((X+1)*1.08))


if X*1.08==N:
    print(X)
else:
    if int((X+1)*1.08)==N:
        print(X+1)
    else:
        print(":(")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <limits>
#include <math.h>
#include <cmath>
#include <cctype>
#include <cstdio>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll> ;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvll = vector<vector<long long >>;
#define PI  3.1415926535
#define rep(i, k, n) for(ll i = k; i < n; i++)

int main(){
  ll h, w, k;
  cin >> h >> w >> k;
  
  vector<vector<char>> block(h,vector<char>(w));
  
  rep(i, 0, h){
    rep(j, 0, w){
      cin >> block[i][j];
    }
  }
  
  ll ans = 0;
  for(ll bit = 0; bit < (1<<(h+w)); bit ++){
    
    vector<vector<char>> painted(h,vector<char>(w));
    rep(i, 0, h){
      rep(j, 0, w){
        painted[i][j] = block[i][j];
      }
    }
    
    rep(i, 0, h+w){
      if(bit & (1 << i)){
        if(i < h){
          rep(j, 0, w){painted[i][j] = 'R';}
        }
        else{
          rep(j, 0, h){painted[j][i-h] = 'R';}
        }
      }
    }
	
    ll cnt = 0;
    rep(i, 0, h){
      rep(j, 0, w){
        if(painted[i][j] == '#'){cnt++;}
      }
    }
    
    if(cnt == k){ans++;}
  }
  
  cout << ans << endl;
    
}






Measured memory_bytes: 3640
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define INF         1e9
#define EPS         1e-9
#define REP(i,n)    for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(lint i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(lint i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define R_UP(a,b)   (((a)+(b)-1)/(b))
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP        cout << fixed << setprecision(8)
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }

signed main() {
	int n = in();
	vector<int>a(n);
	REP(i, n) {
		a[i] = in();
	}
	int m = in();
	vector<int>b(m);
	REP(i, m) {
		b[i] = in();
	}
	vector<int>result;
	set_union(a.begin(), a.end(), b.begin(), b.end(), inserter(result, result.end()));
	REPC(i, result) {
		cout << i << endl;
	}
}


Measured memory_bytes: 6452
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef vector<vector<int>> Graph;

int main() {
	int a, b, n;
	cin >> n>>a >> b;

	a* n < b ? cout<<a * n : cout<<b;
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[])
{
    vector<string> allinputs;
    string output;
    int operation;
    regex pattern("[a-zA-Z]");
    smatch smc;
    while(1)
    {
        string tmps;
        cin >>  tmps;
        if(tmps=="-") break;
        allinputs.push_back(tmps);
    }
    //Junsang****for (auto var : allinputs)
    for (vector<string>::iterator it = allinputs.begin(); it != allinputs.end(); it++)
    {
        if(regex_search(*it, smc, pattern))
        {
            operation = 0;
            output = *it;
            for (vector<string>::iterator it2 = it+2; it2 != it+(stoi(*(it+1)))+2; it2++)
            {
                operation += stoi(*it2);
            }
                rotate(output.begin(), output.begin()+(operation%output.length()), output.end());
                cout << output << endl;
        }else
        {
            continue;
        }
    }
    return 0;
}



Measured memory_bytes: 3296
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int MAX = 1001;
typedef pair<int,int> QQ;
typedef pair<int,int> PP;
typedef pair<PP,QQ> P;

int main(){
  int n;

  while(cin >> n ,n){
    int id,uni,ac,pe;
    int tc[MAX+1];
    fill(tc,tc+MAX,0);
    vector<P> v;

    while(n--){
      cin >> id >> uni >> ac >> pe;
      v.push_back(P(PP(-ac,pe),QQ(id,uni)));
    } 
    sort(v.begin(),v.end());

    int cnt = 0;
    int size = v.size();
    for(int i = 0; i < size ; i++){
      int u = v[i].second.second;
   
      if(cnt < 10){
	if(tc[u] < 3){
	  cout << v[i].second.first << endl;
	  cnt++;
	}
      }
      else if(cnt < 20){
	if(tc[u] < 2){
	  cout << v[i].second.first << endl;
	  cnt++;
	}
      }
      else if(cnt < 26){
	if(tc[u] < 1){
	  cout << v[i].second.first << endl;
	  cnt++;
	}
      }
      tc[u]++;
    } 
  }

  return 0;
}

Measured memory_bytes: 1212
MOD = 10**9+7
N, K = map(int, input().split())
*A, = map(int, input().split())

allm = True
for a in A:
    if a > 0:
        allm = False
        break

if N == K:
    ans = 1
    for a in A:
        ans = (ans*a) % MOD
    print(ans)
elif allm and K % 2 == 1:
    A.sort()
    A.reverse()
    ans = 1
    for a in A[:K]:
        ans = (ans*a) % MOD
    print(ans)
else:
    p, m = [], []
    for a in A:
        if a > 0:
            p.append(a)
        if a < 0:
            m.append(-a)
    p.sort(key=lambda k: -k)
    m.sort(key=lambda k: -k)

    pi, mi = 0, 0
    ans = 1
    while K > 0:
        if K == 1:
            ans = (ans*p[pi]) % MOD
            break
        elif pi < len(p)-1 or mi < len(m)-1:
            pv, mv = 0, 0
            if pi < len(p)-1:
                pv = p[pi]*p[pi+1]
            if mi < len(m)-1:
                mv = m[mi]*m[mi+1]

            if pv > mv:
                ans = (ans*pv) % MOD
                pi += 2
            else:
                ans = (ans*mv) % MOD
                mi += 2
            K -= 2
        else:
            ans = 0
            break
    print(ans)


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

using namespace std;

typedef long long ll;

const int N = 105;

const int mod = 1e9+7;

int main() {
    int x;
    cin >> x;
    if(x >= 30)
        cout << "Yes";
    else
        cout << "No";
	return 0;
}


Measured memory_bytes: 3564
#include <cstdio>

using namespace std;

int parse_int()
{
    int n = 0, c;
    while (1)
    {
        c = getchar_unlocked();
        if ('0' <= c && c <= '9')
            n = n * 10 + c - '0';
        else
            break;
    }
    return n;
}

template <size_t N>
struct Solver
{
    bool is_prime[N + 1];
    short ans[N + 1];
    constexpr Solver() : is_prime(), ans()
    {
        is_prime[0] = false;
        is_prime[1] = false;
        for (size_t i = 2; i <= N; i++)
        {
            is_prime[i] = true;
        }
        for (size_t prime = 2; prime <= N; prime++)
        {
            if (is_prime[prime])
            {
                for (size_t q = prime * 2; q <= N; q += prime)
                {
                    is_prime[q] = false;
                }
            }
        }
        for (size_t i = 1; i <= N; i++)
        {
            ans[i] += ans[i - 1];
            if (is_prime[i] && is_prime[(i + 1) / 2])
            {
                ans[i] += 1;
            }
        }
    }
};

int main()
{
    auto solver = Solver<100000>();

    int Q = parse_int();
    for (size_t i = 0; i < Q; i++)
    {
        int l = parse_int();
        int r = parse_int();
        auto ans = solver.ans[r] - solver.ans[l - 1];
        printf("%d\n", ans);
    }
}


Measured memory_bytes: 896
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#include<set>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;
typedef long long ll;

int main(){

   int k,x;
   cin >> k >> x;

   int minres = x-k+1;
   int maxres = k + x-1;

   for(int i=minres;i<=maxres;i++) cout << i << " ";
   cout << endl;



   return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

int f(int x) {
	int res = 0;
	while (x) {
		x = x % __builtin_popcount(x);
		++res;
	}
	return res;
}

int main() {
	int n; cin >> n;
	string x; cin >> x;
	int cnt = count(x.begin(), x.end(), '1');
	if (cnt == 1) {
		for (int i = 0; i < n; ++i) {
			if (x[i] == '1') cout << 0 << endl;
			else if (i != n - 1) cout << 1 << endl;
			else cout << 2 << endl;
		}
		return 0;
	}
	vector<int> pow1(n), pow2(n);
	pow1[0] = pow2[0] = 1;
	int sum1, sum2;
	sum1 = sum2 = x[n - 1] - '0';
	for (int i = 1; i < n; ++i) {
		pow1[i] = pow1[i - 1] * 2 % (cnt - 1);
		pow2[i] = pow2[i - 1] * 2 % (cnt + 1);
		(sum1 += pow1[i] * (x[n - i - 1] - '0')) %= (cnt - 1);
		(sum2 += pow2[i] * (x[n - i - 1] - '0')) %= (cnt + 1);
	}
	for (int i = 0; i < n; ++i) {
		int ans = 1;
		if (x[i] == '1') ans += f(((sum1 - pow1[n - i - 1]) % (cnt - 1) + cnt - 1) % (cnt - 1));
		else ans += f((sum2 + pow2[n - i - 1]) % (cnt + 1));
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 5176
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
#print(ans)
q = int(input())
import collections
cc = collections.Counter(a)
#print(cc)
for i in range(q):
    b,c = map(int,input().split())
    tmp = cc[b]
    cc[b] = 0
    s=s-b*tmp+c*tmp
    cc[c]+=tmp
    print(s)

Measured memory_bytes: 23972
from collections import Counter
n = int(input())
s = list(input())

# 条件1の個数から条件2の否定となる個数を差し引いて答えとする
# 条件位置の個数
sc = Counter(s)
ans_c1 = sc['R']*sc['G']*sc['B']

# 条件2の否定
# RとBの間にGがある
r_idx = {i for i in range(n) if s[i]=='R'}
g_idx = {i for i in range(n) if s[i]=='G'}
b_idx = {i for i in range(n) if s[i]=='B'}

count = 0
for ri in r_idx:
    for gi in g_idx:
        if (ri+gi)%2==0 and (ri+gi)//2 in b_idx:
            count+=1

for ri in r_idx:
    for bi in b_idx:
        if (ri+bi)%2==0 and (ri+bi)//2 in g_idx:
            count+=1

for bi in b_idx:
    for gi in g_idx:
        if (bi+gi)%2==0 and (bi+gi)//2 in r_idx:
            count+=1

print(ans_c1-count)

Measured memory_bytes: 9772
#include <iostream>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <list>
#include <algorithm>
#include <ctime>
#include <limits>

using namespace std;

using s64 = long long;


int main()
{
    int a[3];
    cin >> a[0] >> a[1] >> a[2];

    sort(a, a + 3);

    cout << a[2] * 10 + a[1] + a[0] << endl;
    return 0;
}

Measured memory_bytes: 256