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

using namespace std;
using ll = long long;
using ii = pair<ll, ll>;

const int MAX { 200010 };
const ll MOD { 1000000007 }, oo { 1LL << 62 };

ll solve(int N, const vector<ll>& xs)
{
    return 0;
}

int main()
{
    ios::sync_with_stdio(false);

    int H, A;
    cin >> H >> A;


    cout << (H + A - 1)/A << '\n';

    return 0;
}


Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split()))
ans = 'Yes'
if N == 1:
  print(ans)
else:
  for i in range(N-1):
    if i == 0:
      if H[0]-1 > H[1]:
        ans = 'No'
        break
      elif H[0]-1 == H[1]:
        H[0] -= 1
        continue
    else:
      if H[i] <= H[i+1]:
        if H[i-1]<=H[i]-1:
          H[i] -=1
        continue
      elif H[i]-1 > H[i+1]:
        ans = 'No'
        break
      elif H[i]-1 == H[i+1]:
        if H[i-1] == H[i]:
          ans = 'No'
          break
        else:
          H[i] -= 1
  print(ans)

Measured memory_bytes: 14704
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll n;
ll num_count = 0;

bool judge(ll m){
    bool flag_3 = false, flag_5 = false, flag_7 = false;
    string t = to_string(m);
    for(int i = 0; i < t.size(); i++){
        if(t[i] == '3')flag_3 = true;
        if(t[i] == '5')flag_5 = true;
        if(t[i] == '7')flag_7 = true;
    }
    if(flag_3 && flag_5 && flag_7)return true;
    else return false;
}
void count_753(ll num){
    if(num > n) return;
    if(judge(num))num_count++;

    count_753(num * 10 + 3);
    count_753(num * 10 + 5);
    count_753(num * 10 + 7);
}

int main(){
    cin >> n;
    count_753(0);
    cout << num_count << endl;
}

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

using namespace std;

#define sp(x) cout<<setprecision(x);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define all(a) (a).begin(), (a).end()
#define inf 10000000
#define linf INT64_MAX*0.99
#define print(s) cout<<(s)<<endl
#define lint long long
#define yes "Yes"
#define no "No"

typedef pair<int, int> P;
 
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> cnt(4);
    REP(i,3){
        int a, b;
        cin>>a>>b;
        a--; b--;
        cnt[a]++;
        cnt[b]++;
    }
    sort(all(cnt));
    if(cnt[0]==0||cnt[3]==3) print("NO");
    else print("YES");
    return 0;
}


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

flag = 0
for i in a:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 != 0:
            flag = 1

if flag == 0:
    print("APPROVED")
else:
    print("DENIED")

Measured memory_bytes: 3068
#include <bits/stdc++.h>
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; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }


