akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
 
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define speed() cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
// #define exit(a, b) return cout << a, b;
 
// debugger
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#define debug(stuff) cout << #stuff << ": " << stuff <<endl
#define debugc(stuff) cout << #stuff << ": "; for(auto x: stuff) cout << x << " "; cout << endl;
// 
 
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define all(v) v.begin(), v.end() 
 
#define print(stuff) cout << stuff << endl
#define printc(stuff) for(auto x: stuff) cout << x << " "; cout << endl;
#define printPrec(stuff) cout << fixed << setprecision(15) << stuff << endl;
#define len length
#define ret0 return 0
#define ret return 
 
 
#define ll long long
#define ld long double
#define fi first
#define endl '\n'
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define fill(ar, x) memset(ar, x, sizeof ar)
 
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>
 
// typedef tree<ll,null_type,less<ll>,rb_tree_tag,
// tree_order_statistics_node_update> indexed_set;
 
#define inf (long long int) 1e18
#define eps 0.000001
#define mod 1000000007
#define mod1 998244353
#define MAXN (ll)2e5+5
#define N (1ll<<10)

void solve(){
    ll a, b, c, k;
    cin>>a>>b>>c>>k;
    ll ans = 0;
    ans += min(a, k);
    k -= min(a, k);
    if(k > 0){
        k -= min(b, k);
    }
    if(k > 0){
        ans -= min(k, c);
    }
    print(ans);
}
 
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifndef ONLINE_JUDGE
        start_routine();
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
 
    ll t = 1;
    // cin>>t;
    while(t--){
        solve();
    }
        
    #ifndef ONLINE_JUDGE
        end_routine();
    #endif
}


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

int main() {
	long int x,i;
	cin>>x;
	char s;
	for(i=0;i<x;i++)
	  {   cin>>s;
	     if(s=='Y')
	       {
	       	cout<<"Four";
	       	return 0;
	       }
	  }
	cout<<"Three"<<'\n';  
	return 0;
}

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

using namespace std;

#define mod 1000000007
#define int long long int
#define pii pair<int,int>
#define vpii vector<pii>
#define vi vector<int>
#define fi first
#define se second
#define psb push_back
#define ppb pop_back
#define fio ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
#define all(x) x.begin(),x.end()
#define endl "\n"

int ar[300];

int32_t main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		for(int i=0;i<n;i++)
			cin>>ar[i];
		string s;
		cin>>s;
		int ans=0;
		set<int,greater<int>> st;
		for(int i=n-1;i>=0;i--)
		{
			for(int e:st)
				ar[i]=min(ar[i],ar[i]^e);
			if(ar[i]==0)
				continue;
			if(s[i]=='0')
				st.insert(ar[i]);
			else
			{
				ans=1;
				break;
			}
		}
		cout<<ans<<endl;
	}
}


Measured memory_bytes: 3532
#include <bits/stdc++.h>
#define gc() getchar() 
#define LL long long
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define _rep(i, a, b) for (int i = (a); i >= (b); --i)
using namespace std;
const int N = 2e5 + 5;
int n, a[N];

inline int read() {
	int x = 0;
	char ch = gc();
	while (!isdigit(ch)) ch = gc();
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = gc();
	return x; 
}

int main() {
	ios::sync_with_stdio(false);
	n = read();
	rep(i, 1, n) a[i] = read();
	LL ans = 0;
	for (int i = 1, l = 1, r = 1, cur = 0; i <= n; ++i) {
		for (; !(cur & a[r]) && r <= n;) cur |= a[r++], ans += r - l;
		cur ^= a[l++];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(false);
  int n , a[100002] , i ;
  bool f = true;
  long long int sum = 0 , x;
  cin >> n;
  for(i=0;i<n;i++)
  {
    cin >> a[i];
    sum = sum + a[i];
  }
  long long int ch = ((long long)n*(n+1))/2;
  if(sum%ch)
    f = false;
  x = sum/ch;
  for(i=0;i<n;i++)
  {
    int d  = a[(i+1)%n] - a[i];
    if(x - d < 0) f = false;
    if((x-d)%n) f = false;
  }
  if(f)
    cout << "YES\n";
  else cout << "NO\n";
  return 0;
}


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

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)

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

int main(void) {
    int m, d, ans;
    ans = 0;
    cin >> m >> d;
    ans = m;
    if(d<m) ans--;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int s;
  scanf("%d",&s);
  int count[1000001] = {0};
  int num = 0;
  int a = s;
  while(1){
    num++;
    count[a] += 1;
    if(count[a] > 1) break;
    if(a % 2 == 0) a /= 2;
    else a = 3 * a + 1;
  }
  printf("%d\n",num);
  return 0;
}

Measured memory_bytes: 4096
#include <iostream>
#include <stdio.h>

#include <string>

#include <vector>
#include <list>
#include <map>

#include <algorithm>
#include <utility>

using namespace std;

int main(const int argc, const char **argv){
  int N;
  scanf("%d", &N);

  double ans = 0;
  for(int i = 0; i < N; i++){
    double x;
    char u[3];

    scanf("%lf %s", &x, u);

    if(string(u) == "JPY"){
      ans += x;
    }else if(string(u) == "BTC"){
      ans += x * 380000.0;
    }
  }

  printf("%f", ans);

  return 0;
}


Measured memory_bytes: 256
//...Bismillahir Rahmanir Rahim...
// Code by    Asad Bin Saber
// 02 05 2020

#include <bits/stdc++.h>

using namespace std;

// typedefs...
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;

// constants...
const double PI = acos(-1);

