akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
  int N; cin>>N;
  vector<int>p(N);
  vector<int>q(N);
  rep(i,N)cin>>p[i];
  rep(i,N){
    rep(j,N)q[i]=p[i];
    rep(j,N){
      rep(k,N){
        if(i==k)q[k]=p[j];
        else if(j==k)q[k]=p[i];
        else q[k]=p[k];
      }
      REP(k,N){
        if(q[k]<=q[k-1])break;
        if(k==N-1){
          cout<<"YES"<<endl;
          return 0;
        }
      }
    }
  }
  cout<<"NO"<<endl;
}

Measured memory_bytes: 3100
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final long result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        long K = sc.nextLong();
        long A = sc.nextLong();
        long B = sc.nextLong();

        sc.close();
        return new TestCase(K, A, B);
    }

    public static long process(TestCase testCase) {
        long K = testCase.K;
        long A = testCase.A;
        long B = testCase.B;

        boolean isPossibleToFullExchange = K >= (A - 1 + 2);
        final long diff = B - A;
        boolean isBeneficialToExchange = diff > 1;
        if (isPossibleToFullExchange && isBeneficialToExchange) {
            final long numRemainingOps = K - (A - 1);
            return A + numRemainingOps / 2 * diff + numRemainingOps % 2;
        } else {
            return 1L + K;
        }
    }

    private static void output(long result) {
        System.out.println(result);
    }

    public static class TestCase {
        final long K;
        final long A;
        final long B;

        public TestCase(long k, long a, long b) {
            K = k;
            A = a;
            B = b;
        }
    }
}


Measured memory_bytes: 24020
#include<bits/stdc++.h>
#define endl '\n'

using namespace std;
int gcd(int a, int b)
{
    // Everything divides 0
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    // base case
    if (a == b)
        return a;

    // a is greater
    if (a > b)
        return gcd(a-b, b);
    return gcd(a, b-a);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int K = 0;
    cin>>K;
    long long sum = 0;
    for(int i = 1 ; i <= K; i++){
        for(int j = 1; j <= K; j++){
            for(int s = 1; s <=K ;s++){
                sum+=(gcd(i,gcd(j,s)));
            }
        }
    }

    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3656
#include "bits/stdc++.h"
using namespace std;

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

    vector<vector<int>> F(110,vector<int>(12));
    vector<vector<int>> P(110,vector<int>(12));

    for(int i=0;i<N;i++){
        for(int j=0;j<10;j++){
            cin >> F[i][j];
        }
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<11;j++){
            cin >> P[i][j];
        }
    }
    int ma=-(1<<30);
    int ct,c;

    for(int i=1;i<(1<<10);i++){
        ct=0;
        for(int j=0;j<N;j++){
            c=0;
            for(int k=0;k<10;k++){
                c+=((i>>k) & (F[j][k]) & 1);
            }
            ct+=P[j][c];
        }
        ma=max(ct,ma);
    }
    cout << ma << endl;
}

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

#define MOD 1000000007
#define INF 1000000001

using namespace std;
typedef unsigned long long ull;
typedef long long ll;


template <class T>
ostream &operator<<(ostream &o, const vector<T>&obj) {
    o << "["; for (int i = 0; i < (int)obj.size(); ++i) o << (i > 0 ? ", " : "") << obj[i]; o << "]"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U>&obj) {
    o << "(" << obj.first << ", " << obj.second << ")"; return o;
}
template <class T, class U>
ostream &operator<<(ostream &o, const map<T, U>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const set<T>&obj) {
    o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;
}
template <class T>
ostream &operator<<(ostream &o, const queue<T>&obj) {
    queue<T> obj_cp = obj;
    bool first = true;
    o << "{";
    while (!obj_cp.empty()) { o << (!first ? ", " : "") << obj_cp.front(); obj_cp.pop(); first = false; }
    o << "}"; return o;
}

void print() {
    cout << "\n";
}
template<class Head, class... Body>
void print(Head head, Body... body) {
    cout << head << " ";
    print(body...);
}


ll llpow(ll n, int a) {
    if (a == 0) {
        return 1;
    } else if (a % 2 == 0) {
        return llpow(n*n, a/2);
    } else {
        return n * llpow(n, a-1);
    }
}

