akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
//const int OO = 0x3f3f3f3f;
const long long OO = (long long) 1e18+7;
//const unsigned long long UOO = (long long) 10e18+7;
#define lp(i,a,n) for(long long i = a ; i < n ; ++i)
#define lpr(i,a,n) for(long long i = a ; i >= n ; --i)
#define rep(i,vec) for(ll i = 0 ; i < vec.size() ; ++i)
#define reprv(i,vec) for(ll i = vec.size()-1; i >=0 ; --i)
#define eps (1e-5)
#define pb(i) push_back(i)
#define EPS 1e-9
#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define debug(x) cout<<(#x)<<": \""<<x<<"\""<<endl
#define debugVec(vec) cout<<(#vec)<<": "; for (auto& i: vec) cout<<i<<" "; cout<<endl

typedef vector<int> vi ;
typedef   long long ll;
typedef   unsigned long long ull;
typedef vector<ll> vll ;
typedef pair<int,int> pii ;
typedef vector< pair<int,int> >  vpii;
typedef vector<pair<long long,long long>> vpll;
typedef vector<vector<int> > vvi ;
typedef complex<double> point;
typedef pair<ll,ll> pll;

using namespace std;
ll  inv(ll a, ll b) {return 1 < a ? b - inv(b % a, a) * b / a : 1;}
ll  Pow(ll  B,ll  P){ll  R=1; while(P>0)  {if(P&1) R=(R*B);P/=2;B=(B*B);}return R;} //compute b^p
ll  GCD(ll  a,ll  b){ while(b){b ^= a ^=b ^= a %=b;}  return a;}
ll  LCM(ll  a,ll  b) { return (a / GCD(a,b)*b); }
ll  BigMod(ll  B,ll  P,ll  M){ ll  R=1; while(P>0)  {if(P&1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return (ll )R;} //compute b^p%m
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//int i=uniform_int_distribution<int>(1,n)(rng);


int N,w;

ll mem[105][100005];
vpii vols; /// volume   weight

ll dp(int pos, int volume ){ /// return weight
    if(pos==N) return volume == 0 ? 0 : OO;
    if(volume < 0) return OO;
    if(mem[pos][volume]!=-1) return mem[pos][volume];
    return mem[pos][volume] = min( dp(pos+1,volume-vols[pos].ff) + vols[pos].ss, dp(pos+1,volume));
}



void mset(){
    lp(i,0,105)lp(j,0,100005) mem[i][j] = -1;

}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
//    cout.tie(0);
//#ifndef ONLINE_JUDGE
//   freopen( "output.txt" , "w" , stdout ) ;
//   freopen( "input.txt" , "r" , stdin ) ;
//#endif


    cin >> N >> w;

    ll sum = 0;
    lp(ilp,0,N){
        int weight,value;
        cin >> weight >> value;
        vols.push_back(make_pair(value,weight));
        sum += value;
    }

    mset();
    lpr(i,sum,0){
        if(dp(0,i) <= w) {
            cout << i;
            return 0;
        }
    }



    return 0;
}


Measured memory_bytes: 85664
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;


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

	int N;
	cin >> N;
	int A[N];
	bool ok = true;
	rep(i,N){
		cin >> A[i];
	}
	sort(A, A+N);
	if(A[0] == A[N-1]){
		if(A[0] == N-1){
			cout << "Yes" << endl;
			return 0;
		}
		else if(N/A[0] == 1){
			cout << "No" << endl;
			return 0;
		}
		else{
			cout << "Yes" << endl;
			return 0;
		}
	}
	else{
		if(A[N-1] - A[0] >= 2){
			cout << "No" << endl;
			return 0;
		}
		for(int i=1;i<N;i++){
			if(A[i] != A[i-1]){
				if(i == N-1){
					cout << "No" << endl;
					return 0;
				}
				else if( (N-i)/2+i >= A[N-1] && A[N-1] > i){
					cout << "Yes" << endl;
					return 0;
				}
				else{
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << (ok ? "Yes" : "No") << endl;
}

Measured memory_bytes: 1024
# coding: utf-8
# Your code here!
S=list(input())
N=len(S)
T=S[:int((N-1)/2)]

U=S[int((N+3)/2)-1:]


if T==T[::-1] and U==U[::-1] and S==S[::-1]:
    print("Yes")
else:
    print("No")
#print(T,U)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
int main()
{
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n)cin >> p[i];
    int cnt = 0;
    int ans = 0;
    for(int i = 1;i<= n;i++){
        if(p[i-1] == i )cnt++;
        else {
            if(cnt==1){
                ans++;
                cnt = 0;
                
            }
            else{
            ans += (cnt+1)/2;
            cnt = 0;
            
            }
        }

    }

    if(cnt==1){
        ans++;
        
    }
    else{
        ans += (cnt+1)/2;
        
    }
    

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

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool f;
double w;
vector<double> v;
int n;
double calc(int i,int j){
  return sqrt((v[i]+v[j])*(v[i]+v[j])-(v[i]-v[j])*(v[i]-v[j]));
}
double memo[1<<12][12];
void dfs(double l,int b,int p){
  if(~p){
    if(memo[b][p]<=l) return;
    memo[b][p]=l;
  }
  if(b==(1<<n)-1){
    f|=l+v[p]<=w;
    return;
  }
  if(p<0) for(int i=0;i<n;i++) dfs(v[i],b+(1<<i),i);
  else for(int i=0;i<n;i++) if(!((b>>i)&1)) dfs(l+calc(p,i),b+(1<<i),i);
}
int main(){
  string s;
  while(getline(cin,s)){
    v.clear();
    stringstream ss(s);
    ss>>w;
    double t;
    while(ss>>t) v.push_back(t);
    n=v.size();
    f=0;
    
    for(int i=0;i<(1<<n);i++) 
      for(int j=0;j<n;j++)
	memo[i][j]=1e9;
    
    dfs(0,0,-1);
    cout<<(f?"OK":"NA")<<endl;
  }
  return 0;
}

Measured memory_bytes: 3504
import java.util.Scanner;

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

		String s1 = in.next();
		String s2 = in.next();
		in.close();

		if(s1.length() > s2.length()) {
			System.out.println("GREATER");
		} else if(s1.length() < s2.length()) {
			System.out.println("LESS");
		} else if(s1.compareTo(s2) > 0) {
			System.out.println("GREATER");
		} else if(s1.compareTo(s2) < 0) {
			System.out.println("LESS");
		} else {
			System.out.println("EQUAL");
		}
	}
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define vlli vector<ll>
#define vi vector<int>
#define vs vector<string>
#define vplli vector< pair< ll,ll> >
#define plli pair< ll,ll >
#define vps vector< pair< string, string> >
#define vpi vector< pair< int, int> >
#define all(x) x.begin(), x.end()
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,n) for(ll i=0;i<n;i++)
#define print(arr,a,n) for(ll i=(a);i<(n);i++)cout<<(arr)[i]<<" ";

int main(){
    fast;
    ll x,y,f=0;
    cin>>x>>y;
    for(ll i = 0;i<=x;i++){
        if(i*2 + (x-i)*4 == y){
            f=1;
            break;
        }
    }
    if(f==1){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3596
function Main(input) {
	var S = input.split('\n');
	var K = S[0].split(" ");
	
	var A = parseInt(K[0]);
	var B = parseInt(K[1]);
	
	if (A >= 10 || B >= 10) {
		console.log(-1);
	} else {
		console.log(A * B);
	}
}
 
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 11468
#include<stdio.h>
int main(void)
{
    int n,y,b[51],r[51],t[51],i,j,c,w;
	double a[51],e;
	scanf("%d",&n);
	while(n!=0){
	    c=0;
		e=1;
	    scanf("%d",&y);
		for(i=1;i<=n;i++){
		    scanf("%d %d %d",&b[i],&r[i],&t[i]);
		}
		for(i=1;i<=n;i++){
		    if(t[i]==1){
			    a[i]=10000*(1+(double)y*r[i]/100);
			}
			if(t[i]==2){
			    for(j=0;j<y;j++){
				    e=e*(1+(double)r[i]/100);
				}
				a[i]=(double)10000*e;
				e=1;
			}
		}
		for(i=1;i<=n;i++){
		    if(c<a[i]){
			    c=a[i];
				w=i;
			}
		}
		printf("%d\n",b[w]);
		scanf("%d",&n);
	}
	return 0;
}

Measured memory_bytes: 2564
/*Author: Anikash Chakraborty
Language: cpp
*/
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < n; i++)
#define pb push_back
#define ff first
#define ss second
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define MAX 1000002
#define MOD 1000000007
#define ll long long



using namespace std;

//ll dp[MAX];
//ll a[MAX];
//ll right(ll *a,ll n,ll x){
//    ll ans=a[x];
//    for (int (i) = x; (i) <n ; ++(i)) {
//        ans=max(a[i],ans);
//    }
//    return ans;
//}
//ll left(ll *a,ll n, ll x){
//    ll ans=a[x];
//    for (int (i) = x; (i) >=0 ; --(i)) {
//        ans=max(a[i],ans);
//    }
//    return ans;
//}
int main()
{
    ll n;
    cin>>n;
    ll ans = 0;
    if(n&1) cout<<"0"<<endl;

    else {

        while (n) {
            ans += (n / 5) / 2;
            n /= 5;
        }
        cout << ans << endl;
    }

    return  0;
}

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

using namespace std;
const int MAX=1e5;
int n,arr[MAX+2][3];
long long dp[MAX+3][3];

long long solve(int ind,int last){
if(ind==n) return 0;
if(dp[ind][last]!=-1) return dp[ind][last];
long long ans=-1e17;
 if(last!=0)   ans=max(ans,solve(ind+1,0)+arr[ind][0]);
 if(last!=1)   ans=max(ans,solve(ind+1,1)+arr[ind][1]);
 if(last!=2)   ans=max(ans,solve(ind+1,2)+arr[ind][2]);
return dp[ind][last]=ans;
}

int main()
{
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++)
            cin>>arr[i][j];
    }
    memset(dp,-1,sizeof(dp));
    cout<<solve(0,4);
    return 0;
}


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

signed main () {
    int n, k;
    cin >> n >> k;
    vector < int > d(n);
    for (int i = 0; i < n; ++i)
        cin >> d[i];
    int ans = 0; 
    for (int cur_k = 1; cur_k <= k; ++cur_k) {
        for (int deleted = 0; deleted <= cur_k / 2; ++deleted) {
            if (cur_k - deleted > n) 
                continue;
            else {
                int took = cur_k - deleted;
                for (int i = 0; i <= took; ++i) {
                    int sum = 0;
                    multiset < int > here;
                    for (int j = 0; j < i; ++j) {
                        sum += d[j];
                        here.insert(d[j]);
                    }
                    for (int j = n - 1; (n - 1 - j) < took - i; --j) {
                        sum += d[j];
                        here.insert(d[j]);
                    }
                    for (int j = 0; j < deleted; ++j) {
                        sum -= *here.begin();
                        here.erase(here.begin());
                    }
                    ans = max(ans, sum);
                }
            }
        }
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <bitset>

using namespace std;
#define LL long long
#define pb push_back
#define mk make_pair
#define pill pair<int, int>
#define fi first
#define se second
#define mst(a, b)	memset(a, b, sizeof a)
#define REP(i, x, n)	for(int i = x; i <= n; ++i)
const int MOD = 1e9 + 7;
const int qq = 2e3 + 10;
const LL INF = 1e9 + 10;
int n, k;
vector<int> G[qq];
int dis[qq][qq];
void Dfs(int rt, int u, int fa, int dep) {
	dis[rt][u] = dep;
	int sz = (int)G[u].size();
	for(int i = 0; i < sz; ++i) {
		int v = G[u][i];
		if(v == fa)	continue;
		Dfs(rt, v, u, dep + 1);
	}
}
pill pl[qq];

int main(){
	scanf("%d%d", &n, &k);
	for(int a, b, i = 1; i < n; ++i) {
		scanf("%d%d", &a, &b);
		G[a].pb(b), G[b].pb(a);
		pl[i] = mk(a, b);
	}
	for(int i = 1; i <= n; ++i) {
		Dfs(i, i, -1, 0);
	}
	int minx = n;
	for(int i = 1; i <= n; ++i) {
		int cnt = 0;
		for(int j = 1; j <= n; ++j) {
			if(dis[j][i] * 2 > k)	cnt++;
		}
		minx = min(minx, cnt);
	}
	for(int i = 1; i <= n - 1; ++i) {
		int cnt = 0;
		for(int j = 1; j <= n; ++j) {
	//		if(j == pl[i].fi || j == pl[i].se)	continue;
			if(2 * min(dis[j][pl[i].fi], dis[j][pl[i].se]) + 1 > k)	cnt++;
		}
		minx = min(minx, cnt);
	}
	printf("%d\n", minx);
	return 0;
}

Measured memory_bytes: 16256
#include<stdio.h>
#include<string.h>



void change(char *str){
  int len=strlen(str);
  int i;
  for(i=0;i<len;i++){
    if('a'<=str[i]&&str[i]<='z'){
      str[i]-=32;
    }
  }
}

int main(){
  char t[10000];
  char key[10000];
  char eofstr[]={"END_OF_TEXT"};
  int ans=0;

  scanf("%s",key);
  change(key);

  while(1){
    scanf("%s",t);
    if(strcmp(t,eofstr)==0){
      break;
    }
    change(t);
    if(strcmp(t,key)==0){
      ans++;
    }
  }

  printf("%d\n",ans);
  return 0;
}

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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

  
int main() {
int N, M;
cin >> N >> M;

vector<pair<ll,ll>> D(N);

REP(i, N) cin >> D.at(i).first >> D.at(i).second;

sort(all(D));

ll money = 0;

for(int i = 0; i < N; i++){ 

      if(M > D.at(i).second){
        money += D.at(i).first * D.at(i).second;
        M -= D.at(i).second;
      }else{
        money += D.at(i).first * M;
        break;
      }

}

print(money);
}

Measured memory_bytes: 1792
using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Numerics;

namespace alsing2020
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            if (File.Exists("input.txt"))
            {
                Console.SetIn(new StreamReader("input.txt"));
            }
            solve_alsing2020C();
            Console.Out.Flush();
        }
        public static void solve_alsing2020C()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            for (int i = 1; i <= n; i++)
            {
                int cnt = 0;
                for (int x = 1; x <= 100; x++)
                {
                    for (int y = 1; y <= 100; y++)
                    {
                        if (x * x + y * y > i)
                        {
                            break;
                        }
                        for (int z = 1; z <= 100; z++)
                        {
                            int d = x * x + y * y + z * z + x * y + y * z + z * x;
                            if (d > i)
                            {
                                break;
                            }
                            if (x * x + y * y + z * z + x * y + y * z + z * x == i)
                            {
                                cnt++;
                            }
                        }
                    }
                }
                Console.WriteLine(cnt);
            }
        }

        public static void solve_alsing2020B()
        {
            int n = Convert.ToInt32(Console.ReadLine());
            int[] a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int cnt = 0;
            for (int i = 0; i < n; i++)
            {
                if ((i + 1) % 2 != 0 && a[i] % 2 != 0)
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
        }

        public static void solve_alsing2020A()
        {
            int[] lrd = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            int cnt = 0;
            for (int i = lrd[0]; i <= lrd[1]; i++)
            {
                if (i % lrd[2] == 0)
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt);
        }
    }
}

