akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>

using namespace std;

int main()
{
  string s;
  cin >> s;
  int result = 753;
  for(int i = 0; i < s.size(); i++)
  {
    string temp;
    for(int j = i; j < i + 3; j++)
    {
      temp.push_back(s[j]);
    }
    int diff = stoi(temp);
    diff = abs(753 - diff);
    result = min(result, diff);
  }
  cout << result << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define PQ priority_queue
#define UM unordered_map
#define US unordered_set
#define ALL(a) (a).begin(),(a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
const ll INF = (1ll << 60);
typedef pair<ll,ll> pii;
int main() {
  string S; cin>>S;
  string T; cin>>T;
  ll N=S.length();
  ll M=T.length();
  vi X(N+1);
  vi Y(M+1);
  REP(i,N)
    if(S[i]=='A') X[i+1]=X[i]+1;
    else X[i+1]=X[i];
  REP(i,M)
    if(T[i]=='A') Y[i+1]=Y[i]+1;
    else Y[i+1]=Y[i];
  ll q; cin>>q;
  REP(i,q) {
    ll a,b,c,d; cin>>a>>b>>c>>d;
    a--; b--; c--; d--;
    ll x=(X[b+1]-X[a])-(b-a+1-(X[b+1]-X[a]));
    ll y=(Y[d+1]-Y[c])-(d-c+1-(Y[d+1]-Y[c]));
    if((x-y)%3==0) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }
}


Measured memory_bytes: 2560
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
using namespace std;
int main(){
    int r,g,b,n;
    cin >> r >> g >> b >> n;
    int ans=0;
    for(int i=0;i<=3000;i++){
        for(int j=0;j<=3000;j++){
            int v = i * r + j * g;
            if(n >= v && (n - v) % b == 0) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;


const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = 0x3f3f3f3f;

int A, B;
char op;

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	cin >> A >> op >> B;
	if (op == '+') {
		cout << A + B << endl;
	} else {
		cout << A - B << endl;
	}
	return 0;
}



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

using namespace std;
typedef long long ll;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    vector<int> v[n+1];
    for(int i=0;i<m;i++)
    {
        int a,b;
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    vector<bool> vis(n+1,0);
    int res=0;
    for(int i=1;i<=n;i++)
    {
        if(vis[i]==1) continue;
        int sz=1;
        queue<int> q;
        q.push(i);
        vis[i]=1;
        while(!q.empty())
        {
            int a=q.front();
            q.pop();
            for(int to:v[a])
            {
                if(vis[to]==1) continue;
                q.push(to);
                vis[to]=1;
                sz++;
            }
        }
        res=max(res,sz);
    }
    cout << res << "\n";
    return 0;
}


Measured memory_bytes: 14800
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <list>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
int main(){
    string s;
    cin >> s;
    if(s == "AAA" or s == "BBB"){
        puts("No");
        
    }else{
        puts("Yes");
    }
}


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

int main(){
    int x;
    cin>>x;
    if(x/200==2)cout<<8<<endl;
    if(x/200==3)cout<<7<<endl;
    if(x/200==4)cout<<6<<endl;
    if(x/200==5)cout<<5<<endl;
    if(x/200==6)cout<<4<<endl;
    if(x/200==7)cout<<3<<endl;
    if(x/200==8)cout<<2<<endl;
    if(x/200==9)cout<<1<<endl;
}

Measured memory_bytes: 3620
N = int(input())
S = input()
b = [0]*N
w = [0]*N
ans = []
for n in range(N):
    if S[n] == '#':
        if n == 0:
            b[n] = 1
        else:
            b[n] = b[n-1] +1
    else:
        if n == 0:
            b[n] = 0
        else:
            b[n] = b[n-1]

    if S[N-1-n] == '.':
        if N-1-n == N-1:
            w[N-1-n] = 1
        else:
            w[N-1-n] = w[N-n] +1
    else:
        if N-1-n == N-1:
            w[N-1-n] = 0
        else:
            w[N-1-n] = w[N-n]

for n in range(N):
    ans.append(b[n]+w[n])


print(min(ans)-1)

Measured memory_bytes: 20964
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {

  int N,M;
  cin>>N>>M;
  
  if(N==1 && M>1){
    cout<<M*(M-1)/2<<endl;
  }
  else if(N>1 && M==1){
    cout<<N*(N-1)/2<<endl;
  }
  else if(N==1 && M==1){
    cout<<0<<endl;
  }
  else{
    cout<<M*(M-1)/2+N*(N-1)/2<<endl;
  }
}
    
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool f[19];

int main(){
  int n,k;
  cin>>n>>k;
  for(int i=0;i<k;i++){
    int d;
    cin>>d;
    f[d]=true;
  }
  while(1){
    int temp=n;
    int cnt=0;
    while(temp!=0){
      if(f[temp%10]==1)cnt++;
      temp/=10;
    }
    if(cnt==0){
      cout<<n<<endl;
      return(0);
    }
    n++;
  }
  return(0);
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};

//a^n (mod)
in modpow(in a, in n, in mod) {
    in res = 1ll;
    while (n > 0ll) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    in n;cin>>n;
    in ans= modpow(10,n,MOD)+modpow(8,n,MOD)-modpow(9,n,MOD)-modpow(9,n,MOD);
    ans %= MOD;
    if(ans<0) ans += MOD;
    cout<<ans<<endl;
}/*
./problem.exe
*/

Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

bool check(int N){
    while(N != 1){
        if(N%2 == 0){
            N /= 2;
        }
        else{
            break;
        }
    }
    if(N != 1) return true;
    else return false;

}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    bool ok = check(N);
    if(!ok){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;

    if(N%2 != 0){
        cout << "1 2" << endl;
        cout << "2 3" << endl;
        cout << 1 << " " << 3+N << endl;
        cout << 3+N << " " << 2+N << endl;
        cout << 2+N << " " << 1+N << endl;

        FOR(i,4,N+1){
            if(i%2 == 0){
                cout << i << " " << 1 << endl;
                cout << i << " " << (i+1)+N << endl;
                cout << i+1 << " " << 1 << endl;
                cout << i+1 << " " << i+N << endl;
            }
        }
    }
    else{
        cout << "1 2" << endl;
        cout << "2 3" << endl;
        cout << 1 << " " << 3+N << endl;
        cout << 3+N << " " << 2+N << endl;
        cout << 2+N << " " << 1+N << endl;

        FOR(i,4,N){
            if(i%2 == 0){
                cout << i << " " << 1 << endl;
                cout << i << " " << (i+1)+N << endl;
                cout << i+1 << " " << 1 << endl;
                cout << i+1 << " " << i+N << endl;
            }
        }

        int base = 1;
        while(base*2 < N){
            base *= 2;
        }
        int rem = N - base + 1;
        if(rem == 3) rem = 3 + N;
        cout << base << " " << N << endl;
        cout << rem << " " << 2*N << endl;
    }


}


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

using namespace std;

#define ll long long int
#define get(a) ll a; cin >> a;
#define show(a) cout << a << endl;
#define full(p) p.begin(), p.end()
#define sz(a) (ll)(a.size())
#define pb push_back

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(10);
	cout<<fixed;
	////////////////////////////////
	get(n);
	std::vector<ll> v;

	for (int i = 0; i < n; ++i)
		{
			get(ni);
			v.push_back(ni);
		}

	// so now that we have all we need;

	ll money = 1000;
	ll stock = 0;

	for (int i = 0; i < n-1; ++i)
	{
		if(v[i+1] > v[i])
		{
			// inc tomorrow;
			stock += money/v[i];
			money  = money%v[i];
			// buy all
		}
		else if(v[i+1] < v[i])
		{
			// dec tomorrow
			money += stock*v[i];
			stock = 0;
			// sell all
		}
	}

	money += stock *v[n-1];
	stock = 0;

	cout <<  money << endl;

	return 0;
}

Measured memory_bytes: 3648
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    n = i_input()
    num_list = i_row(n)

    num_counter = Counter(num_list)

    count = 0

    for v in num_counter.values():
        if v % 2 == 1:
            count += 1

    print(count)

if __name__ == '__main__':
    main()


Measured memory_bytes: 99196
def start_process(high, width, number, color_data):
    ans_data = []
    for i in range(number):
        ans_data += [str(i + 1) for j in range(color_data[i])]
    for i in range(high):
        ans_kari = ans_data[i * width : (i + 1) * width]
        if i % 2 == 1:
            ans_kari = ans_kari[::-1]
        print(' '.join(ans_kari))

def main():
    high, width = map(int, input().split())
    number = int(input())
    color_data = list(map(int, input().split()))
    start_process(high, width, number, color_data)

if __name__ == '__main__':
    main()


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

int main()
{
	int n;
	int a, b;
	std::vector<int> ansa;
	std::vector<int> ansb;
	int sa;
	int sb;
	
	while(1) {
		std::cin >> n;
		if (n == 0) {
			break;
		}
		sa = 0;
		sb = 0;
		for (int i = 0; i < n; i++)
		{
			std::cin >> a >> b;
			if (a > b) {
				sa += a + b;
			}
			else if (a == b) {
				sa += a;
				sb += b;
			}
			else {
				sb += a + b;
			}
		}
		ansa.push_back(sa);
		ansb.push_back(sb);
	}

	for (int i = 0; i < ansa.size(); i++)
	{
		std::cout << ansa[i] << " " << ansb[i] << std::endl;
	}

	return 0;
}

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

using namespace std;

int
main(void){
	int n; cin >> n;
	vector<vector<int> > score(n, vector<int> (3));
	
	for(int i = 0; i < n; i++) cin >> score[i][0] >> score[i][1] >> score[i][2];
	
	vector<int> old_dp(3, INT_MIN);
/*	for(int i = 0; i < n; i++) 
		for(int j = 0; j < 3; j++)
			dp[i][j] = INT_MIN;*/
	
	for(int i = 0; i < 3; i++) old_dp[i] = score[0][i];
	
	for(int i = 1; i < n; i++){
		vector<int> new_dp(3, INT_MIN);
		for(int j = 0; j < 3; j++){
			for(int k = 0; k < 3; k++){
				if(j != k){
					new_dp[j] = max(new_dp[j], old_dp[k] + score[i][j]);
				}
			}
		}
		old_dp = new_dp;
	}
	
	int ans = INT_MIN;
	for(int i = 0; i < 3; i++) ans = max(ans, old_dp[i]);
	
	cout << ans;
	
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

ll pref[211111];
ll x[211111];

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x[i]>>pref[i];
	}
	for(int i=1;i<=n;i++)
	{
		pref[i]+=pref[i-1];
	}
	ll ans=0; ll mini=pref[0]-x[1];
	for(int i=1;i<=n;i++)
	{
		ans=max(ans,pref[i]-x[i]-mini);
		if(i<n) mini=min(mini,pref[i]-x[i+1]);
	}
	cout<<ans<<'\n';
}

Measured memory_bytes: 3456
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BGoldenCoins solver = new BGoldenCoins();
        solver.solve(1, in, out);
        out.close();
    }

    static class BGoldenCoins {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            long x = s.nextLong();
            long ans = 0;
            ans += (1000 * (x / 500));
            x %= 500;
            ans += 5 * (x / 5);
            out.println(ans);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 21460
def main():
    D, G = (int(i) for i in input().split())
    A = [[int(i) for i in input().split()] for j in range(D)]
    ans = 10**6
    for bit in range(1 << D):  # bitが立っている問題のコンプリートボーナスを得る
        cur = 0
        cur_sum = 0
        cur_set = set()
        for j in range(D):
            if (bit & (1 << j)):
                cur += A[j][0]
                cur_sum += A[j][1] + A[j][0] * (100*(j+1))
                cur_set.add(j)
        if cur_sum >= G:
            ans = min(ans, cur)
        else:
            less = G - cur_sum
            for j in range(D)[::-1]:
                if j in cur_set:
                    continue
                solve = (less+(100*(j+1))-1)//(100*(j+1))
                less -= min(solve, A[j][0] - 1) * (100*(j+1))
                cur += min(solve, A[j][0] - 1)
                if less <= 0:
                    ans = min(ans, cur)
                    break
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 41584
#template
from collections import Counter
def inputlist(): return [int(j) for j in input().split()]
#template
N,M,C = inputlist()
B = inputlist()
ans = 0
for i in range(N):
    A = inputlist()
    d =C
    for j in range(M):
        d += A[j]*B[j]
    if d > 0:
        ans +=1
print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
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;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);
// priority_queue<ll, vector<ll>, greater<ll>> pq;