int main(int argc, char const *argv[]) {
    int N;
    cin >> N;
    vector<ll> A(N);
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }

    vector<ll> X(N), Y(N);
    for (int i = 0; i < N; ++i) {
        X[i] = i + A[i];
        Y[i] = i - A[i];
    }
    // print(X);
    // print(Y);
    sort(X.begin(), X.end());
    sort(Y.begin(), Y.end());

    // print(X);
    // print(Y);

    ll ans = 0;
    for (int i = 0; i < N; ++i) {
        ll count = distance(
            lower_bound(Y.begin(), Y.end(), X[i]),
            upper_bound(Y.begin(), Y.end(), X[i]));
        // print(X[i], count);
        ans += count;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8012
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

struct edge {
  int to;
  ll cost;
  edge(int t, ll c): to(t), cost(c) {};
};

using P = pair<ll, int>;

int N;
vector<vector<edge>> G;
vector<ll> d;
vector<int> par;
void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  d = vector<ll>(N, longinf);
  par = vector<int>(N, -1);
  d[s] = 0;
  que.push(P(0, s));

  while (!que.empty()) {
    P p = que.top();
    que.pop();
    int v = p.second;
    if (d[v] < p.first) continue;

    for (int i=0; i<(int)G[v].size(); ++i) {
      edge e = G[v][i];
      if (d[e.to] > d[v] + e.cost) {
	d[e.to] = d[v] + e.cost;
	que.push(P(d[e.to], e.to));
	par[e.to] = v;
      }
    }
  }
}
int main() {
  int M;
  cin >> N >> M;
  G = vector<vector<edge>>(N);
  rep(i, M) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    G[a].push_back(edge(b, 1));
    G[b].push_back(edge(a, 1));
  }
  dijkstra(0);
  cout << "Yes" << endl;
  rep(i, N) {
    if(i) cout << par[i]+1 << endl;
  }
  return 0;
}


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

ll gcd(ll a,ll b){
    if(a%b==0)return b;
    return gcd(b,a%b);
}

ll kosuu(ll num,ll a,ll b){
    return (b/num)-((a-1)/num);
}

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll l=c*d/gcd(c,d);
    cout<<b-a-kosuu(c,a,b)-kosuu(d,a,b)+kosuu(l,a,b)+1<<endl;
}


Measured memory_bytes: 256
/*
h s, d't skp th si tll i's svedclTabCtrl
 * ABC141 E
 * ABC145 D
 * ABC147 F
 * ABC174 F
*/
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
ll a[10000005]={};
int main()
{
ll n;
cin>>n;
ll ans=0;
for(int i=1;i<=n;i++)
{
ans+=(a[i]+1)*i;
ll w=2;
while(i*w<=n)
{
a[i*w]++;
w++;
}
}
cout<<ans<<endl;
}
/*
 *||||

 */

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

#define st              first
#define nd              second
#define pb              push_back
#define lwb             lower_bound
#define upb             upper_bound
#define Size(a)         int((a).size())
#define reset(s, n)     memset(s, n, sizeof(s))
#define bit(n, i)       (((n) >> (i)) & 1)
#define cntbit(n)       __builtin_popcountll(n)
#define all(a)          (a).begin(), (a).end()
#define unique(a)       (a).resize(unique(all(a)) - (a).begin())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))

typedef long double ld;
typedef long long ll;

