akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace B___Picture_Frame
{
    class Program
    {
        static void Main(string[] args)
        {
            var H_W = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int H = H_W[0], W = H_W[1];
            var Aij = Enumerable.Range(1, H).Select(_ => Console.ReadLine()).ToArray();
            var grid = new List<string>();

            for (int i = 0; i < H; i++)
                grid.Add($"#{Aij[i]}#");

            grid.Insert(0, new string('#', W + 2));
            grid.Add(new string('#', W + 2));

            foreach (var g in grid)
                Console.WriteLine(g);
        }
    }
}


Measured memory_bytes: 13396
using System;
using System.Linq;

namespace ABC137
{
    class Program
    {
        static void Main()
        {
            var s = Console.ReadLine().Split(' ').Select(int.Parse);
            var A = s.First();
            var B = s.Skip(1).First();

            Console.WriteLine(Math.Max(Math.Max(A + B, A - B), A * B));
        }
    }
}


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

namespace ABC058A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);
            int c = int.Parse(input[2]);

            string ans;

            if (b - a == c - b)
                ans = "YES";
            else
                ans = "NO";

            Console.WriteLine(ans);

        }
    }
}


Measured memory_bytes: 11092
#include<iostream>
#include<cstdlib>
using namespace std;
#define FOR(i, a, n) for(int i=a; i<n; i++)
#define RFOR(i, a, n) for(int i=n-1; i>=a; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 0, n)
#define INF 2000000001

int main()
{
	int N, M;
	int a[50], b[50], c[50], d[50];
	cin >> N >> M;
	REP(i, N) cin >> a[i] >> b[i];
	REP(i, M) cin >> c[i] >> d[i];

	REP(i, N) {
		long long dist[50];
		int min_v = INF;
		int num;

		REP(j, M) {
			dist[j] = abs(a[i] - c[j]) + abs(b[i] - d[j]);
			if (dist[j] < min_v) {
				min_v = dist[j];
				num = j;
			}
		}

		cout << num + 1 << endl;
	}

	return 0;
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
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;}
const int MOD = 1000000007;

int main() {
    int n;
    string s;
    cin >> n >> s;
    if (n >= 3200) {
        cout << s << endl;
    } else {
        cout << "red" << endl;
    }
}

Measured memory_bytes: 256
import math

a,b,x = map(int, input().split())
T=a**2*b

if T//2 < x:
  X= 2*x/a**2 - b
  Y= b - X
  print(math.degrees(math.asin(Y/math.sqrt(a**2+Y**2))))
else:
  X= 2*x/(a*b)
  print(math.degrees(math.asin(b/math.sqrt(X**2+b**2))))

Measured memory_bytes: 9272
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <string>

using namespace std;