int main(){
    ll n, cnt = 0, ans = 0; cin >> n;
    vector<bool> v(8);
    rep(i, 8) v[i] = false;
    rep(i, n){
        ll a; cin >> a;
        if(a <= 399) v[0] = true;
        else if(a <= 799) v[1] = true;
        else if(a <= 1199) v[2] = true;
        else if(a <= 1599) v[3] = true;
        else if(a <= 1999) v[4] = true;
        else if(a <= 2399) v[5] = true;
        else if(a <= 2799) v[6] = true;
        else if(a <= 3199) v[7] = true;
        else cnt++;
    }
    rep(i, 8){
        if(v[i]) ans++;
    }
    cout << lmax(1, ans) << ' ' << ans + cnt << endl;
}


Measured memory_bytes: 3596
let () =
  let n = read_int () in
  let g = Array.make n [] in
  let rec read i =
    if i < n then
      match List.map int_of_string (Str.split (Str.regexp " ") (read_line ())) with
      | u :: _ :: l -> (g.(u-1) <- l; read (i + 1))
      | _ -> exit 1
  in
  read 0;
  let d = Array.make n (-1) in
  let q = Queue.create () in
  let rec duduwa i = function
    | [] -> ()
    | hd :: tl when d.(hd-1) = (-1) -> (d.(hd-1) <- d.(i) + 1; Queue.add (hd-1) q; duduwa i tl)
    | _ :: tl -> duduwa i tl
  and doit () =
    if not (Queue.is_empty q) then begin
      let i = Queue.take q in
      duduwa i g.(i);
      doit ()
    end
  in
  Queue.add 0 q;
  d.(0) <- 0;
  doit ();
  let rec print i =
    if i < n then (Printf.printf "%d %d\n" (i + 1) d.(i); print (i + 1))
  in
  print 0;

