akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

ll X;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>X;
	ll ret=X/500*1000;
	X%=500;
	ret+=X/5*5;
	cout<<ret<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256
fun main(args : Array<String>) {
    val (N, A, B, C, D) = readLine()!!.split(" ").map { it.toInt() }
    val S = readLine()!!

    var a = A - 1
    var b = B - 1
    val shouldAPassOver = D < C

    while (true) {
        if (a == (C -1) && b == (D - 1)) {
            println("Yes")
            return
        }
        val canAMove1 = if (a + 1 >= N) false else S[a + 1] == '.'
        val canAMove2 = if (a + 2 >= N) false else S[a + 2] == '.'
        val canBMove1 = if (b + 1 >= N) false else S[b + 1] == '.'
        val canBMove2 = if (b + 2 >= N) false else S[b + 2] == '.'

        // Anyone can't move
        if (!(canAMove1 || canAMove2 || canBMove1 || canBMove2)) {
            println("No")
            return
        }

        if (shouldAPassOver) {
            if (canAMove1 && a + 1 != b) {
                a += 1
            } else if (canAMove2 && a + 2 !=b ) {
                a += 2
            } else if (canBMove1) {
                b += 1
            } else {
                b += 2
            }
        } else {
            // Move B first
            if (canBMove1) {
                b += 1
            } else if (canBMove2) {
                b += 2
            } else if (canAMove1) {
                a += 1
            } else if (canAMove2) {
                a += 2
            }
        }
    }
}

Measured memory_bytes: 41480
#include <iostream>

using namespace std;

void solve()
{
	int sum = 0;
	for(int i = 0; i < 4; ++i)
	{
		int temp;
		cin >> temp;
		sum += temp;
	}
	cout << sum / 60 << endl;
	sum %= 60;
	cout << sum << endl;
}

int main()
{
	solve();
	return(0);
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main{
    public static void main(String[] args) { 
        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt(); 
            int n = sc.nextInt(); 
            int[] values = new int[w]; 
            for (int i = 0; i < values.length; i++) { 
                values[i] = i + 1; 
            } 
            for (int i = 0; i < n; i++) { 
                String str = sc.next(); String[] ab = str.split(","); 
                int a = Integer.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1;
                int c = values[a];
                values[a] = values[b];
                values[b] = c;
            } 
            for (int i = 0; i < values.length; i++) { 
                System.out.println(values[i]);
            }
        }
    }
}


Measured memory_bytes: 26164
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <utility>
#include <vector>


using namespace std;

int main(){

	long long N, ans;

	cin >> N;

	if(N % 2 == 0){
		ans = N;
} else {
		ans = N * 2;
}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cstring>
//#define Mfc_Tanzim
#define ll long long
#define ull unsigned long long
#define pb push_back
#define ff first
#define ss second
#define all(v) (v.begin(), v.end())
#define pi acos(-1.0)
#define FastRead ios_base::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define bug(a) cerr << #a << " : " << a << endl
#define pq dp
using namespace std;
const ll mx = 4444444444;

ll posx[] = {1,-1, 0, 0};
ll posy[] = {0, 0, 1,-1};
vector<ll>v, v2;
ll ret = INT_MIN;
bool vis[123456];

void check(int n, int k)
{
    vector<ll>res;
    ll r = 0, ans = INT_MIN;
    memset(vis, false, sizeof(vis));
    while(!vis[n-1]){
                    r+=v2[n-1];
                    vis[n-1] = true;
                    res.pb(v2[n-1]);
                    n = v[n-1];
    }
    for(int i=0; i<res.size(); i++){
                    if(i){
                           res[i]+=res[i-1];
                    }
                    if(i+1<=k){
                           ans = max(ans, res[i]);
                    }
                    else{
                           break;
                    }
                    if(r){
                           ll kk = res[i]+((k-i-1)/res.size())*r;
                           ans = max(ans, kk);
                    }
    }
    ret = max(ret, ans);
}

int main()
{
    FastRead

#ifdef Mfc_Tanzim
    freopen("input.txt","r", stdin);
    // freopen("output.txt","w", stdout);
#endif /// Mfc_Tanzim

    int t=1, n, k, m, a, b, c, d;
    //cin >> t;

    while(t--){
              cin >> n >> k;
              v.resize(n);
              v2.resize(n);
              for(auto &i: v){
                       cin >> i;
              }
              for(auto &i: v2){
                       cin >> i;
              }
              ll nn = n;
              for(int j=0; j<nn; j++){
                       n = j+1;
                       check(j+1, k);
              }
              cout << ret << endl;
    }
    return 0;
}





Measured memory_bytes: 3960
/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.09.13 21:00:35
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int x;cin >> x;
    cout << 1 - x << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl

using namespace std;
using ll = long long;
ll MOD = 998244353;

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

  vector<int> l(k, 0), r(k, 0);
  rep(i, k) cin >> l[i] >> r[i];
  vector<ll> dp(n, 0), sdp(n + 1, 0);

  dp[0] = 1;
  sdp[1] = 1;

  for (int i = 1; i < n; ++i) {
    rep(j, k) {
      int left = max(0, i - r[j]);
      int right = max(0, i - l[j] + 1);
      ll val = sdp[right] - sdp[left];
      if (val < 0) val += MOD;
      dp[i] += val % MOD;
      dp[i] %= MOD;
    }
    sdp[i + 1] = (sdp[i] + dp[i]) % MOD;
  }

  cout << (dp[n - 1] % MOD) << endl;
}


