akhauriyash/Code-Regression huggingface dataset:
// AUTHOR: ROSHAN SRIVASTAVA
// WEBSITE: https://www.youtube.com/channel/UC6uQdd7kLLOdlHSVklhV7Cw

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

int n; 

int main(){

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    cin >> n;
    vector<int> a(n);
    map<int, int> m;
    set<int> s;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        m[a[i]] += 1;
        s.insert(a[i]);
    }

    a.clear();
    a.resize(0);

    for(auto x: s) {
        a.push_back(x);
        // cout<< x << " " << m[x] <<endl;
    }

    n = a.size();    

    int ans = 0;

    for(int i = 0; i < n; i++) {
        for(int j = i + 1; j < n; j++) {
            int val = a[i] + a[j];
            for(int k = j + 1; k < n; k++) {
                if(a[k] < val) {
                    // cout<<i <<" " << j << " "<< k << endl;
                    ans += (m[a[i]] * m[a[j]] * m[a[k]]);
                }
            }
        }
    }


    cout << ans << endl;

    return 0;
}

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

using namespace std;

#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;

int n;
int m;
int cnt;
int p[10];
int adj[10][10];

void dfs() {
	int univ = (1 << n) - 1;
	int dp[univ+1][univ+1];
	for (int i = 0; i <= univ; i++) {
		for (int j = 0; j <= univ; j++) {
			dp[i][j] = 0;
		}
	}
	dp[1][0] = 1;

	for (int s = 2; s < univ+1; s++) {
		for (int j = 0; j < n; j++) {
			int s2 = s & (univ ^ (1 << j));
//			cout << "s " << bitset<8>(s) << " s2 " << bitset<8>(s2) << "\n";
			for (int k = 0; k < n; k++) {
				if (((1 << k) & s2) && adj[k][j]) {
//					cout << s << " " << k << " " << dp[s2][k] << "\n";
					dp[s][j] += dp[s2][k];
				}
			}
		}
	}
	int ans = 0;
	for (int i = 1; i < n; i++) {
		ans += dp[univ][i];
	}
	cout << ans << "\n";;
}

int main()
{
	cin >> n >> m;
	memset(p, 0, sizeof(p));
	cnt = 0;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		adj[a][b]=1;
		adj[b][a]=1;
	}
	dfs();
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define mod 1000000007
#define mx 200002
mt19937 myrand(time(0));

ll n,k;
ll a[mx];

ll check(ll x){
    ll ret=0;
    for(int i=0;i<n;i++){
        ret+=(a[i]+x-1)/x;
        ret--;
    }
    return ret;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(),cout.tie();
    cin>>n>>k;
    ll lo=1,hi=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        hi=max(hi,a[i]);
    }
    ll ans=-1;
    while(lo<=hi){
        ll mid=(lo+hi)/2;
        debug()<<imie(mid)imie(check(mid));
        if(check(mid)<=k){
            ans=mid;
            hi=mid-1;
        }
        else lo=mid+1;
    }
    cout<<ans<<endl;
    return 0;
}


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


ll f(ll a,ll b){
  ll ans;
  ll r = b % a;
  ll x = a*b;
  while(r!=0){
    b = a;
    a = r;
    r = b % a;
  }
  ans = x/a;
 
  return ans;
}

int main(){
  ll a,b;
  ll ans;
  cin >> a >> b;
  if(a > b){
    ll c = a;
    a = b;
    b = c;
  }
  ans = f(a,b);
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

typedef pair<int,int> P;

int main() {
  int n,m;
  int ans = 1;
  cin >> n >> m;
  vector<P> req(m);
  for (int i=0; i<m; i++) {
    int u,v;
    cin >> u >> v;
    req[i] = P(u,v);
  }

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

  int l,r;
  l = INT_MIN;
  r = INT_MAX;
  for (auto re : req) {
    // cerr << r.first << " " << r.second << endl;
    l = max(l,re.first);
    if (l >= r) {
      r = INT_MAX;
      ans++;
    }
    r = min(r,re.second);
  }

  cout << ans << endl;
}


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;


int main(){
    char a,b;cin >>a>>b;
    if(a>b){
        for (int i = 0; i <a-'0' ; ++i) {
            cout <<b;
        }
    }
    else {
        for (int i = 0; i < b - '0'; ++i) {
            cout <<a;
        }
    }
    cout <<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) _MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define pb push_back
#define all(x) begin(x),end(x)
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cerr<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cerr<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.first<<","<<p.second<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
#else
#define dbg(...) {}
#endif

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

  bool ok = false;
  rep(i,100){
    if(n - i*4 >= 0 && (n-i*4)%7==0) ok = true;
  }
  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner (System.in);
	int d, sum, hight;
	while (scan.hasNext()) {
	    d = Integer.parseInt(scan.nextLine());
	    sum = 0;
	    for (int i = 0; i*d < 600; i++) {
		hight = i * d * i * d;
		sum += hight * d;
	    }
	    System.out.println(sum);
	}
    }
}

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

