akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>
#include <cassert>


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 RREP(i, n) for(int i=n-1;i>=0;--i)
#define RFOR(i, a, b) for(int i=b-1;i>=a;--i)

#define all(x) begin(x),end(x)
#define dump(x) cerr<<#x<<" = "<<(x)<<endl
#define debug(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}


template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> p) {
    os << p.first << ":" << p.second;
    return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "[";
    REP(i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<class T1, class T2>
ostream &operator<<(ostream &os, const map<T1, T2> &mp) {
    os << "[";
    for (auto it = mp.begin(); it != mp.end(); ++it) {
        if (it != mp.begin()) {
            os << ", ";
        }
        os << *it;
    }
    return os << "]";
}

// edit

void solve() {
    int x;
    cin >> x;

    int tapu = (x - 400) / 200;
    int ans = 8 - tapu;
    cout << ans << endl;

}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());

    solve();


    return 0;
}


Measured memory_bytes: 3180
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next

  def TapDance(s: String): String = {
    val ll = s.zipWithIndex

    val r = ll.forall {
      case (c, i) =>
        c match {
          case 'R' | 'U' | 'D' if i % 2 == 0 => true
          case 'L' | 'U' | 'D' if i % 2 == 1 => true
          case _ => false
        }
    }
    if (r) "Yes"
    else "No"
  }

  println(TapDance(s))
}

Measured memory_bytes: 27348
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;
	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
		System.exit(0);
	}

	void solve() {
		long N = nextLong();
		long cnt = 0;
		//out.println(Math.sqrt(N));
		long x = (long) Math.sqrt(N);
		while(N % x != 0) {
			x--;
		}
		long y = N/x;
		cnt += (x - 1)+(y - 1);

		out.println(cnt);
	}


	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)a[i] = nextLong();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

	long gcd(long m,long n) {
		if (m<n) return gcd(n,m);
		if (n==0)return m;
		return gcd(n,m%n);
	}
}

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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 30)
#define MOD 1000000007
//int dy[4] = {-1,0,0,1};
//int dx[4] = {0,1,-1,0};


int main(){
  
  int n,k;
  cin >> n >> k;
  ll res = 0;


  for(int i = k+1;i <= n;i++){
    int r = i-k,rr = n%i;
    res += 1ll*(n/i)*r;
    res += max(0,rr-k+1);

  }
  if(k)cout << res << endl;
  else cout << res-n << endl;



  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int x,y,i;
    
    for(i = 1; i <= 3000; i++){
        
        cin >> x >> y;
        
        if((x == 0) && (y == 0)) break;
        
        if(x <= y){
            
            cout << x << " " << y << endl;
            
        } else {
            
            cout << y << " " << x << endl;
            
        }
    }
    
    return 0;
    
}


Measured memory_bytes: 3096
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define hell1 1e9+7
#define hell2 1e9+9
#define pi 3.1415926535
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define eps 0.000001
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define ll long long
#define ld long double 
#define no_of_digits(n) floor(log10(n)) + 1
#define see(x) cout << (#x) << " is " << (x) << endl
#define INF 1e9

using namespace std;

ll mult(ll a,ll b, ll p=hell1){   return ((a%p)*(b%p))%p; }
ll multbig(ll a,ll b,ll mod=hell1){   if(a==0 or b==0) return 0;if(a==1 or b==1) return (a*b)%mod;ll cur=multbig(a,b/2,mod);cur=(2*cur)%mod;if(b%2) cur=(cur+a)%mod;return cur;
}
ll add(ll a, ll b, ll p=hell1){ if(a>=p) a%=p; if(b>=p) b%=p; if(a+b>p) return (a + b)%p; else return a+b;}
ll sub(ll a, ll b, ll p=hell1){return (a%p - b%p + p)%p;}
ll fpow(ll n, ll k, ll p = hell1) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = mult(r,n,p); n = mult(n,n,p);} return r;}
ll inv(ll a, ll p = hell1) {return fpow(a, p - 2, p);}
ll inv_euclid(ll a, ll m = hell1){ll m0 = m;ll y = 0, x = 1;if (m == 1)return 0;while (a > 1){ll q = a / m;ll t = m;m = a % m, a = t;t = y;y = x - q * y;x = t;}if (x < 0)x += m0;return x;}
int isPowerof2(ll x) { return (x && !(x & x-1)); } 
ll log2(ll x) { ll res = 0; while (x >>= 1) res++; return res; } 

// max({a, b, c, d})

vector<ll>adj[200005];
ll update[200005];
ll ans[200005];

