akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define mod 1000000007

using namespace std;

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

void comb(vector<vector <long long int> > &v){
  for(int i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(int k = 1;k <v.size();k++){
    for(int j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j])%mod;
    }
  }
}

ll C(ll a,ll b){
    ll ans = 1;
    ll j = 2;
    for(ll i=0; i<min(b,a-b); i++){
        ans *= a-i;
        while(ans%j==0){
            if(j==min(b,a-b)+1)break;
            ans /= j, j++;
        }
    }
    return ans%mod;
}

int main(){
    ll n, k;
    cin >> n >> k;
    vector<vector<long long int> > v(2000,vector<long long int>(2000+1,0));
    comb(v);
    for(ll i = 1; i <= k; i++){
        ll ad = 0;
        ad = v[k-1][i-1];
        ad = (ad*v[n-k+1][i])%mod;
        cout << ad << endl;
    }
    return 0;
}

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

using namespace std;

int main() {
	int x;
	cin >> x;
	int y = 360 - x;

	cout << min(360 * x / __gcd(360, x) / x, 360 * y / __gcd(360, y) / y) << '\n';

	return 0;
}

Measured memory_bytes: 3632
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

const int N = 2e5 + 20 , mod = 1e9 + 7 ;
const ll inf = 1e18 + 20 ;

int n , m , S , T ;

ll dist[2][N] ;
int num[2][N] ;
vector <pii> g[N] ;
vector <pair <pii , int>> edges ;

int ans ;

inline void add (int &a , int b) {
	a += b ;
	if (a >= mod) a -= mod ;
}

inline void dijk (int S , ll dist[N] , int num[N]) {
	for (int i = 0 ; i < n ; i ++)
		dist[i] = inf , num[i] = 0 ;

	dist[S] = 0 ;
	num[S] = 1 ;

	set <pair <ll , int>> st ;

	st.insert({0 , S}) ;

	while (_sz(st)) {
		int v = st.begin() -> S ;

		st.erase(st.begin()) ;

		for (pii ed : g[v]) {
			int u = ed.F , w = ed.S ;

			if (dist[v] + w < dist[u]) {
				st.erase({dist[u] , u}) ;
				num[u] = 0 ;
				dist[u] = dist[v] + w ;
				st.insert({dist[u] , u}) ;
			}		
		
			if (dist[v] + w == dist[u]) add(num[u] , num[v]) ;
		}
	}
}

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

	cin >> n >> m ;
	cin >> S >> T ;
	S -- , T -- ;

	for (int i = 0 , u , v , w ; i < m ; i ++) {
		cin >> u >> v >> w ;
		u -- , v -- ;
	
		g[u].push_back({v , w}) ;
		g[v].push_back({u , w}) ;

		edges.push_back({{u , v} , w}) ;
	}

	dijk(S , dist[0] , num[0]) ;
	dijk(T , dist[1] , num[1]) ;

	ans = 1ll * num[0][T] * num[1][S] % mod ;

	for (int i = 0 ; i < n ; i ++) {
		if (dist[0][i] == dist[1][i] && dist[0][i] + dist[1][i] == dist[0][T]) {
			add(ans , mod - 1ll * num[0][i] * num[1][i] % mod * num[0][i] % mod * num[1][i] % mod) ; 	
		}
	}

	for (int i = 0 ; i < m ; i ++) {
		int u = edges[i].F.F , v = edges[i].F.S , w = edges[i].S ;

		if (dist[0][u] > dist[0][v]) swap(u , v) ;

		if (dist[0][u] + w + dist[1][v] == dist[0][T] && 2 * dist[0][u] < dist[0][T] && 2 * dist[1][v] < dist[0][T]) {
			add(ans , mod - 1ll * num[0][u] * num[1][v] % mod * num[0][u] % mod * num[1][v] % mod) ;
		}
	}

	cout << ans << '\n' ;
}


