akhauriyash/Code-Regression huggingface dataset:
#define _USE_NATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <random>
#include <tuple>

using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9
const int INF = 1e9;
const ll MOD = 1e9 + 7;
const int MINF = -1e9;


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

int main() {
	
	int n, K;
	cin >> n >> K;
	vector<int> h;
	rep(i, n) {
		int x;
		cin >> x;
		h.push_back(x);
	}
	ll dp[100050];
	rep(i, 100050) dp[i] = INF;

	dp[0] = 0;
	for(int i = 1; i < n; ++i) {
		for (int k = 1; k <= min(i, K); ++k) {
			chmin(dp[i], dp[i - k] + abs(h[i] - h[i - k]));
		}
	}
	cout << dp[n - 1] << endl;
	return 0;
}


Measured memory_bytes: 1528
#include <iostream>
#include <cstdlib>

int main (){
    long long int a, v, b, w, t;
    long long int distance;

    std::cin >> a >> v >> b >> w >> t;

    if (w >= v){
        std::cout << "NO" << std::endl;
    }
    else if (w < v){
        distance = std::abs(a - b);
        if((v - w) * t >= distance){
            std::cout << "YES" << std::endl;
        }
        else if ((v - w) * t < distance){
            std::cout << "NO" << std::endl;
        }
    }


}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d; int j=0; int k=0;
  bool f =true;
  while(1){
    c-=b;
    if(c<=0){f=true; break;}
    a-=d;
    if(a<=0){f=false;break;}
  }
  
  if(f) cout<<"Yes";
  else cout<<"No";
}


Measured memory_bytes: 3632
def c_attack_survival():
    N, K, Q = [int(i) for i in input().split()]
    A = [int(input()) - 1 for _ in range(Q)]

    ans = [0] * N
    for a in A:
        ans[a] += 1
    for i in range(N):
        ans[i] += K - Q
    ans = ['Yes' if a > 0 else 'No' for a in ans]
    return ' '.join(ans)

print(c_attack_survival())

Measured memory_bytes: 11820
import java.util.*;import java.io.*;import java.math.*;
public class Main
{
    public static void process()throws IOException
    {
        String s=nln();
        int N=s.length();
        if(isPalin(s.substring(0,(N-1)/2)) && isPalin(s.substring((N+2)/2,N)) && isPalin(s))
            pn("Yes");
        else
            pn("No");
        
    }

    static boolean isPalin(String s)
    {
        String ss=new StringBuffer(s).reverse().toString();
        if(ss.equals(s))
            return true;
        else return false;
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        boolean oj = true;
        if(oj){sc=new AnotherReader();out=new PrintWriter(System.out);}
        else{sc=new AnotherReader(100);out=new PrintWriter("output.txt");}
        int t=1;
        // t=ni();
        while(t-->0) {process();}
        out.flush();out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static int[] nai(int N)throws IOException{int[]A=new int[N];for(int i=0;i!=N;i++){A[i]=ni();}return A;}
    static long[] nal(int N)throws IOException{long[]A=new long[N];for(int i=0;i!=N;i++){A[i]=nl();}return A;}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}

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

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
   
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}

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

const ll mod = 1000000007;
struct mint {
    ll x;  // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
    string s;
    cin >> s;
    int n = s.size();
    reverse(s.begin(), s.end());

    ll cur = 1;
    vector<vector<mint>> dp(n + 1, vector<mint>(13));
    dp[0][0] = mint(1);
    for (ll i = 0; i < n; i++) {
        for (ll j = 0; j < 13; j++) {
            if (s[i] == '?') {
                for (ll k = 0; k <= 9; k++) {
                    ll num = k * cur;
                    dp[i + 1][(j + num) % 13] += dp[i][j];
                }
            } else {
                ll num = s[i] - '0';
                num *= cur;
                dp[i + 1][(j + num) % 13] += dp[i][j];
            }
        }
        cur = (10 * cur) % 13;
    }
    cout << dp[n][5].x << endl;
}

Measured memory_bytes: 16712
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr = input.trim().split("\n");
var nmab = arr[0].split(" ").map(Number);
var d = arr[1].split(" ").map(Number);
var m = nmab[1];
var a = nmab[2];
var b = nmab[3];
var haiki = [];
 
for (var i = 0; i < d.length; i++) {
   if (d[i] >= a) haiki.push(d[i]);
   else break;
}
 
if (d.length - haiki.length < m) {
   haiki.reverse();
   var cnt = 0;
   for (var i = 0; i < haiki.length; i++) {
      if (haiki[i] <= b) cnt++;
      else break;
   }
   console.log(haiki.length - cnt);
} else {
   console.log(haiki.length);
}

Measured memory_bytes: 15532
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int n,d; cin >> n;
  unordered_set<int> s;
  REP(i,n) { cin >> d; s.insert(d); }
  COUT(s.size());
  return 0;
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        n: isize
    }

    for a in 1..=3500 {
        for b in 1..=3500 {
            let numer = n * a * b;
            let denom = 4 * a * b - n * a - n * b;
            if denom == 0 || numer % denom != 0 {
                continue;
            }
            let c = numer / denom;
            if c <= 0 {
                continue;
            }
            println!("{} {} {}", a, b, c);
            return;
        }
    }
}

