akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
int main(void){
    int n, k, x[100000], ans = 1e9;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        cin >> x[i];
        if(i>=k-1){
            if(x[i] <= 0)ans =min(ans, -x[i-k+1]);
            else if(x[i-k+1] >= 0)ans = min(ans, x[i]);
            else{
                int r = x[i], l = -x[i-k+1];
                ans = min(ans, min(r*2+l, r+l*2));
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<cctype>
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (a * b == 15)
		cout << '*' << endl;
	else if (a + b == 15)
		cout << '+' << endl;
	else
		cout << 'x' << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define pp pair<int,int>
#define ff first
#define dd second
#define Q 100005
#define M 2005
#define N 200005

using namespace std; // zmienic na drzewo przedz

int n, k;
int D, MM;
int mod = 1e9+7;

int tab[M];

map<int,int> ile;

int ans = 0;


main()
{
    ios_base::sync_with_stdio(false);
    cin >> MM >> D;

    for (int i = 2; i < 10; ++i) for (int j = 2; j < 10; ++j) {
            int m = 10*i + j;
            if (m <= D and i*j <=MM) ans++;
        }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
 int N,i,check=0,ans,max,max2;
  scanf("%d",&N);
  int A[N],B[N];
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(i=0;i<N;i++){
    B[i]=A[i];
  }
  max=A[0];
  for(i=1;i<N;i++){
    if(A[i]>max){
      max=A[i],check=i;
    }
  }
  A[check]=0;
  max2=A[0];
  for(i=1;i<N;i++){
    if(A[i]>max2){
      max2=A[i];
    }
  }
  if(max==max2){
    for(i=0;i<N;i++){
      printf("%d\n",max);
    }
  }
  else{
    for(i=0;i<N;i++){
      if(i==check){
        printf("%d\n",max2);
      }
      else{
        printf("%d\n",max);
      }
    }
  }
  return 0;
}
  

Measured memory_bytes: 3072
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

typedef long long ll;

int main()
{
	/*int ans, x;
	rep(i, 5) {
		cin >> x;
		if (x == 0)ans = i + 1;
	}
	cout << ans;*/


	/*int x, y;
	cin >> x >> y;
	rep(i, x + 1) {
		int j = x - i;
		if (i * 2 + j * 4 == y) {
			puts("Yes");
			return 0;
		}
	}
	puts("No");*/


	int x, n;
	cin >> x >> n;
	vector<int>s(102);
	int p;
	rep(i, n) {
		cin >> p;
		s[p] = 1;
	}
	int ans = 0;
	rep(i, 102) {
		if (s[i])continue;
		if (abs(x - i) < abs(x - ans))ans = i;
	}
	cout << ans;



	return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define yes(n) cout << ((n) ? "yes" : "no") << endl

using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;
const vector<int> di = {-1,  0, 1, 0};
const vector<int> dj = { 0, -1, 0, 1};

void chmin(int &a, int b) { if (a > b) a = b; }

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
ll LCM(ll a, ll b) {
    ll g = GCD(a, b);
    return a / g * b;
}


int main() {
    int n; cin >> n;
    vector<int> d(n);
    rep(i, n) cin >> d[i];
    sort(all(d));

    int half = n / 2; 
    cout << ((d[half] - 1) - d[half - 1] + 1) << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include<vector>
#include<climits>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<functional>
#include <numeric>
#define FORi(N) for(int i=0;i<N;++i)
using namespace std;
using ll = long long;
ll gcd(ll m,ll n){
  if(n==0)return abs(m);
  return(gcd(n,m%n));
}
int main(){
  ll D,G;
  cin>>D>>G;
  vector<ll> P(D),C(D);
  FORi(D){
    cin>>P[i]>>C[i];
  }
  ll minnum=LLONG_MAX;
  FORi(pow(2,D)){
    bitset<100> bit(i);
    ll curp=0;
    ll curnum=0;
    for(int ii=0;ii<D;++ii){
      if(bit[ii]){
        curp+=C[ii];
        curp+=(ii+1)*P[ii]*100;
        curnum+=P[ii];
      }
    }
    if(curp>=G){
      minnum=min(minnum,curnum);
      continue;
    }
    ll addnum = D-1;
    while(bit[addnum])addnum--;
    for(ll ii=0;ii<P[addnum]-1;++ii){
      curp+=(addnum+1)*100;
      curnum++;
      if(curp>=G){
        minnum=min(minnum,curnum);
        break; 
      }
    }
  }
  cout<<minnum<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i <= int(n); i++)
#define mod 1000000007


int main()
{
	int n;
	cin >> n;
	vector<int> p(n);
	rep(i,n){
		cin >> p[i];
	}
	int ans = 0;
	for(int i = 1; i < n-1; i++){
		if((p[i-1] < p[i]) && (p[i+1] > p[i])){
			ans++;
		}
		else if((p[i-1]>p[i])&&(p[i] > p[i+1])){
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int n;
main()
{
    while(cin>>n,n)
    {
        vector<pair<int,int> >s;
        for(;n--;)
        {
            int i;cin>>i;
            s.push_back(make_pair(0,i));
            for(int j=4;j--;)
            {
                int a,b;cin>>a>>b;
                s.back().first+=a*60+b;
            }
        }
        sort(s.begin(),s.end());
        cout<<s[0].second<<endl<<s[1].second<<endl<<s[s.size()-2].second<<endl;
    }
}


Measured memory_bytes: 3112
N, M, C = list(map(int, input().split()))
b = list(map(int, input().split()))
a = []
for i in range(N):
    a.append(list(map(int, input().split())))
cnt = 0
for i in range(N):
    s = 0
    for j in range(M):
        s += a[i][j] * b[j]
    s += C
    if s > 0:
        cnt += 1
print(cnt)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = int(1e9) + 7

func main() {
	var K string
	K, D = ReadString(), ReadInt()
	n = make([]int, len(K))
	for i := 0; i < len(K); i++ {
		n[i] = int(K[i] - '0')
	}
	for i := 0; i < len(K)+1; i++ {
		for s := 0; s < 2; s++ {
			for digitSum := 0; digitSum < D; digitSum++ {
				memo[i][s][digitSum] = -1
			}
		}
	}
	fmt.Println((recur(0, 0, 0) - 1 + Mod) % Mod)
}

var D int
var n []int

var memo [10001][2][100]int

func recur(i, smaller, digitSum int) int {
	digitSum %= D
	if i == len(n) {
		if digitSum == 0 {
			return 1
		} else {
			return 0
		}
	}
	if memo[i][smaller][digitSum] >= 0 {
		return memo[i][smaller][digitSum]
	}
	ans := 0
	for x := 0; x <= ifelse(smaller == 1, 9, n[i]); x++ {
		ns := ifelse(smaller == 1 || x < n[i], 1, 0)
		ans += recur(i+1, ns, digitSum+x)
		ans %= Mod
	}
	memo[i][smaller][digitSum] = ans
	return ans
}

func ifelse(cond bool, a int, b int) int {
	if cond {
		return a
	}
	return b
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 19392
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, M;
	cin >> N >> M;

	vector<pair<Int, Int>> ab;
	Int a, b;
	for (Int i = 0; i < N; i++) {
		cin >> a >> b;
		ab.push_back(make_pair(a, b));
	}
	sort(ab.begin(), ab.end());

	priority_queue<Int> pq;

	Int temp = 0;
	Int ans = 0;

	for (Int i = 1; i <= M; i++) {
		while (temp<N && ab[temp].first <= i) {
			pq.push(ab[temp].second);
			temp++;
		}
		if (!pq.empty()) {
			ans += pq.top();
			pq.pop();
		}
	}

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

Measured memory_bytes: 3568
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n=n0()

ans=0
for k in range(105,n+1,2):
    c=0
    for i in range(1,k+1):
        if k%i==0:
            c+=1
#     if i**2==k:
#         c-=1
    if c==8:
        ans+=1
print(ans)

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



int main(){
    ll n;cin>>n;
    if(n==0){cout<<0<<endl;return 0;}
    ll pow2[33];
    pow2[0]=1;
    rep(i,1,33){
        pow2[i]=pow2[i-1]*2;
    }
    vector<int> an;
    ll i=1;
    while(n!=0){
        ll r=n%pow2[i];
        if(i%2==1&&r<0)r+=pow2[i];
        else if(i%2==0&&r>0)r-=pow2[i];
        
        if(r==0)an.push_back(0);
        else an.push_back(1);
        
        n=n-r;
        i++;
    }
    for(int i=an.size()-1;i>=0;i--)cout<<an[i];
    cout<<endl;
}







Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private static long MOD = 1000000007L;

    private void solve(Scanner sc) {
        int N = sc.nextInt();
        sc.nextLine();
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();

        _out.println(search(s1, s2, 0, -1, -1));
    }
    private Map<String, Long> memo = new HashMap<>();
    private long search(String s1, String s2, int idx, int c1, int c2) {
        String key = idx + "-" + c1 + "-" + c2;
        Long tmp = memo.get(key);
        if (tmp != null) {
            return tmp;
        }

        if (idx >= s1.length()) {
            memo.put(key, 1L);
            return 1;
        }

        long ans = 0;
        if (s1.charAt(idx) == s2.charAt(idx)) {
            for (int i = 0; i < 3; ++i) {
                if (i == c1 || i == c2) {
                    continue;
                }
                ans = (ans + search(s1, s2, idx + 1, i, i)) % MOD;
            }
        } else {
            for (int i = 0; i < 3; ++i) {
                for (int j = 0; j < 3; ++j) {
                    if (i == j || c1 == i || c2 == j) {
                        continue;
                    }
                    ans = (ans + search(s1, s2, idx + 2, i, j)) % MOD;
                }
            }
        }
        memo.put(key, ans);
        return ans;
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

Measured memory_bytes: 23636
#include <cstdio>
#include <iostream> 
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>

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

const ll INF = 1e9;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(int i = 0; i < n; i++)
#define RREP(i, n) for(int i = n - 1; i >= 0; i--)
#define REP2(i, n, k) for(int i = 0; i < n; i += k)



int main() {
	ll n;
	cin >> n;
	if (n < 1200) {
		cout << "ABC" << endl;
	}
	else if(n < 2800) {
		cout << "ARC" << endl;
	}
	else {
		cout << "AGC" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	vector<int>A(N);
	rep(i, 0, N)cin >> A[i];
	map<int, ll>mp;
	rep(i, 0, N) {
		mp[(i + 1) - A[i]]++;
	}
	ll ans = 0;
	rep(i, 0, N) {
		ll x = mp[A[i] + i + 1];
		ans += x;
	}
	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 26544
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <bitset>
#include <functional>
using namespace std;
const constexpr int INF = 1e9;
//typedef std::pair<std::string,double> P;

long long Q, H, S, D, N;
string s; 
void solve(){
    Q*=4;
    H*=2; //1リットルに揃える.
    
    //Nが偶数のとき
    if(N%2==0){
        cout << min(N/2*D, N*min({Q, H, S})) << endl;
    }else{
        cout << min(N/2*D+min({Q, H, S}), N*min({Q, H, S})) << endl;
    }
}
int main() {
    cin >> Q >> H >> S >> D >> N;
    solve();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	int cnt=0,ans=0;
	cin>>s;
	rep(i,s.size()){
		if(s[i]=='*')ans=cnt;
		else if(s[i]=='(')cnt++;
		else cnt--;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 3208
#include <bits/stdc++.h>
#define int long long
#define moder (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define all(v) v.begin(),v.end()
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), moder - 2, moder) % moder * mod_pow(kai(y), moder - 2, moder) % moder;
}
/*--------Library Zone!--------*/

int digit(int n) {
	int ans = 0;
	while (n) {
		ans += n % 10;
		n /= 10;
	}
	return ans;
}
signed main() {
	int n, a, b; cin >> n >> a >> b;
	int ans = 0;
	REP(i, n + 1) {
		if (digit(i) >= a && digit(i) <= b)ans += i;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N;
  int result = 1;
  long long time = 0;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  vector<pair<int, int> > C(N);
  
  for(int a = 0;a < N;a++){
    cin >> A[a];
    cin >> B[a];
    C[a] = make_pair(B[a], A[a]);
  }
  sort(C.begin(), C.end());
  for(int a = 0;a < N;a++){
    if(time + C[a].second > C[a].first){
     result = 0; 
      break;
    }
    time += C[a].second;
    
  }
  
  if(result == 0){
   cout << "No" << endl; 
  }else{
   cout << "Yes" << endl; 
  }
  
}

Measured memory_bytes: 6380
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

// #include <iomanip>
//  cout << fixed << setprecision(15) << y << endl;

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
long double B;
ll B_int;
long double B_d;

ll ltmp;
string stmp;
double dtmp;

int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    cin >> A;
    cin >> B;

    B_int = B;
    B_d = B - B_int;

    B_int = B_int * A;
    B_d = B_d * A;

    ll ans = B_int + B_d;
    cout << ans << endl;


}

Measured memory_bytes: 3760
#include <iostream>
#include <vector>
#include <algorithm>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int main(){
  
  int N, H, W, count = 0;
  cin >> N >> H >> W;

  int A[N], B[N];

  REP(i,N){
  	cin >> A[i] >> B[i];
  	if(A[i] >= H && B[i] >= W) count++;
  }

  cout << count << endl;
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1000000007LL;
const int INF = LLONG_MAX;


void f(int i, int j, int ni, int nj, vector<vector<int> > &a, vector<pair<pair<int, int>, pair<int, int> > > &ans){
    cerr << i << " " << j << endl;
    if(a[i][j] % 2 == 1){
        a[i][j]--;
        a[ni][nj]++;
        ans.push_back({{i, j}, {ni, nj}});
    }

    return;
}

signed main(){
    
    int h, w; cin >> h >> w;
    vector<vector<int> > a(h, vector<int> (w));
    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cin >> a[i][j];
        }
    }

    vector<pair<pair<int, int>, pair<int, int> > > ans;

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

        if(i % 2 == 0){

            for(int j = 0; j < w - 1; j++){
                int ni = i;
                int nj = j + 1;
                f(i, j, ni, nj, a, ans);
            }

        }else{

            for(int j = w - 1; j > 0; j--){
                int ni = i;
                int nj = j - 1;
                f(i, j, ni, nj, a, ans);                
            }

        }

        if(i != h - 1){
            //一個下に
            int ni = i + 1;
            int nj;
            if(i % 2== 0) nj = w - 1;
            else nj = 0;
            f(i, nj, ni, nj, a, ans);            
        }

    }

    cout << ans.size() << endl;
    for(int i = 0; i < ans.size(); i++){
        cout << ans[i].first.first + 1 << " " << ans[i].first.second + 1 << " " << ans[i].second.first + 1 << " " << ans[i].second.second + 1 << endl;
    }

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cerr << a[i][j] << " ";
        }
        cerr << endl;
    }

    return 0;
}

Measured memory_bytes: 8304
#include <iostream>
#include <string>

using namespace std;

int main() {
    string s;
    cin >> s;

    string alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    string ans = "";
    for (int i=0; i<(int)s.size(); ++i) {
        ans += alpha[(s[i] - 'A' + 23) % 26];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1192
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif

#define FILE_IO freopen("input.txt","r",stdin)
#define int long long
#define f first
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
#define bp __builtin_popcount
#define debug(x) cerr << #x << " = " << x << endl;

const int MOD = 1e9 + 7;
const int INF = 1e18;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>void print(T t){for(auto &it : t)cout<<it<<" ";}
inline int powerexp(int a, int b, int m = MOD){ int res = 1;while(b){if(b&1)res = res * a % m;a = a * a % m,b >>= 1;}return res % m;}
inline int modinv(int a){ return powerexp(a,MOD-2,MOD);}
inline int lcm(int a, int b){ int g = __gcd(a,b);return a/g*b;}
inline int add(int x, int y){ x += y; if (x >= MOD) x -=  MOD; return x;}
inline int mul(int x, int y){ return (x * 1ll * y) % MOD;}
inline int sub(int x, int y){ x -= y; if (x<0) x += MOD; return x ;}

//-------------------< start here >-------------------------// 
bool cmp(int a, int b){
  return a < b;
}
void solve(){
   int a, b , c;
   cin >> a >> b >> c;
   int x = max({a, b, c}, cmp);
   int y = min({a, b, c}, cmp);
   cout << y << " " << x << endl;
}

//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
   IOS;
   solve();
   //find();
   #ifdef LOCAL_DEFINE
   cerr << "time elapsed " << (double)clock()/CLOCKS_PER_SEC << endl;
   #endif
}



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

using namespace std;

const int N = 2e5 + 4;
vector<int> g[N];
signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  int n, m, u, v;
  cin >> n >> m;
  vector<int> a(n+1);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= m; ++i) {
    cin >> u >> v;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    bool pos = true;
    for (int x: g[i]) {
      pos &= a[x] < a[i];
    }
    ans += pos;
  }
  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 11116
#include <iostream>
#include <vector>
using namespace std;
int dp[100010],l[100010],ans = 0;
vector<int> G[100010];
int dfs(int s){
	if(l[s]!=-1) return l[s];
	int mx = -1;
	for(int v:G[s]){
		mx = max(mx,dfs(v));
	}
	l[s] = mx + 1;
	return l[s];
}

int main(){
	int i,n,m;
	cin >> n >> m;
	for(i=0;i<m;i++){
		int a,b;
		cin >> a >> b;
		a--; b--;
		G[a].push_back(b);
	}
	for(i=0;i<n;i++) l[i] = -1;
	for(i=0;i<n;i++){
		if(l[i]==-1) dfs(i);
	}
	for(i=0;i<n;i++) ans = max(ans,l[i]);
	cout << ans << endl;
}

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

using namespace std;

int main() {
    std::ios::sync_with_stdio(false); 
    cin.tie(nullptr);
    
    int N, H, W;
    cin >> N >> H >> W;
    int res = 0;
    for (int i = 0; i + H <= N; ++i) {
        for (int j = 0; j + W <= N; ++j) {
            ++res;
        }
    }
    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 256
H,W,K = list(map(int,input().split()))
S = []
for i in range(H):
    S.append(list(input()))

rowcnt = [0]*H
ULrow = H
for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            rowcnt[i]+=1
            ULrow = min(ULrow,i)

out = [[0]*W for i in range(H)]
now = 1
for i in range(H):
    X = rowcnt[i]
    if X!=0:
        for j in range(W):
            out[i][j]=now
            if S[i][j]=="#":
                now+=1
                X+=-1
            elif X==0:
                out[i][j] += -1

for i in range(H):
    if rowcnt[i]==0 and i<ULrow:
        for j in range(W):
            out[i][j]=out[ULrow][j]
    elif rowcnt[i]==0 and i>ULrow:
        for j in range(W):
            out[i][j]=out[i-1][j]

for i in range(H):
    print(*out[i])

Measured memory_bytes: 78056
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);cout<<"\n";};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){   return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){ for(auto &e:t) fill_v(e,v); }
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...);}
//FUNCTION

//BELOW
void solve(void)
{ 
  int A,B,X;
  cin>>A>>B>>X;
  A--;
  int S = 0;
  if(A == -1 && X != 1) S++;
  
  cout<<B/X - A/X + S<<endl;
  
  return;
}
  
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(){
  int i,j,c,s,n,d[10010],M=100010;
  char p[100010]={1,1};
  for(i=2;i*i<M;i++){
    if(p[i])continue;
    for(j=i*i;j<M;j+=i)p[j]=1;
  }
  for(i=c=0;i<M;i++){
    if(p[i]==0)d[c++]=i;
  }
  while(scanf("%d",&n),n){
    for(i=c=0;d[i]<=n;i++){
      for(j=s=0;s<n;j++)s+=d[i+j];
      if(s==n)c++;
    }
    printf("%d\n",c);
  }
  return 0;
}

Measured memory_bytes: 744
import sys
N,W = map (int,input().split()) 
dp = [[float("inf") for i in range(10**5+1)] for j in range(N+1)]
weight = []
value = []
for i in range(N):
    w,v = map( int, input().split() )
    weight.append(w)
    value.append(v)

dp[0][0] = 0

for i in range(1,N+1):
    for j in range(10**5+1):
        if j - value[i-1] >= 0:
            dp[i][j] = min( dp[i-1][ j - value[i-1] ] + weight[i-1], dp[i][j])
        dp[i][j] = min(dp[i][j],dp[i-1][j])
        
for i in range(10**5,-1,-1):
    if dp[N][i] <= W:
        print(i)
        sys.exit()

Measured memory_bytes: 320884
import java.math.BigInteger

fun main(){
    readLine()
    val input = readLine()!!.split(" ").map { it.toLong() }
    var result:BigInteger = BigInteger.valueOf(1)
    val max:BigInteger = BigInteger.valueOf( 1000000000000000000)

    if (input.isEmpty()){
        println(0)
        return
    }
    if (input.contains(0)) {
        println(0)
        return
    }
    input.forEach {
        result = result.multiply(BigInteger.valueOf(it))
        if (result > max) {
            println(-1)
            return
        }
    }
    println(result)
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main () {
	int N, K;
	cin >> N >> K;
	double ans = 0;
	rep(i, N) {
		int tmp = i + 1, cnt = 0;
		while (tmp < K) {
			tmp = tmp << 1;
			cnt++;
		}
		ans += 1.0 / N * pow(1.0 / 2, cnt);
		// cout << cnt << endl;
	}
	printf("%0.16f\n", ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

int32_t main(){
	IOS;
	string s, t;
	cin >> s >> t;

	int dif = 0;
	for(int i = 0; i < s.size(); i++)
		dif += s[i] != t[i];

	cout << dif << endl;
	return 0;
}

Measured memory_bytes: 3768
fun main() {
    val mod = 1000000007L.toBigInteger()
    readLine()
    val x = readLine()!!.split(" ").map(String::toBigInteger)
    val s = x.toMutableList()

    (1 until x.size).forEach { i -> s[i] += s[i - 1] }

    x.indices.map { i -> (x[i] * (s.last() - s[i])) }
            .reduce { acc, i ->  (acc + i) }
            .let { println(it.rem(mod)) }
}


Measured memory_bytes: 113460
using System;
using System.Collections.Generic;
using System.Linq;

public class HelloWorld
{
    class data
    {
        public int i;
        public int p;
        public int y;
        public int id;
    }

    static public void Main ()
    {
        var input = Console.ReadLine().Split(' ');
        var n = int.Parse(input[0]);
        var m = int.Parse(input[1]);

        var data = new List<data>();
        for (int i = 0; i < m; i++)
        {
            // (pi, yi)
            var line = Console.ReadLine().Split(' ');
            int p = int.Parse(line[0]);
            int y = int.Parse(line[1]);
            var t = new data
            {
                i = i,
                p = p,
                y = y,
                id = 0,
            };
            data.Add(t);
        }
        var pcount = new Dictionary<int, int>();

        data = data.OrderBy(d => d.y).ToList();
        
        for (int i = 0; i < m; i++)
        {
            var t = data[i];
            if (pcount.ContainsKey(t.p))
            {
                pcount[t.p]++;
            }
            else
            {
                pcount[t.p] = 1;
            }
            t.id = pcount[t.p];
        }

        data = data.OrderBy(d => d.i).ToList();
        
        for (int i = 0; i < m; i++)
        {
            var s = string.Format("{0:000000}{1:000000}", data[i].p, data[i].id);
            Console.WriteLine(s);
        }
    }
}

Measured memory_bytes: 36896
import math


def solve():
    n = int(input())
    al = [int(input()) for _ in range(n)]
    l = al[:]
    l.sort()
    if len(l) == 1:
        f, s = l[0], l[0]
    else:
        f, s = l[-1], l[-2]
    for a in al:
        if a == f:
            print(s)
        else:
            print(f)


if __name__ == "__main__":
    solve()

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

const int N = 1e5 + 5, mod = 1e9 + 7;

int a[N], dp[N][2], n;

int solve(int i, int taken)
{
    if (i == n - 1)
    {
        if (taken)
            return a[i];
        return 0;
    }
    if (dp[i][taken] != -1)
        return dp[i][taken];
    int ans = 0;
    if (taken)
        ans = __gcd(solve(i + 1, 1), a[i]);
    else
        ans = max(__gcd(solve(i + 1, 0), a[i]), solve(i + 1, 1));
    return dp[i][taken] = ans;
}

int main()
{
    //ios::sync_with_stdio(false);cin.tie(nullptr);ios_base::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    memset(dp, -1, sizeof dp);
    cout << solve(0, 0);
    return 0;
}

Measured memory_bytes: 9456
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n;
ll a[1000001];
int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	ll res=0;
	bool flag=true;
	ll now=0;
	for(int i=0;i<n;i++){
		if(now==0){
			now+=a[i];
			if(now==0){
				now++;
				res++;
			}else if(now<0){
				ll b=-now+1LL;
				res+=b;
				now=1;
			}
		}else if(now>0){
			if(now+a[i]<0){
				now=now+a[i];
			}else{
				ll b=now+a[i]+1LL;
				now=-1;
				res+=b;
			}
		}else{
			if(now+a[i]>0){
				now=now+a[i];
			}else{
				ll b=-(now+a[i])+1LL;
				now=1;
				res+=b;
			}
		}
	}
	ll ans=res;
	res=0;
	now=0;
	for(int i=0;i<n;i++){
		if(now==0){
			now+=a[i];
			if(now==0){
				now--;
				res++;
			}else if(now>0){
				ll b=now+1LL;
				res+=b;
				now=-1;
			}
		}else if(now>0){
			if(now+a[i]<0){
				now=now+a[i];
			}else{
				ll b=now+a[i]+1LL;
				now=-1;
				res+=b;
			}
		}else{
			if(now+a[i]>0){
				now=now+a[i];
			}else{
				ll b=-(now+a[i])+1LL;
				now=1;
				res+=b;
			}
		}
	}
	ans=min(res,ans);
	printf("%lld\n",ans);
	return 0;
}

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

int main() {
  int n,ac,wa,tle,re;
  ac = 0;
  wa = 0;
  tle = 0;
  re = 0;
  
  cin >> n;
  
  vector<string> a(n);
  
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(a[i]=="AC")ac++;
    else if(a[i]=="WA")wa++;
    else if(a[i]=="TLE")tle++;
    else re++;
    
  }
  
    
  cout << "AC x " << ac <<endl;
  cout << "WA x " << wa <<endl;
  cout << "TLE x " << tle <<endl;
  cout << "RE x " << re <<endl;
  
  
}


Measured memory_bytes: 6376
#define _LIBCPP_DEBUG 0
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9+7;

int main(void) {

    int N; cin>>N;
    vector<int> a(N+1,0);

    for (int i = 2; i <= N; ++i) { //階上の2~Nまでの全ての素因数を出したい
        int tmp = i;
        for (int j = 2; j <= tmp; ++j) {//tmp(i)を素因数分解する
            while(tmp%j==0){//割り切れるまでjで割って、素因数をa[]でカウント
                tmp /= j;
                a[j]++;
            }
        }
    }

    ll ans = 1;
    for (int i = 0; i <= N; ++i) {
        //もしa[i]>0なら+1したものをansにかけて、a[i]が0なら1をかける
        ans *= (a[i]>0)?++a[i]:1;
        ans %= MOD;
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
using System;

public class hello
{
    public static void Main()
    {
        var a = new int[11];
        var q = 99;
        var s = Console.ReadLine().Trim();
        for (int i = 0; i < 11; i++)
        {
            if (s[i] == '?') q = i;
            else a[i] = int.Parse(s[i].ToString());
        }
        if (q == 99) { Console.WriteLine(getCD(a)); goto end; }
        var cd = int.Parse(s[11].ToString());
        var mu = 0;
        var ans = 99;
        for (int i = 0; i <= 9; i++)
        {
            a[q] = i;
            if (getCD(a) == cd) { mu++; ans = i; }
        }
        if (mu == 1) Console.WriteLine(ans);
        else Console.WriteLine("MULTIPLE");
        end:;
    }
    public static int getCD (int[] a)
    {
        var t = 0;
        for (int i = 1; i <= 11; i++) t += getQn(i) * a[11 - i];
        if (t % 11 >= 2) return 11 - t % 11;
        else return 0;
    }
    public static int getQn (int n)
    {
        if (n >= 1 && n <= 6) return n + 1;
        else return n - 5;
    }
}

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

using namespace std;

#define ll long long
#define pb push_back
#define sz size()

ll get(ll a, ll b){
  
  if(a > b)swap(a, b);
  ll x = a - 1;
  b -= x, a = 1;
  x++;
  b--;
  return x + (b - a) / 2;
}

int main() {

  ll n, a, b;

  cin >> n >> a >> b;
  if(a > b)swap(a, b);
  if( (b - a) & 1){
    cout << min(get(a, b), get(n - a + 1, n - b + 1)) << endl;
  }
  else cout << (b - a) / 2 << endl;

  return 0;
}

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

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<algorithm>
#include<cstring>
#include<string>
#include<vector>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0;i < n;i++)
using namespace std;

double dist(double x1,double y1,double x2,double y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

double dist(double x1,double y1){
    return dist(x1,y1,0,0);
}

void calccenter(double c[][2],double u1[],double u2[]){
    double v[2]={u2[0]-u1[0],u2[1]-u1[1]};
    rep(i,2) {
        rep(j,2){
            c[i][j]=(u1[j]+u2[j])/2.0;
        }
    }
    double lenv = dist(v[0],v[1]);
    double lent = sqrt(1-pow((lenv/2.0),2));
    rep(i,2){
        double dg = i?1.0:-1.0;
        c[i][0]+=dg*(v[1]*lent/lenv);
        c[i][1]-=dg*(v[0]*lent/lenv);
    }
}

int main(){
    int N;
    while(1){
        cin>>N;
        if(!N)break;
        double a[300][2];
        rep(i,N){
            cin>>a[i][0]>>a[i][1];
        }
        int ans = 1;
        int temp = 0;
        if(N==1){
            cout<<1<<endl;
            continue;
        }
        rep(u1,N){
            for(int u2 = u1+1;u2<N;u2++){
                double c[2][2];
                if(dist(a[u1][0],a[u1][1],a[u2][0],a[u2][1])>2){
                    continue;
                }
                calccenter(c,a[u1],a[u2]);
                rep(k,2){
                    temp = 0;
                    rep(l,N){
                        if(l==u1||l==u2){
                            temp++;
                        }else if(dist(c[k][0],c[k][1],a[l][0],a[l][1])<=1.0){
                            temp++;
                        }
                    }
                    ans = max(ans,temp);
                }
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 1236
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#define endl "\n"
using namespace std;

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

    if(!(c < a) && !(c > b))
    	cout << "Yes" << endl;
    else
    	cout << "No" << endl;
}

Measured memory_bytes: 256
package main

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

func main() {
	stdin := bufio.NewScanner(os.Stdin)

	stdin.Scan()
	text := stdin.Text()
	a, _ := strconv.Atoi(strings.Split(text, " ")[0])
	b, _ := strconv.Atoi(strings.Split(text, " ")[1])
	v := 0

	if a > b {
		v += a
		a--
	} else {
		v += b
		b--
	}

	if a > b {
		v += a
	} else {
		v += b
	}

	fmt.Printf("%v\n", v)
}


Measured memory_bytes: 640
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N = ri()
f = [0] * N
for x in range(1,100+1):
    for y in range(1, 100+1):
        for z in range(1, 100+1):
            h = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if h > N:
                continue
            f[h - 1] += 1
for i in range(N):
    print(f[i])
 

Measured memory_bytes: 9372
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#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++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef complex<double> P;
bool cmp(P a,P b) {return atan2(a.imag(),a.real())<atan2(b.imag(),b.real());}
double D(P a, P b) {
  return sqrt((a.real()-b.real())*(a.real()-b.real())+(a.imag()-b.imag())*(a.imag()-b.imag()));
}

void Main() {
  ll n;
  R n;
  P a[n];
  rep(i,n) {
    double x,y;
    cin >> x >> y;
    a[i]=P(x,y);
  }
  sort(a,a+n,cmp);
  double ans=0;
  rep(i,n) {
    P p=P(0,0);
    rep(j,n) {
      p+=a[(i+j)%n];
      ans=max(ans,D(P(0,0),p));
    }
  }
  pd(ans);
}

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


Measured memory_bytes: 512
import fractions
N=int(input())
a=input().split()
A=[int(b) for b in a]
A=sorted(A,reverse=True)
numbers=[]
numbers.append(fractions.gcd(A[0],A[1]))
for a in range(1,N):
    answer=fractions.gcd(numbers[-1],A[a])
    numbers.append(answer)
print(numbers[-1])


Measured memory_bytes: 17432
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
using namespace std;

int main(){
  int a,b,x;
  cin>>a>>b>>x;
  if(a<=x && x<=a+b) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;

}

Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
      string[] s = Console.ReadLine().Split(' ');
      ulong[] a = new ulong[3];
      for(int i=0;i<3;i++){
        a[i] = ulong.Parse(s[i]);
      }
      Console.Write(a[0]<=a[2]?0:a[0]-a[2]);
      Console.Write(' ');
      Console.WriteLine(a[0]<=a[2]?(a[1]>a[2]-a[0]?a[1]-(a[2]-a[0]):0):a[1]);
	}
}


Measured memory_bytes: 13140
s=input()
a=[]
b=[]
d=0
for i in range(int(input())):
  q=input()
  if q=="1":d^=1
  else:
    _,f,c=q.split()
    f=int(f)-1
    if d==0:
      if f==0:a.append(c)
      else:b.append(c)
    else:
      if f==1:a.append(c)
      else:b.append(c)
if d==0:print("".join(a)[::-1]+s+"".join(b))
else:print("".join(b)[::-1]+s[::-1]+"".join(a))


Measured memory_bytes: 5724
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  A = list(map(int, input().split()))
  count = 0
  for a in A:
    while a % 2 == 0:
      count += 1
      a //= 2
  print(count)


if __name__ == '__main__':
  main()

Measured memory_bytes: 4084
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var nabc = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var bamboos = new int[nabc[0]];
            for (var i = 0; i < bamboos.Length; i++)
            {
                bamboos[i] = int.Parse(Console.ReadLine());
            }

            Console.WriteLine(Dfs(0, 0, 0, 0, nabc, bamboos));
        }

        static int Dfs(int current, int a, int b, int c, int[] nabc, int[] bamboos)
        {
            var limit = (int)Math.Pow(10, 9);
            var tmp = Math.Abs(a - nabc[1]) + Math.Abs(b - nabc[2]) + Math.Abs(c - nabc[3]) - 30;
            var abc = new int[] { a, b, c };
            if (current == nabc[0]) return (abc.Min() > 0 ? tmp : limit);

            var rets = new int[4];
            rets[0] = Dfs(current + 1, a, b, c, nabc, bamboos);
            rets[1] = Dfs(current + 1, a + bamboos[current], b, c, nabc, bamboos) + 10;
            rets[2] = Dfs(current + 1, a, b + bamboos[current], c, nabc, bamboos) + 10;
            rets[3] = Dfs(current + 1, a, b, c + bamboos[current], nabc, bamboos) + 10;
            return rets.Min();
        }
    }
}


Measured memory_bytes: 17488