akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define pir pair<int,int>
#define qmin(x,y) (x=min(x,y))
#define qmax(x,y) (x=max(x,y))
#define rsort(x,y) sort(x,y),reverse(x,y)
#define fr first
#define se second
using namespace std;
typedef long long ll;
const int Maxn=2100000;
const int inf=0x3f3f3f3f;

int n,a[Maxn];

signed main() {
    // freopen("test.in","r",stdin);
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    ll ans=1000;
    for(int i=2;i<=n;i++) if(a[i]>a[i-1]) ans+=1ll*(a[i]-a[i-1])*(ans/a[i-1]);
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 3788
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;

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

  // a * x % b == c % b
  // a * x ≡ c mod b
  if (__gcd(b, c) % __gcd(a, b))
    cout << "NO";
  else
    cout << "YES";
  return 0;
}


Measured memory_bytes: 3576
using System;

class Program
{
    static void Main()
    {
        while (true)
        {

            string zeta = null;
            string delta = null;
            string[] alpha = Console.ReadLine().Split(' ');
            int a = int.Parse(alpha[1]);
            int b = int.Parse(alpha[0]);
            if (a == 0 && b == 0)
            {

                break;
            }

            for (int j = 0; a > j; j++)
            {
                if (j % 2 == 0) delta = delta + ".";
                else delta = delta + "#";
                if (j%2 ==0 ) zeta = zeta + "#";
                else zeta = zeta + ".";

            }
            for (int q = 0; b > q; q++)
            {
                if (q%2 ==0) Console.Write(zeta);
                else Console.Write(delta);
                Console.Write("\n");
            }
            Console.Write("\n");
           
        }

    }
}



Measured memory_bytes: 15940
N, M = map(int,input().split())

if M == 0:
    if N == 1:
        print("0")
        exit(0)
    elif N == 2:
        print("10")
        exit(0)
    else:
        print(100)
        exit(0)

A = [0 for k in range(N)]
U = [0 for k in range(N)]
for k in range(M):
    s, c = map(int,input().split())
    if U[s-1] == 1 and A[s-1] != c:
        print(-1)
        exit(0)
    else:
        U[s-1] = 1
        A[s-1] = c

if U[0] == 1 and A[0] == 0:
    if N == 1:
        print(0)
    else:
        print(-1)
else:
    if U[0] == 0:
        A[0] = 1
    print("".join(map(str,A)))


Measured memory_bytes: 38420
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<int,int>P;
struct UnionFind{
  int n;
  vector<int> r,p,cnt;
  UnionFind(){}
  UnionFind(int sz):n(sz),r(sz,1),p(sz,0){iota(p.begin(),p.end(),0);}
  int find(int x){
    return (x==p[x]?x:p[x]=find(p[x]));
  }
  bool same(int x,int y){
    return find(x)==find(y);
  }
  void unite(int x,int y){
    x=find(x);y=find(y);
    if(x==y) return;
    p[y]=x;
  }
  int sum(int x){
    return r[find(x)];
  }
};
main(){
  map<P,int>m;
  int n,m1,m2,a,b,l[200009],r[200009];
  cin>>n>>m1>>m2;
  UnionFind u1(n),u2(n);
  while(m1--){
    cin>>a>>b;a--;b--;
    u1.unite(a,b);
  }
  while(m2--){
    cin>>a>>b;a--;b--;
    u2.unite(a,b);
  }
  rep(i,n)l[i]=u1.find(i);
  rep(i,n)r[i]=u2.find(i);
  rep(i,n)m[P(l[i],r[i])]++;
  rep(i,n)cout<<m[P(l[i],r[i])]<<endl;
}