int main() {
    int N;
    cin >> N;
    int res = 0;
    for (int n = 1; n <= N; n += 2) {
        int cnt = 0;
        for (int i = 1; i <= n; ++i) if (n % i == 0) ++cnt;
        if (cnt == 8) ++res;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <iostream>
//#include <iomanip>
//#include <string>
//#include <vector>
//#include <algorithm>
//#include <utility>
//#include <set>
//#include <map>
//#include <queue>
//#include <deque>
//#include <bitset>
//#include <math.h>
using namespace std ;
using ll = long long ;
//using ld = long double ;
//using vll = vector<ll> ;
//using vvll = vector<vll> ;
//using vc = vector<char> ;
//using vvc = vector<vc> ;
//using vb = vector<bool> ;
//using vvb = vector<vb> ;
//using pll = pair<ll,ll> ;

//ll mod = 1000000007 ;
//long double pie = acos(-1) ;

//void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
//ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
//ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
//ll sa(long long a,long long b){if(a>b) return a-b ; return b-a ;}
//void mysort(vector<long long> &a){sort(a.begin(),a.end()) ;}
//void myrev(vector<long long> &a){reverse(a.begin(),a.end()) ;}

int main(){
	ll ans = 0 ;
	for(int i=0;i<4;i++){
		ll a ; cin >> a ;
		ans += a ;
	}
	cout << ans << endl ;
}



Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
using namespace std;

#define ll long long int

const int MOD = 1000000007;

int max(int a, int b) {

	if (a > b)return a;
	else return b;

}
int main() {

	ll a, b, x, counta, countb, ans;

	cin >> a >> b >> x;

	if (a == 0)counta = 0;
	else counta = (a - 1) / x + 1;

	if (b == 0)countb = 1;
	else countb = b / x + 1;

	cout << countb - counta << endl;

	return 0;
}

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

int main() {
  long n, a, b, c, d;
  cin >> n;
  cin >> a >> b >> c >> d;
  b = abs(a - b);
  a = 0;
  string ans = "NO";
  long m = n - 1;
  for (long i = 0; i <= m; i++) {
    long max = d * i - c * (m - i);
    long min = c * i - d * (m - i);
    if (min <= b && b <= max) {
      ans = "YES";
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3128
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;

int main() {
    int n;
    cin >> n;
    int now = 0;
    rep(i,n) {
        int h;
        cin >> h;
        if(h >= now) now = h;
        else if(h < now-1) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 256
//============================================================================
// Name        : CODEFESTIVAL2017qualA.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

inline int main1();
inline int main2();
inline int main3();
inline int main4();

int main() {

	main3();

	return 0;
}

inline int main2() {

	int i, j, k;
	int num;
	int a, b;
	long long int max_a, min_b;

	max_a = 0;
	min_b = 1000000000;

	cin >> num;

	for (i = 0; i < num; i++) {
		cin >> a >> b;
		if (max_a < a) {
			max_a = a;
			min_b = b;
		}

	}

	cout << max_a + min_b;

	return 0;

}

inline int main3() {

	long long int i, j, k_a, k;
	long long int num;

	cin >> num;

	for (i = 1; i < 3501; ++i)
		for (j = 1; j < 3501; ++j) {
			//for (k = 1; k < 3501; ++k)
			//if (0 ==(4 * i * j * k) - (num * (i * j + j * k + k * i))) {

			k_a = 4 * i * j - num * (i + j);

			if (k_a == 0)
				continue;

			if (((num * i * j) % k_a) != 0)
				continue;

			k = (num * i * j) / k_a;
			if (k <= 3500 && k > 0) {
				cout << i << " " << j << " " << k;
				return 0;
			}
		}

	return 0;

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define mod 1000000007ll
#define mod1 998244353ll
#define endl '\n'
#define inf ((ll)1e18+1)
#include<chrono>
using namespace chrono;
mt19937_64 rng(high_resolution_clock::now().time_since_epoch().count());
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define debr(x,y) {cout<<"-->  "<<#x<<" to "<<#y<<" :  "; auto itr=x; while(itr!=y) cout<<(*itr++)<<' '; cout<<endl; }
#define deba(x) {cout<<"-->  "<<#x<<" :  "; for(auto ele:(x)) cout<<ele<<"  "; cout<<endl; }
#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s);istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout<<endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a <<"  ,  ";
    err(++it, args...);
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    ll t=1;
    // cin>>t;
    while(t--){
        ll n;
        cin>>n;
        vector<ll> ans(n+1,0);
        for(ll x=1;x<=n;x++){
            for(ll y=1;y<=n;y++){
                ll val1=x*y+y*y;
                if(val1>n)break;
                for(ll z=1;z<=n;z++){
                    ll val=x*x+y*y+z*z+x*y+y*z+z*x;
                    if(val>n)break;
                    ans[val]++;
                }
            }
        }
        for(ll x=1;x<=n;x++){
            cout<<ans[x]<<endl;
        }
        // cout<<endl;
    }
    return 0;

}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int n, a[9];
int main() {
	cin >> n;
	rep(i, n)a[i] = i + 1;
	do {
		rep(i, n)cout << a[i] << (i == n - 1 ? "\n" : " ");
	} while (next_permutation(a, a + n));
	return 0;
}


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

using namespace std;

using ll = long long;

#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FORE(i, a, b) for(int i=(a);i<=(b);++i)
#define rep(i, n) for(int i=0;i<(n);++i)
#define repe(i, n) for(int i=0;i<=(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define SP cout<<fixed<<setprecision(10)
typedef pair<int, int> P;
const int inf = (int) 1e9;
const int mod = (int) 1e9 + 7;

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

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

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

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

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n, m;
	cin >> n >> m;
	
	vector<int> can[n], lang[m];
	rep(i, n) {
		int k;
		cin >> k;
		rep(j, k) {
			int l;
			cin >> l;
			l--;
			can[i].push_back(l);
			lang[l].push_back(i);
		}
	}
	
	bool people[n], langs[m];
	memset(people,0, sizeof(people));
	memset(langs,0, sizeof(langs));
	queue<int> q;
	people[0]=true;
	for(int l: can[0]){
		langs[l]=true;
		q.push(l);
	}
	while(!q.empty()){
		int v=q.front();
		q.pop();
		for(int person: lang[v]){
			if(people[person]) continue;
			people[person]=true;
			for(int l:can[person]){
				if(langs[l]) continue;
				langs[l]=true;
				q.push(l);
			}
		}
	}
	
	rep(i,n){
		if(not people[i]){
			cout<<"NO"<<endl;
			return 0;
		}
	}
	
	cout<<"YES"<<endl;
	
	return 0;
}

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

#define int long long
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}

int N;
vint G[2222];

bool used[222];
bool dfs(int v,int p,int s){
    if(used[v]){
        if(s==v)return true;
        return false;
    }
    used[v]=true;
    rep(i,G[v].size()){
        int to=G[v][i];
        if(to==p)continue;
        if(dfs(to,v,s))return true;
    }
    return false;
}

signed main(){
    cin>>N;
    rep(i,N){
        int a,b;
        string s;
        cin>>a>>s>>b;
        a--;b--;b+=100;
        if(s=="wait")G[a].pb(b);
        else G[b].pb(a);
    }

    bool f=false;
    rep(i,200){
        fill_n(used,200,false);
        f|=dfs(i,-1,i);
    }
    cout<<f<<endl;
    return 0;
}

Measured memory_bytes: 1292
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        int g = sc.nextInt();
        int b = sc.nextInt();
        if((r * 100 + g * 10 + b) % 4 == 0){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
}


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

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

const int mod=1000000007;

struct WUnion {
  vector< int > data;
  vector< int > diff_weight;
 
  WUnion(int sz) {
    data.assign(sz, -1);
    diff_weight.assign(sz,0);
  }
 
  bool unite(int x, int y, int w) {
    w+=weight(x);w-=weight(y);
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y), w=-w;
    data[x] += data[y];
    data[y] = x;
    diff_weight[y]=w;
    return (true);
  }
 
  int find(int k) {
    if(data[k] < 0) return (k);
    else{
        int r=find(data[k]);
        diff_weight[k]+=diff_weight[data[k]];
        return (data[k] = find(data[k]));
    }
  }
 
  int size(int k) {
    return (-data[find(k)]);
  }
  int weight(int k){
      find(k);
      return diff_weight[k];
  }
  int diff(int x, int y){
      return weight(y)-weight(x);
  }
};

int main(){
    int n,m;
    cin>>n>>m;
    WUnion uf(n);
    bool flag=1;
    rep(i,m){
        int l,r,d;
        cin>>l>>r>>d;
        if(!uf.unite(l,r,d)){
            if(uf.diff(l,r)!=d){
                flag=0;
                break;
            }
        }
    }
    cout<<(flag?"Yes":"No")<<endl;
}


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

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<vector<int>> dp(n+1, vector<int>(3, 0));
    vector<vector<int>> abc(n, vector<int>(3));
    rep(i, n) cin >> abc[i][0] >> abc[i][1] >> abc[i][2];
    rep(i, n) {
        rep(j, 3) {
            // chmax(dp[i+1][j], dp[i][j] + abc[i][j]);
            rep(k, 3) {
                if (j == k) continue;
                chmax(dp[i+1][j], dp[i][k] + abc[i][j]);
            }
        }
    }
    cout << max({dp[n][0], dp[n][1], dp[n][2]}) << endl;
    return 0;
}

Measured memory_bytes: 11264
diceface = { "TOP":0,"FRONT":1,"RIGHT":2,"LEFT":3,"BACK":4,"BOTTOM":5 }

dice = [ int( i ) for i in raw_input( ).split( " " ) ]
roll = raw_input( )
for i in range( len(  roll ) ):
	if "E" == roll[i]:
		t = dice[ diceface["TOP"] ]
		dice[ diceface["TOP"] ] = dice[ diceface["LEFT"] ]
		dice[ diceface["LEFT"] ] = dice[ diceface["BOTTOM"] ]
		dice[ diceface["BOTTOM"] ] = dice[ diceface["RIGHT"] ]
		dice[ diceface["RIGHT"] ] = t
	elif "N" == roll[i]:
		t = dice[ diceface["TOP"] ]
		dice[ diceface["TOP"] ] = dice[ diceface["FRONT"] ]
		dice[ diceface["FRONT"] ] = dice[ diceface["BOTTOM"] ]
		dice[ diceface["BOTTOM"] ] = dice[ diceface["BACK"] ]
		dice[ diceface["BACK"] ] = t
	elif "S" == roll[i]:
		t = dice[ diceface["TOP"] ]
		dice[ diceface["TOP"] ] = dice[ diceface["BACK"] ]
		dice[ diceface["BACK"] ] = dice[ diceface["BOTTOM"] ]
		dice[ diceface["BOTTOM"] ] = dice[ diceface["FRONT"] ]
		dice[ diceface["FRONT"] ] = t
	elif "W" == roll[i]:
		t = dice[ diceface["TOP"] ]
		dice[ diceface["TOP"] ] = dice[ diceface["RIGHT"] ]
		dice[ diceface["RIGHT"] ] = dice[ diceface["BOTTOM"] ]
		dice[ diceface["BOTTOM"] ] = dice[ diceface["LEFT"] ]
		dice[ diceface["LEFT"] ] = t	

print( dice[ diceface["TOP"] ] )

Measured memory_bytes: 4328
#include<iostream>
#include<cstring>
#include<vector>
#include<queue>
#include<map>
#define P pair<int, int>


using namespace std;

vector<int> v[100009];
map<P, int> m;
map<int, int> d;

int main(){
    int n, tmpa, tmpb, a[100009], b[100009], check[100009], mxd=0;
    memset(check, 0, sizeof(check));
    queue<P> Q;
    cin >> n;
    for(int i=0;i<n-1;i++){
        cin >> tmpa >> tmpb;
        tmpa--;tmpb--;
        v[tmpa].push_back(tmpb);
        v[tmpb].push_back(tmpa);
        a[i] = tmpa; b[i] = tmpb;
        d[tmpa]++;d[tmpb]++;
    }
    for(int i=0;i<n;i++){
        mxd = max(mxd, d[i]);
    }
    cout << mxd << endl;
    check[0] = 1;
    for(int i=0;i<v[0].size();i++){
        Q.push(P(v[0][i], i));
        m[P(0, v[0][i])] = i;
        m[P(v[0][i], 0)] = i;
        check[v[0][i]] = 1;
    }
    while(!Q.empty()){
        int cnt = 0;
        int fr = Q.front().first;
        int cl = Q.front().second;
        Q.pop();
        for(int i=0;i<v[fr].size();i++){
            if(cnt==cl)cnt++;
            if(check[v[fr][i]]==0){
                check[v[fr][i]] = 1;
                Q.push(P(v[fr][i], cnt));
                m[P(fr, v[fr][i])] = cnt;
                m[P(v[fr][i], fr)] = cnt;
                cnt++;
            }
        }
    }
    for(int i=0;i<n-1;i++){
        cout << m[P(a[i], b[i])] + 1 << endl;
    }
}

Measured memory_bytes: 24448
# coding: utf-8
# Your code here!

while True:
    n, k = map(int,input().split())
    if n == 0 and k == 0:
        break
    a = [int(input()) for _ in range(n)]
    s = sum(a[0:k])
    ss = [s]
    for i in range(k, n):
        s = s + a[i] - a[i-k]
        ss.append(s)
    print(max(ss))


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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    map<int,int>mp;
    rep(i,n)
    {
        cin >> a[i];
        mp[a[i]]++;
    }
    sort(a.begin(),a.end());
    a.erase(std::unique(a.begin(), a.end()), a.end());
    vector<int> cand;
    for (auto &&i : a)
    {
        if(mp[i]>=2)
        {
            cand.push_back(i);
            if (mp[i] >= 4)cand.push_back(i);
        }
    }
    if(sz(cand) < 2)
    {
        cout << 0 << endl;
        return 0;
    }
    
    sort(cand.begin(),cand.end(),greater<int>());

    cout << (ll)cand[0]*(ll)cand[1] << endl;

}

Measured memory_bytes: 5376
package main

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

func main() {
	b := readBytes()
	fmt.Println(string(b[0] + 1))
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


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

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef pair<LL, LL> PLL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  string S; cin >> S;
  int N = SZ(S);
  REP(i,N){
	if(i+2 <= N){
	  if(S[i] == S[i+1]){
		cout << i+1 << " " << i+2 << endl;
		return 0;
	  }
	}
	if(i+3 <= N){
	  if(S[i] == S[i+2]){
		cout << i+1 << " " << i+3 << endl;
		return 0;
	  }
	}
  }

  cout << "-1 -1" << endl;
  
  return 0;
}


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

int main(){
    int n,m;
    cin >> n >> m;
    vector <vector <int>> y(m,vector <int> (2));
    int a,b;
    rep(i,m){
        cin >> a >> b;
        y[i][0]=a;
        y[i][1]=b;
    }

    sort(y.begin(),y.end());
    int ans=0;
    if(m>=1){
        ++ans;
    }

    int r,l;
    rep(i,m){
        //cout << y[i][0] << y[i][1] << endl;
        if(i==0){
            l=y[0][0];
            r=y[0][1];
        }
        else{
            if(y[i][0]>=r){
                ++ans;
                l=y[i][0];
                r=y[i][1];
            }
            else{
                l=y[i][0];
                r=min(r,y[i][1]);
            }
        }
    }

    cout << ans << endl;
    

    return 0;
}

Measured memory_bytes: 8756
S = input()
N = len(S)
K = int(input())

def cmb(n, r):
    if r < 0 or r > n:
        return 0
    if r == 1:
        return n
    elif r == 2:
        return n * (n-1) // 2
    else:
        return n * (n-1) * (n-2) // (3 * 2) 

def rec(i, k, isSmaller):
    if i == N:
        if k == 0:
            return 1
        else:
            return 0
    
    if k == 0:
        return 1
    
    if isSmaller:
        return cmb(N-i, k) * pow(9, k)
    else:
        if S[i] == '0':
            return rec(i+1, k, False)
        else:
            zero = rec(i+1, k, True)
            between = rec(i+1, k-1, True) * (int(S[i]) - 1)
            same = rec(i+1, k-1, False)
            return zero + between + same

print(rec(0, K, False))


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

int main(){
	int n, t;
	cin>>n; cin>>t;
	int res=1001;
	for (int i=0; i<n; i++){
		int c, tx;
		cin>>c; cin>>tx;
		if (tx<=t&&c<res)
			res=c;
	}
	if (res==1001) cout<<"TLE"<<endl;
	else cout<<res;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  int N,M,C;cin>>N>>M>>C;
  typedef pair<int,int> P;
  typedef pair<int,P> PP;
  std::vector<P> e[N];
  std::vector<int> g[N];
  std::vector<PP> ed(M);
  for(int i=0;i<M;i++){
    int a,b,c;cin>>a>>b>>c;
    a--;b--;c-=C;
    e[a].push_back(P(b,c));//1->Nの経路にあるかチェック用
    g[b].push_back(a);//これもそう
    ed[i]=PP(a,P(b,c));
  }
  std::vector<int> used(N,0),gused(N,0);//これもチェック用 used[i]:0からいけるか　gused[i]:N-1にいけるか
  queue<int> que;
  que.push(0);
  while(que.size()){//ここからチェック
    int p=que.front();que.pop();if(used[p])continue;
    used[p]++;
    for(auto q:e[p]){
      int k=q.first;
      if(used[k])continue;
      que.push(k);
    }
  }
  que.push(N-1);
  while(que.size()){
    int p=que.front();que.pop();if(gused[p])continue;
    gused[p]++;
    for(int q:g[p]){
      if(gused[q])continue;
      que.push(q);
    }
  }//ここまでチェック
  std::vector<int> d(N,-INF);
  d[0]=0;
  for(int i=0;i<N;i++){//ベルマンフォード
    for(int j=0;j<M;j++){
      int u=ed[j].first,v=ed[j].second.first,w=ed[j].second.second;
      if(used[u]*used[v]*gused[u]*gused[v]==0)continue;
      d[v]=max(d[v],d[u]+w);
    }
  }
  bool f=false;
  for(int j=0;j<M;j++){
    int u=ed[j].first,v=ed[j].second.first,w=ed[j].second.second;
    if(used[u]*used[v]*gused[u]*gused[v]==0)continue;
    if(d[v]<d[u]+w)f=true;//まだ更新できるなら閉路存在
  }
  if(f)cout<<-1<<endl;
  else cout<<max(0LL,d[N-1])<<endl;
}


Measured memory_bytes: 768
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min = 0;
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            int j = sc.nextInt();//当前数
            if (i == 0) {
                min = j;
            }else{
                max=Math.max(max,j-min);
                min=Math.min(min,j);
            }
        }
        System.out.println(max);
    }}