// defines...
#define MP make_pair
#define PB push_back
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b))
#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%lld", &a)
#define sll(a, b) scanf("%lld%lld", &a, &b)
#define slll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)

void task()
{
    ll a, b, n;

    cin >> a >> b >> n;

    ll mid = min(b-1, n);

    ll ans = (ll)(a*mid/b) - a*(ll)(mid/b);

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

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

    //clock_t tStart = clock();

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    task();

    //printf("Time taken: %.3fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC);

    return 0;
}



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

int vector_finder(std::vector<int> vec, int number)
{
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance(vec.begin(), itr);
  if (index != vec.size())
  { // 発見できたとき
    return 1;
  }
  else
  { // 発見できなかったとき
    return 0;
  }
}

int main()
{
  int N, K;

  cin >> N >> K;

  int count = N;

  vector<int> T(N);

  for (int i = 0; i < N; i++)
  {
    T.at(i) = i + 1;
  }

  for (int i = 0; i < K; i++)
  {
    int d;
    cin >> d;
    vector<int> A(d);
    for (int j = 0; j < d; j++)
    {
      cin >> A.at(j);
    }
    for (int j = 0; j < N; j++)
    {
      if (vector_finder(A, T.at(j)) == 1)
      {
        count--;
        T.at(j) = -1;
      }
    }
  }

  cout << count << endl;
}


Measured memory_bytes: 3636
/*
  NAME : RISHABH SINGH
  INSTITUTION : DELHI TECHNOLOGICAL UNIVERSITY
*/
#include "bits/stdc++.h"
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pii pair<int, int>
#define bi __builtin_inf()
#define ll long long
#define mp make_pair
#define ss second
#define pb push_back
#define ff first
#define speed_cubing ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define um unordered_map
#define us unordered_set
#define bp __builtin_popcount
#define ld long double
#define rep(n) for (int i = 0; i < n; i++)
#define pll pair<ll, ll>
#define mx = 1e18;
#define lb(v, val) (lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (upper_bound(v.begin(), v.end(), val) - v.begin())
#define PI 3.1415926535
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
#define sz(v) (int)v.size()
#define endl '\n'
const int N = 1e4;
const int mod = 998244353;
ll mul_inv(ll a,ll b = mod) {ll t1=a,t2=b,t3,v1=1,v2=0,v3;while(t2!=1){ll x=t1/t2;t3=t1-x*t2;v3=v1-x*v2;t1=t2,t2=t3;v1=v2,v2=v3;}return(v2+b)%b;}



int32_t main(){
   
   speed_cubing 
   
   int k,a,b;
   cin>>k>>a>>b;

   for(int i=1;i<=1000;i++){
      if(k*i<=b && k*i>=a){
         cout<<"OK";
         return 0;
      }
   }

   cout<<"NG";
    
   return 0;
}


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
#define CVector CPoint
#define INF 0x3f3f3f3f
#define MAXN 1e5
const LL mod=1e9+7;
const double PI=acos(-1.0);
const double EPS=1e-10;
inline int readint(){int sum=0;char c=getchar();bool f=0;while(c<'0'||c>'9'){if(c=='-')f=1;c=getchar();}while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}if(f) return -sum;return sum;}
inline LL readLL(){LL sum=0;char c=getchar();bool f=0;while(c<'0'||c>'9'){if(c=='-') f=1;c=getchar();}while(c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}if(f) return -sum;return sum;}

LL quickpowmod(LL x,LL y,LL mo){
    LL ret=1;
    while(y){
        if(y&1){
            ret=ret*x;
        }
        x=x*x;
        y>>=1;
    }
    return ret;
}