Measured memory_bytes: 2120
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000000000000009
//#define INF 9223372036854775807
typedef long long ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define ZREP(i,n) for(int i=1;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define rollcall cout<<"I'm Sucu."<<endl;
#define YES(s) s?cout << "YES" << endl:cout << "NO" << endl
#define Yes(s) s?cout << "Yes" << endl:cout << "No" << endl
#define Taka(s) s?cout << "Takahashi" << endl:cout << "Aoki" << endl
#define Yay(s) s?cout << "Yay!" << endl:cout << ":(" << endl
#define out(s,t,u) s?cout << t << endl:cout << u << endl
#define int ll
#define Endl endl
//#define P pair<int,int>


signed main(){
    int N;
    int Ans=0;
    cin >> N;
    for(int i=1;i<=N;i+=2){
        int c=0;
        for(int j=1;j<=i;j++){
            if(i%j==0)c++;
        }
        if(c==8)Ans++;
    }
    cout << Ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e5+5,mod=1e9+7;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    for(ll m=0;m<=n-1;m++){
        ll mn = c*(n-1-m) - d*m;
        ll mx = d*(n-1-m) - c*m;
        if(mn<=b-a && b-a<=mx)return cout<<"YES" , 0;
    }
    cout<<"NO";
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>



int main(){
  char str[1001];

  while(1){
    scanf("%s", str);
    if(str[0] == '0')break;
    int sum=0;
    for(int i=0; i<strlen(str); i++){
      sum +=(str[i]-'0');
    }
    printf("%d\n", sum);
  }
  return 0;
}


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

int num[500005];
typedef long long ll;
int main(){
  string s;
  cin >> s;

  for(int i=0; i<s.size(); i++){
    if(s[i] == '<') num[i+1] = num[i]+1;
  }
  for(int i=s.size()-1; i>=0; i--){
    if(s[i] == '>') num[i] = max(num[i], num[i+1]+1);
  }

  ll ans = 0;
  for(int i=0; i<s.size()+1; i++) ans += num[i];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 5840
N=int(input())
S=input()
ans=0
RGB=[0,0,0]
for i in range(N):
  if S[i]=="R":
    RGB[0]+=1
  if S[i]=="G":
    RGB[1]+=1
  if S[i]=="B":
    RGB[2]+=1
ans=RGB[0]*RGB[1]*RGB[2]    
for i in range(N-2):
  s1=S[i]
  for k in range(i+1,N-1):
    s2=S[k]
    t=k+k-i
    if s1==s2:
      continue
    if t<=N-1:
      s3=S[t]
      if s3!=s1 and s3!=s2:
        ans-=1      
print(ans)        

Measured memory_bytes: 68516
#include<bits/stdc++.h>
#define pii pair<int, int>
#define LL long long
#define mp make_pair
#define pb push_back
using namespace std;

int main() {
	#ifdef DEBUG
	freopen("text.in", "r", stdin);
	#endif
	int d, t, s;
	cin >> d >> t >> s;
	puts(t * s >= d ? "Yes" : "No");
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <numeric>
#include <cmath>
#include <limits>
#include <stdio.h>
#include <iomanip>
#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 <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
using ll = long long;
using Graph = vector<vector<pair<int,int>>>;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
ll Max(ll(a), ll(b), ll(c)) {
	return max(max(a, b), c);
}
ll Min(ll(a), ll(b), ll(c)) {
	return min(min(a, b), c);
}

vector<bool> seen;
vector<ll> kyo;
void dfs(const Graph& G, int v) {
    seen[v] = true; // v を訪問済にする

    // v から行ける各頂点 next_v について
    for (auto next_v : G[v]) {
        if (seen[next_v.first]) continue; // next_v が探索済だったらスルー
        kyo[next_v.first] = kyo[v] + next_v.second;
        dfs(G, next_v.first); // 再帰的に探索
    }
}



int main() {

    // 頂点数と辺数
    int N; cin >> N;

    // グラフ入力受取 (ここでは無向グラフを想定)
    Graph G(N);
    for (int i = 0; i < N-1; ++i) {
        int a, b,c;
        cin >> a >> b>>c;
        a--; b--;
        G[a].push_back(make_pair(b,c));
        G[b].push_back(make_pair(a, c));
    }

    // 頂点 0 をスタートとした探索
    seen.assign(N, false); // 全頂点を「未訪問」に初期化
    kyo.assign(N, 0);
    int Q, K;
    cin >> Q >> K;
    K--;
    dfs(G, K);
    vector<ll> x(Q);
    vector<ll> y(Q);
    rep(i, Q) {
        cin >> x[i] >> y[i];
        x[i]--; y[i]--;
    }
    rep(i, Q) {
        cout << kyo[x[i]] + kyo[y[i]] << endl;
    }
}

Measured memory_bytes: 15540
#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> mp;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int H, W, N;
  cin >> H >> W >> N;
  int count[10];
  for(int i = 0; i < 10; i++){count[i] = 0;}
  for(int i = 0; i < N; i++){
    int a, b;
    cin >> a >> b;
    pair<int, int> p = pair<int, int>(a, b);
    for(int dh = -1; dh < 2; dh++){
      for(int dw = -1; dw < 2;dw++){
        int h = a + dh;
        int w = b + dw;
        if (!((h > 1) && (h < H) && (w > 1) && (w < W))){continue;}
        pair<int,int> p = pair<int, int>(h,w);
        if(mp[p]){
          mp[p] += 1;
        }
        else{
          mp[p] = 1;
        }
      }
    }
  }
  for(map<pair<int,int>,int>::iterator itr = mp.begin(); itr != mp.end(); itr++){
    count[itr->second] += 1;
  }
  unsigned long long zero = H - 2;
  zero *= W - 2;
  for(int i = 1; i < 10; i++){
    zero -= count[i];
  }
  cout << zero << endl;
  for(int i = 1; i < 10; i++){
    cout << count[i] << endl;
  }
}

Measured memory_bytes: 56576
#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>


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

int main(void)
{
    ll n;
    ll m;
    cin>>n>>m;
    ll sum =0;
    vector<int> a(m);

    rep(i,m) 
    {
        cin>>a[i];
        sum+=a[i];
    }

    ll ans = n-sum;

    if(ans<0) cout<<-1<<endl;

    else cout<<ans<<endl;




}

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

const int INF = (1LL<<31)-1;

class SparseTable{
private:
    int N;
    int H;
    vector<vector<int>> data;
    vector<int> rdata;
    
public:
    SparseTable(vector<int> rdata): rdata(rdata){
        N = rdata.size();
        H = log2(N);
        
        data.resize(H+1);
        for(int i=0; i<N; i++){
            data[0].push_back(i);
        }
        int l = 1;
        for(int h=1; h<=H; h++){
            for(int i=0; i+l*2<=N; i++){
                int idx = -1;
                if(rdata[data[h-1][i]] < rdata[data[h-1][i+l]])
                    idx = data[h-1][i];
                else
                    idx = data[h-1][i+l];
                data[h].push_back(idx);
            }
            l <<= 1;
        }
    }
    int find(int a, int b){
        int h = log2(b-a);
        if(rdata[data[h][a]] < rdata[data[h][b-(1<<h)]])
            return data[h][a];
        else
            return data[h][b-(1<<h)];
    }
};

void euler_tour(vector<vector<int>> &G, int u, int d, vector<int> &tour, vector<int> &depth){
    tour.push_back(u);
    depth.push_back(d);
    for(auto v: G[u]){
        euler_tour(G, v, d+1, tour, depth);
        tour.push_back(u);
        depth.push_back(d);
    }
}

int main(){
    int N; cin >> N;
    vector<vector<int>> G(N);
    
    for(int i=0; i<N; i++){
        int k; cin >> k;
        for(int j=0; j<k; j++){
            int c; cin >> c;
            G[i].push_back(c);
        }
    }
    
    vector<int> tour, depth;
    euler_tour(G, 0, 0, tour, depth);
    vector<int> rightmsot(N);
    for(int i=0; i<tour.size(); i++)
        rightmsot[tour[i]] = i;
    
    SparseTable st(depth);
    
    int Q; cin >> Q;
    for(int i=0; i<Q; i++){
        int u, v; cin >> u >> v;
        int ru = rightmsot[u], rv = rightmsot[v];
        if(ru > rv)
            swap(ru, rv);
        rv++;
        int d = st.find(ru, rv);
        cout << tour[d] << endl;
    }
    
    return 0;
}

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

const double PI = 3.14159265358979323846;
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<double, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

std::istream &operator>>(std::istream &in, set<ll> &o) {
    ll a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}


bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

//const ll mod = 1e10;
//typedef priority_queue<P, vector<P>, greater<P> > PQ_ASK;

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

    ll par = n * (n + 1) / 2;
    ll all = accumulate(v.begin(), v.end(), 0ll);
    if (all % par != 0) {
        cout << "NO" << endl;
        ret();
    }

    ll turn = all / par;


    vector<ll> diff(n);
    rep(i, n) diff[i] = v[(i + 1) % n] - v[i] - turn;

    for (ll g : diff) {
        if (g <= 0 && (-g) % n == 0) continue;
        cout << "NO" << endl;
        ret();
    }

    cout << "YES" << endl;

}

Measured memory_bytes: 4732
s = gets.chomp.chars
dp = Array.new(s.size+1, 0)
s.each_with_index do |v,i|
  if v == "S"
    dp[i+1] = dp[i] + 1
  else
    dp[i+1] = dp[i] - 1
  end
end

ans = dp.min < 0 ? dp.min.abs * 2 : 0
puts ans


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

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

using ll = long long;
using ull = unsigned long long;
 
const ll INF = 1LL<<60;
const int MINF = 1e9;
const int MOD = 1e9+7;

using vi = vector<int>;
using vii = vector<vi>;

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

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

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

    ll k,n;cin >> k >> n;
    vi a(n);rep(i,n)cin >> a[i];

    ll roop = a[0] + k - a[n-1];
    vi diff;
    for(int i=0;i<n-1;i++){
        diff.push_back(a[i+1] - a[i]);
    }
    ll Sum = accumulate(ALL(diff),0);
    ll ans = MINF;
    for(int i=0;i<n;i++){
        if(i == 0 || i == n-1)continue;
        ll t1 = Sum + roop - diff[i-1];
        ll t2 = Sum + roop - diff[i];
        ll tmp = min(t1,t2);
        chmin(ans,tmp);
    }
    //i == 0
    chmin(ans,Sum);
    ll tmp = Sum + roop - diff[0];
    chmin(ans,tmp);
    //i == n-1
    tmp = Sum + roop - diff.back();
    chmin(ans,tmp);

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

Measured memory_bytes: 2168
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	ll K, A, B;
	cin >> K >> A >> B;
	if (B - A <= 2) {
		cout << K + 1 << endl;
	}
	else {
		if (A >= K) {
			cout << K + 1 << endl;
		}
		else {
			K -= A - 1;
			K -= 2;
			cout << B + (B - A) * (K / 2) + (K % 2) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3612
//#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cctype>
#include <cstdlib>      // srand,rand


using namespace std;
#define modd 1000000007



typedef pair<long long, long long> pl;
typedef pair<double, long long> pdl;



typedef string::const_iterator State;
class ParseError {};




#define ll long long




class UnionFind {
public:
	vector <ll> par;
	vector <ll> siz;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL){
		for (ll i = 0; i < sz_; ++i) par[i] = i;
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) swap(x, y);
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}



	bool issame(ll x, ll y) { // 連結判定
		return root(x) == root(y);
	}

	ll size(ll x) { // 素集合のサイズ
		return siz[root(x)];
	}


};


class SegmentTree {
private:
	int n;
	vector <ll> node;

public:
	// 元の配列　v をセグメントツリーで表現する。
	SegmentTree(vector<ll> v) {
		//最下段のノード数は元配列のサイズ以上になる最小の2冪->これをnとおく。
		//セグ木全体で必要なノード数は2n-1個である。
		int sz = v.size();
		n = 1; 
		while (n < sz)n *= 2;

	}

};




long long N, M, K, a, b, c, d, e, H, W, L,T;
ll A[300005] = {};
ll B[300005] = {};
ll C[100][3005] = {};
bool f, ff;
string S,SS;
set <long long>sll;
pl bufpl;
vector <long long>vl[100005];
vector <long long>vll;
vector <pl>vpl;
vector <string> vs;
set<ll> llset[50];
multiset<ll> llmset;
queue<ll> ql;


struct ST
{
	ll first;
	ll second;
	ll kaisuu;
	

	bool operator<(const ST& another) const
	{
		return first < another.first;//比較
	};

};



/*vector <ST> vst;
ST st[200005];
ST bufst;
bitset<5000> bits;*/


long long modinv(long long aa, long long mm) {
	long long bb = mm, uu = 1, vv = 0;
	while (bb) {
		long long tt = aa / bb;
		aa -= tt * bb; swap(aa, bb);
		uu -= tt * vv; swap(uu, vv);
	}
	uu %= mm;
	if (uu < 0) uu += mm;
	return uu;
}


ll minn, maxx;
double ansa;

ll zettai(ll aa) {

	if (aa < 0) {
		aa *= -1;
	}
	return aa;

}



double ab[200];

pdl bufdl;
vector<pdl> vdl;

int main() {
	
	cin >> a>>b;
	
	if (b % a == 0) {
		cout << -1 << endl;
	}
	else {
		f = true;
		M = b / a;
		M++;

		for (ll i = M; i <= M+100000; i++) {
			N = i * a;

			e = N / b;
			H = (N - e * b) / a;
			d = e + H+(N-e*b-H*a);

			if (i<d) {
				f = false;
				break;
			}
		}

		if (f) {

			cout << -1 << endl;

		}
		else {
			cout << N << endl;
		}
	}

	

	//cout << fixed << setprecision(10) << ansa << endl;
	return 0;



}



Measured memory_bytes: 5516
#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    int maxa[n+1];
    maxa[0]=0;
    int count=0;
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
        maxa[i+1]=max(maxa[i],a[i]);
        if(maxa[i+1]<=a[i])
            count++;
    }
    cout<<count;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
using namespace std;
#define MAX(X,Y) ((X)>(Y)?(X):(Y))

int main(void){
  map<string,int> mp;
  int n,mx;
  
  cin >> n;
  mx=0;
  for (int i=0; i<n; i++){
    string s; cin >> s;
    if (mp.find(s)==mp.end()){
      mp[s]=1;
    } else {
      mp[s]++;
    }
    mx = MAX(mx,mp[s]);
  }
  for (auto it=mp.begin(); it!=mp.end(); it++){
    if (it->second==mx) cout << it->first << endl;
  }
  return 0;
}


Measured memory_bytes: 25216
s=str(input())
#print(len(s))
p='abcdefghijklmnopqrstuvwxyz'
p=list(p)
if s=='zyxwvutsrqponmlkjihgfedcba':
    print(-1)
elif len(s)!=26:
    for i in range(26):
        if p[i] not in s:
            print(s+p[i])
            break
elif len(s)==26:
    for i in range(24,-1,-1):
        if s[i]<s[i+1]:
            z=list(s[i+1:])
            z.sort()
            for j in range(len(z)):
                if s[i]<z[j]:
                    print(s[:i]+z[j])
                    break
            else:
                continue
            break
        



Measured memory_bytes: 38496
n,m = map(int,input().split())
s = input()
a = []
c = n
while True:
  if c <= m:
    a.append(c)
    break
  for i in range(m,0,-1):
    if s[c-i] =='0':
      a.append(i)
      c -= i
      break
    if i == 1:
      print(-1)
      exit()
print(*a[::-1],sep=' ')

Measured memory_bytes: 50416
fun main(args: Array<String>){
	//Hello_World()
	//X_Cubic()
	Rectangle()
}

fun Rectangle(){
	val xy = readLine()!!.split(" ").map(String::toInt)
	val square = xy[0]*xy[1]
	val around = xy[0]*2+xy[1]*2
	println("${square} ${around}")
}


Measured memory_bytes: 33628
#include<stdio.h>

int main(){
    int a,b,c,x,i,j,k,count=0,coin1,coin2,coin3;
    scanf("%d %d %d %d",&a,&b,&c,&x);
    for(i=0;i<=a;i++){
        coin1=500*i;
        for(j=0;j<=b;j++){
            coin2=100*j;
            for(k=0;k<=c;k++){
                coin3=50*k;
                if(coin1+coin2+coin3==x)
                    count++;
            }
        }
    }
    printf("%d",count);
}



Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
 #ifdef LOCAL_EXEC
 #else
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);
 #endif // LOCAL_EXEC
  long long int x,y,n,k,i,j,sum=0,q;
  cin>>n;
  long long int A[n];
  for(i=0;i<n;i++){
    cin>>A[i];
    if(i==0)
        x=A[i];
    else
        x=x^A[i];
  }
  for(i=0;i<n;i++){
    y=A[i]^x;
    cout<<y<<" ";
  }
  return 0;
}


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