int main() {
  long N;
  cin >> N;
  vector<long> A(N);
  for (long i = 0; i < N; i++) cin >> A.at(i);
  vector<long> R(N);
  R.at(0) = A.at(0);
  for (long i = 1; i < N; i++) {
    R.at(i) = R.at(i - 1) + A.at(i);
  }
  long sum1 = 0, hosei1 = 0;
  for (long i = 0; i < N; i++) {
    if (i % 2 == 0) {
      if (R.at(i) + hosei1 > -1) {
        long tmp = (R.at(i) + hosei1) - -1;
        hosei1 -= tmp;
        sum1 += tmp;
      }
    } else {
      if (R.at(i) + hosei1 < 1) {
        long tmp = 1 - (R.at(i) + hosei1);
        hosei1 += tmp;
        sum1 += tmp;
      }
    }
  }
  long sum2 = 0, hosei2 = 0;
  for (long i = 0; i < N; i++) {
    if (i % 2 == 0) {
      if (R.at(i) + hosei2 < 1) {
        long tmp = 1 - (R.at(i) + hosei2);
        hosei2 += tmp;
        sum2 += tmp;
      }
    } else {
      if (R.at(i) + hosei2 > -1) {
        long tmp = (R.at(i) + hosei2) - -1;
        hosei2 -= tmp;
        sum2 += tmp;
      }
    }
  }
  cout << min(sum1, sum2) << "\n";
}

