akhauriyash/Code-Regression huggingface dataset:
/*
        FFFFFFFFFFFFFFFFFFFFFF
        F::::::::::::::::::::F
        F::::::::::::::::::::F
        FF::::::FFFFFFFFF::::F
          F:::::F       FFFFFF
          F:::::F
          F::::::FFFFFFFFFF
          F:::::::::::::::F
          F:::::::::::::::F
          F::::::FFFFFFFFFF
          F:::::F
          F:::::F
        FF:::::::FF
        F::::::::FF
        F::::::::FF
        FFFFFFFFFFF
*/
 
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<nl
#define cout2(a,b) cout<<a<<" "<<b<<nl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<nl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<nl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<nl
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define ms(v,n) memset((v),n,sizeof(v));
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod 
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
template<typename T> T add(T &a, T b){ return (a+=b)%=mod; }
template<typename T> T sub(T &a, T b){ (a-=b); if(a<0) a+=mod; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
// const int N=...;

int32_t main()
{
    
	fast
	
	string s;
	cin>>s;
	if(s[2]==s[3] and s[4]==s[5])
	cout<<"Yes";
	else
	cout<<"No";
	

	



    

	return 0;
    
}

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

template<typename E> struct SegTree{
    using F=function<E(E,E)>;
    F f;//binary operation
    E Ei;//identity element
    int C=1;//capacity
    vector<E> D;
    SegTree(F f, E Ei): f(f),Ei(Ei) {}
    void init(const vector<E> &I){
        while(C<I.size()) C<<=1;
        D.resize(C*2);
        fill(D.begin(), D.end(),Ei);
        for(int i=0;i<I.size();i++) D[i+C]=I[i];
        for(int i=C-1;i>0;i--) D[i]=f(D[i*2],D[i*2+1]);
    }
    void update(int idx, E e){//0-indexed
        D[idx+=C]=e;
        while(idx>>=1) D[idx]=f(D[idx*2],D[idx*2+1]);
    }
    E query(int l,int r){//0-indexed, [l,r)
        E El=Ei, Er=Ei;
        for(l+=C,r+=C;l<r;l>>=1,r>>=1){
            if(l&1) El=f(El,D[l++]);
            if(r&1) Er=f(D[--r],Er);
        }
        return f(El,Er);
    }
};

//DSL_2_A
int main(){
    int n,q;
    cin>>n>>q;
    SegTree<int> ST([](int a,int b){return min(a,b);},(1LL<<31)-1);
    ST.init(vector<int>(n,(1LL<<31)-1));
    for(int i=0;i<q;i++){
        int com,x,y;
        cin>>com>>x>>y;
        if(com==0){
            ST.update(x,y);
        }else{
            cout<<ST.query(x,y+1)<<endl;
        }
    }
}


Measured memory_bytes: 4152
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a%b==0 || b%a==0)
    {
        printf("%d\n",a+b);
    }
    else
        printf("%d\n",b-a);



return 0;
}


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

int main(){

    
    string s; cin >> s;
    int n = (int)s.size();
    //1 indexed にする
    s = "x" + s;
    if(s[1] == '0'){
        cout << -1 << endl;
        return 0;
    }

    if(s[n] == '1'){
        cout << -1 << endl;
        return 0;
    }

    for(int i = 1; i < n / 2; i++){
        if(s[i] != s[n - i]){
            cout << -1 << endl;
            return 0;
        }
    }


    //この時点で構築可能
    vector<pair<int, int> > ans;
    int cur = 0;
    for(int i = 1; i < n; i++){
        cout << cur + 1 << " " << i + 1 << endl;
        if(s[i] == '1') cur = i;
    
    }

    return 0;
}

Measured memory_bytes: 1660
A, B = map(int,input().split())
S = list(input())
ans = True
if len(S) != (A+B+1):
    ans = False
elif S.count("-") != 1:
    ans = False
elif S.index("-") != A:
    ans = False
elif S != [i for i in S if i.isdecimal() or i == "-"]:
    ans = False
if ans:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>

using namespace std;

typedef pair<int, int> P;

int main(){
    int N, M;
    P PY[100001];
    vector<int> PY_sort[100001];
    cin >> N >> M;
    for(int i = 0; i < M; i++){
        int p, y;
        cin >> p >> y;
        PY[i] = P(p, y);
        PY_sort[p].push_back(y);
    }
    for(int i = 1; i <= N; i++){
        sort(PY_sort[i].begin(), PY_sort[i].end());
    }
    for(int i = 0; i < M; i++){
        int n = lower_bound(PY_sort[PY[i].first].begin(), PY_sort[PY[i].first].end(), PY[i].second) - PY_sort[PY[i].first].begin() + 1;
        cout  << setfill('0') << setw(6) << PY[i].first << setfill('0') << setw(6) << n << endl;
    }

}

