akhauriyash/Code-Regression huggingface dataset:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  h,w=LI()
  s=[S() for _ in range(h)]

  L=[[0 for _ in range(w)]for __ in range(h)]
  R=[[0 for _ in range(w)]for __ in range(h)]
  D=[[0 for _ in range(w)]for __ in range(h)]
  U=[[0 for _ in range(w)]for __ in range(h)]

  for i in range(h):
    for j in range(w):
      if s[i][j]=='#':
        L[i][j]=0
        U[i][j]=0
        continue

      if i==0:
        U[i][j]=1
      else:
        U[i][j]=U[i-1][j]+1

      if j==0:
        L[i][j]=1
      else:
        L[i][j]=L[i][j-1]+1

  for i in range(h)[::-1]:
    for j in range(w)[::-1]:
      if s[i][j]=='#':
        R[i][j]=0
        D[i][j]=0
        continue

      if i==h-1:
        D[i][j]=1
      else:
        D[i][j]=D[i+1][j]+1

      if j==w-1:
        R[i][j]=1
      else:
        R[i][j]=R[i][j+1]+1

  ans=0
  # print(R,L,D,U)
  for i in range(h):
    for j in range(w):
      ans=max(ans,R[i][j]+L[i][j]+U[i][j]+D[i][j]-3)

  return ans

# main()
print(main())


Measured memory_bytes: 195168
#include <iostream>

using namespace std;
long long fact(int n) {
  if (n < 1 || n > 20) return 0;
  if (n == 1) return 1;
  else return fact(n - 1) * (long long)n;
}