Measured memory_bytes: 23852
#include <cstdio>
#include <cstring>
#include <algorithm>
#define lf (x<<1)
#define rg (lf|1)
#define mem(a) memset(a,0,sizeof(a))
#define rep(i,j,k) for (i=j;i<=k;i++)
using namespace std;
const int N=5e5+5,INF=1e9;
int n,k,wh,mode,i,a[N],p[N],deg[N],out[N];
int Min[N*4],cs[N*4],dec[N*4];
int sum[N];
template <typename T> void read(T &ret)
{
	char ch; ret=0;
	for (ch=getchar();ch<'0' || ch>'9';ch=getchar());
	for (;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
}
int lowbit(int x) {return x&(-x);}
void add(int x) {
	while (x<=n) { sum[x]++; x+=lowbit(x); }
}
int query(int x) {
	if (x<1) return 0;
	if (x>n) x=n;
	int ret=0; while (x>0) {ret+=sum[x]; x-=lowbit(x);}
	return ret;
}
void merge(int x)
{
	Min[x]=min(Min[lf],Min[rg]);
	cs[x]=min(cs[lf],cs[rg]);
}
void build(int x,int l,int r)
{
	if (l==r)
	{
		if (!deg[l]) { Min[x]=INF; cs[x]=l; }
		else Min[x]=deg[l],cs[x]=INF;
		return ;
	}
	int mid=(l+r)>>1;
	build(lf,l,mid);
	build(rg,mid+1,r);
	merge(x);
}
void Init()
{
//	freopen("permutation.in","r",stdin);
//	freopen("permutation.out","w",stdout);
	read(n); read(k);
	rep(i,1,n) read(a[i]),p[a[i]]=i;
	rep(i,1,n) {
		deg[p[i]]=query(p[i]+k-1)-query(p[i]-k);
		add(p[i]);
	}
	build(1,1,n);
}
void pushdown(int x)
{
	Min[lf]-=dec[x]; dec[lf]+=dec[x];
	Min[rg]-=dec[x]; dec[rg]+=dec[x];
	dec[x]=0;
}
void recalc(int x,int l,int r)
{
	if (l==r)
	{
		if (Min[x]<1) {
			Min[x]=INF; cs[x]=l;
		}
		return;
	}
	int mid=(l+r)>>1;
	pushdown(x);
	if (Min[lf]<1) recalc(lf,l,mid);
	if (Min[rg]<1) recalc(rg,mid+1,r);
	merge(x);
}
void modify(int x,int L,int R,int l,int r)
{
	if (l>R || r<L) {
		if (Min[x]<1) recalc(x,l,r);
		return;
	}
	if (L<=l && r<=R)
	{
		if (mode==1) cs[x]=INF;
		else {
			Min[x]--; dec[x]++;
		}
		if (Min[x]<1) recalc(x,l,r);
		return ;
	}
	int mid=(l+r)>>1;
	pushdown(x);
	modify(lf,L,R,l,mid);
	modify(rg,L,R,mid+1,r);
	merge(x);
}
void Solve()
{
	int L,R;
	rep(i,1,n)
	{
		wh=cs[1];
		out[wh]=i;
		mode=1;
		modify(1,wh,wh,1,n);
		mode=2;
		L=max(1,wh-k+1); R=min(n,wh+k-1);
		modify(1,L,R,1,n);
	}
}
void Outit()
{
	rep(i,1,n) printf("%d\n",out[i]);	
}
int main()
{
	Init();
	Solve();
	Outit();
	return 0;
}

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

int main() {
    int N;
    string S; 
    cin >> N;
    cin >> S;
    string P;
    int ans=0;
    for(int i=0; i<1000; i++){
        if(i<10) P="00"+to_string(i);
        else if(10<=i&&i<100) P='0'+to_string(i);
        else P=to_string(i);
        int now=0;
        for(int j=0; j<N; j++){
            if(P.at(now)==S.at(j)){
                if(now==0) now=1;
                else if(now==1) now=2;
                else{
                    ans++;
                    break;
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3688
#include<bits/stdc++.h>
#define ll long long

std::deque <std::pair <int, double>> dq;

int n, l;

int main(){
	scanf("%d%d", &n, &l);
	double sum = 0;
	for (int i = 0, v, t; i < n; ++ i){
		scanf("%d%d", &t, &v);
		int now = l;
		while (dq.size() && now - dq.back().first + v >= l){
			now -= dq.back().first;
			sum -= dq.back().second;
			dq.pop_back();
		}
		if (!dq.size()){
			dq.push_front({v, 1ll * t * v});
			sum = 1ll * t * v;
			printf("%.10lf\n", 1.0 * t);
			continue;
		}
		int x = dq.back().first;
		double y = dq.back().second;
		std::pair <int, double> p = {l - v - now + x, y / x * (l - v) + y - y * now / x};
		sum += p.second - y + 1ll * t * v;
		dq.pop_back();
		dq.push_back(p);
		printf("%.10lf\n", sum / l);
		p = {v, 1ll * t * v};
		while (dq.size() && p.first * dq.front().second >= p.second * dq.front().first){
			p = {p.first + dq.front().first, p.second + dq.front().second};
			dq.pop_front();
		}
		dq.push_front(p);
	}
	return 0;
}

Measured memory_bytes: 18708
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
typedef pair<ll,ll> P;
typedef pair<double,double> point;
const ll MAX = 500005;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll D,C = 26;
    cin >> D;
    vector<ll> c(C);
    vector<vector<ll>> s(D,vector<ll>(C));
    cins(all(c));
    rep(i,D){
        rep(j,C){
            cin >> s[i][j];
        }
    }
    ll cnt = 0;
    rep(i,C) cnt += c[i];
    vector<ll> t(D,-1);
    ll m = 0;
    rep(i,C-1){
        ll cn = 365/(365*c[i]/cnt+1);
        for (ll j = i;j < D;j += cn-1){
            if (t[j] == -1) t[j] = i+1;
        }
    }
    rep(i,D){
        if (t[i] == -1) t[i] = C;
    }
    rep(i,D) PRINT(t[i]);
}


Measured memory_bytes: 3752
n = STDIN.gets.to_i
for i in 0.. n-1
  d = STDIN.gets.split(//)
  for j in 0.. d.length-1
    d[j] = d[j].to_i
  end
  puts (d.sort!.reverse!*"")[0..7].to_i - (d.reverse!*"").to_i
end

Measured memory_bytes: 2332
s = list(input())
t = list(input())

ans = []
for i in range(len(s)-len(t)+1):
    if s[i] == '?' or s[i] == t[0]:
        ok = True
        j = 1
        while j < len(t) and ok:
            if s[i+j] == '?' or s[i+j] == t[j]:
                j += 1
                continue
            else:
                ok = False
        if ok:
            f = [x for x in s]
            for j in range(len(t)):
                f[i+j] = t[j]
            for j in range(i+1,len(s)):
                if f[j] == '?':
                    f[j] = 'a'
            f = "".join(f)
            ans.append(f)
    if s[i] == '?':
        s[i] = 'a'

if ans:
    print(sorted(ans)[0])
else:
    print("UNRESTORABLE")


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int r = scanner.nextInt();
			System.out.println((r < 1200) ? "ABC" : (r < 2800) ? "ARC" : "AGC");
		}
	}
}


Measured memory_bytes: 35776
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string s;
	int a,b;
	while(cin>>s>>a>>b){
		cout<<s<<" "<<a+b<<" "<<a*200+b*300<<endl;
	}
}

Measured memory_bytes: 1200
p = 10 ** 9 + 7
N = (10 ** 5)*2 +10  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p


N, K = map(int,input().split())

ans = [1]

# i人が動いた
# iのときi-1を再現可能
# iを考えるときi部屋は空になる
# 残りのn-i部屋から選ぶ
# 1,6,3

for  i in range(1,N+1):
    mm1 = cmb(N,i,p)
    # mm2 = (cmb(N-i,1,p)*ans[i-1])%p
    # nHr n:n-i, r:i
    mm2 = cmb(N-i+i-1,i,p)

    ans.append((mm1*mm2)%p)

mm = 0
for i in range(min(N+1,K+1)):
    mm += ans[i]
    mm %= p
print(mm)

# print(15*14)
# print(*ans)







Measured memory_bytes: 35088
N = int(input())
P_s = list(map(int, input().split()))

orders = [i + 1 for i in range(N)]
total = 0

for i in range(N - 1):
    p = P_s[i]
    n = orders[i]
    
    if (n == p):
        tmp = P_s[i]
        P_s[i] = P_s[i + 1]
        P_s[i + 1] = tmp
        
        total += 1

if (P_s[N - 1] == N):
    total += 1

print(total)


Measured memory_bytes: 14008
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007



string s, ha, ha2;
ll ans = 0, c[110000], now = 0;
int main() {
	cin >> s;
	ha = s;
	REP(i, ha.size()) {
		if (ha.size() == 0)break;
		while (ha[i] == 'x') {
			ha.erase(ha.begin() + i);
			if (ha.size() == 0)break;
		}
	}
	ha2 = ha;
	reverse(ALL(ha2));
	if (ha2 != ha) {
		cout << -1 << endl;
		return 0;
	}
	REP(i, s.size()) {
		if (s[i] != 'x')now++;
		else c[now]++;
	}
	REP(i, (ha.size() + 1) / 2) {
		if (ha.size() % 2 == 0 and i == ha.size() / 2)continue;
		ans += abs(c[ha.size() - i] - c[i]);
	}
	cout << ans << endl;
}


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

int main(){
  int A,B,C;
  cin>>A>>B>>C;

  if(A==B&&B==C){
    cout<<"No"<<endl;
  }else if(A!=B&&B!=C&&C!=A){
    cout<<"No"<<endl;
  }else{
    cout<<"Yes"<<endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> h(n);
	rep(i,n) cin >> h[i];
	vector<vector<int>> to(n);
	rep(i,m) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		to[a].push_back(b);
		to[b].push_back(a);
	}

	int ans = 0;
	rep(i,n) {
		bool b = true;
		for (int j: to[i]) {
			if (h[i] <= h[j]) b = false;
		}
		if (b) ans++;
	}
	cout << ans << endl;
}

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

int solve(int x){
	int res=0;
	while(x){
		res+=x%10;
		x/=10;
	}
	return res;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	int ans=1e9;
	for(int i=1;i<n;i++)
		ans=min(ans,solve(i)+solve(n-i));
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;cin>>n>>k;int cnt=0;
	for(int i=1;i<=n;i++)
	{
		int x;cin>>x;
		if(x>=k) cnt++;
	}
	cout<<cnt<<endl;
 } 

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

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

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;

const int DEBUG = 0;

int calc(const VI &v) {
  int n = v.size();
  if (n <= 1) {
    return 0;
  }
  if (n == 2) {
    return max(v[0], v[1]);
  }
  vector<VI> dp(n + 1, VI(3, -1e8));
  const int inf = 1e8;
  dp[0][0] = 0;
  REP(i, 0, n) {
    int ma = -inf;
    ma = max(ma, dp[i][1] + v[i] - 1);
    ma = max(ma, dp[i][2] + 1);
    ma = max(ma, dp[i][0]);
    dp[i + 1][0] = ma;

    ma = -inf;
    if (v[i] > 1) {
      ma = max(ma, dp[i][1] + v[i] - 1);
      ma = max(ma, dp[i][2] + 2);
    }
    ma = max(ma, dp[i][0] + 1);
    dp[i + 1][1] = ma;

    ma = -inf;
    if (v[i] > 1) {
      ma = max(ma, dp[i][2] + v[i] - 1);
      ma = max(ma, dp[i][1] + v[i] - 2);
    }
    ma = max(ma, dp[i][0] + v[i] - 1);
    dp[i + 1][2] = ma;
    if (DEBUG) {
      cerr << "dp[" << i+1 << "]";
      REP(j, 0, 3) {
	cerr << " " << dp[i+1][j];
      }
      cerr << endl;
    }
  }
  return dp[n][0];
}


int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<VI> seg;
  VI cur;
  int onelen = 0;
  REP(i, 0, s.length()) {
    if (s[i] == '0') {
      if (onelen == 0 && cur.size() > 0) {
	// cut
	seg.push_back(cur);
	cur.clear();
      } else {
	if (onelen > 0) {
	  cur.push_back(onelen);
	  onelen = 0;
	}
      }
    } else {
      onelen += 1;
    }
  }
  if (onelen > 0) {
    cur.push_back(onelen);
    onelen = 0;
  }
  if (cur.size() > 0) {
    seg.push_back(cur);
    cur.clear();
  }
  if (0) {
    cerr << "seg:" << endl;
    for (auto v: seg) {
      for (int t: v) {
	cerr << " " << t;
      }
      cerr << endl;
    }
  }
  int tot = 0;
  for (VI v: seg) {
    tot += calc(v);
  }
  cout << tot << endl;
}


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

string rep(int a, int b, string c, string d){
	string s1=c, s2=d;
	s1=s1.replace(a,b-a+1,s2);
return s1;
}

string rev(int a, int b, string c){
	string s1=c, s2, s3;
	s2=s1.substr(a,b-a+1);
	for(int i=s2.size()-1;i!=-1;i--){s3+=s2[i];}
	s1=s1.replace(a,s3.size(),s3);
return s1;
}

string pri(int a, int b, string c){
	string s1=c;
	s1=s1.substr(a,b-a+1);
return s1;
}

int main(){
	int cnt, a, b;
	string st1, st2, st3;
	cin >> st1 >> cnt;
	for(int i=0;i<cnt;i++){
		cin >> st2;
		if(st2=="replace"){cin >> a >> b >> st3; st1=rep(a, b, st1, st3);}
		else if(st2=="reverse"){cin >> a >> b; st1=rev(a, b, st1);}
		else if(st2=="print"){cin >> a >> b; cout << pri(a,b,st1) << endl;}
	}
return 0;
}

Measured memory_bytes: 1224
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define mod 1000000007
#define exp pow(10,-9)
#define F first
#define S second
#define PB push_back 
#define MP make_pair
#define daman ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define lowercase(str) transform(str.begin(), str.end(), str.begin(), ::tolower);
#define uppercase(str) transform(str.begin(), str.end(), str.begin(), ::toupper);
int main(){
	daman;
	int n;
	cin>>n;
	
	if(n >= 400 && n <= 599)
		cout<<"8\n";
	else if(n>=600&&n<=799)
		cout<<"7\n";
	else if(n>=800&&n<=999)
		cout<<"6\n";
	else if(n>=1000&&n<=1199)
		cout<<"5\n";
	else if(n>=1200&&n<=1399)
		cout<<"4\n";
	else if(n>=1400&&n<=1599)
		cout<<"3\n";
	else if(n>=1600&&n<=1799)
		cout<<"2\n";
	else
		cout<<"1\n";
}

Measured memory_bytes: 3648
fn main() {
    // input
    // N
    let n = read_line::<u32>();

    let ans = n.pow(3);

    println!("{}", ans);
}

#[allow(dead_code)]
fn read_line<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read_line::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define repi(n) rep(i,n)
#define int long long
#define str string
#define vint vector<int>
#define pint pair<int,int>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl
#define call(a) for(auto t:a)cout<<t<<" ";cout<<endl
#define ENDL printf("\n");
#define debg(a) cout<<#a<<":"<<a<<endl;
#define SORT(a) sort(all(a));
#define INF 1LL<<60
#define out(i) cout<<i<<endl;

signed main(){
  int n,t;
  cin>>n>>t;
  vint a(n);
  repi(n)cin>>a[i];
  int res=t;
  rep(i,n-1){
    int dif=abs(a[i]-a[i+1]);
    if(dif>t)res+=t;
    else res+=dif;
  }
  cout<<res<<endl;

  return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define forn(i,a,b) for(int i =a;i<b;i++)
#define fi first
#define se second
#define fast ios_base::sync_with_stdio(false);
using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

bool ok(int m,int x){
	if(100*pow((1.01),m)>=x)
		return true;
	else return false;
}

void solve(){
	ll x;
	cin >> x;	
	ll curr = 100;
	int days = 0;
	while(curr<x){
		curr+=curr/100;
		days++;
	}

	cout << days << endl;

}

int main(){
	fast;
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif

	// int t;cin >> t;while(t--)
		solve();
}

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

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());

    int N;
    int T, A;
    cin >> N >> T >> A;
    int H[N];
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }

    // 平均気温
    double t[N];
    for (int i = 0; i < N; i++) {
        t[i] = T - H[i] * 0.006;
    }

    // Aとの差の絶対値の最小を求める
    double min = DBL_MAX;
    int index = -1;
    for (int i = 0; i < N; i++) {
        double sa = abs(A - t[i]);
        if (sa < min) {
            min = sa;
            index = i;
        }
    }

    cout << index + 1 << endl;
}