Measured memory_bytes: 7808
#include<bits/stdc++.h>
using namespace std;
int main(){
  char a,b;
  string ans;
  cin >> a >> b;
  if (a==b)
  ans = "=";
  else if (a>b)
  ans = ">";
  else
  ans = "<";
 
  cout << ans <<"\n";
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

const int N=210000;
const double PI=acos(-1.0);
const double R=10.0;
const double Q=2*PI*R/4;
const double L=100.0;

int main() {
    int i, n, x, y, x1, x2, y1, y2;
    double D;
    scanf("%d%d%d%d%d", &x1, &y1, &x2, &y2, &n);
    D=L*(abs(x1-x2)+abs(y1-y2));
    if(x1>x2) {
        swap(x1, x2);
        swap(y1, y2);
    }
    vpii z;
    for(i=0; i<n; i++) {
        scanf("%d%d", &x, &y);
        if(abs(x-x1)+abs(x-x2)!=abs(x1-x2)) continue;
        if(abs(y-y1)+abs(y-y2)!=abs(y1-y2)) continue;
        if(y1>y2) y=-y;
        z.pb(pii(x, y));

    }
    sort(all(z));
    vi h;
    for(auto p:z) {
        auto q=lower_bound(all(h), p.sc);
        if(q==h.end()) h.pb(p.sc);
        else *q=p.sc;
    }
    if(sz(h)==abs(x1-x2)+1 || sz(h)==abs(y1-y2)+1) D+=Q;
    printf("%.16lf\n", D+sz(h)*(Q-2*R));
    return 0;
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

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 ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#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 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;
}
template<typename Val>
bool bitcheck(Val bit, size_t idx) {
    return bit & (1 << idx);
}
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;

void solve() {
    ll h; cin >> h;

    ll ans = 0;
    ll coeff = 1;
    while(h >= 1) {
        ans += coeff;
        h /= 2;
        coeff *= 2;
    }
    cout << ans << endl;
}

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

Measured memory_bytes: 3644
n = int(input())
A = list(map(int,input().split()))
from collections import Counter
A = Counter(A)
B = A.most_common()
B.sort(key = lambda x:x[0], reverse = 1)

fst_len = 0
snd_len = 0

for i,c in B:
  if c >1:
    if fst_len==0:
      fst_len = i
      if c >3:
        snd_len = i
    elif snd_len ==0:
      snd_len = i
    else:
      break


print(fst_len * snd_len)

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

int main(){
    int m = 10, index;
    int ans = 0;
    vector<int> v(5);
    rep(i,5) cin >> v[i];

    rep(i,5){
        if(m > v[i] mod 10 && v[i] mod 10 != 0){
            m = v[i] mod 10;
            index = i;
        }
    }

    rep(i,5){
        if(v[i] mod 10 != 0 && i != index){
            v[i] += 10 - v[i] mod 10;
        }
        ans += v[i];
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <unordered_set>

int a[100000];

int main() {
  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    xor_sum ^= a[i];
  }

  std::unordered_set<int> s;
  for (int i = 0; i < n; i++)
    s.insert(a[i] ^ (a[i] - 1));

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (s.find(x) != s.end()) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}

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

ll solve(ll N, vector<pair<ll, ll>> &A){
    sort(A.begin(), A.end());
    priority_queue<ll, vector<ll>, greater<ll>> pq;
    ll ret = 0;
    for(auto x : A){
        ll k = x.first;
        ll v = x.second;

        ret += v;
        pq.push(v);
        if(pq.size() > k){
            ret -= pq.top();
            pq.pop();
        }
    }
    return ret;
}

int main(){
    ll T;
    cin >> T;
    rep(t, T){
        ll N;
        cin >> N;
        ll tot = 0;
        vector<pair<ll, ll>> A;
        vector<pair<ll, ll>> B;
        rep(i, N){
            ll K, L, R;
            cin >> K >> L >> R;
            if(L > R){
                A.emplace_back(K, L-R);
                tot += R;
            }else{
                B.emplace_back(N-K, R-L);
                tot += L;
            }
        }
        cout << tot + solve(N, A) + solve(N, B) << endl;
    }
    return 0;
}


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

int main(){
  string s;
  cin>>s;
  int ctr=0;
  int n=s.size();
  for(int i=0;i<n/2;i++){
    if(s[i]!=s[n-i-1]) ctr++;
  }
  cout<<ctr;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long

signed main(){

  int n; cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }

  int ans = 0, res = 1;
  for(int i = 0; i < n; i++){
    if(a[i] == res){
      res++;
      ans++;
    }
  }
  if(ans == 0) ans = n+1;
  cout << n - ans << endl;

  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define int long long int 
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);cout<<fixed;cout<<setprecision(10);
#define in cin>>
#define out cout<<
#define br cout<<"\n";
const int maxn = 1e7 + 1;
int32_t seive[maxn] = {0};

void buildSeive(int n){
    seive[0]=0;
    seive[1]=1;
    for(int32_t i = 2; i < n + 1; i++){
        if(seive[i]==0){
            seive[i]=i;
            for(int32_t j = i; j < n + 1; j+=i){
                if(seive[j] == 0)
                seive[j]=i;
            }
        }
    }
}

void solve(){
    int n;
    cin>>n;
    buildSeive(n);
    int sum = 0;
    // for(int i = 2; i < n + 1; i++){
    //     cout<<seive[i]<<" ";
    // }
    // cout<<"\n";
    for(int i = 2; i < n + 1; i++){
        int j = i;
        map<int,int> mul;
        while(j!=1){
            mul[seive[j]]++;
            j/=seive[j];
        }
        int prod = 1;
        for(auto i:mul){
            prod*=(i.second + 1);
        }
        //cout<<i<<"->"<<prod<<"\n";
        sum += i*prod;
    }
    sum += 1;
    cout<<sum<<"\n";
}

int32_t main(){
    FASTIO
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
    #endif

    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }

    #ifndef ONLINE_JUDGE
        cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
    #endif

    return 0;
}

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



Measured memory_bytes: 2104
def out(data) -> str:
    print(' '.join(map(str, data)))


N = int(input())
data = [int(i) for i in input().split()]
out(data)
for i in range(1, N):
    tmp = data[i]
    j = i - 1
    while j >= 0 and data[j] > tmp:
        data[j + 1] = data[j]
        j -= 1
    data[j + 1] = tmp
    out(data)


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

const int N = 1e6 + 5;
typedef long long LL;

int n, m, k;
LL ans, fac[N], inv[N], mod = 998244353;

LL fps(LL a, LL b) {
	LL res = 1;
	while(b) {
		if(b&1) res = (res*a)%mod;
		b /= 2;
		a = a*a%mod;
	}
	return res;
}

LL calc(int k) {
	LL res = fac[n - 1]*inv[k]%mod*inv[n - k - 1]%mod;
	res = res*m%mod*fps(m - 1, n - k - 1)%mod;
	return res;
}

int main() {
	cin>>n>>m>>k;
	fac[0] = fac[1] = inv[1] = inv[0] = 1;
	for(int i = 1; i <= n; i++) {
		fac[i] = fac[i - 1]*i%mod;
		inv[i] = fps(fac[i], mod - 2);
	}
	if(m == 1) {
		if(k == n - 1) cout<<1<<endl;
		else cout<<0<<endl;
		return 0;
	}
	for(int i = 0; i <= k; i++) 
		ans = (ans + calc(i))%mod;
	cout<<ans<<endl;
	return 0;
}

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

int n;

int main(){
  cin >> n;
  if (n % 4 == 0 || n % 7 == 0) cout << "Yes";
  else {
    while (n > 0 && n % 7 != 0){
      n -= 4;
    }
    if (n % 7 == 0) cout << "Yes";
    else cout << "No";
  }
}


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

const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

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

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  int cntN = 0, cntE = 0, cntW = 0, cntS = 0;
  for (int i = 0; i < S.size(); i++)
  {
    if (S[i] == 'N')
      cntN++;
    else if (S[i] == 'E')
      cntE++;
    else if (S[i] == 'W')
      cntW++;
    else
      cntS++;
  }
  cerr << cntN << " " << cntS << " " << cntW << " " << cntE << endl;
  if (cntN == cntS && cntW == cntE || cntN == 0 && cntS == 0 && cntW > 0 && cntE > 0 || cntW == 0 && cntE == 0 && cntN > 0 && cntS > 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

// N == S && W == E


Measured memory_bytes: 256
<?php
$server = "php://stdin";
$local = "input.txt";
$handle = fopen($server, "r");
$s= trim(fgets($handle));
$a=trim(fgets($handle));
$a=explode(' ',$a);
$map=[];
for($i=0;$i<$s;$i++)
{
    $map[$a[$i]]=1;
}
if($s==sizeof($map))
{
    echo "YES"."\n";
}else
{
    echo "NO"."\n";
}
?>

Measured memory_bytes: 33780
//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            string s;
            int n,i,j;
            cin>>s;
            n=s.length();
            int ans=0;
            for(i=0;i<n/2;++i)
            {
                if(s[i]!=s[n-1-i])
                    ++ans;
            }
            cout<<ans<<endl;
        }
        return 0;
    }


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