Measured memory_bytes: 99792
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val a = Array.fill(sc.nextInt())(sc.nextInt())
  val even = a.count(_ % 2 == 0)
  println(math.pow(3, a.length).toInt - math.pow(2, even).toInt)
  
}


Measured memory_bytes: 55416
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MP make_pair
#define INF (sizeof(int) == 4 ? 1e9:1e18)
#define EPS 0.0000000001
using namespace std;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
template<class T> void join(T a){int b=0;for(auto itr :a){if(b++!=0)cout << " "; cout << itr;} }
using ll  = long long;
using ld  = long double;
using pii = pair<int,int>;
using piii = pair<int,pii>;
int W,H;
int dx[]={0,0,1,-1}, dy[]={1,-1,0,0};
bool valid(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
#define int ll
signed main(){
    int n,m;
    while(cin >> n >> m, n+m){
        auto Ld = vectors(301,301,INF);
        auto Sd = vectors(301,301,INF);
        rep(i,n)Ld[i][i] = Sd[i][i] = 0;
        rep(i,m){
            int a,b,c; char s;
            cin >> a >> b >> c >> s;
            --a,--b;
            if(s == 'L'){
                cmin(Ld[a][b],c);
                Ld[b][a] = Ld[a][b];
            }else{
                cmin(Sd[a][b], c);
                Sd[b][a] = Sd[a][b];
            }
        }
        rep(k,n)rep(i,n)rep(j,n){
            cmin(Sd[i][j],Sd[i][k] + Sd[k][j]);
            cmin(Ld[i][j],Ld[i][k] + Ld[k][j] );
        }
        int r; cin >> r;
        vector<int>v;
        rep(i,r){
            int t; cin >> t;
            v.push_back(--t);
        }
        auto dp = vectors(1000+1,300+1,INF);
        dp[0][v[0]]=0;
        rep(i,r-1){
            rep(k,n){
                cmin(dp[i+1][k],dp[i][k]+Ld[v[i]][v[i+1]]);
                rep(j,n){
                    cmin(dp[i+1][j],dp[i][k] + Ld[v[i]][k] + Sd[k][j] + Ld[j][v[i+1]]);
                }
            }
        }
        int ans = INF;
        rep(i,n)cmin(ans,dp[r-1][i]);
        cout << ans << endl;
    }
}



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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int n;cin>>n;
  cout<<pow(n,3)<<endl;

  return 0;
}


