akhauriyash/Code-Regression huggingface dataset:
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn main() {
    input! {
        n: u64, m: u64
    }
    println!("{}", (n-1)*(m-1));
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dofloat cout<<fixed<<setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(),vec.end()
#define rall(vec) vec.rbegin(),vec.rend()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vll;
typedef vector<pair<int,int> > vii;
typedef vector<int> vi;
typedef pair<int,int> ii;
const long long MOD=1000000007;
const long long MAX=100005;
const long double PI=3.14159265359;
const long double G=9.807;
const long long INF=1e18;
const long double EPS=1e-6;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
bool isprime(ll a){
  if(a==2)return 1;
  if(!(a&1))return 0;
  for(ll i=3;i*i<=a;i+=2)
    if(a%i==0)return 0;
  return 1;
}
ll mpow(ll base,ll exponent,ll modulus){
  if(modulus==1)return 0;
  long long result = 1;
  base=base%modulus;
  while(exponent){
    if(exponent%2 == 1)
	  result=(result*base)%modulus;
	  exponent=exponent>>1;
	  base=(base*base)%modulus;
  }
  return result;
}
ll minv(ll a,ll mod){
  ll _gcd=gcd(a,mod);
  assert(_gcd==1);
  return mpow(a,mod-2,mod);
}


/*
ll ncr(ll N,ll K){
	if(N<K)return 0;
	if(K==0)return 1;
	if(N==0)return 0;

	ll den=1;
	for(ll i=1;i<=K;i++)den*=i;
	ll num=1;
	while(K--){
		num*=N;
		if(num%den==0){
			num/=den;
			den=1;
		}
		N--;
	}

	return num;
}
*/
ll n,a,b;
int main(){FAST;
cin>>n>>a>>b;
cout<<min(n*a,b);
return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int count=0,l1,l2,l3;
    int max = scan.nextInt(),tmp;
    int[] bars = new int[max];
    for(int i=0;i<max;i++)bars[i] = scan.nextInt();
    for(int i=0;i<max-2;i++){
      for(int j=0;j<max-i-1;j++){
        if(bars[j]<bars[j+1]){
          tmp=bars[j];
          bars[j]=bars[j+1];
          bars[j+1]=tmp;
        }
      }
    }
    for(int i=0; i<max-2;i++){
      l1=bars[i];
      for(int j=i+1; j<max-1;j++){
        l2=bars[j];
        for(int k=j+1; k<max;k++){
          if(l1==l2)break;
          l3=bars[k];
          if(l1<(l2+l3) && l2<(l1+l3) && l3<(l1+l2)&& l3 != l1 && l3 != l2){
            count++;
          }
        }
      }
    }
    
    System.out.println(""+count);
  }
  
}

Measured memory_bytes: 39200
#include <bits/stdc++.h>
using namespace std;
#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) GET_MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  int l;
  string s,t;
  cin>>l>>s>>t;

  if(s+t > t+s) swap(s,t);

  int m = s.size();
  int x = l/m;
  while( (l-x*m)%t.size() > 0 ) x--;

  rep(i,x) cout << s;
  rep(i,(l-x*m)/t.size()) cout << t;
  cout << endl;

  // vector<string> v;
  // rep(_,2){
  //   int m = s.size();
  //   int x = l/m;
  //   while( (l-x*m)%t.size() > 0 ) x--;
  //
  //   stringstream str;
  //   rep(i,x) str << s;
  //   rep(i,(l-x*m)/t.size()) str << t;
  //   v.pb(str.str());
  //   swap(s,t);
  // }
  // sort(all(v));
  // cout << v[0] << endl;

  return 0;
}


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

using namespace std; 
 
#define int long long
#define M 1000000007 
 
signed main(){
	
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
	
	int n,k;
	cin >> n >> k;
	int a[2][k];
	for(int i=0;i<k;i++){
		cin >> a[0][i] >> a[1][i];
	}
	int dp[n+2]={0};
	dp[1]=1;
	int temp[n+1]={0};
	for(int i=1;i<=n;i++){
		temp[i]=(temp[i]+temp[i-1])%998244353;
		dp[i]=(dp[i]+temp[i])%998244353;
		for(int j=0;j<k;j++){
			if(i+a[0][j]<=n){
				temp[i+a[0][j]]=(temp[i+a[0][j]]+dp[i])%998244353;
			}
			if(i+a[1][j]+1<=n){
				temp[i+a[1][j]+1]=(temp[i+a[1][j]+1]-dp[i]+998244353)%998244353;
			}
		}	
	}
	cout << dp[n] << endl;
}


Measured memory_bytes: 6760
#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long y){
       for(int i=2;i<=sqrt(y);i++)
              if(y%i==0)
                   return false;
         return true;
}
int main(){           
   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   //freopen("input.in","r",stdin);
   long long x;
   cin>>x;
   while(!isPrime(x)){
     x++; 
   }
   cout<<x;
   return 0;              
}

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

using namespace std;
const int MOD = 1000000007;