int main(){
  int x, n;
  cin >> x >> n;
  set<int> st;
  for(int i = 0; i < n; ++i){
    int in;
    cin >> in;
    st.insert(in);
  }
  int ans = -1;
  for(int i = 0; i <= 101; ++i){
    if(st.count(i)) continue;
    if(abs(ans - x) > abs(i - x)){
      ans = i;
    }
  }
  cout << ans << endl;
}

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

using namespace std;

int n,k,a[100005],b[100005],cnt;
set <int> st;

int main () {
	cin >> n >> k;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for(int i = 0; i < n; i++) {
		if(a[i] >= k) {
			cnt++;
		}
	}
	cout << cnt;
	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;
import java.util.Arrays;

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

	int N = scan.nextInt();  //人数
	int C = scan.nextInt();  //定員
	int K = scan.nextInt();  //リミット

	int[] T_ = new int[N];
	for(int i = 0; i < N; i++){
	    T_[i] = scan.nextInt();
	}
	Arrays.sort(T_);

	int count = 1;
	int max = T_[0]+K;
	loop: for(int i = 0; i < N;){
	    int index = i;
	    for(int j = index; j < index+C; j++){
		if(j < N && T_[j] <= max){
		    i++;
		}else if(j < N){
		    break;
		}
		else{
		    break loop;
		}
	    }
	    if(i < N){
		max = T_[i]+K;
		count++;
	    }
	}

	System.out.println(count);
    }
}


