akhauriyash/Code-Regression huggingface dataset:
using System;
class Program
 {
        static void Main(string[] args)
        {
    　　UInt64 A,B,C,D;
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            A = UInt64.Parse(str[0]);  //数値で受け取りたい場合は変換する
            B = UInt64.Parse(str[1]);
            C = UInt64.Parse(str[2]);  //数値で受け取りたい場合は変換する
            D = UInt64.Parse(str[3]);
          if(C == 1 || D == 1)
          {
            Console.WriteLine("0");
            return;
          }
            UInt64 m = 1;
            UInt64 val = 2;
            UInt64 tmpC = C;
            UInt64 tmpD = D;
            do
            {
              if(tmpC % val == 0 && tmpD % val == 0)
              {
                tmpC /= val;
                tmpD /= val;
                m *= val;
              }
              else
              {
                val++;
              }
              if(tmpC == 1 || tmpD == 1)
              {
                break;
              }
            }while(val <= Math.Sqrt(Math.Max(C,D)));

            m = m * tmpC * tmpD;
            if(m != 1)
            {
              UInt64 X1 = B - (B / C + B / D - B / m);
              UInt64 X2 = (A-1) - ((A-1) / C + (A-1) / D - (A-1) / m);
              Console.WriteLine(X1-X2);
            }
            else
            {
              UInt64 X1 = B - (B / C + B / D);
              UInt64 X2 = (A-1);
              Console.WriteLine(X1-X2);
            }
        }
 }

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

int main() {
  int N, a, b, c, d;
  cin >> N;
  
  a = N/1000;
  N%=1000;
  b = N/100;
  N%=100;
  c = N/10;
  N%=10;
  d = N/1;
  
  if ( b!=c ) {
  cout << "No" << endl;
  }
  if ( b==c ) {
    if ( ( a==b ) || ( c==d ) ) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 256
using System;

namespace ALDS1_D
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            int time = int.Parse(input);
            int max = int.MinValue;
            int min = int.MaxValue;
            int rate = 0;

            for (int i = 0; i < time; i++)
            {
                rate = int.Parse(Console.ReadLine());
                max = Math.Max(max, rate - min);
                min = Math.Min(min, rate);
            }

            Console.WriteLine(max);

        }
    }
}

