akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long ll;

const int dy[]={-1,0,1,0};
const int dx[]={0,1,0,-1};

bool passed[101][101][4];
char field[101][101];

int h,w;
ll l;
int sy,sx,sag;

bool search1(ll &cl,int &cx,int &cy,int &cag,int &step){
	passed[cy][cx][cag]=true;
	while(1){
		if(cl==0){
			cout<<cy+1<<" "<<cx+1<<" ";
			if(cag==0)cout<<'N';
			else if(cag==1)cout<<'E';
			else if(cag==2)cout<<'S';
			else if(cag==3)cout<<'W';
			cout<<endl;
			return true;
		}
		int nx=cx+dx[cag];
		int ny=cy+dy[cag];
		if(nx>=0&&ny>=0&&nx<w&&ny<h&&field[ny][nx]=='.'){
			if(passed[ny][nx][cag]){
				cx=nx,cy=ny;
				cl--;
				break;
			}
			passed[ny][nx][cag]=true;
			cx=nx;
			cy=ny;
			cl--;
		}
		else{
			cag=(cag+1)%4;
			if(passed[cy][cx][cag])break;
			passed[cy][cx][cag]=true;
		}
	}
	int gx=cx;
	int gy=cy;
	int gag=cag;
	int cnt=0;
	while(1){
		int nx=cx+dx[cag];
		int ny=cy+dy[cag];
		if(nx>=0&&ny>=0&&nx<w&&ny<h&&field[ny][nx]=='.'){
			cnt=0;
			cx=nx;
			cy=ny;
			step++;
			if(gx==cx&&gy==cy&&gag==cag)break;
		}
		else{
			cag=(cag+1)%4;
			cnt++;
			if(gx==cx&&gy==cy&&gag==cag){
				cag=(cag-cnt+4)%4;
				break;
			}
		}
	}
	return false;
}

void solve(){
	// loop find
	int cx,cy,cag,step;
	step=0;
	ll cl=l;
	cx=sx;
	cy=sy;
	cag=sag;
	memset(passed,0,sizeof(passed));
	if(search1(cl,cx,cy,cag,step))return;
	cl%=step;
	step=0;
	memset(passed,0,sizeof(passed));
	search1(cl,cx,cy,cag,step);
}

int main(){

	while(cin>>h>>w>>l&&!(h==0&&w==0&&l==0)){
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				cin>>field[i][j];
				if(field[i][j]!='#'&&field[i][j]!='.'){
					if(field[i][j]=='N')sag=0;
					else if(field[i][j]=='E')sag=1;
					else if(field[i][j]=='S')sag=2;
					else if(field[i][j]=='W')sag=3;
					field[i][j]='.';
					sx=j;
					sy=i;
				}
			}
		}
		solve();
	}

	return 0;
}

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

int main(){
  long long N, total=0,tmp=0,tmp1=0,tmp2=0,res1=0,res2=0,result=0;

  cin >> N;
  int A[N];

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

  int j=0;
  while(tmp < total-tmp){
    tmp += A[j];
    j++;
  }

  tmp1 = tmp;
  res1 = total - tmp1;
  tmp2 = tmp - A[j-1];
  res2 = total - tmp2;

  // cout << A[j-1] << endl;
  // cout << "tmp1 " << tmp1 << " tmp2 " << tmp2 << endl;
  // cout << "res1 " << res1 << " res2 " << res2 << endl;

  if(abs(tmp1-res1)<abs(tmp2-res2)){
    result = abs(tmp1-res1);
  }else{
    result = abs(tmp2-res2);
  }

  cout << result << endl;
}


Measured memory_bytes: 1024
using System;

namespace ABC148A
{
	class Program
	{
		static void Main(string[] args)
		{
			string str1 = Console.ReadLine();
			string str2 = Console.ReadLine();
			int a = int.Parse(str1);
			int b = int.Parse(str2);
			int c = 6 - a - b;
			Console.WriteLine(c);

		}
	}
}


Measured memory_bytes: 11092
#include<iostream>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iomanip>
using namespace std;