Measured memory_bytes: 28736
#include <stdio.h>
#include <string.h>
 
int main(void) {
  int x[5];
  for (int i = 0; i < 5; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i < 5; i++) {
    if (x[i] == 0) {
      printf("%d\n", i + 1);
    }
  }
  return 0;
}

Measured memory_bytes: 1652
// see https://gist.github.com/LumaKernel/ff55d49ee1af69b7388f15b707e75c15
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<P> VP;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,0,n)

#define LFOR(i,a,b) for(ll i=(a);i<(b);++i)
#define RLFOR(i,b,a) for(ll i=(b)-1;i>=(a);--i)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_back
#define EACH(i,c) REP(i,(int)(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define dump(x) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";
#define dump2(x,y) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x)\
			<< " , " << #y << " = " << (y) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

ll n,m;
ll k;
string s;
ll x,y;

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

	cout << min(n,k)*x + max(0ll,n-k)*y;
	cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(void){
  int n,i,a[110],s=0,t,co1=0,co2=0;
  cin >> n;
  for (i=0;i<n;i++){
    cin >> a[i];
    s+=a[i];
  }
  t=s/n;
  for (i=0;i<n;i++) co1+=(t-a[i])*(t-a[i]);
  for (i=0;i<n;i++) co2+=(t+1-a[i])*(t+1-a[i]);
  cout << min(co1,co2) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <map>
#include <algorithm> 
#include <vector> 
#include <string.h> 
#include <math.h> 
#include <stdio.h> 
#include <stdlib.h> 
#include <chrono> 
#include <thread> 
#include <iomanip>
#include <typeinfo>
 
//define
#define trav(i,v)   for(auto i: v)
#define rep(i,n)    for(int i=0;i<n;i++)
#define repu(i,k,n) for(int i=k;i<=n;i++)
#define repd(i,k,n) for(int i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define all(v)  v.begin(), v.end()
#define itn int 

//typedef
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, int > > vpp;
 
const long long MOD = 1000000007;
// const long long MOD = 998244353;
const long long inf = 1000000000000000000;
 
using namespace std;

ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}
 