int main() {
  int n;
  cin >> n;
  if (fact(n))
    cout << fact(n) << endl;
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define FOR(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=(n)-1;i>=0;i--)
using namespace std;

int main()
{
    string s;
    int flag = 0;
    cin >> s;
    REP (i, s.size()) {
        if( s[i] == 'C') {
            flag = 1;
        } else if (s[i] == 'F' && flag == 1) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T, class T2> void smin(T& a, T2 val) {if (a > val) a = val;}template<class T, class T2> void smax(T& a, T2 val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

void yes(){
   cout<<"Yes"<<endl;
   //exit (0);
}
void no(){
   cout<<"No"<<endl;
   //exit (0);   
}

int n, m;
string s, t;

int32_t main(){_

   int a, b, c, k;
   cin >> a >> b >> c >> k;
   
   if (k <= a){
      cout<<k;
      exit(0);
   }

   int ans = a;
   k -= min(k, a);
   k -= min(k, b);

   if (k > 0){
      ans -= min(k, c);
   }

   cout<<ans;

   return 0;
}

Measured memory_bytes: 3612
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  int r, g, b, n;
  cin >> r >> g >> b >> n;
  
  llong ans = 0;
  REP(i,3001){
    REP(j,3001){
      int num = r * i + g * j;
      if(num <= n){
        if((n - num) % b == 0){
          //cout << i << " " << j << " " << r <<  " " << g << endl;
          ans++;
        }
      }
    }
  }

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



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define int long long // LEMBRAR DE TROCAR CASO PROBLEMA DE MEMORIA
#define pii pair<int,int>
#define ieps (int) 1e6
#define eps (int) 1e9
#define mp make_pair
#define pb push_back

int n ; 
vector<int> v;
int32_t main(){
	/*ios::sync_with_stdio(false);
	cin.tie(0) , cout.tie(0);
	*/
	cin>>n;
	v.resize(n);
	for(int i = 0 ;  i < n; i++){
		cin>>v[i];
	}
	int custo = 0;
	int atual = 0;
	for(int i = 0 ; i < n; i ++){
		custo += abs(v[i] - atual);
		atual = v[i];
	}
	custo += abs(atual - 0);
	for(int i = 0 ; i < n; i ++){
		int next = i + 1;
		if(next == n) next = 0;
		else next = v[next];
		int anterior = i - 1;
		if(anterior < 0) anterior = 0;
		else anterior = v[anterior];
		cout<< custo - abs(anterior - v[i]) - abs(v[i] - next) + abs(anterior - next)<<endl;
	}
}

Measured memory_bytes: 2048
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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

def readInts():
  return list(map(int,input().split()))
def main():
    n,k = readInts()
    A = readInts()
    root = []
    ok = True
    l = 0
    start = [1]
    dic = defaultdict(int)
    while True:
        if ok:
            a = 1
            ok = False
        else:
            a = root[-1]
        if not dic[A[a-1]]:
            dic[A[a-1]] = a
            root.append(A[a-1])
        else:
            j = 0
            for i in range(len(root)):
                if A[a-1] == root[i]:
                    j = i
                    break
                start.append(root[i])
            root = root[j:]
            l = j
            break
    if k < len(start):
        print(start[k])
    else:
        k = k - (l+1) if k - (l+1) >= 0 else k
        print(root[k%len(root)])
if __name__ == '__main__':
  main()


Measured memory_bytes: 36696
#include <stdio.h>

int F[44];

int main(){
  int i, n;
  scanf("%d",&n);
  for(i=0; i<44; i++)F[i] = 0;
  printf("%d\n",fib(n));
  return 0;
}

int fib(int n){
  if(n == 0 || n == 1)return F[n] = 1;
  if(F[n] != 0)return F[n];
  return F[n] = fib(n-1) + fib(n-2);
}



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

#define ll long long
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define rep(i, n, m) for (int (i) = (n); (i) < (m); (i)++)
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;
#define vec vector
#define vvi vector<vector<int>>

struct Edge {
   int to, cost;
};
const ll INF = 4e18;
int N, M;
vec<vec<Edge>> G;

void dfs(int pos, vec<ll> &dist) {
   for (Edge e : G[pos]) { // 地点posの遷移先を全探索
      if (dist[e.to] == INF) { // 遷移先の値が定まっていないなら
         dist[e.to] = dist[pos] + e.cost; // 遷移先の値を定める
         dfs(e.to, dist);
      }
   }
}

int main() {
   cin >> N >> M;
   G = vec<vec<Edge>>(N);
   rep (i, 0, M) {
      int l, r, d;
      cin >> l >> r >> d;
      l--, r--;
      G[l].push_back(Edge{r, d});
      G[r].push_back(Edge{l, -d});
   }

   vector<ll> dist(N, INF);
   rep (i, 0, N) {
      if (dist[i] == INF) { // 現在地の値が定まっていないなら
         // 始点を0で初期化.
         // dist[i]からたどるノードはdfsで値が定められる。
         // そのため、二度目以降0で初期化される場合はそこは今までの島とは独立している
         dist[i] = 0;
         dfs(i, dist);
      }
   }


   rep (i, 0, N) {
      for (Edge e : G[i]) {
         // 遷移先の値 - 現在地 != 遷移コスト
         if (dist[e.to] - dist[i] != e.cost) {
            puts("No");
            return 0;
         }
      }
   }
   puts("Yes");

   return 0;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
int N;
	cin >> N;
	vec(A);
	fx(N) {
		vecp(A);
	}

	ll ans = 0;
	fx(N-1) {
		ans += A[x] / 2;
		A[x] -= A[x] / 2*2;
		int sum = min(A[x], A[x + 1]);
		A[x] -= sum;
		A[x + 1] -= sum;
		ans += sum;
	}
	ce(ans + A[N-1]/2)

    return 0;
}



Measured memory_bytes: 892
#include<stdio.h>
#define MAX 100
#define INFTY 1000001
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n,M[MAX][MAX];

void dijkstra();

int main(){
  int i,j;
  int k,c,u,v;

  scanf("%d",&n);
  for(i=0; i<n; i++){
    for(j=0; j<n; j++){
      M[i][j] = INFTY;
    }
  }

  for(i=0; i<n; i++){
    scanf("%d %d",&u,&k);
    for(j=0; j<k; j++){
      scanf("%d %d",&v,&c);
      M[u][v] = c;
    }
  }

  dijkstra();

  return 0;
}

void dijkstra(){
  int minv,i,u,v;
  int d[MAX],color[MAX];

  for(i=0; i<n; i++){
    d[i] = INFTY;
    color[i] = WHITE;
  }

  d[0] = 0;
  color[0] = GRAY;
  while(1){
    minv = INFTY;
    u = -1;
    for(i=0; i<n; i++){
      if( minv > d[i] && color[i] != BLACK ){
	u = i;
	minv = d[i];
      }
    }

    if( u == -1 ) break;
    color[u] = BLACK;
    for(v=0; v<n; v++){
      if( color[v] != BLACK && M[u][v] != INFTY ){
	if( d[v] > d[u] + M[u][v] ){
	  d[v] = d[u] + M[u][v];
	  color[v] = GRAY;
	}
      }
    }
  }
  for(i=0; i<n; i++){
    printf("%d ",i);
    if( d[i] == INFTY ) printf("-1\n");
    else printf("%d\n",d[i]);
  }
}



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

int main(){
	int n,k=0;
	cin >> n >> k;
	string s;
	cin >> s;
	int i;

	int w=0,ans=0;
	for(i=0; i<n-1; i++){
		if(s[i]!=s[i+1]){
			w++;
		}else{
			ans++;
		}
	}

	
	while(k>0 && w>0){
		if(w==1){
			ans++;
			w--;
		}else{
			ans+=2;
			w-=2;
		}
		k--;
	}
  
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) ll((a).size())
#define out(a) cout<<(a)<<endl;
const int inf=INT_MAX;
const int MAX = 510000;
const ll MOD = 1000000007;

int main(){
  ll n,a;cin>>n>>a;
  vll x(n);
  rep(i,0,n)cin>>x[i];
  vector<vvll> dp(51,vvll(51,vll(2501,0))); 
  rep(i,0,n+1){
    dp[i][0][0]=1;
  }
  
  rep(i,1,n+1){
    rep(j,1,i+1){

      rep(k,0,2501){
        if(k<x[i-1]){dp[i][j][k]=dp[i-1][j][k];}
        else{dp[i][j][k]=dp[i-1][j][k]+dp[i-1][j-1][k-x[i-1]];}
      }
    }
  }
  ll ans=0;
  rep(i,1,n+1){
    ans+=dp[n][i][i*a];
  }
  out(ans);
}



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

int main() {
    int N; cin >> N;
    bool hasYellow = false;
    for (int i = 0; i < N; i++) {
        char S; cin >> S;
        if (S == 'Y') {
            hasYellow = true;
        }
    }
    if (hasYellow) {
        cout << "Four" << endl;
    } else {
        cout << "Three" << endl;
    }
}


Measured memory_bytes: 3632
#include<stdio.h>
#include<stdlib.h>

int main(void){

  int K;
  scanf("%d\n", &K);

  int ans=0;

  if(K%2){
    ans = (K/2)*(K/2+1);
  }else{
    ans = (K/2)*(K/2);
  }

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


Measured memory_bytes: 128
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;

#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i, n) for(ll i=(ll)(n-1);i>=0;i--)
#define FOR(i, a, b) for(ll i=(ll)(a); i<=(ll)(b); i++)
#define RFOR(i, a, b) for(ll i=(ll)(a);i>=(ll)(b); i--)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

signed main()
{
	int n;
	cin >> n;
	switch(n%10){
		case 2:
		case 4:
		case 5:
		case 7:
		case 9:
			cout << "hon";
			break;
		case 0:
		case 1:
		case 6:
		case 8:
			cout << "pon";
			break;
		case 3:
			cout << "bon";
			break;
	}
	cout << "\n";
}


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

void input(string& rsMaxNum)
{
  cin >> rsMaxNum;
}

int digitDp(string sMaxNum)
{
  // dp[nPos][nSmall][nDgt3][nDgt5][nDgt7] :=
  //    nPos  : 上位 nPos 桁目まで決定
  //    nSmall: small(数字を自由に選べる)か
  //    nDgt3 : 上位 nPos 桁までで 3 を選択したかflag
  //    nDgt5 : 上位 nPos 桁までで 5 を選択したかflag
  //    nDgt7 : 上位 nPos 桁までで 7 を選択したかflag
  //                             の条件を満たす数値の数
  const vector<int> cnvnDgt = {0, 3, 5, 7};
  int nLen = sMaxNum.size();

  int dp[nLen + 1][2][2][2][2] = {};
  dp[0][0][0][0][0] = 1;

  for (int nPos = 0; nPos < nLen; ++nPos)
  {
    int nMaxDgt = sMaxNum[nPos] - '0';

    for (int nSmall = 0; nSmall < 2; ++nSmall)
      for (int nDgt3 = 0; nDgt3 < 2; ++nDgt3)
        for (int nDgt5 = 0; nDgt5 < 2; ++nDgt5)
          for (int nDgt7 = 0; nDgt7 < 2; ++nDgt7)
            for (int nx = 0; nx < cnvnDgt.size(); ++nx)
            {
              if ( !nSmall && nMaxDgt < cnvnDgt[nx] ) 
                break;
              if (( nDgt3 || nDgt5 || nDgt7) && !cnvnDgt[nx] )
                continue;

              int nTrgSmall = nSmall || (cnvnDgt[nx] < nMaxDgt);
              int nTrgDgt3  = nDgt3  || (cnvnDgt[nx] == 3);
              int nTrgDgt5  = nDgt5  || (cnvnDgt[nx] == 5);
              int nTrgDgt7  = nDgt7  || (cnvnDgt[nx] == 7);
              dp[ nPos + 1 ][ nTrgSmall ][ nTrgDgt3 ][ nTrgDgt5 ][ nTrgDgt7 ]
                += dp[nPos][nSmall][nDgt3][nDgt5][nDgt7];
            }
  }
  return dp[nLen][0][1][1][1] + dp[nLen][1][1][1][1];
}

int main()
{
  string sMaxNum;

  input(sMaxNum);
  cout << digitDp(sMaxNum) << endl;
  
  return 0;
}

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back

using namespace std;

// #define DEBUG_IS_VALID

#ifdef DEBUG_IS_VALID
#define DEB 1 
#else
#define DEB 0
#endif
#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline void chmax(T& a,T const& b){a=max(a,b);}
template<class T> inline void chmin(T& a,T const& b){a=min(a,b);}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll lmod = 1e9+7,LINF=1LL<<60; 

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N; cin >> N ;
  vl a(N),s(N);
  rep(i,N){
    cin >> a[i] ;
  }
  s[0]=a[0];
  rep(i,N-1) s[i+1]=s[i]+a[i+1];
  ll ans = LINF;
  dump(s);
  REP(i,2,N-1){
    int j1,k1;
    {
      int l = 0; int r = i; j1 = (l+r)/2;
      while(abs(r-l)>1){
        if(2*s[j1]>s[i-1]) r = j1;
        else l = j1;
        j1 = (l+r)/2;
      }
    }
    {
      int l = i; int r = N; k1 = (l+r)/2;
      while(abs(r-l)>1){
        if(2*s[k1]>s[i-1]+s[N-1]) r = k1;
        else l = k1;
        k1 = (l+r)/2;
      }
    }
    dump(j1,i,k1);
    ll P,Q,R,S;
    P = s[j1];
    Q = s[i-1]-s[j1];
    dump(P,Q);
    if(j1!=i){
      ll t1,t2;
      j1++;
      t1=s[j1]; t2 = s[i-1]-s[j1];
      if(abs(t1-t2)<abs(P-Q)){
        P = t1; Q = t2;
      }
    }
    R = s[k1]-s[i-1];
    S = s[N-1]-s[k1];
    dump(R,S);
    if(k1!=N-1){
      ll t1,t2; k1++;
      t1=s[k1]-s[i-1];
      t2=s[N-1]-s[k1];
      if(abs(t1-t2)<abs(R-S)){
        R = t1; S = t2;
      }
    }
    chmin(ans,max(max(P,Q),max(R,S))-min(min(P,Q),min(R,S)));
  }
  cout << ans << endl;
  return 0; 
}


Measured memory_bytes: 3456
using System;

namespace ABC078
{
    public class Problem_C
    {
        public static void Main(string[] args)
        {
            var inputs = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int n = inputs[0], m = inputs[1];
            var p = Math.Pow(1 / 2d, m);
            var t = 100 * (n - m) + 1900 * m;
            Console.WriteLine($"{t * (1 / p)}");
        }
    }
}


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

int main(void){
    int n;
    cin >> n;
    int d[n];
    for(int i = 0;i < n;i++)cin >> d[i];
    
    int sum = 0;
    sort(d,d+n);
    for(int i = 0;i < n;i++){
        if(i == (n/2)-1)sum = d[i+1]-d[i];
    }
    cout << sum << endl;
}

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

int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int start=max(a,c);
    int end=min(b,d);
        cout<<max(0,end-start)<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#include<queue>
#include<cstdlib>
#include<ctime>
#define rep(i,j,k) for(register int i = j; i <= k; i++)
#define dow(i,j,k) for(register int i = j; i >= k; i--)
#define ll long long
using namespace std;
 
inline int read() {
	int s = 0, t = 1; char c = getchar();
	while( !isdigit(c) ) { if( c == '-' ) t = -1; c = getchar(); }
	while( isdigit(c) ) s = s * 10 + c - 48, c = getchar();
	return s * t;	
} 

const int N = 1e5+5, p = 1e9+7;
inline void Min(int &x,int v) { if( x > v ) x = v; }
struct node{ int x, y, id; } A[N];
inline bool cmp1(const node&a,const node&b) { 
	return a.x < b.x;
}
inline bool cmp2(const node&a,const node&b) { 
	return a.y < b.y;
}
struct edge{ 
	int x, y, v; bool operator < (const edge&rhs) const { return v < rhs.v; }
} e[N<<1];
int fa[N];
inline int find(int x) { 
	return fa[x] == x ? x : fa[x] = find(fa[x]);
}

int main() {
	int n = read(), cnt = 0;
	rep(i,1,n) A[i].x = read(), A[i].y = read(), fa[i] = A[i].id = i;
	sort(A+1,A+n+1,cmp1);
	rep(i,1,n-1) e[++cnt].x = A[i].id, e[cnt].y = A[i+1].id, e[cnt].v = A[i+1].x - A[i].x;
	sort(A+1,A+n+1,cmp2);
	rep(i,1,n-1) e[++cnt].x = A[i].id, e[cnt].y = A[i+1].id, e[cnt].v = A[i+1].y - A[i].y;
	
	sort(e+1,e+cnt+1);
	int x, y, tot = 0; ll ans = 0;
	rep(i,1,cnt) { 
		x = find(e[i].x), y = find(e[i].y);
		if( x != y ) { 
			ans += e[i].v, fa[x] = y, tot++;
			if( tot == n - 1 ) break;
		}
	}
	cout<<ans<<endl;
    return 0;
} 

Measured memory_bytes: 4224
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	char s = sc.next().charAt(0);
      	if(s=='S') System.out.println("Cloudy");
      	else if(s=='C') System.out.println("Rainy");
      	else System.out.println("Sunny");
    }
}

Measured memory_bytes: 35588
#include<cstdio>

using namespace std;

int main()
{
	char sp[103][103];
	bool chk[103][103];
	int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
	int t;	scanf("%d",&t);

	for(int k=0;k<t;k++){
		if(k>0)	puts("");

		int n;	scanf("%d",&n);
		for(int i=0;i<=n+1;i++)	for(int j=0;j<=n+1;j++)	chk[i][j]=true;
		for(int i=1;i<=n;i++)	for(int j=1;j<=n;j++)	sp[i][j]=' ',chk[i][j]=false;

		int x=1,y=n,di=1;
		sp[y][x]='#';
		while(1){
			if(chk[y+dy[di]][x+dx[di]]){
				di=(di+3)%4;
				if(chk[y+dy[di]][x+dx[di]])	break;
			}
			else{
				int xl,yl,xr,yr;
				xl=x+dx[(di+1)%4];	yl=y+dy[(di+1)%4];
				xr=x+dx[(di+3)%4];	yr=y+dy[(di+3)%4];
				chk[yl][xl]=chk[yr][xr]=true;

				x+=dx[di];	y+=dy[di];
				sp[y][x]='#';
			}
		}

		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++)	putchar(sp[i][j]);
			puts("");
		}
	}

	return 0;
}