const int MAXN = 3005;
double dp[MAXN][MAXN];
double p[MAXN];
int main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> p[i];
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int k = 0; k <= i; k++)
        {
            dp[i][k] = (k ? p[i]*dp[i-1][k-1] : 0)  + (1-p[i])*dp[i-1][k];
        }
    }
    double ans = 0;
    for (int k = n/2 + 1; k <= n; k++)
        ans += dp[n][k];
    cout << setprecision(15) << fixed << ans;
    return 0;
}


Measured memory_bytes: 68992
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long int
#define mod 1000000007
 
#define REP(i, n) for(int i = 0; i < (n); i++)
#define NREP(i, n) for(int i = 0; i < (n); i++)
#define SREP(i, s) for(int i = 0; i < (s.size()); i++)
#define SORT(v, n) sort(v, v+n);
#define GSORT(v, n) sort(v, v+n, greater<int>());
#define VSORT(v) sort(v.begin(),v.end());
#define VGSORT(v) sort(v.begin(),v.end(),greater<int>());
#define REV(a) reverse(begin(a),end(a));

int main(){
	ios::sync_with_stdio(false);cin.tie(0);
	cout << fixed << setprecision(3);
////////////////////////////////////////////	
	int n;
	cin >> n;
	int a[n];
	int maxt=0;
	bool bb=0;
	REP(i,n){
		cin >> a[i];
		maxt=max(maxt,a[i]);
	}
	int cnt=0;
	REP(i,n){
		if(maxt==a[i]) cnt++;
	}
	if(cnt>1) bb=1;

	REP(i,n){
		if(bb) cout << maxt << endl;
		else if(a[i]!=maxt) cout << maxt << endl;
		else{
			int c=0;
			REP(i,n){
				if(a[i]!=maxt) c=max(c,a[i]);
			}
			cout << c << endl;
		}
	}
//////////////////////////////////////////////
}