Measured memory_bytes: 256
k, n = map(int, input().split())
a = list(map(int, input().split()))

r = []
for i in range(n):
    if i==0:
        r.append(a[n-1] - a[0])
    else:
        r.append((k-a[i]) + a[i-1])
r_min = min(r)

l = []
for i in range(n):
    if i==n-1:
        l.append(a[n-1] - a[0])
    else:
        l.append(a[i] + (k-a[i+1]))
l_min = min(l)

print(min(l_min, r_min))



#r[0] = a[n-1] - a[0]
#r[1] = (k-a[1]) + a[0]
#r[2] = (k-a[2]) + a[1]
#...
#r[n-1] = (k-a[n-1]) + a[n-2]
#
#l[0] = a[0] + (k-a[1]) 
#l[1] = a[1] + (k-a[2]) 
#l[2] = a[2] + (k-a[3])
#...
#l[n-1] = a[n-1] - a[0]


Measured memory_bytes: 29240
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
    
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)

using namespace std;
using ll = long long;
using P = pair<int, int>;
using TP = tuple<ll, ll, ll>;
ll MOD = 1e9+7;
//ll INF = 1LL<<40;
int INF = 1LL<<15;
int xv[4] = {-1, 1, 0, 0};
int yv[4] = {0, 0, -1, 1};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    string S;
    cin >> S;
    vector<int> h(S.size(), 0);
    int N = S.size();
    char prev = ' ';
    int o = 0, e = 0;
    int RIndex = 0; int LIndex = 0;
    REP(i, N){
        if(S[i] == 'R'){
            if(prev == 'L'){
                if(RIndex % 2){
                    h[RIndex] = o;
                    h[LIndex] = e;
                }else{
                    h[RIndex] = e;
                    h[LIndex] = o;
                }
                e=0;
                o=0;
            }
        }else{
            if(prev == 'R'){
                RIndex = i - 1;
                LIndex = i;
            }
        }
        if(i % 2 == 1){
            o++;
        }else{
            e++;
        }
        prev = S[i];
    }
    if(RIndex % 2){
        h[RIndex] = o;
        h[LIndex] = e;
    }else{
        h[RIndex] = e;
        h[LIndex] = o;
    }
    
    REP(i, N){
        cout << h[i];
        if(i != N-1){
            cout << " ";
        }
    }
    
    cout << endl;
    return 0;
}