Measured memory_bytes: 0
#ifndef ___CLASS_MODINT
#define ___CLASS_MODINT

#include <cstdint>

template<std::uint32_t mod>
class modint {
private:
	std::uint32_t n;
public:
	modint() : n(0) {};
	modint(std::uint64_t n_) : n(n_ % mod) {};
	bool operator==(const modint& m) const { return n == m.n; }
	bool operator!=(const modint& m) const { return n != m.n; }
	std::uint32_t get() const { return n; }
	modint& operator+=(const modint& m) { n += m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator-=(const modint& m) { n += mod - m.n; n = (n < mod ? n : n - mod); return *this; }
	modint& operator*=(const modint& m) { n = std::uint64_t(n) * m.n % mod; return *this; }
	modint operator+(const modint& m) const { return modint(*this) += m; }
	modint operator-(const modint& m) const { return modint(*this) -= m; }
	modint operator*(const modint& m) const { return modint(*this) *= m; }
	modint binpow(std::uint64_t b) const {
		modint ans = 1, m = modint(*this);
		while (b) {
			if (b & 1) ans *= m;
			m *= m;
			b >>= 1;
		}
		return ans;
	}
	modint inv() { return (*this).binpow(mod - 2); }
};

#endif // ___CLASS_MODINT

#include <vector>
#include <iostream>
#include <functional>
using namespace std;
const int lim = 4000000;
const int mod = 1000000007;
using modulo = modint<mod>;
int main() {
	vector<modulo> fact(lim + 1), inv(lim + 1), factinv(lim + 1);
	fact[0] = 1; inv[1] = 1; factinv[0] = 1;
	for (int i = 1; i <= lim; ++i) fact[i] = fact[i - 1] * i;
	for (int i = 2; i <= lim; ++i) inv[i] = inv[mod % i] * (mod - mod / i);
	for (int i = 1; i <= lim; ++i) factinv[i] = factinv[i - 1] * inv[i];
	function<modulo(int, int)> comb = [&](int n, int m) {
		if (m < 0 || n < m) return modulo(0);
		return fact[n] * factinv[m] * factinv[n - m];
	};
	int A, B, C, SX, SY;
	while (cin >> A >> B >> C >> SX >> SY, A + B + C) {
		modulo ans = 0;
		for (int i = 0; i <= SX && i <= SY; ++i) {
			modulo sub = comb(A + B + C + i - 1, i);
			if (A > 0) sub *= comb(SX - i - 1, A - 1);
			else if (SX - i > 0) sub = 0;
			if(B > 0) sub *= comb(SY - i - 1, B - 1);
			else if (SY - i > 0) sub = 0;
			ans += sub;
		}
		ans *= fact[A + B + C] * factinv[A] * factinv[B] * factinv[C];
		cout << ans.get() << endl;
	}
	return 0;
}


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

int main(){
    int n;
    cin>>n;
    int sum=0;
    if(n>=3){
        sum+=n;
        sum+=n*(n-1)*3;
        sum+=n*(n-1)*(n-2);
    }
    if(n==1)
        sum+=1;
    if(n==2)
        sum+=8;
    cout<<sum<<endl;
}

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

int main()
{
    int n, x1, x2, sum;

    cin >> n;

    x1 = n / 500;
    n = n % 500;

    x2 = n / 5;
    n = n % 5;

    sum = x1 * 1000 + x2 * 5;

    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
 
class Main {
    public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int a,p,maxap;
 
	a = sc.nextInt();
	p = sc.nextInt();
 
	maxap = (3*a + p) /2;
 
	System.out.println(maxap);
    }
}

Measured memory_bytes: 22868
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        string s = sc.Next();