Measured memory_bytes: 16640
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> void get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'; t=getchar());
	if(t=='-')neg=true,t=getchar();
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) get1(a),get1(b)
#define get3(a,b,c) get1(a),get2(b,c)
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int a,b,c,d,e,f;
bool ok1[3333],ok2[3333];
int main()
{
	cin>>a>>b>>c>>d>>e>>f;
	for(int i=0;i<=f;i++)for(int j=0;j<=f;j++)
		if(100*(i*a+j*b)<=f)ok1[100*(i*a+j*b)]=1;
	for(int i=0;i<=f;i++)for(int j=0;j<=f;j++)
		if(1*(i*c+j*d)<=f)ok2[1*(i*c+j*d)]=1;
	int ans1=3,ans2=0;
	for(int i=0;i<=f;i+=100)for(int j=0;j<=f;j++)
	{
		if(i+j>f)continue;
		if(!ok1[i]||!ok2[j])continue;
		if(i*e<j*100)continue;
		if(ans1*j>=ans2*i)
		{
			ans1=i;
			ans2=j;
		}
	}
	printf("%d %d\n",ans1+ans2,ans2);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
struct edge{int to,cost;};
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=MOD;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    int memo=modpow(a,b/2);
    return memo*memo%MOD;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int inv(int x){
    x=modpow(x,MOD-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
double dist(double ax,double ay,double bx,double by){
    return sqrt((bx-ax)*(bx-ax)+(ay-by)*(ay-by));
}
int a,b;
signed main(){
    cin>>a>>b;
    cout<<lcm(a,b)<<endl;
    return 0;
}


Measured memory_bytes: 256
using System;

namespace _0502
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int n = int.Parse(Console.ReadLine());
                if (n == 0)
                {
                    break;
                }
                int ue = 1;
                int mae = 2;
                int migi = 3;
                int ret = 1;
                for (int i = 0; i < n; i++)
                {
                    string s = Console.ReadLine();
                    int x = 0;
                    switch (s)
                    {
                        case ("North"):
                            {
                                x = mae;
                                mae = 7 - ue;
                                ue = x;
                                break;
                            }
                        case ("South"):
                            {
                                x = ue;
                                ue = 7 - mae;
                                mae = x;
                                break;
                            }
                        case ("East"):
                            {
                                x = ue;
                                ue = 7 - migi;
                                migi = x;
                                break;
                            }
                        case ("West"):
                            {
                                x = migi;
                                migi = 7 - ue;
                                ue = x;
                                break;
                            }
                        case ("Right"):
                            {
                                x = migi;
                                migi = 7 - mae;
                                mae = x;
                                break;
                            }
                        default:
                            {
                                x = mae;
                                mae = 7 - migi;
                                migi = x;
                                break;
                            }
                    }
                    ret += ue;
                }
                Console.WriteLine(ret);
            }
        }
    }
}

Measured memory_bytes: 9196
#include<cstdio>
int main(){
	char s[1000001]={};
	scanf("%s",s);
	int x=0;
	int y=100000;
	int ans=0;
	int k=0;
	int l=0;
	while(k==0){
		if(s[y]==0){
			y--;
		}else{
			if(x==y){
				if(s[x]=='x'){
					k=1;
				}else{
					if(l<0)l=-l;
					ans+=l;
					k=1;
				}
			}
			else{
			if(s[x]!='x' && s[x]==s[y]){
				if(l<0)l=-l;
				ans+=l;
				l=0;
				if(x==y)k=1;
				x++;
				y--;
			}else{
				int p=1;
				if(s[x]=='x'){
					l++;
					x++;
					p=0;
				}
				if(s[y]=='x'){
					l--;
					y--;
					p=0;
				}
				if(x>y){
					k=1;
				}else if(p==1){
					k=1;
					ans=-1;
				}
			}
			}
		}
	}
	printf("%d",ans);
	return 0;
}
			

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cctype>
#include <map>

using namespace std;

const int mod = 1000000007;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define ll long long

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

    for (int i = 0; i < s.size(); i++)
    {
        int num = s.size()-1-i;
        string str = s.substr(num) + s.substr(0, num);
        if (str == t)
        {
            cout << "Yes" << endl;
            return 0;
        } 
    }
    
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
import kotlin.math.max

fun main() {
    val (n, m, k) = readLine()!!.split(' ').map { it.toInt() }
    val a = (listOf(0L) + readLine()!!.split(' ').map { it.toLong() }).toLongArray()
    val b = (listOf(0L) + readLine()!!.split(' ').map { it.toLong() }).toLongArray()
    for (i in 1..n) {
        a[i] += a[i - 1]
    }
    for (i in 1..m) {
        b[i] += b[i - 1]
    }

    var answer = 0
    var i = 0
    var j = m
    while (i <= n && a[i] <= k) {
        while (a[i] + b[j] > k) {
            j--
        }
        answer = max(answer, i + j)
        i++
    }
    println(answer)
}

Measured memory_bytes: 83836
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int n;
    cin >> n;
    vector<double> A(n);
    double tot = 0;
    rep(i, n) {
        cin >> A[i];
        tot += A[i];
    }
    vector<double> B(n);
    double tot2 = 0;
    rep(i, n) {
        B[i] = tot / A[i];
        tot2 += B[i];
    }
    double ans;
    ans = tot / tot2;
    cout << fixed << setprecision(10) << ans << endl;
    
    return 0;
}

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

int main() {
  string s;
  cin >> s;
  int a = 0, b = 0, n = s.size();
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      if (s[i] == '0') {
        a++;
      }
      if (s[i] == '1') {
        b++;
      }
    } else {
      if (s[i] == '1') {
        a++;
      }
      if (s[i] == '0') {
        b++;
      }
    }
  }
  cout << min(a, b) << endl;
  return 0;
}

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

typedef long long ll;
const int maxn = 100005;
typedef pair<int, int>par;
const ll mod = 1e9+7;