const int MOD = 1e9 + 7;
const ll INF = 1e18;
const ld PI = acos((ld) -1);
const ld EPS = 1e-7;
inline ll fpow(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline int inv(int a, ll p = MOD) {return fpow(a, p - 2, p);}
inline ll lcm(ll a, ll b) {return a / __gcd(a, b) * b;}
inline void onbit(ll &a, int i){a |= 1LL << i;}
inline void offbit(ll &a, int i){onbit(a, i), a -= (1LL << i);}

const int N = 3e5 + 5;

ll n, m, k;
ll a[N];

void solve(){
    int m, n, k;
    cin >> m >> n >> k;
    vector<vector<long long>> a(m + 1, vector<long long> (n + 1, 0));
    vector<vector<vector<long long>>> f(m + 1, vector<vector<long long>>(n + 1, vector<long long> (5, 0)));
    for(int i = 1; i <= k; i++){
        long long x, y, val;
        cin >> x >> y >> val;
        a[x][y] = val;
    }

    for(int i = 1; i <= m; i++){
        for(int j = 1; j <= n; j++){
            for(int k = 1; k <= 3; k++){
                f[i][j][k] = f[i][j - 1][k];
                f[i][j][k] = max(f[i][j][k], f[i - 1][j][3] + a[i][j]);
                f[i][j][k] = max(f[i][j][k], f[i][j - 1][k - 1] + a[i][j]);
            }
        }
    }
    cout << f[m][n][3];
  
}

main(){
  ios_base::sync_with_stdio(0);
  cin.tie(0); 
  cout.tie(0);
  cout << fixed << setprecision(10);
  // freopen("input.txt", "r", stdin);
  // freopen("output.txt", "w", stdout);
  int query = 1;
  // cin >> query;
  int start = 1000 * clock() / CLOCKS_PER_SEC;
  while(query--) solve();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC  - start << "ms\n";
}


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

#define ll long long
#define all(x) (x).begin(), (x).end()
const long long INF = 1LL << 60;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

// 総数を1000000007で割った余り
const long long mod = 1e9 + 7;

int main() {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    // cout << fixed << setprecision(5);

    // 入力
    int a, b;
    cin >> a >> b;

    // 処理
    string s;
    int    ans = 0;
    for (int i = a; i <= b; i++) {
        s = to_string(i);
        if (s[0] == s[4] && s[1] == s[3]) {
            ans++;
        }
    }

    // 出力
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <iomanip>       // fixed, setprecision
using namespace std;

int main()
{
  int N, K, h, ans = 0;
  cin >> N >> K;
  for (int i = 0; i < N; i++)
  {
    cin >> h;
    if (h >= K)
    {
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3176
#include<bits/stdc++.h>
using namespace std;
#define INF 1e15
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
typedef long long ll;
typedef pair<int, int> P;
#define END system("PAUSE");return 0
signed main() {
	int n;
	cin >> n;
	
		int ans = 0;
		while (n > 0) {
			ans += n % 10;
			n /= 10;
		}
		if (ans == 1)cout << 10 << endl;
		else cout << ans << endl;
	
	END;
}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

void solve() {
  long long k, a, b; scanf("%lld%lld%lld", &k, &a, &b);
  if (b <= a || k+1 < a) {
    printf("%lld", k+1);
    return;
  }
  long long ans = k+1;
  k -= a-1;
  long long cur = k/2*b-(k/2-1)*a;
  if (k%2) ++cur;
  printf("%lld", max(ans, cur));
}
/*
48518828981938099
53513332169120811


a 0

0 1
b 0
(b-a) 1
(2b-a) 0
(2b-2a) 1
(3b-3a) 0
*/
int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 3776
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++)
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b);
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define pb push_back
#define pf push_front
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={1,0,-1,0,1,-1,-1,1};
int dy[]={0,1,0,-1,1,1,-1,-1};
const int MOD = 1e9+7;
const long long INF = 1e18+10;

/*--------------------------------------------------------------------*/
signed main(){
	int n,m;
	cin>>n>>m;
	string a[50],b[50];
	rep(i,n)cin>>a[i];
	rep(i,m)cin>>b[i];

	rep(i,n-m+1){
		rep(j,n-m+1){
			bool ok=1;
			rep(k,m)rep(l,m){
				if(a[i+k][j+l]!=b[k][l]) ok=0;
			}
			if(ok){
				cout<<"Yes"<<endl;
				return 0;
			}
		}
	}
	cout<<"No"<<endl;

	return 0;
}

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

int main()
{
  int N;
  cin >> N;
  
  int ans;
  
  if(N%2==0){
    ans = N/2-1;
  }
  else{
    ans = (N-1)/2;
  }
  
  cout << ans << endl;
  
  return 0;
}

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

#define PROB "RAMEN"
#define vi vector<int>

void init(){
    freopen(PROB".inp","r",stdin);
    freopen(PROB".out","w",stdout);
}

int main(){
    string s;
    getline(std::cin,s);
    int res=700;
    for (int i=0; i<s.size(); i++){
        if (s[i]=='o') res+=100;
    }
    cout<<res;
}


Measured memory_bytes: 256
// Problem : B - Judge Status Summary
// Contest : AtCoder - AtCoder Beginner Contest 173
// URL : https://atcoder.jp/contests/abc173/tasks/abc173_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// writer: w33z8kqrqk8zzzx33
#include <bits/stdc++.h>
using namespace std;

#define iter(i, a, b) for(int i=(a); i<(b); i++)
#define rep(i, a) iter(i, 0, a)
#define rep1(i, a) iter(i, 1, (a)+1)
#define fi first
#define se second
#define pb push_back
 
#define ll long long
#define pii pair<int, int>
//#define int ll
const int MOD = 1000000007;

map<string, int> t;

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n; cin >> n;
    rep(i, n) {
        string k; cin >> k;
        t[k]++;
    }
    cout << "AC x " << t["AC"] << endl;
    cout << "WA x " << t["WA"] << endl;
    cout << "TLE x " << t["TLE"] << endl;
    cout << "RE x " << t["RE"] << endl;
}



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

int main(){
	int n;
	int d[110];
	cin >> n;
	set<int> j;
	rep(i,n){
		cin >> d[i];
		j.insert(d[i]);
	}
	cout << j.size() << endl;
	return 0;
}

Measured memory_bytes: 256
integer N
integer(8) K
integer,allocatable,dimension(:)::A,B
integer(8) X,ans
read*,N,K
allocate(A(N),B(N))
do i=1,N
  read*,A(i),B(i)
end do
call HeapsortPair(n,A,B)

X=0
do i=1,N
  ans=A(i)
  X=X+B(i)
  if(X>=K)exit
end do

print*,ans

contains

subroutine HeapsortPair(n,array,array2)
  implicit none
!ここの入力は状況に応じて変更すること
  integer,intent(in) :: n
  integer,intent(inout) :: array(1:n),array2(1:n)
  integer::i,k,j,l
  integer:: t,t2

  l=n/2+1
  k=n
  do while(k /= 1)
     if(l > 1)then
        l=l-1
        t=array(L)
        t2=array2(L)
     else
        t=array(k)
        t2=array2(k)
        array(k)=array(1)
        array2(k)=array2(1)
        k=k-1
        if(k == 1) then
           array(1)=t
           array2(1)=t2
           exit
        endif
     endif
     i=l
     j=l+l
     do while(j<=k)
        if(j < k)then
           if(array(j) < array(j+1))j=j+1
        endif
        if (t < array(j))then
           array(i)=array(j)
           array2(i)=array2(j)
           i=j
           j=j+j
        else
           j=k+1
        endif
     enddo
     array(i)=t
     array2(i)=t2
  enddo
  return
end subroutine HeapsortPair
end

Measured memory_bytes: 1024
let ($) f g = fun x -> g (f x)
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n

let rec prime_fact acc i n =
  if n = 0 then acc
  else if n < i * i then n :: acc
  else if n mod i = 0 then prime_fact (i :: acc) i (n / i)
  else prime_fact acc (i + 1) n

let prime_fact n =
  List.fold_left (fun acc i ->
    match acc with
      | [] -> [(i, 1)]
      | (v, cnt) :: xs -> if v = i then (v, cnt + 1) :: xs else (i, 1) :: (v, cnt) :: xs
  ) [] @@ prime_fact [] 2 n

let () =
  if n = 1 then print_endline "0"
  else begin
    let acc = prime_fact n in
    let (ans, _) = List.fold_left (fun (sum, rest) (v, cnt) ->
      let t_sum = ref sum in
      let t_rest = ref rest in
      let tv = ref v in
      for i = 1 to cnt do
        if !t_rest >= !tv && !t_rest mod !tv = 0 then begin
            (* Printf.printf "%d %d %d\n" !t_sum !t_rest !tv; *)
            t_sum := !t_sum + 1;
            t_rest := !t_rest / !tv;
            tv := !tv * v
        end
      done;
      (!t_sum, !t_rest)
    ) (0, n) acc in
    Printf.printf "%d\n" ans
  end

Measured memory_bytes: 3852
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		//System.out.println("??\???>>");

		Scanner scan = new Scanner(System.in);

		int intA = scan.nextInt();
		int intB = scan.nextInt();
		int intC = scan.nextInt();

		if(intA < intB ){
			
			if(intB < intC){
				System.out.println("Yes");
			}else{				
				System.out.println("No");
			}
		
		}else{
			
			System.out.println("No");
		} 
			
		
			

	}

}