Measured memory_bytes: 9200
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<int,ll> Pil;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<ll,ll> Pl;
typedef pair<Pil,ll> P2;
const ll INF=1000000000000000001;
const int inf=1000000000;
//struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int b[10]={};
int d[10][10011]={};
int a;
int c[10]={0,2,5,5,4,5,6,3,7,6};
int main(){

	int n,m;

	cin>>n>>m;
	rep(i,m){
		cin>>a;
		b[a]=1;
	}
	for(int i=9; i>0; i--){
		if(b[i]==1&&d[0][c[i]]==0){
			d[i][c[i]]=1;
			d[0][c[i]]=1;
		}
	}
	rep(i,n){
		if(d[0][i]>0){
			for(int j=1; j<10; j++){
				if(b[j]==1){
					int e[10];
					rep(k,10){
						e[k]=d[k][i];
					}
					e[0]++;
					e[j]++;
					bool flg=false;
					if(d[0][i+c[j]]<e[0])flg=true;
					if(d[0][i+c[j]]==e[0]){
						int flg2=0;
						for(int k=9; k>0; k--){
							if(flg2==0){
								if(d[k][i+c[j]]<e[k])flg2=1;
								if(d[k][i+c[j]]>e[k])flg2=-1;
							}
						}
						if(flg2==1)flg=true;
					}

					if(flg){
						rep(k,10){
							d[k][i+c[j]]=e[k];
						}
					}
				}
			}
		}
	}
	for(int i=9; i>0; i--){
		if(b[i]==1){
			rep(j,d[i][n]){
				cout<<i;
			}
		}
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll mod=1000000007;
#define PI 3.14159265358979323846264338327950288419716939937510
int main()
{
    ld a,b,x;
    cin>>a>>b>>x;
    ld h=x/(a*a);
    ld y;
    if(h<b/2)
        y=(2*a*h)/(b*b);
    else
        y=a/(2*(b-h));

    ld theta=90-(atan(y)*(180/PI));
    cout<<setprecision(15)<<theta<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int x,y,z,i;
	cin>>x>>y>>z;
	for(i=x/y;i>0;i--)
	{
		if((i*y+(i+1)*z)<=x)break;
	}
	cout<<i<<endl;
	return 0;
} 

Measured memory_bytes: 256
a,b,c = map(int,input().split())
k = int(input())

for i in range(k):
    if a >= b:
        b *=2
        continue
    elif b >= c:
        c *= 2
    else:
        c *= 2

if a < b and b < c:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 9164
from sys import stdin
N, M, C = [int(x) for x in stdin.readline().rstrip().split()]
B = [int(x) for x in stdin.readline().rstrip().split()]
A = []
ans = 0
for _ in range(N):
    A_ = [int(x) for x in stdin.readline().rstrip().split()]
    A.append(A_)
for i in range(N):
    A_ = A[i]
    cnt = C
    for j in range(M):
        cnt += A_[j] * B[j]
    if cnt > 0:
        ans += 1
print(ans)

Measured memory_bytes: 38256
#include<stdio.h>

/*void trace(int A[], int N){
    int i ;
    printf("%d", A[0]);
    for(i=1; i<N;i++){
            printf(" %d", A[i]);
    }
    printf("\n");
}*/
void trace(int A[], int N){
    int i;
    for(i=0;i<N-1;i++) printf("%d ",A[i]);
    printf("%d\n",A[N-1]);
}
 

void intsertionSort(int A[], int N){
    int i,j,minj,temp,count=0;
    for(i=0;i<=N-1;i++){
        minj = i;
        for(j=i;j<=N-1;j++){
            if (A[j] < A[minj]){
                minj = j;
            }
        }
        if(i!=minj){
            temp = A[i];
            A[i] = A[minj];
            A[minj] = temp;
            count++;
        }
    }
    trace(A,N);
    printf("%d",count);
    printf("\n");
}

int main(){
    int a,i,num[100];
    scanf("%d",&a);
    for(i=0;i<a;i++){
        scanf("%d",&num[i]);        
    }
    intsertionSort(num,a);

}

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

using namespace std;

int n, q;
vector<string> s;
vector<int> k, ans;
vector<vector<int> > permu, query;

struct Trie {
    struct Node {
        int child[26], cnt, lst;
        Node() { memset(child, 0, sizeof child); cnt = lst = 0; }
    };
    vector<Node> node;
    Trie() { node.assign(1, Node() ); }

    void addString(int i) {
        int iNode = 0;
        for (auto c : s[i]) {
            int ascii = c - 'a';
            if (!node[iNode].child[ascii]) {
                node[iNode].child[ascii] = (int)node.size();
                node.push_back(Node() );
            }
            iNode = node[iNode].child[ascii];
            ++node[iNode].cnt;
        }
        ++node[iNode].lst;
    }
} trie;

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

//    freopen("input", "r", stdin);

    cin >> n;
    s.assign(n, "");
    for (int i = 0; i < n; ++i) {
        cin >> s[i];
        trie.addString(i);
    }

    cin >> q;
    k.assign(q, 0);
    permu.assign(q, vector<int>(26, 0) );
    query.assign(n, vector<int>() );
    for (int i = 0; i < q; ++i) {
        cin >> k[i]; --k[i];
        for (int j = 0; j < 26; ++j) {
            char c; cin >> c;
            permu[i][j] = c - 'a';
        }
        query[ k[i] ].push_back(i);
    }

    ans.assign(q, 0);
    for (int i = 0; i < n; ++i) {
        vector<vector<int> > tmp(26, vector<int>(26, 0) );
        int iNode = 0;
        for (auto c : s[i]) {
            int ascii = c - 'a';
            for (int j = 0; j < 26; ++j) {
                if (j != ascii) tmp[j][ascii] += trie.node[ trie.node[iNode].child[j] ].cnt;

            }
            iNode = trie.node[iNode].child[ascii];
            tmp[ascii][ascii] += trie.node[iNode].lst;
        }
        for (int iQ : query[i]) {
            for (int i1 = 0; i1 < 26; ++i1) {
                for (int j1 = i1; j1 < 26; ++j1) ans[iQ] += tmp[ permu[iQ][i1] ][ permu[iQ][j1] ];
            }
        }
    }

    for (int i = 0; i < q; ++i) cout << ans[i] << '\n';

    return 0;
}


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

using ll = long long;
#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 INF 1e9
// constexpr ll INF = 1LL << 60;

void solve(int n){
  int w = 86400;
  vector<int> sum(w+1, 0);
  REP(i, n){
    string s, e;
    cin >> s >> e;
    int st = 0, et = 0;
    st += stoi(s.substr(0, 2))*3600+ stoi(s.substr(3,2))*60 + stoi(s.substr(6, 2));
    et += stoi(e.substr(0, 2))*3600+ stoi(e.substr(3,2))*60 + stoi(e.substr(6, 2));
    sum[st]++, sum[et]--;
  }
  int ans = sum[0];
  REP(i, w){
    sum[i+1] += sum[i];
    ans = max(ans, sum[i+1]);
  }
  cout << ans << endl;
}

int main(){
  while(true){
    int n;
    cin >> n;
    if(n == 0) break;
    solve(n);
  }
  
  return 0;
}




Measured memory_bytes: 3416
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<int> ok(N);
  vector<int> cnt(N, 1);
  ok[0] = 1;
  rep(i, M) {
    int x, y;
    cin >> x >> y;
    x--; y--;
    if(ok[x]) {
      if(cnt[x] == 1) ok[x] = 0;
      ok[y] = 1;
    }
    cnt[x]--; cnt[y]++;
  }
  cout << accumulate(all(ok), 0) << "\n";
  return 0;
}


Measured memory_bytes: 3964
# coding: utf-8
import sys

stdin = sys.stdin
ns = lambda: stdin.readline().rstrip() # ignore trailing spaces
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))


def main():
    n,m,x = na()
    cs = []
    As = []
    for _ in range(n):
        ca = na()
        cs.append(ca[0])
        As.append(ca[1:])
    ans = -1
    for i in range(pow(2,n)):
        rikais = [0 for _ in range(m)]
        money = 0
        for j in range(n):
            if ((i>>j) & 1):
                money += cs[j]
                for k in range(m):
                    rikais[k] += As[j][k]
        flag = 1
        for l in range(m):
            if rikais[l] < x:
                flag = 0
                break
        if flag:
            if ans == -1:
                ans = money
            else:
                ans = min(ans,money)
    print(ans)
    return


if __name__ == '__main__':
    main()

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

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
    
    string s;
    int Q;
    string front = "";
    string end = "";
    int r=0;
    cin >> s;
    cin >> Q;
    int q,F;
    char C;
    for(int i=0;i<Q;i++) {
        cin >> q;
        if(q == 1) r++;
        else {
            cin >> F >> C;
            if(F == 1) {
                if(r%2) end = end+C;
                else front = C+front;
            }
            else {
                if(r%2) front = C+front;
                else end = end+C;
            }
        }
    }
    string ans = front + s + end;
    if(r%2) reverse(ans.begin(), ans.end());
    cout << ans << endl;

}