int main(){ios_base::sync_with_stdio(0);cin.tie(0);
    LL n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    LL s=d-c;
    n--;
    LL t=abs(a-b);
    LL k=0,p,q;
    if(c){
        k=t/c;
        if((n-k)%2) k++;
        p=k+(n-k)/2;
        q=(n-k)/2;
    }else{
        p=n;
    }
    k*=c;
    //cout<<s<<" "<<p<<" "<<q<<endl;
    if(t>=k&&t-k<=p*s) cout<<"YES"<<endl;
    else if(t<k&&(k-t<=q*s)) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

//cout.setf(ios::fixed);
//cout<<fixed<<setprecision(10)<<s<<endl;


Measured memory_bytes: 256
#include <iostream>
#include "bits/stdc++.h"
using namespace std;
#define print(x) cout<<x<<endl;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a) for(int i=0;i<a;i++)
#define debug int debug = 0;
#define RREP(i,a) for(int i=a-1;i>=0;i--)
#define rrep(i,a,b) for(int i=a-1;i>=b;i--)
#define printall(n,array) {for(int i=0;i<n;i++){cout<<array[i]<<" ";}cout<<endl;}
#define U() cout<<endl;
typedef long long ll;
typedef pair<int, int> PI;
typedef pair<int, PI> V;
typedef vector<int> VE;
const ll mod = 1000000007; //10^9+7

int main() {
    int x, y, s;
    int withxTaxa, withxTaxb, withoutTaxs, withoutTaxa, withoutTaxb, withyTaxa, withyTaxb;

    while(true){
        cin >> x >> y >> s;
        int ans = 0;
        int sTax = (s * x) / (100 + x);
        if(x == 0 && y == 0 && s == 0)break;
        withoutTaxs = s - sTax;
        rep(i, 1, withoutTaxs + 1){
            withoutTaxa = i;
            int cnt = 0;
            REP(i, 3){
                if(cnt == 0){
                    withoutTaxb = withoutTaxs - withoutTaxa - 1;
                }else if(cnt == 1){
                    withoutTaxb = withoutTaxs - withoutTaxa;
                }else if(cnt == 2){
                    withoutTaxb = withoutTaxs - withoutTaxa + 1;
                }
                if(withoutTaxb == 0)continue;
                cnt++;
                withxTaxa = withoutTaxa * (100 + x) / 100;
                withxTaxb = withoutTaxb * (100 + x) / 100;
                /*
                if(withoutTaxa == 13){
                    print(withoutTaxs);
                    print(withoutTaxa << " " << withoutTaxb << " " << withxTaxa << " " << withxTaxb);
                }
                */
                if(withxTaxa + withxTaxb == s){
                    withyTaxa = withoutTaxa * (100 + y) / 100;
                    withyTaxb = withoutTaxb * (100 + y) / 100;
                    ans = max(ans, withyTaxa + withyTaxb);
//                    print(withxTaxa << " " << withxTaxb << " " << ans);
                }
            }
        }
        print(ans);
    }
}


Measured memory_bytes: 3016
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define pn(s) cout << (#s) << " " << (s) << endl

const ll mod = 1e9 + 7;
const ll inf = 1e18;

// カウント
ll C[4000][4000] = {};

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

    // input
    ll N, K;
    cin >> N >> K;

    ll K2 = 2 * K;
    ll K4 = 4 * K;

    FOR(i, 0, N){
        ll x, y;
        char c;
        cin >> x >> y >> c;

        // すべてBに変換する
        if(c=='W'){
            x += K;
            c = 'B';
        }

        // 2K x 2K の領域に収める
        x = x % (2*K);
        y = y % (2*K);

        C[y][x]++;
    }

    // 4K x 4Kの領域にコピー
    FOR(i, 0, K2){
        FOR(j, 0, K2){
            C[j+K2][i] = C[j][i];
            C[j][i+K2] = C[j][i];
            C[j+K2][i+K2] = C[j][i];
        }
    }

    // Cをそのまま累積和にする

    // 1. 横の累積和
    FOR(i, 0, K4){
        FOR(j, 1, K4){
            C[i][j] += C[i][j-1];
        }
    }

    // 2. 縦の累積和
    FOR(j, 0, K4){
        FOR(i, 1, K4){
            C[i][j] += C[i-1][j];
        }
    }

    ll count_max = 0;
    // 左下の点を2K, 2Kの領域で動かしながらそれぞれカウントする
    FOR(i, 0, K2){
        FOR(j, 0, K2){
            // 右上のカウント
            ll count0 = C[i+K2][j+K2] - C[i+K][j+K2] - C[i+K2][j+K] + C[i+K][j+K];
            // 左下のカウント
            ll count1 = C[i+K][j+K] - C[i+K][j] - C[i][j+K] + C[i][j];
            ll count = count0 + count1;

            count_max = max(count_max, count);
        }
    }

    p(count_max);
    
    return 0;
}

Measured memory_bytes: 125312
#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main(){
	int n,p,q;
	while(1){
		cin>>n>>p>>q;
		if(!(n|p|q)) break;
		int k,s,e;
		int d[24*60+1]={};
		rep(i,0,n){
			cin>>k;
			rep(j,0,k){
				cin>>s>>e;
				int ts=s/100*60+s%100;
				int te=e/100*60+e%100;
				d[ts]++;
				d[te]--;
			}
		}
		rep(i,1,24*60+1){
			d[i]+=d[i-1];
		}
		int tp=p/100*60+p%100;
		int tq=q/100*60+q%100;
		int now=0,ans=0;
		rep(i,tp,tq){
			if(d[i]!=n){
				now++; ans=max(ans,now);
			}else now=0;
		}
		o(ans);
	}
}

Measured memory_bytes: 1172
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;
struct dat{int x,y,t;};
const int Base = 250;
int sx,sy,gx,gy;
int mp[501][501];
int lx,ly;
int dx[7]={0,1,1,0,-1,-1,0};
int dy[2][7]={{1,0,-1,-1,-1,0,0},{1,1,0,-1,0,1,0}};
int D[501][501][6];

bool onmp(int x,int y){return abs(x-Base)<=lx&&abs(y-Base)<=ly;}

int bfs(){

  for(int i=0;i<501;i++)
    for(int j=0;j<501;j++) 
      for(int k=0;k<6;k++) D[i][j][k] = INF;
  
  
  deque<dat> Q;
  Q.push_front((dat){sx,sy,0});
  D[sy][sx][0] = 0;

  while(!Q.empty()){

    dat p = Q.front();Q.pop_front();
    int x = p.x,y = p.y,t = p.t;

    int cost = D[y][x][t];
    int I = abs((x-Base)*(y-Base)*t)%6;

    if(x==gx&&y==gy) return cost;

    for(int i=0;i<7;i++){
      int nx = x+dx[i];
      int ny = y+dy[x%2][i];
      int nt = (t+1)%6;
      int ncost = cost+(i!=I);
      if(!onmp(nx,ny)||mp[ny][nx]||D[ny][nx][nt]<=ncost)continue;
      if(i!=I)Q.push_back((dat){nx,ny,nt});
      else Q.push_front((dat){nx,ny,nt});
      D[ny][nx][nt] = ncost;
    }
  }
  return -1;
}
  