Measured memory_bytes: 1104
/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class Main {
  static long[] t;
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    String[] s = br.readLine().split(" ");
    int n = Integer.parseInt(s[0]);
    long k = Long.parseLong(s[1]);
    long[] arr = new long[n];
    Pair[] pairs = new Pair[n+1];
    long arrSum = 0;
    for (int i=0; i<n; i++) {
      arr[i] = Long.parseLong(br.readLine());
      arrSum += arr[i];
      pairs[i] = new Pair(i, arrSum-((long)(i+1))*k);
    }
    pairs[n] = new Pair(-1,0);
    Arrays.sort(pairs);

    //System.out.println(Arrays.toString(pairs));
    FT1 ft = new FT1(n+1);
    long sum = 0;
    for (int i=0; i<n+1; i++) {
      Pair p = pairs[i];
      ft.add(p.index+2, 1);
      long prev = sum;
      sum += ft.sum(1,p.index+1);
      //System.out.println(ft.print());
      //System.out.println("Added: "+(sum-prev)+" on insert of: "+p);
    }
    System.out.println(sum);

  }
}
class Pair implements Comparable<Pair> {
  int index;
  long val;
  Pair(int i, long v) {
    index = i;
    val = v;
  }
  public int compareTo(Pair p2) {
    if (val==p2.val)
      return index-p2.index;
    return (val-p2.val) > 0 ? 1 : -1;
  }
  public String toString() {
    return "["+val+","+index+"]";
  }
}
class FT1 {
  int[] arr;
  FT1(int n) {
    arr = new int[n+1];
  }
  int sum(int i, int j) {
    return sum(j)-sum(i-1);
  }
  int sum(int i) {
    int sum=0;
    while (i>0) {
      sum+=arr[i];
      i-=i&-i;
    }
    return sum;
  }
  void add(int i, int delta) {
    if (i<=0)
      return;
    while(i<arr.length) {
      arr[i] += delta;
      i+=i&-i;
    }
  }
  String print() {
    String[] s = new String[arr.length-1];
    for (int i=0; i<s.length; i++) {
      s[i] = ""+ sum(i+1,i+1);
    }
    return String.join(", ",s);
  }
}