Measured memory_bytes: 2592
using System;
using System.IO;
using System.Linq;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;

public static class P
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var sts = Enumerable.Repeat(0, n).Select(_ => Console.ReadLine().Split()).ToArray();
        var x = Console.ReadLine();
        int res = 0;
        foreach (var st in sts)
        {
            var s = st[0];
            var t = int.Parse(st[1]);
            res += t;
            if (s == x) res = 0;
        }
        Console.WriteLine(res);
    }
}


Measured memory_bytes: 13524
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int main(){
  int N;
  cin>>N;
  string S;
  cin>>S;

  vector<char> v;
  rep(i,N) v.push_back(S[i]);

  v.erase(unique(v.begin(),v.end()),v.end());
  cout<<v.size()<<endl;

  return 0;
}


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

int main () {
int A, B, H, M;
cin >> A >> B >> H >> M ;

long double radA , radB;
radA = 2 * PI / (12.0 * 60.0 ) * ((long double)H * 60.0 + (long double)M ) ;
radB = 2 * PI /  60.0 * ((long double)H * 60.0 + (long double) M ) ;
long double length;
long double radC = radA -radB;
length = (long double)(A*A + B*B) - (long double)(2 *A * B )* cosl(radC);
cout << fixed << setprecision(20);
cout << sqrtl(length) << endl;
return 0;
}