int binaryToDecimal(string n) 
{ 
    string num = n; 
    int dec_value = 0; 
  
    // Initializing base value to 1, i.e 2^0 
    int base = 1; 
  
    int len = num.length(); 
    for (int i = len - 1; i >= 0; i--) { 
        if (num[i] == '1') 
            dec_value += base; 
        base = base * 2; 
    } 
  
    return dec_value; 
} 

int main()
{
    int ans[100010]={0};

    ans[1] = 1;

    for(int i=2;i<100010;i++)
    {
        // cout << no_of_digits(i) << "\n";
        ll x = no_of_digits(i);
        if(x%2) ans[i] = ans[i-1]+1;
        else
        {
            ans[i] = ans[i-1];
            // cout << "here";  
        } 
    }
    // cout << ans[13];
    int n;
    cin >> n;

    cout << ans[n] << "\n";
}




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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)

class UnionFind{
    public:
        vector<int> par;
        vector<int> rank;

        UnionFind(int n){
            for(int i = 0; i < n; i++){
                par.push_back(i);
                rank.push_back(0);
            }
        }

        int find(int x){
            if(x == par[x])
                return x;
            else
                return par[x] = find(par[x]);
        }

        void unite(int x, int y){
            x = find(x);
            y = find(y);
            if(x == y) return;

            if(rank[x] < rank[y])
                par[x] = y;
            else{
                par[y] = x;
                if(rank[x] == rank[y]) rank[x]++;
            }
        }

        bool same(int x, int y){
            return find(x) == find(y);
        }
};

int P[100100];
int main(){
    int N, M;
    cin >> N >> M;
    REP(i,N){
        int p;
        cin >> p;
        P[i] = p;
    }

    UnionFind uni(N);
    REP(i,M){
        int x,y;
        cin >> x >> y;
        uni.unite(x, y);
    }

    ll ans = 0;
    REP(i,N){
        int p = P[i];
        if(uni.same(p, i+1)) ans++;
    }

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


Measured memory_bytes: 1660
#include <iostream>
#include <vector>

using namespace std;

int main(int argc, char** argv){
	int N,temp;
	cin >> N;
	vector<int> A(N,0);
	vector<int>::iterator ite;

	for(int i=0; i<N-1;i++){
		cin >> temp;
		A[temp-1]++;
	}
	for(ite=A.begin(); ite!=A.end(); ite++)
		cout << *ite << endl;
	return 0;
}

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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int a, b, c, k;
    cin >> a >> b >> c >> k;

    int cnt = 0;
    while (b <= a) {
        cnt++;
        b *= 2;
    }
    while (c <= b) {
        cnt++;
        c *= 2;
    }

    cout << (cnt <= k ? "Yes" : "No") << "\n";

    return 0;
}


Measured memory_bytes: 3608
import collections

N = int(input())
S = []
for i in range(N):
    S.append(input(""))

c = collections.Counter(S)
a = c.most_common()
m = a[0][1]
ans = list()
ans.append(a[0][0])

for i in range(1,len(a)):
    if a[i][1] == m:
        ans.append(a[i][0])
    else:
        break

ans.sort()
for i in ans:
    print(i)

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

using namespace std;

string s;
int a[555];
int n;
int K;
int at;

map<pair<int, int>, int> dp[555];
 
int poss(int pos, int neg, int i) {
    if(pos > K || neg > K ) return false;
    if((i >= n) && (pos == neg)) return true;
    if(i >= n) return false;
    if(dp[i].find(make_pair(pos, neg)) != dp[i].end()) return dp[i][make_pair(pos, neg)];
    int rem = a[i] % at;
    int x = poss(pos, neg+rem, i+1);
    int y = poss(pos+at-rem, neg, i+1);
    if(x+y > 0) return dp[i][make_pair(pos, neg)]= 1;
    else return  dp[i][make_pair(pos, neg)] = 0;
 
}


int main() {
    cin >> n >> K;
    int tot = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        tot+=a[i];
    }

    vector<int> divs;
    for(int i = 1; i*i <= tot; i++) {
        if(tot % i == 0) {
            divs.push_back(i);
            divs.push_back(tot/i);
        }
    }
    sort(divs.begin(), divs.end());
    int sz = divs.size();
    sort(a, a+n);
    int last_ans;
    for(int p = 0; p < divs.size(); p++) {

        int j = divs[sz-1-p];
        
        if(tot % j != 0) continue;

        at = j;

        long long tot_extra = 0;
        vector<int> extras;
        for(int i = 0; i < n; i++) {
            tot_extra += (at - (a[i] % at));
            extras.push_back((at - (a[i] % at)));
        }   
        sort(extras.begin(), extras.end());
        if((tot_extra) % at != 0) continue;
        int x = tot_extra/at;
        long long neg = 0;
        for(int i = 0; i < x ; i++) {
            neg += (at - extras[n-1-i]);
            tot_extra -= extras[n-1-i];
        }
        if(neg == tot_extra && (neg <= K)) {cout << at; return 0;}
        
        // cout << " At " << at << endl;
        // for(int i = 0; i < 555; i++) dp[i].clear();
        // // if(at == 7) cout << poss(0,0,0); 
        // if (poss(0,0,0)) {
        //     cout << at;
        //     return 0;
        // }

        
    }


}



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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcountll

#define INF 1e16
#define mod 1000000007

ll N,M;
ll dp[301][301][301];

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

  cin>>N>>M;

  dp[0][1][1]=1;
  rep(i,M)rep(j,N+1)rep(k,j+1){
    if(dp[i][j][k]==0)continue;
    { // not visited
      if(j+1<=N)(dp[i+1][j+1][k]+=dp[i][j][k]*(N-j)%mod)%=mod;
    }
    { // sc
      if(k>0)(dp[i+1][j][j]+=dp[i][j][k]*k%mod)%=mod;
    }
    { // back
      (dp[i+1][j][k]+=dp[i][j][k]*(j-k)%mod)%=mod;
    }
  }

  cout<<dp[M][N][N]<<endl;

  return 0;
}


Measured memory_bytes: 211328
N = int(input())
ListV = list(map(int, input().split()))
ListC = list(map(int, input().split()))
Sum = []
for i in range(N):
  Sum.append(ListV[i]-ListC[i])
res = 0
for i in range(N):
  if Sum[i] > 0:
    res += Sum[i]
print(res)

Measured memory_bytes: 9056
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define mp make_pair
#define pb push_back
#define FF first
#define SS second

typedef long long int LL;
typedef pair<int, int > pii;
typedef vector<int > vi;

int main() {
  int n,t;
  S2(n,t);
  LL ans = t;
  int prev;
  rep(i,0,n) {
    int x;
    S(x);
    if(i) {
      ans += min(x - prev, t);
    }
    prev = x;
  }
  cout << ans << "\n";
  return 0;
}


Measured memory_bytes: 764
N = int(input())
e = [0] * (N + 1)

for i in range(2, N + 1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j


def num(m):  # e の要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m - 1, e)))


print(
    num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) *
    (num(5) - 1) * (num(3) - 2) // 2)


Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
  int a,b,c;
int t=0;
  scanf("%d %d %d",&a,&b,&c);
  if (a==b){
t++;
  }
  if(b==c){
t++;
  }
  if(a==c){t++;}
  
  if(t==1){
printf("Yes\n");
  }else{
printf("No\n");
  }
  
  return 0;
}


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

int64_t modpow(int64_t x, int64_t n) {
  const int MOD = 1000000007;
  x = x%MOD;
  if(n==0) return 1;  //再帰の終了条件

  else if(n%2==1) {
    return (x*modpow(x, n-1))%MOD;  //nが奇数ならnを1ずらす
  }
  else return modpow((x*x)%MOD, n/2)%MOD;  //nが偶数ならnが半分になる
}