Measured memory_bytes: 1420
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define repr(i, n) for(int i=n-1; i>=0; i--)
#define repr1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1);
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; }

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

    if (k % 2 == 0 || k % 5 == 0) {
        cout << -1 << endl;
        return 0;
    }

    if (k == 7) {
        cout << 1 << endl;
        return 0;
    }

    int ans = 0;
    ll sum = 0;
    ll mod = 7 % k;
    while (true) {
        mod = (10 * mod) % k;
        sum += mod;
        ans++;
        if (sum % k == 0) break;
    }

    cout << ans << endl;
}


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

typedef long long ll;
int type[8][3]={{1,1,1},{1,1,-1},{1,-1,1},{-1,1,1},{-1,-1,1},
				{-1,1,-1},{1,-1,-1},{-1,-1,-1}};
ll n,m,a[1010],b[1010],c[1010];
vector <pair<ll,int> > v;

ll my_abs(ll x){
	ll ret=x;
	if(x<0) ret*=-1;
	return ret; 
}

ll solve(int c1,int c2,int c3){
	v.clear();
	for(int i=0;i<n;i++){
		ll sum=a[i]*c1+b[i]*c2+c[i]*c3;
		v.push_back(make_pair(sum,i));
	}
	sort(v.begin(),v.end());
	reverse(v.begin(),v.end());
	ll sum1=0,sum2=0,sum3=0;
	for(int i=0;i<m;i++){
		int x=v[i].second;
		sum1+=a[x];
		sum2+=b[x];
		sum3+=c[x];
	}
	ll ret=0;
	ret=my_abs(sum1)+my_abs(sum2)+my_abs(sum3);
	return ret;
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++) scanf("%lld%lld%lld",&a[i],&b[i],&c[i]);
	ll ans=0;
	for(int i=0;i<8;i++){
		int c1=type[i][0],c2=type[i][1],c3=type[i][2];
		ans=max(ans,solve(c1,c2,c3));
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>

const int N = 100 + 10;
const int INF = 1 << 30;

int value[N][N], queue[N], dist[N], temp_dist[N];
int n, m, length, answer;

void dfs(int u, int current) {
	if (current > answer) {
		answer = current;
	}
	if (u > n) {
		return;
	}
	dfs(u + 1, current);
	bool flag = true;
	int temp = INF;
	for (int i = 1; i <= length && flag; ++ i) {
		int v = queue[i];
		flag &= (value[u][v] > 0);
		if (value[u][v] < temp) {
			temp = value[u][v];
		}
	}
	if (flag) {
		/*
		dist[u] = temp;
		if (dist[u] != dist[0]) current += dist[u];
		for (int i = 1; i <= length; ++ i) {
			int v = queue[i];
			temp_dist[v] = dist[v];
			if (value[u][v] < dist[v]) {
				if (dist[v] != dist[0]) current -= dist[v];
				dist[v] = value[u][v];
				current += dist[v];
			}
		}
		*/
		queue[++ length] = u;
		current = 0;
		for (int i = 1; i <= length; ++ i) {
			int min_value = dist[0];
			int a = queue[i];
			for (int j = 1; j <= length; ++ j) {
				if (i != j) {
					int b = queue[j];
					min_value = std::min(min_value, value[a][b]);
				} 
			}
			current += min_value;
		}
		dfs(u + 1, current);
		length --;
		/*
		for (int i = 1; i <= length; ++ i) {
			int v = queue[i];
			dist[v] = temp_dist[v];
		}
		dist[u] = dist[0];
		*/
	}
}

int main() {	
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; ++ i) {
		int a, b, c;
		scanf("%d%d%d", &a, &b, &c);
		value[a][b] = value[b][a] = c;
	}
	memset(dist, 127, sizeof(dist));
	answer = 0;
	for (int i = 1; i <= n; ++ i) {
		length = 1;
		queue[1] = i;
		dfs(i, 0);
	}
	printf("%d\n", answer);
	return 0;
}

Measured memory_bytes: 1236
#include <iostream>

using namespace std;

int main()
{
   int i, ans, a, b, c;
   
   cin >> a >> b >> c;
   ans = 0;
   for(i = a; i <= b; i++)
   {
       if(c % i == 0)
         ans++;
   }
 
   cout << ans << endl;
}


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

int main() {
    int n;
    cin>>n;
    vector<int> p(n);
    int sum =0;
    rep(i,n){
        cin>>p[i];
        sum += p[i];
    }
    sort(p.rbegin(),p.rend());
    
    
    cout << sum- p[0]/2 << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef tuple<int, int, int> tp;
typedef long long LL;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<int, LL> pil;
typedef pair<LL, int> pli;
typedef pair<LL, LL> pll;
typedef pair<pii, int> piipi;
typedef pair<int, pii> pipii;
typedef pair<pii, pii> piipii;
typedef pair<LL, pii> plpii;
typedef pair<LD, LD> pdd;
typedef pair<LD, int> pdi;
typedef pair<LD, LL> pdl;
typedef pair<int, LD> pid;
typedef pair<LL, LD> pld;
const int mod = 1e9 + 7;
const int hf = 999983;
const int N = 1e6;
LL ft[200005];
int h[200005];
void update(int i, LL v){
    for(;i<=200000;i+=(i&-i)){
        ft[i] = max(ft[i], v);
    }
}
LL query(int i){
    LL res = 0;
    for(;i>0;i-=(i&-i)) res = max(res, ft[i]);
    return res;
}
int main(){
    int n, a;
    scanf("%d", &n);
    for(int i=1;i<=n;i++){
        scanf("%d", &h[i]);
    }
    LL ans = 0;
    for(int i=1;i<=n;i++){
        scanf("%d", &a);
        LL q = query(h[i]-1) + a;
        ans = max(ans, q);
        update(h[i], q);
    }
    printf("%lld\n", ans);
}


Measured memory_bytes: 2560
#include<iostream>
#include<cmath>
 
using namespace std;
 
#define rep(i, n) for (int i = 0; i < int(n); ++i)
 
const int MOD = 100000007;
 
long long nck[1111][1111];
 
int main() {
  rep (i, 1111) nck[i][0] = 1;
  rep (i, 1110) rep (j, 1110) {
    nck[i + 1][j + 1] = (nck[i][j] + nck[i][j + 1]) % MOD;
  }
  int r, c, a1, a2, b1, b2, t = 1;
  cin >> r >> c >> a1 >> a2 >> b1 >> b2;
  if (r == abs(a1 - b1) * 2) t *= 2;
  if (c == abs(a2 - b2) * 2) t *= 2;
  int aa = min(abs(a1 - b1), r - abs(a1 - b1));
  int bb = min(abs(a2 - b2), c - abs(a2 - b2));
  cout << nck[aa + bb][aa] * t % MOD << endl;
  return 0;
}

Measured memory_bytes: 10800
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		Set<Integer> set = new HashSet<>();
		int topCount = 0;
		for (int i = 0; i < N; i++) {
			int rate = sc.nextInt();
			int rank = classifiy(rate);
			if (rank == 9) {
				topCount++;
				continue;
			}
			
			set.add(rank);
		}
		
		int min = Math.max(set.size(), 1);
		int max = set.size() + topCount;
		System.out.println(min + " " + max);
		
	}
	
	static int classifiy(int rate) {
		if (rate < 400) {
			return 1;
		} else if (rate < 800) {
			return 2;
		} else if (rate < 1200) {
			return 3;
		} else if (rate < 1600) {
			return 4;
		} else if (rate < 2000) {
			return 5;
		} else if (rate < 2400) {
			return 6;
		} else if (rate < 2800) {
			return 7;
		} else if (rate < 3200) {
			return 8;
		} else {
			return 9;
		}
	}

}

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