int main() {
	int r;
	cin >> r;
	string ans;
	if (r < 1200) {
		ans = "ABC";
	}
	else if (r < 2800) {
		ans = "ARC";
	}
	else {
		ans = "AGC";
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
p = list(map(int, input().split(' ')))

ans = 0
for i in range(n-2):
    if ((p[i] <  p[i+1] and p[i+1] <= p[i+2]) or (p[i+2] < p[i+1] and p[i+1] <= p[i])):
        ans += 1

print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
// using namespace boost::multiprecision;
typedef long long ll;

const int MAX = 510000;
const int MOD = 1000000007;

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

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

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

int main(void){
  cout << setprecision(10);
  ll N,K;
  cin >> N >> K;

  ll ans = 0;
  for(ll i = K; i <= N+1; i++){
    // cerr << i * (N-i+1) + 1 << endl;
    ans += i * (N-i+1) + 1;
    ans %= MOD;
  }
  cout << ans << endl;


}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<string.h>
using namespace std;
#define pb push_back
#define all(v) v. begin(),v. end()
#define  rep(i,n,v) for(i=n;i<v;i++)
#define per(i,n,v) for(i=n;i>v;i--)
#define ff first 
#define ss second 
#define pp pair<ll,ll>
#define ll  long long
#define endl '\n'
void solve()
{
  ll n, a,m=0,b=1, c,k=0, i, j,l=2e9+7;
  string s, r, y;
  cin>>n>>a;
  if(a-n+1<=2019)
  {
    rep(i,n,a)
    {
      rep(j,i+1,a+1)
      {
        l=min(l,((i%2019)*(j%2019))%2019);
      }
    }
    cout <<l;
  }
  else cout<<0<<endl;
}
int main()
{
 ios_base::sync_with_stdio(false);
  cin. tie(0);cout. tie(0);
    ll t=1;
  // cin>>t;
    while(t--)
    {
      solve();
    }
    return 0;
}

Measured memory_bytes: 3592
import math
import numpy as np

N, D = map(int, input().split())
lst = []
for _ in range(N):
    lst.append([int(x) for x in input().split()])

ret = 0
for i in range(len(lst) - 1):
    for j in range(i + 1, len(lst)):
        n = sum(np.square(np.array(lst[i]) - np.array(lst[j])))
        if math.sqrt(n) == int(math.sqrt(n)):
            ret += 1

print(ret)

Measured memory_bytes: 12428
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>

using namespace std;

int main() {
	int N,M;
	long long int ans = 1;

	cin >> N >> M;
	if (abs(N - M) < 2) {
		for (int i = N; i > 1;i--) {
			ans *= i;
			ans %= 1000000007;
		}
		for (int i = M; i > 1; i--) {
			ans *= i;
			ans %= 1000000007;
		}
		if (abs(N - M) < 1) {
			ans *= 2;
			ans %= 1000000007;
		}
	}
	else {
		ans = 0;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define X first
#define Y second
#define pb push_back

using namespace std;

char f(int a, int b)
{
    if (a < b)
        return '.';
    return '#';
}

int main()
{
    ios_base::sync_with_stdio(false);
    int a, b;
    cin >> a >> b;
    int h = 100, w = 100;
    int c = min(a, b) - 1;
    c += c;

    vector < vector <char> > ans(h, vector <char> (w, f(a, b)));
    char r = (f(a, b) == '.' ? '#' : '.');
    int i = 0, j = 0;
    int cc = 0;

    for (i = 0; c && (i < h); i++)
    {
        for (j = 0; c && (j < w); j++)
        {
            if ((i + j) % 2 == 0) {
                ans[i][j] = r;
                cc++;
            }
            c--;
            if (c == 0) break;
        }
        if (c == 0) break;
    }
    if (j & 1) j++;

    for (int k = j; k < w; k++)
        ans[i][k] = r;
    for (int k = 0; k < w; k++)
        ans[i + 1][k] = r;

    if (i - 1 >= 0)
    {
        for (int k = j; k < w; k++)
        {
            if (ans[i - 1][k] == r)
                cc--;
        }
    }
    for (int k = 0; k < j; k++)
        if (ans[i][k] == r)
            cc--;
    cc++;
    int t = 0;
    while (cc < max(a, b))
    {
        i = (t / (h / 2)) * 2;
        j = (t % (w / 2)) * 2;
        ans[h - 1 - i][w - 1 - j] = r;
        t++, cc++;
    }
    cout << h << ' ' << w << '\n';
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            cout << ans[i][j];
        }
        cout << '\n';
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>


int main (void){
  int a,k,b;
  int i=0;
  
  scanf("%d",&k);
  scanf("%d %d",&a,&b);
  
  for(i=a; i<=b; i++){
    if(i % k == 0) {
      printf("OK\n");
      return 0;
    }
  }
  printf("NG\n");
  




  return 0;
  
}


Measured memory_bytes: 1644
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int MAXN = 100000+9;
int num[2][MAXN];
int n;

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&num[0][i]);
		num[0][i]+=num[0][i-1];
	}
	for(int i=1;i<=n;i++)
		scanf("%d",&num[1][i]);
	for(int i=n;i;i--)
		num[1][i]+=num[1][i+1];
	int ans=0;
	for(int i=1;i<=n;i++){
		ans=max(ans,num[0][i]+num[1][i]);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
n,m=map(int,input().split())
es=[[] for _ in range(n)]
for i in range(m):
    x,y=map(int,input().split())
    es[x-1].append(y-1)

connected=[0]*n
for i in range(n):
    for e in es[i]:
        connected[e]+=1

from collections import deque
que=deque([])
for i in range(n):
    if connected[i]==0:
        que.append(i)
dp=[0]*n

while que:
    s=que.popleft()
    for e in es[s]:
        connected[e]-=1
        dp[e]=max(dp[e], dp[s]+1)
        if connected[e]==0:
            que.append(e)
print(max(dp))

Measured memory_bytes: 61728
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;

const ll MOD = 1e9 + 7; 

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF_INT (1<<30)
#define INF_LL (1ll<<62)

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

ll H,W;

int main(){
    cin>>H>>W;
    ll ans=H*W;
    if(W==1||H==1){
        out(1);
        return 0;
    }
    if(ans%2)out(ans/2+1);
    else out(ans/2);
    
    
}

Measured memory_bytes: 256
/**************************************
 * Au: Hany01
 * Prob: agc030b
 * Date: Feb 8th, 2019
 * Email: hany01@foxmail.com
**************************************/

#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define File(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout)
#define Rep(i, j) for (register int i = 0, i##_end_ = j; i < i##_end_; ++ i)
#define For(i, j ,k) for (register int i = (j), i##_end_ = (k); i <= i##_end_; ++ i)
#define Fordown(i, j, k) for (register int i = (j), i##_end_ = (k); i >= i##_end_; -- i)
#define Set(a, b) memset(a, b, sizeof(a))
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define SZ(a) ((int)(a.size()))
#define ALL(a) a.begin(), a.end()
#define PB(a) push_back(a)
#define MP(a, b) make_pair(a, b)
#define X first
#define Y second
#define INF (0x3f3f3f3f)
#define INF1 (2139062143)
#define y1 WoXiHuanNiA 
#ifdef hany01
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

template<typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, 1 : 0; }
template<typename T> inline T read() {
    register char c_; register T _, __;
    for (_ = 0, __ = 1, c_ = getchar(); !isdigit(c_); c_ = getchar()) if (c_ == '-')  __ = -1;
    for ( ; isdigit(c_); c_ = getchar()) _ = (_ << 1) + (_ << 3) + (c_ ^ 48);
    return _ * __;
}
//EOT


const int MAXN = 2e5 + 5;

int L, n, p[MAXN];
LL ans = 0;

int getdis(int x, int y) {
	return max(abs(p[x] - p[y]), L - abs(p[x] - p[y]));
}
void calc() {
	static LL sum1[MAXN], sum2[MAXN];
	For(i, 1, n)
		sum1[i] = sum1[i - 1] + p[i];
	Fordown(i, n, 1)
		sum2[i] = sum2[i + 1] + (L - p[i]);

	For(i, 1, n - 1) {
		if ((n - i) & 1) {
			int x = i + (n - i) / 2 + 1;
			chkmax(ans, (sum1[x - 1] - sum1[i - 1]) * 2 + sum2[x + 1] * 2 + getdis(x, x - 1) - p[x - 1]);
		} else {
			int x = i + (n - i) / 2;
			chkmax(ans, (sum1[x - 1] - sum1[i - 1]) * 2 + sum2[x + 1] * 2 + getdis(x, x + 1) - (L - p[x + 1]));
		}
	}
}

int main() {
#ifdef hany01
    File("agc030b");
#endif

	L = read<int>(), n = read<int>();
	For(i, 1, n) p[i] = read<int>();
	calc(), chkmax<LL>(ans, p[n]);
	For(i, 1, n) p[i] = L - p[i];
	reverse(p + 1, p + 1 + n);
	calc(), chkmax<LL>(ans, p[n]);
	cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4096
#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define db long double
#define fi first
#define se second
#define  pb push_back
#define  pob pop_back
#define W while
#define fn(i,x) for(int i=0;i<x;i++)
#define fs(i,s,x) for(int i=s;i<x;i++)
#define fr(i,x) for(int i=x;i>=0;i--)
#define fit(it,s) for(auto it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mod 1000000007
#define MAX 1005
using namespace std;
int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);

    // freopen("in.txt","r",stdin);
    // freopen("out.txt","w",stdout);
    
    ll n,m;
    cin >> n >> m;
    pll g[m];
    fn(i,m) cin >> g[i].fi >> g[i].se;
    ll l = g[0].fi,r = g[0].se;
    fn(i,m){
       l = max(l,g[i].fi);
       r = min(r,g[i].se);
    }
    cout << max(0LL,r-l+1);
    return 0;

}

Measured memory_bytes: 1920
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	ll A, B, X; cin >> A >> B >> X;
	
	ll first = (A+X-1)/X;
	
	ll last = B/X;
	
	cout << last-first+1 << endl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343


Measured memory_bytes: 256
#define USE_MATH_DEFINES
#include<stdio.h>
#include<iostream>
#include<iomanip>
#include<cmath>                    
using namespace std;
int main(){
   
   int a,b,d,r;
   double f;
   
   cin>>a>>b;
   d=a/b;
   r=a%b;
   f=double (a)/b;
   cout<<fixed;
   cout <<setprecision(6)<<d<<" "<<r<<" "<<f<<endl;
   return 0;
   }


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

#define vec(v) vector<int>(v)
#define be(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define mapci(mp) map<char*,int>(mp)
#define mapcc(mp) map<char*,char*>(mp)
typedef long long ll;
using namespace std;

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


Measured memory_bytes: 1792
#include <iostream>
using namespace std;
#define rep(i,n) for(i=0; i<n; i++)
 
int main(void)
{
	int i, n, k, d, min;
	cin>>k>>n;
	int a[n];
	rep(i,n) cin>>a[i];
	min = a[n-1]-a[0];
	for(i=1; i<n; i++){
		d = k-(a[i]-a[i-1]);
		if(d<min){
			min = d;
		}
	}
	cout<<min;
	
}


Measured memory_bytes: 1152
function main(input) {
  const temp = input.trim().split(' ').map((n) => parseInt(n, 10))
  const x1 = temp[0]
  const y1 = temp[1]
  const x2 = temp[2]
  const y2 = temp[3]

  const vx = x2 - x1
  const vy = y2 - y1

  const x3 = x2 - vy
  const y3 = y2 + vx

  const x4 = x3 - vx
  const y4 = y3 - vy

  console.log('' + x3 + ' ' + y3 + ' ' + x4 + ' ' + y4)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))

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