Measured memory_bytes: 50408
import java.util.Scanner;

public class Main{
	public static void main(String[] args)
	{
		Scanner sc =new Scanner(System.in);
		String s=sc.next(); //入力された文字列
		int C_exi=0;	//Cが存在する時1、しない時0
		int F_exi=0;	//Fが存在する時1、しない時0
		
		//YAKIが最初に出現するインデックスが0かどうか確認
		if(s.indexOf("YAKI")==0) System.out.println("Yes");
		else System.out.println("No");
	}
} 

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int s;
	s=b/a;
	if (s>c)
	{
		cout<<c;
	}
	else
	{
	cout<<s;	
	}
	return 0;
}

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

std::vector<int> target_vector = {
  1<< 1, 1<< 2, 1<< 3, 1<< 4, 1<< 5, 1<< 6, 1<< 7, 1<< 8,
  1<< 9, 1<<10, 1<<11, 1<<12, 1<<13, 1<<14, 1<<15, 1<<16,
  1<<17, 1<<18, 1<<19, 1<<20, 1<<21, 1<<22, 1<<23, 1<<24,
  1<<25, 1<<26, 1<<27, 1<<28, 1<<29, 1<<30
};

int main()
{
  int n;
  std::cin >> n;
  std::vector<int> input(n);
  for (int i = 0; i < n; i++) {
    std::cin >> input.at(i);
  }
  std::unordered_map<int, int> cnt;
  for (auto x : input) {
    auto it = cnt.find(x);
    if (it == cnt.end()) {
      cnt[x] = 1;
    } else {
      cnt[x]++;
    }
  }
  std::sort(input.begin(), input.end());
  int npairs = 0;
  for (auto it = input.rbegin(); it != input.rend(); it++) {
    int val = *it;
    auto p1 = cnt.find(val);
    if (p1 == cnt.end()) {
      std::cerr << "Error: p1 not found\n";
      exit(1);
    }
    if (p1->second <= 0) {
      continue;
    }
    for (auto target : target_vector) {
      auto p2 = cnt.find(target - val);
      if (p2 == cnt.end()) {
        continue;
      }
      if (p2->second <= 0) {
        continue;
      }
      if (p1->first == p2->first && p2->second <= 1) {
        continue;
      }
      // the pair found
      p1->second--;
      p2->second--;
      npairs++;
      break;
    }
  }
  std::cout << npairs << std::endl;
  return 0;
}


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

const string YES = "YES";
const string NO = "NO";

