akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N, A, B;
int ans[MAX_N];

void solve() {
	cin >> N >> A >> B;
	if(N == 1) {
		if(A == 1 && B == 1) {
			cout << 1 << "\n";
		}
		else cout << "-1\n";
		return;
	}
	bool swaped = false;
	if(A < B) {
		swap(A, B);
		swaped = true;
	}
	vector<int> cnt(B, 1);
	int n = N;

	if((N + A - 1) / A > B) {
		cout << "-1\n";
		return;
	}

	rep(i, 0, (N + A - 1) / A) {
		cnt[i] = min(A, n);
		n -= A;
	}

	int r = B - (N + A - 1) / A;

	rep(i, 1, (N + A - 1) / A) {
		if(cnt[i] - 1 >= r) {
			cnt[i] -= r;
			r = 0;
		}
		else {
			cnt[i] = 1;
			r -= (cnt[i] - 1);
		}
	}

	if(r != 0) {
		cout << "-1\n";
		return;
	}

	int at = 0;
	int from = N - 1;

	rep(i, 0, B) {
		rep(j, 0, cnt[i]) {
			ans[at] = from - cnt[i] + j + 1;
			at++;
		}
		from -= cnt[i];
	}

	if(swaped) reverse(ans, ans + N);
	rep(i, 0, N) {
		cout << ans[i] + 1 << " ";
	}
	cout << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 3968
/* https://atcoder.jp/contests/abc123/tasks/abc123_c */

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

long long N;
std::vector<long long> city(5);

void solve()
{
  long long min_cap = *std::min_element(city.begin(), city.end());
  long long bottole_neck = (N+min_cap-1)/min_cap+4;
  std::cout << bottole_neck << std::endl;
  return;
}

int main(int argc, char *argv[])
{
  // Input
  std::cin >> N;

  for (long long & e: city)
    std::cin >> e;

  // Output
  solve();

  return 0;
}


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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//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())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

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

//main code

int main(int argc, char const* argv[])
{
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		cout << (s[i] == '1' ? '9' : '1');
	}
	cout << endl;
	return 0;
}


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

int main() {
  long long N;
  scanf("%lld", &N);
  long long K;
  scanf("%lld", &K);
  long long R;
  scanf("%lld", &R);
  long long S;
  scanf("%lld", &S);
  long long P;
  scanf("%lld", &P);
  std::string T;
  std::cin >> T;

  string prev;

  int r, p, s;
  r = p = s = 0;

  for (int i = 0; i < T.size(); i++) {
    if (i < K || T[i] != prev[i - K]) {
      switch (T[i]) {
        case 'r':
          r++;
          prev.push_back('r');
          break;
        case 'p':
          p++;
          prev.push_back('p');
          break;
        case 's':
          s++;
          prev.push_back('s');
          break;
      }
    } else {
      prev.push_back(0);
    }
  }

  int result = P * r + S * p + R * s;
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 640
import java.util.*;
public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    String[] a = S.split("");
    int price = 700;
    for(int i = 0; i<3; i++){
      if(a[i].equals("o")){
        price += 100;
      }
    }
    System.out.println(price);
  }
}

Measured memory_bytes: 35608
N,T = (int(i) for i in input().split())
t = [int(i) for i in input().split()]
ans = 0
for i in range(1,N):
    if t[i]-t[i-1] <= T:
        ans += t[i]-t[i-1]
    else:
        ans += T
print(ans+T)


Measured memory_bytes: 25200
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))

i32 popcnt (i32 b) {
  i32 res = 0;
  while (b > 0) {
    res += b & 1;
    b >>= 1;
  }
  return res;
}

void run (void) {
  i32 n, m;
  scanf ("%" SCNi32 "%" SCNi32, &n, &m);
  i32 *bit = ALLOC (m, i32);
  i32 *p = ALLOC (m, i32);
  for (i32 i = 0; i < m; ++i) {
    i32 k;
    scanf ("%" SCNi32, &k);
    while (k--) {
      i32 s;
      scanf ("%" SCNi32, &s);
      s--;
      bit[i] |= 1 << s;
    }
  }
  for (i32 i = 0; i < m; ++i) {
    scanf ("%" SCNi32, p + i);
  }
  i32 ans = 0;
  for (i32 i = 0; i < (1 << n); ++i) {
    i32 ok = 1;
    for (i32 j = 0; j < m; ++j) {
      if (popcnt (bit[j] & i) % 2 != p[j]) {
        ok = 0;
      }
    }
    ans += ok;
  }
  printf ("%" PRIi32 "\n", ans);
}

int main (void) {
  run();
  return 0;
}


Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		ArrayList<Pair> p = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			String str[] = br.readLine().split(" ");
			p.add(new Pair(Long.parseLong(str[0]), Long.parseLong(str[1])));
		}

		int ans = n;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (i == j)
					continue;
				long xx = p.get(j).x - p.get(i).x;
				long yy = p.get(j).y - p.get(i).y;

				int res = 0;
				for (int ii = 0; ii < n; ii++) {
					for (int jj = 0; jj < n; jj++) {
						if (ii == jj)
							continue;
						if (xx == p.get(jj).x - p.get(ii).x && yy == p.get(jj).y - p.get(ii).y) {
							res++;
						}
					}
				}
				ans = Math.min(ans, n - res);
			}
		}
		System.out.println(ans);
	}
}