Measured memory_bytes: 4164
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<unordered_set>
#include<unordered_map>
using namespace std;
typedef long long ll;
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod;
ll n,m;
bool ok[100010];
ll f[100010];
int main(){
  cin>>n>>m;
  for(int i=1;i<=n;i++)ok[i]=1;
  for(int i=0;i<m;i++){
      ll x;cin>>x;
      ok[x]=0;
  }
  f[0]=1;
  for(int i=1;i<=n;i++){
      f[i]=0;
      if(ok[i]==0)continue;
      f[i]=f[i-1];
      if(i-2>=0)f[i]=(f[i]+f[i-2])%mod;
  }
  cout<<f[n]<<endl;
  return 0;
}


Measured memory_bytes: 1152
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

class Main {

	static int n;
	static double[] x1, y1, x2, y2;
	static double sx, sy, gx, gy;
	static ArrayList<Integer>[] g;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int q = sc.nextInt();
		while (q-- > 0) {
			long x0, y0, x1, y1, x2, y2, x3, y3;
			x0 = sc.nextLong();
			y0 = sc.nextLong();
			x1 = sc.nextLong();
			y1 = sc.nextLong();
			x2 = sc.nextLong();
			y2 = sc.nextLong();
			x3 = sc.nextLong();
			y3 = sc.nextLong();
			Point p0 = new Point(x0, y0);
			Point p1 = new Point(x1, y1);
			Point p2 = new Point(x2, y2);
			Point p3 = new Point(x3, y3);
			if (linesIntersect(p0, p1, p2, p3)) {
				System.out.println(1);
			} else {
				System.out.println(0);
			}
		}

	}

	static class Point {
		long x, y;
		int id;

		public Point(long x, long y) {
			this.x = x;
			this.y = y;
		}
	}

	static boolean linesIntersect(Point s1, Point d1, Point s2, Point d2) {
		long prd1 = crossProduct(s1, d1, s1, d2) * crossProduct(s1, d1, s1, s2);
		long prd2 = crossProduct(s2, d2, s2, s1) * crossProduct(s2, d2, s2, d1);
		if (prd1 == 0 && prd2 == 0) {
			if (((s2.x - s1.x) * (s2.x - d1.x) <= 0 && (s2.y - s1.y) * (s2.y - d1.y) <= 0)
					|| ((d2.x - s1.x) * (d2.x - d1.x) <= 0 && (d2.y - s1.y) * (d2.y - d1.y) <= 0)
					|| ((s1.x - s2.x) * (s1.x - d2.x) <= 0 && (s1.y - s2.y) * (s1.y - d2.y) <= 0)
					|| ((d1.x - s2.x) * (d1.x - d2.x) <= 0 && (d1.y - s2.y) * (d1.y - d2.y) <= 0)) {
				return true;
			} else
				return false;
		} else
			return prd1 <= 0 && prd2 <= 0;
	}

	static long crossProduct(Point s1, Point d1, Point s2, Point d2) {
		return (d1.x - s1.x) * (d2.y - s2.y) - (d1.y - s1.y) * (d2.x - s2.x);
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Measured memory_bytes: 39892
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	static BufferedReader reader;
	//static field here
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		reader = new BufferedReader(new InputStreamReader(System.in));
		//code here
		String[] strings = readLine();
		int N = Integer.parseInt(strings[0]);
		int[][] x = new int[N][];
		boolean[][] y = new boolean[N][];
		for(int i=0;i<N;i++) {
			strings = readLine();
			int A = Integer.parseInt(strings[0]);
			x[i] = new int[A];
			y[i] = new boolean[A];
			for(int j=0;j<A;j++) {
				strings = readLine();
				x[i][j] = Integer.parseInt(strings[0]);
				y[i][j] = (strings[1].equals("1"));
			}
		}
		
		int max = 0;
		for(int pointer = 0;pointer<Math.pow(2,N);pointer++) {
			boolean succeed = true;
			boolean T[] = new boolean[N];
			int t = 1;
			int cnt = 0;
			for(int i=0;i<N;i++) {
				if((pointer&t)!=0) {
					T[i] = true;
					cnt++;
				}else {
					T[i] = false;
				}
				t*=2;
			}
			if(max>=cnt) {continue;}
			for(int i=0;i<N;i++) {
				if(!T[i]) {continue;}
				for(int j=0;j<x[i].length;j++) {
					if(y[i][j]!=T[x[i][j]-1]) {
						succeed = false;
						break;
					}
				}
				if(!succeed) {break;}
			}
			if(succeed) {max = cnt;}
		}
		
		
		//String[] s = readLine();
		print(max);
	}
	
	//functions here
	//note that all methods should be STATIC

	private static String[] readLine(){
		try{
			return reader.readLine().split(" ");
		}catch(Exception e){
			e.printStackTrace();
			return new String[]{e.getMessage()};
		}
	}
	private static void print(Object o){
		System.out.println(o);
	}
	private static void print(){
		System.out.println();
	}
}