int main() {
    int N, M, ans = 0;
    cin >> N >> M;
    vector<int> X(M), dis(M - 1);
    for(int i = 0; i < M;++i)
        cin >> X[i];
    sort(X.begin(), X.end());
    for(int i = 0; i < M - 1;++i)
        dis[i] = X[i + 1] - X[i];
    sort(dis.begin(), dis.end());
    for(int i = 0; i < M - N;++i)
        ans += dis[i];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, k, h;
  in2(n, k);
  vector<ll> a(n);
  rep(i, n)
    in(a[i]);
  sort(all(a));
  h = n;
  rep(i, n)
    k = k - a[i];
  h = h + k / a[0];
  out(h);
  memi;
}

Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;





public class Main {

    static MyScanner in = new MyScanner();
    static   PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    int N;
    static int max = 200001;
    static int [] dr = {1,-1,0,0};
    static int [] dc={0,0,-1,1};
    public static void main(String args[]) throws IOException {
        int N = in.nextInt();
        long [] prefx = new long[N+1];
        prefx[1] = 1;
        for(int i=2;i<=N;i++){
                if(i%3!=0&&i%5!=0){
                    prefx[i] = prefx[i-1]+i;
                }else{
                    prefx[i] = prefx[i-1];
                }
        }
        out.println(prefx[N]);
        out.flush();


        out.flush();
        }
       static boolean isEven(long a){
            return (a&1)==0;
        }
       static  void swap (int a, int b){

        int temmp = b;
        b=a;
        a = temmp;
        }
        static boolean same(int [] arr,int [] temp){
            Arrays.sort(arr);
           Arrays.sort(temp);
            for(int i=0;i<arr.length;i++){
                if(temp[i]!=arr[i])
                return false;
            }
            return true;
        }

 
  


    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
   
        public MyScanner() {
           br = new BufferedReader(new InputStreamReader(System.in));
        }
   
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
   
        int nextInt() {
            return Integer.parseInt(next());
        }
   
        long nextLong() {
            return Long.parseLong(next());
        }
   
        double nextDouble() {
            return Double.parseDouble(next());
        }
   
        String nextLine(){
            String str = "";
        try {
           str = br.readLine();
        } catch (IOException e) {
           e.printStackTrace();
        }
        return str;
        }
  
     }
}

Measured memory_bytes: 40496
ss=input();t=input();lens,lent=len(ss),len(t);k=[]
def sst(sss):
  global t
  for i in range(lent):
    if sss[i]!=t[i] and sss[i]!="?":return -1
  return 0
def ch(s):
  ans=""
  for i in s:ans+=(i if i!="?"else"a")
  return ans
for i in range(lens-lent+1):
  if sst(ss[i:i+lent])==0:k.append(ch(ss[:i]+t+ss[i+lent:]))
if len(k)==0:print("UNRESTORABLE");exit()
k.sort();print(k[0])

Measured memory_bytes: 3064
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int a[100005];
int b[100005];
int main(){
	memset(b,0,sizeof(b));
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		b[a[i]]++;
		b[a[i]-1]++;
		b[a[i]+1]++;
	}
	int max=b[0];
	for(int i=1;i<=100005;i++){
		if(b[i]>max)
		max=b[i];
	}
	cout<<max;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int n, ans;
