akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class t>
using table = vector<vector<t>>;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"
  

int main() {
	while (1) {

		int N; cin >> N;
		if (!N)break;
		vector<pair<int, int>>nums(4);
		while (N--) {
			int a, b;
			int t;
			scanf("%d:%d", &a, &b);
			cin >> t;
			int time = (t + 60 - b) % 60;
			int date;
			if (a >= 11 && a <= 14)date = 0;
			else if (a >= 18 && a <= 20)date = 1;
			else if(a>=21||a<=1)date = 2;
			else date = 3;
			if (time <= 8)nums[date].first++;
			else nums[date].second++;
		}
		for (int i = 0; i < 3; ++i) {
			if (i == 0)cout << "lunch ";
			else if (i == 1)cout << "dinner ";
			else cout << "midnight ";

			if (nums[i].first + nums[i].second == 0)cout << "no guest";
			else cout << int(100*nums[i].first / (nums[i].first + nums[i].second));
			cout << endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	long long int a[n],b[n],ans=0;
	for(int i=0;i<n;i++){
		cin >> a[i] >> b[i];
	}
	for(int i=n-1;i>=0;i--){
		if((a[i]+ans)%b[i]!=0){
			a[i]+=ans;
			ans+=b[i]-a[i]%b[i];
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

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

struct Edge{
  int to, cost;

  Edge(int t, int c): to(t), cost(c)
  {}
  bool operator>(const Edge& rhs) const{
	return cost > rhs.cost;
  }
};
typedef vector< vector<Edge> > Graph;

void Dijkstra(const Graph& edges, vector<int>& d, int s){
  const int V = edges.size();
  priority_queue<PII, vector<PII>, greater<PII> > pq;
  fill(d.begin(), d.end(), 123456789);
  d[s] = 0;
  pq.push(MP(0,s));

  while(!pq.empty()){
	PII pii = pq.top(); pq.pop();
	int v = pii.second;
	if(d[v] < pii.first) continue;
	for(int i=0;i<edges[v].size();++i){
	  const Edge& e = edges[v][i];
	  if(d[e.to] > d[v] + e.cost){
		d[e.to] = d[v] + e.cost;
		pq.push(MP(d[e.to], e.to));
	  }
	}
  }
}

int dx[] = {-1,0,1,0};
int dy[] = {0,-1,0,1};
int main(){
  int H, W, N; cin >> H >> W >> N;
  cin.ignore();
  vector<string> vs(H);
  REP(i,H) getline(cin, vs[i]);
  Graph G(H*W);
  vector<int> p(N+1);
  REP(y,H) REP(x,W){
	int id_f = y*W + x;
	if(vs[y][x] == 'X') continue;
	if(vs[y][x] == 'S') p[0] = id_f;
	if('1' <= vs[y][x] && vs[y][x] <= '9')
	  p[vs[y][x]-'0'] = id_f;
	
	REP(i,4){
	  int tx = x + dx[i], ty = y + dy[i];
	  int id_t = ty*W + tx;
	  if(tx < 0 || W <= tx || ty < 0 || H <= ty) continue;
	  if(vs[ty][tx] != 'X')
		G[id_f].PB(Edge(id_t, 1));
	}
  }

  int ans = 0;
  VI dist(H*W);
  REP(i,N){
	Dijkstra(G, dist, p[i]);
	ans += dist[p[i+1]];
  }
  cout << ans << endl;
  
  return 0;
}

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

long f(long a,long b){
  if(a==0)return b%2==0?((long)ceil(b/2)%2==0?b:(b+1)):((long)ceil(b/2)%2==0?1:0);
  else return f(0,a-1)^f(0,b);
}

int main(void){
  long a,b;
  cin>>a>>b;
  cout<<f(a,b)<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <map>
#include <vector>

using namespace std;

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

#define reep(i,n,m) for(int i=n;i<m;i++)
#define rep(i,n) reep(i,0,n)

int main(){
    int N;
    ll T;
    cin >> N >> T;

    ll ans=0;
    ll right=0;
    rep(i,N){
        ll t;
        cin >> t;
        if(t<right){
            ans+=T-(right-t);
        }else{
            ans+=T;
        }
        right=t+T;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include <algorithm>
#include<float.h>
#include <limits>
#include <vector> 
#include <numeric>

#define rep(i,a,n) for(int (i) = (a);(i) < (n);(i)++)
#define urep(i,a,n) for(int (i) = (a);(i) > (n);(i)--)
#define MOD 1000000007
#define ll long long

using namespace::std;
int main(){
  int A,B,C,D;
  cin>>A>>B>>C>>D;
  if((A*B)>(C*D)) cout<<A*B;
  else cout<<C*D;
  
}
// int *p = new int[N];

// vector<vector<int>> 変数名(左の個数, vector<int>(右の個数));

//


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void)
{
	char a[100]={},b[100]={},c[100]={},d,e,f;
	scanf("%s%s%s",a,b,c);
	if(a[strlen(a)-1] == b[0] && b[strlen(b)-1] == c[0]) printf("YES");
	else printf("NO");
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
    using namespace std;
    typedef long long lint;
    typedef pair<int,int> pint;
    typedef vector<int> vint;
    #define rep(i, n) for(int i = 0; i < n; i++)
    #define rep2(i, m, n) for(int i = m; i < n; i++)
    #define rep3(elem, vec) for(auto elem: vec)
    #define SORT(V) sort((V).begin(),(V).end())
    #define RSORT(V) sort((V).rbegin(), (V).rend())
    #define COUT(N) cout<<fixed<<setprecision(N)
    lint gcd(int a,int b){return b?gcd(b,a%b):a;}
    lint lcm(int a,int b){return a*b/gcd(a,b);}
    lint comb(int a,int b){return b?comb(a-1,b-1)*a/b:1;}
    int dx[4] ={1,0,-1,0},dy[4] = {0,1,0,-1};
    int MOD = 1e9+7;

int main(){
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    if((C+B-1)/B <= (A+D-1)/D)cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>

int main(void)
{
  int N,i;
  scanf("%d",&N);
  int V[N],C[N];
  for(i = 0; i < N; i++) scanf("%d",&V[i]);
  for(i = 0; i < N; i++) scanf("%d",&C[i]);
  int a;
  for(i = 0; i < N; i++)
  {
    if((V[i]-C[i])>0) a += (V[i]-C[i]);
  }
  printf("%d",a);

  return 0;
}


Measured memory_bytes: 128
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MP make_pair
#define PB push_back
#define MOD 1000000007
#define INF (1LL<<30)
#define LLINF (1LL<<60)
#define PI 3.14159265359
#define EPS 1e-12
//#define int ll

int e[100010], f[200010] = {false};
signed main(void)
{
	int n, m;
	cin >> n >> m;
	REP(i, m) cin >> e[i];

	VI ans;
	for(int i=m-1; i>=0; --i) {
		if(!f[e[i]]) ans.PB(e[i]);
		//cout << e[i] << " ";
		f[e[i]] = true;
	}
	//cout << endl;

	FOR(i, 1, n+1) {
		if(!f[i]) {
			ans.PB(i);
			//cout << i << " ";
		}
	}
	//cout << endl;
	for(int i: ans) cout << i << endl;

	return 0;
}

Measured memory_bytes: 4992
using System;
using System.Collections.Generic;
using System.Linq;

class Program {
  static void Main(string[] args) {
    while(true) {
      string expr = Console.ReadLine();
      if(expr == "#") break;

      string[] factor = expr.Split('|').Select(x => x.Substring(1, x.Length - 2)).ToArray();
      bool ok = false;
      foreach (string term in factor) {
        bool flag = true;
        var set = new HashSet<string>();
        string[] ts = term.Split('&');
        foreach (string s in ts) set.Add(s);
        foreach (string s in ts) {
          if(s[0] == '~') {
            if(set.Contains(s.Substring(1))) flag = false;
          }
          else {
            if(set.Contains("~" + s)) flag = false;
          }
        }
        if(flag) ok = true;
      }
      Console.WriteLine(ok ? "yes" : "no");
    }
  }

  class Scanner {
    string[] inp;
    int ptr;

    public Scanner() {
      inp = new string[0];
      ptr = 0;
    }

    private void Fetch() {
      if (ptr >= inp.Length) {
        inp = Console.ReadLine().Split(' ');
        ptr = 0;
      }
    }

    public int NextInt() {
      Fetch();
      return int.Parse(inp[ptr++]);
    }

    public string Next() {
      Fetch();
      return inp[ptr++];
    }

    public double NextDouble() {
      Fetch();
      return double.Parse(inp[ptr++]);
    }
  }

}

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

int N;
ll c[10][10];

int main() {
    cin >> N;

    memset(c, 0, sizeof(c));

    for (int k = 1; k <= N; k++) {
        string str_k = to_string(k);

        int k_i = str_k[0] - '0';
        int k_j = str_k[str_k.length() - 1] - '0';

        c[k_i][k_j]++;
    }

    ll ans = 0;
    for (int i = 0; i <= 9; i++) {
        for (int j = 0; j <= 9; j++) {
            ans += c[i][j] * c[j][i];
        }
    }

    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream> 
 
using namespace std; 
 
int main(){ 
	int a,b,c,x;
	cin >> a >> b >> c >> x;
	int ans = 0;
	for(int i = 0; i <= a; i++){
		for(int j = 0; j <= b; j++){
			for(int k = 0; k <= c; k++){
				int sum = 500 * i + 100 * j + 50 * k;
				//cout << sum << endl;
				if(sum == x){
					ans++;
				}
			}
		}
	}
	cout << ans << endl;
} 


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

int SS(int n, int x){
    int ct=0;

    for(int i=1;i<(n-1);i++){
        for(int j=(i+1);j<n;j++){
            for(int k=(j+1);k<(n+1);k++){
                if((i+j+k)==x)ct++;

            }

        }
    }

    return ct;
    
}

int main(){

    int n,x;

    while(1){
        cin >> n >> x;

        if(n==0 && x==0)break;
        cout << SS(n,x)<< endl;

    }

    return 0;


}


Measured memory_bytes: 3088
fun main(args : Array<String>) {
    val n = readLine()!!.toInt()
    val ss = mutableMapOf<String, Int>()

    var max = 0
    repeat(n) {
        val s = readLine()!!
        val i = (ss[s] ?: 0) + 1
        ss[s] = i

        if (i > max) {
            max = i
        }
    }

    println(ss.entries.filter { it.value == max }.map { it.key }.sorted().joinToString(separator = "\n"))
}

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

int main()
{
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  double arad, brad, rad;
  double tmp,result;
  
  arad = 30 * H + 0.5 * M;
  brad = 6 * M;

  //cout << arad << brad << endl;
  rad = abs(arad - brad);
  if(rad>180){
    rad = 360 - rad;
  }
  //cout << rad << endl;
  //cout << cos(rad) << endl;

  tmp = A * A + B * B - 2*A*B*cos(rad/180*M_PI);
  //cout << tmp << endl;
  result = sqrt(tmp);

  cout << setprecision(20) << result << endl;
}

Measured memory_bytes: 4228
sx,sy,tx,ty=map(int,input().split())
ans=''
dx=tx-sx
dy=ty-sy
ans+='U'*dy+'R'*dx
ans+='D'*dy+'L'*dx
ans+='L'+'U'*(dy+1)+'R'*(dx+1)+'D'
ans+='R'+'D'*(dy+1)+'L'*(dx+1)+'U'
print(ans)

Measured memory_bytes: 9104
def partition(a, p, r):
    q  = p
    for i in range(p, r):
        if a[i] <= a[r]:
            a[q], a[i] = a[i], a[q]
            q += 1
    a[q], a[r] = a[r], a[q]
    return q 

n = input()
a = list(map(int, input().split()))
q = partition(a, 0, len(a) - 1)
a[q] = '[{}]'.format(a[q])
print(*a)


Measured memory_bytes: 16388
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
#define ALL(v) v.begin(), v.end()
#define vmax(v) *max_element(ALL(v))
#define vmin(v) *min_element(ALL(v))
#define chmax(x, a) x = max(x, a)
#define chmin(x, a) x = min(x, a)

int main() {
    ll N, K; cin >> N >> K;
    vector<ll> A(N), F(N);
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> F[i];
    sort(ALL(A)); sort(ALL(F));
    vector<pair<ll, ll>> memo(N);
    rep(i, N) memo[i] = make_pair(A[i]*F[N-i-1], i);
    sort(ALL(memo));
    reverse(ALL(memo));
    ll ok = memo[0].first, ng = -1;
    while (abs(ok-ng) > 1) {
        ll mid = (ok+ng)/2;
        ll cnt = 0;
        bool flag = true;
        rep(i, N) {
            if (memo[i].first <= mid) break;
            ll tmp = memo[i].second;
            cnt += A[tmp] - mid/F[N-tmp-1];
            if (cnt > K) {
                flag = false;
                break;
            }
        }
        if (flag) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}


Measured memory_bytes: 9524
#include <bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
#define _GLIBCXX_DEBUG

using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll mod = 1e9+7;
void chmod(ll &M){
  if(M >= mod) M %= mod;
  else if(M < 0){
     M += (abs(M)/mod + 1)*mod;
    M %= mod;
}
}
ll modpow(ll x, ll n){
   if(n==0) return 1;
  ll res=modpow(x, n/2);
 if(n%2==0) return res*res%mod;
else return res*res%mod*x%mod;
}
int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  else return GCD(b, a % b);
}

using namespace std;
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
int main()
{
    ull X;
    cin >> X;
    ull sum = 100; 
    ull year = 0;
    while(sum < X) {
        sum += sum/100;
        // sum *= 1.01;
        year++;
    }
cout << year << "\n";

}


Measured memory_bytes: 3564
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<array>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<functional>
#include<limits>
#include<list>
#include<map>
#include<numeric>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(o) {cerr<<#o<<" "<<o<<endl;}
#define DUMPC(o) {cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
const int MOD = 1e9 + 7;

//?????§??¬?´???°
int gcd(int x, int y) {
	return y ? gcd(y, x%y) : x;
}

signed main() {
	int n; cin >> n; cin.ignore();
	REP(i, n) {
		string S; getline(cin, S);
		REP(a, 26) {
			if (gcd(a, 26) != 1)continue;
			REP(b, 26) {
				string T = S;
				REP(j, S.size()) {
					if (S[j] == ' ') {
						continue;
					}
					int c = S[j] - 'a';
					c = (a*c + b) % 26;
					T[j] = char(c + 'a');
				}
				if (T.find("that") == string::npos&&T.find("this") == string::npos) {
					continue;
				}
				else {
					cout << T << endl;
					a = b = 26;
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;
int main(int argc, char const *argv[])
{
    int x, y;
    cin >> x >> y;
    if (x == 1 && y == 1)
    {
        cout << 300000 * 2 + 400000 << endl;
        return 0;
    }
    else
    {
        int sum = 0;
        if (x <= 3)
        {
            sum += 100000 * (4 - x);
        }
        if (y <= 3)
        {
            sum += 100000 * (4 - y);
        }
        cout << sum << endl;
        return 0;
    }
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Text;

namespace AtCoder
{
	public class ProblemA
	{
		public static void Main(string[] args)
		{
			string s = Console.ReadLine();
			int a = s[0] - '0';
			int b = s[1] - '0';
			int c = s[2] - '0';
			int d = s[3] - '0';

			uint i = 0;

			// bitごとに0がマイナス、1がプラスを示す
			for (; i <= 8; i++)
			{
				int tmpAns = a;
				if ((i & 4) > 0)
					tmpAns += b;
				else
					tmpAns -= b;

				if ((i & 2) > 0)
					tmpAns += c;
				else
					tmpAns -= c;

				if ((i & 1) > 0)
					tmpAns += d;
				else
					tmpAns -= d;

				if (tmpAns == 7)
					break;
			}

			var sb = new StringBuilder();
			sb.Append(a);
			sb.Append((i & 4) > 0 ? '+' : '-');
			sb.Append(b);
			sb.Append((i & 2) > 0 ? '+' : '-');
			sb.Append(c);
			sb.Append((i & 1) > 0 ? '+' : '-');
			sb.Append(d);
			sb.Append("=7");

			Console.WriteLine(sb.ToString());
		}
	}
}


Measured memory_bytes: 25864
#include <bits/stdc++.h>
using namespace std;
int n,a,b;
vector<int> vec;
char s[5],res[666];
inline int Q1(int l,int r) {
    printf("? ");
    for (int i=l;i<=r;++i)
        printf("%d%c",i,i==r?'\n':' ');
    fflush(stdout);
    char s[5];scanf("%s",s);
    return 2-(s[0]=='R');
}
inline int Q2() {
    printf("? ");
    for (int i=0;i<(int)vec.size();++i)
        printf("%d%c",vec[i],i+1==(int)vec.size()?'\n':' ');
    fflush(stdout);
    char s[5];scanf("%s",s);
    return 2-(s[0]=='R');
}
inline void go(int p,int x) {
    char ch=(x==1)?'R':'B';
    res[p]=ch;
}
int main()
{
    scanf("%d",&n);
    a=Q1(1,n);
    b=3-a;
    go(1,a);
    go(n+n,b);
    int left=1,right=n+1;
    while (left+1<right) {
        int mid=(left+right)>>1;
        int c=Q1(mid,mid+n-1);
        if (a==c) left=mid;
        else right=mid;
    }
    for (int i=right;i<=left+n-1;++i) vec.push_back(i);
    for (int i=1;i<right;++i) {
        vec.push_back(i);
        go(i,Q2());
        vec.pop_back();
    }
    for (int i=left+n;i<=n+n;++i) {
        vec.push_back(i);
        go(i,Q2());
        vec.pop_back();
    }
    int c1=n/2,c2=n/2;
    vec.clear();
    for (int i=1;i<right;++i) {
        if (c1&&res[i]=='R') vec.push_back(i),--c1;
        if (c2&&res[i]=='B') vec.push_back(i),--c2;
    }
    for (int i=left+n;i<=n+n;++i) {
        if (c1&&res[i]=='R') vec.push_back(i),--c1;
        if (c2&&res[i]=='B') vec.push_back(i),--c2;
    }
    for (int i=right;i<=left+n-1;++i) {
        vec.push_back(i);
        go(i,Q2());
        vec.pop_back();
    }
    printf("! ");
    puts(res+1);
    fflush(stdout);
    return 0;
}


Measured memory_bytes: 724
#include <bits/stdc++.h>
	  #define endl "\n"
	  #define ll long long int
	  #define mod 1000000007
	  #define inf 1000000000000000001;
	  using namespace std;
	  int main()
	  {
	    //  #ifndef ONLINE_JUDGE
	    //  // for getting input from input.txt
	    //  freopen("input.txt", "r", stdin);
	    //  // for writing output to output.txt
	    //  freopen("output.txt", "w", stdout);
	    // #endif
	    std::ios::sync_with_stdio(false);
	    cin.tie(NULL);
	    // int a,b,c,d,e,k;
	    // cin>>a>>b>>c>>d>>e>>k;
	    int v[6];
	    for (int i = 0; i < 6; ++i)
	    {
	    	cin>>v[i];
	    }
	    // cout<<v[5];
	    for (int i = 0; i < 4; ++i)
	    {
	    	for (int j = 1; j < 5; ++j)
	    	{
	    		if(abs(v[i]-v[j]) > v[5]){
	    			// cout<<abs(v[i]-v[j]);
	    			cout<<":(";
	    			return 0;
	    		}
	    	}
	    }

	    cout<<"Yay!";

	    return 0;
	  }


Measured memory_bytes: 3540
#include<iostream>
#include<string>
using namespace std;
int main () {
  string S;
  cin >> S;
  string ans[] = {"hi", "hihi", "hihihi", "hihihihi", 
                  "hihihihihi"};
  for (int i = 0; i < 5; i ++) {
    if (S == ans[i]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int M = sc.nextInt();
		
		int h = sc.nextInt();
		int w = sc.nextInt();
		
		System.out.println((N-h)*(M-w));
		
	}
}


Measured memory_bytes: 21972
<?php
	fscanf(STDIN,'%d%d',$n,$m);
	for($i=0;$i<=$n;$i++)$a[]=0;
	for($i=0;$i<$m;$i++){
		fscanf(STDIN,'%d%d',$c,$b);
		$a[$c]++;
		$a[$b]++;
	}
	for($i=0;$i++<$n;)echo $a[$i],"\n";


Measured memory_bytes: 3828
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 1000000
//リストのノード（スタック内の各データ）の定義
typedef struct node{
    char elem;
    struct node *next;
} node;

//スタックにデータを追加
void push(node **first, char elem){
    //追加する分の領域を確保
    node *new = calloc(1, sizeof(node));
    if(new == NULL) exit(1);
    new->elem = elem;
    new->next = *first;
    *first = new;
}

//スタックからデータを取り出す
char pop(node **first){
    char elem;
    node *tmp = *first;
    if(tmp == NULL) exit(1);
    elem = tmp->elem;
    *first = tmp->next;
    //取り出したノードのメモリを解放
    free(tmp);
    return elem;
}

int main(void){
    char cube[SIZE];
    char under_cube;
    int i,count = 0,answer = 0;
    scanf("%s",cube);
    //最初のノードの指す先
    node *first = NULL;
    /* 文字の数だけループ */
    for ( i = 0; i < strlen(cube); i++)
    {
        if (count == 0)
        {
            /* stackがからの場合、挿入 */
            push(&first,cube[i]);
            count += 1;
        }
        else
        {
            /* stackに要素がある場合、取り出す */
            under_cube = pop(&first);
            if (under_cube == cube[i])
            {
                /* 1か0が連続している場合、stackに追加 */
                push(&first,under_cube);
                push(&first,cube[i]);
                count += 1;
            }
            else
            {
                /* 連続していない場合は、追加せず */
                answer += 2;
                count -= 1;
            }
            
        }
        
    }
    printf("%d\n",answer);
    return 0;
}


Measured memory_bytes: 4960
import java.util.Scanner;

public class Main {

	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNext()){
			
			int a = Integer.parseInt(sc.next());
			String op = sc.next();
			int b = Integer.parseInt(sc.next());
			
			if(op.equals("?")){
				break;
			}
			
			int answer = culculateValues(op,a,b);
			System.out.println(answer);
			
		}
		
		sc.close();
		
	}

	private static int culculateValues(String op, int a, int b) {
		
		int answer = 0;
		
		switch(op){
		
		case "+":
			answer = a + b;
			break;
		case "-":
			answer = a - b;
			break;
		case "*":
			answer = a * b;
			break;
		case "/":
			answer = a / b;
			break;
		
		}
		
		return answer;
	}
}



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

int main(){
  int n;

  while(cin>>n&&n){
    vector<int> k(n);

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

    string s;cin>>s; 
    vector<char> c;

    for(int i=0;i<s.size();++i){
      c.emplace_back(s.at(i));
      int key = k[i%k.size()];
      while(key!=0){
        int tmp;
        if(key>26){
          key -= 26;
          tmp = 26;
        }else{
          tmp = key;
          key -= key;
        }

        if(c[i]>='A'&&c[i]<='Z'){
          c[i] -= tmp;
          if(c[i]<'A'){
            char sub = 'A' - c[i] - 1;
            c[i] = 'z' - sub;
          }
        }
        else if(c[i]>='a'&&c[i]<='z'){
          c[i] -= tmp;
          if(c[i]<'a'){
            char sub = 'a' - c[i] - 1;
            c[i] = 'Z' - sub;
          }
        }
      }
      cout<<c[i];
    }
    cout<<endl;
  }

  return EXIT_SUCCESS;
}

Measured memory_bytes: 1224
# atcoder : python3 (3.4.3)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7

# main
N = int(input())

num = [2,1]
for i in range(N):
    num.append(num[-2]+num[-1])

print(num[N])

Measured memory_bytes: 3060
using System.Linq;
using System.Collections.Generic;
using System;

public class hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        var chair = new List<int>();
        var pre = 0;
        if (a[0] - pre - 1 > 0) chair.Add(-(a[0] - pre - 1));
        chair.Add(1);
        pre = a[0];
        for (int i = 1; i < m; i++)
        {
            if (a[i] - pre - 1 > 0) chair.Add ( - ( a[i] - pre - 1));
            chair.Add(1);
            pre = a[i];
        }
        if (n - a[m - 1] > 0) chair.Add(-(n - a[m - 1]));
        var res = getAns(chair, m);
        Console.WriteLine(res);
    }
    public static int getAns (List<int> a , int m)
    {
        var total = 0;
        var bc = 0;
        for (int i = 0; i < a.Count(); i++)
            if (a[i] > 0)
            {
                total++;
                if (total == m) return bc;
            }
            else
            {
                bc += -a[i];
                total += -a[i];
                if (total >= m) return bc - (total - m);
            }
        return 0;
    }
}




Measured memory_bytes: 18220
/*------------------------------------
.....Bismillahir Rahmanir Rahim.......
created by muslim.time: 2:24:23 pm....
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld long double
#define   pb push_back
#define  sz(x)  (int)x.size()
#define  ff first
#define  ss second
#define  pii  pair<int,int>
using namespace std;

inline void solve(){ 
    string s; cin>>s;
    string res;
    for (int i=0;i<19;i++){
        if (s[i]==',') {
            cout << res << " ";
            res="";
        }
        else res += s[i];
    }
    cout << res << endl; 
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Measured memory_bytes: 256
import numpy as np
def resolve():
    N = int(input())

    freq = np.zeros((10, 10))
    for i in range(1, N+1):
        s = str(i)
        head = int(s[0])
        tail = int(s[-1])
        freq[head][tail] += 1
        
    ans = 0
    for i in range(1, N+1):
        s = str(i)
        head = int(s[0])
        tail = int(s[-1])
        ans += freq[tail][head]      

    print(int(ans))
    

if __name__ == "__main__":
    resolve()

Measured memory_bytes: 12504
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))
#define INF 1000000000

void swap(int* a, int* b)
{
	int tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}

void swap2(double* a, double* b)
{
	double tmp;
	tmp = *a;
	*a = *b;
	*b = tmp;
}

int gcd(int a, int b)
{
	if (a < b)
		swap(&a, &b);

	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}

int lcm(int a, int b)
{
	return a * b / gcd(a, b);
}


int main()
{
	int N;
	int A[1000];

	scanf("%d", &N);

	for (int i = 0; i < N; i++)
		scanf("%d", &A[i]);

	for (int i = 0; i < N; i++)
	{
		if (A[i] % 2 == 0)
		{
			if ((A[i] % 3 != 0) && (A[i] % 5 != 0))
			{
				printf("DENIED");
				return 0;
			}
		}

	}

	printf("APPROVED");
}

Measured memory_bytes: 256
import math
n,d=map(int,input().split())
x=[]
for i in range(n):
    s=list(map(int,input().split()))
    x+=[s]
rote=0
ans=0
for i in range(n):#i番目の点を決める
    for j in range(n):#j番目の点を決める
        for y in range(d):
            rote+=(x[i][y]-x[j][y])**2
        roteans=math.sqrt(rote)
        if rote==0:
            break
        elif roteans%1==0:
            ans+=1
        rote=0
print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}

int x,y,ax,ay,bx,by;

void set_val(){
	ax=abs(x),ay=abs(y);
	if(x!=0)bx=x/ax;
	else bx=1;
	if(y!=0)by=y/ay;
	else by=1;
}

vector<P> vs;

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n;
	cin>>x>>y;
	set_val();
	if(n%2==1 && (ax+ay)%n!=0){
		a=(ax+ay)/n;
		if((a>0 && a%2==(ax+ay)%2) || (a==0 && a%2!=(ax+ay)%2)){
			vs.push_back(make_pair(x,y));
			if(ax>ay){
				ax-=n/2;
				ay+=n-n/2;
			}else{
				ay-=n/2;
				ax+=n-n/2;
			}
			x=ax*bx,y=ay*by;
			set_val();
		}
	}
	if(n%2==0){
		if((x+y)%2!=0){
			cout<<-1<<endl;
			return 0;
		}
	}
	if((ax+ay)%n!=0){
		vs.push_back(make_pair(x,y));
		c=(ax+ay)%n;
		if(ax+ay<n){
			if(ax>ay){
				ay+=n-c;
				ay+=c-c/2,ax-=c/2;
			}else{
				ax+=n-c;
				ax+=c-c/2,ay-=c/2;
			}
		}else{
			if(ax>ay){
				ax-=c;
				ax-=(n-c)/2,ay+=n-c-(n-c)/2;
			}else{
				ay-=c;
				ay-=(n-c)/2,ax+=n-c-(n-c)/2;
			}
		}
		x=ax*bx,y=ay*by;
		set_val();
	}
	while(ax+ay){
		vs.push_back(make_pair(x,y));
		c=min(n,ax);
		ax-=c,ay-=n-c;
		x=ax*bx,y=ay*by;
		set_val();
	}
	reverse(vs.begin(),vs.end());
	cout<<vs.size()<<endl;
	for(auto vt : vs){
		cout<<vt.first<<" "<<vt.second<<endl;
	}
	return 0;
}

Measured memory_bytes: 3952
n,d,a=map(int,input().split())
d=d*2
M=sorted([list(map(int,input().split())) for i in range(n)])
l=0
A=[0]*n
B=[0]
ans=0
for i in range(n):
  while M[l][0]+d<M[i][0]:
    l=l+1
  ans=ans+max(0,(M[i][1]-B[i]+B[l]+a-1)//a)
  A[i]=max(0,(M[i][1]-B[i]+B[l]+a-1)//a)*a
  B.append(B[-1]+A[i])
print(ans)

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define DBGDO(X) ({ if(1) cerr << "DBGDO: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string s; cin >> s;
	bool ok = false;
	FOR(i,0,sz(s)-1) if (s[i] == 'A' && s[i+1] == 'C') ok = true;
	cout << (ok ? "Yes" : "No") << endl;
}



Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[1000];
		int[] b = new int[1000];
		int[] c = new int[1000];
		for(int i=0; i<N; i++){
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			c[i] = sc.nextInt();
		}
		for(int i=0; i<N; i++){
			if(a[i]*a[i] == (b[i]*b[i] + c[i]*c[i]) || b[i]*b[i] == (a[i]*a[i] + c[i]*c[i]) || c[i]*c[i] == (b[i]*b[i] + a[i]*a[i])){
				System.out.println("YES");
			}else{
				System.out.println("NO");
			}
		}
	}
}

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

int main()
{
	int N=0,a=0,b=0,c=0;
	int num=0;
	
	//????????????????????°?????\???
	cin >> N;
	
	for(N; N>0; N--){
		cin >> a >> b >> c;
		
		//??????????????????
		if(a < b){
				num = a;
				a = b;
				b = num;
		}
		if(a < c){
				num = a;
				a = c;
				c = num;
		}
		
		a = a * a;
		b = b * b;
		c = c * c;
		
		if(a == (b + c)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 1152
#include <stdio.h>



int main (void){
    int i,j;
    int n,k; 
    int s[150] = {0};
    int ans[150] = {0};
    int wa = 0;

    scanf("%d %d",&n,&k);

    for(i=0;i<n;i++){
        scanf("%d",&s[i]);
    }
    for(i=0;i<n;i++){
        if(s[i] <= (k/2)){
            ans[i] = s[i]*2;
        }else{
            if(s[i] < k){
                ans[i] = (k-s[i])*2;
            }else{
                ans[i] = (s[i]-k)*2;
            }
        }
    }

    for(i=0;i<n;i++){
        wa += ans[i];
    }

    /*for(i=0;i<n;i++){
       printf("%d\n",ans[i]);
    }*/

    printf("%d\n",wa);
    
    
    return 0;
}

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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;
using P = pair<int, int>;

int main() {
    int j, ans = 0;
    string s;
    cin >> s;
    j = s.size() - 1;
    rep(i, s.size()) {
        if (i > j)
            break;
        if (s[i] != s[j])
            ans++;
        j--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
typedef long long int ll;
using namespace std;
int main(){
	int n,cnt;
	lldiv_t t;
	cin >> n;
	vector<ll> a(n);
	for(int i=0;i<n;i++)
		cin >> a[i];
	
	for(int i=0;i<a.size();i++){
		cnt = 0;
		while(!(t = lldiv(a[i],2)).rem){
			a[i] = t.quot;
			++cnt;
		}
		a[i] = cnt;
	}
	cout << *min_element(a.begin(),a.end()) << endl;
}

Measured memory_bytes: 256
import bisect
s = list(input())
t = list(input())

n = len(s)

p = [[] for _ in range(26)]
for i in range(n):
    p[ord(s[i])-97].append(i+1) 


res = 0
b = 0
for e in t:
    k = ord(e)-97
    if len(p[k]) == 0:
        print(-1)
        exit()
    else:
        r = bisect.bisect_right(p[k],b)
        if len(p[k]) > r:
            res += p[k][r]-b
            b = p[k][r]
        else:
            res += n-b+p[k][0]
            b = p[k][0]

print(res)


Measured memory_bytes: 9060
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <math.h>
#include <iomanip>
using namespace std;

int main() {
  int p, q, r;
  cin >> p >> q >> r;
  int ans;
  ans = p + q + r - max(p, max(q, r));
  cout << ans << endl;
}


Measured memory_bytes: 764
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 200005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n+1);
    a[0] = 2;
    a[1] = 1;
    rep(i,2,n+1){
        a[i] = a[i-1]+a[i-2];
    }
    PRINT(a[n]);
}


Measured memory_bytes: 3600
//#define _GLIBCXX_DEBUG
#include <iostream>
#include <bits/stdc++.h>
    
    
using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cout(n) cout<<fixed<<setprecision(n)



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    vector<ll> v(n);
    FOR(i,0,n)cin>>v[i];
    bool is_odd = false;
    FOR(i,0,n)if(v[i]<0)is_odd^=1;
    ll ans = 0;
    FOR(i,0,n) ans+=abs(abs(v[i]));
    if(is_odd){
        ll x = 1e9;
        FOR(i,0,n) x = min(x, abs(v[i]));
        ans-=x*2;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>s;
    if(s[2]==s[3]&&s[4]==s[5])
    {
        cout<<"Yes\n";
    }
    else
        cout<<"No\n";



    return 0;
}


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

int main(){
    string st;
    getline (cin,st);
    int n=st.size();
    rep(i,n){
        char c=st[i];
        if(islower(c)) printf("%c" , c-32);
        else if(isupper(c)) printf("%c" , c+32);
        else cout<<c;
    }
    cout<<endl;
}


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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)

int main(int argc, char *argv[])
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    char i, j;
    cin >> i >> j;

    string ii = string(int(j - '0'), i);
    string jj = string(int(i - '0'), j);

    cout << (int(i - '0') < int(j - '0') ? ii : jj) << endl;

    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp15
{
    class Class295
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            SortedSet<string> set = new SortedSet<string>();
            for(int i = 0; i < N; i++)
            {
                var s = Console.ReadLine();
                set.Add(s);
            }
            Console.WriteLine(set.Count );
        }
    }
}


Measured memory_bytes: 48004
from sys import stdin, stdout
from time import perf_counter

import sys
sys.setrecursionlimit(10**9)
mod = 10**9+7

# import sys
# sys.stdout = open("e:/python/cp/output.txt","w")
# sys.stdin = open("e:/python/cp/input.txt","r")



s = input()
# print(F"Atcoder {s.title()} Contest")

# print(f"A{s[0].upper()}C ")
print(f"A{s[8].upper()}C")

Measured memory_bytes: 9096
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1000000009;

int main() {
  string s;
  cin >> s;
  int ans = 0, rtn = 0;
  for (int i = 0; i < 3; ++i) {
    if (s[i] == 'R') {
      ++ans;
      rtn = max(rtn, ans);
    } else {
      ans = 0;
    }
  }
  cout << rtn << endl;
}


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

int main(){
  vector<int> a(9);
  for(int i=0;i<9;i++)
    cin >> a.at(i);
  int n;
  cin >> n;
  vector<int> b(n);
  for(int i=0;i<n;i++)
    cin >> b.at(i);
  vector<int> c(9);
  
  for(int i=0;i<n;i++){
    for(int j=0;j<9;j++){
      if(a.at(j)==b.at(i))
        c.at(j)=1;
    }
  }
  
  int k=0;
  
  for(int i=0;i<3;i++){
    if(c.at(i*3)==c.at(i*3+1)&&c.at(i*3)==c.at(i*3+2)&&c.at(i*3)==1)
      k++;
  }
  
  for(int i=0;i<3;i++){
    if(c.at(i)==c.at(i+3)&&c.at(i)==c.at(i+6)&&c.at(i)==1)
      k++;
  }
  
  if(c.at(0)==c.at(4)&&c.at(0)==c.at(8)&&c.at(0)==1)
    k++;
  
  if(c.at(2)==c.at(4)&&c.at(2)==c.at(6)&&c.at(2)==1)
    k++;
  
  if(k!=0)
    cout << "Yes" << endl;
  else
    cout << "No"<< endl;
  
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
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;
}
 
using namespace std;
//ここから

void solve(){
  int a,b,c;
  cin>>a>>b>>c;
  a-=b;
  if(a>=c)cout<<0;
  else cout<<c-a;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 256
def solve(x1, x2, x3, x4, x5):
    for i, x in enumerate([x1, x2, x3, x4, x5]):
        if x == 0:
            return i + 1
    return 0


def main():
    x1, x2, x3, x4, x5 = map(int, input().split())
    res = solve(x1, x2, x3, x4, x5)
    print(res)


def test():
    assert solve(0, 2, 3, 4, 5) == 1
    assert solve(1, 2, 0, 4, 5) == 3


if __name__ == "__main__":
    test()
    main()


Measured memory_bytes: 9140
#include<iostream>
#include<algorithm>
#include<cmath>

using namespace std;

struct DATA{
  int x, y;
  double r;
  DATA(){}
  DATA(int x_, int y_){ x=x_; y=y_; r=(double)x/(double)y; }
  void set(int x_, int y_){ x=x_; y=y_; r=(double)x/(double)y; }
};

int main(){
  int n;
  double p, k;
  DATA a, b;

  while(1){
    cin >> p >> n;
    if(p == 0 && n == 0) break;

    p = sqrt(p);
    a.set((int)p, 1);
    b.set((int)p+1, 1);

    for(int i=b.x+1; i<=n; ++i){
      for(int j=2; j<i; ++j){
	k = (double)i/(double)j;
	if(k < a.r) break;
	if(k > b.r) continue;
	if(a.r < k && k <= p) a.set(i, j);
	else if(p < k && k < b.r) b.set(i, j);
      }
    }

    cout << b.x << "/" << b.y << " ";
    cout << a.x << "/" << a.y << endl;
  }
  return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    constexpr int A_MAX = 1000000;
    vector<int> min_factor(A_MAX + 1);
    vector<int> q(A_MAX + 1, 1);
    vector<int> primes;
    for (int i = 2; i <= A_MAX; ++i) {
        if (!min_factor[i]) {
            min_factor[i] = i;
            primes.push_back(i);
        }
        int min_factor_i = min_factor[i];
        for (int p : primes) {
            int n = i * p;
            if (n > A_MAX) {
                break;
            }
            min_factor[n] = p;
            if (p == min_factor_i) {
                q[n] = q[i];
                break;
            } else {
                q[n] = i;
            }
        }
    }
 
    int N = 0;
    char c = getchar_unlocked();
    do {
        N = 10 * N + c - '0';
    } while ((c = getchar_unlocked()) >= '0');
    vector<int> a(A_MAX + 1);
    for (int i = 0; i < N; ++i) {
        int A = 0;
        c = getchar_unlocked();
        do {
            A = 10 * A + c - '0';
    	} while ((c = getchar_unlocked()) >= '0');
        ++a[A];
    }
 
    bool is_pairwise_coprime = true;
    for (int n = A_MAX; n > 1; --n) {
        if (a[n] > 1) {
            if (a[n] == N) {
                printf("not coprime\n");
                return 0;
            }
            is_pairwise_coprime = false;
        }
        a[min_factor[n]] += a[n];
        a[q[n]] += a[n];
    }
    if (is_pairwise_coprime) {
        printf("pairwise coprime\n");
    } else {
        printf("setwise coprime\n");
    }
 
    return 0;
}

Measured memory_bytes: 15488
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
int main(void){
    int A,B,C;
    cin>>A>>B>>C;
    int X=A-B;
    int ans=C-X;
    if(ans<0){
        ans=0;
    }
    cout<<ans<<endl;
    
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#include <cassert>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
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; }
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using ii = pair<int, int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using gt = greater<int>;
using minq = priority_queue<int, vector<int>, gt>;
using P = pair<ll,ll>;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int N; int L[104];
int main() {
  cin >> N;
  rep(i,N) cin >> L[i];
  int ans = 0;
  rep(i,N) for (int j=i+1; j<N; j++) for (int k=j+1; k<N; k++) {
    vi x(3);
    x[0] = L[i];
    x[1] = L[j];
    x[2] = L[k];
    if (x[0] == x[1] || x[0] == x[2] || x[1] == x[2])continue;
    sort(x.begin(),x.end()); 
    if (x[2] < x[1] + x[0]) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3632
<?php

	$data = explode(" ", trim(fgets(STDIN)));
	$n = $data[0];
	$p = 1000000000 + 7;
	
	$x[1] = $n % $p;
	$x[2] = $n * $n % $p;
	$x[3] = ($n * $n + $n * ($n - 1)) % $p;
	
	$s[1] = $x[1];
	$s[2] = ($s[1] + $x[2]) % $p;
	$s[3] = ($s[2] + $x[3]) % $p;
	
	for($i=4; $i<=$n; $i++){
	    $x[$i] = $x[$i-1] + ($n-1)*($n-1) + $s[$i-3] + 2 + $n - $i;
	    $x[$i] %= $p;
	    $s[$i] = ($s[$i-1] + $x[$i]) % $p;
	}
	
	echo $x[$n];
?>

Measured memory_bytes: 72164
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define fi first
#define se second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define RFor(i,b,a) for(ll i = b;i>=a;i--)
#define sz size()
#define PQ priority_queue
#define len length()
#define mll map<ll,ll>
#define vll vector<ll>
#define sll set<ll>
#define vpll vector<pair<ll,ll> >
#define mp(x,y)  make_pair(x,y)
#define pll pair<ll,ll>
#define pb push_back
#define pf push_front
#define ins insert
#define er erase
#define ALL(v) v.begin(),v.end()
#define LAPAK ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

const ll MOD = 1e9 + 7;
const ll INF = 2e18;
const ll MAX = 3e5+5;


int main() {
    LAPAK
    ll tc;
    tc = 1;
    //cin>>tc;
    while(tc--){
        ll x;
        cin>>x;
        ll k = 360;
        while(k%x!=0){
            k += 360;
        }
        cout<<k/x;
    }
    
	return 0;
}

Measured memory_bytes: 3596