ll a, b, n;
ll f( ll x ){
    return (ll)((a*x)/b) - a*(ll)(x/b);
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    #ifdef acm
    freopen("a.in", "r",stdin);
    #endif // acm



    cin >> a >> b >> n;

//    for( int i = 0; i <= 20; i++ )
//        cout << f(i) << '\n';

//    ll ini = b/a;
//    if( f(ini) == 0 )
//        ini++;
//
//    ll sol = 0;
//    for( ll i = ini; i <= n; i++ ){
//        sol = max(sol, f(i));
//        if( !f(i) )break;
//    }

    ll sol = f( min(n, b-1) );
    cout << sol << "\n";
    return 0;
}


Measured memory_bytes: 3568
/*
	---------O7Oo7oO7O-------------
*/

#include <bits/stdc++.h>

#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std;
#define all(v) v.begin(),v.end()


int Bin_expo(int n, int b)
{
	int res = 1;
	while (b > 0)
	{
		if (b & 1)
		{
			res = (res * n) ;

		}
		n = (n * n) ;


		b /= 2;

	}
	return res;
}


int32_t main()
{
	IOS


	string s,t;
	cin>>s>>t;
	int n = s.size();
	int m = t.size();
	int ans = 1e9;
	for(int i=0;i<n;i++)
	{
		if(i+m <= n)
		{
			string str = s.substr(i,m);
			int cnt = 0;
			for(int j=0;j<m;j++)
			{
				if(t[j]!=str[j])
					cnt++;
			}

			ans = min(cnt,ans);
		}
	}

	cout<<ans<<"\n";
}




Measured memory_bytes: 3660
#include <stdio.h>
int main(){
  int a,b,c,d,e,f = 0;
  scanf("%d",&a);
  scanf("%d",&b);
if(a>=b){
  c = a;
  d = a - 1;
  f = b;
}
else if(a<b){
  c = b;
  d = b - 1;
  f = a;
}
if(d>=f){
  c += d;
}
if(d<f){
  c += f;
}
printf("%d",c);
  return 0;
}
  

  
  



Measured memory_bytes: 128
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define ll long long
#define _for(i,a,b) for(int i = (a);i<(b);i++)
#define endl  '\n'
using namespace std;
const int mod=1e9+7;
const int MAX=1e6+7;
// ll a[MAX];
int main()
{
    ios::sync_with_stdio(0);cin.tie(0), cout.tie(0);
    string s,t;
    cin>>s>>t;
    ll ans=0,len=s.size();
    for(ll i=0;i<len;i++)
    {
    	if(s[i]!=t[i])ans++;
	}
    cout<<ans;
    
    return 0;
}


Measured memory_bytes: 3884
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<long long,long long>
#define ii pair<int,int>
#define mod 1000000007
#define endl '\n'
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

ll power(ll a,ll b){
	ll ans=1;
	while(b>0){
		if(b%2!=0){
			ans=(ans*a)%mod;
		}
		a=((a%mod)*(a%mod))%mod;
		b>>=1;
	}
	return ans;
}

void sieve(int n){
	bool prime[n+1];
	memset(prime,true,sizeof(prime));
	for(int p=2;p*p<=n;p++){
		if(prime[p]){
			for(int i=p*p;i<=n;i+=p)
				prime[i]=false;
		}
	}
	for(int p=2;p<=n;p++){
		if(prime[p])
			cout<<p<<" ";
	}
}

int main() {
	IOS;
	int t=1;
	//cin>>t;
	while(t--){
		int n,x,T;
		cin>>n>>x>>T;
		int ans=(n/x)*T;
		if(n%x!=0)
			ans+=T;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 3644
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto i = (m).begin(); i != (m).end(); ++i)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end());
#define MIN(vec) *std::min_element(vec.begin(), vec.end());
#define MAXI(vec)                                                              \
  std::distance(vec.begin(), *std::max_element(vec.begin(), vec.end()));
#define MINI(vec)                                                              \
  std::distance(vec.begin(), *std::min_element(vec.begin(), vec.end()));
#define BIT(n, num) std::bitset<(n)>((num)).to_string()
#define MATMUL(a, b, c)                                                        \
  REP(i, a.size())                                                             \
  REP(j, b[0].size()) REP(k, a[0].size()) c[i][j] += a[i][k] * b[k][j];
#define CLA2(a) REP(i, a.size()) REP(j, a[0].size()) a[i][j] = 0;
#define REV(T) greater<T>()

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1)
    ret[n] = 1;
  return ret;
}