long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x);
    y -= a / b * x;
    return d;
}

inline long long mod(long long a, long long m) {
    return (a % m + m) % m;
}

long long modinv(long long a, long long m) {
    long long x, y;
    extGCD(a, m, x, y);
    return mod(x, m);
}

long long pow(long long b, long long e) {
  return e == 1 ? b : b * pow(b, e--);
}

int main(void) {
  int N; cin >> N;
  long long prmfct[1000000];
  int A[N];
  vector<pair<int, int>> prmftp;
  memset(prmfct, 0, sizeof(prmfct));
  
  for (int i = 0; i < N; i++) {
    prmftp.clear();
    int a; cin >> a; A[i] = a;
    int n = 0;
    if (a%2 == 0) {
      while (a%2 == 0) {
        a /= 2;
        n++;
      }
      prmftp.push_back(make_pair(2, n));
    }
    for (int j = 3; j*j <= A[i]; j++) {
      n = 0;
      if (a%j == 0) {
        while (a%j == 0) {
          a /= j;
          n++;
        }
        prmftp.push_back(make_pair(j, n));
      }
    }
    if (a != 0)
      prmftp.push_back(make_pair(a, 1));

    for (auto it = prmftp.begin(); it != prmftp.end(); it++) {
      if (prmfct[it->first] < it->second)
        prmfct[it->first] = it->second;
    }
  }

  long long lcm = 1;
  for (int i = 2; i < 1000000; i++) {
    if (prmfct[i] != 0) {
      lcm *= pow(i, prmfct[i]);
      lcm %= MOD;
    }
  }

  // lcm = X mod MOD / A = B
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    int a = modinv(A[i], MOD);
    a += a < 0 ? MOD : 0;
    ans += lcm * a;
    ans %= MOD;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define sz(x) ((int)(x).size())
using namespace std;
using ll = long long;
using pp = pair<int, int>;
const int INF = 1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<vector<int>> dp(N, vector<int>(2));

    dp[0][0] = A[0] % 2 == 0 ? 2 : 1;
    dp[0][1] = A[0] % 2 == 0 ? 1 : 2;

    for (int i = 1; i < N; i++) {
        int odd = A[i] % 2 == 0 ? 2 : 1;
        int even = 3 - odd;
        dp[i][0] = dp[i - 1][0] * odd;
        dp[i][1] = dp[i - 1][1] * 3 + dp[i - 1][0] * even;
    }
    cout << dp[N - 1][1] << endl;
}

Measured memory_bytes: 256
i=0
j=0
cards = [[False for i in range(13)] for j in range(4)]
pattern = ["S", "H", "C", "D"]
n = int(input())
for k in range(n):
   m,s = input().split()
   s = int(s)
   cards[pattern.index(m)][s-1] = True
for i in range(4):
   for j in range(13):
      if cards[i][j] == False:
         print(pattern[i], j+1)
      else:
         pass


Measured memory_bytes: 5604
#include <stdio.h>
#include <stdlib.h>
int num(){
    char s[11];
    int i, n;
    for(i=0; i<sizeof(s); i++){
        s[i] = getchar();
        if(s[i] == ' ' || s[i] == '\n'){
            s[i] = '\0';
            break;
        }
    }
    sscanf(s, "%d", &n);
    return n;
}
int main(void){
    int n, la, lb;
    int a=0, b=0, c=0, d=0, e=0;
    int temp, ans=0;
    int i;
    n = num();
    la = num();
    lb = num();
    
    for(i=0; i<=n; i++){
        if(i < 10){
            a = i;
        }
        if(i >= 10){
            a = i%10;
            b = i/10;
        }
        if(i >= 100){
            b = b%10;
            c = i/100;
        }
        if(i >= 1000){
            c = c%10;
            d = i/1000;
        }
        if(i >= 10000){
            d = d%10;
            e = i/10000;
        }
        
        temp = a+b+c+d+e;
        
        if(la <= temp && temp <= lb){
            ans = ans+i;
        }
        temp = 0;
        a = 0;
        b = 0;
        c = 0;
        d = 0;
        e = 0;
    }
    printf("%d\n", ans);
    
    return 0;
    
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class Main {
	
	public static void main(String[] args) {
		Task task = new Task();
		task.solve();
	}

	public static class Task {
		static final long MOD = (long) 1e9 + 7;

		public void solve() {
			Scan sc = new Scan();
			char[] carr = sc.scanString().toCharArray();
			long k = sc.scanLong();
			for(int i = 0, end = carr.length; i < end; ++i){
				int need = ('z' -  carr[i] + 1);
				if(need != 26 && need <= k){
					carr[i] = 'a';
					k -= need;
				}
				if(k == 0)
					break;
			}
			if(k > 0){
				k%=26;
				carr[carr.length-1] = (char) ('a' + (carr[carr.length-1] - 'a' + k)%26);
			}
			System.out.println(carr);
		}
	}

	public static class Scan {
		private byte[] buf = new byte[1024];
		private int index;
		private InputStream in;
		private int total;

		public Scan() {
			in = System.in;
		}

		public int scan() {
			if (total < 0)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanLong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scanDouble() throws IOException {
			double doub = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doub *= 10;
					doub += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doub += (n - '0') * temp;
						n = scan();
					} else
						throw new InputMismatchException();
				}
			}
			return doub * neg;
		}

		public String scanString() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public char scanChar() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			return (char) n;
		}

		private boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}
	}
}