int main(){
    std::string st1;
    cin >> st1;
    std::string st2;
    cin >> st2;
    if(st1[0] == st2[2] && st1[1] == st2[1] && st1[2] == st2[0]) cout << YES << endl;
    else cout << NO << endl;
    return 0;
}


Measured memory_bytes: 256
def ABC075C_dfs(targ, root, graph, now):

    for dst in graph[now]:
        if targ == sorted([dst, now]):
            continue
        if dst not in root:
            root.append(dst)
            ABC075C_dfs(targ, root, graph, dst)


def ABC075C_Bridge():
    N, M = map(int, input().strip().split())
    graph = [[] for i in range(N)]

    if N > M:
        print(M)
        return 0
    
    edge = [[] for i in range(M)]
    for i in range(M):
        a1, b1 = map(int, input().strip().split())
        a1 -= 1
        b1 -= 1
        graph[a1].append(b1)
        graph[b1].append(a1)
        edge[i] = sorted([a1, b1])

    ans = 0
    for ed in edge:
        root = [0]
        ABC075C_dfs(ed, root, graph, 0)
        if len(root) != N:
            ans += 1

    print(ans)

def main():
    ABC075C_Bridge()

if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}
void _OUT() {}; template<class H, class... T> void _OUT(H &h, T &... t) { cout<<' '<<h; _OUT(t...); };
template<class H, class... T> void _P(H &h, T &... t) { cout<<h; _OUT(t...); };
#define _PN(...) _P(__VA_ARGS__); cout << endl;

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 223450
#endif

string S;

void solve() {
    cin>>S;
    int N = S.size();
    int ans = N;
    REP(i,N-1) {
        if (S[i]!=S[i+1]) {
            chmin(ans, max(i+1, N-1-i));
        }
    }
    _PN(ans);
}



Measured memory_bytes: 3740
use proconio::input;
use std::collections::BTreeMap;

fn main() {
    input! {
        n: usize,
        s: [String; n],
    }

    let mut map = BTreeMap::new();

    for s in s {
        let mut s = s.as_bytes().to_vec();
        s.sort();
        map.entry(s).and_modify(|e| *e += 1).or_insert(1i64);
    }

    let ans: i64 = map.values().map(|x| (x - 1) * x / 2).sum();

    println!("{}", ans);
}


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

inline ll read()
{
    ll num=0,w=0;
    char ch=0;
    while(!isdigit(ch))
    {
        w|=ch=='-';
        ch=getchar();
    }
    while(isdigit(ch))
    {
        num=(num<<3)+(num<<1)+(ch^48);
        ch=getchar();
    }
    return w?-num:num;
}

inline void write(int x)
{
    if(x<0)
    {
        putchar('-');
        x=-x;
    }
    if(x>9)
        write(x/10);
    putchar(x%10+'0');
}
int main()
{
  ll n =read();
 // cout<<n<<endl;
  if(n&1)cout<<0<<endl;
  else {
    ll sum =0 ;
    //cout<<n<<endl;
    while(n>0){
        sum+=(n/5)/2;
        n/=5;
      //  cout<<n<<endl;
    }
    cout<<sum<<endl;
  }
    return 0;
}


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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

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

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

int main(void){
    int N; cin >> N;
    vector<string> S(N); REP(i,N) cin >> S[i];
    vector<pair<string,int>> p;

    SORT(S);
    p.emplace_back(S[0],1);
    REP(i,N-1){
        if(p.back().first == S[i+1]) p.back().second++;
        else p.emplace_back(S[i+1],1);
    }

    int mx = 0;
    REP(i,p.size()) chmax(mx,p[i].second);

    REP(i,p.size()){
        if(p[i].second == mx) cout << p[i].first << endl;
    }
    return 0;
}

Measured memory_bytes: 19568
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

string s;

int main(){
	cin>>s;
	cout<<(s<="2019/04/30"?"Heisei":"TBD")<<endl;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, [ $t:tt ]) => {{
    let len = read_value!($iter, usize);
    (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  }};

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    n: i64,
  }
  let mut ans = n;
  let mut i = 1;
  while i * i <= n {
    if n % i == 0 {
      ans = cmp::min(ans, i - 1 + n / i - 1);
    }
    i += 1;
  }

  puts!("{}\n", ans);
}


Measured memory_bytes: 4352
import java.util.Scanner;

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

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

}