ll power(ll x, ll n)
{
    ll res=1;
    while(n>0){
        if(n&1) res=res*x;
        x=x*x;
        n>>=1;
    }
    return res;
}

void solve()
{
    int n;
    cin>>n;
    ll d;
    cin>>d;
    ll x[n], y[n];
    int cnt=0;
    rep(i,n)
    {
        cin>>x[i]>>y[i];
        if(x[i]*x[i]+y[i]*y[i]<=d*d)
            cnt++;
    }
    cout<<cnt<<endl;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    int t = 1, tt=1;
    // cin>>t;
    while(tt<=t)
    {
        // cout<<"Case #"<<tt<<": ";
        solve();
        tt++;
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}   

Measured memory_bytes: 6928
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
using namespace std;
void read(int &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void read(ll &x){
	x=0; char c=getchar(); int p=1;
	for (;c<48;c=getchar())if (c=='-')p=-1;
	for (;c>47;c=getchar())x=(x<<1)+(x<<3)+(c^48);
	x*=p;
}
void Min(int &x,int y){	
	if (x>y)x=y;
}
void Min(ll &x,ll y){	
	if (x>y)x=y;
}
void Max(int &x,int y){	
	if (x<y)x=y;
}
void Max(ll &x,ll y){	
	if (x<y)x=y;
}

#define bas 50
ll cnt[105][105];
char s[50];
int main(){
//	freopen("1.in","r",stdin);
	int n,i,j,k,l;
	ll x,res=0;
	
	read(n);
	/*
		cnt2[i]+cnt2[j]>=0
		cnt5[i]+cnt5[j]>=0	
	*/
	int m,ct2,ct5;
	for (i=1;i<=n;i++){
		scanf("%s",s);
		m=strlen(s);
		x=0; ct2=ct5=0;
		for (j=0;j<m;j++){
			if (s[j]!='.'){
				x=(x<<1)+(x<<3)+(s[j]^48);
			}
			else{
				ct2-=m-j-1;
				ct5-=m-j-1;
			}
		}
		for (;x&&x%2==0;)x/=2,ct2++;
		for (;x&&x%5==0;)x/=5,ct5++;
		cnt[bas+ct2][bas+ct5]++;
		if (ct2>=0&&ct5>=0)res--;
//		printf("%d %d\n",ct2,ct5);
	}
	for (i=-50;i<=50;i++){
		for (j=-50;j<=50;j++)if (cnt[i+bas][j+bas]){
			for (k=-i;k<=50;k++){
				for (l=-j;l<=50;l++){
					res+=cnt[i+bas][j+bas]*cnt[k+bas][l+bas];
				}
			}
		}
	}
	printf("%lld\n",res/2);
	return 0;
}

Measured memory_bytes: 3792
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
using ll = long long;
using ldb = long double;
using pa = pair < ll, ll >;
using vec = vector < ll >;
 
template < typename T > using index_set = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F  first
#define S  second
#define f(i,x,n) for(ll i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
#define str string
#define edl "\n"
#define add insert
#define cot continue
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)

const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;
const double PI = acos(-1);
const ll LINF = LLONG_MAX;
int main() 
{

  fast();
  

    ll n,k;
    cin >> n >> k;
    vec q(n);
    f(i,0,n)
    {
        cin >> q[i];
    }
    sort(all(q));
    ll mi=q[k-1]-q[0];
    f(i,k,n)
    {
        mi=min(mi,q[i]-q[i-k+1]);
    }
    cout<<mi;

    cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
    return 0;
}
 

Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;

public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] tmpArray = br.readLine().split(" ");
		int n = Integer.parseInt(tmpArray[0]);
		int q = Integer.parseInt(tmpArray[1]);

		@SuppressWarnings("unchecked")
		Stack<Integer>[] stackArray = new Stack[n];
		for(int i = 0; i < n; i++){
			stackArray[i] = new Stack<Integer>();
		}

		for(int i = 0; i < q; i++){
			tmpArray = br.readLine().split(" ");

			//push
			if(tmpArray[0].equals("0")){
				int t = Integer.parseInt(tmpArray[1]);
				int x = Integer.parseInt(tmpArray[2]);

				stackArray[t].push(x);
			}
			//top
			else if(tmpArray[0].equals("1")){
				int t = Integer.parseInt(tmpArray[1]);

				if(!stackArray[t].isEmpty()){
					System.out.println(stackArray[t].peek());
				}
			}
			//pop
			else {
				int t = Integer.parseInt(tmpArray[1]);

				if(!stackArray[t].isEmpty()){
					stackArray[t].pop();
				}
			}
		}

	}
}