class Pair implements Comparable<Pair> {
	long x;
	long y;

	public Pair(long x, long y) {
		this.x = x;
		this.y = y;
	}

	@Override
	public int hashCode() {
		return String.valueOf(x).hashCode() + String.valueOf(y).hashCode();
	}

	@Override
	public boolean equals(Object o) {
		if (((Pair) o).x == this.x && ((Pair) o).y == this.y) {
			return true;
		}
		return false;
	}

	@Override
	public int compareTo(Pair p) {
		if (this.x > p.x) {
			return 1;
		} else if (this.x < p.x) {
			return -1;
		} else {
			if (this.y > p.y) {
				return 1;
			} else if (this.y < p.y) {
				return -1;
			} else {
				return 0;
			}
		}
	}
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

template< class T >
class CumulativeSum2D
{
public:
    vector< vector< T > > m_data;

    CumulativeSum2D(int W, int H) : m_data(W + 1, vector< int >(H + 1, 0)) {}

    // 要素 (x,y) に値 z を加える O(1)
    void Add(int x, int y, int z) {
        ++x, ++y;
        if(x >= m_data.size() || y >= m_data[0].size()) { return; }
        m_data[x][y] += z;
    }

    // 累積和の構築 O(WH)
    void Build() {
        for(int i = 1; i < m_data.size(); i++) {
            for(int j = 1; j < m_data[i].size(); j++) {
                m_data[i][j] += m_data[i][j - 1] + m_data[i - 1][j] - m_data[i - 1][j - 1];
            }
        }
    }