Measured memory_bytes: 4816
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  ll N,K;
  cin >> N >> K;
  if(K==0){ cout << N*N << endl; return 0;}
  ll ans = 0;
  for(ll a=K+1;a<=N;a++){
    ll t= N/a;
    ll tt = N%a;
    ans += t * (a-K);
    ans += max(ll(0),tt - K+1);
    //cout << ans<< endl;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
'use strict'

function main(input) {
    const inputs = input.trim().split(/\n/)
    const len = ~~inputs[0]
    if (inputs[1].length <= len) {
        console.log(inputs[1])
    } else {
        console.log(`${inputs[1].slice(0, len)}...`)
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'))


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

int main(){
  string S,T,U;
  int A,B;
  cin >> S >> T >> A >> B >> U;
  if(S==U){
    cout << A-1 << " " << B << endl;
  }
  else{
    cout << A << " " << B-1 << endl;
  }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

public class Main{
	public static void main(String[] args) {
		SC sc=new SC(System.in);
		while(true) {
			int size=sc.nextInt();
			if(size==0) {
				break;
			}
			else {
				int[][] plate=new int[size][size];
				int[][] dp=new int[size][size];
				for(int i=0; i<size; i++) {
					for(int j=0; j<size; j++) {
						plate[i][j]=0;
						dp[i][j]=0;
					}
				}
				String s="";
				for(int i=0; i<size; i++) {
					s=sc.next();
					for(int j=0; j<size; j++) {
						if(s.charAt(j)=='.') {
							plate[i][j]=0;
						}
						else {
							plate[i][j]=1;
						}
					}
				}
				for(int i=0; i<size; i++) {		//dpループ
					for(int j=0; j<size; j++) {
						if(i>=1 && j>=1) {		//3方向見えるときは、正方形のサイズの制限はない
							if(plate[i][j-1]==1 || plate[i-1][j]==1 || plate[i-1][j-1]==1) {
								//上、左、左上のどれかに壁があるならできる正方形は高々1
								if(plate[i][j]==1) {
									dp[i][j]=0;	//いま見ているところが壁なら正方形はそこにはできない
								}
								else {
									dp[i][j]=1;	//まわりのどれかが壁の時できる正方形は高々1
								}
							}
							else {
								dp[i][j]=Math.min(Math.min(dp[i-1][j], dp[i-1][j-1]), Math.min(dp[i-1][j], dp[i][j-1]))+1;
							}
						}
						else {//もしもいま見ている座標の上、左上、左のいづれかが見ることできないなら　できる正方形のサイズは高々1
							if(plate[i][j]==1) {
								dp[i][j]=0;
							}
							else if(plate[i][j]==0){
								dp[i][j]=1;
							}
						}
					}
				}
				int max=0;
				for(int i=0; i<size; i++) {
					for(int j=0; j<size; j++) {
						max=Math.max(dp[i][j], max);
					}
				}
				pl(max);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
}


Measured memory_bytes: 71124
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int m, f, r;

        while(true) {
            m = sc.nextInt();
            f = sc.nextInt();
            r = sc.nextInt();

            if(m == -1&&f == -1&&r ==-1) {
                break;
            }

            if(m == -1||f == -1){
                System.out.println("F");
                continue;
            }
            else if(m + f >= 80) {
                System.out.println("A");
                continue;
            }
            else if(m + f >= 65) {
                System.out.println("B");
                continue;
            }
            else if(m + f >= 50) {
                System.out.println("C");
                continue;
            }
            else if(m + f >= 30) {
                if(r >= 50){
                    System.out.println("C");
                    continue;
                }
                System.out.println("D");
                continue;
            }
            else {
                System.out.println("F");
                continue;
            }
        }
    }
}


Measured memory_bytes: 26272
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b;
  cin >> a>>b;
  int ans = a+b;
  ans=max(max(ans,a-b),a*b);
  cout << ans << endl;

  
  return 0;
    

}


Measured memory_bytes: 892
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define ll long long int
int main(){
	ll n,k;
	cin>>n>>k;
	long double ans=0.0;
	for(int i=1;i<=n;i++){
		long double loc=(1/(long double)n);
		ll p=0,j=i;
		while(j<k){
			j=2*j;
			p++;
		}
		while(p--){
			loc=loc*0.5;
		}
		ans+=loc;
	}
	cout<<std::setprecision(11)<<ans<<endl;
}


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

int main() {
    int n, m, ans=0;
    cin >> n >> m;
    vector<int> h(n);
    for(int i=0; i<n; i++) cin >> h[i];
    vector<vector<int>> g(n);
    for(int i=0; i<m; i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for(int i=0; i<n; i++){
        bool flag=true;
        for(int j=0; j<g[i].size();j++){
            if(h[i]<=h[g[i][j]]) {
                flag=false;
                break;
            }
        }
        if(flag) ans++;
    }
    cout << ans;
}

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

int main() {
	int n; cin >> n;
	map<int, int>a;
	for (int i = 0, tmp; i < n; i++) {
		cin >> tmp; a[tmp]++;
	}
	int ans = a.size();
	cout << (ans % 2 == 0 ? ans - 1 : ans) << endl;
	return 0;
}

Measured memory_bytes: 4992
import sys
n, m = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        z = (m-i*10000-j*5000)//1000
        if i + j + z == n:
            print(i, j, z)
            sys.exit()
print(-1, -1, -1)

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

int main(){
  int a, b, c, d; cin >> a >> b >> c >> d;
  if((abs(c-a) <= d) || (abs(b-a) <= d && abs(c-b) <= d)) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
#define rep(i,x) for(int i = 0; i < x; i++)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
const ll MOD = 1e9+7;
const int n_max = 1e5+10;

int main(){
    ll n,m; cin >> n >> m;
    vector<ll> a(n);
    priority_queue<ld> pq;
    rep(i,n){
        cin >> a[i];
        pq.push(ld(a[i]));
    } 
    
    ll count = 0;
    while(count < m){
        ld temp = pq.top();pq.pop();
        temp /= 2.0;
        pq.push(temp);
        count++;
    }
    ll res = 0;
    while(pq.size()){
        ll ans = floor(pq.top());pq.pop();
        res += ans;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include<deque>
#include<queue>
#include<set>
#include <functional>

//マクロ
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=1; i<=(int)(n); ++i)
#define RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)

#define All(a) (a).begin(),(a).end()

//定数
#define INF 1e9
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数
vector<int> l;

//使用する関数
template<class T>bool chmax(T &a, const T &b) {
	if (a < b) { a = b; return 1; }
	return 0;
}
template<class T>bool chmin(T &a, const T &b) {
	if (a > b) { a = b; return 1; }
	return 0;
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll ans = 0;
	int a,b;
	cin >> a >> b;

	if (a < 1 || a>9 || b < 1 || b>9) {
		cout << -1 << endl;
		return 0;
	}

	cout << a*b << endl;
}

Measured memory_bytes: 256
#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 FOR (i,m,n) for(int (i)=m;(i)<(n);(i)++)

int main(){
  string s;
  cin >> s >> s;
  cout << 'A' << s.at(0) << 'C';
}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<math.h>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
const int N=100000;
const db pi=acos(-1.0);
#define lowbit(x) (x)&(-x)
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u];i;i=sq[i].nxt)
#define fir first
#define sec second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define maxd 998244353
#define eps 1e-8
int n;
char s[100100];

int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int main()
{
	scanf("%s",s+1);
	n=strlen(s+1);
	int cnt=-1;
	rep(i,1,n)
		if (s[i]!=s[i-1]) cnt++;
	cout << cnt;
	return 0;
}

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

int main() {
	int N, l, i=0, c=0;
	vector<int> a;
	cin >> N;
	while(cin >> l){
		a.push_back(l);
		i++;
		if (i >= N) {
			break;
		}
	}

	bool is_end = false;
	while (true) {
		for (int i = 0; i < a.size();++i) {
			if (a[i] == 0) {
				goto end;
			}
			if (a[i] % 2 == 0) {
				a[i] /= 2;
			}
			else {
				goto end;
			}
		}
		c++;
	}
end:
	cout << c << endl;
}


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

int main(){
    int n;
    string n1, n2;
    cin >> n;
    int j=0, k=0;
    for(int i=0; i<n; i++){
        cin >> n1 >> n2;
        if(n1.compare(n2)==0){
            j++;k++;
        }
        else if(n1.compare(n2)>0) j+=3;
        else k+=3;
    }
    cout << j <<" "<< k << endl;
}


Measured memory_bytes: 3184
#include <iostream>
#include <vector>
#include <string>
#include <tuple>
#include <algorithm>
#include <numeric>
#include <climits>
#include <cmath>
#include <map>
#include <cassert>

using namespace std;

map<int,int> primediv(int n)
{
    assert(n > 1);

    int d = 2;
    int ulimit = sqrt(n);
    map<int,int> res;

    while (d <= ulimit) {
        if (n % d == 0) {
            res[d]++;
            n /= d;
            ulimit = sqrt(n);
        } else
            d += 1;
    }
    if (n != 1)
        res[n]++;
    return res;
}

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

    if (n == 1) {
        cout << 1 << endl;
        return 0;
    }

    vector<int> pf(n+1);

    for (int i = 2; i <= n; i++) {
        //cout << "-----" << i << endl;
        auto v = primediv(i);
        for (auto it = v.begin();
             it != v.end();
             it++) {
            //cout << it->first << "^" << it->second << endl;
            pf[it->first] += it->second;
        }
    }

    long ans = 1;
    for (int i = 0; i < pf.size(); i++) {
        if (pf[i])
            ans = ans * (pf[i] + 1) % 1000000007;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
#define for1(i,a,n)  for(int i=0;i<n;i++)
#define rep(i, c) for(int i = 0; i < (int)c; i++)
#define set(x) cout<<fixed<<setprecision(x);
using namespace std;
//**********************************************DO IT NO****************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {  
      int n,a,b;
      cin>>n>>a>>b;
      int x=n-a;
      cout<<x%b;
    }
}
    
// 🍪 🍪 🍪


Measured memory_bytes: 3448
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n ; ++i)
#define REP(i,a,b) for(int i=a; i<b; ++i)
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
//プロトタイプ宣言
int gcd(int , int);
void often(void);
int get_digent(int);


int main(){
  //often();
  int n;
  cin >> n;
  vi a(n);
  int num;
  rep(i,n){
    cin >> num;
    a[num - 1] = i+1;
  }
  rep(i,n) cout << a[i] << endl;
}








































//以下、ライブラリ

int gcd(auto a, auto b) {
  return b ? gcd(b, a%b) : a;
}  //ユークリッドの互除法

void often(void){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

int get_digent(int x){
  string s;
  s = to_string(x);
  int digent = s.size();
  return digent;
} 

Measured memory_bytes: 1152
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
ll M = 1000000007;
ll beki(int n){
  if(n==0) return 1;
  else return 2*beki(n-1)%M;
}
int main(){

  int N;
  cin >> N;
  int cnt[N];

  for(int i=0;i<N;i++) cnt[i] = 0;

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

  bool flag = true;
  if(N%2==0){   
    for(int i=1;i<N;i+=2){
      if(cnt[i]!=2) flag = false;
    }
  }else{
    if(cnt[0]!=1) flag = false;
    for(int i=2;i<N;i+=2){
      if(cnt[i]!=2) flag = false;
    }
  }

  if(flag) cout << beki(N/2) <<endl;
  else cout << 0 <<endl;

  return 0;
}

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

int main() {
    int a,b;
    cin >> a >> b;
    if((b-a) % 2 == 0){
        cout << max(a,b) - abs(b-a)/2 << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
}


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

#define vec              vector<int>
#define vecll            vector<ll>
#define vecd             vector<double>
#define vecst            vector<string>
#define vecb             vector<bool>
#define v2(v,n,m,init)   vector<vector<int>>  v(n, vector<int>(m, init))
#define vb2(v,n,m,init)  vector<vector<bool>> v(n, vector<bool>(m, init))
#define vll2(v,n,m,init) vector<vector<ll>>   v(n, vector<ll>(m, init))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
template <typename T>
bool chmax(T &a, const T& b){if(a<b){a=b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a>b){a=b; return true;} return false;}
//----------------------------------------------------------------

int main(void) {
  int d, t, s;
  cin >> d >> t >> s;
  if(t*s>=d) prt("Yes");
  else prt("No");
}


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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

static const int MAX = 2e5+5;
// static const int NIL = -1;
static const int INF = 1<<21;
// static const ll MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

vector<vector<int>> g;
vector<int> ans;

void bfs(int s) {
    queue<int> q;
    q.push(s);

    int u;
    u = s;
    while(!q.empty()) {
        u = q.front();
        q.pop();
        for (auto v:g.at(u)) {
            if (ans.at(v)!=INF) continue;
            ans.at(v) = u;
            q.push(v);
        }
    }
}

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

    int a, b;
    g.assign(n, vector<int>());
    for(int im=0;im<m;im++) {
        cin >> a >> b; a--; b--;
        g.at(a).push_back(b);
        g.at(b).push_back(a);
    }

    ans.resize(n);
    for(int in=0;in<n;in++) {
       ans.at(in) = INF;
    }

    bfs(0);

    for(auto c:ans) {
       if(c==INF) {
           cout << "No" << endl;
           return 0;
       } 
    }

    cout << "Yes" << endl;
    ans.at(0) = -1;
    for(auto c:ans) {
        if(c==-1) continue;
        cout << c+1 << endl;
    }
    return 0;
}


Measured memory_bytes: 10072
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <stack>
#include <queue>
#include <set>
#include <list>
#include <bitset>

using namespace std;

#define fi first
#define se second
#define long long long
typedef pair<string,string> ss;

map< pair<string,string>, long> mp1, mp2;

int n;
string s;

void bf1(string s1, string s2, int k)
{
	if(k == n)
		mp1[{s1,s2}]++;
	else
	{
		bf1(s1+s[k], s2, k+1);
		bf1(s1, s2+s[k], k+1);
	}
}
void bf2(string s1, string s2, int k)
{
	if(k == n-1)
		mp2[{s1,s2}]++;
	else
	{
		bf2(s1+s[k], s2, k-1);
		bf2(s1, s2+s[k], k-1);	
	}
}

int main()
{
	ios_base::sync_with_stdio(); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);
	cin >> n >> s;
	bf1("","",0);
	bf2("","",2*n-1);
	long res = 0;
	for(auto it : mp1)
	{
		// cout << it.fi.fi << " " << it.fi.se << " " << it.se << "\n";
		res += mp2[it.fi]*it.se;
	}
	printf("%lld\n", res);
}












Measured memory_bytes: 104320
require 'pp'
N = gets.to_i
CARDS = readlines.map{|l| l.split.map{|x| x.to_i}}

#def hashn(cols)
#  ret = Float::INFINITY
#  i = 0
#  while i < 4 
#    a,b,c,d = cols.rotate(i)
#    h = a*1000000000+b*1000000+c*1000+d
#    ret = h if h < ret
#    i += 1
#  end
#  ret
#end
def hashn(cols)
  a,b,c,d = cols
  [
    a*1000000000+b*1000000+c*1000+d,
    b*1000000000+c*1000000+d*1000+a,
    c*1000000000+d*1000000+a*1000+b,
    d*1000000000+a*1000000+b*1000+c,
  ].min
end

COUNTS = Hash.new{|h, k| h[k] = 0}
CARDS.each.with_index do |cols, k|
  COUNTS[hashn(cols)] += 1
end

      #    0--1\
      #    |\3--2
      #    4 | 7|
      #     \5--6
SIDES = [
  [0,3,5,4],
  [3,2,6,5],
  [2,1,7,6],
  [1,0,4,7],
]

ans = 0
# Loop for all the combinations of top/bottom cards
for i in 0..(N-2)
  #p i; break if i == 1
  top = CARDS[i]
  top_hash = hashn(top)
  for j in (i+1)..(N-1)
    # Loop for each rotation of the bottom card
    4.times do |l|
      btm = CARDS[j].rotate(l)
      btm_hash = hashn(btm)
      cols = top + btm

      # The count is, basically, the sum of the number of candidate cards for each side.
      total = 1
      used = Hash.new(0)
      used[top_hash] += 1
      used[btm_hash] += 1
      4.times do |i|
        side_cols = cols.values_at(*SIDES[i])
        side_hash = hashn(side_cols)
        a,b,c,d = side_cols
        m = if a==b&&b==c&&c==d
              4
            elsif a==c&&b==d
              2
            else
              1
            end
        total *= (COUNTS[side_hash] - used[side_hash]) * m
        used[side_hash] += 1
      end
#      p ij: [i, j], top: top, btm: btm,
#        sides: 4.times.map{|i| cols.values_at(*SIDES[i])},
#        total: total if total > 0
      ans += total
    end
  end
end

# Each cube is counted three times, so divide by 3
p ans / 3


Measured memory_bytes: 90652
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;

string decToBin(float n){
	string binInteger, binDecimal;
	int decInteger;
	float decDecimal;
	ostringstream oss;
	
	decInteger = floor(n);
	decDecimal = n - decInteger;
	
	while(decInteger){
		binInteger += '0'+(decInteger%2);
		decInteger /= 2;
	}
	reverse(binInteger.begin(),binInteger.end());
	if(binInteger.length()>8)return "NA";
	
	while(1){
		decDecimal = (decDecimal-floor(decDecimal))*2;
		if(decDecimal==0.0)break;
		binDecimal += '0'+floor(decDecimal);
	}
	if(binDecimal.length()>4)return "NA";

	oss<<setfill('0')<<setw(8)<<binInteger
	<<"."
	<<left<<setw(4)<<binDecimal;
	
	return oss.str();
}

int main() {
	float n;
	while(cin>>n,n>=0.0){
		cout<<decToBin(n)<<endl;
	}
	return 0;
}

Measured memory_bytes: 1244
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long m,n,i,j,x,y,z,a[300000],k=0,cnt=0,b[300000];
    cin>>n>>m;
    memset(a,0,sizeof(a));
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x]=y;
        if(x==1)
        {
            b[k]=y;
            k++;
        }
    }
    for(i=0;i<k;i++)
    {
        if(a[b[i]]==n)
        {
            cnt=1;
            break;
        }
    }
    if(cnt==1)
        cout<<"POSSIBLE"<<endl;
    else
        cout<<"IMPOSSIBLE"<<endl;


}