namespace ABC133A
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            var total1 = input[0] * input[1];
            var total2 = input[2];

            if (total1 > total2)
            {
                Console.WriteLine(total2);
            }
            else
            {
                Console.WriteLine(total1);
            }
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
 
int main() {
long long int n,a,b;cin>>n;
  
  double root=sqrt(n);
  
  for(long long int i=1;i<=root;i++){
    if(n%i==0){a=n/i;b=i;}
  }
  
  cout<<a+b-2;
}
  
  

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

int main(){
    int n;cin >> n;
    string num, ans;
    ans = "No";
    num = to_string(n);
    rep(i, 3) if(num[i] == '7'){
        ans = "Yes";
        break;
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 3688
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

    public static void main(String[] args) throws Exception {
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	int n = Integer.parseInt(br.readLine().split(" ")[0]);
    	List<String> list = new ArrayList<>();
    	for(int i =0; i < n; i++) {
    		list.add(br.readLine());
    	}

    	Collections.sort(list);
    	list.forEach(System.out::print);

    }
}


Measured memory_bytes: 26580
#include <iostream>
#include <string>
#include <stdio.h>
#include <numeric>
#include <algorithm>
#include <math.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    for(int i=0;i<s.size();++i){
        s[i]=(s[i]-'A'+23)%26+'A';
    }
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 3152
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;