Measured memory_bytes: 48812
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>

using namespace std;

#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)

int main() {
	string s,t;
    cin>>s>>t;
    if(s.length()+1!=t.length()){
            cout<<"No";
            return 0;

    }
    fori(s.length()){
        if(s[i]!=t[i]){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
}

Measured memory_bytes: 3620
import java.util.*;
public class Main{
    public static void main(String[]$){
        Scanner i=new Scanner(System.in);
        long a=i.nextLong(),b=i.nextLong(),c=i.nextLong(),k=i.nextLong();
        System.out.println(k%2==0?a-b:b-a);
    }
}

Measured memory_bytes: 23252
def solve():
    N = int(input())

    dic = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
    for i in range(N):
        name = input()
        if name[0] in list('MARCH'):
            dic[name[0]] += 1
    ans = 0
    march = 'MARCH'
    for i in range(5):
        for j in range(i+1, 5):
            for k in range(j+1, 5):
                ans += dic[march[i]] * dic[march[j]] * dic[march[k]]
    print(ans)


solve()

Measured memory_bytes: 3064
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

S = input()
T = input()
ans = 0
for i in range(3):
    if S[i] == T[i]:
        ans += 1

print(ans)


Measured memory_bytes: 4456
#include <iostream>
using namespace std;
int main()
{
	char O;
	cin >> O;
	if (O == 'a' || O == 'e' || O == 'i' || O == 'o' || O == 'u')
	{
		cout << "vowel" << endl;
	}
	else cout << "consonant" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<tuple>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;

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

	return 0;
}

Measured memory_bytes: 256
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

N = int(input())
a = [0] + list(map(int, input().split()))

b = [0 for i in range(N+1)]
c = []
for i in range(N,0,-1):
    ii = 2*i
    s = 0
    while ii <= N:
        s += b[ii]
        ii += i
    s = s % 2
    if s == a[i]:
        b[i] = 0
    else:
        b[i] = 1
        c.append(i)

print(len(c))
if len(c) > 0:
    c = map(str, c)
    print(" ".join(c))


Measured memory_bytes: 118944
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n;
        int x;
        int sum=0;
        while (true) {
            n = sc.nextInt();
            x = sc.nextInt();
            if(n==0 && x==0){
                break;
            }
            int[] num;
            num = new int[n];
            int count;
            for(count=0;count<n;count++){
                num[count] = count + 1;
            }
            int i,j,k;
            for(i=0;i<n-2;i++){
                for(j=i+1;j<n-1;j++){
                    for(k=j+1;k<n;k++){
                        if(num[i]+num[j]+num[k] == x){
                            sum++;
                        }
                    }
                }
            }
        System.out.println(sum);
        sum = 0; 
        }
        sc.close();
    }
}


