akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

typedef tuple<ll, ll, ll, ll> P; // コスト, 頂点
const ll vectsize = 1000009;
const ll INF = vectsize * vectsize * vectsize;
ll h, w, k;
ll myx1, myy1, myx2, myy2;
vector<bool> movable(vectsize);
vector<bool> used(4 * vectsize, false);
const vector<ll> dx = {1, 0, -1, 0};
const vector<ll> dy = {0, 1, 0, -1};
priority_queue<P, vector<P>, greater<P>> mins;
vector<ll> dist(4 * vectsize, INF);
ll result = INF;

ll index(ll x, ll y, ll dir)
{
    return x * h + y + dir * h * w;
}

int main()
{
    cin >> h >> w >> k;
    cin >> myy1 >> myx1 >> myy2 >> myx2;
    myx1--; myy1--; myx2--; myy2--;
    rep(y, h)
    {
        rep(x, w)
        {
            char c;
            cin >> c;
            movable[index(x, y, 0)] = (c == '.');
        }
    }

    dist[index(myx1, myy1, 0)] = 0;
    mins.push(P(0, myx1, myy1, 0));
    while (!mins.empty())
    {
        P p = mins.top(); mins.pop();
        ll prevdist, x, y, dir;
        tie(prevdist, x, y, dir) = p;
        // cout << prevdist << ' ' << x << ' ' << y << ' ' << dir << endl;
        if (x == myx2 && y == myy2)
        {
            result = (prevdist + (k - 1)) / k;
            break;
        }
        if (used[index(x, y, dir)])
        {
            continue;
        }
        used[index(x, y, dir)] = true;

        // 向きを変える
        rep(i, 3)
        {
            ll newdir = (dir + i + 1) % 4;
            ll newdist = (prevdist + (k - 1)) / k * k;
            if (used[index(x, y, newdir)] || (dist[index(x, y, newdir)] <= newdist))
            {
                continue;
            }
            dist[index(x, y, newdir)] = newdist;
            mins.push(P(newdist, x, y, newdir));
        }
        // 進む
        ll newdist = prevdist + 1;
        ll newx = x + dx.at(dir);
        ll newy = y + dy.at(dir);
        if (newx < 0 || newx >= w || newy < 0 || newy >= h || !movable[index(newx, newy, 0)] || used[index(newx, newy, dir)] || (dist[index(newx, newy, dir)] <= newdist))
        {
            continue;
        }
        dist[index(newx, newy, dir)] = newdist;
        mins.push(P(newdist, newx, newy, dir));
    }

    if (result == INF)
    {
        cout << "-1" << endl;
    }
    else
    {
        cout << result << endl;
    }
}

Measured memory_bytes: 51128
#include <stdio.h>

int main(void)
{
	int n = 0, k = 0, i = 0, po = 0;
	int human[100001] = { 0 };

	scanf("%d %d", &n, &k);
	for (i = 0; i < n; i++) {
		scanf("%d", &human[i]);
	}

	for (i = 0; i < n; i++) {
		if (human[i] >= k) {
			po++;
		}
	}
	printf("%d", po);

	return 0;
}

Measured memory_bytes: 512
N, K = map(int,input().split())
a = [0]*N

for i in range(K):
  b = input()
  c = list(map(int,input().split()))
  for j in range(len(c)):
    a[c[j]-1] += 1
count = 0
for i in range(N):
  if(a[i] == 0):
    count+=1

print(count)

Measured memory_bytes: 9204
using System;

public class Hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = int.Parse(line[0]);
        var b = int.Parse(line[1]);
        var c = int.Parse(line[2]);
        var d = int.Parse(line[3]);
        var taka = (c + b - 1) / b;
        var ao = (a + d - 1) / d;
        Console.WriteLine(taka <= ao ? "Yes" : "No");
    }
}


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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << " = " << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define SP << " " <<

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }

int nmax=200000; // 2*(10^5)
vvec g(nmax);



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    string s;
    cin>>s;
    if(s.substr(0,4)=="YAKI"){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
#define pb push_back
#define int long long
#define pii pair<int,int>
#define f first
#define se second
using namespace std;
double pi=acos(-1.0);
int m=1000000007;
bool cmp2(int n,pii p)
 {return n<p.f;}
int abst(int a)
{return a<0?-a:a;}
struct HASH{
  size_t operator()(const pii &x)const{
    return (size_t) x.first * 37U + (size_t) x.second;}};
int Pow(int n,int x){int ans=1;
 while(x>0)
 {if(x&1)ans=(ans*n)%m;n=(n*n)%m;x=x>>1;}
 return ans;}
int a[1000001];
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;}
int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
for(int i=2;i*i<=1000000;i++)
if(a[i]==0)
for(int j=i*i;j<=1000000;j+=i)
a[j]=1;
a[0]=1;
a[1]=1;
int x;
cin>>x;
for(int i=x;i<=1000000;i++)
if(a[i]==0)
{
    cout<<i;
    return 0;
}
}