int main() {
  int n;
  cin>>n;

  const int MOD = 1000000007;

  int64_t ans = modpow(10,n);
  ans = (ans-modpow(9,n))%MOD;
  ans = (ans-modpow(9,n))%MOD;
  ans = (ans+modpow(8,n))%MOD;

  if(ans<0) ans += MOD;

  cout<<ans<<endl;


  return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int n,k;    cin >> n >> k;
    const ll mod = 1000000000+7;
    ll ans = 0;
    ll min = 0, max = n;
    ll l = 0, r = n;
    for(int i = 1; i <= n+1; i++){
        if(i >= k)  ans += max-min+1;
        ans %= mod;
        l++;    r--;
        min += l;   max += r;
    }
    cout << ans << endl;
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define MOD 1000000007
typedef long long ll;

int main(){
	ll n, ans = 1, cou = 0;
	string str;
	cin >> n >> str;

	REP(i, str.size()){
		int now = ((cou % 2 == 0) + (str[i] == 'B')) % 2;

		if(now){
			ans = (ans * cou) % MOD;
			cou--;
		}
		else {
			cou++;
		}

		if(cou < 0){
			cout << 0 << endl;
			return 0;
		}
	}

	for(int i = 1;i <= n;i++){
		ans = (ans * i) % MOD;
	}

	cout << (cou == 0 ? ans : 0) << endl;

	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll  long long int
#define ull unsigned long long 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back 
#define mp make_pair
#define mod 1000000007
#define ld long double
using namespace std;

ll fun(ll a, ll b)
{
    a%=mod;
    ll ans=1;
    if(a==0) ans=0;

    while(b>0)
    {
        if(b&1) ans=(ans*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return ans;
}



int main()
{ 
fast;
    ll n;
    cin>>n;
    map<pair<ll,ll>,ll > mapp;
    ll zero=0,inf=0,alone=0;

    ll a[n],b[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i]>>b[i];
        if(a[i]==0 and b[i]==0)
            alone++;
        else if(a[i]==0)zero++;
        else if(b[i]==0)inf++;
        else
        {
            ll g=__gcd(abs(a[i]),abs(b[i]));
            a[i]/=g,b[i]/=g;
            if(a[i]<0 and b[i]<0)a[i]=-a[i],b[i]=-b[i];
            else if(a[i]>0 and b[i]<0)a[i]=-a[i],b[i]=-b[i];
            mapp[{a[i],b[i]}]++;
            //cout<<i<<" "<<a[i]<<" "<<b[i]<<endl;
        }
    }

    ll ans=(fun(2,zero)+fun(2,inf)-1+mod)%mod;

    // cout<<ans<<endl;
    for(auto i:mapp)
    {
        if(i.ss>0)
        {
            ll x=i.ff.ff,y=i.ff.ss;
            ll q=0;

            if(x>0 and y>0)
            {
                if(mapp.find({-y,x})!=mapp.end())
                    q=(fun((ll)2,mapp[{-y,x}])-1+mod)%mod,mapp[{-y,x}]=0;
            }
            else
            {
                if(mapp.find({y,-x})!=mapp.end())
                    q=(fun((ll)2,mapp[{y,-x}])-1+mod)%mod,mapp[{y,-x}]=0;
            }

            ll tans=(q+mod+fun((ll)2,i.ss))%mod;
            ans=(ans*tans)%mod;

            // cout<<x<<" "<<y<<" "<<q<<" "<<ans<<endl;
        }
    }

    cout<<(ans-1+mod+alone)%mod<<endl;

}


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

void solve(istream& cin, ostream& cout) {
  int n;
  cin >> n;
  int n2 = 1 << n;
  vector<int> s(n2);

  for (int i = 0; i < n2; i++) {
    cin >> s[i];
  }

  sort(s.begin(), s.end());

  vector<int> a;
  a.push_back(s.back());
  s.back() = -1;
  for (int i = 0; i < n; i++) {
    vector<int> b = a;
    sort(b.begin(), b.end());
    int idx = n2 - 1;
    while (b.size() > 0 && idx >= 0) {
      if (s[idx] == -1) {
        idx--;
        continue;
      }
      if (s[idx] < b.back()) {
        b.pop_back();
        a.push_back(s[idx]);
        s[idx] = -1;
      }
      idx--;
    }
    if (b.size() > 0) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return;
}

#ifndef TEST
int main() {
  solve(cin, cout);
}
#endif


Measured memory_bytes: 2932
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
// #define ll int
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[8] ={1,0,-1,0,1,-1,1,-1};
ll dy[8] ={0,1,0,-1,1,-1,-1,1};
 
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; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


void solve(){
    string s;
    cin>>s;
    ll n=s.size();
    bool ok=false;
    if(n%2==1){
        cout<<"No"<<endl;
        return;
    }
    for(ll i=0;i<n-1;i+=2){
        if(s[i]!='h'||s[i+1]!='i'){
            cout<<"No"<<endl;
            return;
        }
    }
    cout<<"Yes"<<endl;



}

 
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
     
    solve();


    return 0;
}

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

using namespace std;
#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const long long inf = 1e9+7;
const long long mod = 1e9+7;

int main(){
    int n,m,k;
    cin>>n>>m>>k;

    rep2(i,0,n){
        rep2(j,0,m){
            if((n-i)*j+(m-j)*i==k){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }

    cout<<"No"<<endl;
}


Measured memory_bytes: 3616
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <limits>//setprecision
#include <iomanip>
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set,multiset
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#include <numeric> //accumulate,,,
//#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
long long MOD = 1000000007;

void chmax(long long &a,long long b){if(a < b) a = b;}
void chmin(long long &a,long long b){if(a > b) a = b;}

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //When end-of-a bit is 1, times simple N.
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a; else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    string S;cin >> S;
    deque<char> DQ;
    for(int i = 0;i<S.size();i++){
        DQ.push_back(S.at(i));
    }
    bool ok = true;
    int cnt = 0;
    while(DQ.size() > 1){
        char A = DQ.front(),B = DQ.back();
        if(A == B){
            DQ.pop_back();
            DQ.pop_front();
        }
        else if(A != B && A == 'x' && B != 'x'){
            DQ.push_back('x');
            DQ.pop_front();
            DQ.pop_back();
            cnt++;
        }
        else if(A != B && A != 'x' && B == 'x'){
            DQ.push_front('x');
            DQ.pop_back();
            DQ.pop_front();
            cnt++;
        }
        else{
            ok = false;
            break;
        }
    }
    if(ok){
        cout << cnt << endl;
    }
    else{
        cout << -1 << endl;
    }
}


Measured memory_bytes: 3856
#pragma region Macros

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define int ll
using vi = vector<int>;
using vvi = vector<vi>;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

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

// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                        \
    CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
    (__VA_ARGS__)
#else
#define debug(...)
#endif

#pragma endregion

void Main() {
    int A, B, K;
    cin >> A >> B >> K;

    set<int> iSet;

    if (B - A < K) {
        REP(i, B - A + 1) {
            cout << A + i << "\n";
        }
        return;
    }

    for (int i = A; i < A + K; i++) {
        iSet.insert(i);
    }
    for (int i = B; i > B - K; i--) {
        iSet.insert(i);
    }

    for (auto s : iSet) {
        cout << s << "\n";
    }
}

#pragma region main
main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Main();
    cout << flush;
}
#pragma endregion


Measured memory_bytes: 256
/*
author: orthodoxparadox
01-Sep-2018
17:43:01
*/

#include <bits/stdc++.h>

using namespace std;
#define dbl long double
#define int ll
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define fup(i, a, n) for (ll i = a; i < n; i++)
#define fdw(i, a, n) for (ll i = n-1; i >= a; i--)
#define fnu for(ll i = 0; i < n; i++)
#define fnd for(ll i = n-1; i >= 0; i--)
#define fau(i, v) for(auto i:v)
#define rev(s) reverse(all(s))
#define oill ostream_iterator<ll>(cout, " ")
#define oiint ostream_iterator<int>(cout, " ") 
#define pb emplace_back
#define push_back emplace_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define zero(a) memset(a, 0, sizeof(a))
#define onlyunique(v) v.erase(unique(all(v)), v.end()); //only for sorted vector
// #define x real()
// #define y imag()
typedef complex<double> point;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#ifdef __APPLE__
#define dbg(...) __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1)
{
	cerr << name << " : " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << "  ";
	__f(comma + 1, args...);
}
#else
#define dbg(...)
#endif

int __gcd(int a, int b)
{
	return b ? __gcd(b, a%b) : a;
}

// for set of pairs
struct pair_hash {
    inline std::size_t operator()(const std::pair<int,int> & v) const {
        return v.first*31+v.second;
    }
};

const int mod = 1e9 + 7;

vector<int> binarycut(int x){
	vector<int> v;
	while(x){
		if(x&1) v.pb(1);
		else v.pb(0);
		x>>=1;
	}
	reverse(all(v));
	return v;
}

int takemod(int a){
	return ((a%mod)+mod)%mod;
}

int fast_exp(int base, int expo) {
	int res=1;
	while(expo>0) {
		if(expo&1) res=(res*base)%mod;
		base=(base*base)%mod;
		expo>>=1;
	}
	return res;
}

int modinv(int a){
	return takemod(fast_exp(takemod(a), mod-2));
}

// void siev(int n)
// {
// 	sieve[0]=false;
// 	sieve[1]=false;
// 	for(int i=2; i<=sqrtl(n); i++)
// 	{
// 		if(sieve[i])
// 		{
// 			for(int j=i; i*j<=n; j++)
// 			{
// 			sieve[i*j]=false;
// 			}
// 		}
// 	}
// }

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	#ifdef __APPLE__
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	freopen("error.txt", "w", stderr);
	#endif
	time_t t1, t2;
	t1 = clock();

	int n, k;
	cin >> n >> k;
	int ans = 0;
	int mul = 0;
	for(int i = 1; i <= n; i++)
	{
		if(i % k == 0) mul++;
	}
	ans += (mul*mul*mul);
	if(!(k&1))
	{
		mul = 0;
		for(int i = 1; i <= n; i++)
		{
			if(i%k == (k/2)) mul++;
		}
		ans += mul*mul*mul;
	}
	cout << ans << endl;

	t2 = clock();
	cerr << "time taken: " << t2-t1;
	return 0;
}

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

int main(void) {
    int zohe[3] = {}, now = 0;
    string s[3];
    cin >> s[0] >> s[1] >> s[2];
    while (true) {
        if (zohe[now] < s[now].size()) {
            int temp = s[now][zohe[now]] - 'a';
            zohe[now]++;
            now = temp;
        }
        else {
            cout << (char)('A' + now) << endl;
            break;
        }
    }
}


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

def isPrime(x):
    if x == 1:
        return False
    for i in range( 2, int(pow(x, 1/2))+1 ):
        if x%i==0:
            return False
    return True

while True:
    if isPrime(x):
        print(x)
        break
    x += 1

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

/*** 解けなかった ***/

bool solve(int idx, int serch, int a[], int size){
    
    if(serch == 0){ //求める値になったら終わり(成功)
        return true;
    }
    else if(serch < 0){
        return false;
    }

    if(idx >= size){ //配列の最後まで行ったら終わり(失敗)
        return false;
    }
            //調べる頂点を変える             //計算　どんどん減算していく
    return solve(idx+1, serch, a, size) || solve(idx+1, serch-a[idx], a, size);
}

int main()
{
    int n;
    cin >> n;
    int a[20];
    rep(i, n){
        cin >> a[i];
    }

    int q;
    cin >> q;
    int m;
    rep(i, q){
        cin >> m;
        if(solve(0, m, a, n)){
            cout << "yes" << endl;
        }
        else{
            cout << "no" << endl;
        }
    }
    return 0;
}


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

int main()
{
    cin >> n >> k;

    vector<pair<int, int>> ab;
    rep(i, 0, n)
    {
        cin >> a >> b;
        ab.emplace_back(a, b);
    }
    sort(ab.begin(), ab.end());

    int now = -1;
    for (int i = 0; i < ab.size() and k > 0; i++)
    {
        now = ab[i].first;
        k -= ab[i].second;
    }
    cout << now << endl;
    return 0;
}

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int h, n; cin >> h >> n;
    vector<int> a(n);
    vector<int> b(n);
    rep(i, n) cin >> a[i] >> b[i];
    vector<ll> dp(1e8+5, 0);
    rep(i, 1e8+5) {
        rep(j, n) {
            if (i-b[j]<0) continue;
            dp[i] = max(dp[i], dp[i - b[j]] + a[j]);
        }
        if (dp[i]>=h) {
            cout << i << endl;
            return 0;
        }
    }
    
    return 0;
}

Measured memory_bytes: 781568
#include<bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main() {
    int N;
    string S;
    cin >> N;
    cin >> S;
    ll x = 0;
    ll ans = 0;
    REP(i, N){
        if (S[i] == 'I'){
            x += 1;
        }else {
            x -= 1;
        }
        ans = max(ans, x);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC positionimize(3,"Otrst","inline")
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<map>
#include<set>
#include<queue>
#include<vector>
#include<algorithm>
#include<tr1/unordered_map>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+10;
const int INF=0x3fffffff;
const double pi = 3.141592653;
const double E = 2.71828182846;
//const ll mod=9999991;
const int M=2e4+5;
const double eps=1e-8;
const ll MMod=1ll<<32;
#define ci(x) scanf("%lld",&x)
#define co(x) printf("%lld\n",x)

inline int read()
{
    int f=1,x=0;
    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 f*x;
}

ll fast_muttki(ll m, ll n,ll mod)//快速乘法
{
    ll cnt = 0;//注意初始化是0，不是1
    while (n)
    {
        if (n & 1)
        {
            cnt += m;
            cnt %= mod;
        }
        m = (m + m) % mod;//和快速幂一样，只不过这里是加
        n >>= 1;
    }
    return cnt;
}
ll fast_get(ll a, ll n,ll mod)//快速幂
{
    ll cnt = 1;
    while (n)
    {
        if (n & 1)
            cnt = fast_muttki(cnt,a,mod);//不能直接乘
        a = fast_muttki(a, a,mod);
        cnt %= mod;
        a %= mod;
        n >>= 1;
    }
    return cnt;
}

ll ans=1e14;
ll a[N];
ll n,x;
ll b[N];
int main()
{
    memset(b,0x3f,sizeof(b));
    ci(n);
    ci(x);
    for(int i=0;i<n;i++)
        ci(a[i]);
    for(int i=0;i<n;i++)
    {
        ll temp=0LL;
        for(int j=0;j<n;j++)
        {
            b[j] = min(b[j],a[(j-i+n)%n]);
            temp += b[j];
        }
        ans=min(ans,i*x+temp);
    }
    co(ans);
    return 0;
}

// 5 5 2 1 5 4  = 9
// 5 2 1 5 4 5  = 7
// 5 5 2 1 4 5  = 8


Measured memory_bytes: 16640
unittest
{
	assert( [ "0 2 3 4 5" ].parse.expand.solve == 1 );
	assert( [ "1 2 0 4 5" ].parse.expand.solve == 3 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto xs = input.front.split.to!( long[] );
	return tuple( xs );
}

auto solve( long[] xs )
{
	foreach( i, x; xs.enumerate( 1 ) )
	{
		if( i != x ) return i;
	}
	assert( false );
}


Measured memory_bytes: 2772
#include <stdio.h>
#include <math.h>
#include <string.h>
int main(){
	char strk[1000001];
	bool bz=false;
	scanf("%s",strk);
	for(int i=0;i<=strlen(strk)-1;i++){
		if(strk[i]=='C')bz=true;
		if(strk[i]=='F'&&bz==true){
			printf("Yes\n");
			return 0;
		}
	}
	printf("No\n");
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>


int main(int argc, char const *argv[]) {

  int a, b, n;
  scanf("%d", &n);
  scanf("%d", &a);
  scanf("%d", &b);

  int min;
  if (n*a <= b){
      printf("%d\n", n*a);
  }
  else {
      printf("%d\n", b);
  }

  return 0;
}

Measured memory_bytes: 128
/*
  AOJ 2644
  Title:Longest Match
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
char S[200001];
int  lens,lx,ly;
char Sr[200001];  //reverse order
char x[200001],y[200001];
char yr[200001];

str_reverse(char from[],char to[],int len)
{
  int i;

  for(i=0;i<len;i++)
    to[len-i-1]=from[i];
  to[len]='\0';
}
int longest_match()
{
  char *p1,*p2;
  int pos1,pos2,ret;

  p1=strstr(S,x);
  if(!p1)
    return(0);
  pos1=p1-S;


  lx=strlen(x);
  ly=strlen(y);

  str_reverse(y,yr,ly);

  p2=strstr(Sr,yr);
  if(!p2)
    return(0);
  
  pos2 = lens-(p2-Sr)-ly;
  //printf("p2:%d\n",pos2);

  if(pos1>pos2)
    return(0);
  if(pos2+ly<pos1+lx)
    return(0);
  return(pos2-pos1+ly);
}
main()
{
  int i,ret,m;
  
  scanf("%s",S);
  lens=strlen(S);
  str_reverse(S,Sr,lens);
  scanf("%d",&m);
    
  for(i=0;i<m;i++)
    {
      scanf("%s %s",x,y);
      ret=longest_match();
      printf("%d\n",ret);
    }

  return(0);
}

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

 using namespace std;

 int main() {
   int N, T, A;

   cin >> N >> T >> A;

   vector<int> H(N + 1);
   vector<double> temp(N + 1);

   for (int i = 1; i <= N; i++) cin >> H.at(i);

   for (int i = 1; i <= N; i++) temp.at(i) = T - 0.006 * H.at(i);

   double min_temp = 1000;
   int min_i;

   for (int i = 1; i <= N; i++) {
     if (fabs(temp.at(i) - A) < min_temp) {
       min_i = i;
       min_temp = fabs(temp.at(i) - A);
     }
   }

   cout << min_i << endl;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

n = int(input())
*h, = map(int, input().split())

dp = [0]*n
dp[1] = abs(h[1]-h[0])
for i in range(2, n):
    dp[i] = min(abs(h[i]-h[i-1])+dp[i-1], abs(h[i]-h[i-2])+dp[i-2])
print(dp[-1])

Measured memory_bytes: 14016
package main

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

func main() {
	K, X := getStdinInt2()
	min := X - K + 1
	max := X + K - 1
	for i := min; i <= max; i++ {
		if i < max {
			fmt.Printf("%d ", i)
		} else {
			fmt.Printf("%d", i)
		}
	}
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}


Measured memory_bytes: 2156
#include<iostream>
using namespace std;
int main()
{
	void ma(int a[], int m, int n);
        void mi(int a[], int m, int n);
	int n,p,x,t,o,m;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	cin >> p;
	while (p--)
	{
		cin >> o >> x >> t;
		if (o == 0)mi(a, x, t);
		if (o == 1)ma(a, x, t);
	}
	return 0;
}
void ma(int a[], int m, int n)
{
	int max;
	max = a[m];
	for (int i = m+1; i < n; i++)
		if (a[i] > max)max = a[i];
	cout << max << endl;
}
void mi(int a[], int m, int n)
{
	int max;
	max = a[m];
	for (int i = m+1; i < n; i++)
		if (a[i] < max)max = a[i];
	cout << max << endl;
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
using namespace std;
// int S[200000];
struct opt{
	int x,a,b,c,dbg;
	opt(int x=0,int a=0,int b=0,int c=0,int dbg=1):x(x),a(a),b(b),c(c),dbg(dbg){}
	void output(){
		if(x==0){
			if(dbg)cout << '+' << " " << a << " " << b << " " << c << endl;
			// if(dbg)cout << S[a] << " " << S[b] << endl;
			// S[c] = S[a] + S[b];
			// if(dbg)cout << S[c] << endl;
		}else{
			if(dbg)cout << "< " << a << " " << b << " " << c << endl;
			// if(dbg)cout << S[a] << " " << S[b] << endl;
			// S[c] = S[a] < S[b];
			// if(dbg)cout << S[c] << endl;
		}
	}
};
vector<opt> op;
void output(){
	cout << op.size() << endl;
	for(int i=0;i<(int)op.size();i++)op[i].output();
}
 
inline void rpt(int x,int y){
	for(int j=0;j<y;j++)op.push_back(opt(0,x,x,x));
}
 
int pw[64];
int g[128];
 
int main()
{
	// cin >> S[0] >> S[1];
	pw[0]=200000-1;
	op.push_back(opt(1,pw[0],1,pw[0]));
	op.push_back(opt(0,pw[0],0,0));
	op.push_back(opt(0,pw[0],1,1));
	for(int i=1;i<64;i++){
		pw[i] = pw[i-1] - 1;
		op.push_back(opt(0,pw[i-1],pw[i-1],pw[i]));
	}
	int pos0=pw[63]-1;
	g[0]=9;for(int i=1;i<128;i++)g[i]=g[i-1]+1;
	int po2=3,po3=4;
	int po4=5,po5=6;
	// op.push_back(opt(1,pos1,po2,po2));
	for(int i=63;~i;i--){
		op.push_back(opt(0,po2,pw[i],po3));
		
		op.push_back(opt(1,pos0,pos0,po4));//clear 0
		for(int j=63;~j;j--){
			op.push_back(opt(0,po4,pw[j],po5));
			op.push_back(opt(1,po3,0,7));op.push_back(opt(1,7,pw[0],7));
			op.push_back(opt(1,po5,1,8));op.push_back(opt(1,8,pw[0],8));
			op.push_back(opt(1,7,pw[0],7));
			op.push_back(opt(1,8,7,8));
			// for(int k=0;k<i+j;k++){
			// 	op.push_back(opt(0,8,8,8));
			// }
			op.push_back(opt(0,8,g[i+j],g[i+j]));
 
			op.push_back(opt(1,po5,1,po5));
			for(int k=0;k<j;k++){
				op.push_back(opt(0,po5,po5,po5));
			}
			op.push_back(opt(0,po5,po4,po4));
		}
		op.push_back(opt(1,po3,0,po3));
		for(int j=0;j<i;j++){
			op.push_back(opt(0,po3,po3,po3));
		}
		op.push_back(opt(0,po3,po2,po2));
	}
	for(int i=0;i<128;i++){
		for(int j=0;j<i;j++){
			op.push_back(opt(0,g[i],g[i],g[i]));
		}
		op.push_back(opt(0,g[i],2,2));
	}
	output();
	// cout << S[2] << endl;
}

Measured memory_bytes: 8264
#include <cstdint>
#include <cmath>
#include <string>
#include <iostream>
#include <vector>

int main(int argc, char* argv[])
{	
	int64_t N;
	std::cin >> N;
	const int64_t maxXYZ = int64_t(std::sqrt(double(N + 1)));

	for (int64_t n = 1; n <= N; ++n)
	{
		int cnt = 0;
		for (int64_t x = 1; x <= maxXYZ; ++x)
		{
			int64_t x2 = x * x;
			if (x2 > n)
			{
				break;
			}
			for (int64_t y = 1; y <= maxXYZ; ++y)
			{
				int64_t y2 = y * y;
				int64_t xy = x * y;
				if (x2 + y2 + xy > n)
				{
					break;
				}
				for (int64_t z = 1; z <= maxXYZ; ++z)
				{
					int64_t z2 = z * z;
					if (x2 + y2 + xy + z2 > n)
					{
						break;
					}

					if (x2 + y2 + z2 + xy + y * z + z * x == n)
					{
						++cnt;
					}
				}
			}
		}
		std::cout << cnt << std::endl;
	}
}


Measured memory_bytes: 3168
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

typedef pair<long long int, long long int> pll;


const long long int mod = 1000000007;
const long long int INF = 1e18;

long long int N,M,A[100030],L[200200],R[202000],sum[200200]={},res=0;
long long int dp[10005]={};

int main()
{
    cout << fixed << setprecision(18);
    cin>>N>>M;
    for(long long int i = 1; i <= N; i++){
        cin>>A[i];
    }
    cout<<(N-1+(M-2))/(M-1)<<endl;
}


Measured memory_bytes: 1024