int main()
{
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		int a;
		scanf("%d", &a);
		if (m.find(a) == m.end()) m[a] = 1;
		else m[a]++;
	}
	for (auto it = m.begin(); it != m.end(); ++it)
	{
		if (it->second < it->first) ans += it->second;
		else ans += it->second-it->first;
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 4736
S = input()
if S[0] == 'A':
  if S[2:-1].count('C') == 1:
    S1 = S.replace('A', '')
    S2 = S1.replace('C', '')
    if all([x.islower() for x in S2]):
        print('AC')
        exit()
print('WA')

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

int wa(int t){
    int re=0;
    while(t>0){
        re+=t%10;
        t=t/10;
        }
    return re;
}

int main(){
    int n;
    cin>>n;
    int ans=100000000;
    for(int i=1;i<n;i++){
        int j=n-i;
        int t,a,b;
        a=wa(i);
        b=wa(j);
        t=a+b;
        ans=min(ans,t);
        }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
import copy

h,w,k=map(int,input().split())
board=[list(input()) for _ in range(h)]
ans=0
boards=[]
for i in range(2**h):
  tmp=copy.deepcopy(board)
  bit1=format(i,'b')
  bit1='0'*(h-len(bit1))+bit1
  for th in range(h):
    if bit1[th]=='0':
      continue
    for tw in range(w):
      tmp[th][tw]='.'
  boards.append(tmp)
for i in range(len(boards)):
  for j in range(2**w):
    tmp=copy.deepcopy(boards[i])
    bit2=format(j,'b')
    bit2='0'*(w-len(bit2))+bit2
    for tw in range(w):
      if bit2[tw]=='0':
        continue
      for th in range(h):
        tmp[th][tw]='.'
    cnt=0
    for th in range(h):
      for tw in range(w):
        if tmp[th][tw]=='#':
          cnt+=1
    if cnt==k:
      ans+=1
print(ans)

Measured memory_bytes: 9348
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string s;
	cin >> s;
	int a = 0, b = 0;
	for (int i = 0; i < s.length(); ++i)
		if (s[i] == '0')
			++a;
		else
			++b;

	cout << min(a, b) * 2 << endl;

	return 0;
}

Measured memory_bytes: 512
inp = list(input())

A = int(inp[0])
B = int(inp[1])
C = int(inp[2])
D = int(inp[3])

for i in range(2**3):
    sum = A
    ans = str(A)

    op1 = (i >> 2) & 1
    if op1 == 1:
        sum += B
        ans += '+'+str(B)
    else:
        sum -= B
        ans += '-'+str(B)

    op2 = (i >> 1) & 1
    if op2 == 1:
        sum += C
        ans += '+'+str(C)
    else:
        sum -= C
        ans += '-'+str(C)

    op3 = i & 1
    if op3 == 1:
        sum += D
        ans += '+'+str(D)
    else:
        sum -= D
        ans += '-'+str(D)

    if sum == 7:
        print(ans + '=7')
        exit()


Measured memory_bytes: 3064
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
S = collect(chomp(readline()))

ans = 0
for len in 0:length(S)
    for i in 1:length(S) - len
        for s in  S[i:i + len]
            if !(s in ['A', 'C', 'G', 'T'])
                @goto end_try_s
            end
        end
        ans = len + 1
    @label end_try_s
    end
    
end

println(ans)

end


main()

Measured memory_bytes: 169636
N = int(input())
A = list(map(int,input().split()))
sum_all = sum(A)

min_dif = float('inf')
s1 = 0
for i in range(N):
  if(i != N-1):
   s1 += A[i]
   s2 = sum_all - s1
   tmp_dif = abs(s1 - s2)
   min_dif = min(min_dif,tmp_dif)
print(min_dif)

Measured memory_bytes: 24832
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int x, a, b;
	cin >> x >> a >> b;
	if (abs(x - a) > abs(x - b)) {
		cout << "B" << endl;
	}
	else {
		cout << "A" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
object Main extends App {
  val s = io.StdIn.readLine.toInt

  def f(n: Int) = n match {
    case n if n % 2 == 0 => n / 2
    case n => 3 * n + 1
  }

  def test: Int = {
    var previous = s
    var map = Set[Int](s)

    for (i <- 2 to 1000000) {
      val ai = f(previous)
      if (map.contains(ai)) return i
      map = map + ai
      previous = ai
    }
    ???
  }

  val out = test

  println(out)
}



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

int main(void){
    vector<int> x;
    int input;
    scanf("%d",&input);
    x.push_back(input);
    for(int i=0;x[i]!=0;i++){
      scanf("%d",&input);
      x.push_back(input);
    }
    
    for (int i=0;x[i]!=0;i++)
    printf("Case %d: %d\n",i+1,x[i]);
}


Measured memory_bytes: 3388
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>

using namespace std;

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

    vector<uint64_t> vec;
    for (auto i = 0 ; i < count ; ++i) {
        uint64_t n;
        cin >> n;
        vec.push_back(n);
    }

    string result("Yes");
    for (auto i = 1 ; i < count ; ++i) {
        int d = static_cast<int64_t>(vec[i]) - static_cast<int64_t>(vec[i - 1]);

        // 2以上の差分があれば、NG
        if (d <= -2) {
            result = "No";
            break;
        }

        // 等しいなら何もしない
        if (d == 0) continue;

        // 減らす
        --vec[i];
    }

    // すべての数値を走査し、単調非減少になっているかチェック
    if ("No" != result) {
        for (auto i = 0 ; i < count - 1 ; ++i) {
            // 等しい場合と小さい場合は続行
            if (vec[i] <= vec[i + 1]) continue;

            // 右の要素より大きい場合、単調現象となるのでNG
            result = "No";
            break;
        }
    }
    cout << result;
    return 0;
}

Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	ll n;cin>>n;
	vector<ll> a(n);
	ll ans = 0;
	for(ll i = 0; i < n; i++) {
		cin>>a[i];
	}
	for(int i = 1; i < n - 1; i++) {
		if (a[i] != 0 && a[i] % 2 == 0 && a[i - 1] % 2 == 1&& a[i + 1] % 2 == 1){
			a[i]-= 2;
			a[i - 1] ++;
			a[i + 1] ++;
		}
		if (a[i] != 0 && a[i - 1] % 2 == 1){
			a[i]--;
			a[i - 1]++;
		}
	}
	if (n > 2 && a[n - 1] != 0 && a[n - 2] % 2 == 1){
			a[n - 1]--;
			a[n- 2]++;
		}
	for(ll i = 0; i < n; i++) {
		ans += a[i] / 2;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
const gInput = require('fs').readFileSync('/dev/stdin', 'utf8')
const input = gInput.split(' ').map( s => parseInt(s))

const a = input[0]
const b = input[1]
const c = input[2]

if( a < b && b < c ){
    console.log('Yes')
} else {
    console.log('No')
}


Measured memory_bytes: 15120
#include<bits/stdc++.h>
    using namespace std;
    #define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    #include <ext/pb_ds/assoc_container.hpp> 
    #include <ext/pb_ds/tree_policy.hpp> 
    using namespace __gnu_pbds; 
    #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
     
    #define ff first
    #define ss second
    #define sz size()
    #define mp make_pair
     
    #define pb push_back
    #define endl "\n"
     
    #define int long long int
    #define double long double
     
    #define bp __builtin_popcountll
    #define inf 1e17
    const int N=2e5+6;
    const int M=998244353;
    
    signed main()
    {
        FAST
        int n,a,b,ans=LLONG_MAX,c,d;
        cin>>n>>a>>b;
        c=a,d=b;
        if((b-a)%2==0)
        {
        	ans=(b-a)/2;
        }
        else
        {
        	ans=min(ans,max(a-1,b-1));
        	ans=min(ans,max(n-a,n-b));
        	int tt=n-b;
        	a+=tt+1;
        	b=n;
        	tt++;
        	ans=min(ans,tt+(b-a)/2);
        	a=c;b=d;
        	tt=a-1;
        	a=1;
        	b-=(tt-1);
        	ans=min(ans,tt+(b-a)/2);
        }
        cout<<ans;
        
    }


Measured memory_bytes: 256
N, M = map(int,input().split())
K = []
S = []
for i in range(M):
    k = 0
    s = []
    k, *s = map(int,input().split())
    K.append(k)
    S.append(s)
P = list(map(int,input().split()))
res = 0
for bit in range(1 << N):
    judge = True
    for i in range(M):
        cnt = 0
        for s in S[i]:
            cnt += (bit >> s-1) & 1
        if cnt % 2 != P[i]:
            judge = False
    if judge:
        res += 1
print(res)

Measured memory_bytes: 9200
using System;
using System.Collections.Generic;
using System.Text;

class Program
{
  private static int binary_search(int[] A, int right, int left, int key)
  {
    if (right >= left) return right - 1;

    int mid = (right + left) / 2;

    if (key < A[mid])
    {
      return binary_search(A, right, mid, key);
    }
    else if (key > A[mid])
    {
      return binary_search(A, mid + 1, left, key);
    }

    return mid;
  }
  static void Main(string[] args)
  {
    int[] A = { 1, 2, 4, 8, 16, 32, 64 };

    int N = int.Parse(Console.ReadLine());

    int pos = binary_search(A, 0, 7, N);

    Console.WriteLine(A[pos]);
  }
}


Measured memory_bytes: 11092
#https://atcoder.jp/contests/dp/tasks/dp_d
n,mw = map(int,input().split())

dp = [[0 for _ in range(mw + 1)]for _ in range(n + 1)] #dp[i個目までを取る][重さ]

for i in range(n):
    w, v = map(int,input().split())
    for sumw in range(mw + 1):
        if sumw - w >= 0:
            dp[i + 1][sumw] = max(dp[i][sumw], dp[i][sumw - w] + v)
        else:
            dp[i + 1][sumw] = dp[i][sumw]

print(dp[n][mw])

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

typedef long long int ll;
typedef long double ld;

//****************************************************
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define endl "\n" //comment it for interactive questions
#define trace1(a) cerr << #a << ": " << a << endl;
#define trace2(a,b) cerr << #a << ": " << a << " " << #b << ": " << b << endl;
#define trace3(a,b,c) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << endl;
#define trace4(a,b,c,d) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << #d << ": " << d << endl;

#define MOD (ll)1e9+7; //change it for other mods

#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
//*******************************************************

//Some Functions

ll powmod(ll a,ll b)
{
	ll res = 1;
	while(b > 0) {
		if(b & 1) res = (res * a) % MOD;
		a = (a*a)%MOD;
		b = b >> 1; 
	}
	return res % MOD;
}

ll cnt(ll n){
	ll res = 0;
	while(n > 0){
		res++;
		n = n/10;
	}
	return res;
}

ll anss[200000];
int main()
{
 //   FAST_IO;
 //    #ifndef ONLINE_JUDGE
	// freopen("input.txt" , "r", stdin);
	// freopen("output.txt" , "w", stdout);
 // 	#endif
    char s[200000];
    cin >> s;
    ll n = strlen(s);
    ll rs[200000];
    ll ls[200000];
    ll templ = n-1;
    for(ll i=n-2;i>=0;i--){
   		if(s[i] == 'R'){
   			ls[i] = templ;
   		}
   		else{
   			templ = i;
   		}
    }
    ll tempr = 0;
    for(ll i=1;i<n;i++){
    	if(s[i] == 'L'){
    		rs[i] = tempr;
    	}
    	else{
    		tempr = i;
    	}
    }
    for(ll i=0;i<n;i++){
    	if(s[i] == 'L'){
    		if((i-rs[i])%2 == 0){
    			anss[rs[i]]++;
    		}
    		else{
    			anss[rs[i]+1]++;
    		}
    	}
    	else{
    		if((ls[i] - i)%2 == 0){
    			anss[ls[i]]++;
    		}
    		else{
    			anss[ls[i]-1]++;
    		}
    	}
    }
    for(ll i=0;i<n;i++){
    	cout << anss[i] << " ";
    }
    cout << "\n";
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int dx[4] = {0, 0, 1, -1};
int dy[4] = {1, -1, 0, 0};
int main()
{
   int N, K, T, U, V, L;
   cin >> N >> K >> T >> U >> V >> L;
   int d[N + 1];
   rep(i, N)
   {
       cin >> d[i];
   }
   d[N] = L;
   int hav = 0;
   int nextDist = 0;
   double m = 0;
   rep(c, N + 1)
   {
       // cerr << nextDist << "," << c << "," << m << endl;
       if (nextDist <= d[c])
       {
           if (hav >= 1)
           {
               nextDist = nextDist + V * T;
               c--;
               hav--;
           }
           else
           {
               if (c != N)
                   nextDist = d[c] + V * T;
           }
       }
       else
       {
           if (hav + 1 <= K)
           {
               if (c != N) hav++;
               else m += nextDist - d[c];
           }
           else
           {
               m += nextDist - d[c];
               if (c != N)
                   nextDist = d[c] + V * T;
           }
       }
      // cout << m << endl;
      // cout << (double)(N * V * T - m) / (double)V + (double)(L - (N * V * T - m)) / (double)U << endl;
   }

   m += hav * V * T;
   // cout << 1 << "+" << (double)(N * V * T - m) / (double)V + (double)(L - (N * V * T - m)) / (double)U << endl;
   // cout << 1 << "+" << (double)(N * V * T - m) / (double)V + (double)(L - (N * V * T - m)) / (double)U << endl;
   double ans = (double)(N * V * T - m) / (double)V + (double)(L - (N * V * T - m)) / (double)U;
   printf("%0.10lf\n", ans);
   return 0;
}



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

int calcSum(int n)
{
    int sum = 0;
    while(n > 0){
        sum += n%10;
        n /= 10;
    }
    return sum;
}

int main()
{
    int n;
    int a,b;
    int sum = 0;

    cin >> n >> a >> b;

    for(int i = 1;i <= n;i++){
        int check = calcSum(i);
        if(check >= a && check <= b) sum += i;
    }
    cout << sum << endl;
    return 0;
}

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

namespace AtcoderTemplateForCSharp
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var input = Console.ReadLine();

            var n = int.Parse(input);

            var ans = 0;

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

                for (int j = 1; j <= i; j++)
                {
                    if (i % j == 0)
                    {
                        count++;
                    }
                }
                if (count == 8)
                {
                    ans++;
                }
            }

            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <set>
#include <map>
#include <stack>
#include <vector>
#include <cmath>
#include <string>
#include <queue>
#include <cstring>
#include <cstdio>
#define INF 0x3f3f3f3f
typedef long long ll;
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    double a,b;
    cin>>a>>b;
    cout<<b*2-a<<endl;


    return 0;
}



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

int main()
{
  uint64_t N;
  std::cin >> N;
  
  std::vector< std::vector<uint64_t> > A(N);
  for (uint64_t n = 0; n < N; ++n) {
    A[n] = std::vector<uint64_t>(N);
    for (uint64_t m = 0; m < N; ++m) {
      std::cin >> A[n][m];
    }
  }
  
  std::vector< std::vector<uint64_t> > B(A);
  for (uint64_t n = 0; n < N; ++n) {
    for (uint64_t m = 0; m < N; ++m) {
      if (n == m) continue;
      
      for (uint64_t l = 0; l < N; ++l) {
        if (B[n][m] > B[n][l] + B[l][m]) {
          B[n][m] = B[n][l] + B[l][m];
        }
      }
    }
  }
  
  for (uint64_t n = 0; n < N; ++n) {
    for (uint64_t m = 0; m < N; ++m) {
      if (A[n][m] > B[n][m]) {
        std::cout << -1 << std::endl;
        return 0;
      }
    }
  }
  
  uint64_t S = 0;
  
  for (uint64_t n = 0; n < N; ++n) {
    for (uint64_t m = n + 1; m < N; ++m) {
      if (n == m) continue;
      
      bool flag = false;
      
      for (uint64_t l = 0; l < N; ++l) {
        if (n == l || m == l) continue;
        
        if (B[n][m] == B[n][l] + B[l][m]) {
          flag = true;
        }
        
        if (flag) break;
      }
      
      if (!flag) {
        S += A[n][m];
      }
    }
  }
  
  std::cout << S << std::endl;
  
  return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

signed main()
{
    int R;
    cin >> R;
    if(R < 1200) {
        printf("ABC\n");
    }
    else if(R >= 2800) {
        printf("AGC\n");
    }
    else {
        printf("ARC\n");
    }
    return 0;
}


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

map <string, int> a;

int main()
{
    int n, maxx = -1;
    string str;
    cin >> n;
    for (int i = 1; i <= n; ++i)
    {
        cin >> str;
        a[str]++;
        if (a[str] > maxx) maxx = a[str];
    }
    for (map <string, int>::iterator it = a.begin(); it != a.end(); ++it)
    {
        if (it->second == maxx) cout << it->first << '\n';
    }
    return 0;
}



Measured memory_bytes: 25216
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using static System.Console;

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

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


        public static long gcd(long x, long y)
        {
            if (y < x) gcd(y, x);
            while (y != 0)
            {
                var z = x % y;
                x = y;
                y = z;
            }
            return x;
        }
        public static long keta(long x)
        {
            var z = 1;
            while (x > 0)
            {
                x /= 10;
                z++;
            }
            return z;
        }
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var nk = Reads();
            var n = nk[0];
            var k = nk[1];

            var memo = new long[n - k];
            var a = Reads();
            for (int i = 0; i < n-k; i++)
            {
                if (a[i] < a[i + k]) WriteLine("Yes");
                else WriteLine("No");
            }


            Console.Out.Flush();
        }
    }
}