Measured memory_bytes: 8064
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
typedef pair<ll,ll> P;
int main(){
	vector<P> v;
	int n;
	cin >> n;
	int a,b;
	rep(i,n){
		cin >> a>>b;
		v.push_back(P(a,b));
	}
	ll cnt = 0;
	for(int i=n-1;i>=0;i--){
		v[i].first += cnt;
		if (v[i].first%v[i].second==0) continue;
		else cnt += (v[i].first/v[i].second + 1)*v[i].second - v[i].first;
	}

	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 2548
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,b=0,i;
  double d,c;
  cin>>n;
  for(i=1;i<=n;i++)
  {
    if(i%2!=0) b++;
  }
  c=(double)(b);
 d=(c/n);
  cout<<fixed<<setprecision(10)<<d<<endl;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
INF = 2 ** 63 - 1
d = [(-1)*INF for i in range(N+1)]
d[1] = 0
data = []
for i in range(M):
    a, b, c = map(int, input().split())
    data.append([a, b, c])

for i in range(N):
    d_N = d[N]
    for j in range(M):
        a = data[j][0]
        b = data[j][1]
        c = data[j][2]
        d[b] = max(d[b], d[a]+c)
    if i == N-1:
        if d_N != d[N]:
            ans = "inf"
        else:
            ans = d[N]
print(ans)


Measured memory_bytes: 3440
#include "iostream"
#include "string"
#include "vector"
#include "algorithm"
#include "functional"
#include "cmath"
#include "set"

using namespace std;

struct path {
    int end_pos;
    set<int> passed_nodes;
};

int dps_path_number(const path& current_path, const vector<vector<bool>>& edges, const int node_number) {
    if((int)current_path.passed_nodes.size() == node_number) {
        return 1;
    }

    int sum_path_number = 0;

    for (int i = 0; i < node_number; i++) {
        if (edges[current_path.end_pos][i] == true && current_path.passed_nodes.count(i) == 0) {
            set<int> next_passed_nodes = current_path.passed_nodes;
            next_passed_nodes.insert(i);
            path next_path{i, next_passed_nodes};

            sum_path_number += dps_path_number(next_path, edges, node_number);
        }

    }
    return sum_path_number;
}

int main() {
    // get values from input
    int N, M;
    cin >> N >> M;

    vector<vector<bool>> edges(N, vector<bool>(N, false));
    for (int i = 0; i < M; ++i) {
        int ai, bi;
        cin >> ai >> bi;
        ai--;
        bi--;

        edges[ai][bi] = true;
        edges[bi][ai] = true;
    }
    // main procedure
    path first_path{0, set<int>{0}};
    int answer = dps_path_number(first_path, edges, N);

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


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	double r,m,e;
	scanf("%lf",&r);
	m = 3.141592653589 * r * r;
	e = 2 * r * 3.141592653589;
	printf("%lf %lf\n",m,e);
	return 0;
}

Measured memory_bytes: 648
// ------------------
// author: MatsuTaku
// date  : 27/02/2020
// ------------------

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

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

  int N; cin>>N;
  vector<int> P(N), Q(N);
  for (auto& p : P) cin>>p;
  for (auto& q : Q) cin>>q;
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    if (P[i] != Q[i]) {
      if (P[i] > Q[i])
        swap(P, Q);
      break;
    }
  }
  do {
    bool same = true;
    for (int i = 0; i < N; i++)
      if (P[i] != Q[i]) {
        same = false;
        break;
      }
    if (same)
      break;
    ++ans;
  } while (next_permutation(P.begin(), P.end()));
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
N = int(input())
A =[0] + list(map(int, input().split())) + [0]
S = 0
for i in range(N+1):
    S += abs(A[i]-A[i+1])

for i in range(1,N+1):
    Si = S + abs(A[i-1]-A[i+1]) - (abs(A[i-1]-A[i]) + abs(A[i]-A[i+1]))
    print(Si)

Measured memory_bytes: 13920
n,m = (int(i) for i in input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]

for i in range(n-m+1):
    for j in range(n-m+1):
        flg = True
        for y in range(m):
            for x in range(m):
                if a[i+y][j+x] != b[y][x]:
                    flg = False
                    break
            if flg == False:
                break

        if flg:
            print("Yes")
            exit()

print("No")

Measured memory_bytes: 3064
N, K = map(int, input().split())
a = [0 for _ in range(K)]
for i in range(1, N + 1):
    a[i % K] += 1
ans = a[0] ** 3
if K % 2 == 0:
    ans += a[int(K // 2)] ** 3
print(ans)


Measured memory_bytes: 4632
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
#include <sstream>
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define mod 1000000007
#define eps 1e-6
#define ll long long
#define INF 0x3f3f3f3f
#define MEM(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define mk make_pair
#define pi pair<int, int>
#define rep(i, a, b) for (int i = (a); i <= (b); ++i)
#define per(i,a,b) for(int i=a;i>=(b);--i)
using namespace std;
int dt[][2]= {{1,0},{-1,0},{0,1},{0,-1},{0,0}};
//typedef pair<int, int> P;
//priority_queue<int, vector<int>, greater<int> > q;



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


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

int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i=0; i < N; ++i) {
    cin >> a[i];
  }
  int ans = 0;
  bool flag = false;
  int now = 1;
  for (int i=0; i < N; ++i) {
    now = a[now -1];
    ++ans;
    if (now == 2) {
      flag = true;
      break;
    }
  }
  if (flag) {
    cout << ans << "\n";
  }
  else {
    cout << "-1\n";
  }
}
    

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