public class Main {
    private static final StringBuilder builder = new StringBuilder();
    public static void main(String[] args) {
        int n = readInt(), a = readInt(), b = readInt(), low = 0, middle = 0, high = 0;
        for (int i = 0; i < n; i++) {
            int p = readInt();
            if (p <= a) low++;
            else if (p <= b) middle++;
            else high++;
        }

        System.out.print(Math.min(low, Math.min(middle, high)));
    }

    private static void read() {
        builder.setLength(0);
        while (true) {
            try {
                int b = System.in.read();
                if (b == ' ' || b == '\n' || b == -1) {
                    break;
                } else {
                    builder.appendCodePoint(b);
                }
            } catch (IOException e) {
                break;
            }
        }
    }

    private static int readInt() {
        read();
        return Integer.parseInt(builder.toString());
    }

    private static int readInt(int radix) {
        read();
        return Integer.parseInt(builder.toString(), radix);
    }

    private static long readLong() {
        read();
        return Long.parseLong(builder.toString());
    }

    private static long readLong(int radix) {
        read();
        return Long.parseLong(builder.toString(), radix);
    }

    private static BigInteger readBigInteger() {
        read();
        return new BigInteger(builder.toString());
    }

    private static BigInteger readBigInteger(int radix) {
        read();
        return new BigInteger(builder.toString(), radix);
    }

    private static double readDouble() {
        read();
        return Double.parseDouble(builder.toString());
    }

    private static BigDecimal readBigDecimal() {
        read();
        return new BigDecimal(builder.toString());
    }

    private static float readFloat() {
        read();
        return Float.parseFloat(builder.toString());
    }

    private static void skipLine() {
        while (true) {
            try {
                int b = System.in.read();
                if (b == '\n' || b == -1) {
                    break;
                }
            } catch (IOException e) {
                break;
            }
        }
    }

    private static void skip() {
        while (true) {
            try {
                int b = System.in.read();
                if (b == ' ' || b == '\n' || b == -1) break;
            } catch (IOException e) {
                break;
            }
        }
    }

}


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

int min(int a, int b) {
  if (a <= b) return a;
  else return b;
}

int main() {
  int n, k, x, total = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> x;
    total += 2 * min(x, k-x);
  }
  cout << total << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define mp make_pair
#define endl '\n'
using ll=long long;
 
const int INF=1e9+5;
const ll lim=(ll)3e16;
const int N=3e3+5;
const int mod=1e9+7;
const ll oo=1e18+5;


int main(){
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
	int a,b;
	cin>>a>>b;
	if(b<=a) swap(a,b);
	for(int i=0;i<b;++i) cout<<a;
	return 0;
}


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

ll inf = 1000000LL * 1000000LL * 1000000LL;

int main(){
	ll n , w;
	scanf("%lld%lld",&n,&w);
	vector<ll> weight(n) , value(n);
	for(int i = 0 ; i < n ; ++i){
		scanf("%lld%lld",&weight[i],&value[i]);	
	}
	ll sum = 0;
	for(int i = 0 ; i < n ; ++i){
		sum += value[i];
	}
	vector<ll> dp(sum+1,inf);//dp[i] is the minimum weight at value i
	dp[0]=0;
	for(int i = 0 ; i < n ; ++i){
		for(ll j = sum - value[i] ; j>=0; j--){
			dp[j+value[i]] = min(dp[j+value[i]] , dp[j] + weight[i]); 	
		}
	}
	ll ans = 0;
	for(ll i = 0 ; i <= sum ; ++i){
		if(dp[i] <= w){
			ans = max(ans , i);
		}	
	}
	printf("%lld\n",ans);
	return 0;
}


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