Measured memory_bytes: 45488
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define endl "\n"
#define pb push_back
#define f(i,n) for(i=0;i<n;i++)
#define F(i,a,b) for(i=a;a<=b;i++)
#define arr(a,n) for( i=0;i<n;i++)cin>>a[i];
#define fi first
#define se second
#define mp make_pair
#define mod 1000000007
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define yes cout<<"yes"<<endl;
#define no cout<<"no"<<endl;
#define vi vector<ll>
#define ed end()
#define bg begin()
#define sz size()
#define ln length()
#define s() sort(a,a+n);
#define sr() sort(a,a+n,greater<ll>());
#define v()  sort(v.begin(),v.end());
#define vr() sort(v.begin(),v.end(),greater<ll>());
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll gcd(ll a, ll b){if(!b)return a;return gcd(b, a % b);}
ll power(ll x,ll y,ll p){ll res=1;x%=p;while(y>0){if(y&1)res=(res*x)%p;y=y>>1;x=(x*x)%p;}return res;}
int main() {

fast();

{
  int n,k,f=0;;
  cin>>n>>k;
  while(n>0)
  {
    f++;
    n/=k;
  }
  
cout<<f<<endl;

}
return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vector<int>> vvi;
typedef vector<vector<string>> vvs;
typedef vector<vector<char>> vvc;
typedef vector<vector<bool>> vvb;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define vrep(v,n) for(int i=0;i<n;i++){cin >> v.at(i);} 
#define rep(i, l, n) for (int i = l; i < (int)(n); i++)
#define repn(i, l, n) for (int i = l; i <= (int)(n); i++)
#define pb push_back 
#define PI 3.14159265369;
void chmin(int &a, int b) {if(a > b) a = b;}

const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};