int main(){
    int N;
    cin >> N;
    int X[100];
    for(int i=0; i<N; i++) cin >> X[i];
    int64_t ans = 1e18;
    for(int p=0; p<=100; p++){
        int64_t res = 0;
        for(int i=0; i<N; i++){
            int d = X[i]-p;
            res += d*d;
        }
        ans = min(ans, res);
    }
    cout << ans << endl;
    return 0;
}


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

int main()
{
    int n,T;
    cin>>n>>T;
    int i,t[n+1],l,sum;
    sum=T;
    l=0;
    for(i=1;i<=n;i++)
    {
        cin>>t[i];
    }
    for(i=2;i<=n;i++)
    {
        if(t[i]-t[i-1]<T)
        {
            sum=t[i]-t[i-1]+sum;
        }
        else
        {
            l++;
        }
    }
    cout<<(l*T)+sum;




}


Measured memory_bytes: 1024
import sys

sys.setrecursionlimit(int(1e7))

n, m = map(int, input().split())

edges = {}

for i in range(m):
    s, t = map(int, input().split())
    if s not in edges:
        edges[s] = set()
    edges[s].add(t)

stack = []
visited = set()


def dfs(s: int):
    if s in stack:
        return True
    if s in visited:
        return False
    if s not in edges:
        return False

    stack.append(s)
    visited.add(s)

    for t in edges[s]:
        if dfs(t):
            return True

    stack.pop()
    return False


has_cycle = False

for i in range(n):
    if i in visited:
        continue
    if dfs(i):
        has_cycle = True

print(1 if has_cycle else 0)



Measured memory_bytes: 5636
#include<bits/stdc++.h>
#define ll  long long
using namespace std;
int main() {
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	ll n;
	ll k;
	cin >> n >> k;
	ll a[n];
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
	}
	ll dp[k + 1];
	memset(dp, 0, sizeof(dp));
	for (ll i = 1; i <= k; i++) {
		for (ll j = 0; j < n; j++) {
			if (a[j] > i) {
				continue;
			} else if (dp[i - a[j]] == 0) {
				dp[i] = 1;
			}
		}
	}

	if (dp[k])
		cout << "First";
	else
		cout << "Second";
	return 0;
}

Measured memory_bytes: 1024
d,g=map(int,input().split())
ans=10000
p=[]
c=[]
for i in range(d):
    a,b=map(int,input().split())
    p.append(a)
    c.append(b)
for i in range(2**d):
    x=0
    cou=0
    l=[]
    for j in range(d):
        if ((i>>j)&1):
            x+=c[j]+p[j]*(j+1)*100
            cou+=p[j]
        else:
            l.append(j)
    l.sort(reverse=True)
    k=0
    while x<g:
        for _ in range(p[l[k]]):
            if x>=g:
                break
            cou+=1
            x+=(100*(l[k]+1))
        k+=1
        if k>=len(l):
            break
    ans=min(ans,cou)
print(ans)


Measured memory_bytes: 3064
S = input()
res = S[0]
ans = 1
for i in range(1,len(S)):
  if S[i] == res:
    ans += 1
    res = S[i]
    if ans == 3:
      print('Yes')
      exit()
  else:
    ans = 1
    res = S[i]

print('No')


Measured memory_bytes: 2940
import bisect
N=int(input())
l=list(map(int,input().split()))
l.sort()

cnt=0
for i in range(N-1):
    for j in range(i+1,N):
        ind = bisect.bisect_left(l,l[i]+l[j])
        cnt += ind - j-1

        # k=j+1
        # while k<N:
        #     if l[i]+l[j]>l[k]:
        #         cnt+=1
        #         k+=1
        #     else:
        #         cnt+=0
        #         k+=1
print(cnt)

Measured memory_bytes: 3188
#include<iostream>
using namespace std;
int main(){
	int size;  int count=0,max=0;
	cin>>size;
	char a[size];
	for(int i=0;i<size;i++){
		cin>>a[i];	
	}
	for(int i=0;i<=size;i++){
	   if(a[i]=='I')
	   count+=1;
	   else if (a[i]=='D')
	      count-=1;
	   if(max<count)
	   max=count;
	   
}
cout<<max;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
#define pb push_back
#define mp make_pair
#define pf push_front
#define FOR(i,a,b)           for(int i = a;   i <  (int)(b); ++i)
#define for_rev(i,a,b)       for(int i = b-1; i >= (int)(a); --i)
#define for_it(it, v) for (auto it = v.begin(); it != v.end(); it++)
#define all(v) v.begin(), v.end()
#define sortv sort(all(v))
#define print(v)     \
    for (auto i : v) \
        cout << i << " ";
#define FAST                     \
    ios::sync_with_stdio(false); \
    cin.tie(NULL);               \
    cout.tie(NULL);
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef unordered_set<int> ust;
typedef set<int> st;
typedef unordered_map<int, int> ump;
typedef map<int, int> mi;
#define F first
#define S second
/*****************************************************************************/
int arr[100005][3] = {0};
int dp[100005][3] = {0};

int main()
{
	FAST
	int n ; cin >> n ;
	for (int i = 0 ; i < n ; i++)
	{
		for (int j = 0 ; j < 3 ; j++) cin >> arr[i][j];
	}
	for (int i = 0 ; i < 3 ; i++)
	{
		dp[0][i] = arr[0][i];
        // cout << dp[0][i] << endl;
	}
	for (int i = 1 ; i < n ; i++)
	{
		for (int j = 0 ; j < 3 ; j++)
		{
			for (int k = 0 ; k < 3 ; k++)
			{
				if (k != j)
					dp[i][j] = max(dp[i][j],dp[i-1][k]+arr[i][j]);
                // else continue ;     
			}
		}
	}
	int ans = 0 ; 
	for(int i = 0 ; i < n ; i++)
	{
		ans = max(ans,dp[n-1][i]);
	}
	cout << ans << endl;
}

Measured memory_bytes: 5884
import java.io.DataInputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws Exception {
		int a = in.i();
		int b = in.i();

		int cost = b;
		if (6 <= a && a <= 12)
			cost /= 2;
		else if (a < 6)
			cost = 0;

		out.println(cost);
	}

	static PrintStream out = System.out;
	static FastReader in = new FastReader();
}