    // 左上 [sx, sy], 右下(gx, gy) の矩形内の和を求める O(1)
    // 右下は含まないので注意
    T Query(int sx, int sy, int gx, int gy) {
        return (m_data[gx][gy] - m_data[sx][gy] - m_data[gx][sy] + m_data[sx][sy]);
    }
};

ll N, M, Q;

signed main()
{
    cin >> N >> M >> Q;
    CumulativeSum2D<ll> cs(N+1, N+1);
    REP(i, M) {
        ll l, r;
        cin >> l >> r;
        cs.Add(l, r, 1);
    }
    cs.Build();
    REP(i, Q) {
        ll p, q;
        cin >> p >> q;
        printf("%lld\n", cs.Query(p, p, q+1, q+1));
    }

    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,  //less_equal
             tree_order_statistics_node_update> oset; 
typedef long long ll;
typedef pair<int,int> pi;
const int MAXN = 1e6 + 5;
const int MOD = 1e9 + 7;
const int MAXK = 2e3 + 2;
#define sz(x) (int)(x).size()
#define f first
#define s second

map<string,ll> mp;



int main()
{
 
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for(int i = 0 ; i < n ; i++)
	 {
	 	string s;
	 	cin >> s;
	 	sort(s.begin(),s.end());
	 	mp[s]++;
	 }

ll ans = 0;
for(auto &k : mp)
 ans+=(ll)k.second * (ll)(k.second - 1) / 2;

cout << ans ;
   
 
}

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

int a[1005],b[1005];
int dp[10005];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,h,i,j;
    cin>>h>>n;
    memset(dp,0x3f,sizeof(dp));
    dp[0]=0;
    for(i=0;i<n;i++){
        cin>>a[i]>>b[i];
        for(j=0;j<=h;j++){
            dp[min(j+a[i],h)]=min(dp[min(j+a[i],h)],dp[j]+b[i]);
        }
    }
    cout<<dp[h];
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
long long dp[100][100001] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  int n,W;
  cin >> n >> W;
  vector<array<long long,2>> wv(n);
  for(int i=0;i<n;i++) {
    cin >> wv[i][0] >> wv[i][1];
  }
  for(int item_no = n-1;item_no>=0;item_no--) {
    for(int capacity=0;capacity<=W;capacity++) {
      if (item_no==n-1) {
        if (capacity>=wv[item_no][0])
          dp[item_no][capacity] = wv[item_no][1]; 
      } else {
        dp[item_no][capacity] = dp[item_no+1][capacity];
        if (capacity >= wv[item_no][0])
          dp[item_no][capacity] = max(dp[item_no][capacity],
                                      dp[item_no+1][capacity- wv[item_no][0]] + wv[item_no][1]);
      }
    }
  }
  cout << dp[0][W];
  return 0;
}

Measured memory_bytes: 78336
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>
 
const int MAX_N = 100050;
int N;
long long a[MAX_N * 3], max_cand[MAX_N * 3], min_cand[MAX_N * 3];
 
int main(int argc, char **argv) {
    std::cin >> N;

    for (int i = 1; i <= N * 3; i++) {
        std::cin >> a[i];
    }

    max_cand[0] = 0;
    std::priority_queue<int, std::vector<int>, std::greater<int>> que_for_max;
    for (int i = 1; i <= N * 2; i++) {
        que_for_max.push(a[i]);
        int tmp = 0;
        if (que_for_max.size() > N) {
            tmp = que_for_max.top();
            que_for_max.pop();
        }
        max_cand[i] = max_cand[i-1] + a[i] - tmp;
    }

    min_cand[N * 3 + 1] = 0;
    std::priority_queue<int> que_for_min;
    for (int i = 3 * N; N + 1 <= i; i--) {
        que_for_min.push(a[i]);
        int tmp = 0;
        if (que_for_min.size() > N) {
            tmp = que_for_min.top();
            que_for_min.pop();
        }
        min_cand[i] = min_cand[i+1] + a[i] - tmp;
    }

    long long ret = -(long long)MAX_N * 3 * 1000000000;
    for (int i = 0; i <= N; i++) {
        ret = std::max(ret, max_cand[N + i] - min_cand[N + i + 1]);
    }
    std::cout << ret << std::endl;

    return 0;
}

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

int main() {
    int64_t a,b,x;
    cin>>a>>b>>x;
    if(a==0){
        cout<<b/x+1<<endl;
    }else{
        cout<<(b/x+1)-((a-1)/x+1)<<endl;
    }
}


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

#define REP(i, start, count) for (int i = (start); i < (int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;

string N;

int main(void)
{

    cin >> N;
    if (N[0] == '7' || N[1] == '7' || N[2] == '7') {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}

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

int main(){
  int n, m, p;
  int i, k, wan, j;



    while(1){
      int temp[60] = {}, ans = -1;
      cin>>n>>p;
      
      if(n == 0 && p == 0) break;
      
      wan = p;

      //  cout<<n<<endl;
      while(1){//cout<<"QQQQQQQQQQQQQQQQQQQQQQQ"<<endl;cout<<"wan = "<<wan<<endl;



	
	for(i = 0; i < n; i++){//cin>>n;cout<<"NNNNNN"<<endl;
	  if(wan >= 1){//cout<<"wan = "<<wan<<endl;
	    if(wan == 1){//cout<<"CCCCCCCCCCCCCCCCCCCCCCC"<<endl;cout<<"wan = "<<wan<<endl;
	      // k = 0;
	      // cin>>n;
	      /* for(j = 0; j < n; j++){cout<<"BBBBBBBBBBBBBBBBBBBBB"<<endl;
		if(temp[j] >= 1){//cout<<temp[j];
		  k = 1;cout<<"ZZZZZZZZZZZZZZZZZZZZZZZZZZZZ  temp[j] ="<<temp[j]<<" j ="<<j<<endl;
		  break;
		}//cin>>n;
		}*/ wan--;
	      temp[i]++;
	      if(temp[i] == p){//cout<<"DDDDDDDDDDDDDDDD"<<endl;cout<<"wan = "<<wan<<endl;
		  ans = i;
		  break;
	      }//cin>>n;
	      
	    } else {//cout<<"EEEEEEEEEEEEEEEEEEEE"<<endl;
	      // cout<<"wan = "<<wan<<endl;
	      temp[i]++;//cout<<temp[i]<<" "<<i<<endl;
	      wan--;//cin>>n;
	    }
	    
	  } else {//cout<<"AAAAAAAAAAA"<<endl;cout<<"wan = "<<wan<<endl;
	    wan += temp[i];//cin>>n;
	    temp[i] = 0;
	  }
	  
	}





	if(ans != -1)break;//cout<<"RRRRR"<<endl;cout<<"wan = "<<wan<<endl;

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



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

typedef struct edge {
    int to;
    ll cost;
} edge;

vector<edge> G[100010];
bool v[100010];
vector<ll> X(100010);

void dfs(int x, ll D) {
    if (v[x]) return;
    v[x] = true;
    X[x] = D;
    for (auto e: G[x]) {
        dfs(e.to, e.cost+D);
    }
    return;
}

int main(int argc, char const *argv[]) {
    int n, m;
    cin >> n >> m;
    vector<int> l(m);
    vector<int> r(m);
    vector<ll> d(m);
    REP(i,m) {
        cin >> l[i] >> r[i] >> d[i];
        --r[i], --l[i];
        G[l[i]].push_back({r[i], d[i]});
        G[r[i]].push_back({l[i], -d[i]});
    }
    REP(i,100010) v[i] = false;
    REP(i,n) {
        dfs(i, 0);
    }
    REP(i,m) {
        if (X[r[i]]-X[l[i]] != d[i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 18816
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    cin >> n;
    
    long a[n], ans = 0;
    cin >> a[0];
    for(int i = 1;i < n;i++){
        cin >> a[i];
        if(a[i - 1] > a[i]){
            ans += a[i - 1] - a[i];
            a[i] = a[i - 1];
        }
    }
    /*
    for(int i = 0;i < n;i++){
        cout << a[i] << ' ';
    }
    cout << '\n';
    */
    
    cout << ans;
    return 0;
}


Measured memory_bytes: 5144
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;

int main()
{
    int a,b,k;
    cin >> k;
    cin >> a >> b;

    for(int i=a;i<=b;i++){
        if (i%k == 0){
            cout << "OK";
            return 0;
        }

    }
    cout << "NG";

    return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793




int main(){
    string s;
    cin >> s;
    int n=s.size();
    int w;
    cin >> w;
    rep(i,n){
        if(i%w==0)cout << s.at(i);
    }
    cout << endl;
}



    
   


Measured memory_bytes: 3588
#include<iostream> 
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <vector>

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



int main() {
	int a, b, c,ans=0,ans2=0,an,bn,cn;
	cin >> a >> b >> c;
	while (1) {
		ans2++;
		if (ans2 > 10000000) {
			cout << -1 << endl;
			return 0;
		}

		if (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
			an = b / 2 + c / 2;
			//cout << a << endl;
			bn = a / 2 + c / 2;
			//cout << b<< endl;
			cn = a / 2 + b / 2;
			//cout << c<< endl;
			ans++;
			a = an;
			b = bn;
			c = bn;
		}
		else break;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define MM <<" "<<
#define Endl endl

signed main(void){
    int N,A,B;
    cin >> N >> A >> B;
    cout << min(N*A,B) << endl;
    
    return 0;
}




Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
B - Bitter Alchemy
https://beta.atcoder.jp/contests/abc095/tasks/abc095_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(X, M):
    ans = 0

    total = sum(M)
    if X < total:
        return ans

    X -= total
    ans += len(M)
    ans += X // min(M)
    return ans


def main(args):
    N, X = map(int, input().split())
    M = []
    for _ in range(N):
        M.append(int(input()))
    ans = solve(X, M)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 3064
import sys
if sys.platform in ['ios', 'win32', 'darwin']:
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(x) for x in input().split()]

S, C = MAP()

ans = 0

tmp = min(S//1, C//2)
ans += tmp
S -= tmp*1
C -= tmp*2

if C >=4: ans += C//4

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <queue>
#include <stack>
using namespace std;
 
int main(){
	long long N,P;
	cin>>N>>P;
	long long ans = 1;
	for(long long i=2;i*i<=P;i++){
		int cnt=0;
		while(true){
			if(P%i==0){
				P/=i;
				cnt++;
			}
			else{
				break;
			}
		}
		for(int j=0;j<cnt/N;j++){
			ans*=i;
		}
	}
	if(N==1){
		ans*=P;
	}
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 256
/**
 *    author:  tourist
 *    created: 15.09.2018 15:11:41       
**/
#include <bits/stdc++.h>

using namespace std;

long long lcm(long long a, long long b) {
  return a / __gcd(a, b) * b;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int real_n;
  cin >> real_n;
  int n = 500;
  vector<int> primes;
  int x = 2;
  while ((int) primes.size() < 2 * n + 5) {
    int prime = 1;
    for (int i = 2; i * i <= x; i++) {
      if (x % i == 0) {
        prime = 0;
        break;
      }
    }
    if (prime) {
      primes.push_back(x);
    }
    x++;
  }
  vector<vector<long long>> a(n, vector<long long>(n, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if ((i + j) % 2 == 0) {
        a[i][j] = primes[(i + j) / 2] * primes[(i - j) / 2 + n + n / 2 + 2];
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if ((i + j) % 2 == 1) {
        a[i][j] = 1;
        if (i > 0) a[i][j] = lcm(a[i][j], a[i - 1][j]);
        if (j > 0) a[i][j] = lcm(a[i][j], a[i][j - 1]);
        if (i < n - 1) a[i][j] = lcm(a[i][j], a[i + 1][j]);
        if (j < n - 1) a[i][j] = lcm(a[i][j], a[i][j + 1]);
        a[i][j]++;
        assert(a[i][j] <= (long long) 1e15);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - 1; j++) {
      assert(max(a[i][j], a[i][j + 1]) % min(a[i][j], a[i][j + 1]) == 1);
      assert(max(a[j][i], a[j + 1][i]) % min(a[j][i], a[j + 1][i]) == 1);
    }
  }
  set<long long> all;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      all.insert(a[i][j]);
    }
  }
  assert((int) all.size() == n * n);
  for (int i = 0; i < real_n; i++) {
    for (int j = 0; j < real_n; j++) {
      if (j > 0) {
        cout << " ";
      }
      cout << a[i][j];
    }
    cout << '\n';
  }
  return 0;
}


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

const int QSIZE = 3;
int main() {
  string Sin;
  int Q;
  cin >> Sin >> Q;
  deque<char> S;
  for (int i = 0; i < Sin.size(); i ++) S.push_back(Sin.at(i));
  
  bool rev = false;
  int T, F;
  char C;
  for (int i = 0; i < Q; i ++) {
    cin >> T;
    if (T == 1) {
      rev = !rev;
    }
    else if(T == 2) {
      cin >> F >> C;
      if ((F == 1 && !rev) || (F == 2 && rev)) S.push_front(C);
      else if ((F == 1 && rev) || (F == 2 && !rev)) S.push_back(C);
    }
  }
    for (int i = 0; i < S.size(); i++) {
    if (rev) cout << S.at(S.size()-i-1); 
    else cout << S.at(i); 
  }
}


Measured memory_bytes: 896
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9

int main (){
   int s[4];scanf("%s",s);
   if(!strcmp(s,"AAA")||!strcmp(s,"BBB"))printf("No\n");
   else printf("Yes\n");
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;


typedef long long ll;
const int mod = 1e9 + 7;

ll n, k;

ll cal(ll x) {  // (K/x)^N
    int p = n;
    x = 1LL * k / x;
    x %= mod;
    ll res = 1;
    while (p > 0) {
        if (p & 1) res = (x * res) % mod;
        x = x * x % mod;
        p >>= 1;
    }
    return res;
}

void solve() {

    cin >> n >> k;
    vector<ll> g(k + 1, 0);
    for (ll i = k; i >= 1; i--) {
        ll tmp = cal(i);
        ll extra = 0;
        for (ll j = i * 2; j <= k; j += i) {
            extra = (extra + g[j]) % mod;
        }
        tmp %= mod;
        tmp %= mod;
        g[i] = (tmp - extra + mod) % mod;
    }
    ll ans = 0;
    for (int i = 1; i <= k; i++) {
        int add = ((g[i] % mod) * (i % mod)) % mod;
        ans = (ans + add) % mod;
    }
    cout << ans << endl;
}

int main() {
    //freopen("in.txt", "r", stdin);

    solve();

    return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
const int mex=2005;
#define ll long long 
#define test int t;cin>>t;while(t--)
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,a,n) for(int i=a;i<n;i++)
#define rfo(i,a,b) for(int i=a;i>=b;i--)
#define bg begin()
#define en end()
#define fi first
#define se second
#define ub upper_bound
#define lb lower_bound
#define pb push_back
#define veci vector<int>
#define veclli vector<long long int> 
#define all(x) x.begin(),x.end()
#define sci(x) scanf("%d",&x);
#define scc(x) scanf("%c",&x);
#define scs(x) scanf("%s",x);
#define debug(arr,n) for(int i=0;i<n;i++) printf("%d ",arr[i]);
#define sz(x) x.size()
#define loop(x) for(auto it=x.begin();it!= x.end();it++) 
int main()
{
    ll int k,x;
    cin>>k>>x;
    if(500*k>=x) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#define MIN(x,y)	((x)<(y)?(x):(y))
#define ABS(x)		((x)<0 ? -(x):(x))
int main(){
  long long n,k,ans=0;
  scanf("%lld%lld", &n, &k);
  if	 ( n==k ){ ans = 0;   }
  else if( n> k ){ ans = MIN(n%k, ABS(n%k-k)); }
  else if( n< k ){ ans = MIN(n,	  ABS(n  -k)); }
  printf("%lld\n", ans);
  return 0;
}

Measured memory_bytes: 1732
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(g);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double PI = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
ll mod = 1e9 + 7;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	long long n;
	cin >> n;
	vector<long long> a(n);
	long long sunu = 0, ans = M, arai = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		arai += a[i];
	}

	for (int i = 0; i < n - 1; i++) {
		sunu += a[i];
		arai -= a[i];
		ans = min(ans,abs(sunu - arai));
		//cout << min << endl;
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
const int N = 2e5+50;
const int M = 1e6;
const ll oo = 1e18;
const int mod = 1e9+7;

ll dp[3030][3030],a[3030];

int main(){
	int n;
	cin>>n;
	for(int i=0;i<n*n;i++)
		cin>>a[i];
	for(int i=n-1;i>=0;i--){
		for(int j=i;j<n;j++){
			if(i == j)
				dp[i][j] = a[i];
			else 
				dp[i][j] = max(a[i] - dp[i+1][j] , a[j] - dp[i][j-1]);
		}
	}
	cout << dp[0][n-1] << endl;
}

Measured memory_bytes: 71936
# coding: utf-8
# Your code here!
from bisect import bisect_left


n,m = [int(i) for i in input().split()]
py = [[int(i) for i in input().split()] for _ in range(m)]

spy = list(sorted(py))

for p,y in py:
    l2 = bisect_left(spy,[p,y])
    l1 = bisect_left(spy,[p,0])
    print(format(p, '06')+format(l2-l1+1, '06'))

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

int main() {
    ll N, K; cin >> N >> K;
    ll ok = 1e9; ll ng = 1;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
    int t = 40;
    while(t--) {
        ll mid = (ok + ng) / 2;
        ll count = 0;
        for (int i = 0; i < N; i++) {
            count += A[i] / mid;
            if (A[i] % mid == 0) count--;
        }
        if (count > K) ng = mid;
        else ok = mid;
    }
    cout << ok << endl;
}

Measured memory_bytes: 4840
#include <bits/stdc++.h>
#define lli long long int
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(lli i=0, i##_len=(lli)(n); i<i##_len; i++)
#define repf(i, n) for(lli i=1, i##_len=(lli)(n+1); i<i##_len; i++)
#define per(i, n) for(lli i=((lli)(n))-1; i>=0; i--)
#define perf(i, n) for(lli i=((lli)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<lli>
#define vvi vector<vector<lli>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
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 namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    lli n;
    cin >> n;
    lli cnt = 0;
    repf(i, n){
        string s = to_string(i);
        if(s.size()%2ll != 0) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <time.h>

#include <stdlib.h>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <cstdint>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <bitset>
#include <iterator>
#include <deque>
#include <string>
#include <queue>
#include <omp.h>
#include <fstream>   // ifstream, ofstream
typedef int64_t ll;
using namespace std;
const ll INF=1e10;



int main(){
	ll x,a;
	cin>>x>>a;
	if(x<a){
		cout<<0<<endl;
	}else{
		cout<<10<<endl;
	}
}


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

//#pragma comment(linker, "/STACK:400000000")

#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define pb push_back
#define sz size()
#define vi vector<int>

string in;
vi a;

int dfs(vi v,int rest){
    if(rest==0)return 1;
    if(rest==14){
        rep(i,9)if(v[i]>=2){
            vi w=v;
            w[i]-=2;
            if(dfs(w,12))return 1;
        }
        return 0;
    }
    rep(i,9)if(v[i]>=3){
        vi w=v;
        w[i]-=3;
        if(dfs(w,rest-3))return 1;
    }
    rep(i,7)if(v[i] && v[i+1] && v[i+2]){
        vi w=v;
        w[i]--; w[i+1]--; w[i+2]--;
        if(dfs(w,rest-3))return 1;
    }
    return 0;
}

int main(){
	while(cin>>in){
        vi v(9,0),ans;
        rep(i,13)v[in[i]-'1']++;
        rep(i,9){
            if(v[i]==4)continue;
            vi w=v;
            w[i]++;
            if(dfs(w,14))ans.pb(i);
        }
        if(ans.sz==0)cout<<0<<endl;
        else{
            rep(i,ans.sz)cout<<ans[i]+1<<( i!=ans.sz-1?" ":"\n");
        }
    }
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <utility>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long int ll;

int main() {
  int N;
  cin>>N;
  
  vector<double> v(N);
  for(int i=0;i<N;++i){
    cin>>v[i];
  }
  
  sort(v.begin(),v.end(),greater<int>());
  
  double ans=0.0;
  for(int i=0;i<N-1;++i){
    double x=pow(2.0,i+1);
    ans+=v[i]/x;
  }
  double y=pow(2.0,N-1);
  ans+=v[N-1]/y;
  
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	int r[n];
	for(int i=0;i<n;i++)
		cin >> r[i];
	int MAX=-2000000000,MIN=r[0];
	for(int i=1;i<n;i++){
		MAX=max(MAX,r[i]-MIN);
		MIN=min(MIN,r[i]);
	}
	cout << MAX << endl;
	return 0;
}

Measured memory_bytes: 3868
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
    string s; cin >> s;
    int n = s.size();
    for(int left=0;left<n;left++) {
        int right = left;
        map<char, int> mp;
        while(right < n && right-left <=2) {
            mp[s[right]] = 1;
            if(right-left==1 && mp.size()==1) {
                printf("%d %d\n", left+1, right+1);
                return 0;
            }
            if(right-left==2 && mp.size()==2) {
                printf("%d %d\n", left+1, right+1);
                return 0;
            }
            right++;
        }
    }
    printf("%d %d\n", -1, -1);
}


Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 2e5 + 10;
char s[N];

int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  vector<int> sum(n + 1);
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + (s[i] == '#');
  }
  int ret = INF;
  for (int k = 0; k <= n; ++k) {
    int cur = sum[k] + (n - k - sum[n] + sum[k]);
    ret = min(ret, cur);
  }
  printf("%d\n", ret);
  return 0;
}


Measured memory_bytes: 1280
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, q, last, cnt, sum[2000000], ans, dp[20][20], a[300][300],b[2000000],ci[20][20];
string str;
bool f;
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ -1,0 } ,{ 0,-1 } };
struct Edge { LL to, cost; };
vector<Edge>vec[1000000];
vector<Pll>v;
map<string, LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
int main() {
	cin >> h >> w;
	rep(i, 10)
		rep(j, 10) {
		cin >> ci[i][j];
		dp[i][j] = ci[i][j];
	}
	rep(k, 10) {
		rep(i, 10) {
			rep(j, 10) {
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
			}
		}
	}
	rep(i, h)
		rep(j, w) {
		cin >> a[i][j];
		if (a[i][j] != -1)
			ans += dp[a[i][j]][1];
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 26880
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	double n;
	cin>>n;
	cout<<fixed<<setprecision(12)<<(n/3)*(n/3)*(n/3);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <vector>

//#define PI 3.141592653589

using namespace std;

vector<double> heights;

int main()
{
	double height;
	double hyoukousa;
	int num = 0;
	
	while (cin >> height)
	{
		heights.push_back(height);
		num++;
	}
	sort(heights.begin(), heights.end());
	hyoukousa = heights[num-1] - heights[0];
	/*
	for (int i=0; i<num; i++)
	{
		cout << heights[i] << endl;
	}
	*/
	cout << hyoukousa << endl;
	
	return 0;
}

Measured memory_bytes: 1304
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int k=sc.nextInt();
    int[] a={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    System.out.print(a[k-1]);
  }
}

Measured memory_bytes: 23124
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int x = sc.nextInt();
		int t = sc.nextInt();

		System.out.println((n + x - 1)/x * t);
	}

}


Measured memory_bytes: 26988
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <bitset>
#include <functional>
#include <random>
#define REP(_i,_a,_n) for(int _i=_a;_i<=_n;++_i)
#define PER(_i,_a,_n) for(int _i=_n;_i>=_a;--_i)
#define hr putchar(10)
#define pb push_back
#define lc (o<<1)
#define rc (lc|1)
#define mid ((l+r)>>1)
#define ls lc,l,mid
#define rs rc,mid+1,r
#define x first
#define y second
#define io std::ios::sync_with_stdio(false)
#define endl '\n'
#define DB(_a) ({REP(_i,1,n) cout<<_a[_i]<<',';hr;})
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int P = 1e9+7, INF = 0x3f3f3f3f;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll qpow(ll a,ll n) {ll r=1%P;for (a%=P;n;a=a*a%P,n>>=1)if(n&1)r=r*a%P;return r;}
ll inv(ll x){return x<=1?1:inv(P%x)*(P-P/x)%P;}
inline int rd() {int x=0;char p=getchar();while(p<'0'||p>'9')p=getchar();while(p>='0'&&p<='9')x=x*10+p-'0',p=getchar();return x;}
//head



#ifdef __APPLE__
const int N = 1e2+50;
#else
const int N = 1e6+50;
#endif




int main() {
	ll a,b,v,w,t;
	cin>>a>>v>>b>>w>>t;
	if (v<=w) return puts("NO"),0;
	v -= w;
	if ((ll)t*v>=abs(b-a)) return puts("YES"),0;
	return puts("NO"),0;
}









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



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

    int A,B;
    cin >> A >> B;
    int ans;
    if(A==B) ans=A+B;
    else{
        int x=max(A,B);
        ans=x+(x-1);
    }
    cout << ans << endl;



}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n=int(input())
    A=list(map(int,input().split()))
    rgb=[-1,-1,-1]
    ans=1
    mod=10**9+7
    for a in A:
        ans=ans*Counter(rgb)[a-1]%mod
        if ans==0:break
        rgb[rgb.index(a-1)]+=1
    print(ans)
    

if __name__=='__main__':
    main()

Measured memory_bytes: 53036
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n; scanf("%d", &n);
	std::vector<std::pair<std::string, std::pair<int, int>>> vec;
	for(int i = 0; i < n; i++) {
		std::string s; int p; cin >> s >> p;
		
		vec.push_back({s, {-p, i + 1}});
	}
	sort(begin(vec), end(vec));
	
	for(auto v: vec) printf("%d\n", v.second.second);
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <iterator>
#include <climits>
#include <unordered_map>
#include <functional>
#include <queue>

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

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

inline int ctoi(char c) {
    return (int)(c -'0');
}

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

ll are[100010];

int main() {
    ll q;
    cin >> q;
    vector<P> query(q);
    rep(i, q) {
        cin >> query[i].first >> query[i].second;
        if (query[i].first != 0) {
            --query[i].first;
        }
    }

    vector<ll> prime_numbers;
    prime_numbers.push_back(2);
    prime_numbers.push_back(3);

    are[2] = 0;
    are[3] = 1;
    ll p_count = 1;
    for(int i = 4; i <100010; ++i) {
        bool is_prime = true;
        for(auto p : prime_numbers) {
            if (i % p == 0) {
                is_prime = false;
                break;
            }
        }
        if (is_prime) {
            prime_numbers.push_back(i);
        }
        if ( i % 2 != 1) {
            are[i] = p_count;
            continue;
        }
        if (is_prime) {
            if (find(prime_numbers.begin(),
                     prime_numbers.end(),
                     (i + 1)/2) != prime_numbers.end()) {
                ++p_count;
            }
        }
        are[i] = p_count;
    }

    rep(i, q) {
        cout << (are[query[i].second] - are[query[i].first]) << endl;
    }

    return 0;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Data{
public:
	char M;
	int N,I;
	bool operator<(const Data& rhs){
		return N<rhs.N;
	}
};

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

	int N=in();
	vector<Data> C(N);
	REP(i,N){
		string S=in<string>();
		C[i].M=S[0];
		C[i].N=S[1]-'0';
		C[i].I=i;
	}

	auto B(C);
	REP(i,N){
		for(int j=0;j<N-1-i;j++){
			if(B[j].N>B[j+1].N){
				swap(B[j],B[j+1]);
			}
		}
	}
	REP(i,N-1){
		cout << B[i].M << B[i].N << ' ';
	}
	cout << B[N-1].M << B[N-1].N << endl;

	bool stable = true;
	REP(i,9){
		auto itr = B.begin();
		int origin = -1;
		while(itr!=B.end()){
			if(itr->N!=i+1){
				++itr;
				continue;
			}
			if(origin>itr->I){
				stable = false;
				break;
			}
			origin = itr->I;
			++itr;
		}
		if(!stable) break;
	}
	out(stable ? "Stable" : "Not stable");

	auto S(C);
	REP(i,N){
		auto res = min_element(S.begin()+i,S.end());
		if(res!=(S.begin()+i)){
			iter_swap(res,S.begin()+i);
		}
	}

	REP(i,N-1){
		cout << S[i].M << S[i].N << ' ';
	}
	cout << S[N-1].M << S[N-1].N << endl;

	stable = true;
	REP(i,9){
		auto itr = S.begin();
		int origin = -1;
		while(itr!=S.end()){
			if(itr->N!=i+1){
				++itr;
				continue;
			}
			if(origin>itr->I){
				stable = false;
				break;
			}
			origin = itr->I;
			++itr;
		}
		if(!stable) break;
	}
	out(stable ? "Stable" : "Not stable");

	return 0;
}



Measured memory_bytes: 3212
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool b = true;
  if (N % 2 == 1) {b = false;}
  for (int i = 0; i < N / 2; i++) {
    if (S.at(i) != S.at(i + N / 2)) {b = false;}
  }
  if (b) {cout << "Yes" << endl;}
  else {cout << "No" << endl;}
}

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


int main(){
    int n,x;
    cin>>n>>x;
    int l,sum=0,ans=1;
    for(int i=0;i<n;++i){
        cin>>l;
        sum+=l;
        if(sum<=x)ans++;
        else break;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
/**********************************************
 * author : deepak nayan
 * file   : e:/Solutions/atcoder/abc105_a.cpp
 * time   : Thu Apr 30 21:59:27 2020
 * quest  : A - AtCoder Crackers
 *********************************************/
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  cout << ((n % k) ? 1 : 0) << "\n";
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    static Scanner stdIn = new Scanner(System.in);
    public static void main(String[] args){
		int h = stdIn.nextInt();
		int w = stdIn.nextInt();
		int n = stdIn.nextInt();

		if(h > w){
			System.out.println((int)Math.ceil((double)n/h));
		}else{
			System.out.println((int)Math.ceil((double)n/w));
		}
	}
}


Measured memory_bytes: 35632
#include <iostream>
#include <stdio.h>
using namespace std;
 
int main(){
	double r,are,circ,p;
	cin >> r;
	p=3.141592653589;
	
	are=2*p*r;
	circ=r*r*p;
	printf("%f %f\n",circ,are);
    return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h>
 
typedef unsigned long long int ull;
typedef long double ldb;
typedef long long int ll;
 
#define for01(n)  for (ll i=0; i<n; i++)
#define for02(n)  for (ll j=0; j<n; j++)
#define for03(n)  for (ll k=0; k<n; k++)
#define for11(n)  for (ll i=1; i<=n; i++)
#define for12(n)  for (ll j=1; j<=n; j++)
#define for13(n)  for (ll k=1; k<=n; k++)

#define pb push_back
#define mp make_pair
#define vll vector<ll>
#define F first
#define S second
#define pp pair <ll, ll>
#define lb lower_bound
#define ub upper_bound
#define emp empty()
#define beg begin()
#define en end()
#define si size()
#define bk back()
#define deci(n)  fixed<<setprecision(n)

#define p0(a) cout << a << " "
#define p1(a) cout << a << endl

#define MAX LLONG_MAX
#define MIN LLONG_MIN

using namespace std;



int main()
{
    string s1,s2;
    cin >> s1 >> s2;
    
    int f = 0;
    
    for01(s1.length())
    {
        if(s1.at(i) == s2.at(i))
            f++;
            
    }
    
    p1(f);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ans,l,r,k,n;
const int mod=1e9+7;
int main()
{
	cin>>n>>k;
	for(ll i=k;i<=n+1;i++)
	{
		l=(0+i-1)*i/2;
		r=(n+n-i+1)*i/2;
		ans=(ans+r-l+1)%mod;
	}
	cout<<ans;
    return 0;
}


Measured memory_bytes: 3620
s = input()
if (s[0] == s[1] and s[2] == s[3] and s[0] != s[2]) or (s[0] == s[2] and s[1] == s[3] and s[0] != s[1]) or (s[0] == s[3] and s[2] == s[1] and s[0] != s[2]):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064