int main(){
    int n;
    cin >> n;
    cout <<setprecision(10)<< 2*n*PI;
}

Measured memory_bytes: 3784
const M : usize = 1_000_000_007;

fn main()
{
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();

    let data: Vec<&str> = line.split_whitespace().collect();
    let r1 = data[0].parse().unwrap_or(0);
    let c1 = data[1].parse().unwrap_or(0);
    let r2 = data[2].parse().unwrap_or(0);
    let c2 = data[3].parse().unwrap_or(0);

    let n = r2 + c2 + 2;

    let mut f1 = vec![1; n];
    let mut f2 = vec![1; n];
    let mut ff = vec![1; n];

    for i in 2..n
    {
        f1[i] = f1[i - 1] * i % M;
        ff[i] = M - ff[M % i] * (M / i) % M;
        f2[i] = f2[i - 1] * ff[i] % M;
    }

    let ncr = |n, r| (f1[n] * ((f2[r] * f2[n - r]) % M)) % M;
    let sum = |x, y| (1 .. (x + 2)).fold(0, |v, i| (v + ncr(y + i, i)) % M);

    let ans = (4 * M + sum(r2, c2) - sum(r1-1, c2) - sum(r2, c1-1) + sum(r1-1, c1-1)) % M;
    println!("{}", ans);
}