Measured memory_bytes: 21972
#include <iostream>
#include <cmath>
using namespace std;
bool is_suit(int a,int b)
{
	int x=b,len=1;
	while(x>0)
	{
		x=x/10;
		len=len*10;
	}
	int s=a*len+b;
	double y=sqrt(s);
	if(y==(int)y)return true;
	else return false;
}
int main()
{
	int a,b;
	cin>>a>>b;
	if(is_suit(a,b))cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int kaibun(char *s,int l,int r){
	for(int i=l;i<(r-l+1)/2;i++){
		if(s[i]!=s[r+l-i]){
			return 0;
		}
	}
	
	return 1;
}

int main(void){
	char s[99]={0};
	scanf("%s",s);
	
	int n=0;
	for(int i=0;s[i]!=0;i++){
		n++;
	}
	
	if(kaibun(s,0,n-1)==1&&kaibun(s,0,(n-1)/2-1)==1&&kaibun(s,(n+3)/2-1,n-1)==1){
		printf("Yes");
	}else{
		printf("No");
	}
	
	
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b>=c)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    
    return 0;
}

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

using namespace std;

int solve(int a, int b){
    int s, p, m;
    s = a+b;
    p = a*b;
    m = a-b;
    if (s > p && s > m){
        return s;
    }else if (p > s && p > m){
        return p;
    }else{
        return m;
    }
}