class FastReader {
	final private int BUF_SIZE = 1 << 16;
	private DataInputStream din = new DataInputStream(System.in);
	private byte[] buffer = new byte[BUF_SIZE];
	private int bufferPointer, bytesRead;

	String s() throws IOException {
		return s(64);
	}

	String s(int capacity) throws IOException {
		byte[] buf = new byte[capacity];
		int cnt = 0, c;
		while ((c = c()) != -1) {
			if (c == '\n') break;
			buf[cnt++] = (byte) c;
		}
		return new String(buf, 0, cnt);
	}

	int i() throws IOException {
		int ret = 0;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	long l() throws IOException {
		long ret = 0;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		return neg ? -ret : ret;
	}

	double d() throws IOException {
		double ret = 0, div = 1;
		byte c = c();
		while (c <= ' ') c = c();
		boolean neg = (c == '-');
		if (neg) c = c();
		do {
			ret = ret * 10 + c - '0';
		} while ((c = c()) >= '0' && c <= '9');
		if (c == '.')
			while ((c = c()) >= '0' && c <= '9')
				ret += (c - '0') / (div *= 10);
		return neg ? -ret : ret;
	}

	private void fillBuffer() throws IOException {
		bytesRead = din.read(buffer, bufferPointer = 0, BUF_SIZE);
		if (bytesRead == -1) buffer[0] = -1;
	}

	byte c() throws IOException {
		if (bufferPointer == bytesRead) fillBuffer();
		return buffer[bufferPointer++];
	}
}



Measured memory_bytes: 21076
s=input()
n = len(s)

def palindrome(string): return False if string==string[::-1] else True

A = int((n-1)/2)
B = int((n+3)/2)
# print(s[0 : A])
# print(s[B-1 : n])
# print(s[0 : A] == str(''.join(list(reversed(s[0 : A])))) )
# print(s[B-1 : n] == str(''.join(list(reversed(s[B-1 : n])))) )
# print(s == s[::-1])

if s[0 : A] == str(''.join(list(reversed(s[0 : A])))) and s[B-1 : n] == str(''.join(list(reversed(s[B-1 : n])))) and s == s[::-1]:
	print("Yes")
else:
	print("No")

Measured memory_bytes: 3064
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<cmath>
#include<complex>
#include<iomanip>

using namespace std;

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

int main(void){

	int n;
	for(;;){
	cin >> n;
	if(n==0) break;

	int s=0;
	for(int i=1;i*i<=n;i++){
	if(n%i==0){
	if(n==i*i) s+=i;
	else s+=i+n/i;
	}
	}

	s-=n;
	if(s<n) cout << "deficient number" << endl;
	if(s==n) cout << "perfect number" << endl;
	if(s>n) cout << "abundant number" << endl;

	}

	return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main()
{
    int n;scanf("%d",&n);
    for(int i=1;i<10;i++)
    {
        for(int j=1;j<10;j++)
        {
            if(i*j==n)
            {
                printf("Yes\n");
                return 0;
            }
        }
    }
    printf("No\n");
    return 0;
}

Measured memory_bytes: 256
import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

readInt :: IO Int
readInt = fst . fromJust . C.readInt <$> C.getLine

main :: IO ()
main = do
  n <- readInt
  a <- readInt
  putStrLn $ canPay n a

canPay :: Int -> Int -> String
canPay n a = let r = n `rem` 500 in
  if r > a 
    then "No"
    else "Yes"

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

public class Main {
  private static int solve(int n) {
    int count = 0;
    while (n > 1) {
      n /= 2;
      count++;
    }
    return 1 << count;
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    out.println(solve(n));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


Measured memory_bytes: 21076
#include<iostream>
#include<cstdio>
using namespace std;
int main(void)
{while(1)
{
	int  n=0;
	scanf("%d",&n);
	if(n==0){break;}
	int c=0,m[11]={0};
	for(int i=0;i<n;i++)
	{
		scanf("%d",&c);
		for(int j=0;j<11;j++)
		{
			if(c==j){m[j]++;break;}
		}
	}
	for(int i=0;i<10;i++)
	{
		if(m[i]==0){printf("-");}
		else
		{
		for(m[i]=m[i];m[i]>0;m[i]--)
		{
			printf("*");
		}
}
		printf("\n");
	}
}
	return 0;
}


Measured memory_bytes: 3120
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	int X, T;
	cin >> T >> X;
	printf("%.5lf\n", (double)T / X);
}


Measured memory_bytes: 256
s=str(input())
s=list(s)
n=len(s)
temp=0
for i in range(n//2):
  if s[i]!=s[n-1-i]:
    temp=1
    break
for i in range(n//4):
  if s[i]!=s[(n-1)//2-1-i]:
    temp=1
    break
  if s[(n+3)//2-1+i]!=s[n-1-i]:
    temp=1
    break
if temp==0:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	int n;
	scanf("%d",&n);
	if(n%1000==0){
		printf("0\n");
	}else{
		printf("%d\n",1000-n%1000);
	}
	return 0;
}


Measured memory_bytes: 3720
#include<bits/stdc++.h>
#define N 2005
using namespace std;
inline int read(){
	int x=0; bool f=1; char c=getchar();
	for(;!isdigit(c); c=getchar()) if(c=='-') f=0;
	for(; isdigit(c); c=getchar()) x=(x<<3)+(x<<1)+(c^'0');
	if(f) return x; return 0-x;
}
int n,sum;
bitset<N*N> b; 
int main(){
	n=read();
	int a; b[0]=1;
	for(int i=1; i<=n; ++i){
		a=read();
		b|=b<<a;
		sum+=a;
	}
	for(int i=(sum+1)/2; i<=sum; ++i) if(b[i]){printf("%d\n",i); return 0;}
	return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree < pairs ,  null_type , greater<pairs>,  rb_tree_tag ,  tree_order_statistics_node_update > 
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD=(1e9 +7);
typedef pair<ll,ll>pairs;
ll power(ll a, ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD;b--;}a=(a*a)%MOD;b>>=1;}
    return res;}

int main() {
	// your code goes here
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	ll t,n,i,j,k,l,c,f;
	cin>>n;
	l=n%10;
	if(l==1||l==7||l==3||l==9)
	{
	   
	    ll cnt=0,num=0;
	    for(;;)
	    {
	        cnt++;
	        num=(num*10+7)%n;
	        if(num==0)break;
	    }
	    cout<<cnt;
	}
	else
	    cout<<-1;
	return 0;
}


Measured memory_bytes: 3676
#include "iostream"
#include "iomanip"
using namespace std;

double a, b,ans;

int main() {
	cin >> a >> b;
	ans = 1.0 / a + 1.0 / b;
	ans = 1.0 / ans;
	cout <<setprecision(20)<< ans<<"\n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int x, y ,z;
bool check(int a, int b, int c) {
    if (max(a,b)!=x)return false;
    if (max(a,c)!=y)return false;
    if (max(b,c)!=z)return false;
    return true;
}
long long int h[200010];
int main() {
    int t,n,a,b,c;

    while (scanf("%d",&n)!=EOF) {
        long long int num = 0;
        for (int i=0;i<n;i++) {
            scanf("%d",&a);
            if (i)
            {
                if (b>a) {
                    num+=b-a;
                    a=b;
                }
            }
            b = a;
        }
        cout <<num <<endl;
    }
    return 0;
}


Measured memory_bytes: 3252
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;

int n;
string str[501];
vector<int> G[27];
bool used[27];
int edge[27][27];
int num[27];
vector<int> vs;
void dfs(int v){
	used[v]=true;
	for(int i=0;i<G[v].size();i++){
		if(!used[G[v][i]])dfs(G[v][i]);
	}
	vs.push_back(v);
}

bool check(){
	for(int i=0;i<27;i++){
		G[i].clear();
	}
	memset(edge,0,sizeof(edge));
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			int k;
			for(k=0;k<min(str[i].size(),str[j].size());k++){
				if(str[i][k]!=str[j][k]){
					if(edge[str[i][k]-'a'][str[j][k]-'a']==0){
						G[str[i][k]-'a'].push_back(str[j][k]-'a');
						edge[str[i][k]-'a'][str[j][k]-'a']=1;
					}
					break;
				}
			}
			if(k==min(str[i].size(),str[j].size()) && str[i].size()>str[j].size())return false;
		}
	}
	memset(used,0,sizeof(used));
	for(int i=0;i<=26;i++){
		if(!used[i])dfs(i);
	}
	for(int i=0;i<vs.size();i++){
		num[vs[i]]=i;
	}
	for(int i=0;i<26;i++){
		for(int j=0;j<G[i].size();j++){
			if(num[i]<num[G[i][j]])return false;
		}
	}
	return true;
}

int main(void){
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			cin >> str[i];
		}
		printf("%s\n",check()?"yes":"no");
	}
	return 0;
}

Measured memory_bytes: 1292
A, B, C = map(int, input().split())
# C>B>A
K = int(input())

for i in range(K):
    if A >= B:
        B = B * 2
    elif B >= C:
        C = C * 2
    else:
        break
if A < B and B < C:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 61648
#include <stdio.h>
int main (void){
int a[3000],b[3000],i=0,j=0,n=0;
a[0]=1;
b[0]=1;
while(a[i]!=0 || b[i]!=0){
    i++;
    n++;
	scanf("%d %d",&a[i],&b[i]);
	}
for(j=1;j<n;j++){
	if(a[j]<=b[j]){
		printf("%d %d\n", a[j],b[j]);
	}
	else{printf("%d %d\n", b[j],a[j]);
	}
}

return 0;

}

Measured memory_bytes: 1716
inf = float('inf')

#計算量O(V^3) V:頂点数
# dist[i][j]: iからjへのコスト,  n:頂点数
def warshall_floyd(ad):
    n = len(ad)
    dist = [line[:] for line in ad]
    for k in range(n):
        for i in range(n):
            for j in range(n):
                if i == j:
                    dist[i][j] = 0
                elif dist[i][j] > dist[i][k] + dist[k][j]:
                    dist[i][j] = dist[i][k] + dist[k][j]
    return dist

N, M, L = map(int,input().split())
ad = [[inf] * N for _ in range(N)]
for _ in range(M):
    A, B, C = map(int,input().split())
    if C > L:
        continue
    A -= 1
    B -= 1
    ad[A][B] = C
    ad[B][A] = C
Q = int(input())
query = [[int(e)-1 for e in input().split()] for _ in range(Q)]

ad = warshall_floyd(ad)
for s in range(N):
    for t in range(N):
        if ad[s][t] <= L:
            ad[s][t] = 1
        else:
            ad[s][t] = inf

ad = warshall_floyd(ad)
for s, t in query:
    ans = ad[s][t] - 1
    if ans == inf:
        ans = -1
    print(ans)

Measured memory_bytes: 86104
#include <iostream>
#include <set>
using namespace std;
struct node{
    int val;
    node *lch, *rch;
};

int main(int argc, const char * argv[]) {
    int N;
    cin>>N;
    set<int> s;
    int ans=0;
    for(int i=0;i<N;i++){
        int d;
        cin>>d;
        if(s.count(d)!=0){
            
        }else{
            s.insert(d);
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pll, pii> P;
const ll INF = 1ll<<30;
const ll longINF = 1ll<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;
const bool debug = 0;
//---------------------------------//

int N, K;
string S;

int main() {
	cin >> N >> K;
	cin >> S;
	int ans = 0, cnt = 0;
	REP(i, N) {
		int r = i;
		while (r < N && S[i] == S[r]) r++;
		cnt++;
		ans += r - i - 1;
		if (r == N) break;
		i = r - 1;
	}
	if (cnt >= 3) {
		int dif = min(K, 1 + (cnt - 3) / 2);
		ans += dif * 2;
		K -= dif;
		cnt -= dif * 2;
	}
	
	if (cnt >= 2 && K > 0) ans++;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ull  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
double dist(double x, double y, double X, double Y){
    return X * x + Y * y;
}
const int N = 500;
double x[N], y[N], ans[N], c;
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
    double pi = 2 * acos(-1);
    double a = 0;
    double eps = 5e-5;
    while(a < pi){
        a += eps;
        int p = 0;
        c++;
        double q = -1e18;
        double X = cos(a);
        double Y = sin(a);
        for (int i = 1; i <= n; i++){
            if (dist(X, Y, x[i], y[i]) > q){
                q = dist(X, Y, x[i], y[i]);
                p = i;
            }
        }
       //cout << q << endl;
        ans[p]++;
    }
    for (int i = 1; i <= n; i++){
        cout << fixed << setprecision(15) << (double)ans[i] / c << " ";
    }
}


Measured memory_bytes: 512
#include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;

#define N 3
#define N2 9

struct Puzzle
{
  int f[N2];
  int space;
  string path;
  bool operator<(const Puzzle &p) const
  {
    for (int i = 0; i < N2; i++)
    {
      if (f[i] == p.f[i])
      {
        continue;
      }
      return f[i] > p.f[i];
    }
    return false;
  }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(Puzzle p)
{
  for (int i = 0; i < N2; i++)
  {
    if (p.f[i] != (i + 1))
    {

      return false;
    }
  }
  return true;
}

string bfs(Puzzle s)
{
  queue<Puzzle> Q;
  map<Puzzle, bool> V;
  Puzzle u, v;
  s.path = "";
  Q.push(s);
  V[s] = true;

  while (!Q.empty())
  {
    u = Q.front();
    Q.pop();
    if (isTarget(u))
    {
      return u.path;
    }
    int sx = u.space / N;
    int sy = u.space % N;
    for (int r = 0; r < 4; r++)
    {
      int tx = sx + dx[r];
      int ty = sy + dy[r];
      if (tx < 0 || ty < 0 || tx >= N || ty >= N)
      {
        continue;
      }
      v = u;
      swap(v.f[u.space], v.f[tx * N + ty]);
      v.space = tx * N + ty;
      if (!V[v])
      {
        V[v] = true;
        v.path += dir[r];
        Q.push(v);
      }
    }
  }

  return "unsolvable";
}

int main()
{
  Puzzle in;

  for (int i = 0; i < N2; i++)
  {
    cin >> in.f[i];
    if (in.f[i] == 0)
    {
      in.f[i] = N2;
      in.space = i;
    }
  }

  string ans = bfs(in);
  cout << ans.size() << endl;

  return 0;
}


Measured memory_bytes: 30560
import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val Array(n, m) = in.readLine().split("\\s").map(_.toInt)
    val result = Array.fill[Int](n)(-1)

    val scs = (for {
      _ <- 0 until m
    } yield {
      in.readLine().split("\\s").map(_.toInt)
    }).sortWith {
      case (sc1, sc2) => sc1(0) < sc2(0)
    }

    if (scs.groupBy(_ (0)).exists {
      case (_, scs) => scs.map(_ (1)).distinct.size != 1
    }) {
      out.println(-1)
    } else {
      for {
        i <- 0 until m
      } {
        result(scs(i)(0) - 1) = scs(i)(1)
      }

      for {
        i <- 0 until n
        if result(i) == -1
      } {
        if (i == 0 && n != 1) {
          result(i) = 1
        } else {
          result(i) = 0
        }
      }
      
      if (result(0) == 0) {
        if (n == 1) {
          out.println(0)
        } else {
          out.println(-1)
        }
      } else {
        out.println(result.mkString(""))
      }
    }

    out.flush()
  }
}


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

namespace AtCorder
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] N = new int[2];
            N = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int H = N[0]; int W = N[1];
            string[] gyazo = new string[H];
            for (int i = 0; i < H; i++)
            {
                gyazo[i] = Console.ReadLine();
            }
            for (int i = 0; i < W + 2; i++)
                Console.Write("#");
            Console.WriteLine();
            for (int i = 0; i < H; i++) {
                Console.Write("#" + gyazo[i] + "#");
                Console.WriteLine();
            }
            for (int i = 0; i < W + 2; i++)
                Console.Write("#");
            Console.WriteLine();
        }
    }
}