Measured memory_bytes: 53500
<?php

$input = explode(' ', trim(fgets(STDIN)));
$a = (int)$input[0];
$b = (int)$input[1];

$b_str = decbin($b);
$a_str = str_pad(decbin($a), strlen($b_str), '0', STR_PAD_LEFT);

$diff = $b - $a;
$ans = '';

if ($a === $b) {
	echo $a;
	exit();
}
$dev = 1;
$idx = strlen($b_str) - 1;
while ($idx >= 0) {
	// 開始位置
	$smaller = $a - (int)floor($a / $dev) * $dev;
	$larger = $b - (int)floor($b / $dev) * $dev + 1;
	$change = (int)floor((floor($b / $dev) * $dev - floor($a / $dev) * $dev) / $dev);
	// console('change: ' . $change);
	$start_str = $a_str[$idx];
	$one = 0;
	if ($start_str == '1') {
		$one += $dev - $smaller;
		if ($change % 2 === 0) {
			// 1で終わる
			if ($dev === 1) {
				$one += (int)floor($change / 2);
			}else{
				$one += $larger;
			}
		// 	console('larger1: ' . $larger);
		}else{
			if ($dev === 1) {
				$one += (int)floor($change / 2);
			}
		}
	}else{
		if ($change % 2 === 1) {
			// 1で終わる
			if ($dev === 1) {
				$one += (int)ceil($change / 2);
			}else{
				$one += $larger;
			}
			// console('larger3: ' . $larger);
		}else{
			if ($dev === 1) {
				$one += (int)ceil($change / 2);
			}
			// console('4');
		}
	}
	// console('one: ' .$one);
	if ($one % 2 == 0) {
		$add = '0';
	}else{
		$add = '1';
	}
	// console($add);
	$ans = $add . $ans;
	$idx -= 1;
	$dev *= 2;
}

// console($ans);
echo bindec($ans);

function console($txt){
	echo $txt . PHP_EOL;
}

Measured memory_bytes: 4728
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
 
using namespace std;

int main()
{
	int a,b;
	cin>>a>>b;
	if(a >= 13){
		cout<<b<<endl;
	}else if( a >= 6){
		cout<< b/ 2<<endl;
	}else{
		cout<<0<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fo(i,a,b) for(int i=(a);i<(b);i++)
#define MOD 1000000007
#define MP make_pair
#define PB push_back
#define SZ(a) ((int)a.size())
typedef long long ll;

int N, M, a[100100];
ll sub[200200], v[200200], cur[200200], all, rate, ans = 1e18;

int dis (int i, int j) {
        return (j-i+M) % M;
}

int main () {
        scanf("%d %d", &N, &M);
        fo(i, 0, N) {
                scanf("%d", &a[i]), a[i]--;
        }
        fo(i, 1, N) if (a[i-1] != a[i]) {
                all += dis(a[i-1], a[i]);
                int l = a[i-1] + 1;
                int r = a[i];
                if (l > r) r += M;
                sub[l]++, sub[r]--;
                cur[r+1] -= r-l;
        }
        fo(i, 0, 2*M) {
                cur[i] += (i ? cur[i-1] : 0) + rate;
                v[i] -= cur[i];
                rate += sub[i];
        }
        fo(i, 0, M) ans = min(ans, v[i] + v[i+M] + all);
        printf("%lld\n", ans);
        return 0;
}


Measured memory_bytes: 5376