Measured memory_bytes: 26820
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string a, b;
    cin >> a >> b;
    string c = a + b;
    int num = atoi(c.c_str());

    for(int i = 0; i * i <= num; i++)
    {
        if(i * i == num)
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
use v5.18;
use warnings;
use utf8;
sub line { chomp(my $str = <>); $str; }
sub split_line { (split / /, line) }

my $n = line;
my @cards = sort { $a <=> $b } split_line;
my ($alice, $bob) = (0, 0);
for my $n (0 .. $#cards) {
  my $card = $cards[$n];
  if ($n % 2 == 0) {
    $alice += $card
  } else {
    $bob += $card;
  }
}
say abs $alice - $bob;


Measured memory_bytes: 640
from collections import deque

s = deque(input())

ans = 0
while len(s) > 1:
    if s[0] == s[-1]:
        s.pop()
        s.popleft()
    elif s[0] == 'x':
        s.popleft()
        ans += 1
    elif s[-1] == 'x':
        s.pop()
        ans += 1
    else:
        print(-1)
        break
else:
    print(ans)


Measured memory_bytes: 10128
#include <stdio.h>
#include <limits.h>
#include <math.h>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x);
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))

const int INF = 100000000;
typedef double D;
const double EPS = 1e-8;
const double PI = 3.14159;
int dx[4]={-1, 0, 1, 0}, dy[4]={0, -1, 0, 1};
using namespace std;
typedef pair<int, int> P;

/** Problem0280 : The Outcome of Bonze **/
int main()
{
	int N;
	while (cin>>N, N) {
		vector<int> num(N);
		int field=0;
		
		rep(i, 100) {
			char c; cin>>c;
			if (c=='M') {
				num[i%N]++;
			} else if (c=='S') {
				field += num[i%N]+1;
				num[i%N] = 0;
			} else {
				num[i%N] += field + 1;
				field = 0;
			}
		}
		
		sort(num.begin(), num.end());
		
		cout << num[0];
		REP(i, 1, N) {
			cout << " " << num[i];
		}
		cout << " " << field << endl;
	}
}

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


int main() {

    int64_t n;
    cin>>n;

    vector<int64_t> a(n);
    for(int i=0;i<n;i++){
        cin>>a.at(i);
    }

    sort(a.begin(),a.end(), std::greater<int64_t>());

    if(n%2==0){
        int64_t result=a.at(0);
        for(int i=1;i<=(n-2)/2;i++){
            result+=a.at(i)*2;
        }
        cout<<result<<endl;
    }else{
        int64_t result2=a.at(0);
        for(int i=1;i<=(n-1)/2;i++){
            if(i==(n-1)/2)
                result2+=a.at(i);
            else
                 result2+=a.at(i)*2;
        }
        cout<<result2<<endl;
    }


	return 0;
}

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

using namespace std;

typedef pair<int, int> II;
typedef pair<long long, int> LLI;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<II> VII;