Measured memory_bytes: 70280
#include <algorithm>
#include <cstdio>

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

using namespace std;

struct edge{ int u,v,w; };

const int INF=1<<30;

int main(){
	int n,m,p; scanf("%d%d%d",&n,&m,&p);
	edge E[5000];
	rep(i,m){
		scanf("%d%d%d",&E[i].u,&E[i].v,&E[i].w);
		E[i].u--; E[i].v--; E[i].w-=p;
	}

	int d[2500];
	rep(u,n) d[u]=(u==0?0:INF);
	bool neg[2500]={};
	rep(t,4*n) rep(i,m) {
		int u=E[i].u,v=E[i].v,w=-E[i].w;
		if(d[v]>d[u]+w){
			d[v]=d[u]+w;
			if(t>=n-1) neg[v]=true;
		}
	}

	bool vis1[2500]={}; // set of vertices reachable from 0
	vis1[0]=true;
	rep(t,n) rep(i,m) {
		int u=E[i].u,v=E[i].v;
		if(vis1[u]) vis1[v]=true;
	}

	// set of vertices reachable from n-1 in the reversed graph
	bool vis2[2500]={};
	vis2[n-1]=true;
	rep(t,n) rep(i,m) {
		int u=E[i].u,v=E[i].v;
		if(vis2[v]) vis2[u]=true;
	}

	rep(u,n) if(neg[u] && vis1[u] && vis2[u]) { puts("-1"); return 0; }

	printf("%d\n",max(-d[n-1],0));

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<int>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)