Measured memory_bytes: 33588
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

int main(){
    int n;
    cin>>n;
    deque<int> v;
    rep(i,n){
        int a;
        cin>>a;
        if(i%2==0) v.push_back(a);
        else v.push_front(a);
    }

    if(n%2==1) reverse(all(v));
    while(!v.empty()){
        cout<<v.front()<<" ";
        v.pop_front();
    }

    cout<<endl;
}


Measured memory_bytes: 4420
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
	vector<long long> arr(n);
	for(int i=0;i<n;++i)cin>>arr[i];

	long long all = 0L;
	for(int i=0;i<n;++i)all ^= arr[i];
	//cout<<all<<endl;
  
    
	for(int i=0;i<n;++i){
		for(int bit=0;bit<60;++bit){
			if( (all & (1LL<<bit)) && ((1LL<<bit) & arr[i]) ){
				arr[i] -= (1LL<<bit);
			}
		}
	}
  
  	long long sum = 0L;
	for(int i=0;i<n;++i)sum ^= arr[i];
	//cout<<all<<endl;
  
	int index = 0;
	for(int bit=59;bit>=0;--bit){
		long long mx = -1;
		int id = index; 
		for(int i=index;i<n;++i){
			if( ((1LL<<bit)&arr[i]) && mx<arr[i]){
				id = i;
				mx = arr[i];
			}
		}
		if(mx==-1){continue;}
		swap(arr[index],arr[id]);

		for(int i=0;i<n;++i){
			if(i!=index && arr[i]&(1LL<<bit) ){
				arr[i] ^= arr[index];
			}
		}
		index++;
        //for(auto i:arr)cout<<i<<" ";cout<<endl;
	}
  
	
	long long curr = 0L;
	for(int i=0;i<n;++i){
		curr ^= arr[i];
	}
	
	cout<<curr + (curr^sum) + all<<endl;
	return 0;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
	map<string, int> K;
	K["SUN"] = 7;
	K["MON"] = 6;
	K["TUE"] = 5;
	K["WED"] = 4;
	K["THU"] = 3;
	K["FRI"] = 2;
	K["SAT"] = 1;
	string s;
	cin >> s;
	ce(K[s])
    return 0;
}



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

int main(void){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(abs(a-c) <=d || (abs(a-b) <=d && abs(c-b) <=d)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
  int n;
  int min = 1 << 29;
  
  for (scanf("%d", &n); n--;) {
  	int m;
    int count = 0;
    
    scanf("%d", &m);
    
    while (!(m % 2)) {
      count++;
      m /= 2;
    }
    
    min = count < min ? count : min;
  }
  
  printf("%d\n", min);
  
  return 0;
}

Measured memory_bytes: 1704
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <random>

using namespace std;

#define int long long

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int a, b, c;
	cin >> a >> b >> c;
	if (c - a - b < 0) {
		cout << "No\n";
		return 0;
	}
	if (4 * a * b < (c - a - b) * (c - a - b)) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

using namespace std;

int main() {
  INIT;
  
  int n,k,x,y;
  cin >> n >> k >> x >> y;
  cout << (n <= k)*(x*n) + (n > k)*( x*k + (n-k)*y ) << endl;
  
  return 0;
}

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

l = make_divisors(m)

l.reverse()


for x in l:
    if m // x >= n:
        print(x)
        break


Measured memory_bytes: 9092
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>

#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define RREP(i,a) for(long (i)=(a)-1;(i)>=0;(i)--)
#define FORR(i,a,b) for(long (i)=(a)-1;(i)>=(b);(i)--)
#define MOD 1000000007
#define PI acos(-1.0)
#define DEBUG(C) cout<<C<<endl;
#define PII pair<int,int>
#define PDD pair<double,double>
#define PLL pair<long,long>
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).begin(),(a).end(),greater<int>())
#define MP(a,b) make_pair(a,b)
#define FORE(a,b) for(auto &&a:b)

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

int main(void){
	int x,cnt=1;
	while(cin>>x){
		if(x==0) return 0;
		cout<<"Case "<<cnt<<": "<<x<<endl;
		cnt++;
	}
}

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

using namespace std;

int main(){
   int N;
   int add=0;
   cin >> N;
   vector<int> L(N);
   for(int i=0;i<N;i++){
       cin >> L.at(i);
   }

   sort(L.begin(),L.end(),greater<int>());
    for(int i=1;i<N;i++){
        add += L.at(i);
    }
   cout << ((L.at(0)>=add) ? "No" : "Yes") << endl;
}

