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

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define LL long long
#define SZ(X) X.size()
#define pii pair<int,int>
#define ALL(X) X.begin(),X.end()

using namespace std;

LL gcd(LL a, LL b) {return b ? gcd(b, a % b) : a;}
LL lcm(LL a, LL b) {return a / gcd(a, b) * b;}
LL powmod(LL a, LL b, LL MOD) {LL ans = 1; while (b) {if (b % 2)ans = ans * a % MOD; a = a * a % MOD; b /= 2;} return ans;}
const int N = 2e5 + 11;
int main() {
	ios::sync_with_stdio(false);
	LL x;
	cin >> x;
	if (x & 1)cout << 0 << endl;
	else {
		LL ans = 0; x /= 2;
		while (x) {
			ans += x / 5;
			x /= 5;
		}
		cout << ans << endl;
	}
	return 0;
}

//lfxxfl
//fflxxl
//zlhfwx
//hfzlwx




Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,n) for(ll i=0;i<(n);++i)
#define REPR(i,n) for(ll i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

map< ll, int > prime_factor(int64_t n) {
  map< ll, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}



int main(int argc, char const *argv[]) {
    ll n; cin>>n;

    map<ll, int> mp = prime_factor(n);

    vector<ll> cnt(71);
    rep(i,70) {
        cnt[i+1] = cnt[i]+i+1;
    }

    ll ans = 0;

    for (auto &&e: mp) {
        auto itr = upper_bound(cnt.begin(), cnt.end(), e.second);
        --itr;
        int idx = itr-cnt.begin();
        ans += idx;
    }

    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3604
#!/usr/bin/env python3
import sys
from itertools import accumulate
import math

def solve(N: int, K: int, a: "List[int]"):
    accum = [0] + list(accumulate(a))
    sum_list = []
    for i in range(0,N):
        for j in range(i+1,N+1):
            sum_list.append(accum[j]-accum[i])
    sum_list.sort(reverse=True)
    max_bit = int(math.log2(sum_list[0]))
    answer = 0

    for i in range(max_bit,-1,-1):
        count = 0
        tmp = []
        for j in range(len(sum_list)):
            if sum_list[j] & 1<<i:
                count +=1
                tmp.append(sum_list[j])
            
        if count >= K:
            answer += 2**i
            sum_list = tmp
    print(answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    a = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, a)

if __name__ == '__main__':
    main()


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



 bool IsPrime(int num){
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main() {
    int n;
    cin>>n;
    for(int64_t i=n;i>0;i++){
        if(IsPrime(i)){
            cout<<i<<endl;
            break;
        }
    }
}
    
    
    
    
    

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main () {
  long N, K;
  cin >> N >> K;
  vector<long> data(N);
  long d, a;
  for(int i = 0; i < N; i++){
    cin >> d;
    for(int j = 0; j < d; j++){
      cin >> a;
      data.at(a - 1)++;
    }
  }
  long ans = 0;
  for(int i = 0; i < N; i++){
    if(data.at(i) == 0)ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3628
import sys
dataset = sys.stdin.readlines()
 
for item in dataset:
    a, b, c, d, e, f = list(map(int, item.split()))
 
    y = (c * d - f * a)/(b * d - e * a)
    x = (c * e - b * f) / (a * e - b * d)
    if x == 0:
        x = 0
    print("{:.3f} {:.3f}".format(x, y))

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

/*******  All Required define Pre-Processors and typedef Constants *******/
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define Dcout(a) cout << setprecision(20) << a << endl
#define MP make_pair
#define PB push_back
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
using ll = long long;
using PAIR = pair<int, int>;
using Graph = vector<vector<int>>;
//const ll INF = (1LL << 60);
//const double pi=acos(-1.0);
#define debug cout << "line : " << __LINE__ << " debug" << endl
/****** Template of some basic operations *****/
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; }
/**************************************/

/******** User-defined Function *******/




/**************************************/

/********** Main()  function **********/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

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

  rep(i,5){
      if(a[i]==0){
          cout << i+1 << endl;
          return 0;
      }
  }

  return 0;
}
/********  Main() Ends Here *************/


Measured memory_bytes: 3672
import sys
from functools import reduce
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    a_tuple = tuple(map(int, input().split()))
    a_mul = reduce(lambda a, b: a*b, a_tuple)
    print(a_mul / sum([a_mul / a for a in a_tuple]))

if __name__ == '__main__':
    main()


Measured memory_bytes: 3572
import sys
def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

n, X = map(int, sys.stdin.buffer.readline().split())
x = list(map(int, sys.stdin.buffer.readline().split()))
ans = abs(X - x[0])
for i in x[1:]:
    tmp = abs(X - i)
    if tmp % ans:
        ans = gcd(tmp, ans)
print(ans)

Measured memory_bytes: 12496
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <assert.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define x first
#define y second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define SZ(x) int(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define pi acos(-1)
#define mod 998244353 //1000000007
#define inf 1000000007
#define ll long long
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
#define N 100010

template <class U,class T> void Max(U &x, T y){if(x<y)x=y;}
template <class U,class T> void Min(U &x, T y){if(x>y)x=y;}
template <class T> void add(int &a,T b){a=(a+b)%mod;}

int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=1LL*ans*a%mod;
        a=1LL*a*a%mod;b>>=1;
    }
    return ans;
}

ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int main(){
    //cout<<setprecision(9)<<fixed;
    srand(time(NULL));
    int T,ca=0,m=0,k,i,j,n,K;
	scanf("%d",&T);
	ll a,b,c,d;
	while(T--){
		scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
		if(d<b||a<b){
			puts("No");continue;
		}
		a-=b;
		ll x=max(0LL,(a-c)/b);
		a-=b*x;
        if(a>c){
            if(a<b){
                puts("No");continue;
            }
            a-=b;
        }
		d%=b;
		if(d==0){
			puts("Yes");continue;
		}
		if(c>=b-1){
			puts("Yes");continue;
		}
		ll g=gcd(b,d);
		ll l=c-a,r=b-a;
		r=(r-1)/g;
		l=l/g+1;
		//d/=g,b/=g;
		//cerr<<l<<" "<<r<<" "<<g<<" "<<d<<" "<<b<<"\n";
		//cerr<<a<<" "<<c<<" "<<b<<"\n"; 
		if(l>r)puts("Yes");
		else puts("No");
	}
}	



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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


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

      ll n;
      ll Six_yen_coin,Nine_yen_coin;
      ll One_yen_coin_need,Six_yen_coin_need,Nine_yen_coin_need;
      ll final_answer=INF,temporary_answer=0;

       cin>>n;

       rep(i,n+1){

           Six_yen_coin=i;
           Nine_yen_coin=n-i;

           Six_yen_coin_need=6;
           Nine_yen_coin_need=9;

           while(1){

               if(Six_yen_coin<=0)break;

           while(1){
               if(Six_yen_coin<Six_yen_coin_need)break;
               Six_yen_coin_need*=6;
           }

           Six_yen_coin_need/=6;
           Six_yen_coin-=Six_yen_coin_need;

           Six_yen_coin_need=6;
           temporary_answer++;

           }

            while(1){

                if(Nine_yen_coin<=0)break;
               
           while(1){
               if(Nine_yen_coin<Nine_yen_coin_need)break;
               Nine_yen_coin_need*=9;
           }

           Nine_yen_coin_need/=9;
           Nine_yen_coin-=Nine_yen_coin_need;

           Nine_yen_coin_need=9;
           temporary_answer++;

           }

           final_answer=min(final_answer,temporary_answer);

           temporary_answer=0;

       }
       
       Cout(final_answer);
       
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