#define rep(i,n) for(auto i=0; i<(n); i++)
#define isValidPoint(x, y, mx, my) x >= 0 && x  < mx && y >= 0 && y < my

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

const int MOD =   1000003;

long exp_mod(long long a, long long b, long m) {
	long long res = 1;
	while (b > 0) {
		if (b&1)
			res = (res * a)%m;
		a = (a * a)%m;
		b >>= 1;
	}
	return (long)res;
}

long fact_mod(long n, long m) {
	long long res = 1;
	for (long i=n; i>0; --i)
		res = (res * i)%m;
	return (long)res;
}

long comb_mod(long n, long r) {
	long long res = 1;
	for (long i=0; i<r; ++i)
		res = (res * (n - i) )%MOD;
	return ( res * exp_mod(fact_mod(r, MOD), MOD-2, MOD) ) % MOD;
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

struct Pony
{
    long s, t, x;

    Pony(long s_, long t_, long x_)
    {
        s = s_;
        t = t_;
        x = x_;
    }

    bool operator<(const Pony &another) const
    {
        return x < another.x;
    };
};

long modinv(long a, long m) {
    long b = m, u = 1, v = 0;
    while (b) {
        long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

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

  long a, b, c;
  cin >> a >>b >>c;

  if (a >= b && a >= c) {
    cout << b+c << endl;
  } else if (b >= a && b >= c) {
    cout << a+c << endl;
  } else {
    cout << a+b << endl;
  }
}


Measured memory_bytes: 888
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def TUPLE(): return tuple(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = 10**6#float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
#from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

print(INT()^1)

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    Int(n);
    vector<int> data(n);
    for (int i = 0; i < n; i++) {
        cin >> data[i];
    }
    
    sort(all(data));
    int mmn = data.back();

    int ptr = 0;
    rep(i, data.size()-1) {
        if (abs(mmn - data[ptr] * 2) > abs(mmn - data[i] * 2)) ptr = i;
    }

    std::cout << mmn << " " << data[ptr] << std::endl;

    return 0;
}


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

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

int main(){
  int n,k;
  cin>>n>>k;
  ll h[n];
  rep(i,n)
    cin>>h[i];
  sort(h,h+n);
  ll ans=10000000000;
  for(int i=0;i<n-k+1;i++)
    ans=min(ans,h[i+k-1]-h[i]);
  cout<<ans<<endl;
  return 0;
}


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

void print(vector<int> v,int n)
{
	for (int i = 0; i < n; i++)
	{
		cout << v[i];
		if (i == n - 1)break;
		cout << " " ;
	}
	cout << endl;
}

int main()
{
	int n,m;
	cin >> n;
	vector<int> v;
	int j,k;
	for (int i = 0; i < n; i++) { cin >> m; v.push_back(m); }
	for (int i = 0; i < n; i++)
	{
		j = v[i];
		for (k = i-1; k >= 0; k--)
		{
			if (v[k] < j)
			{
				v.erase(v.begin() + i);
				v.insert(v.begin() +  k + 1 , j);
				break;
			}
			else if (v[k] > j && k == 0)
			{
				v.erase(v.begin() + i);
				v.insert(v.begin(),j);
			}
		}
		print(v,n);
	}
	return 0;
}

Measured memory_bytes: 3116
#include<bits/stdc++.h>
#define int long long
#define pii pair<int,int>
using namespace std;

const int M = 1e18+7;

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

    string s , t;
    cin >> s >> t;
    int n = s.length() , m = t.length();
    vector<vector<int>> dp(n+1 , vector<int>(m+1 , 0));
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= m; j++) {
            if(s[i-1] == t[j-1]) dp[i][j] = 1 + dp[i-1][j-1];
            else dp[i][j] = max(dp[i-1][j] , dp[i][j-1]);
        }
    }
    string str = "";
    int x = n , y = m;
    while(x > 0 && y > 0) {
        if(s[x-1] == t[y-1]) {
            str = s[x-1]+str;
            --x , --y;
        }
        else if(dp[x-1][y] > dp[x][y-1]) --x;
        else --y; 
    }
    cout << str << "\n";

    return 0;
}