Measured memory_bytes: 6676
import java.io.*;
import java.util.Arrays;

public class Main {

    public static void main(String[] args) throws IOException  {
        
        BufferedReader reader =
            new BufferedReader(new InputStreamReader(System.in));
 
        String[] line = reader.readLine().split(" ");
        int a = 0;
        int[] list;
        list = new int[3];
        
        for(int i = 0; i < 3; i++) {           
            list[i] = Integer.parseInt(line[i]);
        }
        
        Arrays.sort(list);
        
        System.out.println(list[0]+" "+list[1]+" "+list[2]);
        
        
    }
    
}

Measured memory_bytes: 24320
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>
#include <tuple>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;

int main(int argc, char *argv[])
{
	int i, n;
	string tmp;
	unordered_map<string, int> input;
	vector<string> candidate;
	int candidate_num = 1;
	
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> tmp;
		if (input.find(tmp) == input.end())
			input[tmp] = 1;
		else
			input[tmp]++;
	}

	for (auto itr = input.begin(); itr != input.end(); itr++) {
		if (itr->second == candidate_num)
			candidate.push_back(itr->first);
		else if (itr->second > candidate_num) {
			candidate.erase(candidate.begin(), candidate.end());
			candidate.push_back(itr->first);
			candidate_num = itr->second;
		}
	}

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

	for (i = 0; i < candidate.size(); i++) 
		cout << candidate[i] << endl;

	return 0;
}