int main(){
  cin>>sx>>sy>>gx>>gy;
  sx+=Base,sy+=Base;
  gx+=Base,gy+=Base;

  int n;
  cin>>n;
  for(int i=0,x,y;i<n;i++) cin>>x>>y,mp[y+Base][x+Base] = 1;
  cin>>lx>>ly;
  cout<<bfs()<<endl;
  return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    long long sum = 0;
    for (int i = 1; i <= N; ++i) {
        if (i % 3 != 0 && i % 5 != 0) {
            sum += i;
        }
    }
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define finp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
long long int n,ans;
string s;
map<char,int> mp;
int main()
{
    finp;
    cin>>s;
    n=s.length();
    for(int i=0;i<n;i++)
    {
        ans+=(i-mp[s[i]]);
        mp[s[i]]++;
    }
    ans++;
    cout<<ans<<endl;
return 0;
}

Measured memory_bytes: 720
#include <algorithm>
#include <bitset>
//#include <boost/multiprecision/cpp_int.hpp>
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <sstream>
#include <stdio.h>
#include <string>
#include <tuple>
#include <vector>
#include<iomanip>
// namespace mp = boost::multiprecision;
using namespace std;
using ull = unsigned long long;
using ld = long double;
// using ll = boost::multiprecision::cpp_int;
using ll = long long;
#define FOR(i, N) for(ll i = 0; i < N; ++i)

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
// using int = ll;
ll gcd(ll m, ll n) {
    if(n == 0)
        return abs(m);
    return (gcd(n, m % n));
}
void putYN(bool b) {
    if(b) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}
void swap(ll &a, ll &b) {
    ll tmp = a;
    a = b;
    b = tmp;
}
ll combi(ll n, ll k) {
    ll r = 1, rr = 1;
    for(ll i = 0; i < k; ++i) {
        r *= (n - i);
        rr *= (i + 1);
        // r %= 1000000007;
        // rr %= 1000000007;
    }
    r /= rr;
    // r %= 1000000007;
    return r;
}
int main() {
  const double PI=3.14159265358979323846;
  double a,b,x;
  cin>>a>>b>>x;
  x/=a;
  double c2 = a*a+b*b;
  if(a*b/2==x){
    cout<<std::setprecision(10)<<90-abs(atan(a/b))/PI*180.0<<endl;
  }else if(a*b/2>x){
    double t=(x*2)/b;
    cout<<std::setprecision(10)<<90-abs(atan(t/b))/PI*180.0<<endl;
  }else{
    
    double xx = x-a*b/2;
    double d1=abs(atan(a/b));
    double h=xx*2/sqrt(c2);
    double bb = xx*2/a;
    double bbb = b-bb;
    cout<<std::setprecision(10)<<abs(atan(bbb/a))/PI*180.0<<endl;
    
    
  }
  return 0;
}


Measured memory_bytes: 256
(x,y,z,k),a,b,c=$<.map{|s|s.split.map &:to_i}
ab=a.product(b).map{|x,y|x+y}.sort.reverse[0,k]
abc=ab.product(c).map{|x,y|x+y}.sort.reverse[0,k]
p *abc

Measured memory_bytes: 286092
#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <ios>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>
#define itn int
#define retrun return
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
using namespace std;
typedef long long llong;
typedef pair<int, int> pii;
llong gcd(llong a, llong b) {
	if (a < b) std::swap(a, b);
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}
llong lcm(llong a, llong b) {
	llong g = gcd(a, b);
	return a * b / g;
}
//ここまで共通

int N;
int main() {
	cin >> N;
	if (N % 2 == 1) cout << N / 2 + 1;
	else cout << N / 2;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <sstream>
#include <set>
#include <map>
#define LLMAX 9223372036854775807

using namespace std;
using ll = long long;

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

	ll ret = 1;
	for (ll i = 0; i < argN; ++i) {
		ret *= (i + 1);
		if (ret >= 1000000000LL + 7LL) {
			ret %= (1000000000LL + 7LL);
		}
	}

	cout << ret << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<Int> A(N); for (auto &a : A) cin >> a;
    Int sum = accumulate(begin(A), end(A), 0LL);
    Int psum = 0;
    Int ans = 1e18;
    for (int i = 0; i < N; i++) {
        psum += A[i];
        ans = min(ans, abs(sum - 2 * psum));
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 1792
<?php
    $input_line = trim(fgets(STDIN));
    
    $num = explode(" ",$input_line);
    
    $x = ($num[0]);

    // printf("%.6f",pi()*$x*$x);
    // echo " ";
    // printf("%.6f",2*pi()*$x);
    // echo "\n";
    
    printf("%.6f %.6f",pi()*$x*$x,2*pi()*$x);
?>


Measured memory_bytes: 9200
#include <bits/stdc++.h>
using namespace std;
int main(){
  int D,A=26;
  scanf("%d",&D);
  vector<int> C(A);
  for(int i=0;i<A;i++){
    scanf("%d",&C[i]);
  }
  vector<vector<int>> S(D,vector<int>(A));
  for(int i=0;i<D;i++){
    for(int j=0;j<A;j++){
      scanf("%d",&S[i][j]);
    }
  }
  vector<int> X(A,0);
  vector<int> XX(A,0);
  vector<vector<pair<int,int>>> Q(D,vector<pair<int,int>>(A));
  for(int i=0;i<D;i++){
    for(int j=0;j<A;j++){
      X[j]+=C[j];
      XX[j]+=X[j];
      Q[i][j]=make_pair(-S[i][j]-X[j],j);
    }
    sort(Q[i].begin(),Q[i].end());
    XX[Q[i][0].second]-=X[Q[i][0].second];
    X[Q[i][0].second]=0;
  }
  vector<vector<int>> P(D,vector<int>(A));
  for(int i=0;i<D;i++){
    for(int j=0;j<A;j++){
      P[i][j]=Q[i][j].second;
    }
  }
  int SC=0,SC2;
  for(int i=0;i<D;i++){
    SC+=S[i][P[i][0]];
  }
  vector<int> Y;
  vector<int> YY;
  int Z;
  int SX,SY;
  for(int l=0;l<123;l++){
    for(int k=0;k<25;k++){
      for(int i=0;i<D;i++){
        SC2=SC;
        YY=XX;
        Y=X;
        SC2-=S[i][P[i][0]];
        SC2+=S[i][P[i][k+1]];
        for(int j=0;j<A;j++){
          Y[j]=0;
        }
        YY[P[i][0]]=0;
        YY[P[i][k+1]]=0;
        for(int j=0;j<D;j++){
          if(i==j){
            Z=P[j][k+1];
          }else{
            Z=P[j][0];
          }
          Y[P[i][0]]+=C[P[i][0]];
          Y[P[i][k+1]]+=C[P[i][k+1]];
          Y[Z]=0;
          YY[P[i][0]]+=Y[P[i][0]];
          YY[P[i][k+1]]+=Y[P[i][k+1]];
        }
        SX=0;
        SY=0;
        for(int j=0;j<A;j++){
          SX+=XX[j];
          SY+=YY[j];
        }if(SC2-SY>SC-SX){
          P[i].insert(P[i].begin(),P[i][k+1]);
          P[i].erase(P[i].begin()+k+2,P[i].begin()+k+3);
          XX=YY;
          SC=SC2;
        }
      }
    }
  }
  /*
  int uku=0;
  for(int i=0;i<A;i++){
    X[i]=0;
  }
  for(int i=0;i<D;i++){
    uku+=S[i][P[i][0]];
    for(int j=0;j<A;j++){
      X[j]+=C[j];
    }
    X[P[i][0]]=0;
    SX=0;
    for(int i=0;i<A;i++){
      SX+=X[i];
    }
    uku-=SX;
  }
  cout<<uku<<endl;
  */
  for(int i=0;i<D;i++){
    cout<<P[i][0]+1<<"\n";
  }
}

Measured memory_bytes: 3892
def judge(x):
    for i in range(2, x):
        t = x
        while t != 1:
            if t % i == 0:
                t //= i
            else:
                break
            if t == 1:
                return True
    return False


x = int(input())

ans = 1

for i in range(x, 1, -1):
    if judge(i):
        ans = i
        break

print(ans)


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

vector<unsigned long long> next_p_mod(unsigned N, long long mod) { //next_permutation
  vector<unsigned long long> Next_p(N);
  unsigned long long Next_p_buff = 1;
  for (int i = 0; i < N; i++)
  {
    Next_p_buff *= (i + 1) % mod;
    Next_p.at(i) = Next_p_buff % mod;
  }
  return Next_p;
}
unsigned long long modpow(unsigned long long a, unsigned long long n, unsigned long long mod) {
   unsigned long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
void comb(vector<vector <long long int> > &v,unsigned long long mod) {
  //vector<入れたい型> v(配列の個数(x),vector<入れたい型> (配列の個数,初期値));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int k = 1; k < v.size(); k++) {
    for (int j = 1; j < k; j++) {
      v[k][j] = (v[k - 1][j - 1] + v[k - 1][j])%mod;
    }
  }
}
// a^{-1} mod を計算する
unsigned long long modinv(unsigned long long a, unsigned long long mod) {
    return modpow(a, mod - 2, mod);
}


int main() {
  long long N,L;
  bool flag=0;
  cin >> N>>L;
    long long L_sum=L,L_max=L;
  long long L_low;
  vector<long long> Li(N);  
  for(int i=1;i<N;i++){
    L_max+=1;
    //cout<<"max:"<<L_max<<endl;
    L_sum+=L+i;
  }
  if(L<0&&L_max>=0){
    L_low=0;
  }else if(L<0&&L_max<0){
    L_low=L_max;
  }else if(L>=0){
    L_low=L;
  }
  cout<<L_sum-L_low<<endl;
  return 0;
}


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

int main(){
  int a,b;
  cin >> a >> b;
  int n =  b-a;
  int tall = 0;
  for(int i = 0; i <= n; i++){
    tall += i;
  }
  int x = tall - b;
  cout << x << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 2e5+10;
LL num[maxn];
int main()
{
   double L;
   cin >> L;
   cout << setprecision(12) << fixed<< L*L*L/27 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ssd ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define debug_x(x) cout<< #x <<"---> : "<<x<<endl;
#define debug_ve(x) for(auto it: x) cout<<it<<" ";
#define rep(i,a,n) for (int i=a;i<n;i++)
#define _rep(i,a,n) for (int i=a;i<=n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef vector<int> VI;
typedef pair<int,int> PII;
typedef double db;
//std::mt19937 mrand(random_device{}());
//int rnd(int x) { return mrand() % x ; }
const ll mod=1e7;
ll ksm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

/***********************/
int a[400040];
int main(){
    ssd;
    int k,n;cin >> k >> n;
    rep(i,0,n) cin>>a[i];
    int m = a[n-1] - a[0];
    rep(i,1,n) m = min(m,k-a[i] +a[i-1]);
    cout<<m<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()
{  ios::sync_with_stdio(false);
   cin.tie(0);  
   int n;
   cin>>n;
   vector<int>v(n);
   for(int i=0;i<n;i++) cin>>v[i];
     int d1=0,d2=abs(v[1]-v[0]),ans=0;
     if(n==1) {cout<<d1; return 0;}
     if(n==2) {cout<<d2; return 0;}
     for(int i=2;i<n;i++){
         ans=min(abs(v[i]-v[i-1])+d2,abs(v[i]-v[i-2])+d1);
         d1=d2;
         d2=ans;
     }
     cout<<ans;
     return 0;
}


Measured memory_bytes: 3692
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<bits/stdc++.h>
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF 1e18
using ll = long long;
using namespace std;
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; }

int main(){
  ll a,b;  cin >> a >> b;
  cout << (a*b)/__gcd(a,b);
}


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

int n, m;
bool ac[100000];
int pn[100000];
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int k;
    string s;
    cin >> k >> s;
    --k;
    if (s == "AC") {
      ac[k] = true;
    } else {
      if (ac[k]) continue;
      ++pn[k];
    }
  }
  
  long sum = 0;
  int cnt = 0;
  for (int i = 0; i < n; ++i) {
    if (ac[i]) {
      sum += pn[i];
      ++cnt;
    }
  }
  cout << cnt << ' ' << sum << endl;
}

Measured memory_bytes: 768
// https://atcoder.jp/contests/abc089/tasks/abc089_a
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << n / 3 << endl;
    return 0;
}


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

#define int long long
#define pii pair<int, int>
#define pb push_back

bool ispal(string s){
    string t = s;
    reverse(s.begin(), s.end());
    return s == t;
}
signed main(){

    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    
    string s;
    cin >> s;
    int n = s.size();
    string t = s.substr(0,(n-1)/2);
    string p = s.substr((n + 3)/2 - 1);
    bool ans = ispal(s)&ispal(t)&ispal(p);
    if(ans){
        cout << "Yes";
    }
    else{
        cout << "No";
    }

    return 0;
}

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

int main() {
  int a, num;
  num = 0;

  cin >> a;

  for(int i = a; i != 0; i /= 10){
    if( (i % 10) == 1)
      num++;
  }

  cout << num << endl;

  return 0;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

const int mod = 1000000007;
class mint {
    long long x;
public:
    mint(long long x=0) : x((x%mod+mod)%mod) {}
    mint operator-() const { 
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }
 
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};

int main(){
    string L;    
    cin >> L;
    ll N = L.size();
    vector<ll> v(N);
    rep(i,N){
        v[i] = L[i] - '0';
    }
    vector<vector<mint>> dp(N+1, vector<mint> (2));
    mint ans = 0;
    dp[0][0] = 1; 
    rep(i,N){
        if(v[i]==0){
            dp[i+1][1] += dp[i][1]*3;
            dp[i+1][0] += dp[i][0];
            //ans += dp[i][1]*mint(2);
            //ans += dp[i][1] + dp[i][0];
        }else{
            dp[i+1][1] += dp[i][1]*3 + dp[i][0];
            dp[i+1][0] += dp[i][0]*2;
            //ans += dp[i][1]*mint(2) + dp[i][0]*mint(2); 
            //ans += dp[i][1] + dp[i][0]; 
        }
    }
    //cout << ans+mint(1) << endl;
    cout << (dp[N][0] + dp[N][1]) << endl;
}

Measured memory_bytes: 9604
import bisect
from collections import deque

N = int(input())
A = [int(input()) for _ in range(N)]

dp = deque()
dp.append(A[0])

for i in range(1, N):
    ind = bisect.bisect_left(dp, A[i])

    if ind == 0:
        dp.appendleft(A[i])
    elif dp[-1] < A[i]:
        dp[-1] = A[i]
    else:
        dp[ind-1] = A[i]

print(len(dp))

Measured memory_bytes: 13936
package main

import (
	"fmt"
)

func main() {

	var N int
	var K int

	var R int
	R = 1

	fmt.Scan(&N)
	fmt.Scan(&K)

	for i := 0; i < N; i++ {

		if R < K {
			R = R * 2
		} else {
			R = R + K
		}

	}

	fmt.Println(R)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define ppll pair <pll, pll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#pragma 03
using namespace std;
using namespace __gnu_pbds;
ll n; 
ll a[200005];
int main(){
	cout << fixed << setprecision(10);
	fastio;
	ll n, k; cin >> n >> k;
	ll cursum = 0, maxsum = 0;
	for (ll i = 0; i<n; i++){
		cin >> a[i];
		if (i < k) cursum += a[i];
		else{
			cursum += a[i];
			cursum -= a[i - k];
		}
		maxsum = max(maxsum, cursum);
	}
	double ans = maxsum + k; ans /= 2.0;
	cout << ans << endl;
	return 0;	
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S, T;
    cin >> S >> T;
    
    vector<int> a;
    
    for (auto &i : S) { a.emplace_back(0); }
    
    for (int i=0; i<S.size(); ++i) {
         for (int j=0; j<i+1; ++j) {
             if ((S[i] == T[a[j]] || S[i] == '?') && a[j] > -1) {
                 a[j] += 1;
             } else {
                if (a[j] < T.size()) {
                     a[j] = -1;
                }
             }
         }
    }
    
    int l = -1;
    for (int i=0; i<S.size(); ++i) {
        if (a[i] != -1 && a[i] >= T.size()) {
            l = i;
        }
    }
    
    if (l > -1) {
        string t = "";
        for (int i=0; i<S.size(); ++i) {
            if (i >= l && i - l < T.size()) {
                t += T[i - l];
            } else {
                if (S[i] == '?') {
                    t += "a";
                } else {
                    t += S[i];
                }
            }
        }
        cout << t << endl;
    } else {
        cout << "UNRESTORABLE" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <cstring>
#include<vector>
#include <list>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#include <map>
#include <tuple>
#include <string>
#define FORi(N) for(int i=0;i<N;++i)
#define FORj(N) for(int j=0;j<N;++j)
#define FORk(N) for(int k=0;k<N;++k)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
void putYN(bool b){
  if(b){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}
void swap(ll &a,ll &b){
  ll tmp=a;
  a=b;
  b=tmp;
}
int main(){
  string S;
  cin>>S;
  if(S[0]==S[1]||
     S[1]==S[2]||
     S[2]==S[3]){
    cout<<"Bad"<<endl;
  }else{
    cout<<"Good"<<endl;
  }
  return 0;
  
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mit map<int,int>::iterator
#define sit set<int>::iterator
#define itrm(g,x) for(mit g=x.begin();g!=x.end();g++)
#define itrs(g,x) for(sit g=x.begin();g!=x.end();g++)
#define ltype int
#define rep(i,j,k) for(ltype(i)=(j);(i)<=(k);(i)++)
#define rap(i,j,k) for(ltype(i)=(j);(i)<(k);(i)++)
#define per(i,j,k) for(ltype(i)=(j);(i)>=(k);(i)--)
#define pii pair<int,int>
#define fi first
#define se second
#define mpr make_pair
#define pb push_back
#define fastio ios::sync_with_stdio(false)
const int inf=0x3f3f3f3f,mod=1000000007;
const double pi=3.1415926535897932,eps=1e-6;
int n,w,b,tag,cnt[100005];vector<int> v[100005],path;
void dfs(int x,int fa){
    path.pb(x);
    if(x==n){
        int len=path.size();
        tag=path[(len+1)/2];
    }
    rap(i,0,v[x].size())
    if(fa!=v[x][i]) {
        dfs(v[x][i],x);
        cnt[x]+=cnt[v[x][i]];
    }
    path.pop_back();
}
int main()
{
    scanf("%d",&n);
    rap(i,1,n){
        int t1,t2;
        scanf("%d%d",&t1,&t2);
        v[t1].pb(t2);v[t2].pb(t1);
    }
    rep(i,1,n) cnt[i]=1;
    dfs(1,0);
    puts(cnt[tag]*2<n?"Fennec":"Snuke");
    return 0;
}

Measured memory_bytes: 11256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {
	string s;
	cin>>s;
	for(int i=0;i<s.length()-7;i++){
		if(s.substr(i,1)=="F"&&s.substr(i+1,1)=="E"&&s.substr(i+2,1)=="S"&&s.substr(i+3,1)=="T"&&s.substr(i+4,1)=="I"&&s.substr(i+5,1)=="V"&&s.substr(i+6,1)=="A"&&s.substr(i+7,1)=="L"){
			s.erase(s.length()-8,8);
			break;
		}
	}
	cout<<s<<endl;
	return 0;
}



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

using lint = long long;

int find_first(int n) {
	int k = log10(n);
	n /= pow(10, k);
	return n;
}

int find_last(int n) {
	return n % 10;
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n;
    cin >> n;
    map<pair<int,int>, int> mapa;
    for (int i = 1; i <= n; ++i) {
    	mapa[{find_first(i), find_last(i)}]++;
    }
    int res = 0;
    for (int i = 1; i <= n; ++i) {
    	res += mapa[{find_last(i), find_first(i)}];
    }
    cout << res << '\n';
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.stream.Collectors;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		int m= sc.nextInt();
		int[] x = sc.nextIntArray(m);
		Arrays.sort(x);
		if(n >= m) {
			System.out.println(0);
			return;
		}
			
		int[] abs = new int[m-1];
		Map<Integer, Integer> map = new HashMap<>();
		for(int i = 0; i < m-1; i++) {
			map.put(i, x[i+1] - x[i]);
		}
		
		List<Entry<Integer, Integer>> list = map.entrySet().stream()
				.sorted(Comparator.comparingInt(Entry::getValue))
				.collect(Collectors.toList());
		int sum = 0;
		for(int i =m-2; i >m-1-n; i--)
			sum += list.get(i).getValue();
		System.out.println(x[m-1] - x[0] - sum);
	}
}

class Scanner {
	private static final int SPACE = (int)' ';
	private static final int LINE_END_0 = 13;
	private static final int LINE_END_1 = 10;
	private static final int BEFORE = -1;
	private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	
	public String next(){
		StringBuilder sb = new StringBuilder();
		
		int length = BEFORE;
		readLoop: while(true) {
			try {
				int value = br.read();
				switch(value) {
				case LINE_END_1:
					if(length == BEFORE)
						break;
					
					if((int)sb.charAt(length) == LINE_END_0)
						sb.deleteCharAt(length);
				case SPACE:
					break readLoop;
				}
				sb.append((char)value);
				length++;

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		return sb.toString();
	}
	
	public String[] nextArray(int length) {
		String[] array = new String[length];
		for(int i = 0; i < length; i++)
			array[i] = next();
		return array;
	}
	
	public double nextDouble() {
		return Double.parseDouble(next());
	}
	
	public double[] nextDoubleArray(int length) {
		double[] array = new double[length];
		for(int i = 0; i < length; i++)
			array[i] = nextDouble();
		return array;
	}
	
	public int nextInt() {
		return Integer.parseInt(next());
	}
	
	public int[] nextIntArray(int length) {
		int[] array = new int[length];
		for(int i = 0; i < length; i++)
			array[i] = nextInt();
		return array;
	}
	
	public long nextLong() {
		return Long.parseLong(next());
	}
	
	public long[] nextLongArray(int length) {
		long[] array = new long[length];
		for(int i = 0; i < length; i++)
			array[i] = nextLong();
		return array;
	}
	
	public boolean ready() {
		try {
			return br.ready();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
}


Measured memory_bytes: 45912
/**
 *     author: qodjf
 *     created: 04.17.2020 01:37:18
 */
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

int main() {
  ll a, b, x;
  cin >> a >> b >> x;
  a = (a + x - 1) / x * x;
  b = b / x * x;
  ll ans = (b - a) / x + 1;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define el "\n"
#define sp " "
typedef long long ll;
ll b[3][3];
main()
{
	ll a[3][3];
	for(ll i=0;i<3;i++)
	for(ll j=0;j<3;j++)
	cin>>a[i][j];
	ll n,x;
	cin>>n;
for(ll i=0;i<n;i++)
{
	cin>>x;
	for(ll i=0;i<3;i++)
	for(ll j=0;j<3;j++)
	if(a[i][j]==x)
	b[i][j]=1;
}
ll y=0;
for(ll i=0;i<3;i++)
{
	if(b[i][0]&&b[i][1]&& b[i][2])
	y=1;
}
for(ll i=0;i<3;i++)
{
	if(b[0][i]&&b[1][i]&& b[2][i])
	y=1;
}

if(b[0][0]&&b[1][1]&& b[2][2])	
y=1;
if(b[0][2]&&b[1][1]&& b[2][0])
y=1;
if(y)
cout<<"Yes";
else
cout<<"No";
	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	vector<long long> v;
	long long a,b,c;
	long long d;
	scanf("%lld%lld%lld",&a,&b,&c);
	if(a%2==1&&b%2==1&&c%2==1){
		v.push_back(a);
		v.push_back(b);
		v.push_back(c);
		sort(v.begin(),v.end());
		d=v[0]*v[1];
	}else d=0;
	printf("%lld",d);
}

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(), m = sc.nextInt(), k = sc.nextInt();
        long ans = 0;
        final int MOD = 998244353;

        long[] pow_mminus1 = new long[n];   //先に計算しとく。
        long[] nminus1Cx = new long[n];
        pow_mminus1[0] = m;
        nminus1Cx[0] = 1;
        for(int i=1;i<n;i++){
            pow_mminus1[i] = pow_mminus1[i-1] * (m-1) % MOD;
            nminus1Cx[i] = nminus1Cx[i-1] * (n-i) % MOD;
            nminus1Cx[i] = modDivision(nminus1Cx[i], i, MOD);
        }

        for(int i=0;i<=k;i++){  //隣り合うブロックの組であって同じ色で塗られている組がi組であるとき、
            long ans_ = pow_mminus1[n-i-1] * nminus1Cx[i];
            ans += ans_;
            ans %= MOD;
        }
        System.out.println(ans);
    }

    private static long combination(long n, long k){
        if(k <= 0 || n <= 0 || n <= k){
            return 1;
        }
        return factorial(n) / (factorial(k) * factorial(n - k));
    }

    private static long combination(long n, long k, long mod){
        if(k <= 0 || n <= 0 || n <= k){
            return 1;
        }
        return factorial(n, mod) / (factorial(k, mod) * factorial(n - k, mod)) % mod;
    }

    private static long factorial(long l){
        long ans = 1;
        while(l > 0){
            ans *= l;
            l--;
        }
        return ans;
    }

    private static long factorial(long l, long mod){
        long ans = 1;
        while(l > 0){
            ans *= l;
            ans %= mod;
            l--;
        }
        return ans;
    }

    private static long modDivision(long a, long b, long mod){
        return a * modInv(b, mod) % mod;
    }

    private static long modInv(long a, long mod){   // a÷b%p → a * modInv(b, p) % p
        exEuclid(a, mod);
        EUCX %= mod;
        return EUCX >= 0 ? EUCX : EUCX + mod;
    }

    static long EUCX, EUCY;
    private static long exEuclid(long a, long b){
        if(b == 0){
            EUCX = 1;
            EUCY = 0;
            return a;
        }
        long d = exEuclid(b, a%b);
        long px = EUCX;
        EUCX = EUCY;
        EUCY = px;
        EUCY -= a/b*EUCX;
        return d;
    }
}


Measured memory_bytes: 30408
# coding: utf-8

while True:
	n = int(raw_input())
	if n == 0:
		break
	else:
		henkan = []
		for i in range(n):
			henkan.append(raw_input().split())
		#print(henkan)

		m = int(raw_input())
		ans = ""
		for i in range(m):
			c = raw_input().split()
			for j in range(len(henkan)):
				if c[0] == henkan[j][0]:
					#print("{:} -> {:}".format(henkan[j][0], henkan[j][1]))
					c[0] = henkan[j][1]
					break
			ans += c[0]

		print(ans)

Measured memory_bytes: 7732
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int n;
	long long d;
	cin >> n >> d;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		long long x, y;
		cin >> x >> y;
		if (x * x + y * y <= d * d) {
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3220
//Moh_K_Imar .......
//26/08/2020  ... 3,27.
//Ya Rab....
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
int main(){
    string a;
    cin>>a;
    if(a=="Sunny")cout<<"Cloudy"<<endl;
    else if(a=="Cloudy")cout<<"Rainy"<<endl;
    else if(a=="Rainy")cout<<"Sunny"<<endl;

    return 0;
}



Measured memory_bytes: 3596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int D = sc.nextInt();
		sc.close();
		
		if (D==22){
			System.out.println("Christmas Eve Eve Eve");
		}
		else if (D==23){
			System.out.println("Christmas Eve Eve");
		}
		else if (D==24){
			System.out.println("Christmas Eve");
		}
		else
			System.out.println("Christmas");
	}

}


Measured memory_bytes: 20820