Measured memory_bytes: 59768
<?php
  $n = trim(fgets(STDIN));
  $a = explode(" ", trim(fgets(STDIN)));
  $gusu = 0;
  $count = 0;
  for($i=0; $i<$n; $i++){
    if ($a[$i]%2==0){
      $gusu++;
       if ($a[$i]%3 == 0 || $a[$i]%5 == 0) {
         $count++;
       }
    }
  }
  if($gusu == $count){
    echo "APPROVED\n";
  } else {
    echo "DENIED\n";
  }
  


Measured memory_bytes: 4604
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


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

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

signed main(){
  int h, w, n;cin>>h>>w>>n;
  cout << (n-1)/max(h, w)+1 << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <utility>
#include <vector>
#include <queue>
#include <cmath>
#define read(X) scanf("%d",&X);
#define readLL(X) cin>>X;
#define readN(N,a) for(int i=0;i<N;i++)scanf("%d",&a[i]);
#define LL long long
#define FOR(x,a,b) for(int x=a;x<b;x++)
#define pii pair<int,int>
#define INF 3000000
using namespace std;

long long fastpow(long long A, long long B, long long MOD){
	long long ret=1;
	while (B){
		if (B % 2) {
			B--;
			ret = (ret * A) % MOD;
		} else {
			B/=2;
			A = (A*A) % MOD;
		}
	}
	return ret % MOD;
}


int N;
int s[111];
int dp[11100];
int main(){
	cin>>N;
	readN(N,s);

	dp[0]=1;
	for (int i=0;i<N;i++){
		for (int j=10000;j>=s[i];j--){
			if (dp[j-s[i]]) dp[j] =1;
		}
	}
	int res=0;
	FOR(i,0,N)res+=s[i];
	if (res % 10){
		cout<<res<<endl;
		return 0;
	}

	FOR(i,0,10000){
		//cout<<dp[i]<<endl;
		if (i % 10 == 0) continue;
		if (dp[i]) {
			cout<<res - i<<endl;
			return 0;
		}
	}
	cout<<0<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
using namespace std;

unsigned long long int gcd(unsigned long long int a, unsigned long long int b){
  if(a % b == 0){
    return b;
  }
  else return gcd(b, a % b);
}

unsigned long long int lcm(unsigned long long int a, unsigned long long int b){
  unsigned long long int x = max(a, b), y = min(a, b);
  return x / gcd(x, y) * y;
}

void solve(){
  int n; cin >> n;
  vector<unsigned long long int> t(n);
  for(int i = 0; i < n; i++){
    cin >> t[i];
  }
  if(t.size() == 1){
    cout << t[0] << endl;
    return;
  }
  unsigned long long int ans = lcm(t[0], t[1]);
  for(int i = 2; i < n; i++){
    ans = lcm(ans, t[i]);
  }
  cout << ans << endl;
  return;
}

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


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

int main() {
  long long N;
  cin >> N;
  long long mod = pow(10,9)+7;
  long long a = 1;
  long long b = 1;
  long long c = 1;
  for(int i = 0; i < N; i++) {
    a *= 10;
    a %= mod;
    b *= 9;
    b %= mod;
    c *= 8;
    c %= mod;
  }
  if(a + c - 2*b < 0) {
    if(a + c - 2*b + mod >= 0) {
      cout << a + c - 2*b + mod << endl;
    }
    else {
      cout << a + c - 2*b + 2*mod << endl;
    }
  }
  else {
    cout << (a + c - 2*b)%mod << endl;
  }
}


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

int main (){
  int N, A, B;
  cin >> N >> A >> B;
  
  if (A >= B){
    cout << B;
  }
  else {
    cout << A;
  }
  cout << " ";
  if (N >= A + B){
    cout << 0;
  }
  else {
    cout << A + B - N;
  }
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

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

int main()
{
    cout << fixed << setprecision(15);
    ll N, K;
    cin >> N;
    cin >> K;

    ll ans = 0;
    REP(i, N){
        ll x;
        cin >> x;

        ans += min(abs(x), abs(x-K));
    }

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

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

struct UnionFind {
    int n, num;
    vector<int> sz, par;
    UnionFind() {}
    UnionFind(int n_) : n(n_), num(n_), sz(n_, 1), par(n_, 0) { iota(par.begin(), par.end(), 0); }
    int find(int x) { return x==par[x]? x:(par[x]=find(par[x])); }
    bool same(int a, int b) { return find(a)==find(b); }
    void unite(int a, int b) {
        a = find(a);
        b = find(b);
        if(a == b) return;
        if(sz[a] < sz[b]) swap(a,b);
        sz[a] += sz[b];
        par[b] = a;
    }
    int size(int a) { return sz[find(a)]; }
};

const int MAX_N=100005;
ll n, m;
ll A[MAX_N][2], answer[MAX_N];

ll cal(ll x) { return x*(x-1)/2; }

int main() {
    cin >> n >> m;
    rep(i, m) cin >> A[i][0] >> A[i][1];
    ll in = cal(n);
    UnionFind uf(n+1);
    for(int i=m-1; i>=0; i--) {
        answer[i] = in;
        int a=A[i][0], b=A[i][1];
        if(uf.same(a,b)) continue;
        in += cal(uf.size(a)) + cal(uf.size(b));
        uf.unite(a, b);
        in -= cal(uf.size(a));
    }
    rep(i, m) cout << answer[i] << endl;
    return 0;
}


Measured memory_bytes: 4480
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    return

#B
def B():
    x1, y1, x2, y2 = LI()
    a = x2 - x1
    b = y2 - y1
    print(x2 - b, y2 + a, x1 - b, y1 + a)
    return

#C
def C():
    n, k = LI()
    if k % 2:
        print((n // k)** 3)
    else:
        print(int((n//k)**3 + ((n-k/2)//k+1)**3))
        
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()


Measured memory_bytes: 39024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

int main() {
	ll a,b,c,k;
	cin>>a>>b>>c>>k;
	ll ans=0;
	ans+=min(k,a);
	if(k<=a){
		cout <<ans;
		return 0;
	}
	k-=a;
	k-=b;
	if(k<=0){
		cout <<ans;
		return 0;
	}
	ans-=min(k,c);
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 3612
N, M = map(int, input().split())
k = []
s = []
p = []

switch_state_list=[]
ans = 0

for _ in range(M):
    temp = list(map(lambda x:int(x)-1, input().split()))
    k.append(temp[0]+1)
    s.append(temp[1:])

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


def check_denqu(switch_state):
    denqu_state=[0]*M

    for i in range(M):
        on_num = 0
        for index in s[i]:
            on_num += switch_state[index]
        if on_num % 2 == p[i]:
            denqu_state[i]=1
        else:
            denqu_state[i]=0
    
    if all(denqu_state):
        return 1
    else:
        return 0


def dfs(i, m):
    global ans

    switch_state_list.append(m)
    if i == N-1:
        ans += check_denqu(switch_state_list)
        switch_state_list.pop()
        return 
   
    dfs(i+1, 0)
    dfs(i+1, 1)

    switch_state_list.pop()


dfs(0,0)
dfs(0,1)

print(ans)


Measured memory_bytes: 3064
N, K = map(int, input().split())
A = list(map(int, input().split()))

sumA = sum(A)
divisors = []
for i in range(1, sumA + 1):
    if i * i > sumA:
        break
    if sumA % i != 0:
        continue
    divisors.append(i)
    if sumA // i != i:
        divisors.append(sumA // i)

divisors.sort(reverse=True)

ans = 0
for d in divisors:
    costs = [a % d for a in A]
    costs.sort(reverse=True)
    plus = sum(costs)
    minus = 0
    for j in range(N):
        if plus == minus:
            break
        else:
            plus -= costs[j]
            minus += d - costs[j]

    if plus <= K:
        print(d)
        break

Measured memory_bytes: 3188
from itertools import accumulate
n,k=map(int,input().split())
l=list(map(int,input().split()))
b=[0 for i in range(n+1)]
h=[0 for i in range(n+1)]
for i,j in enumerate(l,1):
    if j>0:
        b[i]=j
    else:
        h[i]=-j
b,h=list(accumulate(b)),list(accumulate(h))
ma=b[-1]
ans=0
for i in range(n-k+1):
    ans=max(ans,ma-(b[i+k]-b[i]),ma-(h[i+k]-h[i]))
print(ans)

Measured memory_bytes: 78240
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    x = N * 800
    y = (N // 15) * 200
    print(x - y)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9096
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 2100100100;
// const int MOD = 1e9 + 7;

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    cout << min(A * N, B);
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))


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

    int n, k;
    cin >> n >> k;

    int ans = k;
    rep (i, n - 1)
    {
        ans *= k - 1;
    }

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



Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_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())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 



int main(){
       int A,B,M;
       cin >> A >> B >> M;
       long long a[A],b[B];
       long long pos_min_A=(int)pow(10,6);
       long long pos_min_B=pos_min_A;
       for(int i=0;i<A;++i){
           cin >> a[i];
           pos_min_A=min(a[i],pos_min_A);
       }
       
       for(int i=0;i<B;++i){
           cin >> b[i];
           pos_min_B=min(b[i],pos_min_B);
       }
       long long act[M];
       long long ans=(long long) pow(10,10);
       int x[M],y[M],c[M];
       for(int i=0;i<M;++i){
           cin >> x[i] >> y[i] >> c[i];
           ans=min(a[x[i]-1]+b[y[i]-1]-c[i],ans);
        }
    ans=min(ans,pos_min_B+pos_min_A);
    cout << ans;
}


Measured memory_bytes: 2944
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N, A, B = map(int, readline().split())
H = [int(readline()) for _ in range(N)]


def C(T):
    """
    T回爆発させて、魔物全滅できるか
    """
    damage = B * T
    cnt = 0
    for h in H:
        h -= damage
        if h <= 0:
            continue
        cnt += (h + (A - B) - 1) // (A - B)
    return cnt <= T


left = 0
right = 10 ** 18
while right - left > 1:
    mid = (right + left) // 2
    if C(mid):
        right = mid
    else:
        left = mid

ans = right
print(ans)


Measured memory_bytes: 7064
n = int(input())
a,b=[],[]

for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)

a=list(reversed(a))
b=list(reversed(b))

OK=0
for i in range(n):
    A=a[i]+OK
    if A==b[i]:
        continue
    else:
        ok=-(-A//b[i])*b[i]-A
    OK+=ok

print(OK)


Measured memory_bytes: 17704
#include <stdio.h>
int main() {
    int n, a, ans = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &a);
        while (a % 2 == 0) {
            a /= 2;
            ans++;
        }
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
_, k = gets.chomp.split(' ').map(&:to_i)
s = gets.chomp
ranges = s.chars.chunk(&:itself).map { |c, arr| [c, arr.size] }
max = if s[0] == '1'
        ranges.take(2*k + 1).map { |_, arr| arr }.reduce(:+)
      else
        ranges.take(2*k).map { |_, arr| arr }.reduce(:+)
      end
tmp = max
1.upto(ranges.size - 1) do |idx|
  c, _ = ranges[idx]
  if c == '1'
    tmp -= ranges[idx - 2][1] if idx - 2 >= 0
    tmp -= ranges[idx - 1][1]
    tmp += ranges[idx + 2*k - 1][1] if ranges[idx + 2*k - 1]
    tmp += ranges[idx + 2*k][1] if ranges[idx + 2*k]
    max = [tmp, max].max
    break if ranges[idx + 2* k].nil?
  end
end
puts max
__END__
5 1
00010


Measured memory_bytes: 16764
#include<iostream>
#include<cmath>
#include<string>
#include<queue>
#include<map>

using namespace std;
static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char dir[4] = {'u','l','d','r'};

class puzzle{
public :
  int f[9],space;
  string path;

  bool operator < (const puzzle &p) const{
    for(int i=0;i<9;i++){
      if(f[i]==p.f[i])continue;
      return f[i] > p.f[i];
    }
    return false;
  }
};

bool isTarget(puzzle p){
  for(int i=0;i<9;i++){
    if(p.f[i] !=(i+1))return false;
  }
  return true;
}

string bfs(puzzle s){
  queue<puzzle> Q;
  map<puzzle,bool> V;
  puzzle u,v;
  s.path="";
  Q.push(s);
  V[s]=true;

  while(!Q.empty()){
    u = Q.front();
    Q.pop();

    if(isTarget(u))return u.path;
    int sx=u.space/3;
    int sy=u.space%3;

    for(int r=0;r<4;r++){
      int tx=sx+dx[r];
      int ty=sy+dy[r];
      if(tx<0||ty<0||tx>=3||ty>=3)continue;
      v=u;
      swap(v.f[u.space],v.f[tx*3+ty]);
      v.space = tx*3+ty;

      if(!V[v]){
	V[v] =true;
	v.path +=dir[r];
	Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  puzzle in;
  for(int i=0;i<9;i++){
    cin >> in.f[i];
    if(in.f[i] ==0){
      in.f[i] = 9;
      in.space=i;
    }
  }
  string ans =bfs(in);
  cout << ans.size()<<endl;

  return 0;

}


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

int main()
{
    int h,w;
    for( ; ; )
    {
        cin >> h >> w;
        if(h==0 && w==0)
        {
            break;
        }
        for(int i=0;i<h;i++)
        {
            for(int j=0;j<w;j++)
            {
                cout << "#";
            }
            cout << endl;
        }
        cout << endl;
    }
}


Measured memory_bytes: 3100