Measured memory_bytes: 70784
#include<stdio.h>
long long k, j, b[100001] = { 0};

int main(void){
	int i;
	int a;
	int n;
	int t;

	scanf("%d %lld", &n, &k);

	while(n--){
		scanf("%d", &a);
		scanf("%d", &t);
		b[a] += t;
	}

	j = 0;
	for(i = 1; i < 100001; i++){
		j += b[i];
		if(j >= k){
			printf("%d\n", i );
			break;
		}
	}
	printf("\n");
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int N;
    cin>>N;
    vint A(N);
    rep(i,N)cin>>A[i];
    cout<<*max_element(all(A))-*min_element(all(A))<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

vvll to;
void dfs(vll& cnt, ll u, ll par){
  if(par != -1) cnt[u] += cnt[par];
  for(ll v : to[u]){
    if(v == par) continue;
    dfs(cnt, v, u);
  }
}

int main() {
  // ios_base::sync_with_stdio(0), c
  cout << fixed << setprecision(15);

  ll n, q;
  cin >> n >> q;

  to.resize(n);
  rep(i,n-1){
    ll a, b;
    cin >> a >> b;
    a--, b--;
    to[a].push_back(b);
    to[b].push_back(a);
  }

  vll cnt(n, 0);
  rep(i,q){
    ll p,x;
    cin >> p >> x;
    p--;
    cnt[p] += x;
  }

  dfs(cnt, 0, -1);

  rep(i,n) cout << cnt[i] << " ";
  cout << endl;

  return 0;
}


Measured memory_bytes: 25088
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define SZ(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	string s;
	int n,k;	
   cin>>n>>k;
   cin>>s;
   for (int i = 0; i < n; ++i)
   {
   	    (i==k-1)?cout<<(char)tolower(s[i]):cout<<s[i];
   }
   return 0;
}


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

ll val(ll a,ll b,ll x){
    return ((a*x) / b) - (a * (x/b));
}

int main() {
    ll a,b,n;
    cin>>a>>b>>n;
    if(b == n){
        cout<<max(val(a,b,n),val(a,b,n-1));
    }else if(b > n){
        cout<<val(a,b,n);
    }else{
        cout<<max(val(a,b,n),val(a,b,b-1));
    }
    return 0;
}


Measured memory_bytes: 3648
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	ll n,cnt=0;
	cin>>n;
	ll arr[n];
	for(ll i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	ll min[n];
	min[0]=1000000000;
	for(ll i=1;i<n;i++)
	{
		if(arr[i-1]<min[i-1])
		min[i]=arr[i-1];
		else
		min[i]=min[i-1];
	}
	for(ll i=0;i<n;i++)
	{
		//cout<<min[i]<<endl;
		if(min[i]<=arr[i])
		++cnt;
	}
	cout<<n-cnt;
	return 0;
}

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

using namespace std;

const int maxn = 2e5+10;

int n;
int a[maxn], h[maxn];
long long int bit[maxn<<1];

long long int query(int pos){
	long long int res = 0;
	for (; pos > 0; pos -= pos&-pos)
		res = max(res, bit[pos]);
	return res;
}

void update(int pos, long long int x){
	for (; pos <= n; pos += pos&-pos)
		bit[pos] = max(bit[pos], x);
}

int main(){
	cin >> n;
	for (int i = 0; i < n; i++)
		scanf("%d", &h[i]);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i]);

	for (int i = 0; i < n; i++){
		update(h[i], query(h[i]) + a[i]);
	}

	cout << query(n) << endl;
	return 0;
}


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

int main() {
	int a,b;
	cin >> a >> b;
	string k = "Zero";
	if(a > 0)
	{
		k = "Positive";
	}
	else if(b < 0)
	{
		int c = b - a;
		if(c % 2 == 1)
		{
			k = "Positive";
		}
		else
		{
			k = "Negative";
		}
	}
    cout << k << endl;
	return 0;
}

Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;

const ll INF = 1LL << 32;

bool judge(vll& lst, ll a, ll b, ll t, ll n) {
  ll ret = 0;
  for (ll i = 0; i < n; i++) {
    ret += max(((lst[i] - b * t) + a - b - 1) / (a - b), 0LL);
  }
  return (ret <= t);
}