#define For(i,a,b) for(int i = a;i <= b; i++)
#define Rep(i,a,b) for(int i = a;i >= b; i--)
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, f) for(auto i : f)
#define fi first
#define se second
#define pb push_back
#define sz(s) int(s.size())
#define reset(f, x) memset(f, x, sizeof(f))
#define all(x) x.begin(), x.end()
#define two(x) (1LL << x)
#define getbit(x, i) ((x >> (i-1)) & 1LL)
#define onbit(x, i) (x | (1LL << (i-1)))
#define offbit(x, i) (x & ~(1 << (i-1)))

const int N = 2e5+1;

int n, t[N], res, a[N], pos[N], f[N];

int main() {
    ios_base::sync_with_stdio(false);
    //freopen("in.txt","r",stdin);
    //freopen("","w",stdout);
    cin >> n;
    For(i, 1, n) {
        cin >> a[i];
        pos[a[i]] = i;
        f[a[i]] = f[a[i]-1] + 1;
        res = max(res, f[a[i]]);
    }
    cout << n-res;
}




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

using namespace std;

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

    int answer = 700;

    string x;
    cin >> x;

    for(int i = 0; i < x.size(); ++i)
        if(x[i] == 'o')
            answer += 100;

    cout << answer << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <list>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)

int main(){
    ll a,b,k;
    cin >> a >> b >> k;
    vector<int> v;
    v.empty();
    for(int i=1;i<=100;i++){
        if(a%i==0 && b%i==0) v.push_back(i);
    }
    cout << v.at(v.size()-k) << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0L;i--)
#define prep(i,n) for(int64_t i=1;i <= (int64_t)(n);i++)
using namespace std;

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  fspcnt = 0;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int n,tt;
  cin >> n >> tt;
  vector<int64_t> c(n),t(n);
  rep(i,n){
    cin >> c.at(i) >> t.at(i);
  }
  int64_t mincost = 1000000000000;
  rep(i,n){
    if(t.at(i) <= tt){
      mincost = min(mincost,c.at(i));
    }
  }
  if(mincost == 1000000000000){
    cout << "TLE" << endl;
  }else{
    cout << mincost << endl;
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int max(int a,int b){return (a>b ? a:b);}
int min(int a,int b){return (a<b ? a:b);}

int compare_int(const void *a, const void *b){return *(int*)a - *(int*)b;}
//これは昇べきの順のソート

//int compare_int(const void *a, const void *b){return *(int*)b - *(int*)a;}
//これは降べきの順のソート

//qsort(配列, 長さ, sizeof(int), compare_int);

double BS(int array[],int len,int target);


void merge(long long a1[],long long len_a1,long long a2[],long long len_a2,long long a[]){
    long long i = 0,j = 0;
    while(i<len_a1 || j<len_a2){
        if(j>=len_a2 || (i<len_a1 && a1[i]<a2[j])){
            a[i+j] = a1[i];
            i++;
        }else{
            a[i+j] = a2[j];
            j++;
        }
    }
}
void mergeSort(long long a[],long long len_a){
    if(len_a > 1){
        long long m = len_a/2;
        long long n = len_a - m;
        long long a1[m];
        long long a2[n];
        for(long long i = 0;i < m;i++) a1[i] = a[i];
        for(long long i = 0;i < n;i++) a2[i] = a[m+i];
        mergeSort(a1,m);
        mergeSort(a2,n);
        merge(a1,m,a2,n,a);
    }
}
 
//////////////////////////////////////////

char S[100010];

int main(){
    scanf("%s",S);
    int N = strlen(S);

    char S1[N],S2[N];

    for(int i = 0;i < N;i++){
        if(i%2 == 0){
            S1[i] = '0';
            S2[i] = '1';
        }else{
            S1[i] = '1';
            S2[i] = '0';
        }
    }
    int c1 = 0, c2 = 0;

    for(int i = 0;i < N;i++){
        if(S[i] != S1[i])c1++;
        if(S[i] != S2[i])c2++;
    }

    printf("%d\n",min(c1,c2));    
    return 0;
}



///////////////////////////////////////////


double BS(int array[],int len,int target){ //(配列,長さ,見つける値)
    int low,mid,high;

    low = 0;
    high = len-1;

    int mark;

    while(low <= high){
        mid = (low + high) / 2;
        if(array[mid] == target){
            mark = 0;
            break;
        }else if(array[mid] < target){
            low = mid + 1;
            mark = 1;
        }else{
            high = mid - 1;
            mark = -1;
        }
    }
    if(mark == 0){
        return mid; //配列の何番目か（０から）
    }else if(mark == 1){
        return (double)mid + 0.5;//なかったらどこのあいだか
    }else{
        return (double)mid - 0.5;
    }
}


Measured memory_bytes: 512
import java.io.*;
import java.util.*;

public class Main {

	
	public static void main(String[] args) {
		FastScanner in=new FastScanner();
		PrintWriter out=new PrintWriter(System.out);
	//	int t=in.nextInt();
	//	while(t-->0)
		solve(in,out);
		out.close();
	}

    static void solve(FastScanner in,PrintWriter out){
     out.println(Math.abs(in.nextInt()-1));
    }    
	


	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

	
}


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

using namespace std;
#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<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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; }

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

int N, A[21][21];

ll dp[22][1 << 21];

const ll MOD = 1e9 + 7;

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

  cin >> N;

  rep(i, N){
    rep(j, N){
      cin >> A[i][j];
    }
  }

  dp[0][0] = 1;
  rep(i, N){

    for(int bit = 0; bit < 1 << N; bit++){
      if(__builtin_popcount(bit) == i){
        for(int j = 0; j < N; j++){
          if(bit & (1 << j)) continue;
          if(A[i][j] == 1){
            dp[i+1][bit | 1 << j] = (dp[i+1][bit | 1 << j] + dp[i][bit]) % MOD; 
          }
        }
      }
    }
  }

  cout << dp[N][(1<<N)-1] << endl;

  return 0;
}


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