int main()
{
    int r;
    cin >> r;
    string ans = "";
    if (r < 1200)
    {
        ans = "ABC";
    }
    else if (r < 2800)
    {
        ans = "ARC";
    }
    else
    {
        ans = "AGC";
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n, a[21000],b[21000];
int main(){
	scanf("%d", &n);
	int d = 30000;
	b[0] = 1e9;
	for(int i = 1; i <= n; i++){
		a[i] = a[i - 1] + d;
		b[i] = b[i - 1] - d;
	//	cout<<a[i]<<" "<<b[i]<<endl;
	}
	int x, y;
	scanf("%d", &x);
	for(int i = 2; i <= n; i++){
		scanf("%d", &y);
		if(a[y] - a[x] > b[x] - b[y]) continue;
		a[y] += b[x] - b[y] + a[x] + 1 - a[y];
		swap(x, y);
	}
	for(int i = 1; i <= n; i++) printf("%d ", a[i]);puts("");
	for(int i = 1; i <= n; i++) printf("%d ", b[i]);
	return 0;
}

Measured memory_bytes: 896
#include<stdio.h>

int main(){
  int x=1;
  int y=1;
  int i,j;
  scanf("%d %d",&x,&y);

  for(i=0;i<=x;i++){
    for(j=0;j<=x;j++){
      if(x==i+j && y==2*i+4*j){
		printf("Yes");
        return 0;
      }
    }
  }
  printf("No");
  return 0;
}


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

int main() {
    int a,b,c,d;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    int result = 0;
    if (a>b){
        result += b;
    }else{
        result += a;
    }
    if (c>d){
        result += d;
    }else{
        result += c;
    }
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")

using namespace std;

typedef long long ll;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>pb_ds;

#define IN freopen("in.txt","r",stdin)
#define OUT freopen("out.txt","w",stdout)
#define pi pair<int,int>
#define F first
#define S second
#define pb push_back
#define pp pop_back
#define mod 1000000007
#define pai acos(-1)
#define N 100000

ll Weight[N+5],Profit[N+5],dp[2][N+5];

int main ()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   int n,w;cin>>n>>w;
   for(int i=1;i<=n;i++){
      cin>>Weight[i]>>Profit[i];
   }
   fill(dp[0],dp[0]+2*(N+5),INT_MAX*105);
   dp[(n+1)%2][0]=0;
   for(int i=n;i>=1;i--){
      for(int p=0;p<=N;p++){
         ll op1=dp[(i+1)%2][p];
         ll op2=(p-Profit[i]>=0)?Weight[i]+dp[(i+1)%2][p-Profit[i]]:INT_MAX*105;
         dp[i%2][p]=min(op1,op2);
      }
   }
   int ans=0;
   for(int i=0;i<=N;i++){
      if(dp[1][i]<=w){
         ans=max(ans,i);
      }
   }
   cout<<ans<<"\n";
   return 0;
}



Measured memory_bytes: 5216
a,b =map(int,input().split())
 
#print(a,b)
#10000,5000,1000
 
i=0
j=0
flag=0
while i<= a:
  j=0
  while j <= a-i:
    k=a-i-j
    #print(i,j,k)
    
    if 10000*i+5000*j+1000*k==b:
      print(i,j,k)
      flag=1
      break
    
    if flag==1:
      break
    j=j+1
  if flag==1:
    break
  
  i=i+1
if flag==0:
  print(-1,-1,-1)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

#define u unsigned
#define s short
#define ll long long
#define REP(i, a, b) for (auto i = (a); i < (b); i++)
#define REPR(i, a, b) for (auto i = (a-1); i >= (b); i--)

using namespace std;

int main()
{
    vector<int> A(100000);

    u int N;
    cin >> N;

    ll int sum = 0;
    REP(i, 0, N)
    {
        u int a;
        cin >> a;
        sum += a;
        A[a - 1]++;
    }

    // for (auto it = vect.begin(); it != vect.end(); it++)
    //     cin >> *it;

    u int Q;
    cin >> Q;

    REP(i, 0, Q)
    {
        int B, C;
        cin >> B >> C;
        
        sum = sum + (A[B - 1] * (C - B));
        cout << sum << "\n";

        A[C - 1] += A[B - 1];
        A[B - 1] = 0;
    }
}

Measured memory_bytes: 3684
mod=10**9+7
n,k= map(int, input().split())
x=[0]*(k+1)
y=0

# 最大公約数がその数になる組合せで場合わけ、後ろから埋めて重複を引く
for i in range(k,0,-1):
    m=k//i
    x[i]=pow(k//i,n,mod)
    for j in range(1,m):
        x[i]-=x[i*(j+1)]
        x[i]%=mod

ans=0
for i in range(1,k+1):
    ans+=x[i]*i
    ans%=mod

print(ans)

Measured memory_bytes: 74332
def main() -> None:
    N = int(input())
    ans = 0
    now, prev = 0, -1
    A = [int(x) for x in input().split()]
    for a in A:
        if a <= prev:
            now += 1
        else:
            now = 0
        prev = a
        ans = max(ans, now)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 20092
#include <bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(false);cin.tie(0);

int main() {
	optimizar_io

	int N;
	string s;

	cin >> N >> s;
	int ans = 0;
	for (int i = 0, j = 0; i < N; ) {
		while (s[i] == s[j])
			j++;
		i = j;
		ans++;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define INF (1LL<<50)

signed main(){

	lli n,k;
	cin>>n>>k;

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

	lli cnt=0;
	REP(b,k,n+1){
		lli tmp=0;
		if(n%b<k){
			tmp=(b-k)*(n/b);
		}
		else{
			tmp=(b-k)*(n/b)+(n%b-k+1);
		}
		cnt+=tmp;
	}
	cout<<cnt<<endl;


	return 0;
}

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

int main(){
    int n, k; cin >> n >> k;
    if(k > (n-1)*(n-2)/2){
        cout << -1 << endl;
        return 0;
    }
    else{
        vector<pair<int, int>> tmp;
        int ans = 0;
        int cnt = (n-1)*(n-2)/2;
        //cout << cnt << endl;
        for(int i = 2; i <= n; i++){
            ans++;
            tmp.push_back(make_pair(1, i));
        }
        for(int i = 2; i < n; i++){
            if(cnt == k) break;
            for(int j = i + 1; j <= n; j++){
                tmp.push_back(make_pair(i, j));
                cnt--;
                ans++;
                if(cnt == k) break;
            }
        }
        cout << ans << endl;
        for(int i = 0; i < tmp.size(); i++) cout << tmp[i].first << " " << tmp[i].second << endl;
    }
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define F first
#define S second
#define INF 1000000000000000000
#define M 1000000007
void YES(bool o){
    if(o)printf("YES\n");
    else printf("NO\n");
}
void Yes(bool o){
    if(o)printf("Yes\n");
    else printf("No\n");
}
int p[15];
int main(void){
    int n; cin>>n;
    for(int i=0;i<n;i++){
        cin>>p[i];
    }
    sort(p,p+n);
    ll ans=0;
    ans=ans+p[n-1]/2;
    for(int i=0;i<n-1;i++){
        ans=ans+p[i];
        
        
    }
    cout<<ans<<endl;
    
}


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


public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) throws Exception{
        int[] a = new int[101];
        while(hasNext()){
            int b = NI();
            a[b]++;
        }
        int max = 0;
        for (int i = 0; i < a.length; i++) {
            max=Math.max(max, a[i]);
        }
        for (int i = 0; i < a.length; i++) {
            if(max==a[i])System.out.println(i);
        }
        /*
        System.setIn(new FileInputStream("text"));
        while(hasNext()){
            StringBuilder s = new StringBuilder(NLine());
            StringBuilder ans=new StringBuilder();
            if(s.length()==0)return;
            for (int i = 0; i < s.length(); i++) {
                if(s.charAt(i)=='@'){
                    i++;
                    int len = s.charAt(i)-'0';
                    i++;
                    for (int j = 0; j < len; j++) {
                        ans.append(s.charAt(i));
                    }
                } else {
                    ans.append(s.charAt(i));
                }
            }
            System.out.println(ans);
        }
        */
    }

    
    static int c=-2;
    static int NI(){
        return (int)NL();
    }
    
    static long NL(){
        try {
            long r = 0;
            skip();
            if(c=='-') return -NL();
            for(;'0'<=c&&c<='9';c=System.in.read())
                r = r * 10 + c - '0';
            return r;
        } catch (Exception e) {
            return -1;
        }
    }
    
    static char NC(){
        try {
            skip();
            return (char)c;
        } catch (Exception e) {
            return 0;
        }
    }
    
    static String NS(){
        StringBuilder sb=new StringBuilder();
        try {
            skip();
            for(;!isSkip();){
                sb.append((char)c);
                c=System.in.read();
            }
            return sb.toString();
        } catch (Exception e) {
            return "";
        }
    }
    
    static String NLine(){
        StringBuilder sb=new StringBuilder();
        try {
            if(c==-2){
                c=System.in.read();
            }
            for(;c!='\n'&&c!='\r';){
                sb.append((char)c);
                c=System.in.read();
//                System.out.println(c);
            }
//            c=System.in.read();
            skip();
            return sb.toString();
        } catch (Exception e) {
            return "";
        }
    }
    
    static void skip(){
        try{
            while(isSkip()){
                c=System.in.read();
            }
        } catch (Exception e){}
        
    }
    
    static boolean hasNext(){
        skip();
        return c!=-1;
    }
    
    static boolean isSkip(){
        return 0 <= c && c <= ' ' || c == -2;
    }
}

Measured memory_bytes: 16840
# your code goes here
n=int(input())
l=[]
h=0
cnt=0
b=0
for a in range (0,n):
	l.append(int(input()))

for a in l:
	if a>h:
		h=a
		hn=b
		
	b+=1
for a in range(0,n):
	if hn==a:
		cnt+=l[a]/2
	else:
		cnt+=l[a]
		
print(int(cnt))

Measured memory_bytes: 3064
#ABC168D
def main():
    import sys
    from collections import defaultdict
    from collections import deque
    N, M = map(int, sys.stdin.readline().split())
    AB = [tuple(map(int, sys.stdin.readline().split())) for _ in range(M)]
    #print(AB)
    
    edge = defaultdict(list)
    for ab in AB:
        edge[ab[0]-1] +=[ab[1]-1]
        edge[ab[1]-1] +=[ab[0]-1]
    
    #print(edge)
    flag = [-1 for i in range(N)]
    def bfs(start, queue=deque([])):
        queue += [start]
        flag[start] =1
        while queue:
            now = queue.popleft()
            for ch in edge[now]:
                if flag[ch]==-1:
                    flag[ch] = now+1
                    queue.append(ch)
            
            
    
    bfs(0)
    print('Yes')
    for f in flag[1:]:
        print(f)
        
if __name__=='__main__':
    main()

Measured memory_bytes: 71836
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main(){
	ll n, k;
  cin >> k >> n;
  ll prev=0;
  vector<ll> values;
  ll x;
  for (int i=0; i<n; i++){
    cin >> x;
    values.push_back(x-prev);
    prev = x;
  }
  values[0] += k-x;
  sort(values.begin(), values.end());
  cout << k - values[n-1];
}

Measured memory_bytes: 2548
#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int x;
    cin >> x;
    if(x < 600)cout << 8 << endl;
    else if(x < 800) cout << 7 << endl;
    else if(x < 1000) cout << 6 << endl;
    else if(x < 1200) cout << 5 << endl;
    else if(x < 1400) cout << 4 << endl;
    else if(x < 1600) cout << 3 << endl;
    else if(x < 1800) cout << 2 << endl;
    else  cout << 1 << endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <queue>
#include <tuple>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int X, Y, Z, K;
	cin >> X >> Y >> Z >> K;

	vector<int64_t> A(X+1);
	vector<int64_t> B(Y+1);
	vector<int64_t> C(Z+1);

	for (int i = 0; i < X; ++i)
	{
		cin >> A[i];
	}
	A[X] = -100000000000;

	for (int i = 0; i < Y; ++i)
	{
		cin >> B[i];
	}
	B[Y] = -100000000000;

	for (int i = 0; i < Z; ++i)
	{
		cin >> C[i];
	}
	C[Z] = -100000000000;

	sort(A.begin(), A.end(), std::greater<int64_t>());
	sort(B.begin(), B.end(), std::greater<int64_t>());
	sort(C.begin(), C.end(), std::greater<int64_t>());

	using elem = tuple<int64_t, int, int, int>;

	auto compare = [](elem a, elem b) {
		return get<0>(a) < get<0>(b);
	};

	priority_queue<elem, vector<elem>, decltype(compare)> que(compare);
	set<elem> checker;
	elem first_elem = make_tuple(A[0] + B[0] + C[0], 0, 0, 0);

	que.push(first_elem);
	checker.insert(first_elem);
	for (int i = 0; i < K; ++i)
	{
		elem top_elem = que.top();
		
		int64_t sum = get<0>(top_elem);
		int l = get<1>(top_elem);
		int m = get<2>(top_elem);
		int n = get<3>(top_elem);

		cout << sum << endl;
		elem candidate[3] =
		{ make_tuple(A[l+1] + B[m] + C[n], l+1, m, n)
		, make_tuple(A[l] + B[m+1] + C[n], l, m+1, n)
		, make_tuple(A[l] + B[m] + C[n+1], l, m, n+1) };

		que.pop();

		for (int j = 0; j < 3; ++j)
		{
			if (checker.find(candidate[j]) == checker.end())
			{
				checker.insert(candidate[j]);
				que.push(candidate[j]);
			}
		}
	}

	return 0;
}

Measured memory_bytes: 896
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n){
    if(n==1||n==1){
        return false;
    }
    for(int i=2;i<n;++i){
        if(n%i==0){
            return false;
        }
    }
    return true;
}
int fact(int n){
    int ans = 1;
    for(int i = 1; i<= n; ++i){
        ans *= i;
    }
    return ans;
}


int main()
{
    long long x;
    cin>>x;
    for(long long i = -2000; i <2000; ++i){
        for(long long f= 2000; f > -2000; f--){
            long long e = i*i*i*i*i;
            long long b = f*f*f*f*f;
            if(e-b==x){
                cout<<i<<" "<<f<<endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const LL LINF=1LL<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};


int main(){
    int n,m;cin >> n >> m;
    vector<int> a(n),b(n);
    vector<P> d;
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
        d.pb(mp(m-a[i],b[i]));
    }
    sort(RALL(d));
    LL ans=0;
    priority_queue<LL> q;
    int k=0;
    for (int i = m; i >= 0; i--) {
        while(k<n&&d[k].first>=i){
            q.push(d[k].second);
            k++;
        }
        if(q.empty()) continue;
        LL p=q.top();q.pop();
        ans+=p;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4336
n,m = map(int,input().split())
a_list = list(map(int,input().split()))

count = 0
x = sum(a_list)/(4*m)
for i in range(0,n):
  if a_list[i] >= x :
    count += 1
if count >= m :
  print('Yes')
else :
  print('No')


Measured memory_bytes: 3060
#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 cost(int num1, int num2) {

	if (num1 > num2)return (num1 - num2)*(num1 - num2);
	else return (num2 - num1)*(num2 - num1);

}
int main() {

	int N, L;
	string S[105], tmp;

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

		cin >> S[i];

	}
	
	for (int i = 0; i < N - 1; i++) {
		for (int j = i + 1; j < N; j++) {

			if (S[i] > S[j]) {

				tmp = S[i];
				S[i] = S[j];
				S[j] = tmp;

			}

		}
	}

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

		cout << S[i];

	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;
const ll linf = 1001001001001001001;

struct repl {
    vector<int> v;
    int n;
    repl(vector<int> v):v(v),n(v.size()) {}
    repl& operator*=(repl a) {
        repl nr(*this);
        rep(i,n) nr.v[i] = a.v[v[i]];
        return *this = nr;
    }
    repl pow(ll t) {
        repl res(vector<int>(n,0)),a(*this);
        rep(i,n) res.v[i] = i;
        while(t > 0) {
            if(t&1) res *= a;
            t >>= 1;
            a *= a;
        }
        return res;
    }
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    cin >> n;
    vi x(n);
    cin >> x;
    int m;
    ll k;
    cin >> m >> k;
    vi a(m);
    cin >> a;
    rep(i,m) a[i]--;
    vi v(n-1),dis(n-1);
    rep(i,n-1) dis[i] = x[i+1]-x[i];
    rep(i,n-1) v[i] = i;
    rep(i,m) swap(v[a[i]-1],v[a[i]]);
    vi cv = v;
    rep(i,n-1) v[cv[i]] = i;
    repl r(v);
    vi res = r.pow(k).v;
    vi ndis(n-1);
    rep(i,n-1) ndis[res[i]] = dis[i];
    ll ans = x[0];
    cout << ans << endl;
    rep(i,n-1) {
        ans += ndis[i];
        cout << ans << endl;
    }
}


Measured memory_bytes: 4488
unittest
{
	assert( [ "7", "abcdbbd", "6", "2 3 6", "1 5 z", "2 1 1", "1 4 a", "1 7 d", "2 1 7" ].parse.expand.solve == "3\n1\n5" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto s = input.front.to!( dchar[] );
	input.popFront;
	auto q = input.front.to!( long );
	auto qss = new dchar[][ 3 ][ q ];
	foreach( ref qs; qss )
	{
		input.popFront;
		qs = input.front.split.to!( dchar[][] );
	}
	return tuple( s, qss );
}

auto solve( dchar[] s, dchar[][ 3 ][] qss )
{
	BinaryIndexedTree[ 26 ] bits;
	foreach( ref bit; bits )
	{
		bit = BinaryIndexedTree( s.length );
	}
	foreach( i, c; s )
	{
		bits[ c - 'a' ].add( i, 1 );
	}
	
	long[] anss;
	foreach( qs; qss )
	{
		if( qs[ 0 ] == "1" )
		{
			auto i = qs[ 1 ].to!( long ) - 1;
			auto c = qs[ 2 ].front;
			if( s[ i ] != c )
			{
				bits[ s[ i ] - 'a' ].add( i, -1 );
				s[ i ] = c;
				bits[ s[ i ] - 'a' ].add( i, 1 );
			}
		}
		else
		{
			auto l = qs[ 1 ].to!( long ) - 1;
			auto r = qs[ 2 ].to!( long );
			auto t = 0L;
			foreach( i, bit; bits )
			{
				t += ( 0 < bit.sum( l, r ) );
			}
			anss ~= t;
		}
	}
	return anss.to!( string[] ).join( "\n" );
}

struct BinaryIndexedTree
{
	private long[] ps;
	
	public this( long n )
	{
		ps.length = 1 + n;
	}
	
	public void add( long i, long v )
	{
		for( auto j = i + 1; j < ps.length; j += j & -j ) ps[ j ] += v;
	}
	
	public auto sum( long l, long r )
	{
		auto lt = 0L;
		auto rt = 0L;
		for( auto j = l; 0 < j; j -= j & -j ) lt += ps[ j ];
		for( auto j = r; 0 < j; j -= j & -j ) rt += ps[ j ];
		return rt - lt;
	}
}


Measured memory_bytes: 125840
//前置き
#pragma region

#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>

using namespace std;

typedef  long long ll;

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(all(a))
#define REVERSE(a) reverse(all(a))

#define PRINT(str) printf(#str "\n")
#define yOUT PRINT(Yes)
#define nOUT PRINT(No)
#define YOUT PRINT(YES)
#define NOUT PRINT(NO)

#pragma endregion

//関数定義
#pragma region 
//偶数 ->　true :: 奇数　-> false
bool EVEN(ll a){
    return a%2-1;
}

//最大公約数
ll gcd(ll a, ll b) {  
    if (!b)  
        return a;  
    return gcd(b, a%b);  
}  

//最小公倍数
ll lcm(ll a, ll b) {  
    return a*b/gcd(a,b);  
} 

#pragma endregion


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


    vector<int> w(N),v(N);

    REP(i,N){
        cin >> v[i] >> w[i];
    }

    int dp[105][10005];

    REP(i,W) dp[0][i] = 0;
    REP(i,N) dp[i][0] = 0;

    FOR(i,1,N+2){
        FOR(j,1,W+2){
            if(j < w[i-1]){
                dp[i][j] = dp[i-1][j];
            }else{
                dp[i][j] = max(dp[i-1][j-w[i-1]]+v[i-1], dp[i-1][j]);
            }
        }
    }

    
    
    cout << dp[N][W]<<endl;
}
    



Measured memory_bytes: 7084
//Author : pakhandi
//
using namespace std;

#include <bits/stdc++.h>

#define wl(n) while(n--)
#define fl(i,a,b) for(i=a; i<b; i++)
#define rev(i,a,b) for(i=a; i>=b; i--)

#define si(n) scanf("%d", &n)
#define sll(l) scanf("%lld",&l)

#define debug(x) cout<<"\n#("<<x<<")#\n"
#define nline printf("\n")

#define mem(a,i) memset(a,i,sizeof(a))

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

#define PB push_back
#define SZ size
#define MP make_pair

#define IGNORE cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n');

const ll INF = (1LL << 58);
const bool DEBUG = 0;

const int MAX_LIMIT = 2 * 100005;
bool vis[MAX_LIMIT];
int N, x, p;

int main()
{
	int i, j;

	si(N);	si(x);

	N = 2 * N - 1;

	if(x == 1 || x == N)
	{
		printf("No\n");
		return 0;
	}

	int reqPos = N / 2;
	reqPos++;

	int offset = reqPos - x;

	if(offset > 0)
	{
		p = N - offset + 1;
	}
	else
	{
		p = -offset + 1;
	}

	printf("Yes\n");

	while(vis[p] != 1)
	{
		vis[p] = 1;
		printf("%d\n", p);
		p++;
		if(p == N + 1)
			p = 1;
	}


	return 0;
}
/*
	Powered by Buggy Plugin
*/


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

int main() {
	
	int a, b;
	cin >> a >> b;
	int diff = b - a;
	int h = diff * (diff - 1) / 2;
	cout << h - a << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


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

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

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

int main(){
  int N;
  cin>>N;
  vector<int> s(N);
  int total=0;
  for(int i=0;i<N;i++){
    cin>>s[i];
    total+=s[i];
  }
  if(total%10 == 0){
    sort(s.begin(),s.end());
    for(int i=0;i<N;i++){
      if(s[i]%10 != 0){
        total-=s[i];
        break;
      }
    }
  }
  if(total%10==0) cout<<0<<endl;
  if(total%10!=0) cout<<total<<endl;
}
     

Measured memory_bytes: 256
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(a):
    print(a + a ** 2 + a ** 3)


if __name__ == '__main__':
    # S = input()
    a = int(input())
    # N, M = map(int, input().split())
    # As = [int(i) for i in input().split()]
    # Bs = [int(i) for i in input().split()]
    solve(a)


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

int main(void)
{
	 int x, y, s;
	 while(cin >> x >> y >> s && x != 0 && y != 0 && s != 0){
	 	int max_s = 0;
	 	for (int i = 1; i < s - 2; ++i)
	 	{
	 		for (int j = s - i; j >= i; --j)
	 		{
	 			if(i * (100 + x) / 100 + j * (100 + x) / 100 == s){
	 				max_s = max(max_s, i * (100 + y) / 100 + j * (100 + y) / 100);
	 			}
	 		}
	 	}
	 	cout << max_s << endl;
	 }
}

Measured memory_bytes: 1160
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=n-1;i>=a;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pair<ll,ll>>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
template<typename T>
void max_self(T &a,T b){
    a=max(a,b);
}
template<typename T>
void min_self(T &a,T b){
    a=min(a,b);
}
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=5e5+10,oo=0x3f3f3f3f,MOD=998244353;
const double PI = acos(-1);

void solve(){
    int a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3616
while True:
    H,W=map(int,input().split())
    
    if H==0 and W==0:
        quit()
    

    
    count=0
    
    for j in range(H):
        res=[]

        for i in range(W):
            
            if (count+i)%2==0:
                res.append("#")
    
            else:
                res.append(".")
                
        res="".join(res)
        print(res)
        count+=1
    # print(res)
    print()



Measured memory_bytes: 5616
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main(){
		ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
		//freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
		int N;
		cin>>N;
		cout<<N*N*N;
		return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<string>
#include<stack>
#include<set>
#include<unordered_map>
#include<time.h>
#include<cstdlib>
typedef long long ll;
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mm(a) memset(a,0,sizeof(a))
#define lr rt<<1
#define rr rt<<1|1
#define sync std::ios::sync_with_stdio(false);std::cin.tie(0);
#define inf 0x3f3f3f3f
#define eqs 1e-8
#define lb(x) (x&(-x))
#define ch(a) (int(a-'a')+1)
#define rep(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
typedef pair<int,int> pii;
const double pi=acos(-1);
const int maxn=400010;;
//const ll Mod=1000000007;
const ll Mod=998244353;
using namespace std;


struct node
{
    ll val,id;
}t[maxn];

bool cmp(node a,node b)
{
    return a.val>b.val;
}

ll p[maxn],q[maxn],r[maxn];
int main()
{
    sync;
    int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    int cnt=0;
    int w;
    rep(i,1,a)
    {
        cin>>w;
        t[++cnt].val=w;
        t[cnt].id=1;
    }
    rep(i,1,b)
    {
        cin>>w;
        t[++cnt].val=w;
        t[cnt].id=2;
    }
    rep(i,1,c)
    {
        cin>>w;
        t[++cnt].val=w;
        t[cnt].id=3;
    }
    sort(t+1,t+cnt+1,cmp);
    int pos=1;
    int da=0,db=0,dc=0;
    ll sum=0;
    int s=0;
    while(pos<=cnt)
    {
        if(x+y==s)
            break;
        if(t[pos].id==1)
        {
            if(da<x)
            {
                sum+=1ll*t[pos].val;
                da++;
                s++;
                pos++;
            }
            else
            {
                pos++;
                continue;
            }
        }
        else if(t[pos].id==2)
        {
            if(db<y)
            {
                sum+=1ll*t[pos].val;
                db++;
                s++;
                pos++;
            }
            else
            {
                pos++;
                continue;
            }
        }
        else
        {
            sum+=1ll*t[pos].val;
            s++;
            pos++;
        }
        if(x+y==s)
            break;
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 6400
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );

            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}

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

    string s;
    int n;
    cin >> n;
    cin >> s;
    for( int i = 0; i < s.size(); ++i ) {
        if( s[i] + n > 'Z' ) {
            s[i] = 'A' + (n - ('Z' - s[i]) - 1);

        } else {
            s[i] += n;

        }
    }
    cout << s << endl;
    return 0;
}



Measured memory_bytes: 256
use whiteread::parse_line;

fn main() {
    let (n, a, b): (u32, u32, u32) = parse_line().unwrap();
    let mut ans: u32 = 0;

    for i in 1..=n {
        let num = i.to_string();
        let mut sum: u32 = 0;
        for c in num.chars() {
            sum += c.to_digit(10).unwrap();
        }
        if a <= sum && sum <= b {
            ans += i;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2172
import java.util.Scanner;

class Main{
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int ans = x-a;
        ans = ans%b;

        System.out.println(ans);

    }
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
#define MAX 100000
#define MOD 1000000007
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int k,s;
	cin>>k>>s;
	int ans = 0;
	for(int i=0;i<=k;++i)
	{
		for(int j=0;j<=k;++j)
		{
			if(i+j>s||s-i-j>k)
				continue;
			++ans;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3644
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		boolean exit = true;
		while(exit==true){
			int a = sc.nextInt();
			int b = sc.nextInt();
			if(a==0 && b==0)exit=false;
			if(exit==true){
				int count=0;
				for(int j=1;j<a;j++){
					if(j==4 || j==6 || j==9 || j==11){
						count+=30;
					}else if(j==2){
						count+=29;
					}else{
						count+=31;
					}
				}
				count+=b;
				if(count%7==1){
					System.out.println("Thursday");
				}else if(count%7==2){
					System.out.println("Friday");
				}else if(count%7==3){
					System.out.println("Saturday");
				}else if(count%7==4){
					System.out.println("Sunday");
				}else if(count%7==5){
					System.out.println("Monday");
				}else if(count%7==6){
					System.out.println("Tuesday");
				}else if(count%7==0){
					System.out.println("Wednesday");
				}
				
			}
		}
	}
}

Measured memory_bytes: 17376
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

int main() {
	int n,k;
	cin >> n >> k;
	vector <int> v(n);
	rep(i,n) cin >> v[i];
	sort(v.begin(), v.end(), greater<int>());
	int ans=0;
	rep(i,k)ans+=v[i];
	cout << ans << endl;
}


Measured memory_bytes: 256