Measured memory_bytes: 384
# coding=utf-8


class Dice(object):

    def __init__(self, list_):
        self.label = list_

    def getLabel(self, i):
        return self.label[i - 1]

    def _rotateS(self):
        self.label = [self.getLabel(i) for i in [5, 1, 3, 4, 6, 2]]

    def _rotateN(self):
        self.label = [self.getLabel(i) for i in [2, 6, 3, 4, 1, 5]]

    def _rotateE(self):
        self.label = [self.getLabel(i) for i in [4, 2, 1, 6, 5, 3]]

    def _rotateW(self):
        self.label = [self.getLabel(i) for i in [3, 2, 6, 1, 5, 4]]

    def _spinPos(self):
        self.label = [self.getLabel(i) for i in [1, 4, 2, 5, 3, 6]]

    def _spinNeg(self):
        self.label = [self.getLabel(i) for i in [1, 3, 5, 2, 4, 6]]

    def rotate(self, rotates):
        for r in rotates:
            if r == 'S':
                self._rotateS()
            elif r == 'N':
                self._rotateN()
            elif r == 'E':
                self._rotateE()
            elif r == 'W':
                self._rotateW()
            elif r == 'T':
                self._spinPos()
            elif r == 'B':
                self._spinNeg()

    def matchTopFront(self, top, front):
        iTop = self.label.index(top) + 1
        topRot = {1: '', 2: 'N', 3: 'W', 4: 'E', 5: 'S', 6: 'SS'}
        self.rotate(topRot[iTop])

        iFront = self.label.index(front) + 1
        frontRot = {2: '', 3: 'B', 4: 'T', 5: 'TT'}
        self.rotate(frontRot[iFront])

    def copy(self):
        return Dice(self.label[:])

    def __eq__(self, other):
        # ?????¢???????????¢?????\????????§6????????????
        for rs in ['', 'S', 'N', 'E', 'W', 'SS']:
            tmp = self.copy()
            for r in rs:
                tmp.rotate(r)
            # ?????¢????????¢????????§??????
            top = tmp.getLabel(1) == other.getLabel(1)
            bottom = tmp.getLabel(6) == other.getLabel(6)
            # ??´??¢?????????????????????????????????????????¢??????????????????????????´??????????????°??????
            # top and bottom ???False??????????????????????????????????????§?????¢??°?????????
            def side():
                result, n = False, 3
                while not result and n > 0:
                    if tmp.label[1:5] == other.label[1:5]:
                        result = True
                    else:
                        tmp.rotate('T')
                        n -= 1
                return result
            if top and bottom and side():
                return True
        else:
            return False