#define Online 1
// #define multitest 1
#define Debug 1
typedef long long ll;
typedef long double ld;
#define f first
#define s second
#define pb push_back
#define mp make_pair
const long long mod = 1000000007;
const long long High = 1e16;
void ControlIO();
void TimerStart();
void TimerStop();
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
	std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char *names, Arg1 &&arg1, Args &&... args)
{
	const char *comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
#else
#define db(...)
#endif

void solve()
{
    int a,b,t;
    cin >> a >> b >> t;
    ld tt = t + 0.5;
    int x = t/a;
    t %= a;
    tt = t + 0.5;
    cout << (x*b); 
}

int main()
{
	ControlIO();
	int t = 1;
#ifdef multitest
	cin >> t;
#endif
	TimerStart();
	while (t--)
		solve();
	TimerStop();
	return 0;
}

void ControlIO()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifndef Online
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

auto TimeStart = chrono::steady_clock::now();
auto TimeEnd = chrono::steady_clock::now();

void TimerStart()
{
#ifndef Online
	TimeStart = chrono::steady_clock::now();
#endif
}

void TimerStop()
{
#ifndef Online
	TimeEnd = chrono::steady_clock::now();
	auto ElapsedTime = TimeEnd - TimeStart;
	cout << "\n\nTime elapsed: " << chrono::duration<double>(ElapsedTime).count() << " seconds.\n";
#endif
}


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

/*ジョーカー2枚を除いた52枚の内、所持していない
トランプの種類を調べるプログラム*/

int main()
{
    int  n;//トランプの所持数
    int cards[4][13];//全トランプを所持しているかを
                     //管理する配列

    char sign;
    int rank;

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 13; j++)
        {
            //cards配列を初期化する
            cards[i][j] = 0;
        }
    }

    //所持しているカード枚数を入力
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        //持っているカードの種類を入力
        //第一ステータス(sign)…絵柄(S スペード,H　ハート,D　ダイヤ,C　クラブ)
        //第二ステータス(rank)…カードのランク(1~13までを入力)
        
        cin >> sign >> rank;

        //持っているカードに1をセットする
        //1…持っている 0…持っていない
        switch (sign)
        {
        case 'S':
            cards[0][rank - 1] = 1;
            break;
        case 'H':
            cards[1][rank - 1] = 1;
            break;
        case 'C':
            cards[2][rank - 1] = 1;
            break;
        case 'D':
            cards[3][rank - 1] = 1;
            break;
        }
    }

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 13; j++)
        {
            //cards配列を初期化する
            if (cards[i][j] == 0)
            {
                if (i == 0)
                {
                    cout << "S " << j+1 << endl;
                }
                if (i == 1)
                {
                    cout << "H " << j+1 << endl;
                }
                if (i == 2)
                {
                    cout << "C " << j+1 << endl;
                }
                if (i == 3)
                {
                    cout << "D " << j+1 << endl;
                }
            }
        }
    }
    return 0;
}


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

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;}
template<class T> inline T gcd(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<class T> inline T lcm(T a,T b){return a*b/gcd(a,b);}

const ll INF = 1LL << 60;

int main(){
  ll n,m;
  cin >> n >> m;
  ll p[1000000],y[1000000];
  vector<ll> d[1000000];
  FOR(i,m){
    cin >> p[i] >> y[i];
    d[p[i]].push_back(y[i]);
  }
  FOR(i,n){
    sort(d[i+1].begin(),d[i+1].end());
  }
  FOR(i,m){
    printf("%012lld\n",p[i]*1000000+(int)(lower_bound(d[p[i]].begin(),d[p[i]].end(),y[i])-d[p[i]].begin()+1));
  }



}


Measured memory_bytes: 33792
#include <stdio.h> 
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <iostream>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	int l[200010];
	int r[200010];
	int a[200010]={0};
	int i;
	for(i=1;i<=m;i++){
		cin>>l[i]>>r[i];
		if(l[i]==1||l[i]==n) a[r[i]]++;
		if(r[i]==1||r[i]==n) a[l[i]]++;
	}
	int t=0;
	for(i=2;i<=n-1;i++){
		if(a[i]==2) t=1;
	}
	if(t==1) cout<<"POSSIBLE";
	else cout<<"IMPOSSIBLE"; 
	return 0;
}

Measured memory_bytes: 2560
#include<stdio.h>
int main(){
  int n,x[3],sw,i,j,st,max=0,maxi;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&x[i]);
    if(x[i]>max){
      max=x[i];
      maxi=i;
    }
  }
  for(i=1;i<=max;i++){
    if(x[maxi]%i==0){
      sw=0;
      st=i;
      for(j=0;j<n;j++){
	if(x[j]%st!=0){
	  sw=1;
	  break;
	}
      }
      if(sw==0)printf("%d\n",st);
    }
  }
  return 0;
}