ll factorial(int n) {
  ll ans = 1;
  for (int i = 2; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll P(int n, int m) {
  ll ans = 1;
  for (int i = m + 1; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll power(int n, int m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = power(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * power(n, m - 1)) % MOD;
  }
}
ll C(int n, int m) {
  return (P(n, n - m) * power(factorial(m), MOD - 2)) % MOD;
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ll N, M, ANS = 1;
  cin >> N >> M;
  vector<ll> a = divisor(M);
  auto it = std::lower_bound(a.begin(), a.end(), N);
  cout << M / (*it) << endl;
  return 0;
}


Measured memory_bytes: 256
/*jai_ganeshdeva*/

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pu push  //  adds the value to the last of the queue 
#define lld long long int
#define ins insert /// used in set to insert the values 
#define adv advance  /// used to increment the iterator
#define mp make_pair
#define fi first
#define se second
#define all(c) c.begin(),c.end()
#define PI 3.1415926
#define INF (lld)1e18
#define vl  vector<long long int >
#define vpl vector< pair<lld ,lld> >
#define vvl vector<vector<lld> > 
#define pll pair <lld,lld>
long long int modp(lld a,lld p,lld n)
{
   lld d[100];
    lld i,j,k,l;
    if(n==0) return 1;
    for(i=0;n>=1;i++)
    {
        d[i]=n%2;
        n/=2;
    }
    l=i;
    long long int e=1;
    if(d[0]==1) e*=(a%p);
    for(i=1;i<l;i++)
    {
        a*=a;
        a=a%p;
        if(d[i]==1) 
        {
            e*=a;
            e=e%p;
        }
    }
    return e%p;
}
lld modInverse(lld n, lld p) 
{ 
    return modp(n, p, p-2); 
}

//lld fac[100001]; 
/*
void solve2()
{
   lld p=1000000007;
    fac[0] = 1; 
    for (lld i=1 ; i<=100000; i++) 
        fac[i] = fac[i-1]*i%p; 
}    

long long int nCrModPFermat(lld n, lld r,lld p) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
     
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
}


long long int gcd(lld b,lld a)
{
    if(a<b) return gcd(a,b);
    if(a%b==0) return b;
    return gcd(a%b , b);
}
*/
lld p1=1000000007,p2=998244353;
lld l,r,mid,ans;
lld n,m,i,j,k;
lld x,y,n1,a,b,n2,h,z,c;
queue<lld> q;
lld d,p=1000000000;
//vector< vector <lld > > v(100001);
/*
void bfs(lld x , vector<lld>& d)
{
    d[x]=0;
    q.pu(x);
    while(!q.empty())
    {
        x=q.front();
        q.pop();
        l=v[x].size();
        for(i=0;i<l;i++)
        {
            y=v[x][i];
            if(d[y]==INF) 
            {
                d[y] = d[x]+1;
                q.pu(y);
            }       
        }
    }

}
/*

lld DFS(lld a ,lld x)
{
    visited[a] =true;
    sub_size[a]=1;
 //   if(a==x) 
   //     cont[a] =true;
    lld l= v[a].size();
    for(lld i=0;i<l;i++)
    {
        if(visited[v[a][i]] == false)
        {
            sub_size[a]+= DFS(v[a][i],b);
//            if(cont[v[a][i]] ==true ) cont[a]=true;
        }
    }
    return sub_size[a];

}
*/

void solve()
{
    string s;
    cin>>s;
    if(s[1]=='R') cout<<"ABC";
    else cout<<"ARC";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lld t=1;
    
 //   cin>>t;
 //   solve2();
    for(int i=0;i<t;i++)
    {
   //     cout<<"Case #"<<i+1<<": ";
        solve();
    //    cout<<"\n";
    }

    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h> 
using namespace std; 
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

void vowelOrConsonant(char x) { 
    if (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u') 
        cout << "vowel" << endl; 
    else
        cout << "consonant" << endl; 
}
int main(void) {
    io;
    char c; cin >> c;
    vowelOrConsonant(c);
    return 0; 
} 


Measured memory_bytes: 3576
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long n = scan.nextLong();
    long g = (long) Math.sqrt(n);
    if (g*g == n){
      System.out.println(g*2-2);
      return;
    }

    for (long i=g;i>0;i--){
      if (n%i == 0){
        long p = (long) n/i;
        System.out.println(p+i-2);
        return;
      }
    }
  }
}


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

/* macro */
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define int long long
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define isin(a, b, c) (b <= a && a <= c)
#define println cout << "\n";
#define sz(v) (int)v.size()
#define bin(x) static_cast<bitset<16> >(x)


/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef tuple<int, int, int> ti;
typedef map<int, int> mi;
typedef set<int> si;


/* constant */
const int inf = 1LL << 62;
const int mod = 1e9 + 7;
const int dx[8]={1,0,-1,0,-1,1,-1,1};
const int dy[8]={0,1,0,-1,-1,-1,1,1};
const string alphabet = "abcdefghijklmnopqrstuvwxyz";

/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T, class U, class V> void printx(tuple<T, U, V> t){cout << "{" << get<0>(t) << "," << get<1>(t) <<"," << get<2>(t) << "}" << endl;}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}
template<class T> void printans(vec<T> v){rep(i,0,sz(v)){cout << v[i] << (i == sz(v) - 1 ? "" : " ");}cout << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>T cut(T &a, int l, int r){return T(a.begin()+l, a.begin()+r);}


/* math_method */
int ceil(int a, int b){return a / b + (a % b > 0);}


/* main */

int n;
vi v;
vi c;
void in(){
    cin >> n;
    rep(i,0,n) v.push_back(input());
    rep(i,0,n) c.push_back(input());
}

void solve(){

    int ans = 0;
    rep(i,0,n) ans += max(0LL, v[i] - c[i]);
    print(ans);

}

signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);
    in();
    solve();
    
}

Measured memory_bytes: 256
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        AtCoder problem = new AtCoder(sc);
        problem.solve(out);

        out.flush();
    }

}