def main():
    face1 = map(int, raw_input().split())
    face2 = map(int, raw_input().split())
    # ????????????????????????????????´?????????????????´???
    if set(face1) != set(face2):
        print 'No'
    # ???????????????????????´???
    elif len(face1) == len(set(face1)):
        d1 = Dice(face1)
        d2 = Dice(face2)
        d2.matchTopFront(d1.getLabel(1), d1.getLabel(2))
        print 'Yes' if d1.label == d2.label else 'No'
    # ???????????????????????´???
    else:
        d1 = Dice(face1)
        d2 = Dice(face2)
        print 'Yes' if d1 == d2 else 'No'

if __name__ == '__main__':
    main()

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


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

int main(void){
	int n, i;
	scanf("%d", &n);
	int b[200000];
	char c = (n%2==0);
	int l=n/2, r=l;
	scanf("%d", b+l);
	for(i=1; i<n; i++){
		int j;
		if(c==0){
			c=1;
			j=++r;
		}else{
			c=0;
			j=--l;
		}
		scanf("%d", b+j);
	}
	for(i=0; i<n; i++){
		printf("%d ", b[i]);
	}
	putchar(10);
}


Measured memory_bytes: 2816
#define _GLIBCXX_DEBUG
// header {{{
#include <bits/stdc++.h>
using namespace std;
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y
#define ASSERT(expr...) assert((expr))
using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using f80 = __float80;
// }}}
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
// util {{{
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}
// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

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

