akhauriyash/Code-Regression huggingface dataset:
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

import Debug.Trace

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = readLn >>= putStrLn . reverse . concatMap show . solve 2 1

solve 2 _ 0 = [ 0 ]
solve _ _ 0 = []
solve m sgn n
	| n `mod` m /= 0 = 1 : solve' ( n - sgn * m `div` 2 )
	| otherwise = 0 : solve' n
	where
		solve' = solve ( m * 2 ) ( -sgn )

Measured memory_bytes: 508
//import java.io.File;
import java.util.Scanner;
import java.util.Stack;

class Main{
  public static void main(String[] args) throws Exception{
    //Scanner scan = new Scanner(new File("in.txt"));
    Scanner scan = new Scanner(System.in);
    //MyScanner scan = new MyScanner();

    int input1 = scan.nextInt();
    Stack<Integer> st = new Stack<>();
    int stc = 0;
    int answer = 0;

    for(int incount = 0; incount < input1; incount++) {
      int input2 = scan.nextInt();
      boolean flag = true;

      while(!st.isEmpty()) {
        if(st.peek() > input2) {
          st.pop();
          answer++;
          stc--;
        }else break;
      }
      if(!st.isEmpty()) {
        if(st.peek() < input2) {
          st.push(input2);
          stc++;
        }
      }
      if(st.isEmpty()) {
        stc++;
        st.push(input2);
      }

      /*
      for(int j = 0; j < ite; j++) {
        System.out.print(arr[j]+",");
      }
      System.out.println(" answer -> "+answer);
      */
    }
    System.out.println(answer+stc);
  }
}

Measured memory_bytes: 106076
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define int long long
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define inf 1000000000000000007
#define f first
#define s second
#define mini(c,a,b) *min_element(c+a,c+b)
#define maxi(c,a,b) *max_element(c+a,c+b)
//printf("%.12Lf\n",);
int keta(int x){
	rep(0,i,30){
		if(x<10){
			return i+1;
		}
		x=x/10;
	}
}
int gcd(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return bb;
		}	
		bb=bb%aa;
		if(bb==0){
			return aa;
		}
	}
}	
int lcm(int x,int y){
	int aa=x,bb=y;
	rep(0,i,1000){
		aa=aa%bb;
		if(aa==0){
			return x/bb*y;
		}	
		bb=bb%aa;
		if(bb==0){
			return x/aa*y;
		}
	}
}
bool p(int x){
	if(x==1)return false;
	rep(2,i,sqrt(x)+1){
		if(x%i==0&&x!=i){
			return false;
		}
	}	
	return true;
}
int max(int a,int b){
	if(a>=b)return a;
	else return b;
}
int min(int a,int b){
	if(a>=b)return b;
	else return a;
}	
int n2[41];		
int nis[41]; 
int nia[41];
int mody[41];
int nn;
int com(int n,int y){
	int ni=1;
	for(int i=0;i<41;i++){
		n2[i]=ni;
		ni*=2;
	}
	int bunsi=1,bunbo=1;
	rep(0,i,y)bunsi=(bunsi*(n-i))%mod;
	rep(0,i,y)bunbo=(bunbo*(i+1))%mod;
	mody[0]=bunbo;
	rep(1,i,41){
		bunbo=(bunbo*bunbo)%mod;
		mody[i]=bunbo;
	}
	rep(0,i,41)nis[i]=0;
	nn=mod-2;
	for(int i=40;i>=0;i-=1){
		if(nn>n2[i]){
			nis[i]++;
			nn-=n2[i];
		}
	}
	nis[0]++;
	rep(0,i,41){
		if(nis[i]==1){
			bunsi=(bunsi*mody[i])%mod;
		}
	}
	return bunsi;
}
int yakuwa(int n){
	int sum=0;
	rep(1,i,sqrt(n+1)){
		if(n%i==0)sum+=i+n/i;
		if(i*i==n)sum-=i;
	}
	return sum;
}	
bool hei(int n){
	rep(0,i,100){
		if(i*i==n){
			return true;
		}
	}
	return false;
}
int pow(int b,int a){	
	int aa=1;
	rep(0,i,a)aa*=b;	
	return aa;
}
int a[114514];
int sum[114514];
signed main(){
	ic(n)
	int ans=0;
	rep(1,i,sqrt(n)){
		if(n%i==0&&n/i-1!=i){
			ans+=n/i-1;
		}	
	}	
	if(n==2)ans=0;
	c(ans)
}


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<ll, ll>> v(n);
  rep(i, n) cin >> v[i].first >> v[i].second;
  sort(v.begin(), v.end());
  ll ans = 0;
  rep(i, n) {
    if (m > v[i].second) {
      ans += v[i].first * v[i].second;
      m -= v[i].second;
    }
    else {
      ans += v[i].first * m;
      break;
    }
  }
  cout << ans << endl;
  return 0;
}


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

int	main()
{
	unordered_map<int64_t, int64_t>	cnt_map;
	cnt_map[0] = 1;
	int64_t	sum = 0;
	int	N;
	int64_t	A;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		cin >> A;
		sum += A;
		if (cnt_map.count(sum))
			++cnt_map.at(sum);
		else
			cnt_map[sum] = 1;
	}
	int64_t	cnt = 0;
	for (auto pr : cnt_map) 
		cnt += pr.second * (pr.second - 1) / 2;
	cout << cnt << endl;
}


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