Measured memory_bytes: 256
#Ａ２　Ｂ４ N10
#AABBBBAABB.BBAABBBB
#NまでにAは何個か

N,A,B=input().split()
N=int(N);A=int(A);B=int(B);

bai=int(N/(A+B))
amari=N%(A+B)
#print(bai,amari)

if amari>A:
    nokoriA=A
else:
    nokoriA=amari

sumA=bai*A+nokoriA
print(sumA)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ln(S) (S).length()
using namespace std;

typedef long long llint;

string s;
int k;

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

	for (int i = 0; i < ln(s); ++i)
	{
		int toa = ('z' - s[i] + 1) % 26;
		if (toa <= k) {
			s[i] = 'a';
			k -= toa;
		}
	}

	if (k > 0) {
		s[ln(s)-1] = (s[ln(s)-1]-'a' + (k % 26)) % 26 + 'a';
	}

	cout << s;

	return 0;
}

Measured memory_bytes: 512
def main(string1, string2):
	
	answer = "No"
	
	for i in range(len(string1)):
		
		newstring = string2[i:] + string2[:i]
		
		if string1 == newstring:
			
			answer = "Yes"
	
	return answer
	
	
string1 = input()
string2 = input()

print(main(string1, string2))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define inf 1<<30
using namespace std;

vector<int> v[100001];
int n,m,s,t,d1[100001],d2[100001];

void dijkstra1(){
  for(int i=0;i<n;i++)d1[i]=inf;
  priority_queue<pair<int,int> > pq;
  d1[s]=0;
  pq.push(mp(0,s));
  while(!pq.empty()){
    pair<int,int> u=pq.top();
    pq.pop();
    int a=(-1)*u.f,b=u.s;

    if(d1[b]<a)continue;

    for(int i=0;i<v[b].size();i++){
      if(a+1<d1[v[b][i]]){
	d1[v[b][i]]=a+1;
	pq.push(mp((-1)*(a+1),v[b][i]));
      }
    }
  }
}

void dijkstra2(){
  for(int i=0;i<n;i++)d2[i]=inf;
  priority_queue<pair<int,int> > pq;
  d2[t]=0;
  pq.push(mp(0,t));
  while(!pq.empty()){
    pair<int,int> u=pq.top();
    pq.pop();
    int a=(-1)*u.f,b=u.s;

    if(d2[b]<a)continue;

    for(int i=0;i<v[b].size();i++){
      if(a+1<d2[v[b][i]]){
	d2[v[b][i]]=a+1;
	pq.push(mp((-1)*(a+1),v[b][i]));
      }
    }
  }
}

int main()
{
  int a,b;

  cin>>n>>m>>s>>t;
  s--;t--;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    a--;b--;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dijkstra1();
  dijkstra2();

  long long A[100001]={},B[100001]={},minc=d1[t],ans=0;

  for(int i=0;i<100001;i++){
    A[i]=0;
    B[i]=0;
  }
  for(int i=0;i<n;i++){
    if(d1[i]==inf)continue;
    A[d1[i]]++;
    B[d2[i]]++;
  }
  for(int i=0;i<d1[t]-1;i++){
    ans+=A[i]*B[minc-2-i];
  }
  cout<<ans<<endl;
  return 0;
}

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

int main(){
  ll K;
  cin >> K;
  ll i=100,co=0;
  while(i<K){
    i*=1.01;
    co++;
  }
  
  cout << co << endl;
  
}

Measured memory_bytes: 3636
using System;

using System.Linq;



namespace hello_cs

{

    class Program

    {

        static void Main(string[] args)

        {

            var blank = " ";

            var num = System.Console.ReadLine().Split(blank.ToCharArray());

            var n = int.Parse(num[0]);

            var m = int.Parse(num[1]);



            var vote = Console.ReadLine().Split(blank.ToCharArray()).Select(x => int.Parse(x)).ToArray();

            var all = 0;

            foreach(var i in vote){

                all += i;

            }



            var fav = vote.Where(x => x >= (double)all / (double)( 4 * m )).ToArray();



            Console.WriteLine(fav.Count() >= m ? "Yes" : "No");

        }

    }

}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>


template <class T> void chmin(T&a, const T&b) { a = min(a,b); }
template <class T> void chmax(T&a, const T&b) { a = max(a,b); }

const double EPS =1e-9;
const long INF =999999999;
const long MOD =1000000007; //10^9+7
#define PI 3.14159265258979

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