int main(){
    int a, b;
    cin >> a >> b;
    cout << solve(a, b);
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(){
  long long int N,i,ans,num;
  ans=0;
  scanf("%lld",&N);
  long long int A[N+1];
  for(i=0;i<N;i++) scanf("%lld",&A[i]);
  for(i=0;i<N-1;i++){
    if(A[i]>A[i+1]){
      num=A[i]-A[i+1];
      ans=ans+num;
      A[i+1]=A[i];
    }
  }
  printf("%lld",ans);
  return 0;
}

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

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

Measured memory_bytes: 3604
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define fi first
#define se second
using namespace std;

int inf = 2147483647;
int64_t inf64 = 9223372036854775807;
int MOD = 1e+7;

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

  int n;
  cin >> n;

  deque<int> res;

  rep(i,n) {
    int num;
    cin >> num;
    int a = abs(n-i);
    if(a % 2 == 0) res.push_back(num);
    if(a % 2 == 1) res.push_front(num);
  }
  for(int x : res) {
    cout << x << " ";
    res.pop_front();
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}
const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  int k, s;cin >> k >> s;
  int ans = 0;
  int z;
  for (int x = 0; x <= k; x++){
    for (int y = 0; y <= k; y++){
      z = s - x - y;
      if(z >= 0 && z <= k){
        // cout << x << " " << y << " " << z << endl;
        ans++;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int n;
  long a, b;
  cin >> n >> a >> b;
  vector<long> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x.at(i);
  }
  long ans = 0;
  for (int i = 0; i < n-1; i++) {
    if ((x.at(i+1)-x.at(i))*a < b) ans += (x.at(i+1)-x.at(i))*a;
    else ans += b;
  }
  cout << ans << endl;
}
      

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

int n,q;
vector<vector<int>> g(200005,vector<int>());
vector<int> ans(200005);

void dfs(int v,int p){
    for(int nv : g[v]){
        if(nv==p) continue;
        ans[nv]+=ans[v];
        dfs(nv,v);
    }
}

int main(){
    cin>>n>>q;
    for(int i=0;i<n-1;i++){
        int a,b;
        cin>>a>>b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i=0;i<q;i++){
        int p,x;
        cin>>p>>x;
        p--;
        ans[p]+=x;
    }
    dfs(0,-1);
    for(int i=0;i<n;i++) cout<<ans[i]<<endl;
}

Measured memory_bytes: 24260
#include<iostream>
#include<stdlib.h>
#include<algorithm>
using namespace std;


int main(void) {
	int m, d;
	int a, b;
	cin >> m >> d >> a >> b;

	if (b == 1) {
		cout << 1;
		return 0;
	}
	cout << 0;
	return 0;
}

Measured memory_bytes: 256
// Problem : A - Takoyaki
// Contest : AtCoder - AtCoder Beginner Contest 176
// URL : https://atcoder.jp/contests/abc176/tasks/abc176_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long
#define db double
#define mod 1000000007
#define pb push_back
#define pp pair<int,int>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define maxn 200005
#define ss second
#define ff first
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
int inv(int a, int b){
 return 1<a ? b - inv(b%a,a)*b/a : 1;
}
void solve()
{
	db n,x,t;
	cin >> n >> x >> t;
	int ans  = ceil(n/x);
	ans*=t;
	cout << ans;
}
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3852
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int dp[305][305],n,m;
string f[305];
int x[305][305][26];
int main(){
	cin >> n >> m;
	for(int i=0;i<n;i++) cin >> f[i];
	int ret = 0;
	for(int ii=1;ii<m;ii++){
		//f[*][ii-1] and f[*][ii]
		rep(i,305)rep(j,305) dp[i][j] = INF;
		dp[0][0] = 0;
		int zip[305][305][2];
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				if(i!=n){
					int v = 0;
					if(i==0||j==0){
						for(int k=0;k<n-i;k++){
							if(0<=k+i-j&&k+i-j<n) v += f[k][ii-1] == f[k+i-j][ii];
						}
					}
					else{
						v = zip[i-1][j-1][0]-(f[n-i][ii-1] == f[n-j][ii]);
					}
					zip[i][j][0] = v;
					dp[i+1][j] = min(dp[i+1][j],dp[i][j]+v);
				}
				if(j!=n){
					int v = 0;
					if(i==0||j==0){
						for(int k=0;k<n-j;k++){
							if(0<=k+j-i&&k+j-i<n) v += f[k][ii] == f[k+j-i][ii-1];
						}
					}
					else{
						v = zip[i-1][j-1][0]-(f[n-j][ii] == f[n-i][ii-1]);
					}
					zip[i][j][1] = v;
					dp[i][j+1] = min(dp[i][j+1],dp[i][j]+v);
				}
			}
		}
		ret += dp[n][n];
	}
	cout << ret << endl;
}