Measured memory_bytes: 17320
# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    mod = 10**9+7

    return str((pow(10, n, mod)-2*pow(9, n, mod)+pow(8, n, mod)) % mod)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


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

int main(){
    int n,a,b;
    cin >> n >> a >> b;
    cout << min(n*a,b) << endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include <vector>
#include <cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;

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 long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  ci(n);
  vpll A(n);
  FOR(i,0,n){
    ci(A[i].se>>A[i].fi)
  }
  SORT(A);
  ll now=0;
  FOR(i,0,n){
  now+=A[i].se;
    if(now>A[i].fi){
      co("No")
        break;
    }
    
    if(i==n-1){
      co("Yes")
    }
  }
}

Measured memory_bytes: 3456
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#if __cplusplus >= 201103L
#include <chrono>
using namespace std::chrono;
#endif
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#ifdef LOCAL
#define prln(x) (cout << #x << ' ' << x << endl)
#define pr(x) (cout << #x << ' ' << x << ' ' )
#define prv(x) (cout << x << ' ')
#else
#define prln(x) 
#define pr(x)
#define prv(x)
#endif
#define clr(x) memset((x), 0, sizeof((x)))
#define clr1(x) memset((x), -1, sizeof((x)))
#define endl "\n"
#define pi acos(-1)
#define rep(i, st, ed) for (int i = (st); i <= (ed); ++i)
#define rep0(i, st, ed) for (int i = (st); i < (ed); ++i)
#define per0(i, st, ed) for (int i = (st); i > ed; --i)
#define per(i, st, ed) for (int i = (st); i >= ed; --i)
#define chmin(a, b) (a = a > b ? b : a)
#define chmax(a, b) (a = a < b ? b : a)
template<class T> void _sf(T &x) {cin >> x;}
void _sf(int &x) {scanf("%d", &x);}
void _sf(ll &x) {scanf("%lld", &x);}
void _sf(double &x) {scanf("%lf", &x);}
void _sf(char &x) {scanf(" %c", &x);}
void _sf(char *x) {scanf("%s", x);}
void sf() {}
template <class T, class...U> void sf(T & head, U&... tail) { _sf(head); sf(tail...);}
template<class T> void _out(const T &x) { cout << x; }
void _out(const int &x) { printf("%d", x); }
void _out(const ll &x) { printf("%lld", x); }
void _out(const double &x) { printf("%.16f", x); }
void _out(const char &x) { putchar(x); }
void _out(const char *x) { printf("%s", x); }
template<class T,class U> void _out(const pair<T,U> &x) {_out(x.F); putchar(' '); _out(x.S);}
template<class T> void _out(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _out(*i++)) if (i != x.cbegin()) putchar(' '); }
void out() {}
template<class T, class... U> void out(const T &head, const U &... tail) { _out(head); putchar(sizeof...(tail) ? ' ' : '\n'); out(tail...); }
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
const int maxn = 1e5 + 5;