Measured memory_bytes: 2432
n = int(input())

a = list(map(int, input().split()))
b = [None]*n

half = int(n/2)
for i in range(1,n+1):
    t = i%2
    if t != 0:
        b[half+int(i/2)] = a[i-1]
    else:
        b[half-int(i/2)] = a[i-1]

if n%2 == 1:
    for i in range(1,n+1):
        print(b[-i], end=' ')
else:
    for i in range(n):
        print(b[i], end=' ')

Measured memory_bytes: 26180
N,M = map(int,input().split())
src = list(map(int,input().split()))
es = [tuple(map(int,input().split())) for i in range(M)]

if M == N-1:
    print(0)
    exit()
if M + N//2 < N-1:
    print('Impossible')
    exit()

parent = [i for i in range(N)]
rank = [0] * N
def root(a):
    if parent[a] == a:
        return a
    else:
        parent[a] = root(parent[a])
        return parent[a]
def same(a,b):
    return root(a) == root(b)
def unite(a,b):
    ra = root(a)
    rb = root(b)
    if ra == rb: return
    if rank[ra] < rank[rb]:
        parent[ra] = rb
    else:
        parent[rb] = ra
        if rank[ra] == rank[rb]: rank[ra] += 1

for a,b in es:
    unite(a,b)
trees = {}
for i in range(N):
    trees[root(i)] = False