Measured memory_bytes: 1024
/*░░░░░░░▄▄▄▀▀▀▄▄███▄
░░░░░▄▀▀░░░░░░░▐░▀██▌
░░░▄▀░░░░▄▄███░▌▀▀░▀█
░░▄█░░▄▀▀▒▒▒▒▒▄▐░░░░█▌
░▐█▀▄▀▄▄▄▄▀▀▀▀▌░░░░░▐█▄
░▌▄▄▀▀░░░░░░░░▌░░░░▄███████▄
░░░░░░░░░░░░░▐░░░░▐███████████▄
░░░░░le░░░░░░░▐░░░░▐█████████████▄
░░░░toucan░░░░░░▀▄░░░▐██████████████▄
░░░░░░has░░░░░░░░▀▄▄████████████████▄
░░░░░arrived░░░░░░░░░░░░█▀██████*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

const int MAXN = 1007;
double x[MAXN], y[MAXN], r[MAXN];
double dist(int u, int v)
{
	double dx = x[u] - x[v], dy = y[u] - y[v];
	return max(0.0, sqrt(dx * dx + dy * dy) - r[u] - r[v]);
}
double d[MAXN];
bool used[MAXN];
int main()
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	double aa, bb, cc, dd;
	cin >> aa >> bb >> cc >> dd;
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> x[i] >> y[i] >> r[i];
	}
	x[n + 1] = aa, y[n + 1] = bb;
	x[n + 2] = cc, y[n + 2] = dd;
	for (int i = 1; i <= n + 2; i++)
	{
		d[i] = 1e30;
	}
	d[n + 1] = 0;
	n += 2;
	for (int i = 1; i <= n; i++)
	{
		int v = -1;
		for (int j = 1; j <= n; j++)
		{
			if (!used[j] && (v == -1 || d[j] < d[v])) v = j;
		}
		used[v] = true;
		for (int j = 1; j <= n; j++)
		{
			d[j] = min(d[j], d[v] + dist(v, j));
		}
	}
	cout.precision(20);
	cout << fixed << d[n] << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int a, b;
	cin >> a >> b;
	if (a < b) {
		cout << "a < b" << endl;
		return 0;
	}
	else if (a == b) {
		cout << "a == b" << endl;
		return 0;
	}
	else {
		cout << "a > b" << endl;
		return 0;
	}
	return 0;
}


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

using namespace std;


int main() {
    int n ; cin>>n;
    long long one = 1 , two = 1;
    for(;n--;){
        int a , b;
        cin>>a>>b;
        long long mx = max((one - 1 + a) / a ,(two - 1 + b) / b);
        one = mx * a;
        two = mx * b;
    }
    cout<<two + one<<"\n";
}

Measured memory_bytes: 256
import math


def main():
    A, B, H, M = map(int, input().split())
    alpha = 6 * M
    beta = (H * 30) + (M * 0.5)
    theta = math.radians(abs(alpha-beta))
    cos = math.cos(theta)
    ans = (A ** 2) + (B ** 2) - (2 * A * B * cos)
    print(math.sqrt(ans))


if __name__ == "__main__":
    main()

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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main(){
    gearup;
    ll n;cin>>n;
    string s;cin>>s;
    vl e(n+1),w(n+1);
    rep(i,n){
        if(s[i] == 'W'){
            w[i+1] = w[i]+1;
            e[i+1] = e[i];
        }
        else{
            e[i+1] = e[i]+1;
            w[i+1] = w[i];
        }
    }
    ll res = L_INF;
    rep(i,n){
        res = min(w[i]+e[n]-e[i+1],res);
    }
    out(res);
}

Measured memory_bytes: 5396
fn main() {
    let v = read_vec::<u32>();
    let n = v[0];
    let m = v[1];
    println!("{}", (n - 1) * (m - 1));
}

#[allow(dead_code)]
fn read<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::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;

template<typename T>
class hashmap64 {
	std::vector<std::pair<uint64, T>> map;
	uint64 mask, count, temp;
	uint64 hash64(uint64 key) {
		key = ~key;
		key ^= key << 13;
		key ^= key >> 19;
		return key ^ (key << 17);
	}
public:
	hashmap64() :map(8192, std::make_pair(~static_cast<std::uint_fast64_t>(0), T())) {
		mask = 8191; count = 0;
	}
	hashmap64(size_t s) {
		s |= s << 1;
		s |= s >> 2;
		s |= s >> 4;
		s |= s >> 8;
		s |= s >> 16;
		s |= s >> 32;
		mask = s;
		count = 0;
		map.resize(s + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
	}
	T &operator[](uint64 suf) {
		temp = mask&hash64(suf);
		while (map[temp].first != suf) {
			temp = mask&(temp + 1);
		}
		return map[temp].second;
	}
	void insert(uint64 key, const T &value) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				map[temp].second = value;
				return;
			}
			temp = mask&(temp + 1);
		}
		map[temp] = std::make_pair(key, value);
		++count;
		if ((count << 1) > mask) {
			std::pair<uint64, T> mkey;
			mask = mask << 1 | 1;
			map.resize(mask + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
			for (uint64 t = 0;t <= mask >> 1;++t) {
				if (~map[t].first) {
					mkey = map[t];
					map[t].first = ~static_cast<std::uint_fast64_t>(0);
					temp = mask&hash64(mkey.first);
					while (~map[temp].first) {
						temp = mask&(temp + 1);
					}
					map[temp] = mkey;
				}
			}
		}
		return;
	}
	bool find(uint64 key) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				return true;
			}
			temp = mask&(temp + 1);
		}
		return false;
	}
	bool empty(void) {
		return !count;
	}
	size_t size(void) {
		return count;
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	hashmap64<uint32> map(500);
	uint32 n;
	std::cin >> n;
	int64 a, sum = 1e15;
	uint32 ans = 0;
	map.insert(sum, 0);
	rep(i, 0, n) {
		std::cin >> a;
		sum += a;
		if (map.find(sum)) {
			ans = std::max(ans, i + 1 - map[sum]);
		}
		else {
			map.insert(sum, i + 1);
		}
	}
	std::cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 15156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ss second
#define ff first
#define pb push_back
#define mp make_pair

int main() {
    int a,b;
    cin>>a>>b;
    for(int i=b-a+1;i<=b+a-1;i++)
        cout<<i<<' ';

    return 0;
    }


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <cmath>

using namespace std;

int main ()
{
    int N, a, b, c, buf;
    cin >> N;
    
    for (int i=0; i<N; i++) {
        cin >> a >> b >> c;
        if(b > c)   buf = b, b = c, c = buf;
        if(a > b)   buf = a, a = b, b = buf;
        if(b > c)   buf = b, b = c, c = buf;
        if(a*a + b*b == c*c)    cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <deque>
#include <string.h>
using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef pair<string,string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

const int MAX_N = 100;
int n;
int a1[MAX_N], a2[MAX_N];


int main(){
  cin >> n;
  REP(i, n) cin >> a1[i];
  REP(i, n) cin >> a2[i];

  int ans = 0;

  REP(i, n) {
    int s = 0;
    for(int j = 0; j <= i; j++) {
      s += a1[j];
    }
    for(int j = i; j < n; j++) {
      s += a2[j];
    }
    ans = max(s, ans);
  }

  cout << ans << endl;
  
  return 0;
}


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

using namespace std;

using ll = long long;

const long long MOD = 1e9+7;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBER(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

void ALLOUT_NUMBER(vector<ll> V)
{
    ll N = V.size();
    for(ll i=0;i<N;i++)
    {
        cout << V[i];
        if(i<N-1) cout << ' ';
    }
    cout << endl;
}

class Mll
{
    public:
    ll x;

    Mll() : x(0){}
    Mll(ll x=0) : x((x%MOD+MOD)%MOD){}

    Mll operator-() const
    {
        return Mll(-x);
    }

    Mll& operator+=(const Mll& A)
    {
        if((x += A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator-=(const Mll& A)
    {
        if((x += MOD - A.x) >= MOD) x -= MOD;
        return *this;
    }
    Mll& operator*=(const Mll& A)
    {
        (x *= A.x) %= MOD;
        return *this;
    }
    
    Mll operator+(const Mll& A)
    {
        Mll res(*this);
        return res+=A;
    }
    Mll operator-(const Mll& A)
    {
        Mll res(*this);
        return res-=A;
    }
    Mll operator*(const Mll& A)
    {
        Mll res(*this);
        return res*=A;
    }
    
    Mll pow(ll t) const // t乗
    {
        if(t==0) return 1;
        Mll A = pow(t>>1);
        A *= A;
        if(t&1) A *= *this;
        return A;
    }

    // for prime mod
    Mll inv() const
    {
        return pow(MOD-2);
    }
    Mll& operator/=(const Mll& A)
    {
        return (*this) *= A.inv();
    }
    Mll operator/(const Mll& A) const
    {
        Mll res(*this);
        return res/=A;
    }

    friend ostream& operator<<(ostream& os, const Mll& M)
    {
        os << M.x;
        return os;
    }
};

vector<Mll> ALLIN_MLL(ll N)
{
    vector<ll> numbers_ll(N);
    ALLIN1_NUMBER(numbers_ll);

    vector<Mll> numbers_Mll;
    for(ll i=0;i<N;i++)
    {
        Mll add(numbers_ll[i]);
        numbers_Mll.push_back(add);
    }

    return numbers_Mll;
}

template<class T>
void OUT0(T N)
{
    cout << N << endl;
}

static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

int main()
{
    ll N,K;
    cin >> N >> K;

    vector<ll> A(N);
    ALLIN1_NUMBER(A);

    for(ll i=0;i+K<N;i++)
    {
        if(A[i]<A[i+K]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 4752
fn main() {
    let (w, h): (i64, i64) = (read::<i64>(), read::<i64>());
    let (x, y, r): (i64, i64, i64) = (read::<i64>(), read::<i64>(), read::<i64>());
    // よこ
    if x <= w - r && r <= x {
        // たて
        if y <= h - r && r <= y {
            println!("Yes");
            exit(0);
        }
    }
    println!("No");
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: usize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========



Measured memory_bytes: 5024
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 3e5 + 10;
ll a[N], b[N];
int main() {
    int n;
    ll k;
    cin >> n >> k;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for(int i = 0; i < n; i++) {
        cin >> b[i];
    }
    sort(a, a + n);
    sort(b, b + n);
    ll l = 0, r = 1e12+100, ans = 0;
    while(l <= r) {
        ll mid = (l + r) / 2;
        ll t = k;
        for(int i = 0; i < n; i++) {
            int j = n - i - 1;
            if(mid/b[i] < a[j]) {
                t -= a[j] - mid/b[i];
            }
        }
        if(t < 0) {
            l = mid + 1;
        } else {
            ans = mid;
            r = mid - 1;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3840
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

int main(){
  int a[4],b[4];
  while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
    int tmp[10] = {0};
    int hit = 0, blow = 0;
    cin>>b[0]>>b[1]>>b[2]>>b[3];
    REP(i,4){
      tmp[a[i]]++;
      tmp[b[i]]++;
    }
    REP(i,10) if(tmp[i] == 2) blow++;
    REP(i,4) if(a[i]==b[i]) hit++;
    cout << hit << " " << blow - hit << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200003];
int main()
{
  ll sum=0;
  int n;
  cin>>n;
  for(int i=1;i<=n;i++)
    cin>>a[i];
    int Max=a[1];
  for(int i=2;i<=n;i++)
    if(Max>a[i]) sum+=Max-a[i];
  else Max=a[i];
  cout<<sum<<endl;
}


Measured memory_bytes: 5188
# coding: utf-8

n = int(input())

l = [int(i)+1 for i in range(n)]
check = list(map(int,input().split()))

#print(l)
index = 0
flag = 0
for i in range(n):
    #print("check{0},今{1}".format(check[i],i))
    if check[i] != i+1:
        flag +=1
        if flag == 2:
            check[index] = check[i]
            check[i] = tmp
            #print("index{}={}".format(check[index],i+1))
            #print("index{}={}".format(check[i],index+1))
            break
        #違う部分の値を保存
        index = i
        tmp = check[index]
        #print(tmp)
        
#print(l)
#print(check)

print("YES") if l == check else print("NO")

Measured memory_bytes: 3064
#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <functional>
using namespace std;
using ll = long long;

int main() {
	int N, M;
	cin >> N;
	vector<int> T(N);
	for (int i = 0; i < N; i++) {
		cin >> T[i];
	}
	cin >> M;
	vector<pair<int, int>> drink(M);
	for (int i = 0; i < M; i++) {
		int P, X;
		cin >> P >> X;
		drink[i] = make_pair(P, X);
	}
	for (int i = 0; i < M; i++) {
		int k = T[drink[i].first - 1];
		T[drink[i].first - 1] = drink[i].second;
		cout << accumulate(T.begin(), T.end(), 0) << endl;
		T[drink[i].first - 1] = k;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <utility>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
using namespace std;

int main(){
	int h,w;
	cin>>h>>w;
	vector<vector<char>> s(h+2);
	rep(i,h+2){
		s[i].resize(w+2);
	}
	rep(i,h+2){
		if(i==0 || i==h+1){
			rep(j,w+2){
				s[i][j]='.';
			}
		}else{
			rep(j,w+2){
				if(j==0 || j==w+1){
					s[i][j]='.';
				}else{
					cin>>s[i][j];
				}
			}
		}
	}
	int count=0;
	FOR(i,1,h+1){
		FOR(j,1,w+1){
			if(s[i][j]=='.'){
				if(s[i-1][j-1]=='#')count++;
				if(s[i-1][j]=='#')count++;
				if(s[i-1][j+1]=='#')count++;
				if(s[i][j-1]=='#')count++;
				if(s[i][j+1]=='#')count++;
				if(s[i+1][j-1]=='#')count++;
				if(s[i+1][j]=='#')count++;
				if(s[i+1][j+1]=='#')count++;
				s[i][j]='0'+count;
				count=0;
			}
		}
	}
	FOR(i,1,h+1){
		FOR(j,1,w+1){
			cout<<s[i][j];
		}
		cout<<endl;
	}

}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
public class Main{
    public static void main(String[] args)throws IOException{
        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
        int[] in=new int[10];
        for(int i=0;i<10;i++){
            in[i]=Integer.parseInt(reader.readLine());
        }
        Arrays.sort(in);
        System.out.println(in[9]);
        System.out.println(in[8]);
        System.out.println(in[7]);
     
    }
}

Measured memory_bytes: 24140
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<list>
#include<map>
#include<iomanip>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>
#include<memory.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	string m[27];
	int a[27]={0},flag=0;
	for(int i=0;i<s.length();i++ )
		a[s[i]-'a']++;
	for(int i=0;i<26;i++)
	if(a[i]==0){
		cout<<char(i+'a')<<endl;
		flag=1;
		break;
	}
	if(flag==0)cout<<"None"<<endl;
	return 0;
}


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

int main(){
    int64_t a, b, k;
    cin >> a >> b >> k;
    if(a+b <= k) cout << "0 0" << endl;
    else if(a <= k) cout << "0 " << a+b-k << endl;
    else cout << a-k << " " << b << endl;
}


Measured memory_bytes: 384
def botton(x,y):
    if abs(x) <= abs(y):
        if x >= 0 and y >= 0:
            print(y-x)
        if x >= 0 and y < 0:
            print(-y-x+1)
        if x < 0 and y >= 0:
            print(y+x+1)
        if x < 0 and y < 0:
            print(-y+x+2)
    elif abs(x) > abs(y):
        if x > 0 and y > 0:
            print(-y+x+2)
        if x > 0 and y <= 0:
            print(y+x+1)
        if x <= 0 and y > 0:
            print(-y-x+1)
        if x <= 0 and y <= 0:
            print(y-x)

x,y = map(int,input().split())
botton(x,y)

Measured memory_bytes: 3064