struct Node {
    int l, r;
    bool operator < (const Node &rhs) const {
        return r == rhs.r ? l < rhs.l : r < rhs.r;
    }
}a[maxn];


int main(){
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    int n = read();
    rep(i, 0, n - 1) {
        int x, len;
        sf(x, len);
        a[i].l = x - len;
        a[i].r = x + len;
    }
    sort(a, a + n);
    int ans = 1;
    Node pre = a[0];
    for (int i = 1; i < n; ++i) {
        if (a[i].l < pre.r) continue;
        else {
            ++ans;
            pre = a[i];
        }
    }
    out(ans);
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

class Main{

  public static double crossProduct(double[] vec1, double[] vec2){
    double cp = vec1[0]*vec2[1] - vec1[1]*vec2[0];
    return cp;
  }

  public static int isCross(double[][] point){
    double[] abVec = {point[1][0]-point[0][0],point[1][1]-point[0][1]};
    double[] acVec = {point[2][0]-point[0][0],point[2][1]-point[0][1]};
    double[] bdVec = {point[3][0]-point[1][0],point[3][1]-point[1][1]};
    double c0 = crossProduct(acVec, bdVec);
    if (c0 == 0) {
      return -1;
    }
    double ca = crossProduct(abVec, acVec);
    double cb = crossProduct(abVec, bdVec);
    if (ca/c0 <= 1 && ca/c0 >= 0 && cb/c0 <= 1 && cb/c0 >= 0) {
      return 1;
    }
    else {
      return 0;
    }
  }

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    while(sc.hasNext()) {
      double[][] point = new double[4][2];
      String str = sc.next();
      String[] strArr = str.split(",");
      for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 2; j++) {
          point[i][j] = Double.parseDouble(strArr[2*i+j]);
        }
      }
      if(isCross(point) > 0) {
        System.out.println("YES");
      }
      else {
        System.out.println("NO");
      }
    }
  }
}

Measured memory_bytes: 12000
S = input()

N = len(S)
S_i_current = 'R'
length = 0
left = []
right = []
left_pos = []
right_pos = []
for i in range(N):
    S_i = S[i]
    if S_i != S_i_current:
        if S_i_current == 'R':
            right.append(length)
            left_pos.append(i)
            right_pos.append(i-1)
        else:
            left.append(length)
        S_i_current = S_i
        length = 1
    else:
        length += 1
left.append(length)

ans = [0] * N
for i in range(len(left_pos)):
    lp = left_pos[i]
    rp = right_pos[i]
    L = left[i]
    R = right[i]
    ans[lp] = R // 2 + (L + 1) // 2
    ans[rp] = L // 2 + (R + 1) // 2

print(" ".join(map(str, ans)))


Measured memory_bytes: 52080
#include <bits/stdc++.h>
#define ff first
#define ss second
#define endl '\n'
using namespace std;
const long long INF = (long long) 1e18;
const int mod = (int) 1e9+7;
const int MAXN = (int) 3e5+5;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n;
int p[MAXN], q[MAXN];
int arr1[MAXN];
int arr2[MAXN];



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

    #ifdef Local
        freopen("../IO/int.txt","r",stdin);
        freopen("../IO/out.txt","w",stdout);
    #endif
    int a1, a2;
    cin>>n;
    for(int i = 0; i < n; i++){
        cin>>p[i];
        arr1[i] = i + 1;
    }
    
    for(int i = 0; i < n; i++){
        cin>>q[i];
        arr2[i] = i + 1;
    }
    int cnt = 1;
    do{
        bool cn = 1;
        for(int i = 0; i < n; i++){
            if(p[i] != arr1[i]){
                cn = 0;
                break;
            }
        }
        if(cn){
            a1 = cnt;
        }
        cnt++;
    }while(next_permutation(arr1, arr1 + n));
    cnt = 1;
    do{
        bool cn = 1;
        for(int i = 0; i < n; i++){
            if(q[i] != arr2[i]){
                cn = 0;
                break;
            }
        }
        if(cn){
            a2 = cnt;
        }
        cnt++;
    }while(next_permutation(arr2, arr2 + n));
    cout<<abs(a1 - a2)<<endl;
    #ifdef Local
        cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds ";
    #endif
}