Measured memory_bytes: 26692
# B - Foods Loved by Everyone

N, M = map(int, input().split())
F = [0] * (M+1)

for i in range(N):
    KA = list(int(x) for x in input().split())
    for j in range(1, len(KA)):
        F[KA[j]] += 1

print(F.count(N))

Measured memory_bytes: 3060
#include <stdio.h>
int main(){
    int n,a[100],ans=1,min=1;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        ans*=3;
        if(a[i]%2==0)min*=2;
    }
    printf("%d\n",ans-min);
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<numeric>

typedef long long LL;

using namespace std;

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define dbg(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;

int n,m,q;
int clr[111111];
int lst[111111];
vector<int> g[111111];

void dfs(int v,int d,int c){
  if(!clr[v])clr[v]=c;
  if(lst[v]>=d)return;
  lst[v]=d;
  if(d==0)return;
  for(int u:g[v])dfs(u,d-1,c);
}

int main(){
  cin>>n>>m;
  for(int i=0;i<m;++i){
    int a,b;
    cin>>a>>b;
    --a,--b;
    g[a].pb(b);
    g[b].pb(a);
  }
  
  cin>>q;
  vector<tuple<int,int,int> > vv;
  for(int i=0;i<q;++i){
    int v,d,c;
    cin>>v>>d>>c;
    v--;
    vv.pb(make_tuple(v,d,c));
  }
  
  reverse(all(vv));
  for(int i=0;i<q;++i){
    int v,d,c;
    tie(v,d,c)=vv[i];
    dfs(v,d,c);
  }

  for(int i=0;i<n;++i){
    cout<<clr[i]<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 9072
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	vector<int> d(6);

	for (int i = 0; i < d.size(); ++i)
		cin >> skipws >> d[i];

	string s;
	cin >> s;

	for (int i = 0; i < s.size(); ++i)
		switch (s[i])
		{
		case 'N': swap(d[0], d[4]); swap(d[0], d[1]); swap(d[1], d[5]); break;
		case 'E': swap(d[0], d[3]); swap(d[3], d[5]); swap(d[5], d[2]); break;
		case 'S': swap(d[0], d[1]); swap(d[0], d[4]); swap(d[4], d[5]); break;
		case 'W': swap(d[0], d[2]); swap(d[2], d[5]); swap(d[5], d[3]); break;
		}

	cout << d[0] << endl;

	return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);

int n, k;
const int maxn = 2005;
int total;
bool bad[4 * maxn];
int d[4 * maxn][maxn];
bool used[maxn][2];
int fact[maxn];
const int mod = 924844033;

void addTo(int &a, int b) {
    a += b;
    if (a >= mod)
        a -= mod;
}

int mul(ll a, ll b) {
    return (a * b) % mod;
}

int main() {
    #ifdef LOCAL
    assert(freopen("d.in", "r", stdin));
    #else
    #endif
    fact[0] = 1;
    for (int i = 1; i < maxn; ++i)
        fact[i] = mul(fact[i - 1], i);
    cin >> n >> k;
    forn (i, n) {
        forn (j, 2) {
            if (used[i][j])
                continue;
            int x = i, y = j;
            int len = 0;
            while (x < n) {
                used[x][y] = true;
                ++len;
                y ^= 1;
                x += k;
            }
            --len;
            total += len;
            bad[total++] = true;
        }
    }
    d[0][0] = 1;
    forn (i, total)
        forn (j, n + 1) {
            if (d[i][j] == 0)
                continue;
            addTo(d[i + 1][j], d[i][j]);
            if (!bad[i])
                addTo(d[i + 2][j + 1], d[i][j]);
        }
    int ans = 0;
    forn (x, n + 1) {
        int res = 0;
        addTo(res, d[total][x]);
        addTo(res, d[total + 1][x]);
        //cerr << x << ' ' << res << '\n';
        res = mul(res, fact[n - x]);
        if (x % 2)
            res = (mod - res) % mod;
        addTo(ans, res);
    }
    cout << ans << '\n';
}

Measured memory_bytes: 27904
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int N;
  cin>>N;
  vi A(N);
  rep(i,0,N) cin>>A[i];
  sort(ALL(A));
  cout<<A[N-1]-A[0];
  }


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

int main()
{
	int a, b;
	cin >> a >> b;
	int n = 0;
	while (true)
	{
		n++;
		if ((a - 1) * (n - 1) + a >= b)
			break;
	}
	if (b == 1) {
		cout << 0 << endl;
	}
	else
	{
		cout << n << endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define ARRAY_LENGTH( array ) ( sizeof( array ) / sizeof( array[ 0 ] ))

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

int main( void ){
	ll N;
	cin >> N;
	if (N % 2 == 1){
		cout << 0 << endl;
		return 0;
	}
	ll ans = 0;
	ll cnt = 5;
	while(N >= cnt ){
		ans += ( ll )( N / ( cnt << 1 ));
		cnt *= 5;
	}
	cout << ans << endl;

}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}


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

int main()
{
    int N,X,A[110],sum=0,mi=1100,ans;
    cin >> N >> X;
    for(int i=0; i<N; i++){
        cin >> A[i];
        sum += A[i];
        mi = min(A[i],mi);
    }
    ans = N;
    X -= sum;
    ans += X/mi;
    cout << ans << endl;
    return 0;
}


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

class op
{
    public:
        int ci, cj, ni, nj;
        op (int a, int b, int c, int d) { 
            ci = a;
            cj = b;
            ni = c;
            nj = d;
        }
};

int main()
{
    int H, W;
    int a[501][501];
    std::cin >> H >> W;
        for (int i = 1; i <= H; i++) {
        for (int j = 1; j <= W; j++) {
            std::cin >> a[i][j];
        }
    }

    std::vector< op > ans;
    for (int i = 1; i <= H; i++) {
        for (int j = 1; j < W; j++) {
            if (a[i][j] % 2 == 1) {
                ans.push_back(op(i, j, i, j + 1));
                a[i][j + 1]++;
            }
        }
    }
    for (int i = 1; i < H; i++) {
        if (a[i][W] % 2 == 1) {
            ans.push_back(op(i, W, i + 1, W));
            a[i + 1][W]++;
        }
    }

    std::cout << ans.size() << std::endl;
    for (int k = 0; k < ans.size(); k++) {
        std::cout << ans[k].ci << " "
                  << ans[k].cj << " "
                  << ans[k].ni << " "
                  << ans[k].nj << std::endl;
    }
}

Measured memory_bytes: 5232
<?php 

$input = trim(fgets(STDIN));

$prev = $input[0];
$count = 0;
$max_count =  0;
for ( $i = 0; $i < 4 ; $i++ )  {
   if ($prev === $input[$i]) {
      $count += 1;
      if ($max_count < $count ) $max_count = $count;
 }
  else 
    $count = 1;
  $prev = $input[$i];
}
echo ($max_count>=3)?"Yes":"No";

?>

Measured memory_bytes: 3700
#include<bits/stdc++.h>
#define N 1<<18
#define p 998244353
#define ll long long
using namespace std;

int n,m,a[N],b[N],S;

inline int read()
{
	int ans=0,f=1;char c=getchar();
	while(c>'9'||c<'0') {if(c=='-') f=-1;c=getchar();}
	while(c>='0'&&c<='9') ans=(ans<<1)+(ans<<3)+(c^48),c=getchar();
	return ans*f;
}

inline int add(int x,int y){return x+y<p?x+y:x+y-p;}

inline int mul(int a,int b)
{
	int ans=1;
	while(b)
	{
		if(b&1) ans=(ll)ans*a%p;
		a=(ll)a*a%p;
		b>>=1;
	}
	return ans;
}

inline void fwt(int a[],int n,int dft)
{
	for(int stp=1;stp<n;stp<<=1)
		for(int i=0;i<n;i+=(stp<<1))
			for(int j=i;j<i+stp;++j)
			{
				int x=a[j],y=a[j+stp];
				a[j]=add(x,y),a[j+stp]=add(x,p-y);
			}
	if(dft==-1)
	{
		int inv=mul(n,p-2);
		for(int i=0;i<n;++i) a[i]=(ll)a[i]*inv%p;
	}
}

int main()
{
	n=read();n=1<<n;
	for(int i=0;i<n;++i) a[i]=read(),S+=a[i];
	S=mul(S,p-2);
	for(int i=0;i<n;++i) a[i]=(ll)a[i]*S%p;
	a[0]--;
	b[0]=n-1;
	for(int i=1;i<n;++i) b[i]=p-1;
	fwt(a,n,1),fwt(b,n,1);
//	for(int i=0;i<n;++i) printf("%d ",a[i]);
	for(int i=1;i<n;++i) a[i]=(ll)b[i]*mul(a[i],p-2)%p;
	fwt(a,n,-1);
	int val=(ll)(p-a[0])*n%p;
	fwt(a,n,0);
	a[0]=val;
	fwt(a,n,-1);
	for(int i=0;i<n;++i) printf("%d\n",a[i]);
}


Measured memory_bytes: 4864
n=int(input())
a=list(map(int,input().split()))
from itertools import accumulate
from copy import copy
A=list(accumulate(a))
'''
if a[0]<0:
    temp=0
    count=0
    for i in range(1,n):
        if i%2==1:
'''
def seq(xc:list):
    x=copy(xc)
    n=len(x)
    temp1=0
    count1=0
    for i in range(n):
        x[i]+=temp1
        if i%2==1:
            if x[i]<=0:
                count1+=(1-x[i])
                temp1+=(1-x[i])
        else:
            if x[i]>=0:
                count1+=(x[i]+1)
                temp1-=(x[i]+1)
    temp2=0
    count2=0
    for j in range(n):
        xc[j]+=temp2
        if j%2==1:
            if xc[j]>=0:
                count2+=(xc[j]+1)
                temp2-=(xc[j]+1)
        else:
            if xc[j]<=0:
                count2+=(1-xc[j])
                temp2+=(1-xc[j])
    
    return min(count1,count2)
    

print(seq(A))


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

int main()
{
  ll N, M;
  cin >> N >> M;
  ll lcm = 1;
  ll gcd = 0;
  rep(i, N)
  {
    ll now;
    cin >> now;
    now /= 2;
    lcm = now * lcm / __gcd(now, lcm);
    gcd = __gcd(now, gcd);
  }
  if (lcm / gcd % 2 == 0)
  {
    cout << 0 << endl;
  }
  else
  {
    cout << M / lcm - M / (2 * lcm) << endl;
  }
}

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

#define For(i, l, r) for(register int i = (l), i##end = (int)(r); i <= i##end; ++i)
#define Fordown(i, r, l) for(register int i = (r), i##end = (int)(l); i >= i##end; --i)
#define Set(a, v) memset(a, v, sizeof(a))
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define debug(x) cout << #x << ": " << x << endl
#define DEBUG(...) fprintf(stderr, __VA_ARGS__)

using namespace std;

inline bool chkmin(int &a, int b) {return b < a ? a = b, 1 : 0;}
inline bool chkmax(int &a, int b) {return b > a ? a = b, 1 : 0;}

namespace pb_ds
{   
	namespace io
	{
		const int MaxBuff = 1 << 16;
		const int Output = 1 << 22;
		char B[MaxBuff], *S = B, *T = B;
#define getc() ((S == T) && (T = (S = B) + fread(B, 1, MaxBuff, stdin), S == T) ? 0 : *S++)
		char Out[Output], *iter = Out;
		inline void flush()
		{
			fwrite(Out, 1, iter - Out, stdout);
			iter = Out;
		}
	}

	template<class Type> inline Type read()
	{
		using namespace io;
		register char ch; register Type ans = 0; register bool neg = 0;
		while(ch = getc(), (ch < '0' || ch > '9') && ch != '-')     ;
		ch == '-' ? neg = 1 : ans = ch - '0';
		while(ch = getc(), '0' <= ch && ch <= '9') ans = ans * 10 + ch - '0';
		return neg ? -ans : ans;
	}
}

using namespace pb_ds;

void File() {
#ifdef zjp_shadow
	freopen ("D.in", "r", stdin);
	freopen ("D.out", "w", stdout);
#endif
}

const int N = 1e5 + 1e3, inf = 0x7f7f7f7f;
int n, m, val[N], minp[N], lis[N], id[N], Size; bool used[N];

int fa[N];
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }

inline bool Cmp(const int &a, const int &b) { return val[a] < val[b]; }

long long ans = 0;

int main () {

	File();

	n = read<int>(); m = read<int>(); For (i, 1, n) val[i] = read<int>(), fa[i] = i;
	For (i, 1, m) { int u = read<int>() + 1, v = read<int>() + 1; fa[find(u)] = find(v); }

	val[0] = inf;
	For (i, 1, n) {
		int rt = find(i); if (!id[rt]) id[rt] = ++ Size; rt = id[rt];
		if (val[i] < val[minp[rt]]) minp[rt] = i;
	}
	int need = 2 * (Size - 1);
	if (!need) return puts("0"), 0;
	if (need > n) return puts("Impossible"), 0;

	For (i, 1, Size) ans += val[minp[i]], used[minp[i]] = true;
	need -= Size; Size = 0;

	For (i, 1, n) if (!used[i]) lis[++ Size] = i;
	sort(lis + 1, lis + Size + 1, Cmp);
	For (i, 1, need) ans += val[lis[i]];

	printf ("%lld\n", ans);

	return 0;
}


Measured memory_bytes: 3968
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<string>
using namespace std;
#define dint __int128
#define gc getchar()
#define fup(i,a,b) for(int i=a;i<b;++i)
#define upf(i,a,b) for(int i=a;i<=b;++i)
#define dnf(i,a,b) for(int i=a;i>=b;--i)
#define mem(a,b) memset(a,b,sizeof(a))
#define kk putchar(32)
#define hh putchar(10)
#define ll long long
struct in {template<typename T>inline in operator >> (T &x){
T f=1;char a;while((a=gc)<48||a>57)if(a==45)f=-1;
for(x=a^48;(a=gc)>47&&a<58;x=(x<<3)+(x<<1)+(a^48));x*=f;}}qin;
struct nnn{int x,y,z;};
void Main();

//void Main()
//{
//    int n;
//    cin>>n;
//    while(n--)
//    {
//
//    }
//}
int main()
{
    Main();
    return 0;
}

void Main()
{
    int a[5],ans=0;
    fup(i,0,3)cin>>a[i];
    sort(a,a+3);
    if(a[0]==a[1]&&a[1]==a[2]);
    else if(a[0]==a[1])ans=a[2]-a[0];
    else if(a[1]==a[2]){
        int n=a[2]-a[0];ans+=n>>1;
        if(n&1)ans+=2;
    }
    else{
        int m=a[2]-a[1];ans+=m;
        int n=a[2]-a[0]-m;ans+=n>>1;
        if(n&1)ans+=2;
    }
    cout<<ans;
}


Measured memory_bytes: 256
fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val numbers = readLine()!!.split(" ").map { it.toInt() }
    var min = numbers.first()
    var ans = 1
    for(i in (1 until numbers.size)) {
        if(numbers[i] < min) {
            ans++
            min = numbers[i]
        }
    }
    println(ans)
}

Measured memory_bytes: 82696