costs = []
for i,c in enumerate(src):
    costs.append((c,i))
costs.sort()

used = [False] * N
ans = used_n = 0
for c,v in costs:
    t = root(v)
    if trees[t]:
        continue
    else:
        trees[t] = used[v] = True
        used_n += 1
        ans += c

for c,v in costs:
    if used_n == 2*(N-M-1): break
    if used[v]: continue
    used_n += 1
    ans += c
print(ans)


Measured memory_bytes: 33164
#include <bits/stdc++.h>
using namespace std;
int main() {
  int K,A,B;
  cin >> K;
  cin >> A >> B;
  int x = B-A;
  int check = 0;
  for(int i = 0;i<x+1;i++){
    if((A+i)%K == 0){
      check++;
      break;
    }
  }
  if(check>0){   
  cout << "OK" <<endl;
  }else{
   cout << "NG" <<endl;
  }
}



Measured memory_bytes: 3600
#include<stdio.h>
int main()
{
	long long int n;
	scanf("%lld\n", &n);
	char s[200005];
	scanf("%s", s);
	long long int p = 1e9 + 7;
	long long int i;
	long long int count = 0, ans = 1;
	for (i = 1; i <= n; i++)
		ans = ans * i % p;
	for (i = 0; i < 2 * n; i++)
	{
		if (s[i] == 'B')
		{
			if (count % 2 == 0)
				count++;
			else
			{
				ans = ans * count % p;
				count--;
			}
		}
		else
		{
			if (count % 2 == 1)
				count++;
			else
			{
				ans = ans * count % p;
				count--;
			}
		}
	}
	if (count != 0)
		ans = 0;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>

#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
using namespace std;

int main(void) {
	int n;
	int count = 0;
	int* a;
	int* flag;
	cin >> n;
	a = new int[n + 1];
	flag = new int[n + 1]();
	FOR(i, 1, n) {
		cin >> a[i];
	}
	FOR(i, 1, n) {
		if (flag[i] == 1) {
			continue;
		}
		if (a[a[i]] == i) {
			count++;
			flag[a[i]] = 1;
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
 
const int N=2e5+20;
 
int n,a[N];
long long ans;
map <int,int> m;
 
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		ans+=m[a[i]-i];
		m[-a[i]-i]++;
	}
 
	cout<<ans;
}

Measured memory_bytes: 21432
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <array>
#include <tuple>
#include <random>

using namespace std;
typedef long long int ll;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()

#define inf 10000000000

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

    ll a, b, x;
    cin >> a >> b >> x;
    cout << ((a + b >= x && a <= x) ? "YES" : "NO") << endl;
}



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

#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define ll long long
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
 
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
 
const int mod=1e9+7;
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
int mul(int a,int b)
{
	return ((a)*1ll*(b))%mod;
}
 
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
}
 