signed main() {
    int n;
    cin>>n;
    bool flg=false;
    for(int i=1;i<=9;i++){
        if( n % i == 0 && 1 <= n / i && n / i <= 9){
            flg=true;
        }
        

    }
    if(flg){
        cout<<"Yes"<<endl;

    } else {
        cout<<"No"<<endl;
    }

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

Measured memory_bytes: 256
/* template.cpp [[[ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)s)
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)s)
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const ll mod = 1e9 + 7;
const ll mod9 = 1e9 + 9;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
struct prepare_ { prepare_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } prepare__;
ll in(){ ll x; cin >> x; return x; }
vector<ll> in(size_t n){ vector<ll> v(n); each(x, v) cin >> x; return v; }
/* ]]] */

int h, w, n;
int a[100000], b[100000];
map<pair<int, int>, int> s;
ll c[10];

int main(){
  cin >> h >> w >> n;
  rep(i, n) cin >> a[i] >> b[i], a[i]--, b[i]--;
  rep(i, n) rep(j, -2, 1) rep(k, -2, 1){
    if (j == 0 && k == 0) s[{a[i], b[i]}] += 1;
    else s[{a[i] + j, b[i] + k}] += 0;
  }
  auto ss = s;
  int cn = 0;
  each(p, ss){
    if (p.fs.fs < 0 || p.fs.sc < 0) continue;
    if (p.fs.fs + 3 > h || p.fs.sc + 3 > w) continue;
    cn++;
    int t = 0;
    rep(i, 3) rep(j, 3) t += s[{p.fs.fs + i, p.fs.sc + j}];
    c[t]++;
  }
  c[0] += (ll)(h - 2) * (w - 2) - cn;
  rep(i, 10) cout << c[i] << endl;
}


Measured memory_bytes: 213504
import math

def gcd(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
      a, b = b, a % b
    return b


def lcm(a, b):
    return (a * b) // gcd(a, b)

a, b = map(int, input().split())
print(lcm(a, b))

Measured memory_bytes: 3060
//Author- Vaibhav singh


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_multiset tree<long long , null_type,less_equal<long long >, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set tree<long long , null_type,less<long long >, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define ll long long int
#define YES cout<<"YES"<<"\n";
#define NO cout<<"NO"<<"\n";
#define ld     long double 
#define yes cout<<"yes"<<"\n";
#define no cout<<"no"<<"\n";
#define No cout<<"No"<<"\n";
#define Yes cout<<"Yes"<<"\n";
#define f(i,a) for(i=0;i<a;i++)
#define fo(i,a) for(i=1;i<=a;i++)
#define fa(i,a) for(auto i:a)
#define r(i,a) for(auto i=a.rbegin();i!=a.rend();i++)
#define en cout<<"\n";
#define ull unsigned long long int
#define o(x) cout<<x<<"\n";
#define o1(x) cout<<x<<" ";
#define pb push_back
#define F first
#define in insert
#define mp make_pair
#define S second
#define pre(n) cout<<fixed<<setprecision(n);
#define      gcd(a,b)    __gcd(a,b)
#define bs            binary_search
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test ll t;cin>>t;while(t-->0)
const ll Mod = 998244353;
#define mod 1000000007
#define pi 3.14159265358979323846
#define re return 0;
// *#######################################################################################*
/*
ll prf(ll n)
{
    ll c=0,i;
    while(n%2==0)
    {
        n=n/2;
        c++;
    }
    for(i=3;i*i<=n;i++)
    {
        while(n%i==0)
    }
    
    
    
}
*/

int main()
{
      
   fast 
   ll a,c=0;
   string s;
   cin>>a>>s;
   c=((s[0]-'0')*100)+(s[2]-'0')*10+(s[3]-'0');
   
   ll p=(ll)(a*c);
   
   o(p/100)
   
   
   
   
   
   
   
    re
}

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

int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    vector<int> a(n+1);
    for (size_t i = 0; i < n+1; i++) cin >> a[i];
    vector<int> b(n);
    for (size_t i = 0; i < n; i++) cin >> b[i];

    long long ans = 0;
    for (int i = 0; i < n; i++) {
        int c;
        c = min(a[i], b[i]);
        a[i] -= c;
        ans += c;

        c = min(a[i+1], b[i]-c);
        a[i+1] -= c;
        ans += c;
    }

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


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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)

int main()
{
  ll n, maxv=0;
  cin >> n;
  string str;
  vector <string> s(n);
  forll(i, 0, n)
	cin >> s[i];
  
  map <string, ll> m;

  forll(i, 0, n)
	m[s[i]]++;

  for(auto x : m)
	maxv = max(maxv, x.second);

  for(auto x : m){
	if (x.second == maxv)
	  cout << x.first << endl;
  }
}


Measured memory_bytes: 26752
#include <stdio.h>

int main(void)
{
    int x;
    int i, n, a, b, k, min;

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

    x=1;
    for (i=0; i<n; i++) {
        if (x*2 < x+k)  x = x*2;
        else            x = x+k;
    }

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

    return 0;
}

Measured memory_bytes: 128
n, x, y = map(int, input().split())
cnt = [0] * n
for i in range(1, n+1):
    for j in range(i+1, n+1):
        cnt[min(j-i, abs(x-i)+1+abs(y-j), abs(y-i)+1+abs(x-j))] += 1

for i in range(1,n):
    print(cnt[i])

Measured memory_bytes: 3444
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;

struct team{
  int id;
  int ans;
  int time;
  team(int i,int a,int t): id(i),ans(a),time(t){}

  bool operator >(const team &e)const {
    if(ans!=e.ans)
      return ans > e.ans;
    if(time != e.time)
      return time<e.time;
    return id>e.id;
  }
  bool operator <(const team &e)const {
    if(ans!=e.ans)
      return ans < e.ans;
    if(time != e.time)
      return time>e.time;
    return id<e.id;
  }
};

int main()
{
  int m,t,p,r;
  for(;cin>>m>>t>>p>>r,m;)
    {
      int teamans[t+1];
      int teamtime[t+1];
      int teampena[t+1][p+1];
      memset(teamans,0,sizeof(teamans));
      memset(teamtime,0,sizeof(teamtime));
      memset(teampena,0,sizeof(teampena));
      for(int i=0;i<r;i++)
	{
	  int mm,tt,pp,jj;
	  cin>>mm>>tt>>pp>>jj;
	  //  if(m>mm)
	  //   continue;
	  if(jj==0)
	    {
	      teamans[tt]++;
	      teamtime[tt]+=mm+teampena[tt][pp];
	    }
	  else
	    {
	      teampena[tt][pp]+=20;
	    }
	}
      priority_queue<team> qu;
      for(int i=1;i<=t;i++)
	{
	  qu.push(team(i,teamans[i],teamtime[i]));
	}
      int buf,buf2;
      bool flag=false;
      
      while(!qu.empty())
	{
	  team tmp =qu.top();
	  qu.pop();
	  if(flag)
	    {
	      if(tmp.ans==buf &&tmp.time==buf2)
		cout<<"=";
	      else
		cout<<",";
	    }
	  flag=true;
	  buf=tmp.ans;
	  buf2=tmp.time;
	  cout<<tmp.id;
	}
      cout<<endl;
      
    }


}

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

using namespace std;
using iii = tuple<int, int, int>;
using mii = map<int, int>;
using vi = vector<int>;
using viii = vector<iii>;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q, a, b;
  cin >> n >> q;
  vi x(n);
  mii m;
  for (int i = 0; i < n; i++) {
    int y;
    cin >> y;
    if (m.count(y)) x[i] = m[y];
    else x[i] = m.size(), m[y] = x[i];
  }
  viii y(q);
  for (int i = 0; i < q; i++) {
    cin >> a >> b;
    y[i] = {a-1, b, i};
  }
  int k = sqrt(n);
  sort(y.begin(), y.end(), [&](iii x, iii y) -> bool {
    int a1, b1, i1, a2, b2, i2;
    tie(a1, b1, i1) = x;
    tie(a2, b2, i2) = y;
    int a1q = a1/k, a2q = a2/k;
    if (a1q < a2q) return true;
    if (a1q > a2q) return false;
    return b1 < b2;
  });
  vi res(q);
  vi count(m.size());
  int l = 0, r = 0, ans = 0;
  for (iii z : y) {
    int i;
    tie(a, b, i) = z;
    while (r < b) if (++count[x[r++]] == 1) ans++;
    while (r > b) if (--count[x[--r]] == 0) ans--;
    while (l < a) if (--count[x[l++]] == 0) ans--;
    while (l > a) if (++count[x[--l]] == 1) ans++;
    res[i] = ans;
  }
  for (int z : res) cout << z << '\n';
}