class AtCoder {

    String S;

    AtCoder(FastScanner sc) {
        S = sc.next();
    }

    void solve(PrintWriter out) {
        if (S.compareTo("2019/04/30") <= 0) {
            out.println("Heisei");
        } else {
            out.println("TBD");
        }
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 23252
#include <stdio.h>
int main(void){
int a,b,c;
    scanf("%d",&a);
    scanf("%d",&b);
    scanf("%d",&c);
    if(a<b && b<c){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;  
 } 


Measured memory_bytes: 2100
s=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(s[int(input())-1])


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
const int mod = 1e9+7;
const int maxn = 250005;
int dp[3005][3005];
string s, t;
int solve(int x, int y) {
	if (x < 0 || y < 0) {
		return 0;
	}
	if (~dp[x][y]) {
		return dp[x][y];
	}
	if (s[x] == t[y]) {
		return dp[x][y] = solve(x - 1, y- 1) + 1;
	}
	else {
		return dp[x][y] = max(solve(x, y - 1), solve(x - 1, y));
	}
}

string ans;
void dfs(int x, int y) {
	if (x < 0 || y < 0) {
		return;
	}
	if (s[x] == t[y]) {
		ans += s[x];
		dfs(x - 1, y - 1);
	}
	else {
		if (!x) {
			dfs(x, y - 1);
		}
		else if (!y) {
			dfs(x - 1, y);
		}
		else if (dp[x - 1][y] > dp[x][y - 1]) {
			dfs(x - 1, y);
		}
		else {
			dfs(x, y - 1);
		}
	}
}
void go() {
   	memset(dp, -1, sizeof(dp));
   	cin >> s >> t;
   	solve(s.size() - 1, t.size() - 1);
   	dfs(s.size() - 1, t.size() - 1);
   	reverse(all(ans));
   	cout << ans << '\n';
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int c = 0;
    int t;
    if (!c) {
        t = 1;
    }
    else {
        cin >> t;
    }
    while (t--) {
        go();
    }
    
}

Measured memory_bytes: 39148
#include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <cctype>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)

int main(){
    ll n,m,l;
    cin >> n >> m >> l;
    ll a[n][m];
    ll b[m][l];
    ll c[n][l];
    rep(i,n){
        rep(j,m) cin >> a[i][j];
    }
    rep(i,m){
        rep(j,l) cin >> b[i][j];
    }
    rep(i,n){
        rep(j,l){
            c[i][j]=0;
            rep(k,m) c[i][j] += a[i][k]*b[k][j];
            if(j != 0) cout << ' ';
            cout << c[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 3236
import sys
def input():
    return sys.stdin.readline()[:-1]


N, M = map(int, input().split())

P = []
Y = []
for _ in range(M):
    p, y = map(int, input().split())
    P.append(p)
    Y.append(y)

pref = {}

for i in range(M):

    if P[i] not in pref:
        pref[P[i]] = []

    pref[P[i]].append({
        'city': i,
        'year': Y[i],
    })

for key in pref:
    pref[key].sort(key=lambda x: x['year'])

# print(pref)

city = {}

for key in pref:
    for i in range(len(pref[key])):
        city[pref[key][i]['city']] = {'order': i + 1}

# print(pref)

# output
for i in range(M):
    print(format(P[i], '06d') + format(city[i]['order'], '06d'))


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

#define ll long long
#define ull unsigned long long

using namespace std;


int main() {
	int H, W;
	cin >> H >> W;
	vector <string> S;
	for (int ii = 0; ii < H; ++ii){
		string tmp;
		cin >> tmp;
		S.push_back(tmp);
	}

	//前計算(左上から)
	vector<vector<int>> L(H, vector <int>(W, 0));
	vector<vector<int>> U(H, vector <int>(W, 0));
	for (int row = 0; row < H; ++row){
		for (int col = 0; col < W; ++col){
			if (S[row][col] == '#'){
				continue;
			}
			//Lの計算
			if (col == 0){
				L[row][col] = 1;
			} else {
				L[row][col] = L[row][col-1] + 1;
			}
			//Uの計算
			if (row == 0){
				U[row][col] = 1;
			} else {
				U[row][col] = U[row-1][col] + 1;
			}
		}
	}

	//前計算(右下から)
	vector<vector<int>> R(H, vector <int>(W, 0));
	vector<vector<int>> D(H, vector <int>(W, 0));
	for (int row = H - 1; row >= 0; --row){
		for (int col = W - 1; col >= 0; --col){
			if (S[row][col] == '#'){
				continue;
			}
			//Rの計算
			if (col == W - 1){
				R[row][col] = 1;
			} else {
				R[row][col] = R[row][col+1] + 1;
			}
			//Dの計算
			if (row == H - 1){
				D[row][col] = 1;
			} else {
				D[row][col] = D[row+1][col] + 1;
			}
		}
	}

	//maxを計算
	int ans = 0;
	for (int row = 0; row < H; ++row){
		for (int col = 0; col < W; ++col){
			if (S[row][col] == '#'){
				continue;
			}
			int tmp = L[row][col] + R[row][col] + U[row][col] + D[row][col] - 3;
			ans = max(ans, tmp);
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 67200
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
#include<utility>
#define mod 998244853
using namespace std;
int in[4][2]={{1,0},{-1,0},{0,1},{0,-1}};
struct b{
  int x, y;
};
struct compare{
  bool operator()(pair<int, int> const& a, pair<int, int> const& b)
  {
      return a.second > b.second;
  }
};
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n, x;
    cin >> n;
    int a[n+1];
    for(int i = 1; i <= n; i++)
    {
        cin >> x;
        a[x]=i;
    }
    for(int i = 0; i < n; i++)
        cout << a[i+1] << ' ';
}

Measured memory_bytes: 1280
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
#define INF 0x3f3f3f3f

int main() {
	int n;
	cin>>n;	
	int Max=0,Min=INF;
	for (int i=1,x;i<=n;i++)
	{
		cin>>x;
		Max=max(Max,x);
		Min=min(Min,x);
	}
	cout<<Max-Min<<endl;
	return  0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
  ll n;
  cin>>n;
  ll sum=0;
  for(ll i=1;i<=n;i++){
      if(i%3!=0&&i%5!=0)sum+=i;
  }
  cout<<sum<<"\n";
}

Measured memory_bytes: 3640
import sys

sys.setrecursionlimit(10000000)
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = il()
    A = sorted(il())
    matches = [2, 5, 5, 4, 5, 6, 3, 7, 6]
    dict = {i + 1: matches[i] for i in range(9)}
    dp = [-1] * (N + 1)
    dp[0] = 0

    for n in range(N + 1):
        for a in A:
            if n + dict[a] <= N:
                dp[n + dict[a]] = max(dp[n + dict[a]], dp[n] * 10 + a)
    print(dp[N])


if __name__ == '__main__':
    main()


Measured memory_bytes: 15556
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

const int inf = 999999999;
const double pi = acos(-1);

#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}

///////////////////////////////////////////////////////////////////////////

int main(){
    ull a,b,x;
    cin >> a >> b >> x;

    if(a == 0)cout << b/x + 1 << endl;
    else cout << b/x - (a-1)/x << endl;

	return 0;
}

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

int main() {
  int k, n; cin >> k >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  int ans = 1000001;
  for (int i = 0; i < n; i++) {
    int s=v[i], e=v[(i+n-1)%n];
    ans = min(ans, (e-s+k)%k);
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main()
{
	int n, k;
	int count = 0;
	
	scanf("%d%d", &n, &k);

	for (int i = 1; i <= n; i += 2) {
		count++;
	}

	if (count >= k)
		printf("YES\n");
	else
		printf("NO\n");

	return 0;
}

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

void bfs(vector <int >a[],int le[],int vi[],int n)
{
	queue <int>q;
	q.push(1);
	vi[1]=1;
	le[1]=0;
	while(q.size()!=0)
	  {     int x,i;
	  	x=q.front();
	  	q.pop();
	  	for(i=0;i<a[x].size();i++)
	  	  {
	  	  	if(vi[a[x][i]]==0)
	  	  	  {
	  	  	  	vi[a[x][i]]=1;
	  	  	  	q.push(a[x][i]);
	  	  	  	le[a[x][i]]=1+le[x];
	  	  	  }
	  	  }
	  }
}
int main() {
	int n,i,x,y,m;
	cin>>n;
	vector <int >a[n+1];
	cin>>m;
	while(m--)
	  {
	     cin>>x>>y;
	     a[x].push_back(y);
	     a[y].push_back(x);
	  }
	int vi[n+1],le[n+1];
	for(i=1;i<n+1;i++)
	  {vi[i]=0;
	  le[i]=-1;}
	bfs(a,le,vi,n);
	if(le[n]==2)
	  {
	  	cout<<"POSSIBLE";
	  }
	else
	  {
	     cout<<"IMPOSSIBLE";	
	  }
	// your code goes here
	return 0;
}

Measured memory_bytes: 13936
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i, n) for (int i = 0; i < n; i++)

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  vector<int> B;
  rep(i, M) {
    int b;
    cin >> b;
    B.push_back(b);
  }

  int result = 0;
  rep(i, N) {
    vector<int> A;
    rep(i, M) {
      int a;
      cin >> a;
      A.push_back(a);
    }
    int temp = 0;
    rep(i, M) { temp += A[i] * B[i]; }
    temp += C;
    if (temp > 0) {
      result++;
    }
  }

  cout << result << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
    ll a, v, b, w, t;
    cin >> a >> v >> b >> w >> t;
    bool chk = 0;
    if (w >= v) chk = 1;
    else if (abs (a - b) > (v - w) * t) {
        chk = 1;
    }
    if (chk) cout << "NO\n";
    else {
        cout << "YES\n";
    }
}

Measured memory_bytes: 3636
from random import choice
from random import random
from time import time


class Optimizer:
    def __init__(self, C, S):
        self.C = C
        self.S = S
        X = []
        L = [-1] * 26
        for i in range(365):
            max_diff = -10**10
            best_j = 0
            for j in range(26):
                memo = L[j]
                L[j] = i
                diff = self.S[i][j] - \
                    sum([self.C[jj] * (i - L[jj]) for jj in range(26)])
                if diff > max_diff:
                    max_diff = diff
                    best_j = j
                L[j] = memo
            L[best_j] = i
            X.append(best_j)
        self.X = X

    def calc_score(self):
        score = 0
        L = [-1 for j in range(26)]
        A = [0 for j in range(26)]
        for i in range(365):
            score += self.S[i][self.X[i]]
            A[self.X[i]] += (i - L[self.X[i]]) * \
                (i - L[self.X[i]] - 1) // 2
            L[self.X[i]] = i
        for j in range(26):
            A[j] += (365 - L[j]) * (365 - L[j] - 1) // 2
            score -= self.C[j] * A[j]
        return score

    def optimize(self, temp, threp, interval, start_time=time(), lim=1.8):
        max_score = self.calc_score()
        while True:
            t = (time() - start_time) / 2
            if random() < threp:
                i = choice(range(365))
                j = choice(range(26))
                memo = self.X[i]
                self.X[i] = j
                new_score = self.calc_score()
                if new_score > max_score:
                    max_score = new_score
                elif random() < pow(2.7, (new_score - max_score) / pow(2000, 1 - t)):
                    max_score = new_score
                else:
                    self.X[i] = memo
            else:
                a = choice(range(interval))
                i0 = choice(range(365 - a))
                i1 = i0 + a
                self.X[i0], self.X[i1] = self.X[i1], self.X[i0]
                new_score = self.calc_score()
                if new_score > max_score:
                    max_score = new_score
                elif random() < pow(2.7, (new_score - max_score) / pow(2000, 1 - t)):
                    max_score = new_score
                else:
                    self.X[i0], self.X[i1] = self.X[i1], self.X[i0]
            if time() - start_time > lim:
                break
        return max(max_score + 10**6, 0)


if __name__ == "__main__":
    d = int(input())
    *C, = map(int, input().split())
    S = [list(map(int, input().split())) for i in range(d)]
    opt = Optimizer(C, S)
    opt.optimize(400, 0.2, 8)
    for x in opt.X:
        print(x + 1)
    # print(opt.calc_score())


Measured memory_bytes: 90204
using System;
using static System.Console;
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder
{
    class Program
    {
        //メイン関数
        static void Main(string[] args)
        {
            string[] input = Read().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);

            if (b - a == c - b) WriteLine("YES");
            else WriteLine("NO");
        }

        //メインじゃない関数
        private static string Read() { return ReadLine(); }
        private static int ReadI() { return int.Parse(ReadLine()); }
    }
}


Measured memory_bytes: 11092
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication34
{
    class Program
    {
        static void Main()
        {
            while (true)
            {
                int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();int ss = 0;
                if (a[0] == 0) break;
                for(int s = 1; s < a[0]; s++)
                {
                    if (s == 2) ss += 29;
                    else if (s == 4 || s == 6 || s == 9 || s == 11) ss += 30;
                    else ss += 31;
                }
                ss += a[1];
                switch (ss % 7) {
                    case 0:Console.WriteLine("Wednesday"); break;
                    case 1: Console.WriteLine("Thursday"); break;
                    case 2: Console.WriteLine("Friday"); break;
                    case 3: Console.WriteLine("Saturday"); break;
                    case 4: Console.WriteLine("Sunday"); break;
                    case 5: Console.WriteLine("Monday"); break;
                    case 6: Console.WriteLine("Tuesday"); break;
                }
            }
        }
    }
}

Measured memory_bytes: 9152
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int n = scanner.nextInt();
    int[] p = new int[n];
    for (int i = 0; i < n; i++) {
      p[i] = scanner.nextInt();
    }
    int count = 0;
    for (int i = 0; i < n - 2; i++) {
      if (p[i] < p[i + 1] && p[i + 1] < p[i + 2]) count++;
      else if (p[i] > p[i + 1] && p[i + 1] > p[i + 2]) count++;
    }
    System.out.println(count);
  }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A, B;
  cin >> A >> B;
  int cnt = 1;
  int a = A;
  while(A < B){
    cnt++;
    A += a - 1;
  }
  if(B == 1){
    cnt = 0;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
n = int(input())
p_list = list(map(int, input().split()))

cnt = 0
for i in range(1, n-1):
  if p_list[i] != max(p_list[i-1], p_list[i], p_list[i+1]) and p_list[i] != min(p_list[i-1], p_list[i], p_list[i+1]) :
    cnt += 1
print(cnt)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        sc.close();

        // 確率
        double prob = 0.0;
        // サイコロが1からnの場合の各確率を求め、
        // それを合計したものが求めたい確率
        for (int i = 1; i <= n; i++) {
            int points = i;
            double diff = 1.0 / n;
            while (points < k) {
                diff *= 0.5;
                points *= 2;
            }
            prob += diff;
        }
        System.out.println(prob);
    }

}


Measured memory_bytes: 22228
n, k = map(int, input().split())
inf = float("inf")
lst = list(map(int, input().split()))

dp = [inf]*(n+k)
dp[0] = 0

for i in range(n):
  for j in range(1, k+1):
    dp[i+j] = min(dp[i+j], dp[i] + abs(lst[min(n-1, i+j)] - lst[i]))

print(dp[n-1])

Measured memory_bytes: 55520
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(16);

    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];

    set<int> ma;
    for (auto &&x : a)
        ma.insert(x);

    const int k = ma.size();
    const int ans = k - !(k % 2);

    cout << ans << endl;
}


Measured memory_bytes: 5760
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ZYCSwing
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private static final int N = 100010;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            boolean[] prime = new boolean[N];
            Arrays.fill(prime, true);
            prime[0] = prime[1] = false;
            for (int i = 2; i < N; ++i) {
                if (prime[i]) {
                    for (int j = 2 * i; j < N; j += i) {
                        prime[j] = false;
                    }
                }
            }

            int[] cnt = new int[N];
            Arrays.fill(cnt, 0);

            for (int i = 2; i < N; ++i) {
                cnt[i] = cnt[i - 1];
                if (i % 2 == 1 && prime[i] && prime[(i + 1) / 2]) {
                    ++cnt[i];
                }
            }

            int q = in.nextInt();
            int l, r;
            for (int i = 0; i < q; ++i) {
                l = in.nextInt();
                r = in.nextInt();
                out.println(cnt[r] - cnt[l - 1]);
            }
        }

    }
}



Measured memory_bytes: 69008
#include <stdio.h>
#include <iostream>
#include <map>
#include <vector>
#include <string>

using namespace std;

using ll = long long;

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