Measured memory_bytes: 6440
from sys import exit
from itertools import accumulate,chain
n,*s=open(0).read().split()
t=list(map(lambda x:2*x.count("(")-len(x),s))
if sum(t)!=0:
    print("No")
    exit()
#pypyではinitialだめ
st=[[t_,min(accumulate(s_,lambda a,b: a+(1 if b=="(" else -1),initial=0))] for s_,t_ in zip(s,t)]

now=sum(map(lambda x:x[0],filter(lambda x:x[1]>=0,st)))
v=list(filter(lambda x:x[1]<0 and x[0]>=0,st))
w=list(filter(lambda x:x[1]<0 and x[0]<0,st))
v.sort(reverse=True,key=lambda z:z[1])
w.sort(key=lambda z:z[0]-z[1],reverse=True)

for sub in chain(v,w):
    if now+sub[1]<0:
        print("No");exit()
    now+=sub[0]
print("Yes")


Measured memory_bytes: 119696
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
a.sort!

isSame = false
(n-1).times do |i|
  if a[i] == a[i+1]
    isSame = true
    break
  end
end

puts isSame ? 'NO' : 'YES'

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

/* using */
using namespace std;

/* main constructor */
struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(0);
        //cout << fixed << setprecision(12);
    }
} fast;

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

/* define */
#define REP(i, x, n) for (int i = x; i < (int)(n); ++i)
#define RREP(i, x, n) for (int i = x - 1; i >= (int)(n); --i)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) REP(i, 1, n + 1)
#define rrep(i, n) RREP(i, n, 0)
#define each(i, n) for (auto &i : n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define eunique(x) \
    sort(all(x));  \
    (x).erase(unique(all(x)), (x).end())
#define int long long
#define mp make_pair
#define r0 return 0

/* function */
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }

/* const */
const int inf = 1e9 + 7;
const int dxl[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dyl[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dxs[4] = {1, 0, -1, 0};
const int dys[4] = {0, 1, 0, -1};

/* main */
signed main(void)
{
    int n;
    cin>>n;
    cout << 180 * (n - 2) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[1] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

vector<int>  v[100000];
char vi[100000];

void go(int o) {
    vi[o]++;
    for (int i : v[o]) {
        if (vi[i]) continue;
        go(i);
    }
}

int main() {
    int n,m;
    scanf("%d %d", &n, &m);

    for (int i = 0; i < m; i++) {
        int a,b;
        scanf("%d %d", &a, &b);
        a--; b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }

    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (!vi[i]) go(i), cnt++;
    }
    printf("%d", cnt - 1);
}


// author: rdd6584


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

int main() {
    int n, m;
    cin >> n >> m;
    priority_queue<int> q;
    rep(i, n) {
        int a;
        cin >> a;
        q.push(a);
    }

    rep(i, m) {
        int x = q.top(); q.pop();
        x /= 2;
        q.push(x);
    }

    ll sum = 0;
    while(!q.empty()) {
        sum += q.top(); q.pop();
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 892
#include<bits/stdc++.h>
#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define per(i,n,j) for(int i=(n)-1;i>=(j);i--)
using ll=long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF=1LL<<60;

int h,w;
vector<vector<char>> a(110,vector<char>(110));

int main(){
    cin>>h>>w;
    rep(i,0,h) rep(j,0,w) cin>>a[i][j];

    rep(i,0,h){
        int cnt=0;
        rep(j,0,w){
            if(a[i][j]=='.') cnt++;
        }
        if(cnt==w){
            rep(j,0,w) a[i][j]='F';
        }
    }

    rep(i,0,w){
        int cnt=0;
        rep(j,0,h){
            if(a[j][i]=='.' || a[j][i]=='F') cnt++;
        }
        if(cnt==h){
            rep(j,0,h) a[j][i]='F';
        }
    }

    rep(i,0,h){
        int cnt=0;
        rep(j,0,w){
            if(a[i][j]!='F') cout<<a[i][j];
            else cnt++;
        }
        if(cnt!=w) cout<<"\n";
    }
    return 0;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int N;
int A[100001];
int num[100001]={0};

int main()
{
	scanf("%d", &N);
	for (int i = 1; i <= N; ++i) scanf("%d", A + i);

	for (int i = 1; i <= N; ++i){
		num[A[i]]++;
	}

	int num_val = 0;
	int num_even = 0;
	for (int i = 1; i <= 100000; ++i){
		if( num[i] ){
			while( num[i] >= 3 ){
				num[i] -= 2;
			}
			num_val++;
			if( num[i] == 2 ) num_even++;
		}
	}

	printf("%d\n", num_val - (num_even%2) );

	return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <iterator>

using namespace std;

#if 1
#define PRINT(x) { cout << #x << ": " << (x) << endl; }
#define PRINT_CONTAINER(x)  { cout << #x << ": ";                       \
        for (size_t ix = 0; ix < (x).size(); ++ix) cout << (x)[ix] << ", "; \
        cout << endl; }
#else
#define PRINT(x)
#define PRINT_CONTAINER(x)
#endif

int main(int argc, char *argv[])
{
    int n, a, b;
    scanf("%d %d %d", &n, &a, &b);
    int d = a - b;
    if (d % 2 == 0)
    {
        puts("Alice");
    }
    else
    {
        puts("Borys");
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const ll MOD = 1000000007;

int main() {
    int N, cnt = 0;
    cin >> N;
    FOR(i, 1, N+1) {
        if (to_string(i).length() % 2 == 1)
            cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>

#define MOD 1000000007
#define INF INT_MAX
#define NINF INT_MIN
#define LLINF LLONG_MAX
using ll = long long;
using namespace std;


int main() {
    int a, b, c, d, e, k;
    cin >> a >> b >> c >> d >> e >> k;
    if (e - a > k) {
        cout << ":(" << endl;
    }
    else {
        cout << "Yay!" << endl;
    }
    getchar(); getchar();
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int n;
    scanf("%d", &n);
    int a[n];
    for(int i = 0;i < n; i++) scanf("%d", &a[i]);
    int cnt = 0;
    for(int i = 0; i < n; i++){
        for(int j = n-1; j > i; j--){
            if(a[j] < a[j-1]){
                int temp = a[j];
                a[j] = a[j-1];
                a[j-1] = temp;
                cnt++;
            }
        }
    }

    for(int i = 0; i < n; i++){
        if(i == n-1) printf("%d\n", a[i]);
        else printf("%d ", a[i]);
    }
    printf("%d\n", cnt);
    return 0;
}


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

using namespace std;
typedef pair<int, int> P;
typedef long long int ll;
int main(){
  int n;cin>>n;
  map<int, int> mp;
  for(int i=0;i<n;i++){
    int a;cin>>a;
    mp[a]++;
  }
  // n&1:  0 2 2 4 4 ... n-1 n-1
  // else: 1 1 3 3 5 5 n-1 n-1
  bool possible=true;
  if(n&1){
    if((int)mp.size()!=(n+1)/2)possible=false;
    else{
      for(auto itr=mp.begin();itr!=mp.end();itr++){
      	if(!((itr->first==0 && itr->second==1)||
          (itr->first%2==0&&itr->first>=2&&itr->first<n&&itr->second==2)))
          possible=false;break;
      }
    }
  }else{
    if((int)mp.size()!=n/2)possible=false;
    else{
      for(auto itr=mp.begin();itr!=mp.end();itr++){
      	if(!((itr->first%2!=0&&itr->first>=1&&itr->first<n&&itr->second==2)))
          possible=false;break;
      }
    }
  }
  if(possible){
    ll ans=1;
  	for(int i=0;i<n/2;i++){
      ans=(ans*2)%ll(1e9+7);
    }
    cout<<ans<<endl;
  }else{
  	cout<<0<<endl;
  }
}


Measured memory_bytes: 3200
from sys import stdin

def main():

    input = stdin.readline

    K,N = map(int,input().split())

    A = list(map(int,input().split()))

    max_blank = 0

    for i in range(N-1):
        max_blank = max(max_blank,abs(A[i]-A[i+1]))
    
    max_blank = max(max_blank,abs(A[0] + abs(K - A[N-1])))

    print(K - max_blank)


if __name__ == "__main__":
    main()

Measured memory_bytes: 25884
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
template<class T>

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

vvi adl_input(int N,int M){ //N頂点M辺
  vvi L(N);
  rep(i,M){
    int a,b;
    cin >> a >> b;
    //a--;b--;
    L[a].push_back(b);
    L[b].push_back(a);
  }
  return L;
}

ll gcd(ll a,ll b){
  if (a%b==0) return(b);
  else return(gcd(b,a%b));
}
ll lcm(ll a,ll b){
  return a*b/gcd(a,b);
}

vector<int> bfs(vvi L,int S){ //List,Start
  vector<int> v(L.size(),-1);
  v[S]=0;
  queue<int> q;
  q.push(S);
  while(!q.empty()){
    int a=q.front();
    q.pop();
    for(int x:L[a]){
      if (v[x]==-1){
        v[x]=v[a]+1;
        q.push(x);
      }
    }
  }
  return v;//startからの距離
}

void initialize(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout << fixed << setprecision(15);
}

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

int main(){
  initialize();
  string S;
  cin >> S;
  bool f=true;
  rep(i,S.size()){
    if(i%2==0) if(S[i] == 'L') f=false;
    if(i%2==1) if(S[i] == 'R') f=false;
  }
  cout << (f?"Yes":"No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

#define INF 2000000000

void merge(int *,int,int,int);
void mergeSort(int *,int,int);

int count = 0;

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

  int i;
  int num;
  scanf("%d",&num);
  int S[num];

  for( i = 0 ; i < num ; i++ ){
    scanf("%d",&S[i]);
  }

  mergeSort(S,0,num);

  for( i = 0 ; i < num-1 ; i++ ){
    printf("%d ",S[i]);
  }
  printf("%d\n",S[i]);

  printf("%d\n",count);

  return 0;
}

void merge(int *A, int left, int mid, int right){

  int n1,n2;
  int i,j,k;

  n1 = mid - left;
  n2 = right - mid;
  int L[n1+1],R[n2+1];

  for( i = 0 ; i < n1 ; i++ ){
    L[i] = A[left+i];
  }

  for( i = 0 ; i < n2 ; i++ ){
    R[i] = A[mid+i];
  }

  L[n1] = INF;
  R[n2] = INF;

  i = 0;
  j = 0;

  for( k = left ; k < right ; k++ ){

    count++;

    if( L[i] <= R[j] ){
      A[k] = L[i];
      i++;
    }else{
      A[k] = R[j];
      j++;
    }
  }


}

void mergeSort(int *A, int left, int right){

  int mid;

  if( left+1 < right ){

    mid = (left+right)/2;
    mergeSort(A,left,mid);
    mergeSort(A,mid,right);
    merge(A,left,mid,right);

  }

}

Measured memory_bytes: 4504
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

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

    vector<int> a(n);
    rep(i, n) cin >> a[i];

    int s = 0;
    int x = 0;
    int r = 0;
    int ans = 0;
    for(int l = 0; l < n; l++){

        while(r < n && s + a[r] == (x xor a[r])){
            s += a[r];
            x ^= a[r];
            r++;
        }
        ans += r - l;
        s -= a[l];
        x ^= a[l];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<algorithm>
#include <stdio.h>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
  string s1,s2;
  cin >>s1>>s2;
  int i=0;
  while(s1[i]){
    if(s2[i]) cout<<s1[i]<<s2[i];
    else cout<<s1[i];
    i++;
  }
  cout<<endl;
}


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

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;
using P = pair<int64,int64>;
const int MOD = 1000000007;

void diviser(int64 n, map<int64,int64>& mp) {
    for (int64 i=2; i*i<=n; i++) {
        while (n % i == 0) n/=i, mp[i]++;
        mp[i] %= MOD;
    }
    if (n != 1) mp[n]++;
}

int main() {
    int64 n;
    cin >> n;
    map<int64,int64> mp;
    for (int64 i=2; i<=n; i++) diviser(i,mp);
    int64 ans = 1;
    for (auto p : mp) {
        ans *= (p.second + 1);
        ans %= MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 998244353 //1000000007 // //100000000
#define INF 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

ll dx[4] = {0, 0, 1, -1};
ll dy[4] = {1, -1, 0, 0};

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    map<string, ll> mp;
    ll n; cin >> n;
    char x = '.';
    rep(i, n)
    {
        string s;
        cin >> s;
        if(i == 0) mp[s]++, x = s[s.size()-1];
        else{
            if(mp[s] || s[0] != x) ANS("No");
            mp[s]++, x = s[s.size()-1];
        }
    }
    ANS("Yes");
}
main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
ans = 0
for i in range(1, N+1):
    for j in range(i, N+1, i):
        ans += j
print(ans)

Measured memory_bytes: 73336
END { load __FILE__ unless $stdin.eof? }

def cumsum(ary)
  y = 0
  ary.map { |x| y += x }.unshift(0)
end

x = 10**9 + 1

n, m, k = gets.split.map!(&:to_i)
a = cumsum(gets.split.map!(&:to_i) << x)
b = cumsum(gets.split.map!(&:to_i) << x)

imax = a.bsearch_index { |t| t > k } - 1
jmax = b.bsearch_index { |t| t > k } - 1
if imax > jmax
  imax, jmax = jmax, imax
  a, b = b, a
end
a = a.take(imax + 1)
b = b.take(jmax + 1) << x

p a.each_with_index.map { |t, i| kk = k - t; i + b.bsearch_index { |tt| tt > kk } - 1 }.max


Measured memory_bytes: 41012
#include <iostream>
#include <string>
using namespace std;
#define MAX 2000000
#define INFTY (1<<30)

int H, A[MAX];

void heapIncreaseKey(int key){
  int i, tmp;
  i = H;
  if(key < A[i]){
    cout << "ERROR: the new key is too small." << endl;
    return;
  }
  A[i] = key;
  while(i > 1 && A[i/2] < A[i]){
    tmp = A[i];
    A[i] = A[i/2];
    A[i/2] = tmp;
    i /= 2;
  }
}

void insert(int key){
  H++;
  A[H] = -1 * INFTY;
  heapIncreaseKey(key);
}

void maxHeapify(int i){
  int l, r, largest, tmp;
  l = i * 2;
  r = i * 2 + 1;

  // i番目のノードと左の子、右の子の中で最大のノードを選ぶ。
  if(H >= l && A[l] > A[i]) largest = l;
  else largest = i;
  if(H >= r && A[r] > A[largest]) largest = r;

  if(i != largest){
    tmp = A[i];
    A[i] = A[largest];
    A[largest] = tmp;
    maxHeapify(largest);
  }
}

int heapExtractMax(){
  if(H < 1){
    cout << "ERROR: Overflow." << endl;
    return -1 * INFTY;
  }

  int max = A[1];
  A[1] = A[H];
  H--;
  maxHeapify(1);

  return max;
}

int main(void){
  int key, max;
  string order;
  bool is_end = false;
  H = 0;

  while(!is_end){
    cin >> order;
    if(order == "end"){
      is_end = true;
    }else if(order == "extract"){
      max = heapExtractMax();
      cout << max << endl;
    }else if(order == "insert"){
      cin >> key;
      insert(key);
    }
  }

  return 0;
}



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

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n, ans = 0;
    cin >> n;
    int a[n], b[n], c[n - 1];
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    rep(i, n - 1) cin >> c[i];

    rep(i, n) {
        ans += b[a[i] - 1];
        if (i != 0 && a[i - 1] + 1 == a[i])
            ans += c[a[i] - 2];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws IOException {

        // long startTime = System.currentTimeMillis();

        Scanner scanner = new Scanner(System.in);

        int x = scanner.nextInt();

        scanner.close();

        System.out.println(calc(x));

        // System.out.println(System.currentTimeMillis() - startTime);
    }

    private static int calc(int x) {
        int s = (int) Math.sqrt(x);
        int max = 1;
        for (int i = 2; i <= s; i++) {
            int j = i;
            int k = 2;
            while (j <= x) {
                if (max < j) {
                    max = j;
                }
                j = (int) Math.pow(i, k);
                k++;
            }
        }

        return max;
    }
}


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

int main(){
  int n, s; cin >> n >> s;
  vector<int> a(n);
  vector<vector<ll>> dp(n, vector<ll>(3005));
  rep(i, n) cin >> a[i];
  
  dp[0][0] = 2; dp[0][a[0]] = 1;
  rep(i, n){
    if(i==0) continue;
    rep(j, s+1){
      if(j == 0){ dp[i][0] = dp[i-1][0] + 1; continue;}
      if( j >= a[i] ) dp[i][j] = (dp[i-1][j] + dp[i-1][j-a[i]]) %mod;
      else dp[i][j] = dp[i-1][j];
    }
  }
  
  ll ans = 0;
  rep(i, n) ans = (ans + dp[i][s]) %mod;
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 70912
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int n; cin >> n;
    rep(i, 100) {
        rep(j, 100) {
            if(4 * i + 7 * j == n) {
                cout << "Yes" << endl;
                return;
            }
        }
    }
    cout << "No" << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

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


    using namespace std;
    using ll = long long;
    using ull = unsigned long long;
    using pii = pair<int, int>;
    using pll = pair<ll, ll>;



    const int INF = 0x3f3f3f3f;
    const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
    const int NMAX = 1e5 + 5;
    const int MOD = 1e9 + 7;
    #define endl "\n"



    int main() {
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        int n,m,t;
        cin>>n>>m>>t;
        vector<ll> books1(n+1,0);
        vector<ll> books2(m+1,0);
        for (int i=1 ; i<=n ; ++i)
        {
            cin>>books1[i];
            books1[i]+=books1[i-1];
        }
        for (int i=1 ; i<=m ; ++i)
        {
            cin>>books2[i];
            books2[i]+=books2[i-1];
        }

        int range = m , ans = 0;
        for (int i = 0; i <=n; ++i)
        {
            if(books1[i]>t){break;}
            while(books2[range] > t-books1[i]){
                range--;
            }
            ans = max(ans,i+range);
        }
        cout<<ans;
        return 0;
    }


Measured memory_bytes: 6332
#include <bits/stdc++.h>
 #define int long long
using namespace std;
 
signed main() {
    int n;
    set <int> s;
    cin >>n;
    // long long a[n];
    int i,flag=0;
    for(i=0;i<n;i++)
    {
        cin>>flag;
        s.insert(flag);
    }
    if(s.size()==n) cout<<"YES";
    else cout<<"NO";
    return 0;
}

Measured memory_bytes: 9600
def convex(Pset):
    v1=[Pset[1][0]-Pset[0][0],Pset[1][1]-Pset[0][1]]
    v2=[Pset[2][0]-Pset[1][0],Pset[2][1]-Pset[1][1]]
    v3=[Pset[2][0]-Pset[0][0],Pset[2][1]-Pset[0][1]]
    c= v1[0]*v2[1]-v1[1]*v2[0]
    return c

def area(Pset):
    v1=[Pset[1][0]-Pset[0][0],Pset[1][1]-Pset[0][1]]
    v2=[Pset[2][0]-Pset[1][0],Pset[2][1]-Pset[1][1]]
    v3=[Pset[2][0]-Pset[0][0],Pset[2][1]-Pset[0][1]]
    return abs(v1[0]*v3[1]-v1[1]*v3[0])/2.

def nopoints(Pset,P):
    v1=[Pset[1][0]-Pset[0][0],Pset[1][1]-Pset[0][1]]
    v2=[Pset[2][0]-Pset[1][0],Pset[2][1]-Pset[1][1]]
    v3=[Pset[2][0]-Pset[0][0],Pset[2][1]-Pset[0][1]]
    CPv=[ [p[0]-Pset[0][0],p[1]-Pset[0][1]] for p in P if p not in Pset]
    #print CPv
    for pv in CPv:
        rdet=1./(v1[0]*v3[1] - v1[1]*v3[0])
        t1=rdet*( v3[1]*pv[0]-v3[0]*pv[1])
        t2=rdet*(-v1[1]*pv[0]+v1[0]*pv[1])
        #print pv, v1, v3, t1,t2
        if (t1>=0 and t2>=0 and t1+t2<=1 ):
            return 0
            break
    return 1

an=1
while(1):
    n=int(raw_input())
    if n==0:        break
    P=[]
    for i in range(n):
        P.append([int(x) for x in raw_input().split()])
    ans=0
    while(len(P)>=3):
        for i in range(len(P)-2):
            Pset=P[i:i+3]
            c= convex(Pset)
            if c<=0:
                if c==0:
                    del P[i+1]
                    break
                elif nopoints(Pset,P[:]):
                    ans+=area(Pset)
                    del P[i+1]
                    break
        else:
            print 'err',P
            break
    print an, ans
    raw_input()
    an+=1
    

Measured memory_bytes: 6440
/*      ░░█ ▄▀█ █   █▀ █░█ █▀█ █▀▀ █▀▀   █▀█ ▄▀█ █▀▄▀█  
        █▄█ █▀█ █   ▄█ █▀█ █▀▄ ██▄ ██▄   █▀▄ █▀█ █░▀░█     */

// Author : Udit "luctivud" Gupta @ (https://www.linkedin.com/in/udit-gupta-1b7863135/)


#include <bits/stdc++.h>
#pragma GCC optimize "trapv"

using namespace std;

typedef long long int lld;
typedef unsigned long long int llu;


#define       TESTCASES()  cin >> (T3X0); T353 = T3X0; while(T3X0--)
#define       _input(V3C)  for(auto &V3C_I7 : (V3C)) cin >> (V3C_I7)
#define mems(A77AY, V4LU)  memset((A77AY), (V4LU), sizeof((A77AY)))
#define  CH3K(I7, E4, S7)  (((S7)<0) ? (I7)>(E4) : (I7)<(E4))
#define for4(I7,S4,E4,S7)  for(auto I7=(S4); CH3K(I7,E4,S7); (I7)+=(S7))




void solveEachTest(lld T35TC453N = 1) {
    
    lld n; cin >> n;

    lld mod = (lld) 1e9 + 7ll;

    lld ans = 1ll;

    for4 (i, 1ll, n+1ll, 1ll) {
    	ans = ((ans % mod) * (i % mod)) % mod;
    }

    cout << ans;

    cout << "\n"; 

    return;
}


signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);

    lld T3X0 = 0, T353 = 1;

    // TESTCASES() 
        solveEachTest(T353 - T3X0);
    return 0;
}
// Random Thought :  null  

Measured memory_bytes: 3548
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>
#include<limits>
#include<iterator>

#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ll, char> plc;

int main()
{
	int n, m;
	cin >> n >> m;
	cout << (n - 1)*(m - 1) << endl;
	return 0;
}

Measured memory_bytes: 256
n=int(input())
h=list(map(int,input().split()))
c=[0,abs(h[1]-h[0])]
for i in range(2,n):
  c.append(min(c[i-1]+abs(h[i]-h[i-1]),c[i-2]+abs(h[i]-h[i-2])))
print(c[-1])

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

int main() {
  int n;

  while (cin >> n, n) {
    int ans = 0;

    for (int i = 0; i <= n; ++i) {
      for (int j = i + 2; j <= n; ++j) {
        if (j * (j + 1) / 2 - i * (i + 1) / 2 == n) ans++;
      }
    }

    cout << ans << endl;
  }
}

Measured memory_bytes: 3028
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int Mod = 1000000007;
class mll {
public:
	long long x;
	mll(long long x = 0) : x((x% Mod + Mod) % Mod) {};
	void operator += (const mll& a) {
		if ((x += a.x) >= Mod) x -= Mod;
	}
	void operator -= (const mll& a) {
		if ((x += Mod - a.x) >= Mod) x -= Mod;
	}
	void operator *= (const mll& a) {
		(x *= a.x) %= Mod;
	}
	mll operator * (const mll& a) const {
		mll ans = *this;
		ans *= a;
		return ans;
	}
	mll inv() {
		long long a = x, b = Mod, u = 1, v = 0;
		while (b) {
			long long t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		u %= Mod;
		if (u < 0) u += Mod;
		a = u;
		return mll(a);
	}
};

int main() {
	int N, K;
	cin >> N >> K;
	vector<int> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(A.begin(), A.end());
	vector<mll> NCKm1(N + 1, 1ll);
	if (K - 1 > 0) {
		for (int i = K; i <= N; i++) {
			NCKm1[i] = NCKm1[i - 1] * i;
			mll bmb = (long long)i - K + 1;
			NCKm1[i] *= bmb.inv();
		}
	}
	mll ans = 0;
	for (int i = 0; i < N; i++) {
		if (i + K - 1 < N) ans -= NCKm1[N - i - 1] * A[i];
		if (i - K + 1 >= 0) ans += NCKm1[i] * A[i];
	}
	cout << ans.x << endl;
}


Measured memory_bytes: 4496
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

int dp[110][4][2];
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

    string s;
    cin>>s;
	int n=s.size(),m;
    cin>>m;
    dp[0][0][0]=1;
    rep(i,n)rep(j,m+1)rep(k,2)rep(x,10){
        if(!k&&s[i]-'0'<x)break;
        int I=i+1,J=j+!!x,K=k|(x<s[i]-'0');
        if(J>m)break;
        dp[I][J][K]+=dp[i][j][k];
    }
    cout<<dp[n][m][0]+dp[n][m][1]<<endl;
}


Measured memory_bytes: 256
#include<iostream>
//#include<algorithm>
//#include<cmath>
//#include<string>
//#include<cctype>
//#include <vector>
using namespace std;
int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}
int main(){
	int a, b;
	while (cin>>a>>b){
		int c = gcd(a, b);
		cout << c << " " << a / c*b << endl;
	}
	return 0;
}

Measured memory_bytes: 2932
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N=2e5+10;
const int B=316;
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;
}
void print(LL x){
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
int n;
LL ans=0;
int a[N];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;++i) {
		scanf("%d",&a[i]);
		if(i>1&&a[i]<a[i-1]){
			ans+=(LL)(a[i-1]-a[i]);
			a[i]=a[i-1];
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 4428
#include  <stdio.h>

int main(void)
{
	int x,i;
	
	for(i=1;1;i++)
	{
		scanf("%d",&x);
		if(x==0)
		{
			break;
		}
		printf("Case %d: %d\n",i,x);
	}
	return  0;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
int main(){
	int ones = 0;
	string str;
	cin >> str;
	if(str.at(0) == '1') ++ones;
	if(str.at(1) == '1') ++ones;
	if(str.at(2) == '1') ++ones;
	cout << ones <<	endl;
}


Measured memory_bytes: 256
// khodaya khodet komak kon
#include <bits/stdc++.h>
#define pb push_back
#define ers erase
#define ins insert
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x)  cerr << #x << " = " << x << endl
#define kill(x) return cout << x, 0;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#pragma GCC optimize ("Ofast")
using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pll> vpl;

const ld Pi = 3.14159265359;
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll N = 2e5 + 10;
const ll INF = 1e18;
const ll LOG = 20;

bool f1, f2;
str s;

int main(){
	IOS;
	cin >> s;
	ll num = 0, num1 = 0;
	for (int i = 0; i < 2; i++){
		num = num * 10 + (s[i] - '0');
	}
	for (int i = 2; i < 4; i++){
		num1 = num1 * 10 + (s[i] - '0');
	}
	if (num <= 12 && num > 0) f1 = 1;
	if (num1 <= 12 && num1 > 0) f2 = 1;
	if (f1 && f2) kill("AMBIGUOUS");
	if (f1) kill("MMYY");
	if (f2) kill("YYMM");
	kill("NA"); 
	
	return 0;
}






/*
     ,---,           ___                 ,--,
    '  .' \        ,--.'|_             ,--.'|                             ,--,
   /  ;    '.      |  | :,'            |  | :                           ,--.'|    ,---.        ,---,
  :  :       \     :  : ' :            :  : '                 .--.--.   |  |,    '   ,'\   ,-+-. /  |
  :  |   /\   \  .;__,'  /    ,--.--.  |  ' |     ,--.--.    /  /    '  `--'_   /   /   | ,--.'|'   |
  |  :  ' ;.   : |  |   |    /       \ '  | |    /       \  |  :  /`./  ,' ,'| .   ; ,. :|   |  ,"' |
  |  |  ;/  \   \:__,'| :   .--.  .-. ||  | :   .--.  .-. | |  :  ;_    '  | | '   | |: :|   | /  | |
  '  :  | \  \ ,'  '  : |__  \__\/: . .'  : |__  \__\/: . .  \  \    `. |  | : '   | .; :|   | |  | |
  |  |  '  '--'    |  | '.'| ," .--.; ||  | '.'| ," .--.; |   `----.   \'  : |_|   :    ||   | |  |/
  |  :  :          ;  :    ;/  /  ,.  |;  :    ;/  /  ,.  |  /  /`--'  /|  | '.'\   \  / |   | |--'
  |  | ,'          |  ,   /;  :   .'   \  ,   /;  :   .'   \'--'.     / ;  :    ;`----'  |   |/
  `--''             ---`-' |  ,     .-./---`-' |  ,     .-./  `--'---'  |  ,   /         '---'
                            `--`---'            `--`---'                 ---`-'
*/




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

int main(){
  int N =0;
  cin >> N;
  int d[110];
  for(int i = 0; i<N; i++){
    cin>> d[i];}
  set<int> values;
  for(int j=0; j<N; j++){
    values.insert(d[j]);
  }
  
  
  cout <<values.size()<<endl;
  return 0;
}
  
  


Measured memory_bytes: 256
n=int(input())
h=list(map(int,input().split()))
flag=0
h[0]-=1
for i in range(len(h)-1):
    if h[i+1]-h[i]>=1:
        h[i+1]-=1
for i in range(len(h)-1):
    if h[i]>h[i+1]:
        flag=1
if flag==0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14396
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
#include<map>
#include<stack>
#include<set>
#include<utility>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ii> P;
typedef unsigned long long int ull;
const int MOD=1e9+7;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
const int MAXN=100000;
const int MAXE=100000;
const int MAXV=10000;
const ll INF=2e9;

int main(){
    int n,m;cin>>n>>m;
    ll dp[n+1];
    for(int i=0;i<=n;i++) dp[i]=0;
    dp[0]=1;
    for(int i=0;i<m;i++){
        int a;cin>>a;
        dp[a]=-1;
    }
    for(int i=1;i<=n;i++){
        if(dp[i]==-1) continue;
        if(dp[i-1]!=-1) dp[i]+=dp[i-1];
        if(i-2>=0&&dp[i-2]!=-1) dp[i]+=dp[i-2];
        dp[i]%=MOD;
    }
    cout<<dp[n]<<endl;
    return 0;
}

Measured memory_bytes: 4380
#include <iostream>

using namespace std;

int n, m, x;
int A[101];

bool isA(int i) {
    for (int j = 0; j < m; j++) {
        if (A[j] == i) {
            return true;
        }
    }
    return false;
}

int main() {
    cin >> n >> m >> x;
    for (int i = 0; i < m; i++) {
        cin >> A[i];
    }

    int right_min = 0;
    for(int i = x; i < n;i++){
        if(isA(i)) right_min++;
    }

    int left_min = 0;
    for(int i = x ; i > 0; i--){
        if(isA(i)) left_min++;
    }

    cout << min(right_min,left_min);
    return 0;

}

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

int main(){
  long long N,M;
  cin >>N>>M;
  long long sum=0;
  if((N<=M*2)&&(M>=2*N)){
    sum=sum+N;
    sum=sum+(M-2*N)/4;
    cout<<sum<<endl;
    return 0;
  }
  else sum=M/2;
  cout<<sum<<endl;
  return 0;
  
}

  

Measured memory_bytes: 256
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
time = 0
ans = "Yes"
AB.sort(key=lambda x:x[1]) 
for i in range(N):
  time += AB[i][0]
  if(time > AB[i][1]):
    ans = "No"
    break
print(ans)

Measured memory_bytes: 53660
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
#define f(i, n) for(int i = 0; i < n; ++i)
#define pb push_back
typedef long long int ll;

void input(){
   int a, b;
   cin >> a >> b;
   if(b == 1){
    cout << 0 <<endl;return;
   }
   int ans = 0;
   cout << (int)ceil((double) (b -1) / (double(a - 1))) << endl;
}
int main()
{
 input();
 return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
//typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){int i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll H,W,Q;
  cin>>H>>W>>Q;
  vector<string> A(H);
  cin>>A;
  vector<vector<int>> cnt1(H+1,vector<int>(W+1,0));
  vector<vector<int>> cnt2(H+1,vector<int>(W+1,0));
  vector<vector<int>> cnt3(H+1,vector<int>(W+1,0));
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(A[i][j]=='1'){
        cnt1[i][j]=1;
        if(i+1<H && A[i+1][j]=='1'){cnt2[i][j]=1;}
        if(j+1<W && A[i][j+1]=='1'){cnt3[i][j]=1;}
      }
    }
  }
  auto uku1=
    [&](vector<vector<int>> &A){
      for(int i=0;i<H;i++){
        for(int j=1;j<W;j++){
          A[i][j]+=A[i][j-1];
        }
      }
      for(int i=1;i<H;i++){
        for(int j=0;j<W;j++){
          A[i][j]+=A[i-1][j];
        }
      }
    };
  uku1(cnt1);
  uku1(cnt2);
  uku1(cnt3);
  auto uku2=
    [&](vector<vector<int>> &A,int x,int y,int xh,int yh){
      if(x>xh || y>yh){return 0LL;}
      ll ret=A[xh][yh];
      if(x>0){ret-=A[x-1][yh];}
      if(y>0){ret-=A[xh][y-1];}
      if(x>0 && y>0){ret+=A[x-1][y-1];}
      return ret;
    };
  auto cul=
    [&](int x,int y,int xh,int yh){
      return uku2(cnt1,x,y,xh,yh)-uku2(cnt2,x,y,xh-1,yh)-uku2(cnt3,x,y,xh,yh-1);
    };
  for(int i=0;i<Q;i++){
    int x,y,xh,yh;
    cin>>x>>y>>xh>>yh;
    x--; y--; xh--; yh--;
    cout<<cul(x,y,xh,yh)<<endl;
  }
  


  return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	ll N;
	string S;
	cin >> N >> S;
	vector<ll> cnt(26, 0);

	REP(i, N){
		cnt[S[i]-'a']++;
	}
	ll res = 1;
	REP(i, 26){
		res *= (cnt[i]+1);
		res %= mod;
	}
	cout << res-1 << endl;
    return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main(void){
	
	int b,f,r,v,i,j,k,n;
	int A[4][3][10]={0};
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d %d %d",&b,&f,&r,&v);
		A[b-1][f-1][r-1]+=v;
	}
	for(i=0;i<=3;i++){
		for(j=0;j<=2;j++){
			for(k=0;k<=9;k++){
				printf("%2d",A[i][j][k]);
			}
			printf("\n");
		}
		if(i!=3)printf("####################\n");
	}
	return 0;
}

Measured memory_bytes: 620