int main(){
  int A,B,C,D;
  int af,bf;
  af=0;
  bf=0;
  cin >> A>> B >> C >> D;

  while(1){
    C=C-B;
    if(C <= 0){
      bf = 1;
      break;
    }
    A=A-D;
    if(A<= 0){
      af=1;
      break;
    }
  }
  if(af==1){
    cout<<"No";
  }else{
    cout << "Yes";
  }
}


Measured memory_bytes: 3128
/*
    Author : DemonStar
*/

#pragma GCC optimize("Ofast")
#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;
typedef long long ll;
#define ordered_set tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define loop(i, n) for(ll i = 0; i < n; i++)
#define mset(v, a) memset(v, a, sizeof v);
#define pl pair<ll, ll>
#define vl vector<ll>
#define endl '\n'
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...);}

#ifdef LOCAL
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};


template <typename T, typename TT>
ostream &operator<<(ostream &os, const pair<T, TT> &t) {
    return os << t.first << " " << t.second;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &t) {
    for (auto &i : t) os << i << " ";
    return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for (T &t : v) is >> t;
    return is;
}
template <typename T1, typename T2>
istream &operator>>(istream &is, vector<pair<T1, T2>> &v) {
    for (pair<T1, T2> &t : v) is >> t.first >> t.second;
    return is;
}

const ll mod = 1e9 + 7;

int main()
{

#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    fast;
    long double a, b;
    cin >> a >> b;
    cout << ll(a * b) << endl;

#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s";
#endif

    return 0;
}


Measured memory_bytes: 3752
#include<stdio.h>
#define MAX 105

int matrix[MAX];
#include<stdio.h>
#include<limits.h>
#define MAX 105

int cost[MAX][MAX];
int matrix[MAX];

void chain(int);

int main(){

	int i,last,n;

	scanf("%d",&n);
	for(i = 0; i < n; i++)
		scanf("%d%d",&matrix[i],&last);
	matrix[n] = last;
	chain(n);
	printf("%d\n",cost[1][n]);
	return 0;
}

void chain(int n){

	int i,j,k,l,min;

	for(i = 1; i <= n; i++)
		cost[i][i] = 0;
	for(l = 2; l <= n; l++){
		for(i = 1; i <= n - l + 1; i++){
			j = i + l -1;
			cost[i][j] = INT_MAX;
			for(k = i; k <= j - 1; k++){
				min = cost[i][k] + cost[k + 1][j] + matrix[i - 1] * matrix[k] * matrix[j];
				if(cost[i][j] > min)
					cost[i][j] = min;
			}
		}
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vchar = vector<char>;
using vvchar = vector<vchar>;

#define rep(i, n) for (int i = 0; i < n; ++i)
#pragma region Debug
istream &operator>>(istream &is, P &a)
{
    return is >> a.first >> a.second;
}
ostream &operator<<(ostream &os, const P &a) { return os << "(" << a.first << "," << a.second << ")"; }

template <typename T>
void view(const std::vector<T> &v)
{
    for (const auto &e : v)
    {
        std::cout << e << " ";
    }
    std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T>> &vv)
{
    for (const auto &v : vv)
    {
        view(v);
    }
}
#pragma endregion

#pragma region UnionFind
struct UnionFind
{
    vector<int> d;
    // d[x] is the index of the parent of x
    // d[x] is -size if x is a root

    UnionFind(int n) : d(vector<int>(n, -1)) {}
    int root(int x)
    {
        if (d[x] < 0)
        {
            return x;
        }
        return d[x] = root(d[x]);
    }

    bool unite(int x, int y)
    {
        x = root(x);
        y = root(y);
        if (x == y)
        {
            return false;
        }
        if (d[x] > d[y])
            swap(x, y); // x always bigger tree

        d[x] += d[y];
        d[y] = x;
        return true;
    }

    bool same(int x, int y)
    {
        return root(x) == root(y);
    }
    int size(int x) { return -d[root(x)]; }
};
#pragma endregion

int main()
{
    int n, q;
    cin >> n >> q;
    UnionFind uft(n);
    rep(_, q)
    {
        int c, x, y;
        cin >> c >> x >> y;
        if (c)
        {
            cout << uft.same(x, y) << endl;
        }
        else
        {
            uft.unite(x, y);
        }
    }

    return 0;
}


Measured memory_bytes: 3148
N=int(input())
T=list(map(int,input().split()))
M=int(input())
P=[0 for k in range(M)]
X=[0 for k in range(M)]
for k in range(M):
    P[k],X[k]=map(int,input().split())
sumT=sum(T)
for k in range(M):
    print(sumT-T[P[k]-1]+X[k])

Measured memory_bytes: 3064