Measured memory_bytes: 28296
#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
typedef long long int lint;
using namespace std;

//ただの辺
struct edge {
    using lint = long long int;
    int from;
    int to;
    lint cost;
    //引数一つの時は距離1
    edge(int f, int t, lint c = 1) : from(f), to(t), cost(c) {
    }
};

// warshall_floyd
// dは隣接行列(long long intを使うこと)
void warshall_floyd(vector<vector<long long int>>& d) {
    long long int n = d.size();
    for (int k = 0; k < n; k++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (d[i][k] == LLONG_MAX || d[k][j] == LLONG_MAX) continue;
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}

int main() {
    lint M = LLONG_MAX;
    int n;
    cin >> n;
    vector<vector<lint>> a(n, vector<lint>(n));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    vector<vector<lint>> b(n, vector<lint>(n, M));
    for (int i = 0; i < n; i++) {
        b[i][i] = 0;
    }
    lint ans = 0;
    // i~jに辺を張る必要があるか判定
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            bool flag = true;
            for (int k = 0; k < n; k++) {
                if (k == i || k == j) continue;
                // cout << a[i][j] << " " << a[i][k] << " " << a[k][j] << endl;
                if (a[i][j] == a[i][k] + a[k][j]) {
                    flag = false;
                    break;
                }
            }
            if (flag) {
                b[i][j] = a[i][j];
                ans += a[i][j];
            }
        }
    }
    // for (int i = 0; i < n; i++) {
    //     for (int j = 0; j < n; j++) {
    //         cout << b[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    // cout << endl;
    warshall_floyd(b);
    // for (int i = 0; i < n; i++) {
    //     for (int j = 0; j < n; j++) {
    //         cout << b[i][j] << " ";
    //     }
    //     cout << endl;
    // }
    // cout << endl;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (b[i][j] != a[i][j]) {
                cout << -1 << endl;
                return 0;
            }
        }
    }
    cout << ans / 2 << endl;
}