Measured memory_bytes: 1536
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

main()
{
	int a,b,c,d;
	scanf("%d %d %d", &a, &b, &c);
	if (c < a)
	{
		d = a;
		a = c;
		c = d;
	}
	if (b < a)
	{
		d = a;
		a = b;
		b = d;
	}
	if (c < b)
	{
		d = b;
		b = c;
		c = d;
	}
	printf("%d %d %d\n", a, b, c);
}


Measured memory_bytes: 2104
#line 1 "/workspaces/compro/lib/template.hpp"


#line 1 "/workspaces/compro/lib/io/vector.hpp"
#include <iostream>
#include <vector>

#ifndef IO_VECTOR
#define IO_VECTOR

template <class T> std::ostream &operator<<(std::ostream &out, const std::vector<T> &v) {
  int size = v.size();
  for (int i = 0; i < size; i++) {
    std::cout << v[i];
    if (i != size - 1)
      std::cout << " ";
  }
  return out;
}

template <class T> std::istream &operator>>(std::istream &in, std::vector<T> &v) {
  for (auto &el : v) {
    std::cin >> el;
  }
  return in;
}

#endif
#line 4 "/workspaces/compro/lib/template.hpp"
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes, T no) { cout << (val ? yes : no) << "\n"; }

void say(bool val, string yes = "Yes", string no = "No") { say<string>(val, yes, no); }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}

// C++ 17に完全移行したら消す
// 最大公約数を求める
template <class T> T gcd(T n, T m) { return n ? gcd(m % n, n) : m; }

// 最小公倍数を求める
template <class T> T lcm(T n, T m) {
  int g = gcd(n, m);
  return n * m / g;
}

// 重複を消す。計算量はO(NlogN)
template <class T> void unique(std::vector<T> &v) {
  std::sort(v.begin(), v.end());
  v.erase(std::unique(v.begin(), v.end()), v.end());
}


#line 2 "m_solutions2020_a.cpp"

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

  int x;
  cin >> x;
  cout << 8 - (x - 400) / 200 << endl;
}


Measured memory_bytes: 3652
// D - Powerful Discount Tickets
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rp(i,n) for(int i=0;i<(n);i++)
#define allr(x) (x).rbegin(),(x).rend()

int main(){
	int N,M;cin>>N>>M;

	vector<int> A(N);
	vector<pair<int,int>> B;
	rp(i,N){
		int a; cin>>a;
		A[i] = a;
		while(a>0){
			B.push_back(make_pair(a - (a>>1), i));
			a>>=1;
		}
	}

	sort(allr(B));

	vector<int> counting(N);
	rp(i, min(M, (int)B.size())) counting[B[i].second]++;

	ll ans = 0;
	rp(i,N) ans += (ll)A[i]/(1<<counting[i]);
	cout<< ans <<endl;
}

Measured memory_bytes: 35556
house = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
for i in range(int(input())):
    b, f, r, v = map(int, input().split())
    house[b-1][f-1][r-1] += v
for b in range(4):
    for f in range(3):
        house[b][f] = ' ' + ' '.join(map(str, house[b][f]))
    house[b] = '\n'.join(map(str, house[b])) + '\n'
border = '#' * 20 + '\n'
house = border.join(map(str, house))
print(house.rstrip())

Measured memory_bytes: 7752
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll N, A, B;
	cin >> N >> A >> B;

	ll X[100001];
	rep(i, N) cin >> X[i];

	ll kotae = 0;
	rep(i, N - 1) {
		kotae += min((X[i + 1] - X[i]) * A, B);
	}
	co(kotae);

	Would you please return 0;
}

Measured memory_bytes: 1024
let [|N;K|]=stdin.ReadLine().Split() |> Array.map int
let S=stdin.ReadLine()
S |> Seq.pairwise |> Seq.map (fun x->if x=('R','L') then 1 else 0) |> Seq.sum
|> fun x->
    if S.[0]='L' && S.[N-1]='R' then (x,2)
    elif S.[0]='L' || S.[N-1]='R' then (x,1)
    else (x,0)