	int h = x / 500;
	int f = (x % 500) / 5;

	cout << h * 1000 + f * 5 << endl;
	

	//system("pause");
	return 0;
}


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

int main(void) {
    vector<int> a(3);
    cin >> a.at(0) >> a.at(1) >> a.at(2);
    for (int i = 0; i < 3; i++) {
        for (int j = i + 1; j < 3; j++) {
            if (a.at(i) > a.at(j)) {
                int temp = a.at(i);
                a.at(i) = a.at(j);
                a.at(j) = temp;
            }
        }
    }
    cout << a.at(0) << " " << a.at(1) << " " << a.at(2) << endl;
    return 0;
}



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

int main() {
  int n;
  cin>>n;
  vector<int>vec(n);
  for(int i=0;i<n;i++) {
    int a;
    cin>>a;
    vec[i]=a;
  }
  sort(vec.begin(),vec.end());
  for(int i=0;i<n;i++) {
    for(int j=1;j<vec.size();j++) {
      if(vec.at(j-1)==vec.at(j)) {
        vec.erase(vec.begin()+j);
      }
    }
  }
  cout<<vec.size()<<endl;
}

Measured memory_bytes: 256
import java.util.*;

// UVa 11504

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int[] time = new int[n];
		int sum = 0;
		
		for (int i = 0; i < n; i++) {
			time[i] = in.nextInt();
			sum += time[i];
		}
		
		int m = in.nextInt();
		for (int i = 0; i < m; i++) {
			int problem = in.nextInt() - 1;
			int newTime = in.nextInt();
			System.out.println(sum - time[problem] + newTime);
		}
	}
}

Measured memory_bytes: 24020