Measured memory_bytes: 2304
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
#include <string>

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl

using namespace std;
using i64 = long long;

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

    int search_for = 1;
    int broken_brick = 0;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin >> a;
        if (a == search_for)
        {
            search_for++;
            continue;
        }
        broken_brick++;
    }

    if (search_for == 1)
        broken_brick = -1;

    cout << broken_brick << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n;
  R n;
  ll a[n];
  rep(i,n) R a[i];
  ll x=1000;
  rep(i,n-1) {
    if(a[i]<a[i+1]) {
      ll y=x/a[i];
      x-=y*a[i];
      x+=y*a[i+1];
    }
  }
  pr(x);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 3644
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int[] cnt = new int[4];
		for(int i=0;i<N;i++){
			cnt[A[i]]++;
		}
		memo = new Dictionary<int,double>();
		memo.Add(0,0);
		Console.WriteLine(dfs(cnt[1],cnt[2],cnt[3]));
		
	}
	
	Dictionary<int,double> memo;
	
	double dfs(int one, int two, int three){
		int h = one * 400 * 400 + two * 400 + three;
		if(memo.ContainsKey(h)) return memo[h];
		
		int zero = N - one - two - three;
		double p0 = zero / (double) N;
		double p1 = one / (double) N;
		double p2 = two / (double) N;
		double p3 = three / (double) N;
		
		double v = 1;
		if(one > 0) v += p1 * dfs(one - 1, two, three);
		if(two > 0) v += p2 * dfs(one + 1, two - 1, three);
		if(three > 0) v += p3 * dfs(one, two + 1, three - 1);
		
		memo.Add(h, v / (1 - p0));
		return v / (1 - p0);
	}
	
	int N;
	int[] A;
	public Sol(){
		N = ri();
		A = ria();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main(int argc, char const *argv[])
{
	int n, m; cin >> n >> m;
	cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new KK(); }
class KK
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	const int MOD = 1000000007;
	public KK()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var I = GL;
		int N = (int)I[0];
		var K = ToBits(I[1]);
		var A = GL.Select(ToBits).ToArray();
		var cnt = new int[50];
		var mask = new bool[50];
		for (var a = 0; a < 50; a++)
		{
			for (var i = 0; i < N; i++) if (A[i][a]) cnt[a]++;
			mask[a] = cnt[a] <= N - cnt[a];
		}
		// 0<=x<=K => x[0,i) は自由, x[i]<K[i], x[i+1,50) は K と共通
		// x[0,i) は mask にすべき, K[i]=true のはず, x[i]=false のはず, 
		var ans = 0L;
		for (var a = 0; a < 50; a++) ans += cnt[a] * (1L << a);
		var hoge = 0L;
		for (var a = 0; a < 50; a++) hoge += (K[a] ? N - cnt[a] : cnt[a]) * (1L << a);
		ans = Max(ans, hoge);
		for (var i = 0; i < 50; i++) if (K[i])
			{
				var x = new bool[50];
				for (var j = 0; j < i; j++) x[j] = mask[j];
				for (var j = i + 1; j < 50; j++) x[j] = K[j];
				var sum = 0L;
				for (var a = 0; a < 50; a++) sum += (x[a] ? N - cnt[a] : cnt[a]) * (1L << a);
				ans = Max(ans, sum);
			}
		WriteLine(ans);
	}
	static bool[] ToBits(long x)
	{
		var ans = new bool[50];
		for (var i = 0; i < 50; i++) ans[i] = (x & (1L << i)) != 0;
		return ans;
	}
}