int sub(int a,int b){
	a-=b;
	if(a<0){
		a+=mod;
	}
	return a;
}
 
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1){
			res=mul(res,a);
		}
		b/=2;
		a=mul(a,a);
	}
	return res;
}
 
template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x) {
	input>>x.F>>x.S;
	return input;
}
 
template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
	for(auto& i:x)
		input>>i;
	return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
	for(auto& i:x)
		output<<i<<' ';
	return output;
}
 
const int N=1000002;

void solve(){
	int h,a;
	cin>>h>>a;
	cout<<(h+a-1)/a;	
}
 
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int tc=1;
	//~cin>>tc;
	for(int _=0;_<tc;_++){
		//~ cout<<"Case #"<<_+1<<": ";
		solve();
		if(_!=tc-1)
		cout<<"\n";
	}
}


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

#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-origin昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-origin昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-origin降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-origin降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
template<typename T> bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1;} return 0;}
template<typename T> bool chmin(T &a, const T &b){ if(a>b){ a=b; return 1;} return 0;}


/*FUNCs=================================================*/


/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    //入力
    int n, a; cin >> n;
    vi u(n+1); rep1(i,n) cin >> u[i];
    //全部同じ数ならescapeする
    bool can = false;
    rep1(i,n-1) if(u[i]!=u[i+1]) can= true;
    
    if(can){ 
        map<int,int> research1;
        int r1max1st = -1, r1max2nd = -1; //そのまま残す要素の数を記録
        int r1max_n; //要素の数が最大の要素を保持
        for(int i = 1; i <= n; i += 2){
            a = u[i];
            if(research1.find(a) == research1.end()) research1.insert(make_pair(a, 1));
            else research1[a]++;
            //あるデータから同じ要素の個数を記録していくとき、mapの要素数の最大を探索しながら探す
            if(chmax(r1max1st, research1[a])) r1max_n = a; 
            else {
                chmax(r1max2nd, research1[a]);
            } 
        }
        int r2max1st = -1, r2max2nd = -1;
        int r2max_n;
        map<int,int> research2;
        for(int i = 2; i <= n; i += 2){
            a = u[i];
            if(research2.find(a) == research2.end()) research2.insert(make_pair(a, 1));
            else research2[a]++;
            if(chmax(r2max1st, research2[a])) r2max_n = a; 
            else {
                chmax(r2max2nd, research2[a]);
            }
        }
        
        if(r1max_n != r2max_n) cout << n - r1max1st - r2max1st << '\n';
        else {
            if(r1max2nd > r2max2nd) cout << n - r1max2nd - r2max1st << '\n';
            else cout << n - r1max1st - r2max2nd << '\n';
        }
    }
    else {
        cout << n/2 << '\n';
    }
}