int main() {
	string s;
	cin >> s;

	cout << (s == "ABC" ? "ARC" : "ABC") << endl;
	return 0;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define all(obj) (obj).begin(), (obj).end()
static const int dx[4] = { 0, 1, 0, -1 };
static const int dy[4] = { 1, 0, -1, 0 };
static const char dir[4] = { 'u', 'r', 'd', 'l' };
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;
int N, M;

signed main()
{
    cin >> N >> M;
    vector<int> num(N, 1);
    vector<bool> red(N);
    red[0] = true;
    rep(i, M)
    {
        int x, y;
        cin >> x >> y;
        --x, --y;

        if (red[x]) {
            red[y] = true;
        }
        --num[x], ++num[y];
        if (num[x] == 0) {
            red[x] = false;
        }
    }
    int res = count(all(red), true);
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int clz(int x) { return 31 - __builtin_clz(x); }
int clz(ll x) { return 63 - __builtin_clzll(x); }
int ctz(int x) { return __builtin_ctz(x); }
int ctz(ll x) { return __builtin_ctzll(x); }

class compare {
public:
	bool operator()(tuple<ll, ll> a, tuple<ll, ll> b) {
		return (get<1>(a) > get<1>(b));
	}
};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	string s;
	cin>>s;
	n=s.size();
	ll x,y;
	cin>>x>>y;
	vl xx,yy;
	bool b=true;
	int cnt=0;
	rep(i,n){
		if(s[i]=='T'){
			if(cnt!=0||xx.size()==0){
				if(b) xx.push_back(cnt);
				else if (cnt!=0)  yy.push_back(cnt);
			}
			cnt=0;
			b=!b;
		}
		else cnt++;	
	}
	if(cnt){
		if(b) xx.push_back(cnt);
		else yy.push_back(cnt);
	}
	vvb xxx(xx.size()+1,vb(160002,false)),yyy(yy.size()+1,vb(160000,false));
	xxx[0][8000]=true;yyy[0][8000]=true;
	rep(i,xxx.size()-1){
		rep(j,xxx[i].size()){
			if(xxx[i][j]){
				xxx[i+1][j+xx[i]]=true;
				if(i!=0)xxx[i+1][j-xx[i]]=true;
			}
		}
	}
	rep(i,yyy.size()-1){
		rep(j,yyy[i].size()){
			if(yyy[i][j]){
				yyy[i+1][j+yy[i]]=true;
				yyy[i+1][j-yy[i]]=true;
			}
		}
	}
	Out(xxx[xx.size()][x+8000]&&yyy[yy.size()][y+8000]);

}


Measured memory_bytes: 78720
""" A
    https://atcoder.jp/contests/abc173/tasks/abc173_a
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return [lambda _: readIntegerSet(m) for _ in range(0, n)]

def main(X):
    return "Yes" if X >= 30 else "No"

if __name__ == "__main__":
    _X = readInteger()

    print(main(_X))

Measured memory_bytes: 9564
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
  long long n;
  cin >> n;
  long long root = sqrt(n);
  long long x, y;
  bool has = false;
  for (long long i = root; i >= 2; --i)
  {
    if (n % i == 0)
    {
      has = true;
      x = i, y = n / i;
      break;
    }
  }
  if (has)
    cout << (x - 1) + (y - 1) << endl;
  else
    cout << n - 1 << endl;

  return 0;
}

Measured memory_bytes: 256
n=int(input())
table=[0,20, 39, 59, 78, 98, 117, 137, 156, 176, 195]
u_table=[0,20, 40, 60, 80, 100, 120, 140, 160, 180, 200]
for i in range(n):
    y,m,d=map(int,input().split())
    ans=0
    for j in range(y+1,1000):
        if j%3==0:
            ans+=u_table[-1]
        else:
            ans+=table[-1]
    if y%3==0:
        ans+=u_table[-1]-u_table[m]
        ans+=u_table[m]-u_table[m-1]-d+1
    else:
        ans+=table[-1]-table[m]
        ans+=table[m]-table[m-1]-d+1
    print(ans)


Measured memory_bytes: 5600
#include<stdio.h>
int main()
{
    int a, b, c, d, e, k;
    scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k);
    if (e - a > k)
        printf(":(\n");
    else
        printf("Yay!\n");
    return 0;
}

Measured memory_bytes: 128
// https://atcoder.jp/contests/abc153/tasks/abc153_c
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, K;
    cin >> N >> K;
    vector<int> H(N);
    REP(i, N) { cin >> H[i]; }
    sort(ALLR(H));
    int sum = 0;
    FOR(i, K, N) { sum += H[i]; }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 1792
import math
n=int(input())
def c():
    l=list(map(int, input().split()))
    s=0
    t=list(range(1,n+1))
    for i in range(n):
        s+=t.index(l[i])*math.factorial(n-i-1)
        t.remove(l[i])
    return s
print(abs(c()-c()))

Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<set>
#include<algorithm>

using namespace std;

int main() {
    string str;
    cin >> str;
    if ((str[2] == str[3]) && (str[4] == str[5]))cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
	int a[26],b[26],n,m,i,j,t;
	char s1[1010],s2[1010];
	while(scanf("%s",s1)!=EOF){
		scanf("%s",s2);
		n=strlen(s1);
		m=strlen(s2);
		for(i=0;i<m;i++){
			s2[m+i]=s2[i];
		}
		int flag2=0,chance=0,q=0;
		int flag=0;
		while(flag==0){
			
			for(i=0;i<n;i++){
				if(s1[i]!=s2[q+i]){
					q++;
					break;
				}
				if(i==n-1){
					flag=1;
				}
			}
			if(q==n){
				printf("No\n");
				break;
			}
			if(flag==1){
				printf("Yes\n");
				break;
			}
		}
	}
	
}

Measured memory_bytes: 128
#include<stdio.h>
#include<string.h>

int LCSLength(char*,char*);

int main(){
  int q,i;
  char X[1000],Y[1000];

  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%s",X);
    scanf("%s",Y);
    printf("%d\n",LCSLength(X,Y));
  }

  return 0;
}

int LCSLength(char *X,char *Y){
  int i,j,c[1001][1001];
  int m,n;

  m = strlen(X);
  n = strlen(Y);
  
  for(i=1;i<=m;i++){
    c[i][0] = 0;
  }
  for(j=0;j<=n;j++){
    c[0][j] = 0;
  }
  
  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(X[i-1]==Y[j-1]) c[i][j]=c[i-1][j-1]+1;
      else if(c[i-1][j]>=c[i][j-1]) c[i][j] = c[i-1][j];
      else c[i][j] = c[i][j-1];
    }
  }

  return c[m][n];
}

Measured memory_bytes: 4524
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

#define int long long
#define read(a) int a; cin >> a;
#define readarr(a, n) int a[(n) + 1] = {}; fori(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori(i, 1, n) {fori(j, 1, m) cin >> a[i][j];}
#define pb push_back
#define fi first
#define se second
#define rz resize
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define sort1(v) sort(v.begin(), v.end()) 
#define endl '\n'

using namespace std;
using namespace __gnu_pbds; 

typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;

const long long inf2 = (long long)1e18;
const long long mod = (long long)(1e9+7);
const long long inf1 =(long long)(1e6+1);
 
signed main() 
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    char a, b;
    cin >> a >> b;
    string str1 = "", str2 = "";
    fori(i, 1, (int)(b-'0')) str1 += a;
    fori(i, 1, (int)(a-'0')) str2 += b;
    cout << min(str1, str2);

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define mod ((ull)1e9+7)
#define MAX ((ull)1e9)

int main(){
	int n;
	cin >> n;
	ull a[n], b[n];
	for(int i=0; i<n; i++){
		cin >> a[i] >> b[i];
	}
	ull ans=0;
	for(int i=n-1; i>=0; i--){
		if((a[i]+ans)%b[i]!=0){
			ull r=b[i]-(a[i]+ans)%b[i];
			ans+=r;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
int n, a[200];

int solve(int i, int m) {
	int res;
	if (m == 0) {
		return 1;
	}
	if (i >= n) {
		return 0;
	}
	res = solve(i + 1, m) || solve(i + 1, m - a[i]);
	return res;
}

int main(void) {
	int q, m,i;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	scanf("%d", &q);
	for (i = 0; i < q; i++) {
		scanf("%d", &m);
		if (solve(0, m)) {
			printf("yes\n");
		}
		else {
			printf("no\n");
		}
	}
	return 0;
}


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

void fnInput(int &a_riLoadingCnt, int &a_riTrackCnt, vector<int> &a_rviLoading)
{
  cin >> a_riLoadingCnt >> a_riTrackCnt;

  a_rviLoading.resize(a_riLoadingCnt);
  for (int i = 0; i < a_riLoadingCnt; i++)
    cin >> a_rviLoading[i];
}

int fnSimuAlloc(const vector<int> &a_cnrviLoading, int a_iTrackCnt, int a_iMinLoading)
{
  int iCurLoading;
  int iTrackCnt = 0;

  for (int i = 0; i < a_cnrviLoading.size();    )
  {
    if (a_cnrviLoading[i] > a_iMinLoading) return 0;

    iTrackCnt++;
    iCurLoading = 0;

    while (i < a_cnrviLoading.size())
    {
      iCurLoading += a_cnrviLoading[i];
      if (iCurLoading > a_iMinLoading)
        break;

      i++;
    }
  }
  return (iTrackCnt <= a_iTrackCnt);
}

void fnAllocation(const vector<int> &a_cnrviLoading, int a_iTrackCnt, int &a_riMinLoading)
{
  const int cniMinLoading = 0;
  const int cniMaxLoading = 1000000000;

  int iLow  = cniMinLoading;
  int iHigh = cniMaxLoading;
  a_riMinLoading = cniMaxLoading;

  while (iLow < iHigh)
  {
    int iMid = (iLow + iHigh) / 2;
    if (fnSimuAlloc(a_cnrviLoading, a_iTrackCnt, iMid))
    {
      a_riMinLoading = min(a_riMinLoading, iMid);
      iHigh = iMid;
    }
    else
      iLow = iMid + 1;
  }
}

void fnResultOut(int a_iMinLoading)
{
  cout << a_iMinLoading << endl;
}

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

  int iLoadingCnt, iTrackCnt;
  vector<int> viLoading;
  int iMinLoading = 0;

  fnInput(iLoadingCnt, iTrackCnt, viLoading);
  fnAllocation(viLoading, iTrackCnt, iMinLoading);
  fnResultOut(iMinLoading);

  return 0;
}

Measured memory_bytes: 1524
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;
const int inf = 1001001000;
const long long int Inf = 1001001001001001000;

void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//mod計算用のクラス
class ModInt{
public:
    long long int x;
    long long int mod;
	ModInt(){}
    ModInt(long long int _x, long long int _mod = 1000000007){
        this->x = _x % _mod;
        this->mod = _mod;
    }
	ModInt operator+(ModInt other){
		return ModInt(this->x + (other.x % this->mod),this->mod);
	}
	ModInt operator-(ModInt other){
		long long int res = this->x - (other.x % this->mod);
		if (res < 0) return ModInt(res + this->mod, this->mod);
		return ModInt(res);
	}
	ModInt operator*(ModInt other){
		return ModInt(this->x * (other.x % this->mod),this->mod);
	}
	ModInt operator/(ModInt other){
		return ModInt(*this * other.inv());
	}
	ModInt pow(long long int n){
		ModInt res(1, this->mod), a(this->x, this->mod);
		while (n){
			if (n & 1){
				res = res * a;
			}
			n >>= 1;
			a = a * a;
		}
		return res;
	}
	ModInt inv(){
		return ModInt(this->pow(this->mod - 2));
	}
	void disp(){
		cout << this->x << endl;
	}
};
ostream& operator<<(ostream& stream, const ModInt m){
	stream << to_string(m.x);
	return stream;
}

//素因数分解をする関数.
map<long long int, int> prime_factorization(long long int a) {
	map<long long int, int>ans;
	for (long long i = 2; i*i <= a; ++i) {
		while (a%i == 0) {
			ans[i]++;
			a /= i;
		}
	}
	if (a != 1)ans[a]++;
	return ans;
}

//与えられた配列の最小公倍数を返す.返り値は素因数分解された形.オーバーフローするときはこっちを使う.
map<long long int,int> lcm(vector<long long int> a){
	int n = a.size();
	map<long long int, int> res;
	rep(i, n)
	{
		map<long long int, int> t = prime_factorization(a[i]);
		for (auto x:t){
			res[x.first] = max(res[x.first], x.second);
		}
	}
	return res;
}

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

	map<long long int, int> p = lcm(a);

	ModInt lm(1);
	for (auto x:p){
		ModInt n(x.first);
		n = n.pow(x.second);
		lm = lm * n;
	}

	ModInt ans(0);
	rep(i, n)
	{
		ModInt aa(a[i]);
		ans = ans + (lm / aa);
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <stack>
#include <functional>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

#define _SI(arr) (sizeof(arr)/sizeof(arr[0])

int main() {
	string s;
	cin >> s;
	ll n0 = 0, n1 = 0;

	for (ll i = 0; i < s.size(); i++)
	{
		if (s[i] == '0')n0++;
		else n1++;
	}


	cout << s.size() - abs(n0 - n1) << endl;
}

Measured memory_bytes: 512
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace AtCoder
{
	public class ABC
	{
		static public void Main(string[] args)
		{
			Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
			Solve(args);
			Console.Out.Flush();
		}

		const int mod = 1000000007;  // 10^9+7
		static int Mod(long x, int m) { return (int)((x % m + m) % m); }
		static long Mod(long x, long m) { return (x % m + m) % m; }

		static public void Solve(string[] args)
		{
			//string s = Console.ReadLine();
			//int n = int.Parse(Console.ReadLine());
			//long x = long.Parse(Console.ReadLine());
			//int[] vs = Console.ReadLine().Split().Select(int.Parse).ToArray();
			//long[] vs = Console.ReadLine().Split().Select(long.Parse).ToArray();

			int n = int.Parse(Console.ReadLine());
			int[] a = Console.ReadLine().Split().Select(int.Parse).OrderByDescending(p => p).ToArray();

			//System.Diagnostics.Debug.WriteLine(string.Join(" ", a));
			long ans = 0;
			for (int i = 1, j = 0; i < n; i++) {
				ans += a[j];
				//System.Diagnostics.Debug.WriteLine($"{a[j]}");
				if (i % 2 != 0) {
					j++;
				}
			}
			Console.WriteLine(ans);

		}
	}
}


Measured memory_bytes: 49104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

int main(){
    int a, b, t; cin >> a >> b >> t;

    cout << b * (t/a) << endl;
}

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

// C - Replacing Integer
int main() {
    long long N, K;
    cin >> N >> K;
    if (N > K) N = N % K;
    // if (N > K) cout << min(N, abs(N - K));
    // if (N < K) cout << N;
    if (N < K) cout << min(N, abs(N - K));
    if (N == K) cout << 0;
}


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

int		main(void)
{
	int n;

	cin >> n;
	bool ans = true;
	set<string> words;
	string check;

	for (int i = 0; i < n; i++)
	{
		string tmp;
		
		cin >> tmp;
		if (i != 0 && check.back() != tmp[0])
			ans = false;
		check = tmp;
		words.insert(tmp);
	}
	if (words.size() != n)
		ans = false;
	if (ans)
		puts("Yes");
	else
		puts("No");
}



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

using namespace std;

typedef long long ll;

const int mod = 1e9+7;

int main(){
	std::ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << "ABC" << n << "\n";

	return 0;
} 


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const int MOD = 1000000007;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int ans;
  rep(i, n) {
    int a;
    cin >> a;
    if (i == 0)
      ans = a;
    else
      ans = __gcd(ans, a);
  }
  cout << ans << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int,int>;


const long long INFLL = 1LL << 60;
const int INFI = 1000000000;


int main(){
    long long X; cin >> X;
    long long ans=0;
    long long s=0;
    while(true){
        ans++;
        s+=ans;
        if(s >=X) break;
    }
    cout << ans<< endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int n,i,j,t;
	int a[100];
	scanf("%d",&n);
	for (i = 0 ; i < n ; i++)
	{
		scanf("%d",&a[i]);
	}
	
	for (i = 1 ; i < n ; i++)
	{
	    for (j = 0 ; j < n ; j++)
		{
			if (j == n-1)
			{
			    printf("%d\n",a[j]);
		    }
		    else
		    {
			    printf("%d ",a[j]);
		    }	 
	    }
		t = a[i];
		j = i-1;
		while(j >= 0 && a[j] > t)
		{
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = t;
		/*for (j = 0 ; j < n ; j++)
		{
			if (j == n-1)
			{
			    printf("%d\n",a[j]);
		    }
		    else
		    {
			    printf("%d ",a[j]);
		    }	 
	    }*/
    }
    for (j = 0 ; j < n ; j++)
		{
			if (j == n-1)
			{
			    printf("%d\n",a[j]);
		    }
		    else
		    {
			    printf("%d ",a[j]);
		    }	 
	    }
    return 0;
}


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

using namespace std;

#define int long long
#define endl '\n'
#define MOD 1000000007
#define maxn 100010

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
//
//    int n;
//    cin >> n;
//
//    vector<int> v(n);
//    for (int i = 0; i < n; ++i) {
//        cin >> v[i];
//    }

    vector<string> s = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    string st;
    cin >> st;

    int an = 0;
    for (int j = 0; j < s.size(); ++j) {
        if (s[j] == st)
            an = j;
    }
    cout << 7 - an << endl;
}

Measured memory_bytes: 256
K = int(input())

def runrun_build(K):
    runrun_list = list(range(1, 10))
    base_list = runrun_list.copy()
    cnt = 9
    for i in range(0, 9):
        new_base_list = []
        for val in base_list:
            val_list = []
            if val % 10 == 0:
                for j in range(0, 2):
                    val_list.append(val * 10 + val % 10 + j)
                    cnt += 1
            elif val % 10 == 9:
                for j in range(-1, 1):
                    val_list.append(val * 10 + val % 10 + j)
                    cnt += 1
            else:
                for j in range(-1, 2):
                    val_list.append(val * 10 + val % 10 + j)
                    cnt += 1
            new_base_list.extend(val_list)
            if cnt > K:
                runrun_list.extend(new_base_list)
                return runrun_list
        runrun_list.extend(new_base_list)
        base_list = new_base_list
    return runrun_list

print(sorted(runrun_build(K))[K-1])


Measured memory_bytes: 7952
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE BangPatterns #-}

-- Default Imports

import Control.Monad
import Control.Monad.ST
import Control.Monad.Trans.Class

import qualified Control.Monad.Reader as Reader
import Control.Monad.Reader (Reader, ReaderT, runReader, runReaderT)

import qualified Data.Array.MArray as MArray
import qualified Data.Array.ST as STArray
import Data.Array.ST (STArray, STUArray, runSTArray, runSTUArray)
import Data.Ix (Ix)

import qualified Data.Bits as Bits
import Data.Bits ((.&.), (.|.))

import qualified Data.ByteString.Char8 as BS
import Data.ByteString.Char8 (ByteString)

import qualified Data.Char as Char
import qualified Data.List as List
import qualified Data.Map.Strict as Map
import Data.Map.Strict (Map)
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import Data.Set (Set)

import qualified Data.Vector as Vector
import qualified Data.Vector.Generic as GVector
import qualified Data.Vector.Mutable as MVector
import Data.Vector.Mutable (STVector)
import qualified Data.Vector.Unboxed as UVector

import Numeric

import Debug.Trace
-- ----------

-- Custom Import Here


-- ----------

-- Default Definitions

type Vector = Vector.Vector
-- type GVector = GVector.Vector
type UVector = UVector.Vector

readIntToList :: ByteString -> [Int]
readIntToList = List.unfoldr (fmap (second $ BS.dropWhile Char.isSpace) . BS.readInt)

readToList :: Read a => ByteString -> [a]
readToList = List.unfoldr $ fmap (mapTaken . mapRemain) . span' (not . Char.isSpace)
	where
		mapTaken  = first $ read . BS.unpack
		mapRemain = second $ BS.dropWhile Char.isSpace
		span' pred s
			| BS.null taken = Nothing
			| otherwise     = Just (taken, remain')
			where
				(taken, remain) = BS.span pred s
				remain' = BS.dropWhile Char.isSpace remain

readToListN :: Read a => Int -> ByteString -> [a]
readToListN n = take n . readToList

readIntToVector :: ByteString -> Vector Int
readIntToVector = Vector.unfoldr (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToUVector :: ByteString -> UVector.Vector Int
readIntToUVector = UVector.unfoldr (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToVectorN :: Int -> ByteString -> Vector.Vector Int
readIntToVectorN n = Vector.unfoldrN n (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace

readIntToUVectorN :: Int -> ByteString -> UVector.Vector Int
readIntToUVectorN n = UVector.unfoldrN n (fmap stripRemain . BS.readInt)
	where stripRemain = second $ BS.dropWhile Char.isSpace


first :: (a -> a') -> (a, b) -> (a', b)
first f (a, b) = (f a, b)

second :: (b -> b') -> (a, b) -> (a, b')
second f (a, b) = (a, f b)

average :: Fractional a => [a] -> a
average xs = sum xs / (fromIntegral . length) xs

-- ----------

main :: IO ()
main = do
	[s, w] <- readIntToList <$> BS.getLine
	if s <= w
		then putStrLn "unsafe"
		else putStrLn "safe"


Measured memory_bytes: 3676
def warshall_floyd(dp, v):
    for k in range(v):
        for i in range(v):
            for j in range(v):
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])


def check(dp, v):
    for k in range(v):
        for i in range(v):
            for j in range(v):
                if dp[i][j] > dp[i][k] + dp[k][j]:
                    return False
    return True


def main():
    v, e = map(int, input().split())
    INF = 10 ** 10
    MAX = 2 * (10 ** 7)
    MIN = -2 * (10 ** 7)
    dp = [[INF for i in range(v)] for j in range(v)]
    for i in range(e):
        s, t, d = map(int, input().split())
        dp[s][t] = d
    for i in range(v):
        for j in range(v):
            if i == j:
                dp[i][j] = 0

    warshall_floyd(dp, v)
    if not check(dp, v):
        print("NEGATIVE CYCLE")
    else:
        for i in range(v):
            for j in range(v):
                if j > 0:
                    print(end=' ') 
                if dp[i][j] > MAX * v or dp[i][j] < MIN * v:
                    print("INF", end='')
                else:
                    print(dp[i][j], end='')
            print()


if __name__ == '__main__':
    main()



Measured memory_bytes: 6572
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;
// #define DEBUG
#ifdef DEBUG
#define debug(var) cout << (#var) << ": " << (var) << endl;
template<class T> void dump_array_impl(const T& a) {
  bool first = true;
  for (auto&& x : a) {
    if (!first) cout << ", "; else first = false; cout << x;
  }
}
#define debug_array(a) cout<<(#a)<<": ";dump_array_impl(a);cout<<endl
#else
#define debug(var) {}
#define debug_array(a) {}
#endif
template<class T> void read_n(vector<T>& v, size_t n) {
  v = vector<T>(n); for (lli i=0; i<n; ++i) cin >> v[i];
}
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

lli n, k;
vector<lli> a;
int main() {
  cin >> n >> k; read_n(a, n);
  sort(begin(a), end(a));
  vector<lli> h;
  lli c=1;
  for (lli i=1; i<n; ++i) {
    if (a[i-1] == a[i]) c++;
    else { h.push_back(c); c=1; }
  }
  h.push_back(c);
  sort(begin(h), end(h), greater<lli>());
  lli kind=0, ans=0;
  for (auto c : h) {
    if (++kind > k) ans += c;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3956
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
vector<ll> a, b, c, bb, ab;
int N; ll t,res=0;
int main()
{
	cin >> N;
	for (int i = 0; i < N; i++) { cin >> t; a.push_back(t); }
	for (int i = 0; i < N; i++) { cin >> t; b.push_back(t); }
	for (int i = 0; i < N; i++) { cin >> t; c.push_back(t); }
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	sort(c.begin(), c.end());

	for (int i = 0; i < N; i++)
		bb.push_back(c.end()- upper_bound(c.begin(), c.end(), b[i]));

	ll t = 0;
	int jp = N - 1;
	for (int i = N-1; i >=0;i--)
	{
		for (;jp>=0&& b[jp] > a[i]; jp--)t += bb[jp];
		res += t;
	}

	cout << res << endl;
}


Measured memory_bytes: 4084
n = int(input())
h = list(map(int, input().split()))
h_pre = h[0]
k = 0
ans = 0
for hi in h[1:]:
    if hi <= h_pre:
        k += 1
    else:
        ans = max(ans, k)
        k = 0
    h_pre = hi
print(max(ans, k))


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

int main() {
	int n;
	while (cin >> n, n) {
		int fl[100][100] = {};
		int w, h;
		cin >> w >> h;

		for (int i = 0;i < n;i++) {
			int a, b;
			cin >> a >> b;
			fl[a - 1][b - 1]++;
		}
		int s, t;
		cin >> s >> t;

		int ans = 0;
		for (int i = 0;i + s-1 <= w;i++) {
			for (int j = 0;j + t -1 <= h;j++) {
				int z = 0;
				for (int k = i;k < s+i;k++) {
					for (int l = j;l < t+j;l++) {
						z += fl[k][l];
					}
				}
				ans = max(z, ans);
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3028
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;

bool is_integer(double A)
{
    if (floor(A) == A)
    {
        return true;
    }
    else
    {
        return false;
    }
}
//A19:55 - 20:00
//B
int main()
{
        long long A, B = 0;
        cin >> A >> B;
        long long ans = A * B;
        ans = ans / 2;
        if( A > 1  && B ==1 || A == 1 &&B > 1){
            ans = 1;
        }
        else if (A % 2 == 1 && B % 2 == 1)
        {
            ans = ans + 1;
        }
        cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() { cout << "Yes"; }

void no() { cout << "No"; }

int main() {
  kyun;
  in6 k,n;
  cin >> k >> n; 
  vi data(2*n);
  rep(i,n) cin >> data[i];
  rep(i,n) data[i+n] = data[i] - k;
  sort(all(data));
  in6 ans = inf;
  rep(i,n) {
    in6 now = abs(data[i] - data[i+n-1]);
    ans = min(ans,now);
  }
  cout << ans;
  hinata;
}

Measured memory_bytes: 1792
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B_Balance
{
    class Program
    {
        static void Main(string[] args)
        {
            int total = int.Parse(ReadLine());
            string input = ReadLine();
            string[] array = input.Split(' ');
            int[] n = new int[array.Length];
            for (int i = 0; i < array.Length; i++) {
                n[i]= int.Parse(array[i]);
            }
            int a = 0;
            int b = 0;
            int answerA = 0;
            int answerB = 0;
            int count = 0;
            for (int j = 1; j < array.Length; j++) {
                for (int k = 0; k <= j-1; k++) {
                    a += n[k];
                   
                }
                for (int m = j; m < array.Length; m++) {
                    b += n[m];
                }
                count++;
                if (a >= b) {
                   
                    
                    break;
                }
                a = 0;
                b = 0;
            }
            int c = a - n[count-1];
            int d = b + n[count-1];

            answerA = System.Math.Abs(c - d);
            answerB = System.Math.Abs(a - b);
            if (answerA < answerB)
            {
                WriteLine(answerA);
            }
            else {
                WriteLine(answerB);
            }
            ReadKey();
        }
    }
}


Measured memory_bytes: 11092
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main{

	static Scanner s=new Scanner(System.in);

	public static void main(String __[]){
		input();
		solve();
	}

	static int		n, m, l, a[][], b[][];
	static long[][]	c;

	private static void input(){
		n=s.nextInt();
		m=s.nextInt();
		l=s.nextInt();
		a=new int[n][m];
		b=new int[m][l];
		c=new long[n][l];
		for(int i=0; i<n; i++){
			for(int k=0; k<m; k++){
				a[i][k]=s.nextInt();
			}
		}
		for(int k=0; k<m; k++){
			for(int j=0; j<l; j++){
				b[k][j]=s.nextInt();
			}
		}
	}

	private static void solve(){
		for(int i=0; i<n; i++){
			for(int j=0; j<l; j++){
				for(int k=0; k<m; k++){
					c[i][j]+=a[i][k]*b[k][j];
				}
			}
		}
		for(int i=0; i<n; i++){
			System.out.println(Arrays.stream(c[i]).mapToObj(String::valueOf).collect(Collectors.joining(" ")));
		}
	}
}

Measured memory_bytes: 55624
//#define _GLIBCXX_DEBUG
#include <iostream>
#include <bits/stdc++.h>
    
    
using namespace std;
#define ll long long
#define ld long double
#define  P pair<ll,ll>
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,m,n) for(ll i=n; i>=(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define sortAl(v) sort(v.begin(),v.end())
#define sortAlr(v) sort(v.begin(),v.end()); reverse(v.begin(),v.end())
#define cout(n) cout<<fixed<<setprecision(n)
#define dout(n) cout<<# n<<" = "<<n<<endl;
    
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    if(s[2]==s[3] && s[4]==s[5]) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>

using namespace std;

const int hoken = 10;

const double EPS = 1e-9;
const double PI = acos(-1);

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

int main() {
	int N;
	P engine[100 + hoken];
	AngleP angle[100 + hoken];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> engine[i].first >> engine[i].second;
		if (abs(engine[i].first) < EPS && abs(engine[i].second) < EPS) {
			angle[i].second = i, angle[i].first = 0;
		}
		else {
			angle[i].second = i, angle[i].first = atan2(engine[i].second, engine[i].first);
		}
	}
	sort(angle, angle + N);
	ll tx = 0, ty = 0;
	
	double ans = 0;
	double cur = 0;
	int r = 0;
	
	for (int l = 0; l < 2 * N; l++) {
		ans = max(ans, sqrt(tx * tx + ty * ty));
		while (r <= 2 * N && r - l < N &&
			sqrt(tx * tx + ty * ty) < EPS + sqrt(pow(tx + engine[angle[r % N].second].first, 2)
				+ pow(ty + engine[angle[r % N].second].second, 2))) {
			tx += engine[angle[r % N].second].first;
			ty += engine[angle[r % N].second].second;
			ans = max(ans, sqrt(tx*tx + ty*ty));
			r++;
		}
		ans = max(ans, sqrt(tx*tx + ty*ty));
		if (l == r) {
			r++;
		}
		else {
			tx -= engine[angle[l % N].second].first;
			ty -= engine[angle[l % N].second].second;
			ans = max(ans, sqrt(tx*tx + ty*ty));
		}
	}

	cout << setprecision(12) << ans << endl;
	return 0;
}

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

int main(){
  int N,K;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  
  int ans = vec.at(K-1) - vec.at(0);
  for(int i=1; i<N-K+1; i++){
    ans = min(ans,vec.at(K-1+i)-vec.at(i));
  }
  cout << ans << endl;
} 

Measured memory_bytes: 640
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCorder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadInt;
            var ans = (N + 1) / 2;
            WriteLine((double)ans / N);
        }
        public class ConsoleInput
        {
            private readonly System.IO.TextReader _stream;
            private char _separator = ' ';
            private Queue<string> inputStream;
            public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
            {
                this._separator = separator;
                this._stream = stream;
                inputStream = new Queue<string>();
            }
            public string Read
            {
                get
                {
                    if (inputStream.Count != 0) return inputStream.Dequeue();
                    string[] tmp = _stream.ReadLine().Split(_separator);
                    for (int i = 0; i < tmp.Length; ++i)
                        inputStream.Enqueue(tmp[i]);
                    return inputStream.Dequeue();
                }
            }
            public string ReadLine { get { return _stream.ReadLine(); } }
            public int ReadInt { get { return int.Parse(Read); } }
            public long ReadLong { get { return long.Parse(Read); } }
            public double ReadDouble { get { return double.Parse(Read); } }
            public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
            public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
            public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        }
    }
}

Measured memory_bytes: 11220
X = int(input())

if X<=599:
    print('8')
elif X<=799:
    print('7')
elif X<=999:
    print('6')
elif X<=1199:
    print('5')
elif X<=1399:
    print('4')
elif X<=1599:
    print('3')
elif X<=1799:
    print('2')
elif X<=1999:
    print('1')


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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x, n) bitset<n>(x)
#define PI 3.14159265358979323846

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

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


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

    int n, k;
	cin >> n >> k;
	REP(i, k) {
		int a, b;
		cin >> a >> b;
		int ans = min(min(a, n - a + 1), min(b, n - b + 1)) % 3;
		cout << (ans ? ans : 3) << endl;
	}

	return 0;
}




Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;


int main(){
  int a,b,q;
  cin >> a >> b >> q;
  vector<ll> s(a),sr(a),t(b),tr(b),x(q);
  rep(i,a){ cin >> s[i]; sr[i]=-s[i]; }
  rep(i,b){ cin >> t[i]; tr[i]=-t[i]; }
  rep(i,q){ cin >> x[i]; }
  sort(sr.begin(),sr.end());
  sort(tr.begin(),tr.end());
  
  rep(i,q){
    auto its = lower_bound(s.begin(),s.end(),x[i]);
    auto itsr = lower_bound(sr.begin(),sr.end(),-x[i]);
    auto itt = lower_bound(t.begin(),t.end(),x[i]);
    auto ittr = lower_bound(tr.begin(),tr.end(),-x[i]);

    ll ans=longinf;
    ll tmpa,tmpb,tmpc,tmpd;
    if(its!=s.end() && itt!=t.end()){
      tmpa = max(*its,*itt)-x[i];
    } else {tmpa=longinf;}
    if(itsr!=sr.end() && ittr!=tr.end()){
      tmpb = x[i]-min(*itsr*(-1),*ittr*(-1));
    } else {tmpb=longinf;}
    if(its!=s.end() && ittr!=tr.end()){
      tmpc = min(*its-x[i],x[i]-*ittr*(-1)) + *its-x[i] + x[i]-*ittr*(-1);
    } else {tmpc=longinf;}
    if(itsr!=sr.end() && itt!=t.end()){
      tmpd = min(*itt-x[i],x[i]-*itsr*(-1)) + *itt-x[i] + x[i]-*itsr*(-1);
    } else {tmpd=longinf;}
    
    ans = min(ans,min(min(tmpa,tmpb),min(tmpc,tmpd)));
    cout << ans << endl; 
  }

  return 0;
}


Measured memory_bytes: 5248
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main(){
    string s,t;
    cin>>s>>t;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end(), greater<char>());
    if(s<t) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3640
using System;
using System.Collections.Generic;
using System.Linq;
public class Hello{
    public Hello(){}
    public static void Main(){
        new Hello().Calc();
    }
    void Calc(){
        var inputs = Inputvalues;
        foreach(var i in inputs){
            Console.WriteLine(i);
        }
    }
    static long SumDigit(string s){
        long ans = 0;
        for(var i = 0;i < s.Length;i++){
            ans += long.Parse(s.Substring(i,1));
        }
        return ans;
    }
    List<long> Inputvalues{
        get{
            var inputs = new List<long>();
            while(true){
                var s = Console.ReadLine();
                if(s == "0"){
                    break;
                }else{
                    inputs.Add(SumDigit(s));
                }
            }
            return inputs;
        }
    }
}



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

int main() {
    long long A;
    string s;
    cin >> A >> s;
    int B = (s[0] - '0') * 100;
    B += (s[2] - '0') * 10;
    B += (s[3] - '0');
    long long ans = A * B / 100;
    cout << ans << endl;
}

Measured memory_bytes: 3628
// Tazoe

#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main()
{
	while(true){
		string str;
		getline(cin, str);

		if(str==".")
			break;

		stack<char> S;

		bool flg = true;
		for(int i=0; flg&&str[i]!='.'; i++){
			if(str[i]=='('){
				S.push(str[i]);
			}
			else if(str[i]=='['){
				S.push(str[i]);
			}
			else if(str[i]==')'){
				if(S.empty()||S.top()!='('){
					flg = false;
				}
				else{
					S.pop();
				}
			}
			else if(str[i]==']'){
				if(S.empty()||S.top()!='['){
					flg = false;
				}
				else{
					S.pop();
				}
			}
		}

		if(flg&&S.empty()){
			cout << "yes" << endl;
		}
		else{
			cout << "no" << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 904
#include<bits/stdc++.h>
using namespace std;
#define deb(x) cerr<<"["#x<<" : "<<x<<" ]\n";
bool isok(int start, const string& s, const string pat)
{
	int n = pat.length();
	int index = n-1;
	while(start >= 0 and index >= 0 and s[start] == pat[index]) {
		index--;
		start--;
	}
	return index == -1;
}

int main()
{
	string s;
	cin >> s;
	int n = s.length();
	int start = n-1;
	
	while(true) {
		bool ok = false;
		
		if(s[start] == 'r') {
			if(isok(start, s, "dreamer")) {
				ok = true;
				start -= 7;
			} else if(isok(start, s, "eraser")) {
				ok = true;
				start -= 6;
			}
		} else if(s[start] == 'm' and isok(start, s, "dream")) {
			ok = true;
			start -= 5;
		} else if(s[start] == 'e' and isok(start, s, "erase")) {
			ok = true;
			start -= 5;
		}
		
		if(!ok or start == -1) {
			break;
		}
	}
	
	if(start == -1) puts("YES");
	else puts("NO");
}


Measured memory_bytes: 3732
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <cmath>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int lim[51000];

int dp[5][210];

int main() {
  int N; cin >> N;
  vector<int> t(N), v(N);
  for (int i = 0; i < N; ++i) cin >> t[i], t[i] *= 2;
  int sum = 0;
  for (int i = 0; i < N; ++i) {
    cin >> v[i], v[i] *= 2;
    for (int j = sum; j < sum + t[i]; ++j) {
      lim[j] = v[i];
    }
    sum += t[i];
  }
  for (int i = 0; i < 5; ++i) for (int j = 0; j < 210; ++j) dp[i][j] = -(1<<29);
  dp[0][0] = 0;
  for (int i = 0; i < sum; ++i) {
    for (int j = 0; j < 210; ++j) {
      if (j + 1 <= min(lim[i], lim[i+1])) chmax(dp[(i+1)%2][j+1], dp[i%2][j] + j*2+1);
      if (j <= min(lim[i], lim[i+1])) chmax(dp[(i+1)%2][j], dp[i%2][j] + j*2);
      if (j - 1 >= 0 && j - 1 <= min(lim[i], lim[i+1])) chmax(dp[(i+1)%2][j-1], dp[i%2][j] + j*2-1);
    }

    for (int j = 0; j < 210; ++j) dp[i%2][j] = -(1<<29);
  }
  cout << fixed << setprecision(10) << (double)dp[0][0] / 8 << endl;
  return 0;
}


Measured memory_bytes: 384