Measured memory_bytes: 1664
S = set()
L = [True]*(10**5+1)
L[0] = False
L[1] = False
for i in range(2, 10**5+1):
    if L[i]:
        S.add(i)
        for j in range(i*2, 10**5+1, i):
            L[j] = False


def prime(n):
    return n in S


M = [0]*(5*10**4+1)
for i in range(1, 5*10**4+1):
    m = 2*i-1
    n = i
    M[i] = M[i-1]+(prime(m) & prime(n))

Q = int(input())
ans = [0]*Q
for _ in range(Q):
    l, r = list(map(int, input().split()))
    i = (l+1)//2
    j = (r+1)//2
    ans[_] = M[j]-M[i-1]
for _ in range(Q):
    print(ans[_])

Measured memory_bytes: 97244
#include <iostream>
#include <sstream>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <numeric>
#include <algorithm>
#include <string>
#include <complex>
 
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <cstring>
 
#define REP(i,e) for(int i=0;i<(int)(e);i++)
#define FOR(i,b,e) for(int i=(int)(b);i<(int)(e);i++)
#define ALL(c) (c).begin(), (c).end()
#define EACH(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define RALL(c) (c).rbegin(), (c).rend()
#define ALLA(a,n) ((a)+0), ((a)+n)
 
using namespace std;
 
typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef vector<string> vstring;
typedef vector<double> vdouble;
 
template<class T>void pp(T v,int n){ REP(i,n)cout<<v[i]<< ' ' ; cout << endl; }
template<class T>void pp(T v){ EACH(it,v) cout << *it << ' ' ; cout << endl;  }
template<class T>T& ls(T& a,T b){ if(b<a) a=b; return a; }
template<class T>T& gs(T& a,T b){ if(b>a) a=b; return a; }
inline ll to_i(const string& s){ll n;sscanf(s.c_str(),"%lld",&n);return n;}
inline string to_s(ll n){char buf[32];sprintf(buf,"%lld",n);return string(buf);}

template<ll MOD> class MInt {
  ll value;
public:
  MInt() : value(0) {}
  MInt(int v) : value(v) {}
  MInt(ll v) : value(v) {}
  MInt& operator+=(const MInt<MOD> &r) {
    value += r.value; if (value > MOD) value -= MOD; return *this;
  }
  MInt& operator-=(const MInt<MOD> &r) {
    value -= r.value; if (value < 0) value += MOD; return *this;
  }
  MInt& operator*=(const MInt<MOD> &r) {
    value *= r.value; value %= MOD; return *this;
  }
  MInt& operator/=(const MInt<MOD> &r) {
    (*this) *= r.inv(); return *this;
  }
  MInt operator+(const MInt<MOD> &r) const { MInt result = *this; result += r; return result; }
  MInt operator-(const MInt<MOD> &r) const { MInt result = *this; result -= r; return result; }
  MInt operator*(const MInt<MOD> &r) const { MInt result = *this; result *= r; return result; }
  MInt operator/(const MInt<MOD> &r) const { MInt result = *this; result /= r; return result; }
  MInt pow(ll p) const {
    MInt result = 1, x = *this;
    for (;p;p >>= 1) {
      if (p & 1) result *= x;
      x *= x;
    }
    return result;
  }
  MInt inv() const { return this->pow(MOD - 2); }
  operator ll() const { return value; }
  
};