int main() {
	int N,M;
  	cin >> N >> M;
  
  	vector<string> a(N),b(M);
  
  	for(int i = 0; i < N; i++) {
    	cin >> a.at(i);
    }
  
  	for(int i = 0; i < M; i++) {
    	cin >> b.at(i);
    }
  
  	int l =0,times = N - M + 1;
  	string ans = "No";
  
  	while(l < times) {
    	int h = 0;
      	bool stop = false;
      while(h < times) {
        bool can = true;
        for(int i = l; i < l + M; i++) {
        	for(int j = h; j < h + M; j++) {
            	if(a.at(i).at(j) != b.at(i - l).at(j - h)) {
                	can = false;
                }
            }
        }
          
        if(can)  {
          	ans = "Yes";
            stop = true;
          	break;
          }        	
      h++;
      }     
      if(stop) break;     
      	l++;
    }
  	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <unordered_set>

using ll = long long;

bool judge(const std::vector<std::string>& S)
{
    for (int i = 1; i < S.size(); i++)
    {
        if (S[i - 1].back() != S[i].front())
        {
            return false;
        }
    }

    for (int i = 0; i < S.size(); i++)
    {
        for (int j = i + 1; j < S.size(); j++)
        {
            if (S[i] == S[j])
            {
                return false;
            }
        }
    }
    return true;
}


int main()
{
    int N;
    std::cin >> N;

    std::vector<std::string> S(N);
    for (int i = 0; i < N; i++)
    {
        std::cin >> S[i];
    }
    if (judge(S))
    {
        std::cout << "Yes" << std::endl;
    }
    else
    {
        std::cout << "No" << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
from functools import reduce

N, M = map(int, input().split())
As = list(map(int, input().split()))

Bs = [A//2 for A in As]

def gcd(a, b):
    while b:
        a, b = b, a%b
    return a
def lcm(a, b):
    return a // gcd(a, b) * b

nums = []
for B in Bs:
    num = 0
    while B%2 == 0:
        B //= 2
        num += 1
    nums.append(num)

if len(set(nums)) != 1:
    ans = 0
else:
    L = reduce(lcm, Bs)
    ans = M//L - M//(2*L)

print(ans)


Measured memory_bytes: 21200
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rapido ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void solve()
{
   int n;cin>>n;
   if(n>=30)
   cout<<"Yes"<<endl;
   else
   cout<<"No"<<endl;
}
int32_t main()
{
    rapido;
    int t;
    //cin>>t;
     t=1;
    while(t--)
     solve();
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define is(s) freopen((const char*)(s),"r",stdin)
#define os(s) freopen((const char*)(s),"w",stdout)
#define elif else if
#define pb push_back
#define ll long long

using namespace std;
ll h,sum=0,k=1;
int main()
{
	//is("");os("");
	//ios_base::sync_with_stdio(false);cin.tie(0);
	cin>>h;
	while(h>0)
	{
		h/=2;
		sum+=k;
		k*=2;
	}
	cout<<sum<<endl;
	return 0;}


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

#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<29
#define LINF LLONG_MAX/3
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(v) (v).begin(),(v).end()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

vector<string> split(string str,char delim){
    for(char& c : str) if(c==delim) c=' ';
    stringstream ss;
    ss << str;
    string s;
    vector<string> res;
    while(ss >> s){
        res.push_back(s);
    }
    return res;
}

int main(){
    string s;
    cin >> s;
    int n=s.size();
    int nn=n-1;
    string s2="";
    for(int i=0;i<n;i++){
        s2.push_back(s[i]);
        s2.push_back('+');
    }

    ll ans=0;
    for(int mask=0;mask<(1<<nn);mask++){
        vector<int> v;
        for(int i=0;i<nn;i++){
            if((mask>>i) & 1){
                v.push_back(i*2+1);
            }
        }
        string vs=s2;
        for(int i=0;i<v.size();i++){
            vs[v[i]] = '.';
        }
        string ss="";
        for(int i=0;i<vs.size();i++){
            if(vs[i]=='.') continue;
            else ss.push_back(vs[i]);
        }
        vector<string> vec = split(ss,'+');
        ll sum = 0;
        for(string str : vec){
            sum += stoll(str);
        }
        ans += sum;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
N, M = [int(i) for i in input().split()]
Hn = [int(i) for i in input().split()]

g = [[] for i in range(N)] 

for i in range(M):
    A, B = [int(i) for i in input().split()]
    g[A-1].append(B)
    g[B-1].append(A)

i = 0
for row in g:
    if(len(row) != 0):
        g[i] = list(set(row))
    i = i + 1
  

i = 0
ans = 0
# 個々の展望台に接続された展望台について
for connected_obs in g:
    now_obs_height = Hn[i]
    conected_max_height = 0
    # 接続された展望台の最大値を得る
    for j in connected_obs:
        conected_max_height = max(conected_max_height, Hn[j-1])
    if(now_obs_height > conected_max_height or len(g) == 0):
        ans = ans + 1
    i = i + 1

print(ans)

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

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

int main(){

    int A,B;
    cin >> A >> B;
    int Min = min(A, B);
    int Max = max(A, B);

    string moji;
    rep(i, Max)
        moji += to_string(Min);
    cout << moji << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <queue>
#include <sstream>
using namespace std;

typedef struct {
	int d[8];
	int count;
} data;
map <string,int> memo;
queue <data> bfs;

string tto_string(int n) {
stringstream ss;
ss << n;
string str = ss.str();  
return str;
}

int main() {
	data first;
	for (int i = 0;i < 8;i++) {
		first.d[i] = i;
	}
	first.count = 0;
	bfs.push(first);
	for (;;) {
		if (bfs.empty()) break;
		data front = bfs.front();
		bfs.pop();
		string str = tto_string(front.d[0])+tto_string(front.d[1])+tto_string(front.d[2])+tto_string(front.d[3])+tto_string(front.d[4])+tto_string(front.d[5])+tto_string(front.d[6])+tto_string(front.d[7]);
		if(memo.find(str) !=memo.end()){
			continue;
		}
		memo[str] = front.count;
		//Find Zero
			int zero;
			for (int i = 0;i < 8;i++) {
				if (front.d[i] == 0) {
					zero = i;
					break;
				}
			}
			
			//Move
			if (zero < 4) {
				//???????????\?????????
				int x;
				data array = front;
				array.count = front.count + 1;
				x = array.d[zero];
				array.d[zero] = array.d[zero+4];
				array.d[zero+4] = x;
				bfs.push(array);
				if (zero>0) {
					int y;
					data array2 = front;
					array2.count = front.count + 1;
					y = array2.d[zero];
					array2.d[zero] = array2.d[zero-1];
					array2.d[zero-1] = y;
					bfs.push(array2);
				}
				if(zero<3) {
					int z;
					data array3 = front;
					array3.count = front.count + 1;
					z = array3.d[zero];
					array3.d[zero] = array3.d[zero+1];
					array3.d[zero+1] = z;
					bfs.push(array3);
				}
			}
			else {
				//???????????\?????????
				int x;
				data array = front;
				array.count = front.count + 1;
				x = array.d[zero];
				array.d[zero] = array.d[zero-4];
				array.d[zero-4] = x;
				bfs.push(array);
				if (zero>4) {
					int y;
					data array2= front;
					array2.count = front.count + 1;
					y = array2.d[zero];
					array2.d[zero] = array2.d[zero-1];
					array2.d[zero-1] = y;
					bfs.push(array2);
				}
				if(zero<7) {
					int z;
					data array3 = front;
					array3.count = front.count + 1;
					z = array3.d[zero];
					array3.d[zero] = array3.d[zero+1];
					array3.d[zero+1] = z;
					bfs.push(array3);
				}
			}
	} 
	while(true) {
		int puz[8];
		if (cin >> puz[0]) {
			for (int i = 1;i < 8;i++) {
				cin >> puz[i];
			}
			string str = tto_string(puz[0])+tto_string(puz[1])+tto_string(puz[2])+tto_string(puz[3])+tto_string(puz[4])+tto_string(puz[5])+tto_string(puz[6])+tto_string(puz[7]);
			cout << memo[str] << endl;
		}
		else break;
	}
	return 0;
}

Measured memory_bytes: 3504
#include <bits/stdc++.h>
#define rep(i, n) for(int i= 0; i < (n); i++)
using ll= long long int;
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; }
ll mod= 1e9 + 7;



int main(){
  int x;
  cin >> x;
  if(x>=30){cout << "Yes"<< endl;}else{cout << "No" << endl;}
}

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

int main() {
  char c;
  cin >> c;
  
  const string vowel = "aeiou";
  string result; 
  for (int i = 0; i < vowel.size(); i++) {
    if (c == vowel.at(i)) {
      result = "vowel";
      break;
    }
    else {
      result = "consonant";
    }
  }
  
  cout << result << endl;
  
  return 0;
}



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

int main(void) {
  int n;
  cin >> n;
  vector<int> N(n), P(n), Q(n);
  for (int i = 0; i < n; i++) {
    cin >> P[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> Q[i];
  }

  // count P
  for (int i = 0; i < n; i++) {
    N[i] = i + 1;
  }
  int p = 0;
  do {
    p++;
    bool match = true;
    for (int i = 0; i < n; i++) {
      if (N[i] != P[i]) {
        match = false;
      }
    }
    if (match) {
      break;
    }
  } while (next_permutation(N.begin(), N.end()));

  // count Q
  for (int i = 0; i < n; i++) {
    N[i] = i + 1;
  }
  int q = 0;
  do {
    q++;
    bool match = true;
    for (int i = 0; i < n; i++) {
      if (N[i] != Q[i]) {
        match = false;
      }
    }
    if (match) {
      break;
    }
  } while (next_permutation(N.begin(), N.end()));

  cout << abs(p - q) << endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/python

n = input()
a = [int(i) for i in input().split()]
color = [0, 0, 0, 0, 0, 0, 0, 0]
tr = 0

for i in a:
  if i < 3200 and color[int(i/400)] == 0:
    color[int(i / 400)] = 1
  elif i >= 3200:
    tr += 1

color_kind = 0
for i in color:
  if i == 1:
    color_kind += 1

if color_kind > 0:
  print(str(color_kind) + " ", end = '')
else:
  print(str(1) + " ", end = '')

print(str(color_kind + tr))

Measured memory_bytes: 3064
H,W=map(int,input().split())
dir_H=0
dir_W=0

if H==1 or W==1:
    print(1)
else:
    if H%2==0:
        dir_H=H//2
        print(dir_H*W)
    else:
        if W%2==0:
            dir_W=W//2
            print(dir_W*H)
        else:
            dir_H=H//2+1
            dir_W=W//2+1
            print(dir_H*dir_W+(H-dir_H)*(W-dir_W))
    


Measured memory_bytes: 3060
n,k = map(int,input().split())

z = 0
l = [0]
for i in range(k):
  d=int(input())
  s =list(map(int,input().split()))
  l.extend(s)
for i in range(n+1):
  if l.count(i)==0:
    z = z + 1
print(z)

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

#define FasterIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(), v.end()
const int MOD = 1e9+7;

int main(){
    FasterIO;

    int n, d;

    while(cin>>n>>d){
        int ans = n/(2*d+1);

        if(n%(2*d+1))
            ans++;
        cout<<ans<<endl;
    }

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cstring>
#include<cmath>
#include <numeric>
#include<queue>
#include<climits>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
//#define INF LLONG_MAX / 2;
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;
typedef pair<ll,int> LL_IP;

#define INF 1e9

#define ARRAY_MAX 3000



typedef struct edge{
    int from;
    int to;
    int cost;
}EDGE;


/*頂点sから各頂点への最短距離を求める*/
/*V-1回の更新で各ノードへの最短距離は求められるが、V回目*/
bool shortest_path(int v,int e,int s,vector<EDGE>& arr,vector<int>& d){
    /*頂点の個数、辺の個数、始点となる頂点、辺の情報、最短距離*/
    for(int i = 0;i < d.size();i++){
        d[i] = INF;
    }
    d[s]=0;
    
    for(int i = 0;i < v;i++){
        for(int j = 0;j < e;j++){
            EDGE tmp = arr[j];
            if(d[tmp.from] != INF && d[tmp.to] > d[tmp.from] + tmp.cost){
                d[tmp.to] = d[tmp.from] + tmp.cost;
                if(i == v-1){
                    return true;
                }

            }
        }
    }
    return false;
}

int main(){

    int v,e,r;/*v:頂点の個数、e:辺の個数、r:始点となる頂点の番号*/
    cin >> v >> e >> r;
    vector<EDGE> arr(ARRAY_MAX);/*辺の情報を格納*/
    vector<int> d(ARRAY_MAX,0);/*負の閉路があるかの判定、0で初期化*/

    REP(i,e){
        cin >> arr[i].from >> arr[i].to >> arr[i].cost;
    }

    bool exist_negative_cycle = shortest_path(v,e,r,arr,d);
    if(exist_negative_cycle){
        /*負の閉路が存在する場合*/
        cout << "NEGATIVE CYCLE" << endl;
    }else{
        for(int i = 0;i < v;i++){
            if(d[i] == INF){
                cout << "INF" << endl;
            }else{
                cout << d[i] << endl;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3188
#include<stdio.h>

int main()
{
  int N;
  int n,m;
  int i,j;
  int t=0;
  int s=1;
  scanf("%d",&N);
  n=N/4;
  m=N/7;
  for(i=0;i<=n;i++){
    for(j=0;j<=m;j++){
      if(4*i+7*j==N){
        t=1;
        s=0;
        break;
      }
    }
    if(s==0) break;
  }
  if(t==1){
    printf("Yes");
  } else if(t==0){
    printf("No");
  }
  return 0;
}


Measured memory_bytes: 1728
#include <iostream>
#include <cstring>

using namespace std;

int main(int argc, char* argv[])
{
    int r, c, sum_r = 0, sum_c = 0;

    cin >> r >> c;

    int array[r+1][c+1];

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

    for (int i = 0; i < r; i++){
        for (int j = 0; j < c; j++){
            cout << array[i][j] << " ";
            sum_r += array[i][j];
        }
        
        array[i][c] = sum_r;
        cout << array[i][c] << endl;
        sum_r = 0;
    }

    for (int j = 0; j < c + 1; j++){
        for (int i = 0; i < r; i++){
            sum_c += array[i][j];
        }
        if (j) cout << " ";
        cout << sum_c;
        sum_c = 0;
        
    }
    cout << endl;

    return 0;
}



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

int main(){
    int a = 0, b = 0, c = 0;
    int N = 0, M = 0;
    string s;
    
    cin >> a >> b >> c;

    if(a < c && c < b){
        cout << "Yes" << endl;
    }
    else if (b < c && c < a){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284

typedef long long ll;
typedef long long int lli;

#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)

template<class T>bool umax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool umin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

using namespace std;

// gcd
int gcd(int a, int b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}
// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

// sort big to small
// sort(A,A+N, greater<int>());

// v.front() = -BOUND;
// v.back() = BOUND;

// Iterator
// v.begin
// v.end
int answer=0;

bool checker(long long int M){
    bool c3=false,c5=false,c7=false;
    while(M>0){
        if(M%10==3) c3 = true;
        if(M%10==5) c5 = true;
        if(M%10==7) c7 = true;
        M/=10;
    }
    return c3&&c5&&c7;
}
void make753(long long int pre,long long int N){
    if(10*pre+3<=N){
        if(checker(10*pre+3)) answer++;
        make753(10*pre+3,N);
    } else{
        return;
    }
    if(10*pre+5<=N){
        if(checker(10*pre+5)) answer++;
        make753(10*pre+5,N);
    } else{
        return;
    }
    if(10*pre+7<=N){
        if(checker(10*pre+7)) answer++;
        make753(10*pre+7,N);
    }
    return;
}

int main() {
    long long int N;
    cin >> N;
    make753(0,N);

    cout << answer <<endl;
    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int s;
    double w, h, bmi;
    
    while (scanf("%d %*c %lf %*c %lf", &s, &w, &h) != EOF) {
        bmi = w / (h * h);
        if (bmi >= 25) {
            printf("%d\n", s);
        }
    }
    return 0;
}

Measured memory_bytes: 628
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 1000000007;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}



signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll n;cin>>n;
  V<ll> v(n);
  rep(i,0,n)cin>>v[i];

  map<ll,ll> ne;

  rep(i,0,n){
    ne[i-v[i]]++;
  }

  ll ans=0;
  rep(i,0,n){
    ans+=ne[v[i]+i];
  }
  cout<<ans<<ENDL;
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

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

int main(){
  int r,d,x2000;
  cin>>r>>d>>x2000;
  int a[11];
  a[0]=x2000;
  for(int i=0;i<10;i++){
    a[i+1]=a[i]*r - d;

  }
  for(int i=1;i<11;i++){
    cout<<a[i]<<"\n";
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=100003,INF=1<<30,MAX_LOG=20;

vector<vector<int>> to(MAX,vector<int>(MAX_LOG,0));

int main(){
    
    int N;cin>>N;
    vector<int> X(N);
    for(int i=0;i<N;i++){
        //scanf("%d",&X[i]);
        cin>>X[i];
    }
    
    int L,Q;cin>>L>>Q;
    
    for(int i=0;i<N;i++){
        auto it=upper_bound(all(X),X[i]+L);
        if(it==X.end()){
            if(i!=N-1) to[i][0]=N-1;
            else to[i][0]=INF;
        }else{
            it--;
            to[i][0]=distance(X.begin(),it);
        }
    }
    
    for(int j=1;j<MAX_LOG;j++){
        for(int i=0;i<N;i++){
            if(to[i][j-1]==INF) to[i][j]=INF;
            else to[i][j]=to[to[i][j-1]][j-1];
        }
    }
    
    for(int i=0;i<Q;i++){
        int a,b;cin>>a>>b;
        //scanf("%d",&a);
        //scanf("%d",&b);
        a--;b--;
        if(a>b) swap(a,b);
        
        int ans=0;
        
        while(1){
            auto it=upper_bound(all(to[a]),b);
            if(it==to[a].begin()){
                ans++;
                break;
            }
            it--;
            if(*it==b){
                ans+=(1<<(distance(to[a].begin(),it)));
                break;
            }
            if(it==to[a].begin()&&*it>=b){
                ans++;
                break;
            }
            
            ans+=(1<<(distance(to[a].begin(),it)));
            a=*it;
            
        }
        
        cout<<ans<<"\n";
        
    }
}



Measured memory_bytes: 12928
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main()
{
    int n;
    cin >> n;
    int a[n];
    rep(i, 0, n) cin >> a[i];
    int cnt = 0;
    for (int i = n - 2; i >= 0; i--) {
        for (int j = 0; j <= i; j++) {
            if (a[j + 1] < a[j]) {
                swap(a[j], a[j + 1]);
                cnt ++;
            }
        }
    }
    rep(i, 0, n) {
        if (i == n - 1) cout << a[i] << endl;
        else cout << a[i] << " ";
    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 3124
#include <cstdio>
#include <iostream>
using namespace std;
#define N 100
#define M 100

int main() {
  int n, m;
  cin >> n >> m;
  int A[n][m];
  int B[m];
  int C[m];

  for (int i = 0; i < n; i++) {
   for (int j = 0; j < m; j++) {
      scanf("%d", &A[i][j]);
   } 
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &B[i]);
  }

  for (int i = 0; i < n; i++) {
    int tmp = 0;
    for (int j = 0; j < m; j++) {
       tmp += A[i][j] * B[j]; 
    }
    C[i] = tmp;
  }
  
  for (int i = 0; i < n; i++) {
    cout << C[i] << endl;
  }
}

Measured memory_bytes: 1284
#include <stdio.h>

int main(void)
{
	int n;
	int i;
	int a, b, c;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; ++i){
		scanf("%d %d %d", &a, &b, &c);
		if (((a * a) == (b * b) + (c * c)) || ((b * b) == (a * a) + (c * c))|| ((c * c) == (b * b) + (a * a))){
		printf("YES\n");
		}
		else {
			printf("NO\n");
		}
	}
	
	return (0);
}

Measured memory_bytes: 576
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll h,w;
    cin >> h >> w;
    ll ch,cw,dh,dw;
    cin >> ch >> cw >> dh >> dw;
    ch--;
    cw--;
    dh--;
    dw--;
    vector<vector<char>> s(h,vector<char>(w));
    rp(i,h){
        rp(j,w){
            cin >> s[i][j];
        }
    }
    matrix mat(h,Vi(w,1000000000));
    vector<queue<PLL>> vq(250000);
    vq[0].push(mp(ch,cw));
    mat[ch][cw]=0;
    rp(dist,250000){
        while(!vq[dist].empty()){
            PLL pl=vq[dist].front();
            vq[dist].pop();
            repi(i,-2,3){
                repi(j,-2,3){
                    if(i==0&&j==0) continue;
                    if(pl.first+i<0||pl.first+i>=h) continue;
                    if(pl.second+j<0||pl.second+j>=w) continue;
                    if(s[pl.first+i][pl.second+j]=='#') continue;
                    if(mat[pl.first][pl.second]<dist) continue;
                    
                    if(abs(i)+abs(j)==1){
                        if(chmin(mat[pl.first+i][pl.second+j],mat[pl.first][pl.second])) vq[dist].push(mp(pl.first+i,pl.second+j));
                    }else{
                        if(chmin(mat[pl.first+i][pl.second+j],mat[pl.first][pl.second]+1)) vq[dist+1].push(mp(pl.first+i,pl.second+j));
                    }
                }
            }
        }
    }
    if(mat[dh][dw]>10000000) print(-1);
    else print(mat[dh][dw]);

    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 180568
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#define INF          1e9
#define INFLL        1e18
#define EPS          1e-9
#define MOD          1000000007
#define REP(i,n)     for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)    for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)    for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)   for(ll i=(n);i>0;--i)
#define REPC(i,obj)  for(auto i:obj)
#define ALL(obj)     (obj).begin(),(obj).end()
#define SETP(n)      cout<<fixed<<setprecision(n)
#define VV(T,h,w)    vector<vector<T>>(h,vector<T>(w))
#define VVI(T,h,w,i) vector<vector<T>>(h,vector<T>(w,i))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
    ll p = in(), q = in(), r = in();
    cout << p + q + r - max({ p,q,r }) << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    // 整数の入力
    int a = sc.nextInt();
    // スペース区切りの整数の入力
    int b = sc.nextInt();
    int c = sc.nextInt();

    int ab = a + b;
    int bc = b + c;
    int ac = a+c;

    int result = Math.min(ab, Math.min(bc , ac));
    System.out.println(result);
  }
}


Measured memory_bytes: 20692
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from bisect import bisect_left

a, b, q = map(int, readline().split())
s = [int(readline()) for _ in range(a)]
t = [int(readline()) for _ in range(b)]
s.sort()
t.sort()
inf = float('inf')
for i in range(q):
    x = int(readline())
    ans = inf
    index_s = bisect_left(s, x)
    index_t = bisect_left(t, x)
    if index_s > 0 and index_t > 0:
        ans = min(ans, x - min(s[index_s - 1], t[index_t - 1]))
    if index_s < a and index_t < b:
        ans = min(ans, max(s[index_s], t[index_t]) - x)
    if index_s > 0 and index_t < b:
        ans = min(ans, min((x - s[index_s - 1]) * 2 + t[index_t] - x, x - s[index_s - 1] + (t[index_t] - x) * 2))
    if index_s < a and index_t > 0:
        ans = min(ans, min((s[index_s] - x) * 2 + x - t[index_t - 1], s[index_s] - x + (x - t[index_t - 1]) * 2))
    print(ans)


Measured memory_bytes: 12204
#include<bits/stdc++.h>
using namespace std;
#define ll long long int

int main() {
    string S;
    ll ans=0;
    string tmp="";
    cin >> S;

    for(int i=0; i<pow(2, S.size()-1); i++){
	int bit=i;
	for(int j=0; j<S.size(); j++){
	    tmp += S[j];
	    if(bit&1){
		ans += stoll(tmp);
		tmp = "";
	    }
	    bit = bit>>1;
	}
	ans += stoll(tmp);
	tmp = "";
    }


    cout << ans << endl;
} 



Measured memory_bytes: 256
function main (input) {
    const N = input.split('\n')[0].split(' ')[0];
    const K = input.split('\n')[0].split(' ')[1];
    const l = input.split('\n')[1].split(' ')
                 .map(function(e){return Number(e);})
                 .sort(function(a,b){return b-a;});
    ans = 0;

    for (var i = 0; i < K; i++) {
        ans = ans + l[i];
    }
    console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);

  int n;
  cin >> n;
  rep (i, 25) {
    rep(j, 15) {
      if (i == 0 && j == 0) continue;
      if (4 * i + 7 * j == n) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}


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

int64_t MOD = 1000000007;
double PI = 3.141592653589793;

int main()
{
    int64_t N, D;
    cin >> N >> D;
    D = D * D;
    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        int64_t X, Y;
        cin >> X >> Y;
        if (X * X + Y * Y <= D)
            ans++;
    }
    cout << ans;
}

Measured memory_bytes: 3628
import fractions
a,b,c,d=map(int, input().split()) 

i = b//c- (a-1)//c
j = b//d- (a-1)//d

f=fractions.gcd(c,d)
f2= int(c * d / f)
k = b//f2 - (a-1)//f2

pot = i + j - k

print(b-(a-1)-pot)

Measured memory_bytes: 5052
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#define INF 0x3f3f3f3f
int read()
{
    int x=0,f=1;    char c=getchar();
    while(c<'0'||c>'9')   {if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9') {x=x*10+c-'0';c=getchar();}
    return x*f;
}
//priority_queue<int,vector<int>,greater<int> >q1;
priority_queue<int,vector<int>,less<int> >q;
//priority_queue<int,vector<int>,less<int> >q2;
const ll maxn = 1e6 + 7;
const int mod = 1e9 + 7;
/** keep hungry and keep calm! **/

/**
奇数+奇数 = 偶数
偶数+偶数 = 偶数
不管有多少偶数一定能相加
只有奇数有奇数个时会单出来一个 
**/
int main()
{
    int n,tmp;
    bool book = true;
    scanf("%d",&n);
    for(register int i=1;i<=n;i++)
	{
        scanf("%d",&tmp);
        if(tmp %2 != 0)
		{
            book=!book;
        }
    }
    if(book){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	a := []string{"AC", "WA", "TLE", "RE"}
	m := map[string]int{}
	for _, v := range a {
		m[v] = 0
	}

	for i := 0; i < n; i++ {
		s := ""
		fmt.Scan(&s)

		m[s]++
	}

	for _, v := range a {
		fmt.Printf("%s x %d\n", v, m[v])
	}
}


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

int main() {
    int a, b, count=0;
    cin >> a >> b;
    for (int i = a; i <=  b; i++) {
        if(i/1000 == (i%100)%10*10 + (i%100)/10) {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define MAXN 200000
using namespace std;
int main(){
	int N, K;
	long long h[MAXN], ans=0;
	cin >> N >> K;
	for(int i=0; i<N; i++)
		cin >> h[i];
	sort(h, h+N, greater<long long>());
	for(int i=K; i<N; i++)
		ans += h[i];
	cout << ans << endl;
}




Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main() {
  int N;
  cin >> N;

  int ans = 0, pre = 1e9;
  for (int i = 0; i < N; i++) {
    int A;
    cin >> A;
    if (pre < A) {
      ans++;
    }
    pre = A;
  }

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


Measured memory_bytes: 3120
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = 999999999;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

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

int main(){
	
    int n;
    int s[105] = {};
    int ans = 0;

    cin >> n;

    rep(i,0,n){
        cin >> s[i];
        ans += s[i];
        if(s[i] % 10 == 0)s[i] = 0;
    }
    sort(s,s+n);

    int i = 0;
    while(ans%10 == 0 && ans > 0 && i < n){
        ans -= s[i];
        i++;
    }
	
	if(ans%10 == 0)cout << 0 << endl;
    else cout << ans << endl;
	return  0;
}

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


int main(){
    int n, k; cin >> n >> k;
    int ans = 1;

    for(int i = 0; i < n; i++){
        if(ans * 2 < ans + k) ans *= 2;
        else ans  += k;
    }

    cout << ans << endl;
}

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

int main()
{
    ll n;
    cin >> n;
    vector<pair<ll, int>> fs;
    for (ll i = 2; i * i <= n; ++i)
    {
        int x = 0;
        while (n % i == 0)
        {
            n /= i;
            ++x;
        }
        fs.emplace_back(i, x);
    }
    if (n != 1)
        fs.emplace_back(n, 1);

    int ans = 0;
    for (auto p : fs)
    {
        int x = p.second;
        int b = 1;
        while (b <= x)
        {
            x -= b;
            b++;
            ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

#define MAX 100005
#define INF INT_MAX

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

int main(int, char**)
{
    int n;
    cin >> n;

    vector<ll> a(n+1);
    for (int i = 1; i <= n; i++) cin >> a[i];

    for (int i = 1; i <= n; i++) {
        int pi = i/2;
        int li = i*2;
        int ri = i*2+1;
        cout <<  "node " << i << ": key = " << a[i] << ", ";
        if (pi > 0) cout << "parent key = " << a[pi] << ", ";
        if (li <= n) cout << "left key = " << a[li] << ", ";
        if (ri <= n) cout << "right key = " << a[ri] << ", ";
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3072
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	X, Y := sc.nextStr(), sc.nextStr()

	if X < Y {
		fmt.Fprintln(wtr, "<")
	} else if Y < X {
		fmt.Fprintln(wtr, ">")
	} else {
		fmt.Fprintln(wtr, "=")
	}
	wtr.Flush()
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<bool> vb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 29);
const ll LINF = 1e18;
const double PI = acos(-1);

template<typename T>vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value != 0>::type
fill_v(U & u, const V... v) { u = U(v...); }
template<typename T, typename U, typename... V>
typename enable_if<is_same<T, U>::value == 0>::type
fill_v(U & u, const V... v) { for (auto& e : u) fill_v<T>(e, v...); }
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 (a > b) { a = b; return 1; } return 0; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	while (N != 0) {
		int W, H;
		cin >> W >> H;
		vvi Map(W, vi(H,0));
		vi X(N), Y(N);
		vector<vb> M(W, vb(H, false));
		REP(i, N) {
			cin >> X[i] >> Y[i];
			X[i]--;
			Y[i]--;
			M[X[i]][Y[i]] = true;
		}
		int S, T;
		cin >> S >> T;
		REP(i, N) {
			FOR(x, max(0, X[i] - S + 1),X[i] + 1) {
				FOR(y, max(0, Y[i] - T + 1), Y[i] + 1) {
					Map[x][y]++;
				}
			}
		}
		int ans = 0;
		REP(x, W) {
			REP(y, H) {
				chmax(ans, Map[x][y]);
			}
		}
		cout << ans << endl;
		cin >> N;
	}
	return 0;
}



Measured memory_bytes: 3108
#pragma comment(linker, "/STACK:128777216")
#pragma GCC optimize("fast-maths")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <bitset>
#include <stack>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <climits>
#include <ctime>
#include <random>
#include <complex>
using namespace std;

#define forx(_name, _from, _to, _value) for (int _name = _from; _name < _to; _name += _value)
#define rforx(_name, _from, _to, _value) for (int _name = _from; _name > _to; _name -= _value)
#define all(_STL_NAME) _STL_NAME.begin(), _STL_NAME.end()
#define rall(_STL_NAME) _STL_NAME.rbegin(), _STL_NAME.rend()
#define mp(_FIRST,_SECOND) make_pair(_FIRST, _SECOND)

typedef long long ll;
typedef unsigned long long llu;
typedef long double ld;
const ld eps = 1e-6;
mt19937 rndm;

void start() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cout.precision(6); cout.setf(ios::fixed);
	string FILENAME = "\-__-/";
	rndm.seed(time(0));
#ifdef _DEBUG
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#else
	//freopen((FILENAME + ".in").c_str(), "rt", stdin);
	//freopen((FILENAME + ".out").c_str(), "wt", stdout);
#endif
}

const int maxn = 1e6 + 500;
int mark[maxn];
bool nprime[maxn];

bool eratosphene() {
	nprime[1] = 1;
	for (int i = 2; i < maxn; ++i) {
		if (!nprime[i]) {
			int v = 0;
			for (int j = i; j < maxn && v < 2; j += i) {
				v += mark[j];
			}
			if (v > 1)
				return false;
		}
	}
	return true;
}

int gcd(int a, int b) {
	while (b) {
		a %= b;
		swap(a, b);
	}
	return a;
}

int main() {
	/* File On */
	start();
	int n;
	cin >> n;
	vector<int> q(n);
	for (int i = 0; i < n; ++i) {
		cin >> q[i];
		mark[q[i]]++;
	}
	int g = q[0];
	for (int i = 1; i < n; ++i)
		g = gcd(q[i], g);
	if (g != 1)
		return !(cout << "not coprime");
	if (eratosphene())
		cout << "pairwise coprime";
	else
		cout << "setwise coprime";
#ifdef _DEBUG
	cout << "\nTime: " << 1.0 * clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}

Measured memory_bytes: 10660
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
mod = 10 ** 9 + 7

class LazyBit():
    """区間加算、区間取得クエリをそれぞれO(logN)で答える
    add: 区間[l, r)にvalを加える
    get_sum: 区間[l, r)の和を求める
    l, rは0-indexed
    """
    def __init__(self, n):
        self.n = n
        self.bit0 = [0] * (n + 1)
        self.bit1 = [0] * (n + 1)

    def _add(self, bit, i, val):
        i = i + 1
        while i <= self.n:
            bit[i] += val
            i += i & -i

    def _get(self, bit, i):
        s = 0
        while i > 0:
            s += bit[i]
            i -= i & -i
        return s

    def add(self, l, r, val):
        """区間[l, r)にvalを加える"""
        self._add(self.bit0, l, -val * l)
        self._add(self.bit0, r,  val * r)
        self._add(self.bit1, l,  val)
        self._add(self.bit1, r, -val)

    def get_sum(self, l, r):
        """区間[l, r)の和を求める"""
        return self._get(self.bit0, r) + r * self._get(self.bit1, r) \
               - self._get(self.bit0, l) - l * self._get(self.bit1, l)

n, q = MAP()
lazyBit = LazyBit(n+1)
for _ in range(q):
    query = input().split()
    if query[0] == "0":  # update
        _, s, t, x = query
        s, t, x = map(int, [s, t, x])
        lazyBit.add(s, t+1, x)

    else:  # find
        _, s, t = query
        s, t = map(int, [s, t])
        print(lazyBit.get_sum(s, t+1))



Measured memory_bytes: 13344