Measured memory_bytes: 5376
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    while (true) {
        int n;
        int m;
        cin >> n >> m;
        if (n == 0 && m == 0) {
            break;
        }

        vector<int> v;
        for (int i = 0; i < n; ++i) {
            int a;
            cin >> a;
            v.push_back(a);
        }

        int r = -1;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                if (i == j) {
                    continue;
                }
                auto a = v[i] + v[j];
                if (a <= m) {
                    r = max(a, r);
                }
            }
        }
        if (r == -1) {
            cout << "NONE" << endl;
        }
        else {
            cout << r << endl;
        }
    }
}

Measured memory_bytes: 3060
H,W=map(int,input().split())
N=int(input())
la=list(map(int,input().split()))
lans=[[0 for _ in range(W)] for _ in range(H)]
count=0
tmpi=0
for i in range(H):
    if i%2==0:
        for j in range(W):
            if count==0:
                tmpi+=1
                count=la[tmpi-1]
            lans[i][j]=tmpi
            count-=1
    else:
        for j in range(W-1,-1,-1):
            if count==0:
                tmpi+=1
                count=la[tmpi-1]
            lans[i][j]=tmpi
            count-=1
for i in range(H):
    for j in range(W-1):
        print(lans[i][j],end=" ")
    print(lans[i][W-1])
    


Measured memory_bytes: 3916
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
int INF = 100100101;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int h,w;
  cin>>h>>w;
  string s;
  rep(i, w+2){
  	cout << "#";
  }
  cout << endl;
  rep(i,h){
    cout << "#";
    cin >> s;
    cout << s;
    cout << "#"<<endl;;
  }
  rep(i, w+2){
  	cout << "#";
  }
  cout << endl; 
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll h,w,k;cin>>h>>w>>k;
  vector<string>hw(h);
  vector<vector<ll>>c(h,vector<ll>(w));
  vector<ll>empty(h);

  rep(i,h){
    cin>>hw[i];
  }
  rep(i,h){
    ll f=1;
    rep(j,w)if(hw[i][j]=='#')f=0;
    if(f)empty[i]=1;
  }
  ll col=1;
  ll f=0;
  rep(i,h){
    if(empty[i])continue;
    rep(j,w){
      if(hw[i][j]=='#'){
        if(f){
          col++;
          f=1;
        }
        else{
          f=1;
        }
      }
      c[i][j]=col;
    }
    col++;
    f=0;
  }
  vector<ll>id(h);
  ll ti=-1;
  rep(i,h){
    if(!empty[i])ti=i;
    if(ti!=-1&&empty[i])id[i]=ti;
  }
  ti=-1;
  rrep(i,h){
    if(!empty[i])ti=i;
    if(ti!=-1&&empty[i])id[i]=ti;
  }
  rep(i,h){
    if(empty[i]){
      rep(j,w)c[i][j]=c[id[i]][j];
    }
  }
  rep(i,h){
    rep(j,w){
      cout<<c[i][j]<<" ";
    }
    cout<<"\n";
  }
  cout<<flush;
  return 0;

}


Measured memory_bytes: 1664
// #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fi first
#define se second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map< int, int >
#define Vector std::vector<int>
 
using std::cin;
using std::cout;
using std::endl;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int N = 100000 + 5;
const int M = 1000 + 5;
const int K = 1e7 + 5;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;
const int LOG = 40;
const ull BASE = 19260817;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
const double PI = acos(-1);
 
template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

int n;
int buc[105];
ll cnt[105];

inline void divide(int x) {
    for (int i = 2; i <= x; i++) {
        while (x % i == 0) buc[i]++, x /= i;
    }
}

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) divide(i);
    for (int i = 2; i <= 100; i++) {
        if (buc[i] >= 2) cnt[2]++;
        if (buc[i] >= 4) cnt[4]++;
        if (buc[i] >= 14) cnt[14]++;
        if (buc[i] >= 24) cnt[24]++;
        if (buc[i] >= 74) cnt[74]++;
    }
    printf("%lld\n", cnt[74] + (cnt[24] * (cnt[2] - 1)) + (cnt[14] * (cnt[4] - 1)) + (cnt[4] * (cnt[4] - 1) * (cnt[2] - 2) / 2));
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string a,b,c="";
int main(){
	int n;
	cin>>n;
	cin>>a>>b;
	for(int i=0;i<n;i++){
		c+=a[i];
		c+=b[i];
	}
	cout<<c;
	
	
	
	return 0;
}

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

using namespace std;

typedef long long ll;

#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR1(i,n) for(int (i)=1;(i)<(n);(i)++)
#define eFOR(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define eFOR1(i,n) for(int (i)=1;(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())
#define INF 1000000000

int main() {

	string b;
	cin >> b;
	if (b == "A")cout << "T" << endl;
	else if (b == "T")cout << "A" << endl;
	else if (b == "C")cout << "G" << endl;
	else cout << "C" << endl;
	return 0;
}


Measured memory_bytes: 256
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: usize) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}

fn read_col<T: std::str::FromStr>(n: usize) -> Vec<T> {
    (0..n).map(|_| read()).collect()
}