typedef MInt<1000000007> Int;


int main() {
  int n, m;
  while (cin >> n >> m) {
    set<int> s;
    REP(i,m) {
      int t; cin >> t; s.insert(t);
    }

    vector<Int> dp(n+1, 0);
    dp[0] = Int(1);
    FOR(i,1,dp.size()) if (!s.count(i)) {
      dp[i] += dp[i-1];
      if (i - 2 >= 0) dp[i] += dp[i-2];
    }

    cout << dp.back() << endl;
  }
}


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

using namespace std;

#define pb push_back
#define mp make_pair

typedef long long int ll;
typedef vector< pair<int,int> > vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef pair<int,int> pii;

const ll INF= ll (1e18);
const int MOD= 1e9+7;
const int N=100000+10;

int main()
{
    std::ios::sync_with_stdio(0);

    ll n,m;
    cin>>n>>m;

    if(m-2*n>0)
    {ll x= floor((m-2*n)/2);

    cout<<n+ (x/2)<<endl;
    }
    else
    {
        m/=2;
        cout<<min(n,m)<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
//Heaplax
//别让自己后悔
#include<bits/stdc++.h>
#define N 100001
#define LL long long
#define LOG(x) cerr<<#x<<" = "<<x<<endl
#define add_edge(u,v) nxt[++cnt]=head[u],head[u]=cnt,to[cnt]=v
#define open(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout)
char ch;bool fs;void re(int& x)
{
	while(ch=getchar(),ch<33);
	if(ch=='-')fs=1,x=0;else fs=0,x=ch-48;
	while(ch=getchar(),ch>33)x=x*10+ch-48;
	if(fs)x=-x;
}
using namespace std;
int n,ans,a[N];
int main()
{
	re(n);
	for(int i=1;i<=n;++i)re(a[i]);
	int now=1;
	while(now<=n)
	{
		++ans;
		int x=now,y=now;
		while(x<=n && a[x+1]>=a[x])++x;
		while(y<=n && a[y+1]<=a[y])++y;
		now=max(x,y)+1;
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 640
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ENDL '\n'
#define print(i) std::cout << (i) << '\n'

#define int long long // at least int64 > 9*10^18
#define all(v) (v).begin(), (v).end()
/* libraries */

// ceil of a/b
inline int ceil(int a, int b) { return (a%b?a/b+1:a/b); }


signed main() {
	int a,b;
	std::cin >> a >> b;
	print(ceil(b-1,a-1));

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,l[1005];
int main() {
    cin>>a>>b;
    for(int i=1;i<=999;i++) l[i]=l[i-1]+i;
    int k=b-a;
    for(int i=1;i<=999;i++) {
    	if(l[i]-l[i-1]==k) {cout<<l[i-1]-a;return 0;}
    }
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int h, w, a, b; cin >> h >> w >> a >> b;
  vector<vector<int> > ans(h, vector<int>(w, -1));
  REP(i, b) {
    REP(j, a) ans[i][j] = 0;
    FOR(j, a, w) ans[i][j] = 1;
  }
  FOR(i, b, h) {
    REP(j, a) ans[i][j] = 1;
    FOR(j, a, w) ans[i][j] = 0;
  }
  REP(i, h) {
    REP(j, w) cout << ans[i][j];
    cout << '\n';
  }
  return 0;
}


Measured memory_bytes: 5248