Measured memory_bytes: 36524
/*****************************************************

@author: blue_is_love
Compiled On: 25th May 2019

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

#include<bits/stdc++.h>
#define MAX 9223372036854775807
#define endl "\n"
#define ll long long
#define int long long
#define pb push_back
#define pf push_front
#define ppf pop_front
#define mp make_pair
#define ip pair<int, int>

#define loop(i,n) for(int i=0;i<n;i++)
#define fast ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL)
using namespace std;

const ll MOD = 1e9+7;
const ll SZ = 107;
const ll N = 2e3+7;

int pow(int x, int y)
{
    ll r = 1LL;
    while(y)
    {
        if(y&1)
            r = (r * x);
        y >>= 1;
        x = (x * x);
    }
    return r;
}

bool comp(pair<pair<string, int>, int> x, pair<pair<string, int>, int> y)
{
    if(x.first.first == y.first.first)
        return x.first.second > y.first.second;
    return x.first.first < y.first.first;
}

void solve()
{
	int n, m; cin>>n>>m;
    
    vector<int> adj[n+5];
    for(int i=1;i<=m;i++)
    {
        int k; cin>>k;
        for(int j=0;j<k;j++)
        {
            int x; cin>>x;
            adj[i].pb(x);
        }
    }
    int p[n+5];
    for(int i=1;i<=m;i++)
        cin>>p[i];

    int ans = 0;
    for(int i=0;i<(1<<n);i++)
    {
        int on[n];
        for(int j=0;j<n;j++)
        {
            if(i&(1<<j))
                on[j] = 1;
            else
                on[j] = 0;
        }
        int c = 0;
        for(int j=1;j<=m;j++)
        {
            int k = 0;
            for(auto x: adj[j])
                if(on[x-1])
                    k++;
            if(k%2==p[j])
                c++;
        }
        if(c==m)
            ans++;
    }
    cout<<ans;
}


signed main()
{
    fast;

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

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


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

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

int main() {
    int N;
    int M = 0, ans = 0;
    
    cin >> N;
    for (int i = 0; i < N; ++i){
        int t;
        cin >> t;
        if (t >= M){
            M = t;
            ans++;
        }
    }   
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20)
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define MOD 1000000007
#define all(vec) vec.begin(), vec.end()

int main(){
    string s;
    cin >> s;
    rep(i,3){
        if(s.at(i) == '7'){
            YES;
            return 0;
        }
    }
    NO;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
    int n;
    cin >> n;
    string s,t;
    cin >> s >> t;
    for(int i=n; i>=0; i--){
        bool hantei=true;
        for(int j=0; j<i; j++){
            if(s[n-i+j] != t[j]) hantei=false;
        }
        if(hantei){
            cout << n*2-i << endl;
            return 0;
        }
    }
    cout << n*2 <<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define QOEINDIEDIS freesteed
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

void solve(){
	int n,m,a,b;
	cin>>n>>m;
	vector<VI> grid(n+1);
	vector<int> mn(n+1,n+1); 
	rep(i,0,m){
		cin>>a>>b;
		mn[a] = min(mn[a],b);
		grid[a].pb(b);
	}
	int board=n+1,ans=0;
	for(int i=n-1;i;i--){
		if(sz(grid[i])){
			if(mn[i]<board){
				board = i+1;
				ans++;
			}
		}
	}
	cout<<ans;
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}






Measured memory_bytes: 6144
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
    int a,b;
    cin >> a >> b;
    if(a == b)cout << a * 2 << endl;
    else cout << max(a,b) + max(a-1,b-1) << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define int long long
#define range(i, a, b) for(auto i = a; i < b; i++)
#define rep(i, a) range(i, 0, a)
#define all(a) (a).begin(),(a).end()
using namespace std;
const int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const int MOD = 1000000007;
const long double EPS = 1e-8;
using vi = vector <int>;
using vvi = vector <vi>;

signed main() {
	int n, h;
	cin >> n >> h;
	vi a(n), b(n);
	int macsA = -1;
	rep (i, n) {
		cin >> a[i] >> b[i];
		macsA = max(macsA, a[i]);
	}
	sort(all(b));
	auto ub = upper_bound(all(b), macsA);
	int sum = 0;
	int cnt = 0;
	for (auto itr = b.rbegin(); *itr > macsA && itr != b.rend(); itr++) {
		sum += *itr;
		cnt++;
		if(h - sum <= 0) {
			cout << cnt << endl;
			return 0;
		}
	}
	if(h - sum <= 0)
		cout << (b.end() - ub) << endl;
	else
		cout << (b.end() - ub) + (h - sum) / macsA + ((h - sum) % macsA != 0) << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<math.h>
#include<cstring>
#include<set>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#include<string>
#include<bitset>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
typedef long long ll;
using namespace std;
const int N = 1e5;
const int INF = 1e9;
ll MOD = 998244353;
struct point
{
    int x , y , num;
};
map<int , int > m;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    string s;
    cin >> s;
    int n = s.size();
    cout << s.substr(0 , n - 8) << "\n";
    return 0;
}


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

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RREP(i, a, b) for (int i = (int)(a)-1; i >= (int)(b); --i)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) RREP(i, n, 0)
#define ALL(r) (r).begin(), (r).end()

void Main();

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}

void Main() {
    int n, r = 0;
    int64_t d, x, y;
    cin >> n >> d;
    d = d * d;
    rep(i, n) {
        cin >> x >> y;
        if ((x*x + y*y) <= d) {
            r++;
        }
    }
    cout << r << endl;
}


Measured memory_bytes: 3608
"""
author : halo2halo
date : 4, Feb, 2020
"""

import sys

# import itertools
# import math

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10 ** 9

N, K, *H = map(int, read().split())
H.sort()

print(sum(H[:N - K]) if len(H) > K else 0)


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

using namespace std;

typedef long long ll;

const int INF = 1e9;

int main()
{
  int n = 0, quantum = 0;
  fscanf(stdin, "%d %d", &n, &quantum);
  vector<string> names(n);
  vector<int> times(n, 0);
  queue<pair<int, int> > que;
  for (int i = 0; i < n; ++i) {
    cin >> names[i] >> times[i];
    que.push(make_pair(i, times[i]));
  }
  int now = 0;
  while (!que.empty()) {
    pair<int, int> p = que.front(); que.pop();
    if (p.second > quantum) {
      p.second -= quantum;
      que.push(p);
      now += quantum;
    }
    else {
      fprintf(stdout, "%s %d\n", names[p.first].c_str(), now + p.second);
      now += p.second;
    }
  }
  return 0;
}

Measured memory_bytes: 4436
N=int(input())
P=[]
for i in range(1,11111):
  p=5*i+1
  hantei=True
  for j in range(2,int(p**0.5)+1):
    if p%j==0:
      hantei=False
  if hantei:
    P+=[p]
#print(P)
print(*P[:N])

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

ll solve() {
    ll A, B;
    cin >> A >> B;
    for ( int i = 1; i <= 3; i++ ) {
        if ( A != i && B != i) {
            return i;
        }
    }
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf=0x3f3f3f3f;
const int MOD=1e9+7;
const int maxn=1e5+10;
ll gcd(ll a, ll b){return (b==0)?a:gcd(b, a%b);}
bool isPrime(ll n){
    if(n<=3){
        return n>1;
    }
    if(n%6!=1&&n%6!=5){
        return false;
    }
    ll sqr=sqrt(n);
    for(ll i=5;i<=sqr;i+=6){
        if(n%i==0||n%(i+2)==0){
            return false;
        }
    }
    return true;
}
int dis[4][2]={0,1,0,-1,1,0,-1,0};
int read(){
    int x=0,f=1;char c=getchar();
    while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
    while (c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
    return x*f;
}

int a[200005];
int main()
{
	int n;cin>>n;
	memset(a,0,sizeof(a));
	for(int i=1;i<n;i++)
	{
		int x;cin>>x;
		a[x]++;
		
	}
	for(int i=1;i<=n;i++)
	cout<<a[i]<<endl;
}
 

Measured memory_bytes: 4408
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

ll bit[300000];
void add(int k,ll x){
	k++;
	while(k<300000){
		bit[k]=max(bit[k],x);
		k+=k&-k;
	}
}
ll query(int k){
	k++;
	ll res=0;
	while(k){
		res=max(res,bit[k]);
		k-=k&-k;
	}
	return res;
}
int h[300000];
ll a[300000];
int main(){
	int n;scanf("%d",&n);
	rep(i,n){
		scanf("%d",&h[i]);
	}
	rep(i,n)scanf("%lld",&a[i]);
	rep(i,n){
		ll res=query(h[i])+a[i];
		add(h[i],res);
	}
	cout<<query(n)<<endl;
}

Measured memory_bytes: 4992
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);
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;}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }
int nmax=200000; // 2*(10^5)
vvec g(nmax);



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
   
    int n,k;
    cin>>n>>k;
    if(n==k){
        cout<<0<<endl;
        return 0;
    }
    else if(n>k){
        int memo=n/k;
        n-=memo*k;
    }

    // n<k

    cout<<min(n,abs(n-k))<<endl;

}

Measured memory_bytes: 4992
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
int main()
{
	long long a = 0, b = 0, c = 0, hairetu[4000] = { }, mi = 0, ma = 0, ansa = 0, ansb = 0, count = 1;
	
	using namespace std;

	int x = 0, y = 0, z = 0;
	std::string str, strt, str_s;
	bool okada=false;
	cin >> x;
	for (int i = 0; i < x; i++) {
		std::cin >> hairetu[i];
		a += hairetu[i]-1;
	}
	cout << a<<endl;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int k,a,b;
	cin>>k;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(i%k==0){
			cout<<"OK"<<endl;
			return 0;
		}
	}
	cout<<"NG"<<endl;
	
}

Measured memory_bytes: 3636