|> fun (x,y)->
    let a=min x K
    let b=min (K-a) y
    min (N-x*2-y+a*2+b) (N-1)
|> stdout.WriteLine

Measured memory_bytes: 13908
N, M = gets.split(" ").map(&:to_i)
r = 0
R = [false,false,false]
M.times{
  s, c = gets.split(" ").map(&:to_i)
  if s == 1
    if c == 0
      if N != 1
        puts -1
        exit
      end
    end
  end
  if R[s-1] 
    k = r.div(10 ** (N-s)) % 10
    if k == c
     next
    end 
    puts -1
    exit
  end
  r = r + (10 ** (N-s)) * c
  R[s-1] = true
}
if (10 ** (N-1)) > r
  if N != 1
    r = r + (10 ** (N-1))
  end
end
puts r

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define N 200010
int n,a[N],b[N],c[N],d[N];
int main(){
    cin>>n;
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    rep(i,n+1)c[i]=d[i]=0;
    rep(i,n)c[a[i]]++,d[b[i]]++;
    rep(i,n+1){
	if(c[i]+d[i]>n){
	    cout<<"No\n";
	    return 0;
	}
    }
    for(int i=1;i<=n;i++){
	c[i]+=c[i-1];
	d[i]+=d[i-1];
    }
    int x=0;
    for(int i=1;i<=n;i++)x=max(x,c[i]-d[i-1]);
    cout<<"Yes\n";
    rep(i,n){
	if(i)cout<<" ";
	cout<<b[(i+n-x)%n];
    }
    cout<<"\n";
}


Measured memory_bytes: 6748
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		
		sc.close();
		
		if(s.length() == 2) {
			if(s.charAt(0) == s.charAt(1)) {
				System.out.println("1 2");
				return;
			} else {
				System.out.println("-1 -1");
				return;
			}
		} else {
			for(int l = 2; l <= 3; l++) {
				int[] c = new int[26];
				for(int j = 0; j < l; j++) {
					c[s.charAt(j) - 97]++;
				}
				for(int m = 0; m < c.length; m++) {
					if(c[m] > 1) {
						System.out.println("1" + l);
						return;
					}
				}
				
				for(int i = l; i < s.length(); i++) {
					c[s.charAt(i) - 97]++;
					c[s.charAt(i-l) - 97]--;
					for(int m = 0; m < c.length; m++) {
						if(c[m] > 1) {
							System.out.println((i-l+2) + " " + (i+1));
							return;
						}
					}
				}	
			}
		}
				
		System.out.println("-1 -1");
		return;
	}
	
}

Measured memory_bytes: 12924
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int h, w;
    cin >> h >> w;
    vector<vector<char>> board(h + 2, vector<char>(w + 2, '.'));
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            cin >> board[i][j];
        }
    }
    
    for(int i = 1; i <= h; i++){
        for(int j = 1; j <= w; j++){
            if(board[i][j] == '#'){
                if(board[i - 1][j] == '#' || board[i][j - 1] == '#' || board[i + 1][j] == '#' || board[i][j + 1] == '#'){
                    
                }else{
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "Yes" << endl;
    
    /*for(int i = 0; i <= h + 1; i++){
        for(int j = 0; j <= w + 1; j++){
            cout << board[i][j];
        }
        cout << endl;
    }*/
    return 0;
}


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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

int counter[300];

void compute(int n,string s) {
  rep(i,n) if( s[i] != '+' ) {
    ++counter[s[i]-'a'];
  }
  map<int,int> mp;
  rep(i,300) if( counter[i] >= 1 ) ++mp[counter[i]];
  int answer = 0;
  int connect = 0;
  for(map<int,int>::iterator it=mp.begin();it!=mp.end();it++) {
    int coef = it->first;
    int cnt  = it->second;
    //cout << coef << "," << cnt << endl;
    ++connect;
    if( coef == 1 ) {
      answer += (cnt*2-1);
      continue;
    }
    if( cnt == 1 ) {
      answer += 3;
    } else if( cnt >= 2 ) {
      answer += ( 4 + cnt * 2 - 1 );
    }
  }
  --connect;
  answer += connect;
  cout << answer << endl;
}

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  compute(n,s);
  return 0;
}

Measured memory_bytes: 1212