int main(void){
	int N;
	cin>>N;
	printf("%d\n",800*N-200*(N/15));

	
	return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt"
int main() {
	while (1) {
		int N, M; cin >> N >> M;
		if (!N)break;
		int memo[200][200][5];
		memset(memo, 0, sizeof(memo));
		memo[0][0][4] = 1;
		for (int i = 0; i < 110; ++i) {
			for (int j = 0; j < 110; ++j) {
				for (int k = 0; k < 5; ++k) {
					memo[i][j][k] %= 100000;
					if (k == 0) {
						memo[i + 1][j][2] += memo[i][j][k];
					}
					else if (k == 1) {
						memo[i][j + 1][3] += memo[i][j][k];
					}
					else if (k == 2) {
						memo[i + 1][j][2] += memo[i][j][k];
						memo[i][j + 1][1] += memo[i][j][k];
					}
					else if (k == 3) {
						memo[i + 1][j][0] += memo[i][j][k];
						memo[i][j + 1][3] += memo[i][j][k];
					}
					else {
						memo[i + 1][j][2] += memo[i][j][k];
						memo[i][j + 1][3] += memo[i][j][k];
					}
				}
			}
		}
		int ans = 0;
		for (int i = 0; i < 5; ++i)ans += memo[N - 1][M - 1][i];
		cout << ans % 100000 << endl;
	}
	
	return 0;
}

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

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define all(x) (x).begin(), (x).end()
#define clr(ar, val) memset(ar, val, sizeof(ar))
#define INF 100000000000LL

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;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef long double ld;

int main(void) {
  int n, k, a, ma, gc;
  cin >> n >> k;
  rep(i, n){
    cin >> a;
    if(i == 0) ma = gc = a;
    else{
      ma = max(ma, a);
      gc = gcd(gc, a);
    }
  }
  if(k <= ma && (ma - k) % gc == 0)
    cout << "POSSIBLE" << endl;
  else
    cout << "IMPOSSIBLE" << endl;
  return 0;
}

Measured memory_bytes: 256
s = input()
flag = True
while 1:
    if s[-7:] == "dreamer":
        s = s[:-7]
    elif s[-6:] == "eraser":
        s = s[:-6]
    elif s[-5:] == "dream" or s[-5:] == "erase":
        s = s[:-5]
    else:
        flag = False
        break
    if s == "":
        break
if flag:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3236
import sys
input = sys.stdin.readline
from math import sqrt


def Eratosthenes(n):
    """n(>=6)未満の素数列挙 """
    n, correction = n - n % 6 + 6, 2 - (n % 6 > 1)
    sieve = [True] * (n // 3)
    for i in range(1, int(sqrt(n)) // 3 + 1):
        if sieve[i]:
            k = 3 * i + 1 | 1
            sieve[k * k // 3::2 * k] = [False] * ((n // 6 - k * k // 6 - 1) // k + 1)
            sieve[k * (k - 2 * (i & 1) + 4) // 3::2 * k] = [False] * ((n // 6 - k * (k - 2 * (i & 1) + 4) // 6 - 1) // k + 1)
    # return [2, 3] + [3 * i + 1 | 1 for i in range(1, n // 3 - correction) if sieve[i]]
    # x が素数か判定したいとき
    return {2, 3}.union({3 * i + 1 | 1 for i in range(1, n // 3 - correction) if sieve[i]})


sieve = Eratosthenes(10 ** 5 + 1)
ans = [0] * (10 ** 5 + 1)
for i in range(3, 10 ** 5, 2):
    if i in sieve and (i + 1) // 2 in sieve:
        ans[i] += 1
for i in range(3, 10 ** 5):
    ans[i + 1] += ans[i]
q = int(input())
for i in range(q):
    l, r = map(int, input().split())
    print(ans[r] - ans[l - 1])


Measured memory_bytes: 13076
#include <bits/stdc++.h>
using namespace std;
#define printArr(harry, tam) range(tam) cout << harry[i] << " \n"[i == tam -1];
#define range(n) for(int i = 0; i < n; i++)
#define maxn 100000
#define mod 1000000007
#define md(x) ((((x) % mod) + mod) % mod)
#define sc scanf
#define pr printf
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define EPS 1e-9
#define INF INT_MAX
#define INFd 1e9

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;

//Trace dinamico
template<typename T>
void trace(T a) { cout << a << "\n"; }
template<typename T, typename... Args>
void trace(T a, Args... args) { cout << a << " "; trace(args...); }

//DP debug
int recNum = 0;
void prTabs() { range(recNum) cout << "    "; }
template<typename... Args>
void recInit(Args... args) { prTabs(); trace("rec(", args..., ")"); recNum++; }
template<typename T>
void recEnd(T a) { prTabs(); trace("->", a); recNum--;}
int n, m, a, b, c;

int main(){
	sc("%d %d", &a, &b);
	pr("%d\n", max(max(a + a-1, b + b-1), b + a));
 	return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int W, H, x, y, r;

	cin >> W >> H >> x >> y >> r;

	if ((x+r) <= W && (x-r) >= 0 && (y+r) <= H && (y-r) >= 0) {
		cout << "Yes" << endl;
	} else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
int n,m,q,a[50],b[50],c[50],d[50],ans,p[10];
void dfs(int len, int pre){
    if(len==n){
        int s=0;
        for(int i=0;i<q;i++){
            if(p[b[i]-1]-p[a[i]-1]==c[i])s+=d[i];
        }
        ans=max(ans,s);
        return;
    }
    for(int i=pre;i<=m;i++){
        p[len]=i;
        dfs(len+1,i);
    }
}
int main(){
    cin>>n>>m>>q;
    for(int i=0;i<q;i++){
        cin>>a[i]>>b[i]>>c[i]>>d[i];
    }
    dfs(0,1);
    cout<<ans;
}

Measured memory_bytes: 3596
/**Lucky Boy**/
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define FORD(i, a, b) for (int i = (a); i >= (b); --i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define maxc 1000000007
#define maxn 100005
#define maxm 1000006
#define pii pair <int,int>
#define Task ""
template <typename T> inline void read(T &x){char c;bool nega=0;while((!isdigit(c=getchar()))&&(c!='-'));if(c=='-'){nega=1;c=getchar();}x=c-48;while(isdigit(c=getchar())) x=x*10+c-48;if(nega) x=-x;}
template <typename T> inline void writep(T x){if(x>9) writep(x/10);putchar(x%10+48);}
template <typename T> inline void write(T x){if(x<0){putchar('-');x=-x;}writep(x);putchar(' ');}
template <typename T> inline void writeln(T x){write(x);putchar('\n');}
using namespace std;
int n,gt[maxn << 1],ans,cur;
int main()
{
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    //freopen(Task".inp", "r",stdin);
    //freopens(Task".out", "w",stdout);
    cin >> n;
    n <<= 1;
    gt[0] = 1;
    FOR(i,1,n) gt[i] = (1ll*gt[i-1]*i) % maxc;
    ans = gt[n / 2];
    FOR(i,1,n)
    {
        int x;
        char c;
        cin >> c;
        x = (c == 'W');
        if (x)
        {
            if (cur & 1)
            {
                ++cur;
            }
            else
            {
                ans = (1ll*ans*cur) % maxc;
                --cur;
            }
        }
        else
        {
            if (cur & 1)
            {
                ans = (1ll*ans*cur) % maxc;
                --cur;
            }
            else
            {
                ++cur;
            }
        }
    }
    if (cur) ans = 0;
    cout << ans;
    return 0;
}


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

int d, score;
vector<int> c(26);
vector<vector<int>> s(400, vector<int>(26)), pos(26);

int get_score(vector<int> t){
    int ans = 0;
    vector<int> last(26, 0);
    rep(i, d){
        pos[t[i]].push_back(i);
        ans += s[i][t[i]];
        rep(j, 26){
            if(t[i] == j)last[j] = i+1;
            ans -= c[j] * ((i+1)-last[j]);
        }
    }
    return ans;
}

int main() {
    cin >> d;
    rep(i, 26)cin >> c[i];
    rep(i, d)rep(j, 26)cin >> s[i][j];
    //-----code------// 
    vector<int> t(d, 0);
    rep(i, d){
        int ma = 0;
        rep(j, 26)ma = max(ma, s[i][j]);
        rep(j, 26)if(ma == s[i][j])t[i] = j;
    }
    score = get_score(t);
    clock_t now = clock();
    while(now < 1950000){
        int D = rand() % d, q = rand() % 26;
        int old = t[D], olds = get_score(t);
        t[D] = q;
        if(get_score(t) < olds)t[D] = old;
        now = clock();
    }
    rep(i, d)cout << t[i]+1 << endl;
}


Measured memory_bytes: 210824
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007

int main(){
  ll a,b;
  cin>>a>>b;
  rep(i,0,b){
    ll c;
    cin>>c;
    a-=c;
  }
  if(a<=0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6)

n = int(input())
A = list(map(int, input().split()))

CurrentMoney = 1000

for i in range(0, n-1):
    Stocks = 0
    if A[i] < A[i+1]: Stocks = CurrentMoney // A[i]
    CurrentMoney += (A[i+1] - A[i]) * Stocks

print(CurrentMoney)

Measured memory_bytes: 9192
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

 size_t strlen(const char *s);
#define rep(i,n) for(long long int i=0;i<n;i++)
#define sz(x) ((int)(x).size())

using namespace std;
std::vector<int> graph[10050];//graph頂点数のsize
const int N=200010;
const int P=1000000007;
using ll = long long;
vector<ll> prime;

//絶対値
int ze(int a, int b){
	if(a>b){
		return a-b;
	}else{
		return b-a;
	}
}
//小さい方
long long int min(long long int a,long long int b){
	if(a>b){
		return b;
	}else{
		return a;
	}
}
//大きい方
long long int max(long long int a,long long int b){
	if(a>b){
		return a;
	}else{
		return b;
	}
}
// a^n mod 
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod 
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

//mod掛け算
long long mt(long long a, long long b, long long mod){
	return (a*b)%mod;
}

//メモ

/*
	memset(b, '\0', sizeof(b));
初期化*/


/*
	string s;
	s.size()
*/

/*
	char s[N];
	strlen(s)
*/
/*
	if(  <  )puts("Yes");
	else puts("No");
*/

/*文字列比較
if(strcmp(name[i],s)==0)
*/

/*
	graph[a].push_back(b);//graph[a][i番目に入れた]==b
	graph[j].size()	//forで回すときとか

*/


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





	if( s.at(1)=='B'     )puts("ARC");


	else puts("ABC");


}


Measured memory_bytes: 3864
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int main()
{
	//投票

	int N, M;
	cin >> N >> M;
	int A[1000], vote[1000];
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		vote[i] = 0;
	}
	int b;
	for (int i=0; i < M; i++) {
		cin >> b;
		for (int j = 0; j < N; j++) {
			if (A[j] <= b) {
				vote[j]++;
				break;
			}
		}
	}
	int temps=0,ans;
	for (int i=0; i < N; i++) {
		if (vote[i] > temps) {
			temps = vote[i];
			ans = i;
		}
	}
	cout << ans + 1 << endl;
	//2.すごろく	
	/*
	int n;
	cin >> n;
	int A, _A = 1;
	int k = 0;
	int A_count[100];
	A_count[0] = 1;
	for (int i = 0; i < n; i++)
	{
		cin >> A;
		if (A == 1)
		{
			if (A == _A)
			{
				A_count[k]++;
			}
			else
			{
				k++;
				A_count[k] = 2;
			}
		}
		_A = A;
	}
	sort(A_count, A_count + k + 1);
	cout << A_count[k] << endl;
	*/

	//タイムカード
	/*
	int t[2][3];
	int x[3][3];
	for (int n=0; n < 3; n++)
	{
		for (int i=0; i < 2; i++)
			for (int k=0; k < 3; k++)
				cin >> t[i][k];
			
		for (int m = 2; m >= 0; m--)
		{
			x[n][m] = t[1][m] - t[0][m];
			if (t[0][m] > t[1][m])
			{
				x[n][m] += 60;
				t[1][m - 1]--;
			}
		}
	}
	for (int n= 0; n < 3; n++)
	{
		cout << x[n][0] << ' ' << x[n][1] <<' '<< x[n][2] << endl;
	}
	*/


	
	return 0;
}


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

int main()
{
    string s;
    cin >> s;
    if(s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) cout << "Yes" << endl;
    else if(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) cout << "Yes" << endl;
    else if(s[0] == s[3] && s[1] == s[2] && s[0] != s[1]) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
/**Bismillahir Rahmanir Raheem
    Author:Refat(BSMRSTU)**/
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 2e5 + 5;
const int M = 1e9 + 7;
const double pi=2*acos(0.0);
const double esp=1e-9;
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}

ll countpositive(vector<ll>vt,ll value) {
    ll ans=0;
    for(int i=0,j=(int)vt.size()-1; i<(int)vt.size()&&i<j; i++) {
        while(j>=0&&vt[i]*vt[j]>value)j--;
        if(i<j)
            ans+=(j-i);
    }
    return ans;
}

ll countnegative(vector<ll>vt1,vector<ll>vt2,ll value) {
    reverse(vt1.begin(),vt1.end());
    ll ans=0;
    for(int i=0,j=(int)vt2.size()-1; i<(int)vt1.size(); i++) {
        while(j>=0&&vt1[i]*vt2[j]>value)j--;

        ans+=(j+1);
    }
    return ans;
}
int main() {
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);
    vector<ll>pos,neg,nneg;
    int test=1;
    ///scanf("%d",&test);
    for(int cs=1; cs<=test; cs++) {
        ll n,k,x;
        scanf("%lld %lld",&n,&k);
        for(int i=1; i<=n; i++) {
            scanf("%lld",&x);
            if(x>=0) {
                pos.push_back(x);
            } else {
                neg.push_back(x),nneg.push_back(-x);
            }
        }
        sort(pos.begin(),pos.end());
        sort(neg.begin(),neg.end());
        sort(nneg.begin(),nneg.end());
        ll l=-1e18,r=1e18,cnt,ans;

        while(l<=r) {
            ll mid=(l+r)>>1;
            if(mid>=0) {
                cnt=countpositive(pos,mid)+countpositive(nneg,mid)+(ll)pos.size()*(ll)neg.size();
            } else {
                cnt=countnegative(pos,neg,mid);
            }
            if(cnt>=k) {
                r=mid-1;
                ans=mid;
            } else if(cnt<k) {
                l=mid+1;
            }
        }
        printf("%lld\n",ans);
    }
    return 0;
}



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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 (a>b) { a=b; return 1; } return 0; }

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll x; cin>>x;
    ll A = x/11;
    ll B = (x%11==0)?0:(x%11<=6)?1:2;
    cout<<A*2+B<<endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A
{
    class Program
    {
        public static void Main(string[] args)
        {
            var n = ReadLineIntSpilit();
            var re = "No";

            var a = new int[]{ 1, 3, 5, 7, 8, 10, 12 };
            var b = new int[] { 4, 6, 9, 11 };

            if(n[0] != 2) {
                if((a.Contains(n[0]) && a.Contains(n[1])) || (b.Contains(n[0]) && b.Contains(n[1]))) {
                    re = "Yes";
                }
            }

            Console.WriteLine(re);
            ReadLine();
        }

        /// <summary>
        /// stringを一文字ずつintにキャストして配列に変換します。
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int[] StringCharArrayIntArray(string str)
        {
            List<int> b = new List<int>();
            for (int i = 0; i < str.Length; i++) {
                b.Add( int.Parse(str[i].ToString()));
            }
            return b.ToArray();
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static int ReadLineInt()
        {
            return int.Parse(Console.ReadLine());
        }

        public static string[] ReadLineStringSplit(char a = ' ')
        {
            return ReadLine().Split(a).ToArray();
        }

        public static int[] ReadLineIntSpilit(char a = ' ')
        {
            return ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        }
    }
}

Measured memory_bytes: 13396
import re

T = input()
max_ = 0
s = re.match('[ACGT]+', T)
if s:
    max_ = len(s.group(0))

s = re.search('[^ACGT][ACGT]+$', T)
if s:
    max_ = max(max_, len(s.group(0)) - 1)


ss = re.findall('[^ACGT][ACGT]+[^ACGT]', T)
if ss:
    for s in ss:
        if s:
            max_ = max(max_, len(s) - 2)
print(max_)

Measured memory_bytes: 3188
def circle_range(start_x,start_y,r)
    {min_x:start_x-r,max_x:start_x+r,min_y:start_y-r,max_y:start_y+r}
end

W,H,x,y,r = *gets.split.map(&:to_i)
circle_inforamtion = circle_range(x,y,r)
if 0<=circle_inforamtion[:min_x] && circle_inforamtion[:max_x]<=W && 0<=circle_inforamtion[:min_y] && circle_inforamtion[:max_y]<=H
    puts "Yes"
else
    puts "No"
end


Measured memory_bytes: 6876
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>
#include<tuple>
#include<stack>


using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> tpl;
int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };

#define ARRAY_MAX 305

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

int main() {

	int a, b, c;
	cin >> a >> b >> c;
	if (a == b && b == c && c == a)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}



	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);


int main()
{
    fast
    int q=1;
   
    while(q--)
    {
        ll n;
        cin>>n;
        cout<<1-n;
        
    }

    return 0;
}


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

public class Main {

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

        String[] ABCD = sc.nextLine().split(" ");
        int A = Integer.parseInt(ABCD[0]);
        int B = Integer.parseInt(ABCD[1]);
        int C = Integer.parseInt(ABCD[2]);
        int D = Integer.parseInt(ABCD[3]);

        int[] ans = new int[101];
        addTime(ans, A, B);
        addTime(ans, C, D);

        long count = Arrays.stream(ans).filter(s -> s > 1).count();
        System.out.println(count);
    }

    private static void addTime(int[] ans, int start, int stop) {
        for (; start < stop; start++) {
            ans[start]++;
        }
    }
}



Measured memory_bytes: 26836
n = int(input())
work = []
for _ in range(n):
    a, b = map(int, input().split())
    work.append((a,b))
work.sort(key=lambda x:x[1])
t = 0
for i in range(n):
    tim, exp = work[i]
    t +=tim
    if t > exp:
        print('No')
        break

else:
    print('Yes')

Measured memory_bytes: 31872
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();

		if (A<=0&&B>=0) {
			System.out.println("Zero");
		}else {
			if (A>0&&B>0) {
				System.out.println("Positive");
			}else if((A-B-1) % 2 == 0) {
				System.out.println("Positive");
			}else {
				System.out.println("Negative");
			}
		}


	}
}




Measured memory_bytes: 35696
#ifdef __GNUC__
#include <bits/stdc++.h>
#endif // __GNUC_

int dfs(int n, int N, std::vector<bool> s, const std::vector<std::vector<int>>& l, const std::vector<int>& p) {
    if (n < N) {
        int ans = 0;
        s[n] = true;
        ans += dfs(n + 1, N, s, l, p);
        s[n] = false;
        ans += dfs(n + 1, N, s, l, p);
        return ans;
    }
    else {
        bool ok = true;
        int M = l.size();
        for (int i = 0; i < M; ++i) {
            int count = 0;
            for (auto& v : l[i])if (s[v])++count;
            if ((count & 1) == p[i])continue;
            ok = false;
            break;
        }
        if (ok)return 1;
        else return 0;
    }
}

int main() {

    int N, M;
    std::cin >> N >> M;
    std::vector<bool> switches(N, false);
    std::vector<std::vector<int>> lights(M);
    std::vector<int> p(M);
    for (auto& v : lights) {
        int k;
        std::cin >> k;
        v.resize(k);
        for (auto& v2 : v) {
            int tmp;
            std::cin >> tmp;
            v2 = tmp - 1;
        }
    }
    for (auto& v : p)std::cin >> v;
    int ans = dfs(0, N, switches, lights, p);
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256