        s = s.Replace("BC", "X");

        long answer = 0;

        long aCount = 0;

        foreach (char c in s)
        {
            if (c == 'A')
            {
                aCount++;
            }
            else if (c == 'X')
            {
                answer += aCount;
            }
            else
            {
                aCount = 0;
            }
        }

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}


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

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 long long INF = 1LL << 60;
const long long mod = 1000000007;


int main(void){
    vector<queue<char> > v(3) ;
    for(int i=0;i<3;i++){
	string s; cin >> s;
	for(int j=0;j<s.length();j++){
	    v[i].push(s[j]);
	}
    }
    int turn = 0;
    while(1){
	if(v[turn].empty()) break;
	char s = v[turn].front();v[turn].pop();
	if(s == 'a') turn = 0;
	if(s == 'b') turn = 1;
	if(s == 'c') turn = 2;
    }
    if(turn == 0) cout << "A" << endl;
    else if(turn == 1) cout << "B" << endl;
    else cout << "C" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)

int main(){
    string s;
    cin >> s;
    int ans = s.size();
    int T = 0;
    reverse(all(s));
    rep(i,s.size()){
        if(s[i] == 'T') ++T;
        if(s[i] == 'S' && T) ans -= 2,--T;
    }
    cout << ans << endl; 
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define REP(i,a,b) for(int(i)=(a);(i)<(b);++(i))
#define RREP(i,a,b) for(int(i)=(a)-1;(i)>=(b);--(i))
#define ALL(x) (x).begin(),(x).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
using namespace std;
typedef long long ll;

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

  ll ans = 0;  // お気に入りの数の総和
  for(ll i=1; i*i <= N; ++i) {
    if (N % i == 0) {
      // (Nの約数)-1が候補
      // 大きい方の約数だけ
      ll m = N/i - 1;
      if (m != 0 && N / m == N % m) ans += m;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import sys, os
import collections
import heapq

MOD = 10 ** 9 + 7

def solve(input_stream):
  N = read_int(input_stream)
  values = read_ints(input_stream)
  heapq.heapify(values)
  while len(values) > 1:
    a,b = (heapq.heappop(values), heapq.heappop(values))
    heapq.heappush(values, (a+b)/2.0)
  return [str(heapq.heappop(values))]


def read_ints(input_stream):
  return [i for i in map(int, input_stream.readline().strip().split())]

def read_int(input_stream):
  return int(input_stream.readline().strip())


if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

Measured memory_bytes: 38384
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    string s, t;
    cin >> s >> t;
    sort(s.begin(), s.end());
    bool ok = true;
    vector<bool> used((int)t.size(), false);
    rep(i, (int)s.size()) {
        bool flg1 = false;
        bool flg2 = false;
        rep(j, (int)t.size()) {
            if (s[i] < t[j]) {
                flg1 = true;
            }
            else if (!flg2 && s[i] == t[j] && !used[j]) {
                flg2 = true;
                used[j] = true;
            }
        }
        if (flg1) {
            cout << "Yes" << endl;
            return 0;
        }
        else if (!flg2) {
            cout << "No" << endl;
            return 0;
        }
    }
    rep(i, (int)t.size()) {
        if (!used[i]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3636
import java.io.IOException;
import java.util.Scanner;

class Main
{	
	private static Scanner sc;
	
	public static void main(String[] args)throws IOException
	{
		sc = new Scanner(System.in);
		String aa = sc.next();
		int a = Integer.parseInt(aa);
		String bb = sc.next();
		int b = Integer.parseInt(bb);
		String cc = sc.next();
		int c = Integer.parseInt(cc);
	
		if(a+b==c || b+c==a || a+c==b){
			System.out.println("Yes");
		}
		else{
			System.out.println("No");
		}
		
	}

}


Measured memory_bytes: 9672
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define vi vector<int>
using namespace std;

int main(){
	int n;
	cin>>n;
	
	vi d(n);
	REP(i,n) cin>>d[i];
	
	sort(ALL(d));
	
	cout<<d[n/2]-d[n/2-1]<<endl;
}//解答参考.

Measured memory_bytes: 640
"use strict";

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }

var processData = function processData(lines) {
  var _lines$0$split$map = lines[0].split(' ').map(function (x) {
    return +x;
  }),
      _lines$0$split$map2 = _slicedToArray(_lines$0$split$map, 2),
      x = _lines$0$split$map2[0],
      y = _lines$0$split$map2[1];

  var reds = lines[1].split(' ').map(function (x) {
    return +x;
  }).sort(function (a, b) {
    return b - a;
  });
  var greens = lines[2].split(' ').map(function (x) {
    return +x;
  }).sort(function (a, b) {
    return b - a;
  });
  var colorless = lines[3].split(' ').map(function (x) {
    return +x;
  }).sort(function (a, b) {
    return b - a;
  });
  var all = reds.slice(0, x).concat(greens.slice(0, y)).sort(function (a, b) {
    return b - a;
  });
  var res = [];
  var m = 0;
  var l = 0,
      r = 0;

  while (m < all.length) {
    var t = all[l];
    var p = colorless[r] || 0;

    if (t > p) {
      res.push(t);
      l++;
    } else {
      res.push(p);
      r++;
    }

    m++;
  }

  console.log(res.reduce(function (a, b) {
    return a + b;
  }, 0));
};

var i = '';
process.stdin.on('data', function (c) {
  return i += c;
});
process.stdin.on('end', function () {
  var _require = require('os'),
      EOL = _require.EOL;

  var lines = i.split(EOL);
  /*your input text, split by lines*/

  processData(lines);
});


Measured memory_bytes: 57440
import sys
input = sys.stdin.readline

S = input().strip()
K = int(input())

count_l = 0
count_r = 0
f = S.count(S[0]) == len(S)
for x in S:
    if x == S[0]:
        count_l += 1
    else:
        break

for x in S[::-1]:
    if x == S[-1]:
        count_r += 1
    else:
        break

ans = 0
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        s = S[i]
        ans += 1
        S = S.replace(s * 2, s + '_', 1)

if count_l % 2 and count_r % 2 and S[0] == S[-1]:
    if f:
        ans = ans * K + K // 2
    else:
        ans = (ans + 1) * K - 1
else:
    ans *= K

print(ans)


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

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

    int N;
    cin >> N;
    string s;
    cin >> s;
    int n = 0, w = 0;
    REP(i, N) {
        if ('A' <= s[i] && s[i] <= 'M')
            n++;
        if ('N' <= s[i] && s[i] <= 'Z')
            n--;
        if ('a' <= s[i] && s[i] <= 'm')
            w++;
        if ('n' <= s[i] && s[i] <= 'z')
            w--;
    }
    string ans = "";
    if (0 <= n) {
        REP(i, n) ans += "A";
    } else {
        REP(i, -n) ans += "N";
    }
    if (0 <= w) {
        REP(i, w) ans += "a";
    } else {
        REP(i, -w) ans += "n";
    }
    print(ans.size());
    print(ans);

    return 0;
}


Measured memory_bytes: 3340
#include <bits/stdc++.h>
using namespace std;
#define int long long
int inf = 10e17;
#define mod 1000000007

bool vis[200005];
vector<int> vec[2000005], v1;
vector<pair<int, int>> vec2[2000005];
int child[2000005];
int parent[2000005];
int div1[100005];
int min_indx[900005];
int count1 = 0;
int height = 0;
int max_indx[200005];
void dfs(int node)
{

    vis[node] = 1;

    for (int i = 0; i < vec[node].size(); i++)
    {
        if (!vis[vec[node][i]])
        {
            parent[vec[node][i]] = node;
            dfs(vec[node][i]);
        }
    }
}

int MAXN = 200005;
int LOGMAXN = (int)log2(200005) + 1;
int M[200005][60];
void process2(int A[], int N)
{
    int i, j;

    //initialize M for the intervals with length 1
    for (i = 0; i < N; i++)
        M[i][0] = i;
    //compute values from smaller to bigger intervals
    for (j = 1; 1 << j <= N; j++)
        for (i = 0; i + (1 << j) - 1 < N; i++)
            if (A[M[i][j - 1]] < A[M[i + (1 << (j - 1))][j - 1]])
                M[i][j] = M[i][j - 1];
            else
                M[i][j] = M[i + (1 << (j - 1))][j - 1];
}
//int parent[200005];
vector<int> vec1;
//bool vis[200005];
//int hei[200005];
int lev[200005];
int dis[200005];
bool cmp(pair<int, int> &a,
         pair<int, int> &b)
{
    return a.second < b.second;
}
void Ios()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //  int t;
}
int32_t main()
{
    //  Ios();
    //  int t;
    int a, b, c;
    cin >> a >> b >> c;
    int ans = 0;
    for (int i = a; i <= b; i++)
    {
        if (i % c == 0)
            ans++;
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 97432
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define END(a) {cout << (a) << "\n"; return 0;}
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }
const long double pi = acos(-1);
int main() {
    init();
    
    double a, b, x; cin >> a >> b >> x;
    double Max = a * a * b;

    if (Max / 2 < x) {
        double ng = b, ok = 0;
        double lim = Max - x;
        FOR(cnt, 0, 1000000) {
            double mid = (ok + ng) / 2;
            if (a * a * mid / 2 > lim)ng = mid;
            else ok = mid;
        }
        cout << atan(ok / a) / pi * 180;
    }
    else {
        long double ng = a, ok = 0;
        FOR(cnt, 0, 1000000) {
            long double mid = (ok + ng) / 2;
            if (a * b * mid / 2 > x)ng = mid;
            else ok = mid;
        }
        cout << ((pi / 2) - atan(ok / b)) / pi * 180;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		if(x < 1200) {
			System.out.println("ABC");
		} else {
			System.out.println("ARC");
		}
	}

}


Measured memory_bytes: 21844
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

# 可能操作回数
op = sum(b) - sum(a)

# 必要操作回数のカウント
a_must = 0
b_must = 0
for ai, bi in zip(a,b):
    if ai  > bi:
        b_must += (ai - bi)
    
    elif bi > ai:
        a_must += (bi - ai +1) // 2
        b_must += (bi - ai) % 2
    

# 可能回数と比較して、可能ならYes
if a_must <= op and b_must <= op:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 4596
#include<iostream>
#include<cstring>
using namespace std;
int main() {
	int n, m, k;
	int a[201];
	int b[201], c[201];
	memset(a, 0, sizeof(a));
	memset(b, 0, sizeof(b));
	memset(c, 0, sizeof(c));
	cin >> n;
	for (int i = 1; i <= n * 2; i++) {
		a[i] = i;
	}
	cin >> m;
	for (int x = 1; x <= m; x++) {
		cin >> k;
		if (k == 0) {
			for (int i = 1; i <= n; i++) {
				b[i] = a[i];
				//cout << a[i] << endl;;
			}
			for (int i = n + 1; i <= n * 2; i++) {
				c[i-n] = a[i];
			}
			int v = 1, x = 1;
			for (int i = 1; i <= n * 2; i++) {
				if (i % 2 != 0&&b[v]!=0) {
					a[i] = b[v];
					v++;
				}
				else if(c[x]!=0){
					a[i] = c[x];
					x++;
				}
			}
		}
		else if(1<=k&&k<=n*2-1){
			for (int i = 1; i <= k; i++) {
				b[i] = a[i];
			}
			for (int i = k + 1; i <= n * 2; i++) {
				c[i-k] = a[i];
			}
			for (int i = 1; i <= n*2-k; i++) {
				a[i] = c[i];
			}
			for (int i =n*2-k+1; i <= n * 2; i++) {
				a[i] = b[i-n*2+k];
			}
		}
	}
	for (int i = 1; i <= n * 2; i++) {
		cout << a[i] << endl;
	}
}

Measured memory_bytes: 3100
import math
n,a,b = map(int,input().split())
mod = 10**9 + 7
s = pow(2,n,mod) - 1
a_ue = 1
a_shita = 1
b_ue = 1
b_shita = 1
for i in range(1,a+1):
    a_ue = a_ue * (n-i+1) % mod
    a_shita = a_shita * i % mod
a_tmp = a_ue * pow(a_shita,mod-2,mod) % mod
# pow(a_shita,mod-2,mod) で逆元を求める
for j in range(1,b+1):
    b_ue = b_ue * (n-j+1) % mod
    b_shita = b_shita * j % mod
b_tmp = b_ue * pow(b_shita,mod-2,mod) % mod
#print('j',j,b_ue,b_shita,b_ue/b_shita)
print((s-a_tmp-b_tmp)%mod)

Measured memory_bytes: 38896
#include <iostream>

using namespace std;

int main() {
	long long int x;
	long long int a = 0;

	cin >> x;

	for (int i = 0;x >= 500;i++) {
		x -= 500;
		a += 1000;
	}

	for (int i = 0;x >= 5;i++) {
		x -= 5;
		a += 5;
	}

	cout << a;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int n, i,cou, list[6] = {500, 100, 50, 10, 5, 1};
	
	while(scanf("%d", &n)){
		if(n == 0) break;
		cou = 0;
	n = 1000 - n;
	for( i = 0; 6 > i; i++){
		cou += n/list[i];
		n %= list[i];
		
		if(n == 0) break;
	}
	printf("%d\n", cou);
	}
	return 0;
}

Measured memory_bytes: 1028
#include<bits/stdc++.h>
#define fr(i,c,b) for(int i=c;i<b;i++)
#define si(x) int x; scanf("%d", &x)
#define sll(x) ll x; scanf("%lld", &x)
#define pi(x) printf("%d", x)
#define pll(x) printf("%lld", x)
#define nl printf("\n")
#define watch(x) cout << (#x) << " is " << (x) << endl
#define MAX 1000001

typedef long long int ll;

using namespace std;

int main()
{
    int c=0;
    string s; cin>>s; string t; cin>>t;
    for(int i=0;i<3;i++)
    {
        if(s[i]==t[i])
            c++;
    }
    cout<<c;
}

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

const int MOD = (int)1e9+7;

int main(){
	int N;
	cin >> N;
	vector<long long> A(N+1);
	for(int i=0;i<N+1;i++)	cin >> A.at(i);
	vector<long long> B(N);
	for(int i=0;i<N;i++)	cin >> B.at(i);
	
	long long count=0;
	long long pre=0;
	for(int i=0;i<N;i++){
		if(A.at(i)>=pre){
			A.at(i)-=pre;
			count+=pre;
		}
		else{
			count+=A.at(i);
			A.at(i)=0;
		}
		
		if(A.at(i)>=B.at(i)){
			count+=B.at(i);
			pre=0;
		}
		else{
			count+=A.at(i);
			pre=B.at(i)-A.at(i);
		}
	}
	if(A.at(N)>=pre){
		count+=pre;
	}
	else{
		count+=A.at(N);
	}
	cout << count << endl;
	
	return 0;
}


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

int main()
{
 int n,x,y;
  cin>>n>>x>>y;
  map<int,int>mp;
  for(int i=1;i<=n;i++)
  {
    for(int j=i+1;j<=n;j++)
    {
      mp[min(j-i,abs(x-i)+1+abs(y-j))]++;
    }
  }
  for(int i=1;i<n;i++)cout<<mp[i]<<endl;
  
  
}


Measured memory_bytes: 384
import std.stdio;
import std.string;
import std.conv;
import std.algorithm: canFind;

void main() {
	string[] inputs = split(readln());
	string A = inputs[0];
	string B = inputs[1];
	string C = inputs[2];
	if(A[$-1] == B[0] && B[$-1] == C[0]) "YES".writeln;
	else "NO".writeln;
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
    .map(|e| e.parse().ok().unwrap()).collect()
}

pub fn main() {
    loop {
        let v: Vec<i32> = read_vec();
        let (f,m,r) = (v[0], v[1], v[2]);
        let a = match (f,m,r) {
             (-1, -1, -1) =>  break,
             (-1, _, _) | (_, -1, _) => 'F',
             _ if 80 <= f + m => 'A',
             _ if 65 <= f + m && f + m < 80 => 'B',
             _ if 50 <= f + m && f + m < 65 => 'C',
             _ if 30 <= f + m && 50 <= r => 'C',
             _ if 30 <= f + m => 'D',
             _ => 'F',
        };
        println!("{}", a);
    }
}



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

int main()
{
    int n, k, d;
    cin >> n >> k;
    int a[n] = {0};
    int i, j, temp;

    for(i = 0; i < k; i++){
        cin >> d;
        for(j = 0; j < d; j++){
            cin >> temp;
            a[temp - 1]++;
        }
    }
    int count = 0;
    for(i = 0; i < n; i++){
        if(a[i] == 0)
            count++;
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 3632
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    D, T, S = LI()

    if T * S >= D:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 10052
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D;
  cin >> D;
  
  if (D == 25){
    cout << "Christmas" << endl;
  }
  else if (D == 24){
    cout << "Christmas Eve" << endl;
  }
  else if (D == 23){
  	cout << "Christmas Eve Eve" << endl;   
  }
  else {
    cout << "Christmas Eve Eve Eve" << endl;
  }
}
 

Measured memory_bytes: 256