int main() {
  ll n, a, b;
  cin >> n >> a >> b;

  vll lst(n);
  rep(i, n) cin >> lst[i];

  ll lp = 0;
  ll rp = 1e9 + 1;
  while (lp + 1 < rp) {
    ll t = (lp + rp) / 2;
    if (judge(lst, a, b, t, n))
      rp = t;
    else
      lp = t;
  }
  cout << rp << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  ll a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  ll ans = 1e18;

  for (ll i = 0; i < 2 * (max(x, y) + 1); i += 2) {
    ll t = i * c + max(x - i / 2, 0LL) * a + max(y - i / 2, 0LL) * b;
    ans = min(ans, t);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<algorithm>
#include<map>
using namespace std;

int parse(string a) {
	int s = 0;
	for (char b : a) {
		s *= 10;
		s += b - 48;
	}
	return s;
}
vector<string>split(string a) {
	vector<string>b;
	string c = "";
	for (char d : a) {
		if (d == '=' || d == '+') {
			b.push_back(c);
			c = "";
		}
		else c += d;
	}
	b.push_back(c);
	return b;
}
int main() {
	string a;
	while (cin >> a) {
		for (int c = 0; c < 10; c++) {
			string b = a;
			for (int d = 0; d < b.length(); d++) {
				if (b[d] == 'X')b[d] = c + 48;
			}
			vector<string>e = split(b);
			if (!(e[0].length() != 1 && e[0][0] == '0') && !(e[1].length() != 1 && e[1][0] == '0') && !(e[2].length() != 1 && e[2][0] == '0')) {
				if (parse(e[0]) + parse(e[1]) == parse(e[2])) { cout << c << endl; break; }
			}
			if (c == 9)cout << "NA" << endl;
		}
	}
}

Measured memory_bytes: 3156
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

#define FOR(i,a,b) for(ll i = (a);i<(b);i++)
#define REP(i,a) FOR(i,0,(a))
#define MP make_pair

int main() {
  char c;
  cin >> c;

  if (c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
    cout << "vowel" << endl;
  } else {
    cout << "consonant" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define cmin(a,b) (a>(b)?a=(b),1:0)
#define cmax(a,b) (a<(b)?a=(b),1:0)
#define dmin(a,b) ((a)<(b)?(a):(b))
#define dmax(a,b) ((a)>(b)?(a):(b))
namespace io
{
	int F()
	{
		 int F=1,n=0;
		 char ch;
		 while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		 ch=='-'?F=0:n=ch-'0';
		 while((ch=getchar())>='0'&&ch<='9')n=n*10+ch-'0';
		 return F?n:-n;
	}
	long long G()
	{
		 long long F=1,n=0;
		 char ch;
		 while((ch=getchar())!='-'&&(ch<'0'||ch>'9'));
		 ch=='-'?F=0:n=ch-'0';
		 while((ch=getchar())>='0'&&ch<='9')n=n*10+ch-'0';
		 return F?n:-n;
	}
}
int R(int l,int r)
{
	return (rand()<<15|rand())%(r-l+1)+l;
}
const int M=1000000007;
int f[11]={1,1,2,3,5,8,13,21,34,55};
int g[111][11];
int main()
{
	int h=io::F(),w=io::F(),k=io::F();
	g[0][1]=1;
	for(register int i=1;i<=h;++i)
		for(register int j=1;j<=w;++j)
			if(g[i-1][j])
			{
				g[i][j]=(g[i][j]+g[i-1][j]*(long long)f[j-1]*f[w-j])%M;
				if(j!=w)g[i][j+1]=(g[i][j+1]+(long long)g[i-1][j]*f[j-1]*f[w-j-1])%M;
				if(j!=1)g[i][j-1]=(g[i][j-1]+(long long)g[i-1][j]*f[j-2]*f[w-j])%M;
			}
	printf("%d\n",g[h][k]);
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 101
void push(int);
int pop(void);
void dealOperator(char);
int isOperator(char);
void printStack(void);
int stack[MAX];
int top=0;
int main(void)
{
  char s[10];//input comes here
  int ans;//calculation result comes here
  for(;;)
    {
      if(scanf("%s ",s)==EOF) break;
      if(isOperator(s[0])==1) dealOperator(s[0]);
      else push(atoi(s));
      //printStack();
    }
  ans=pop();
  printf("%d\n",ans);
  return 0;
}
void push(int x)
{
  if(top>=MAX-1) exit(1);//stack is full
  else
    {
      top++;
      stack[top]=x;
      //printf("stack[%d]=%d is pushed\n",top,x);
    }
}
int pop(void)
{
  if(top<=0) exit(2);//stack is empty
  else
    {
      top--;
      //printf("stack[%d]=%d is poped\n",top+1,stack[top+1]);
      return stack[top+1];
    }
}
void dealOperator(char c)
{
  int b=pop();//value on the top
  int a=pop();//value on the 2nd top
  switch(c)
    {
    case '+':
      push(a+b);
      break;
    case '-':
      push(a-b);
      break;
    case '*':
      push(a*b);
      break;
    default:
      exit(3);//undefined operator
    }
}
int isOperator(char c)
{
  if(c=='+'||c=='-'||c=='*') return 1;
  else return 0;
}
void printStack(void)
{
  int i;
  for(i=1;i<=top;i++)
    {
      if(i>1) printf(" ");
      printf("%d",stack[i]);
    }
  printf("\n");
}



Measured memory_bytes: 2084
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int n, m, cost[105][105], pre[105], d[105], INF = 10000;
bool used[105];

void dijkstra(int s) {
	fill(d, d+n, INF);
	fill(used, used+n, false);
	fill(pre, pre+n, -1);
	d[s] = 0;
	
	while (true) {
		int v = -1;
		FOR(u, n) {
			if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
		}
		if (v == -1) break;
		used[v] = true;
		FOR(u, n) {
			if (d[u] > d[v] + cost[v][u]) {
				d[u] = d[v] + cost[v][u];
				pre[u] = v;
			}
		}
	}
}

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	MEM(cost, INF);
	// map<pair<int, int>, int> mp;
	set<pair<int, int> > st;
	FOR(i, m) {
		int a, b, c;
		cin >> a >> b >> c;
		a--;
		b--;
		// if (a > b) swap(a, b);
		cost[a][b] = c;
		cost[b][a] = c;
		st.insert({a, b});
		st.insert({b, a});
		// mp[{a, b}]++;
	}
	map<pair<int, int>, int> mp2;
	FOR(i, n) {
		dijkstra(i);
		FOR(j, n) {
			if (i == j) continue;
			int t = j;
			for ( ; t != -1; t = pre[t]) {
				if (pre[t] == -1) continue;
				if (st.count({t, pre[t]}) || st.count({pre[t], t})) {
					st.erase({t, pre[t]});
					st.erase({pre[t], t});
				}
				// mp2[make_pair(min(t, pre[t]), max(t, pre[t]))]++;
			}
		}
	}
	cout << st.size()/2 << endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
// #include "prettyprint.hpp"
typedef long long ll;
typedef double db;

#define fast_io() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)

const ll LINF = LLONG_MAX, MOD = 1e9 + 7, N = 1e5 + 5, LG = 20;
const int INF = INT_MAX;
const db PI = acos(-1), EPS = 1 / db(1e6);

void test() {
    int n; cin >> n;
    map<int, int> mp;
    for (int i = 0; i < n; ++i) {
        int k; cin >> k;
        ++mp[k];
    }
    // debug(mp);
    int k = (mp.rbegin()) -> first, cnt = 0;
    for (auto& [x, y] : mp) {
        for (int i = 2 * x; i <= k; i += x) {
            if (mp.count(i)) mp[i] = 0;
        }
        if (y == 1) ++cnt;
    }
    // debug(mp);
    cout << cnt << "\n";;
}

int main() {
      fast_io();
      #ifdef HOME
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
      #endif
      cout << fixed << setprecision(15);
      int t = 1;
      // cin >> t;
      for (int i = 1; i <= t; ++i) {
          test();
      }
      #ifdef HOME
          cout << "Time: " << (int)(clock() * 1000. / CLOCKS_PER_SEC) << "ms";
      #endif
      return 0;
}


Measured memory_bytes: 12932
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define P pair<int,int>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define endl '\n'

int dp[1010][1010];

void solve(){
    string s,t;
    cin >> s >> t;

    int n = s.size();
    int m = t.size();
    memset(dp,0,sizeof(dp));
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(s[i] == t[j]){
                dp[i+1][j+1] = max(dp[i+1][j+1],dp[i][j] + 1);
            }
            dp[i+1][j+1] = max(max(dp[i+1][j+1],dp[i+1][j]),dp[i][j+1]);
        }
    }
    cout << dp[n][m] << endl;
}

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

    while(q--){
        solve();
    }
}



Measured memory_bytes: 7184
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
#include <tuple>
using namespace std;

long long const MOD = 1000000007LL;

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

    int number = n;
    int keta = 0;

    while (number > 0) {
        ++keta;
        number /= 10;
    }

    int res = 0;
    if (keta == 1) {
        res += n;
    }
    if (keta >= 2) {
        res += 9;
    }
    if (keta == 3) {
        res += n - 99;
    }
    if (keta >= 4) {
        res += 999 - 99;
    }
    if (keta == 5) {
        res += n - 9999;
    }
    if (keta == 6) {
        res += 99999 - 9999;
    }

    cout << res << endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

As = []
for _ in range(3):
    As.append(list(map(int, input().split())))
N = int(input())

s = set()
for n in range(N):
    b = int(input())
    s.add(b)

table = [[0] * 3 for _ in range(3)]
for h in range(3):
    for w in range(3):
        a = As[h][w]
        table[h][w] = (a in s)

# for t in table:
#     print(t)

ans = False
for h in range(3):
    if table[h][0] == table[h][1] == table[h][2] == True: ans = True
for w in range(3):
    if table[0][w] == table[1][w] == table[2][w] == True: ans = True
if table[0][0] == table[1][1] == table[2][2] == True: ans = True
if table[0][2] == table[1][1] == table[2][0] == True: ans = True

if ans:
    print("Yes")
else:
    print("No")




Measured memory_bytes: 7976
n = int(input())
a = list(map(int, input().split()))

ans = 1
flag = 0
base = -1
count = 0
for i in range(n):
  if count == 0:
    count += 1
    base = a[i]
  elif count == 1:
    
    if a[i] < base:
      flag = 0
      count += 1
    elif a[i] > base:
      flag = 1
      count += 1
    else:
      continue
  else:
    if flag == 0:
      if a[i] <= a[i-1]:
        continue
      else:
        count = 1
        base = a[i]
        ans += 1
    else:
      if a[i] >= a[i-1]:
        continue
      else:
        count = 1
        base = a[i]
        ans += 1
print(ans)
        


Measured memory_bytes: 14440