Measured memory_bytes: 38960
X, K, D = list(map(int,input().split()))

ans = 0
if abs(K * D) < abs(X):
    ans = (abs(X) - abs(K * D))
else:
    num = X//D # 距離がD未満になるまでに必要な最小の移動回数
    tmp = (abs(X) - abs(num * D))
    if X < 0:
        tmp *= (-1)
    # 残った回数が奇数の場合
    if (K - num) % 2 == 1:  
        ans = min([abs(tmp - D), abs(tmp + D)])
    else:
        ans = abs(tmp)
        
print(ans)
        


Measured memory_bytes: 9192
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 200100;
const int mod = 1e9 + 7;
const int oo = 1e9;
long long power(long long x, long long k)
{
	long long ans = 1;
	while(k)
	{
		if(k & 1)
			(ans *= x) %= mod;
		k >>= 1;
		(x *= x) %= mod;
	}
	return ans;
}
int n, m;
char s[maxn];
int l = oo;
long long ans = 0;
long long dp[maxn][2][2] = {0}, h[maxn][2][2] = {0}, f[maxn];
int main()
{
	std::ios::sync_with_stdio(false);
	cin >> n >> m;
	for(int i = 1; i <= m; i ++)
		cin >> s[i];
	while(s[m] == s[1] && m >= 1)
		m --;
	if(m != 0)
	{
		int len;
		for(len = 1; len <= m && s[len] == s[1]; len ++);
		len --;
		if(len & 1)
			l = min(l, len);
		else
			l = min(l, len + 1);
		int now = 0;
		for(int i = len + 2; i <= m; i ++)
		{
			if(s[i] != s[1])
			{
				if(now & 1)
					l = min(l, now);
				now = 0;
			}
			else
				now ++;
		}
	}
	if(m == 0)
	{
		f[0] = 2;
		f[1] = 1;
		for(int i = 2; i <= n; i ++)
			f[i] = (f[i - 1] + f[i - 2]) % mod;
		cout << f[n] << endl;
		return 0;
	}
	if(n & 1)
	{
		cout << 0 << endl;
		return 0;
	}
	n >>= 1;
	l >>= 1;
	//cout << n << " " << l << endl;
	dp[1][0][0] = h[1][0][0] = 1;
	dp[1][1][1] = h[1][1][1] = (l > 0);
	//dp[0][0][0] = dp[0][1][1] = h[0][0][0] = h[0][1][1] = 1;
	for(int i = 2; i <= n; i ++)
	{
		//cout << i << " : " << endl;
		dp[i][0][0] = (dp[i - 1][0][1] + dp[i - 1][0][0]) % mod;
		dp[i][0][1] = (h[i - 1][0][0] - h[max(0, i - l - 1)][0][0] + mod) % mod;
		dp[i][1][0] = (dp[i - 1][1][1] + dp[i - 1][1][0]) % mod;
		dp[i][1][1] = (h[i - 1][1][0] - h[max(0, i - l - 1)][1][0] + mod) % mod;
		if(i <= l)
			dp[i][1][1] ++;
		for(int asd1 = 0; asd1 < 2; asd1 ++)
			for(int asd2 = 0; asd2 < 2; asd2 ++)
				h[i][asd1][asd2] = (h[i - 1][asd1][asd2] + dp[i][asd1][asd2]) % mod;
		//cout << dp[i][0][0] << " " << dp[i][0][1] << " " << dp[i][1][0] << " " << dp[i][1][1] << endl;
		//cout << h[i][0][0] << " " << h[i][0][1] << " " << h[i][1][0] << " " << h[i][1][1] << endl;
	}
	for(int i = 1; i <= min(l, n); i ++)
		dp[i][1][1] --;
	long long ans = 0;
	for(int i = 1; i <= n; i ++)
	{
		(ans += (n - i) * dp[i][1][1]) %= mod;
		if(i <= l && n - i > 1)
			(ans += (n - i)) %= mod;
		if(n - i <= l && i >= 2)
			(ans += (n - i) * dp[i][0][0]) %= mod;
		//cout << i << " " << ans << endl;
	}
	ans ++;
	//cout << ans << endl;
	if((l >= n - 1) && n != 1)
		ans += n;
	cout << (ans * 2 + (m == 0 && n != 1)) % mod << endl;
	return 0;
}
/*
1 3
BBB
*/

Measured memory_bytes: 11136