fn f(n: u32) -> u32 {
    let mut tmp = n;
    let mut cnt: u32 = 0;
    while tmp > 0 {
        cnt += 1;
        tmp = tmp / 10;
    }
    cnt
}

fn pow(a: u32, b: u32) -> u32 {
    let mut ans: u32 = 1;
    for _ in 0..b {
        ans *= a;
    }
    ans
}

fn main() {
    let s: String = read();
    let v: Vec<char> = s.chars().collect();
    let l = v.len();
    let mut ans: Vec<u32> = vec![0; l];

    let mut distance_left_R: Vec<usize> = vec![0; l];
    let mut rightest_r: usize = 0;
    for i in 0..l {
        if v[i] == 'R' {
            rightest_r = i;
            distance_left_R[i] = i;
        } else {
            distance_left_R[i] = rightest_r;
        }
    }

    let mut hoge: Vec<usize> = (0..l).collect();
    hoge.reverse();
    let it = hoge.iter();

    let mut distance_right_L: Vec<usize> = vec![0; l];
    let mut leftest_l: usize = 0;
    for &i in it {
        if v[i] == 'L' {
            leftest_l = i;
            distance_right_L[i] = i;
        } else {
            distance_right_L[i] = leftest_l;
        }
    }

    for i in 0..l {
        if v[i] == 'L' {
            let j = distance_left_R[i];
            if (i - j) % 2 == 0 {
                ans[j] += 1;
            } else {
                ans[j + 1] += 1;
            }
        } else {
            let j = distance_right_L[i];
            if (j - i) % 2 == 0 {
                ans[j] += 1;
            } else {
                ans[j - 1] += 1;
            }
        }
    }

    for i in 0..l {
        print!("{}", ans[i]);
        if i < l - 1 {
            print!(" ");
        } else {
            println!("");
        }
    }
}


Measured memory_bytes: 8572
#include <iostream>
#include <algorithm>

using namespace std;

long long int N, D[200001] = {}, M, T[200001] = {}, a = 1;

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++)cin >> D[i];
	stable_sort(D, D + N + 1);
	cin >> M;
	for (int i = 1; i <= M; i++)cin >> T[i];
	stable_sort(T, T + M + 1);
	for (int i = 1; i <= M; i++) {
		while (T[i] > D[a])a++;
		if (T[i] < D[a]) {
			cout << "NO" << endl;
			return 0;
		}
		if (T[i] == D[a])a++;
	}
	cout << "YES" << endl;
	return 0;
}

Measured memory_bytes: 4208
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repi(i,a,n) for(int (i)=(a);(i)<(n);(i)++)
typedef long long ll;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n,k,same=0,dif=0;
  string s;
  cin>>n>>k>>s;
  rep(i,n-1){
    if(s[i]==s[i+1])same++;
    else dif++;
  }
  cout<<same+min(dif,k*2);
  return 0;
}


Measured memory_bytes: 512
use std::io::*;
use std::str::FromStr;

fn main() {
    let mut strs = String::new();
    let stdin = stdin();
    let mut stdinlock = stdin.lock();
    stdinlock.read_line(&mut strs).unwrap();
    let n:i64 = i64::from_str(strs.trim()).unwrap();
    let mut backloga = 1u64;
    let mut backlogb = 2u64;
    for _ in 1..n {
        let test:u64 = backloga + backlogb;
        backlogb = backloga;
        backloga = test;
    }
    println!("{}", backloga);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
signed main()
{
  int x=0,y=0,z=0,n=0,m=0;
  std::cin >> x;
  rep(i,x){
    std::cin >> y>>z;
    n+=z-y+1;
  }
  std::cout << n << '\n';
}


Measured memory_bytes: 256
/*******************************
Author:galaxy yr
LANG:C++
Created Time:2019/08/13 10:25:27
 *******************************/
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1e4+5;
int head[maxn],cnt,n,w[maxn];
struct edge{
    int to,next;
}e[maxn<<1];
void add(int u,int v)
{
    e[++cnt].next=head[u];
    e[cnt].to=v;
    head[u]=cnt;
}
int win[maxn];
void dfs(int now)
{
    for(int i=head[now];i;i=e[i].next)
        if(win[e[i].to]==0 and w[e[i].to]!=w[now])
        {
            win[now]=1;
            break;
        }
    if(win[now]!=-1)return;
    for(int i=head[now];i;i=e[i].next)
        if(w[now]>w[e[i].to] and win[e[i].to]!=1)
        {
            dfs(e[i].to);
            if(win[e[i].to]==0)
            {
                win[now]=1;
                break;
            }
        }
    if(win[now]==-1)
        win[now]=0;
    return;
}
int main()
{
    //freopen("game.in","r",stdin);
    //freopen("game.out","w",stdout);
    ios::sync_with_stdio(false);
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>w[i];
    int a,b;
    for(int i=1;i<n;i++)
    {
        cin>>a>>b;
        add(a,b);
        add(b,a);
    }
    memset(win,-1,sizeof win);
    for(int i=1;i<=n;i++)
        if(win[i]==-1)
            dfs(i);
    for(int i=1;i<=n;i++)
        if(win[i])
            cout<<i<<' ';
    cout<<endl;
    return 0;
}


Measured memory_bytes: 384