akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] s=br.readLine().split(" ");
        int n=Integer.parseInt(s[0].trim());
        long d=Long.parseLong(s[1].trim());
        long r=(d*d);
        long res=0;

        for(int i=0;i<n;i++){
            s=br.readLine().split(" ");
            long x=Long.parseLong(s[0].trim());
            long y=Long.parseLong(s[1].trim());
            if(is_path(x,y,r)){
                res++;
            }

        }
System.out.println(res);
//        int t = Integer.parseInt(br.readLine().trim());

    }

    public static boolean is_path(long x,long y,long d){
        long r=(x*x)+(y*y);
//        r=Math.sqrt(r);
        if(r<=d){
            return true;
        }
        return false;
    }



}


Measured memory_bytes: 54712
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>
#include <random>
#include <list>
#include <numeric>



#define rep(i,p,q) for(ll i = p;i < q;i++)
#define ll long long

using namespace std;

vector<vector<ll>> graph;
vector<ll> query;
vector<ll> ans;
vector<ll> visited;

const ll MAX = 510000;
const ll MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (ll i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(ll n, ll k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

//2019 C
int main(void) {
	ll n;
	string s;
	cin >> n >> s;
	vector<ll> d = vector<ll>(2 * n);
	//0 = L,1 = R
	d[0] = 0;
	d[2 * n - 1] = 1;
	rep(i, 0, 2 * n - 2) {
		if (s[i] == s[i + 1]) {
			d[i + 1] = d[i] ^ 1;
		}
		else {
			d[i + 1] = d[i];
		}
	}
	if (s[0] != 'B' || s[2 * n - 1] != 'B') cout << 0 << endl;
	else {
		ll ans = 1;
		bool can = true;
		ll lCount = 0;
		rep(i, 0, d.size()) {
			if (lCount < 0) {
				can = false;
				break;
			}
			if (d[i] == 1) {
				ans = (ans * lCount) % MOD;
				//ans %= MOD;
				lCount--;
			}
			else {
				lCount++;
			}
		}
		rep(i, 2, n + 1) {
			ans *= i;
			ans %= MOD;
		}
		if (lCount != 0) cout << 0 << endl;
		else cout << ans << endl;			
		
		
	}
}

Measured memory_bytes: 2180
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
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(int argc, char const *argv[]) {
  int n, a;
  cin >> n >> a;
  cout << n/a + (n%a!=0) << endl;
  return 0;
}

Measured memory_bytes: 3596
using System;

namespace ITP1_2_D {
    class Program {
        static void Main(string[] args) {
            string[] s = Console.ReadLine().Split(' ');
            int[] a = new int[5];
            for(int i = 0; i < 5; i++)
                a[i] = int.Parse(s[i]);
            int W = a[0];
            int H = a[1];
            int x = a[2];
            int y = a[3];
            int r = a[4];

            if(W >= x + r && H >= y + r) {
                if(x > 0 && y > 0 && x - r >= 0 && y - r >= 0) {
                    Console.WriteLine("Yes");
                } else {
                    Console.WriteLine("No");
                }
            } else {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 8936
import sys
def solve():
    X, K, D = list(map(int, input().split()))

    if(D > abs(X)):
        if( K % 2 == 0):
            ans = abs(X)
            print(ans)
        else:
            ans = D - abs(X)
            print(ans)
    elif(abs(X) - D*K >= 0):
        ans = abs(X) - D*K 
        print(ans)
    elif(abs(X) - D*K < 0):
        if((K - (abs(X) // D)) % 2 == 0):
            ans = abs(X) - ((abs(X) // D) * D)
            print(abs(ans))
        else:
            tmp = abs(X) - ((abs(X) // D) * D)
            ans = tmp - D
            print(abs(ans))



if __name__ == "__main__":
    solve()

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

int main(){
  int N, K;
  cin >> N >> K;
  vector<string> a(N);
  for(int i=0; i<N; i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  int alice=0, bob=0;
  for(int i=0; i<N; i++){
      cout << a.at(i);
  }
}


Measured memory_bytes: 256
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_4_B
// DFS algorithm
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool dfs(vector<vector<int>> &A, vector<int> &U, vector<int> &R, int c)
{
        if (U[c] == 2)
                return true;
        if (U[c] == 1)
                return false;
        U[c] = 1;
        for (auto a: A[c])
                if (!dfs(A, U, R, a))
                        return false;
        U[c] = 2;
        R.push_back(c);
        return true;
}

int main(int argc, char **argv)
{
        int V, E;
        cin >> V >> E;
        vector<vector<int>> A(V);
        for (int i = 0; i < E; i++) {
                int s, t;
                cin >> s >> t;
                A[s].push_back(t);
        }
        vector<int> U(V), R;
        bool ok = true;
        for (int i = 0; i < V && ok; i++)
                if (!U[i])
                       ok = dfs(A, U, R, i);
        if (!ok) {
                cout << "Found cyclic path" << endl;
                return 0;
        }
        reverse(R.begin(), R.end());
        for (auto r: R)
                cout << r << endl;
        return 0;
}

Measured memory_bytes: 3592
/*

Author : AllKilled
Date   : 201910277

Contest: AtCoder Beginner Contest 144.
Problem: F - Fork in the Road
Result : AC

*/
#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const LL MAXN = 6e2+7;

///--------------------------------------------///

double dp[MAXN], delta[MAXN], p[MAXN], ans;
vector<int> g[MAXN];
int n, m;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    for(int s, t, i = 0; i < m; ++i){
        cin >> s >> t;
        g[s].push_back(t);
    }
    p[1] = 1;
    for(int i = 1; i < n; ++i){
        int sz = g[i].size();
        for(auto x : g[i]) p[x] += p[i] / sz;
    }
    dp[n] = 0;
    ans = 0;
    for(int i = n - 1; i; --i){
        double cnt = 0, mx = 0;
        int sz = g[i].size();
        for(auto x : g[i]) {
            cnt += dp[x];
            mx = max(mx, dp[x]);
        }
        dp[i] = cnt / sz + 1;
        delta[i] = 0;
        if(sz > 1){
            double now = (cnt - mx) / (sz - 1) + 1;
            delta[i] = dp[i] - now;
        }
        ans = max(ans, p[i] * delta[i]);
    }
    ans = dp[1] - ans;
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define ff first
#define ss second

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a, b, c, d;
  	cin >> a >> b >> c >> d;
  	if ((a <= 0 && b <= 0 && c >= 0 && d >= 0) || (a >= 0 && b >= 0 && c <= 0 && d <= 0)) {
    	cout << max(b * c, d * a) << '\n';
      	return 0;
    }
  	cout << max(a * c, b * d) << '\n';
    return 0;
}

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

int main() {
	int A, B;
	cin >> A >> B;
	B *= 10;
	for (int i = 0; i < 10; i++) {
		if (floor((B + i) * 0.08) == A) {
			cout << B + i << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	return 0;
}


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

int main()
{
    int i,j;
    int n,x,y;
    cin >> n >> x >> y;
    --x; --y;
    vector<int> ans(n);
    for(i = 0;i < n;++i){
        for(j = 0;j < n;++j){
            int tmp;
            if(i <= x){
                if(j <= x){
                    tmp = abs(i-j);
                    ++ans.at(tmp);
                }else if(x < j <= y){
                    tmp = min(j-i, 1+abs(y-j)+abs(x-i));
                    ++ans.at(tmp);
                }else if(y < j){
                    tmp = abs(x-i) + 1 + abs(j-y);
                    ++ans.at(tmp);
                }
            }else if(x < i && i <= y){
                int sm,bi;
                if(i > j){
                    sm = j;
                    bi = i;
                }else{
                    sm = i;
                    bi = j;
                }
                if(j <= x){
                    tmp = min(abs(i-j), abs(y-bi) + 1 + abs(x-sm));
                    ++ans.at(tmp);
                }else if(x < j <= y){
                    tmp = min(abs(i-j), abs(sm-x) + 1 + abs(y-bi));
                    ++ans.at(tmp);
                }else if(y < j){
                    int tmp = min(abs(j-i), abs(i-x) + 1 + abs(j-y));
                    ++ans.at(tmp);
                }
            }else{
                if(j <= x){
                    int tmp = abs(i-y) + 1 + abs(x-j);
                    ++ans.at(tmp);
                }else if(x < j <= y){
                    int tmp = min(abs(i-j), abs(i-y) + 1 + abs(j-x));
                    ++ans.at(tmp);
                }else if(y < j){
                    int tmp = abs(j-i);
                    ++ans.at(tmp);
                }
            }
        }
    }
    for(i = 1;i < n;++i){
        cout << ans.at(i)/2 << endl;
    }
    return 0;
}

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

using namespace std;

typedef long long ll;

#define FOR(a, b, i) for(int i=a; i<b; i++)
#define RFOR(a, b, i) for(int i=a; i>=b; i--)
#define PB push_back
#define MP make_pair
#define MOD 1e9+7
#define newline cout<<"\n"

const int nax = 1e5+5;

vector<int> adj[nax];
vector<int> indegree(nax, 0);
vector<int> dist(nax, 0);
vector<bool> visited(nax, false);

void dfs(int start)
{
    visited[start] = true;
    for(auto x: adj[start])
    {
        dist[x] = max(dist[x], dist[start]+1);
        indegree[x]--;
        if(indegree[x]==0)
        {
            dfs(x);
        }
    }
}

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

    int n, m; cin>>n>>m;
    
    while(m--)
    {
        int x, y;
        cin>>x>>y;
        adj[x].PB(y);
        indegree[y]++;
    }

    FOR(1, nax, i)
    {
        if(indegree[i]==0 && !visited[i])
        {
            dfs(i);
        }
    }

    cout<<*max_element(dist.begin(), dist.end());
    newline;

    return 0;
}

Measured memory_bytes: 9600
#include <iostream>
#include <cmath>

using namespace std;

bool is_orth(double xa, double ya, double xb, double yb, double xc, double yc, double xd, double yd) {

    double inner_product = (xa-xb)*(xc-xd) + (ya-yb)*(yc-yd);
    return fabs(inner_product) < 1e-10;
}

int main() {
    double xa, ya, xb, yb, xc, yc, xd, yd;
    string result;
    while (cin >> xa >> ya >> xb >> yb >> xc >> yc >> xd >> yd) {
        if(is_orth(xa, ya, xb, yb, xc, yc, xd, yd)) {
            result = "YES";
        } else {
            result = "NO";
        }
        cout << result << endl;
    }
    return 0;
}

Measured memory_bytes: 3220
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
const long long INF = 1LL << 60;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
using ll = long long;
#define int long long
signed main(void){
    int n; cin>>n;
    vector <int> data(26, INF); 
    rep(i, n){
        string s; cin>>s;
        vector <int> tmp(26); 
        rep(j, s.size()) tmp[s[j] - 'a']++;
        rep(j, 26)  chmin(data[j], tmp[j]);
    }
    rep(i, 26){
        while(data[i]){
            cout<<char('a' + i);
            data[i]--;
        }
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstdlib>
using namespace std;
int n;
int map[10];
bool hash[10];

void input()
{
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int x,y;
		cin>>x>>y;
		map[x]|=(1<<y);
		hash[x]=1;
	}
}

void dfs(int here)
{
	if(here==8){
		for(int i=0;i<8;i++)
		{
		    for(int j=0;j<8;j++)
		    	if(map[i]&(1<<j)) cout<<'Q';
		    	else cout<<'.';
			cout<<endl;
		}
		exit(0);
	}
	if(hash[here]) dfs(here+1);
	for(int i=0;i<8;i++)//????i???????????? 
	{
		int t=(1<<i);
		int k=1;
		for(int j=0;j<8;j++){
			if(t&map[j]) k=0;
			if(t>>abs(here-j)&map[j]) k=0;
			if(t<<abs(here-j)&map[j]) k=0;
		}
		if(k) {map[here]+=t;dfs(here+1);map[here]-=t;}
	}
}

int main()
{
	input();
	dfs(0);
	return 0;
}

Measured memory_bytes: 3096
def main():
    N, K = map(int, input().split())
    white = [[0] * K for _ in range(2*K)]
    for i in range(N):
        x, y, c = input().split()
        x, y = int(x) % (2*K), int(y) % (2*K)
        if y >= K:
            y -= K
            x = (x-K) % (2*K)
        if c == "W":
            white[x][y] += 1
        else:
            white[(x+K) % (2*K)][y] += 1
    ysum = [[0] * (2*K) for _ in range(2*K)]
    for i in range(2*K):
        ysum[i][0] = sum(white[i][:K])
        for j in range(1, K):
            ysum[i][j] = ysum[i][j-1] - white[i][j-1]
        for j in range(K+1, 2*K):
            ysum[i][j] = ysum[i][j-1] + white[i][(j+K-1) % (2*K)]
    csum = [[0] * (2*K) for _ in range(2*K)]
    ans = 0
    for i in range(2*K):
        csum[0][i] = sum([ysum[x][i] for x in range(K)]) + \
            sum([ysum[x][(i+K) % (2*K)] for x in range(K, 2*K)])
        for j in range(1, 2*K):
            csum[j][i] = csum[j-1][i] \
                + ysum[(j+K-1) % (2*K)][i] - ysum[(j+K-1) % (2*K)][(i+K) % (2*K)]\
                - ysum[j-1][i] + ysum[j-1][(i+K) % (2*K)]
    for i in range(2*K):
        for j in range(K):
            ans = max(ans, csum[i][j])
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 127064
import heapq

n, m = map(int, input().split())
A = list(map(int, input().split()))

heap = []
heapq.heapify(heap)
for a in A:
    heapq.heappush(heap, -1*a)

for i in range(m):
    x = heapq.heappop(heap)
    newx = x / 2
    heapq.heappush(heap, newx)

ans = 0
for y in heap:
    y = -1 * y
    ans += y // 1

print(int(ans))


Measured memory_bytes: 14180
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const long long INF = (long long)1e18+1;
#define DIV 1000000007
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long idx=0;
    long r;
    cin >> r;
    cout << 3* (r*r) << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Measured memory_bytes: 256
from  math import *
def a(m, h):
    return abs(h/ 6 - m / 30) * pi
a, b, h, m = map(int, input().split())
# print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 + 1/(6*m) - m / 30) * pi)))
print(sqrt(a**2 + b**2 - 2*a*b*cos((h/ 6 + m/(360) - m / 30) * pi)))

Measured memory_bytes: 9504
#!/usr/bin/env python
"""AtCoder Beginner Contest 173: C - H and V
https://atcoder.jp/contests/abc173/tasks/abc173_c
"""

import copy


def debug_cells(cells):
    for col in cells:
        print(''.join(col))


def count_black(cells):
    count = 0
    for col in cells:
        count += col.count('#')
    return count


def draw_and_count(cells, xs, ys):
    for x in xs:
        for col in cells:
            col[x] = '@'
    for y in ys:
        for i in range(len(cells[y])):
            cells[y][i] = '@'
    # debug_cells(cells)
    return count_black(cells)


def main():
    H, W, K = list(map(int, input().split()))
    cells = [[0 for j in range(W)] for i in range(H)]
    for x in range(H):
        Cs = list(input())
        for y in range(W):
            cells[x][y] = Cs[y]

    Xs = []
    for i in range(2 ** W):
        Xs.append([j for j in range(W) if (i >> j) & 1])
    Ys = []
    for i in range(2 ** H):
        Ys.append([j for j in range(H) if (i >> j) & 1])

    # print(Xs)
    # print(Ys)
    ans = 0
    for xs in Xs:
        for ys in Ys:
            black_count = draw_and_count(copy.deepcopy(cells), xs, ys)
            if black_count == K:
                ans += 1
            # print('{}, {} => {}'.format(xs, ys, draw_lines(copy.deepcopy(cells), xs, ys)))
    print(ans)



if __name__ == '__main__':
    main()


Measured memory_bytes: 9352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double llf;
typedef pair<int, int> pii;
const int maxn = 2e5 + 5;
const ll inf = 2e15 + 7;

int main()
{
	ll h, w;
	cin >> h >> w;
	ll ans = h * w;
	if (h == 1 || w == 1) { cout << "1\n"; return 0; }
	if (ans % 2 == 1)cout << ans / 2 + 1 << endl;
	else cout << ans / 2 << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define maxn 100003
#define mod 1000000007
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int,int> pi;

int n;

int main() {
	scanf("%d",&n);
	printf("%d\n",1-n);
	return 0;
}

Measured memory_bytes: 3864
#include <stdio.h>
#include <string.h>
int a[26];
int main(void){
    // Your code here!
    int i;
    char s[27];
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++){
        if(a[s[i]-'0'-49]==1){
            printf("no\n");
            return 0;
        }
        else a[s[i]-'0'-49]++;
    }
    printf("yes\n");
    return 0;
}


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

int main()
{
    int N;
    cin >> N;
    vector<string> U(N);
    for (auto &a : U)
    {
        cin >> a;
    }
    int M;
    cin >> M;
    int flag = 0, auth;
    for (int i = 0; i < M; i++)
    {
        string s;
        cin >> s;
        auth = 0;
        for (int j = 0; j < N; j++)
        {
            if (U[j] == s)
            {
                if (flag == 0)
                {
                    cout << "Opened by " << s << endl;
                    flag = 1;
                }
                else
                {
                    cout << "Closed by " << s << endl;
                    flag = 0;
                }
                auth = 1;
                break;
            }
            if (auth)
                break;
        }
        if (auth == 0)
            cout << "Unknown " << s << endl;
    }
    return 0;
}



Measured memory_bytes: 3216
n,m=map(int,input().split())
cnt=[n for _ in range(m)]
for i in range(n):
	k = list(map(int,input().split()))
	for i in range(1, k[0]+1):
		cnt[k[i]-1] -= 1
ans = 0
for i in range(m):
	if cnt[i] == 0:
		ans += 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#define eol '\n'
using namespace std;

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

  int N, x;
  cin >> N >> x;
  vector<long long int> a(N);

  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }

  long long int count = 0;
  for (int i = 0; i < N - 1; i++) {
    if (a[i] + a[i+1] > x) {
      long long int minus = a[i] + a[i+1] - x;
      count += minus;
      a[i+1] = max(static_cast<long long>(0), a[i+1] - minus);
      a[i] = x - a[i+1];
    }
  }

  cout << count << eol;
  
  return 0;
}


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

const int MOD = 1000000007;
int n, k;
ll cnt[100100];

ll lgput(ll x, ll y){
    if (x < 0) return 0;
    ll ans = 1;
    while (y){
        if (y & 1) ans = (ans * x) % MOD;
        x = (x * x) % MOD;
        y /= 2;
    }
    return ans;
}

int main(){
    cin >> n >> k;
    ll ans = 0;
    for (int i=k; i; i--){
        cnt[i] = lgput(k / i, n);
        for (int j=i+i; j<=k; j+=i){
            cnt[i] = (cnt[i] - cnt[j] + MOD) % MOD;
        }
        ans = (ans + i * cnt[i]) % MOD;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 4380
#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 ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
#define LINF 1e18
typedef long long ll;


int main() {
    ll r,D,x; cin >> r >> D >> x;
    REP(i,10){
        x = r*x-D;
        cout << x << endl;
    }
    return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <queue>

using namespace std;
typedef long long ll;
#define REP(i,n) for (ll i = 0; i < (n); ++i)

int main(){
    ll n;
    cin >> n;
    vector<ll> s(n, 0);
    REP(i, n){
        ll ai;
        cin >> ai;
        s.at(--ai)++;
    }
    priority_queue<ll, vector<ll>, greater<ll>> que;
    REP(i, n){
        if(s.at(i)){
            que.push(s.at(i));
        }
    }
    vector<ll> ans(n, 0);
    for(ll i = que.size(); i >= 1; --i){
        ans.at(i - 1) = que.top();
        if(que.size() > 1){
            ll x1 = que.top(); que.pop();
            for(; x1 > 0; --x1){
                ll x2 = que.top(); que.pop();
                que.push(x2 + 1);
            }
        }
    }
    REP(i, ans.size()){
        cout << ans.at(i) << endl;
    }
    return 0;
}


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

int main() {
  string s;
  int w;
  cin >> s >> w;
  string result;
  int i;
  for (i = 0; i < s.length(); i += w) {
    result.push_back(s.at(i));
  }
  cout << result << endl;
  return 0;
}


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

bool counter_C(string m);

int main()
{
    bool LOWER;
    string S;
    cin>>S;
    for(int j=1;j<S.size();j++){
        if(S[j]=='C')
        LOWER=false;

else if(islower(S[j]))
                LOWER=true;
           else{
           LOWER=false;
           break;}

    }
    if(S[0]=='A' && counter_C(S) && LOWER )
        cout<<"AC"<<endl;
    else
        cout<<"WA"<<endl;


    return 0;
}
bool counter_C(string m){
    int countter=0;
for(int i=2;i<m.size();i++){
    if(m[i]=='C'){
            countter+=1;


    }
}
    if(countter==1)
    return true;
    else
        return false;


}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

int main(){
    int a,b,c,k,mn;
    cin >> a >> b >> c >> k;
    int m=max(a,max(b,c)),n=min(a,min(b,c));
    vector<int>x={a,b,c};
    sort(x.begin(),x.end());
    mn=x[1];
    for(int i=0;i<k;i++){
        m*=2;
    }
    cout << m+n+mn;
}

Measured memory_bytes: 256
<?php

fscanf(STDIN, "%d %d", $k, $n);
$a_arr = explode(' ', trim(fgets(STDIN)));

$diff_arr = [];

for ($i = 0; $i < $n - 1; ++$i) {
    $diff_arr[] = $a_arr[$i + 1] - $a_arr[$i];
}
$diff_arr[] = $k - $a_arr[$n - 1] + $a_arr[0];

echo $k - max($diff_arr);



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

struct med{
	int time;
	int value;
	double rate;
}f[11];

int cmp(med a,med b){
	return a.rate>b.rate;
}

int main(){
	
	//test3//
	int N,i,count,flag;
	scanf("%d",&N);
	int a[N];
	for(i=0;i<N;i++){
		scanf("%d",&a[i]);
	}
	sort(a,a+N);
	count = 0;
	for(i=0;i<N;i++){
		flag=1;
		while(a[i]==a[i+1]){
			flag++;
			i++;
		}
		if(flag%2==1){
			count++;
		}
	}
	printf("%d",count);
	//test3//
	
	return 0;
} 

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, s, e) for(int i = s; i < e; i++)
#define rrep(i, s, e) for(int i = s; i > (s)-(e); i--)
#define pr(s) std::cout << s << std::endl
#define prb(s) std::cout << s
using namespace std;



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


  int x, a, b;
  cin >> x >> a >> b;

  if (b-a <= 0) pr("delicious");
  else if (b-a <= x) pr("safe");
  else pr("dangerous");


  return 0;
}


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

template<class T>
T gcd(T n,T m){
    if(n>m) return gcd(m,n);
    else if(n==0) return m;
    else return gcd(m-n*(m/n),n);
}

struct rat{
    ll p,q;
    rat(ll p_=0,ll q_=1){
        ll k=gcd(abs(p_),abs(q_));
        p=(p_/k)*(q_/abs(q_));
        q=abs(q_)/k;
    }
    bool operator==(const rat& x){
        return p==x.p&&q==x.q;
    }
    bool operator<(const rat& x){
        return p*x.q<x.p*q;
    }
    bool operator>(const rat& x){
        return p*x.q>x.p*q;
    }
    rat& operator=(const rat& x){
        p=x.p;q=x.q;
        return *this;
    }
    rat operator+(const rat& x){
        rat y(p*x.q+x.p*q,q*x.q);
        return y;
    }
    rat operator-(const rat& x){
        rat y(p*x.q-x.p*q,q*x.q);
        return y;
    }
    rat operator*(const rat& x){
        rat y(p*x.p,q*x.q);
        return y;
    }
    rat operator/(const rat& x){
        rat y(p*x.q,q*x.p);
        return y;
    }
    rat& operator+=(const rat& x){
        *this=*this+x;
        return *this;
    }
    rat& operator-=(const rat& x){
        *this=*this-x;
        return *this;
    }
    rat& operator*=(const rat& x){
        *this=*this*x;
        return *this;
    }
    rat& operator/=(const rat& x){
        *this=*this/x;
        return *this;
    }
};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    ll S{};
    int n;
    in>>n;
    vector<int> a(n),b(n),p(n),v(n);
    vector<ll> s(n+1);
    fr(i,n) in>>a[i]>>b[i],p[i]=i,S+=a[i];
    sort(p.begin(),p.end(),[&](int i,int j){
        return max(a[i],b[i])>max(a[j],b[j]);
    });
    for(int i=0,j=p[0];i<n;++i,j=p[i]){
        s[i+1]=s[i]+max(a[j],b[j]);
        v[j]=i;
    }
    using ld=long double;
    ld x=0,nx;
    ll ap=0,aq=1;
    for(auto i:p){
        int j=lower_bound(s.begin(),s.end(),S-b[i])-s.begin();
        if(v[i]>=j){
            if(S-s[j]<0) continue;
            nx=(ld)((ll)(n-j)*b[i]-S+s[j])/((ll)n*b[i]);
            if(nx>x){
                x=nx;
                rat r((ll)(n-j)*b[i]-S+s[j],(ll)n*b[i]);
                ap=r.p,aq=r.q;
            }
        }
        else{
            j=lower_bound(s.begin(),s.end(),S+max(a[i],b[i])-b[i])-s.begin();
            if(S-s[j]+max(a[i],b[i])<0) continue;
            nx=(ld)((ll)(n-j+1)*b[i]-S+s[j]-max(a[i],b[i]))/((ll)n*b[i]);
            if(nx>x){
                x=nx;
                rat r((ll)(n-j+1)*b[i]-S+s[j]-max(a[i],b[i]),(ll)n*b[i]);
                ap=r.p,aq=r.q;
            }
        }
    }
    cout<<ap<<" "<<aq<<endl;
}

Measured memory_bytes: 2560
#pragma comment(linker, "/STACK:512000000")
#define _CRT_SECURE_NO_WARNINGS
//#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve(bool);
void precalc();
clock_t start;
int main() {
#ifdef AIM
  freopen("/home/alexandero/ClionProjects/ACM/input.txt", "r", stdin);
  //freopen("/home/alexandero/ClionProjects/ACM/output.txt", "w", stdout);
  //freopen("out.txt", "w", stdout);
#else
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
#endif
  start = clock();
  int t = 1;
  cout.sync_with_stdio(0);
  cin.tie(0);
  precalc();
  cout.precision(10);
  cout << fixed;
  //cin >> t;
  int testNum = 1;
  while (t--) {
    //cout << "Case #" << testNum++ << ": ";
    //cerr << testNum << endl;
    solve(true);
    //cerr << testNum - 1 << endl;
  }
  cout.flush();
#ifdef AIM1
  while (true) {
      solve(false);
  }
#endif

#ifdef AIM
  cerr << "\n\n time: " << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

  return 0;
}

//BE CAREFUL: IS INT REALLY INT?

template<typename T>
T binpow(T q, T w, T mod) {
  if (!w)
    return 1 % mod;
  if (w & 1)
    return q * 1LL * binpow(q, w - 1, mod) % mod;
  return binpow(q * 1LL * q % mod, w / 2, mod);
}

template<typename T>
T gcd(T q, T w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
template<typename T>
T lcm(T q, T w) {
  return q / gcd(q, w) * w;
}

void precalc() {

}

template<typename T>
void relax_min(T& cur, T val) {
  cur = min(cur, val);
}

template<typename T>
void relax_max(T& cur, T val) {
  cur = max(cur, val);
}

//#define int li
//const int mod = 1000000007;


void solve(bool read) {
  int n, p;
  cin >> n >> p;
  p %= 2;
  int odd = 0, even = 0;
  for (int i = 0; i < n; ++i) {
    int cur;
    cin >> cur;
    if (cur & 1) {
      ++odd;
    } else {
      ++even;
    }
  }

  li res = (1LL << even);
  if (odd == 0) {
    if (p == 1) {
      cout << 0 << endl;
    } else {
      cout << res << endl;
    }
    return;
  }

  res = res * (1LL << (odd - 1));

  cout << res << endl;

}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int ls[3][3];vector<int> up(101,0);
	for(int u=0;u<3;u++){
		for(int v=0;v<3;v++){
			cin>>ls[u][v];}}
	int u,v,an=0,n,f=1;cin>>n;
	while(n--){
		int a;cin>>a;up[a]=1;}
	for(u=0;u<3;u++){f=1;
		for(v=0;v<3;v++){
					if(!up[ls[v][u]]){f=0; break;}}
					an+=f;if(an)break;}
	for(u=0;u<3;u++){f=1;
		for(v=0;v<3;v++){
					if(!up[ls[u][v]]){f=0; break;}}
					an+=f;if(an)break;}f=1;
		for(u=1;u<3;u++) if(!up[ls[u][u]]) f=0;
		if(f) an++;
		if(up[ls[1][1]]&&up[ls[0][2]]&&up[ls[2][0]]) an++;
		cout<<(an? "Yes":"No");
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define MOD 1000000007
#define pb push_back
#define cy cout<<"Yes\n"
#define cn cout<<"No\n"
typedef long long int ll;
int main()
{
    ll sum=0,cnt=0;
    ll n,a,b,c,d;
    cin>>a>>b>>c>>n;
    sum+=(a-c);
    if(a+b+c<n)
        cout<<sum<<endl;
    else if(n<=a+b)
    {
        cout<<min(n,a)<<endl;
    }
    else
    {
         n=n-(a+b);
         cout<<a-n<<endl;
    }
    //main();

}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define all(box) box.begin(), box.end()

using namespace std;

using P = pair<int,int>;
using ll = long long;

const long long INF = LLONG_MAX/3;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
inline void Yes (bool condition) { if(condition) { cout << "Yes" << endl; } else { cout << "No" << endl;} }

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[b]+=siz[a];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

long long gcd(long long a,long long b){
    if(b==0)return a;
    return gcd(b,a%b);
}
long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

const int MOD=998244353;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
template< typename T >
struct BinaryIndexedTree {
  vector< T > data;

  BinaryIndexedTree(int sz) {
    data.assign(++sz, 0);
  }

  T sum(int k) {
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  void add(int k, T x) {
    for(++k; k < data.size(); k += k & -k) data[k] += x;
  }
};

signed main(){
	string s;
	cin>>s;
	int n=s.size();
	int cnt[26]={};
	rep(i,n)cnt[s[i]-'a']++;
	int ret=0;
	rep(i,26)ret+=cnt[i]*(n-cnt[i]);
	cout<<ret/2+1<<endl;
}


Measured memory_bytes: 640
// input! macro is published in the following URLs.
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
// https://github.com/tanakh/competitive-rs.git
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        txys: [(i64, i64, i64); n],
    }
    for w in vec![(0, 0, 0)]
        .iter()
        .chain(&txys)
        .collect::<Vec<_>>()
        .windows(2)
    {
        let t = w[1].0 - w[0].0;
        let d = (w[1].1 - w[0].1).abs() + (w[1].2 - w[0].2).abs();
        if ((d % 2 == 0 && t % 2 == 0) || (d % 2 == 1 && t % 2 == 1)) && t >= d {
            continue;
        } else {
            println!("No");
            return;
        }
    }
    println!("Yes");
}


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

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

vector< pair<int, int> > X;

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

    int N;
    cin >> N;

    for(int i=1; i<=N; i++)
    {
        int x, len;
        cin >> x >> len;

        X.push_back({x - len, x + len});
    }

    sort(X.begin(), X.end());

    int ans = 0, done = - inf;

    for(auto x : X)
    {
        int L = x.first, R = x.second;

        if(L >= done)
            ans++, done = R;
        else
            done = min(done, R);
    }

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


Measured memory_bytes: 1400
using System;
class Program
{
    static void Main(string[] args)
    {
        int[] a = new int[6];
        for(int i = 0; i < 6; i++)
        {
            a[i] = int.Parse(Console.ReadLine());
        }
        bool isYay = true;
        for (int i = 0; i < 5; i++)
            for (int j = i + 1; j < 5; j++)
            {
                if ((a[j] - a[i]) > a[5])
                {
                    isYay = false;
                }
            }
        Console.WriteLine(isYay ? "Yay!" : ":(");
    }
}

Measured memory_bytes: 11092
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
int ceil(int a, int b) {
    return (a + b - 1) / b;
}
int round(int a, int b) {
    return (a + b / 2) / b;
}
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    int A, B;
    cin >> A >> B;
    if (A + B < 10) {
        cout << A + B << endl;
    } else {
        cout << "error" << endl;
    }
    return 0;
}


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

  using namespace std;
  using namespace std::chrono; 

  typedef long long int ll;

  #define MOD (ll)(1e9+7)
  #define endl "\n"
  #define pb push_back
  #define TEST_CASES  ll t;cin>>t;while(t--)
  #define forn(i,a,n) for (int i = a; i < n; ++i)
  #define f first
  #define s second
  #define all(x) x.begin(), x.end()

  void __print(int x) {cerr << x;}
  void __print(long x) {cerr << x;}
  void __print(long long x) {cerr << x;}
  void __print(unsigned x) {cerr << x;}
  void __print(unsigned long x) {cerr << x;}
  void __print(unsigned long long x) {cerr << x;}
  void __print(float x) {cerr << x;}
  void __print(double x) {cerr << x;}
  void __print(long double x) {cerr << x;}
  void __print(char x) {cerr << '\'' << x << '\'';}
  void __print(const char *x) {cerr << '\"' << x << '\"';}
  void __print(const string &x) {cerr << '\"' << x << '\"';}
  void __print(bool x) {cerr << (x ? "true" : "false");}

  template<typename T, typename V>
  void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  template<typename T>
  void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  void _print() {cerr << "]\n";}
  template <typename T, typename... V>
  void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  #ifndef ONLINE_JUDGE
  #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
  #else
  #define debug(x...)
  #endif
  
  ll powD(ll x,ll y){
    ll res = 1;
    while(y > 0){
      if(y & 1)
        res = (res*x)%MOD;
      x = (x*x)%MOD;
      y = y>>1;
    }
    return res;
  }


  /*CHECK FOR CORNER CASES FOR GOD'S SAKE*/
  int main()
  {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,d;
    cin>>n>>d;
    ll cnt = 0;
    forn(i,0,n){
      ll x,y;
      cin>>x>>y;
      if(x*x + y*y <= d*d)
        cnt++;
    }
    cout<<cnt<<endl;

  }
   
  


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
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; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll a[3],ans=1;
    cin>>a[0]>>a[1]>>a[2];
    sort(a,a+3);
    for (ll i=1;i<3;i++){
        if (a[i]!=a[i-1])ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 764
N = int(input())
An = sorted(list(map(int, input().split())))
Bn = sorted(list(map(int, input().split())))
Cn = sorted(list(map(int, input().split())))

import bisect
total = 0
for B in Bn:
    ai = bisect.bisect_left(An, B)  # この index より手前は自分より真に小さい
    ci = bisect.bisect_right(Cn, B) # この index より後ろは自分より真に大きい
    total += ai*(N-ci)
print(total)


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

typedef long long ll;
typedef pair<ll, ll> P;


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    ll n, k; cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    rep(i, n-k) {
        if(a[k+i] > a[i]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

ll my_gcd(ll a, ll b) {
    if(b == 0) return a;
    return my_gcd(b, a%b);
}

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 4808
#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9+7;
typedef long long int lli;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<lli> vlli;
typedef vector<bool> vb;
long long int max(long long int a,long long int b){
  if(a>b)
    return a;
  else
    return b;
}
long long int min(long long int a,long long int b){
  if(a<b)
    return a;
  else
    return b;
}
long long int binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % m;
      a = a * a % m;
      b >>= 1;
    }
  return res;
}
long long binpow(long long a, long long b) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2);
    if (b % 2)
        return res * res * a;
    else
        return res * res;
}
 
//############################ENDOFTEMPLATE############################

void solve(){
  int x,y,a,b,c;
  cin>>x>>y>>a>>b>>c;

  vi p(a),q(b),r(c);
  for(int i = 0;i<a;i++){
    cin>>p[i];
  }

  for(int i = 0;i<b;i++){
    cin>>q[i];
  }

  for(int i = 0;i<c;i++){
    cin>>r[i];
  }

  priority_queue<lli,vector<lli>,greater<lli>> pq;

  sort(p.rbegin(),p.rend());
  sort(q.rbegin(),q.rend());
  sort(r.rbegin(),r.rend());

  for(int i = 0;i<x;i++){
    pq.push(p[i]);
  }
  for(int i = 0;i<y;i++){
    pq.push(q[i]);
  }

  lli ans = 0;

  for(int i = 0;i<c;i++){
    if(r[i]>pq.top()){
      pq.pop();
      ans+=r[i];
    }
  }

  while(!pq.empty()){
    ans+=pq.top();
    pq.pop();
  }

  cout<<ans;




}

 
 
 
 
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  //freopen("moobuzz.in","r",stdin);
  //freopen("moobuzz.out","w",stdout);
  int t = 1;
  //cin>>t;
  while(t--){
    solve();
  }
}

Measured memory_bytes: 6472
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll a,b,c;
  cin >> a >> b >> c;
  if(a == b)cout << c << endl;
  else if(a == c)cout << b << endl;
  else cout << a << endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; -i)
#define INF (1 << 20)
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int N;

int main() {
	int tp = 0, hp = 0;
	scanf("%d", &N);
	rep(i, N) {
		string t, h;
		cin >> t >> h;
		if(t > h) tp += 3;
		else if(t < h) hp += 3;
		else ++tp, ++hp;
	}
	printf("%d %d\n", tp, hp);
	return 0;
}

Measured memory_bytes: 3260