akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <stdio.h>
#include <ctype.h>
#include <unordered_set>
#include <cmath>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map> // for(int i = 0; i < n; i++) { }
#define ch cout 
#include <fstream>
#include <sstream>

#define REP(i, a, b) for(int i = a; i <= b; i++)
using namespace std;
const int modulo = 1e9;
typedef long long ll;
int N = 4;

int main() {
     ios::sync_with_stdio(false);
     cin.tie(0);
      
      string str;
      cin >> str;
      if(str[2] == str[3] && str[4] == str[5]) {
      	cout << "Yes" << "\n";
      } else {
      	cout << "No" << "\n";
      }



   return 0;	
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}

int dp[105][10] = {};
//dp[i][j] := i段目j本目にいるあみだくじの数

signed main(void) {
    int h,w,k;
    cin >> h >> w >> k;
    if(w == 1){
        cout << 1 << endl;
        return 0;
    }
    dp[0][0] = 1;
    rep(i,h){
        rep(bit,1<<(w-1)){
            bool c = true;
            vector<bool> a(w-1);
            rep(j,w-1)if(bit & (1<<j))a[j] = true;
            rep(j,w-2)if(a[j] && a[j+1])c = false;
            if(!c)continue;
            rep(j,w){
                if((j == 0 || !a[j-1]) && (j == w-1 || !a[j])){
                    (dp[i+1][j] += dp[i][j]) %= MOD;
                }else if(j > 0 && a[j-1]){
                    (dp[i+1][j-1] += dp[i][j]) %= MOD;
                }else if(j < w-1 && a[j]){
                    (dp[i+1][j+1] += dp[i][j]) %= MOD;
                }
            }
        }
        //rep(j,w)cout << " " << dp[i][j];cout << endl;
    }
    cout << dp[h][k-1] << endl;
}


Measured memory_bytes: 256
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))



##### main #####

def main():
	x,y = LI()
	if x%y == 0:
		print(-1)
	else:
		print(x)


if __name__ == '__main__':
    main()

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

#define ALL(n) (n).begin(),(n).end()

int main(){
	int n,m;
	while(1){
		cin>>n>>m;	if(n==0&&m==0)break;

		vector<int> p(n+1);
		p[0]=0;
		for(int i=1;i<=n;i++)cin>>p[i];
		sort( ALL(p) );

		vector<int> pc_pd((n+1)*(n+1));
		for(int c=0;c<=n;c++){
			for(int d=0;d<=n;d++){
				pc_pd[c*(n+1) + d]=p[c]+p[d];
			}
		}
		sort( ALL(pc_pd) );

		int ans=0;
		for(int a=0;a<=n;a++){
			for(int b=0;b<=n;b++){
				int tmp=p[a]+p[b];

				if(tmp>m)continue;
				else{
					//{{{ binary_search
					int OK=0, NG=(n+1)*(n+1);
					int MAX=m-tmp;

					while(NG-OK>1){
						int mid=(NG+OK)/2;

						if(pc_pd[mid]<=MAX) OK=mid;
						else NG=mid;
					}
					tmp+=pc_pd[OK];
					//}}}
				}


				ans=max(ans,tmp);
			}
		}

		cout<<ans<<endl;

	}
	return 0;
}



Measured memory_bytes: 7204
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const n = input[0][0];

  return Number(
    n
      .split("")
      .map((char) => (char === "1" ? "9" : "1"))
      .join("")
  );
};

console.log(main(read()));


Measured memory_bytes: 29648
from fractions import gcd
a, b, c, d = map(int, input().split())

a_c = (a-1)//c
a_d = (a-1)//d
gcd_dc = gcd(d,c)
lcm_dc = (c*d)//gcd_dc
a_cd = (a-1)//lcm_dc
b_c = b//c
b_d = b//d
b_cd = b//lcm_dc

print(b-a+1-(b_c+b_d-b_cd-a_c-a_d+a_cd))


Measured memory_bytes: 5076
#include <bits/stdc++.h>
 
#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         998244353
#define pqueue      priority_queue<pii>
#define pdqueue     priority_queue< int,vector<int> ,greater< int >>
 
using namespace std;
 
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  
int power(int a,int n)
{
    a %= mod;
    if(n == 1)return a;
    if(n == 0)return 1;
    if(n%2)return (a*(power((a*a)%mod,n/2)%mod))%mod;
    return power((a*a)%mod,n/2)%mod;
}
 
const int inf = (int) 1e18;
 
int inverse(int x){
    return power(x,mod-2)%mod;//little fermat....
}  

void solve(){
    int h1,m1,h2,m2,k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int tot = 0;
    if(h2 > h1)tot = m2+(h2-h1-1)*60+60-m1;
    else tot = m2-m1;
    cout << max(0LL,tot-k) << "\n";
}       

 
signed main()   
{
    showoff;
    int T = 1;
    //cin >> T;
    FOR(t,1,T+1){
        solve();
        cout << "\n";
    }
    return 0;
}
//*->for large size of matrix take int not long long if possible......
//*->always take maximum as inf for safer side ...

Measured memory_bytes: 3636
//
// Created by kuroneko on 2019-09-01.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

typedef long long ll;

#define INF 1000000000000009LL
#define MOD 1000000007LL

typedef int Weight;
struct Edge {
    int src, dst;
    Weight weight;
    Edge(int src, int dst, Weight weight):src(src), dst(dst), weight(weight) {}
};

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef vector<Weight> Array;
typedef vector<Array> Matrix;

int dp[1005][1005];

int main() {
    int N; cin >> N;
    int A[N][N-1];
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N-1; j++) {
            cin >> A[i][j];
            A[i][j]--;
        }
    }
    int next[N];
    for (int i = 0; i < N; i++) next[i] = 0;

    bool flag = false;

    while (!flag) {
        for (int i = 0; i < N; i++) {
            int idx = A[i][next[i]];
            if (next[i] >= N-1 || next[idx] >= N-1) continue;
            int prev_i, prev_idx;
            if (next[i] > 0) prev_i = A[i][next[i]-1]+1;
            else prev_i = 0;

            if (next[idx] > 0) prev_idx = A[idx][next[idx]-1]+1;
            else prev_idx = 0;

            if (A[idx][next[idx]] == i) {
                dp[i+1][idx+1] = dp[idx+1][i+1] = max(dp[i+1][prev_i], dp[idx+1][prev_idx]) + 1;
                next[i]++;
                next[idx]++;
                flag = true;
            }
        }
        flag = !flag;
    }

    int res = 0;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (i != j && dp[i+1][j+1] == 0) {
                cout << -1 << endl;
                return 0;
            } else if (i != j) {
                res = max(res, dp[i+1][j+1]);
            }
        }
    }

    cout << res << endl;
    return 0;
}


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

const int D = 365, N = 26;
int d, q;
ll c[N+1];
ll s[D+1][N+1];
ll last[N];
int contest[D+1];

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> d;
	for(int i = 1; i <= N; i++)
		cin >> c[i];
	for(int i = 1; i <= d; i++) {
		for(int j = 1; j <= N; j++)
			cin >> s[i][j];
	}
	memset(last, 0, sizeof last);
	ll ans = 0;
	for(int i = 1; i <= d; i++) {
		int t; cin >> t;
		ans += s[i][t];
		last[t] = i;
		for(int j = 1; j <= N; j++)
			ans -= c[j] * (i - last[j]);
		contest[i] = t;
	}
	cin >> q;
	while(q--) {
		ll idx, x; cin >> idx >> x;
		ll l = idx-1, r = idx+1;
		ll len, len2;
		while(l > 0 && contest[l] != contest[idx]) l--;
		len = idx - l;
		while(r <= d && contest[r] != contest[idx]) r++;
		len2 = r - idx;
		ans -= s[idx][contest[idx]];
		ans -= c[contest[idx]] * len * len2;
		contest[idx] = x;

		l = idx-1, r = idx+1;
		while(l > 0 && contest[l] != contest[idx]) l--;
		len = idx - l;
		while(r <= d && contest[r] != contest[idx]) r++;
		len2 = r - idx;
		ans += s[idx][x];
		ans += c[x] * len * len2;
		cout << ans << '\n';
	}

	return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using ull = unsigned long long;
#define int long long
using namespace std;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
namespace mydef {
const int INF = 1ll << 60;
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
bool dbg = false;
}  // namespace mydef
using namespace mydef;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<pair<int, int>>
#define vvp vector<vector<pair<int, int>>>
#define pi pair<int, int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define asn ans


int X;
int intpow(int a, int b) {
    int ans = 1;
    while (b) {
        if (b & 1)
            ans *= a;
        a *= a;
        b /= 2;
    }
    return ans;
}


void solve() {

    for (int A = 0;; A++) {
        int Y = intpow(A, 5) - X;
        if (Y == 0) {
            cout << A << " " << 0 << endl;
            return;
        }
        int minus = 1;
        if (Y < 0) {
            minus = -1;
            Y *= -1;
        }
        int ok = 0;
        int ng = 1000;
        auto check = [&](int x) {
            return intpow(x, 5) <= Y;
        };
        while (abs(ok - ng) > 1) {
            int mid = (ok + ng) / 2;
            if (check(mid)) {
                ok = mid;
            } else {
                ng = mid;
            }
        }
        if (intpow(ok, 5) == Y) {
            cout << A << " " << ok * minus << endl;
            return;
        }
    }
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> X;


    solve();
    return 0;
}


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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();//, b = sc.nextInt();
		//int x=sc.nextInt();//,k=sc.nextInt();
		long sum=0,count=0,flag=0,max=-999999,min=99999;
		long[] array=new long[a];
		//String s=sc.next();//,t=sc.next();
		String buff;
		//String[] arrays = new String[a];
		for(int i=0;i<a;i++) {
			array[i]=sc.nextInt();
		}
		Arrays.sort(array);
		for(int i=a-1;i>=0;i-=2) {
			sum+=array[i];
			if(i-1<0)break;
			count+=array[i-1];
		}

		System.out.println(sum-count);

	}
	public static int sample(int n) {
		return n;
	}

}


Measured memory_bytes: 24020
#include<bits/stdc++.h>
#define LL long long
#define MAXN 50005
#define INF (1<<25)
#define P int(998244353)
using namespace std;

int N;
LL x,y,c,d,k;

LL ceil1(LL a, LL b){
	return a/b + (a%b!=0);
}

int main(){
	
	cin>>N;
	
	cin>>x>>y;
	
	--N;
	
	while(N--){
		cin>>c>>d;
		
		k = max(ceil1(x,c), ceil1(y,d));
		
		x = c * k;
		y = d * k;

		//cout<<"% "<<x<<" "<<y<<endl;
	}
	
	
	cout<<x + y<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod= 1000000007;

void add_self(int &a, int b){
      a+=b;
      while(a>mod)
            a-=mod;
}

int main(){
      string s;
      int d;
      cin>>s>>d;
      int len=s.length();
      vector<vector<int>>dp(d, vector<int>(2, 0));

      dp[0][0] = 1;

      for(int where = 0; where < len; where++){
            
            vector<vector<int>>new_dp(d, vector<int>(2, 0));
            
            for(int sum = 0; sum < d; sum++){
                  
                  for(bool sm_already: {false, true}){
                        
                        for(int digit = 0; digit < 10; digit++){
                              
                              if((digit > s[where] - '0') && !sm_already){
                                    break;
                              }
                              add_self(new_dp[(sum + digit)%d][sm_already || (digit < (s[where] - '0'))], dp[sum][sm_already]);
                        }
                  }
            }
            dp = new_dp;
      }
      int ans=dp[0][1]+dp[0][0];
      ans--;
      ans%=mod;
      if(ans<0)ans=mod-1;
      cout<<ans;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
#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)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int gcd(int a,int b) {
  if (a < b) swap(a, b);
  if (a % b == 0) return b;
  return gcd(b, a%b);
}

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  int ab = gcd(a, b);
  vector<int> divisor(16);
  int id = 0;
  FORR(i, sqrt((double)ab), 1) {
    if (ab % i == 0)  {
      int j = ab / i;
      divisor[id] = i;
      id++;
      if (i == j) continue;
      divisor[id] = j;
      id++;
    }
  }
  sort(divisor.begin(), divisor.end(), greater<int>());
  cout << divisor[k-1] << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
	long double D,T,S;
	cin >> D >> T >>S;

	string s;
	//cin >> s;

	//int A[5]
	//sort(A, A + 5);



	if (D / S <= T)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

}

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

int main(void){
    ll N, A, B;
    cin >> N >> A >> B;

    ll BA = B - A;

    if(BA < 0) {
        cout << 0 << endl;
        return 0;
    }

    if(N==1){
        if(BA == 0){
            cout << 1 << endl;
            return 0;
        } else {
            cout << 0 << endl;
            return 0;
        }
    }

    ll result = (N-2) * (B-A) + 1;

    cout << result << endl;
    
    return 0;
}


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

vector<int> prime;
map<int, int> m;

bool is_prime(int n) {
	for (int i = 2; i < n; i++) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}

void update_map(int n) {
	for (int i = 0; i < prime.size() ; i++) {
		if (prime[i] > n) return;
		while (n % prime[i] == 0) {
			n /= prime[i];
			m[prime[i]]++;
		}
	}
}
		
int main() {
	int N;
	cin >> N;

	for (int i = 2; i <= N; i++) {
		if (is_prime(i)) {
			prime.push_back(i);
			m[i] = 1;
		}
	}

	for (int i = 2; i <= N; i++)
		update_map(i);

	long long ans = 1;
	for (auto i = m.begin(); i != m.end(); i++) {
		ans = (ans * i->second) % 1000000007;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
import sys
input = lambda: sys.stdin.readline().rstrip()

m = int(input())
total = 0
ans = 0
for _ in range(m):
    d, c = map(int, input().split())
    total += d*c
    ans -= (d - 1)*c
while total > 9:
    temp = total%10
    total -= temp
    ans += total//10 * 10
    total = total//10 + temp
ans += total - 1
print(ans)




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

int main()
{
    string s; cin >> s;
    int max = 0;
    int count = 0;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] == 'A' || s[i] =='C' || s[i] =='G' || s[i] =='T')
        {
            count ++;
        }else
        {
            if(count > max)max = count;
            count = 0;
        }
        
        if(count > max)max = count;
        
    }

    cout << max << endl;
    
}

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

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

    int N = scanner.nextInt();
    int[] a = new int[N];
    int[] b = new int[N];
    int[] c = new int[N];
    for (int i = 0; i < N; i++) a[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) b[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) c[i] = scanner.nextInt();

    Arrays.sort(a);
    Arrays.sort(b);
    Arrays.sort(c);

    long total = 0;
    for (int i = 0; i < N; i++) {
      total += (findMaxSmaller(a, b[i]) + 1) * (N - findMinBigger(c, b[i]));
    }
    System.out.println(total);
  }

  public static long findMaxSmaller(int[] a, int k) {
    int left = -1;
    int right = a.length;
    while (right - left > 1) {
      int mid = (left + right) / 2;
      if (a[mid] < k) {
        left = mid;
      } else {
        right = mid;
      }
    }
    return left;
  }

  public static long findMinBigger(int[] a, int k) {
    int left = -1;
    int right = a.length;
    while (right - left > 1) {
      int mid = (left + right) / 2;
      if (a[mid] > k) {
        right = mid;
      } else {
        left = mid;
      }
    }
    return right;
  }
}


Measured memory_bytes: 95412
s = input()
t = input()

ans = 1001001001
for i in range(len(s)-len(t)+1):
    _s = s[i:i+len(t)]
    cnt = 0
    for j in range(len(t)):
        if t[j] != _s[j]:
            cnt += 1
    ans = min(ans, cnt)

print(ans)

Measured memory_bytes: 9048
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
ll a,b,c,d;
ll low(ll x)
{
    ll re= b/x-a/x;
    if(a%x==0)
      re++;
    return re;
}
int main()
{

  scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
   ll sumc=low(c);
   ll sumd=low(d);

   ll s=c*d/(__gcd(c,d));

   ll sumcd=low(s);
 //  cout<<sumc<<' '<<sumd<<' '<<sumcd<<endl;
     ll ans=(b-a+1)-(sumc+sumd-sumcd);
     cout<<ans<<endl;


    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define int ll
using pint = pair<int,int>;
using Graph = vector<vector<int>>;
void YN(bool flg) {cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg) {cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg) {cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#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 out(n) cout << n << '\n'
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 1e10; //10^10
const double PI = acos(-1.0L);
/*mod逆元*/long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}
template< typename T >T mod_pow(T x, T n, T p=MOD) {T ret = 1;while(n > 0) {if(n & 1) (ret *= x) %= p;(x *= x) %= p;n >>= 1;}return ret;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n >>= 1; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}

//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    if(n==1){out("Hello World"); return 0;}
    else {
        int a,b; cin >> a >> b;
        out(a+b);
    }

    return 0;
}

Measured memory_bytes: 256
import sys

def main():
    input = sys.stdin.readline
    MOD = 10**9 + 7
    N, B = map(int, input().split())
    R = N - B

    # Preparation for factorial table
    factrial = [1] * (N+1)
    for k in range(1, N+1):
        factrial[k] = (factrial[k-1] * k) % MOD

    # Preparation for inverse of factorial table
    fact_inv = [1] * (N+1)
    fact_inv[N] = pow(factrial[N], MOD - 2, MOD)
    for k in range(N-1, -1, -1):
        fact_inv[k] = (fact_inv[k+1] * (k+1)) % MOD

    def comb_mod(n, r, MOD=10**9+7):
        if n == 0 and r > 0:
            return 1
        if n < 0 or r < 0 or n < r:
            return 0
        return (factrial[n] * fact_inv[r] * fact_inv[n-r]) % MOD

    for q in range(1, B+1):
        ans = 0
        blue = comb_mod(B-1, B-q)

        # pattern 1: BR..B
        red1 = comb_mod(R-1, R-(q-1))
        ans += (blue * red1) % MOD
        ans %= MOD

        # pattern 2: BR...R or RB...B
        # The number of R and B is same
        red2 = comb_mod(R-1, R-q)
        ans += (2 * blue * red2) % MOD
        ans %= MOD

        # pattern 3: RB...R
        red3 = comb_mod(R-1, R-(q+1))
        ans += (blue * red3) % MOD
        ans %= MOD

        if N == B and q == 1:
            ans = 1

        print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3444
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int N;
  int x[100], y[100], h[100];

  cin >> N;

  for(int i=0;i<N;i++){
    scanf("%d%d%d", x+i, y+i, h+i);
  }

  for(int i=0;i<=100;i++){
    for(int j=0;j<=100;j++){
      int H = -1;
      bool ok = true;

      for(int k=0;k<N;k++){
        if (h[k]) {
          H = h[k] + abs(x[k] - i) + abs(y[k] - j);
          break;
        }
      }

      for(int k=0;k<N;k++){
        ok &= max(0, H - abs(x[k] - i) - abs(y[k] - j)) == h[k];
      }

      if (ok) {
        cout << i << " " << j << " " << H << endl;
        return 0;
      }
    }
  }

  assert(false);

  return 0;
}


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

int main() {
  int N,max=40,current=0;
  cin >> N;
  for(int i=1;i<N+1;i++){
    current=0;
    int j;
    cin >> j;
    while(j%2==0){
	  j/=2;
      current++;
    }
    if(current<max)
      max=current;
  }
  cout << max << endl;
}
   

Measured memory_bytes: 3644
#include <iostream>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>

 
using namespace std;

 
int main(){
	int a,b,c,x=0;
	cin>>a>>b>>c;
	if(a==b) x+=1;
	if(b==c) x+=1;
	if(c==a) x+=1;
	if (x==3) x=2;
	cout<<3-x<<endl;





	return 0;
	}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <chrono>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define eps 1e-9
#define f first
#define s second

typedef long long ll;

using namespace std;

int main()

{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int cnt = 0;
    string s;
    set <char> ss;

    cin >> s;

    char x = s[0];

    for (int i = 1; i < 4; i++) {

        ss.insert(s[i]);

        if (s[i] != x) cnt++;
    }

    if (ss.size() == 2 && cnt == 2) cout << "Yes";
    else cout << "No";

    return 0;
}


Measured memory_bytes: 256
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
print((n-2)*180)

Measured memory_bytes: 3064
s = str(input())
first = s[0] + s[1]
second = s[2] + s[3]
if int(first) <= 12 and int(first) > 0 and (int(second) > 12 or int(second) == 0):
    print("MMYY")
elif int(second) <= 12 and int(second) > 0 and (int(first) > 12 or int(first) == 0):
    print("YYMM")
elif int(second) <= 12 and int(second) > 0 and int(first) <= 12 and int(first) > 0:
    print("AMBIGUOUS")
else:
    print("NA")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for (int i=1;i<=(n);++i)
using namespace std;
using ll = long long;
using P= pair<ll,ll>;
vector<ll> ans(10050);
int main() {
    ll N;
    
    cin>>N;
    
    rep(x,105)
    {
      rep(y,105)
      {
        rep(z,105)
        {
          ll v=x*x+y*y+z*z+x*y+y*z+z*x;
          if(v<10050)ans[v]++;
        }
      }
    }
    rep(i,N)cout<<ans[i]<<endl;
    
    return 0;
}

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


int main(){
  int n;
  cin >> n;
  map<int,int> d;
  for(int i=0;i<n;++i){
    int a;
    cin >> a;
    d[a]++;
  }
  int m;
  cin >> m;
  for(int i=0;i<m;++i){
    int a;
    cin >> a;
    if(d[a]==0){
      cout << "NO" << endl;
      return 0;
    }else{
      d[a]--;
    }
  }
  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 9600
W, H, N = map(int, input().split())
paint_dot = {}
for _ in range(N):
  t1, t2, t3 = map(int,input().split())
  paint_dot[(t1, t2)] = t3

pattern_H = [1]*H
pattern_W = [1]*W

for key in paint_dot:
  if paint_dot[key] == 1:
    for i in range(key[0]):
      pattern_W[i] = 0
  elif paint_dot[key] == 2:
    for i in range(key[0],W):
      pattern_W[i] = 0
  elif paint_dot[key] == 3:
    for i in range(key[1]):
      pattern_H[i] = 0
  else:
    for i in range(key[1],H):
      pattern_H[i] = 0

print(sum(pattern_W) * sum(pattern_H))
        

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;

int dp[100010], nxt[100010];

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

    int n, x;
    cin >> n >> x;
    vector<int> s(n);
    rep(i, n) cin >> s[i];
    sort(all(s));
    reverse(all(s));
    dp[x] = 1;
    rep(i, n)
    {
        rep(j, 100010) nxt[j] = 0;
        rep(j, 100010)
        {
            if (j < s[i])
                (nxt[j] += dp[j] * (n - i) % mod) %= mod;
            else
            {
                (nxt[j % s[i]] += dp[j]) %= mod;
                nxt[j] += dp[j] * (n - i - 1) % mod;
                nxt[j] %= mod;
            }
        }
        rep(j, 100010) dp[j] = nxt[j];
    }
    int ans = 0;
    rep(i, 100010)(ans += i * dp[i]) %= mod;
    cout << ans << endl;
}

Measured memory_bytes: 1920
import heapq
N=int(input())
ad_li=[[]for i in range(N)]
for i in range(N):
    nums=list(map(int,input().split()))
    f=nums[0]
    for j in range(nums[1]):
        t=nums[j*2+2]
        c=nums[j*2+3]
        ad_li[f].append([t,c])

memo=[1E18 for i in range(N)]
memo[0]=0
qu=[]
heapq.heappush(qu,(0,0))
while len(qu)!=0:
    atop=heapq.heappop(qu)
    for ne in ad_li[atop[1]]:
        next_cost=atop[0]+ne[1]
        if(memo[ne[0]]>next_cost):
            memo[ne[0]]=next_cost
            heapq.heappush(qu,(next_cost,ne[0]))
for i in range(N):
    print(i,memo[i])

Measured memory_bytes: 8232
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
#include <queue>
#include <map>
#include <set>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>& p) { os << p.first << " " << p.second; return os; }
template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) { for(int i = 0; i < (int) v.size(); i++) os << v[i] << (i + 1 != v.size() ? " " : ""); return os; }

void solve()
{
    string s; cin >> s;
    int n = s.back() - '0';
    if(n == 3) cout << "bon" << endl;
    else if(n == 2 or n == 4 or n == 5 or n == 7 or n == 9) cout << "hon" << endl;
    else cout << "pon" << endl;
}

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
using namespace std;
int main(){
  int n;
  int T[16][16];
  bool matatabiX[16][16];
  bool matatabiY[16][16];
  int Gx,Gy;
  cin >> n;
  for(int o=0;o<n;++o){
	// cout << "a!" << endl;
    cin >> Gx >> Gy;
    int p;
    cin >> p;

    for(int i=0;i<16;++i){
      for(int j=0;j<16;++j){
	//cout << "b!" << endl;
	matatabiX[i][j]=0;
	matatabiY[i][j]=0;
	T[i][j]=0;
      }
    }
  
    for(int i=0;i<p;++i){
      //cout << "c!" << endl;
      int x1,y1,x2,y2;
      cin >> x1 >> y1 >> x2 >> y2;
      if(x1==x2) matatabiY[x1][max(y1,y2)]=1;
      if(y1==y2) matatabiX[max(x1,x2)][y1]=1;
    }
    
    for(int j=0;j<Gy+1;++j){
      for(int i=0;i<Gx+1;++i){
	//cout << "d!" << endl;
	if     (i==0&&j==0)                         T[i][j]=1;
	else if(j==0&&matatabiX[i][j])             T[i][j]=0;
	else if(j==0)                               T[i][j]+=T[i-1][j]; 
	else if(i==0&&matatabiY[i][j])             T[i][j]=0;
	else if(i==0)                               T[i][j]+=T[i][j-1];
	else if(matatabiX[i][j]&&matatabiY[i][j]) T[i][j]=0;
	else if(matatabiX[i][j])                   T[i][j]+=T[i][j-1];
	else if(matatabiY[i][j])                   T[i][j]+=T[i-1][j];
	else T[i][j]+=T[i-1][j]+T[i][j-1];
      }
    }

    if(T[Gx][Gy]==0) cout << "Miserable Hokusai!" << endl;
    else cout << T[Gx][Gy] << endl;
  }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

signed main()
{
    //freopen("input.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];
    int b[n];
    copy(a, a + n, b);
    sort(b, b + n);
    for(int i = 0; i < n; i++)
        a[i] = lower_bound(b, b + n, a[i]) - b;
    int cnt = 0;
    for(int i = 0; i < n; i++)
        cnt += (a[i] & 1) ^ (i & 1);
    cout << cnt / 2 << "\n";
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define FOR(i, l, r) for(ll i = l; i < r; i++)
#define rep(i, N) FOR(i, 0, N)
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<ll> vl;
const ll MOD = round(1e9+7);

int main() {
    int K,T; cin >> K >> T;
    vi A(T); rep(i,T) cin >> A[i];
    sort(A.begin(), A.end());
    int ans = 0;
    if(T == 1) ans = K-1;
    else {
        ans = 2*A[T-1] - K - 1;
        if(ans < 0) ans = 0;
    }

    cout << ans;
    return 0;
}


Measured memory_bytes: 3540
n = int(input())
S = [ input() for _ in range(n)]
m = int(input())
T = [ input() for _ in range(m)]

S_set = list(set(S))
score = 0

for s in S_set:
  x = S.count(s)
  y = T.count(s)
  if x - y > score:
    score = x - y
print(score)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

int main(void)
{
    int N, K;
    cin >> N >> K;
    double ans = 0;
    auto invN = 1.0 / N;
    for (int i = 1; i <= N; i++)
    {
        auto now = i;
        auto temp = invN;
        while(now < K)
        {
            now *= 2;
            temp /= 2;
        }
        ans += temp;
    }

    cout << setprecision(10) << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static FastReader input = new FastReader();
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) throws IOException {

		int n = input.nextInt();
		int t = input.nextInt();
		int tax = input.nextInt();

		out.println(Math.min(n * t, tax));

		out.flush();
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() throws IOException {
			while (st == null || !st.hasMoreElements()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}

		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}

		String nextLine() throws IOException {
			String str = "";
			str = br.readLine();
			return str;
		}
	}

	static class con {
		static int IINF = (int) 1e9;
		static int _IINF = (int) -1e9;
		static long LINF = (long) 1e15;
		static long _LINF = (long) -1e15;
		static double EPS = 1e-9;
	}

	static class Triple implements Comparable<Triple> {
		int x;
		int y;
		int z;

		Triple(int x, int y, int z) {
			this.x = x;
			this.y = y;
			this.z = z;
		}

		@Override
		public int compareTo(Triple o) {
			if (x == o.x && y == o.y)
				return z - o.z;
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}
	}

	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		Pair(int x, int y) {
			this.x = x;
			this.y = y;

		}

		@Override
		public int compareTo(Pair o) {
			if (x == o.x)
				return y - o.y;
			return x - o.x;
		}
	}

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int r = i + (int) (Math.random() * (a.length - i));
			int tmp = a[r];
			a[r] = a[i];
			a[i] = tmp;
		}
	}

}

Measured memory_bytes: 20436
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    string Sa,Sb,Sc;
    cin >> Sa >> Sb >> Sc;
    int len_a = Sa.size();
    int len_b = Sb.size();
    int len_c = Sc.size();
    int count_a = 0;
    int count_b = 0;
    int count_c = 0;
    char next = 'a';
    while(true){
        if (next == 'a'){
            if (count_a == len_a){
                cout << "A" << endl;
                break;
            }
            next = Sa[count_a];
            count_a++;
        }
        else if (next == 'b'){
            if (count_b == len_b){
                cout << "B" << endl;
                break;
            }
            next = Sb[count_b];
            count_b++;
        }
        else if (next == 'c'){
            if (count_c == len_c){
                cout << "C" << endl;
                break;
            }
            next = Sc[count_c];
            count_c++;
        }
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>
using namespace std;

int n;
int ans;
int k[101];
vector<int> a;

int main(void){
	while(1){
		cin >> n;
		if(n==0)break;
		memset(k,0,sizeof(k));
		a.clear();
		for(int i=0;i<=n;i++){
			int b;
			cin >> b;
			k[i]=b;
		}
		for(int i=0;i<=n;i++){
			a.clear();
			ans=k[i];
			for(int j=0;j<=n;j++){
				if(i!=j)a.push_back(k[j]);
			}
			bool ch=true;
			int c=a[1]-a[0];
			int s=1;
			for(int o=s;o<n;o++){
				if(c!=(a[o]-a[o-1]))ch=false;
			}
			if(ch)goto end;
		}
end:
		cout << ans << endl;
	}
    return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int s, w;
    cin >> s >> w;
    cout << (s <= w ? "unsafe" : "safe") << endl;
    return 0;
}


Measured memory_bytes: 3644
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char s[15] = {0};
    scanf("%s", s);
    int i = 0, w = 0;
    while (s[i])
    {
        if (s[i] == 'o')
        {
            w++;
        }
        i++;
    }
    if (15 - i >= 8 - w)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}

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

int main() {
  
  int n;
  cin >> n;
  
  vector<int> A(n);
  
  for (int i = 0; i < n; i++) {
    cin >> A.at(i);
  }
  
  int64_t step = 0;
  int highest = A.at(0); 
  
  for (int i = 0; i < n-1; i++) {
    if (highest < A.at(i+1) ) {
      highest = A.at(i+1);
    }
    else{
      step += highest - A.at(i+1);
    }

  }
  
  cout << step << endl;

return 0;
}

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

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

Measured memory_bytes: 256
n,k = map(int,input().split())
a = list(map(int,input().split()))
ans = float('inf')
for i in range(n-k+1):
    l = i
    r = i + k - 1
    ldis = abs(a[l])+abs(a[r]-a[l])
    rdis = abs(a[r])+abs(a[r]-a[l])
    ans = min(ans, ldis, rdis)
print(ans)

Measured memory_bytes: 14228
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int mod=1e9+7;
int fact_memo[200000],inv_memo[200000];
int extgcd(int a,int b,int&x,int&y){
	int d=a;
	if(b!=0){
		d=extgcd(b,a%b,y,x);
		y-=(a/b)*x;
	}else{
		x=1;
		y=0;
	}
	return d;
}
int mod_inverse(int a){
	int x,y;
	extgcd(a,mod,x,y);
	return(mod+x%mod)%mod;
}
int fact(int x){
	if(fact_memo[x]!=0)
		return fact_memo[x];
	if(x==0)
		return 1;
	return fact_memo[x]=fact(x-1)*x%mod;
}
int fact_inv(int x){
	if(inv_memo[x]!=0)
		return inv_memo[x];
	return inv_memo[x]=mod_inverse(fact(x));
}
int comb(int a,int b){
	return fact(a)*fact_inv(b)%mod*fact_inv(a-b)%mod;
}
int mod_pow(int x,int n){
	if(n==0)
		return 1;
	int res=mod_pow(x*x%mod,n/2);
	if(n&1)
		res=res*x%mod;
	return res;
}
signed main(){
	int n,a,b,c;
	cin>>n>>a>>b>>c;
	int ad=a*mod_inverse(a+b)%mod,bd=b*mod_inverse(a+b)%mod;
	int ans=0;
	for(int i=n;i<=2*n-1;i++){
		int A=n-1,B=i-n;
		ans=(ans+comb(A+B,B)*mod_pow(ad,A+1)%mod*mod_pow(bd,B)%mod*i%mod)%mod;
		A=i-n,B=n-1;
		ans=(ans+comb(A+B,A)*mod_pow(ad,A)%mod*mod_pow(bd,B+1)%mod*i%mod)%mod;
	}
	cout<<ans*mod_inverse(a+b)%mod*100%mod<<endl;
}


Measured memory_bytes: 4096
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <queue>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>

int main(){

  long long int N;
  scanf("%lld", &N);

  if(N == 0){
    std::cerr << "Answer: " << std::endl;
    std::cout << 0 << std::endl;
  }
  else if(N%2 == 1){
    std::cerr << "Answer: " << std::endl;
    std::cout << 0 << std::endl;
  }
  else{
    long long int n2, n5, tmp;
    // count n2
    n2 = 0;
    tmp = N;
    while(tmp > 0){
      tmp /= 2;
      n2 += tmp;
    }

    // count n5
    n5 = 0;
    tmp = N/10;
    while(tmp > 0){
      n5 += tmp;
      tmp /= 5;
    }

    std::cerr << "Answer: " << std::endl;
    std::cout << std::min(n2, n5) << std::endl;
    
  }

  return 0;
  
}


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


int main(){
  // mapでそれぞれの回数を管理
  map<string, int> S;
  // 初期化
  S["AC"] = 0;
  S["WA"] = 0;
  S["TLE"] = 0;
  S["RE"] = 0;

  int N;
  cin >> N;
  // mapに格納していく
  rep(i, N){
    string s;
    cin >> s;
    S[s]++;
  }
  // mapの内容を出力する
  cout << "AC x " << S["AC"] << endl;
  cout << "WA x " << S["WA"] << endl;
  cout << "TLE x " << S["TLE"] << endl;
  cout << "RE x " << S["RE"] << endl;
}


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

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

#define LL long long

string multiply(string nums1, string nums2) {
   int n = nums1.size();
   int m = nums2.size();
   string ans(n + m, '0');
   for(int i = n - 1; i>=0; i--){
      for(int j = m - 1; j >= 0; j--){
         int p = (nums1[i] - '0') * (nums2[j] - '0') + (ans[i + j + 1] - '0');
         ans[i+j+1] = p % 10 + '0';
         ans[i+j] += p / 10 ;
      }
   }
   for(int i = 0; i < m + n; i++){
      if(ans[i] !='0')return ans.substr(i);
   }
   return "0";
}

int main() {
	string a, b, b2;
	cin >> a >> b;

	for(int i=0;i<b.size();i++) {
		if(b[i] != '.') {
			b2 += b[i];
		}
	}

	string ans = multiply(a, b2);
	// trace(a, b2, ans);

	if(ans.size() < 3) {
		cout << 0 << endl;
		return 0;
	}

	string fin;
	for(int i=0;i<max(0, (int)ans.size() - 2);i++) {
		fin += ans[i];
	}
	cout << fin << endl;
	return 0;
}

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

int main() {
   int D;
   cin >> D;
   string s;
   if(D == 22){
    s = "Christmas Eve Eve Eve";
   }else if(D==23){
    s = "Christmas Eve Eve";
   }else if(D==24){
    s = "Christmas Eve";
   }else if(D==25){
    s = "Christmas";
   }
    cout << s << endl;
}

Measured memory_bytes: 256
N=int(input())
A=[list(map(int,input().split())) for _ in range(N)]
cnt=0
for a in A:
    if a[2]!=0:
        cnt+=1
        ans=a
if cnt==1:
    print(*ans)
    exit()
for i in range(101):
    for j in range(101):
        hi=[]
        flg=True

        for a in A:
            if a[2]!=0:
                hi_=a[2]+abs(a[1]-j)+abs(a[0]-i)
                hi.append(hi_)

            if len(hi)>=2:
                if hi[-1]!=hi[-2]:
                    flg=False
        #print(i,j,hi)
        if flg:
            ans=[i,j,hi[0]]

print(*ans)


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

using namespace std;

#define endl "\n"
#define lln long long unsigned int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

const lln MOD = 1e9 + 7;

int main(){
    IOS;

    int n;
    cin >> n;
    vector<lln> a(n);
    vector<lln> sum(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        if(i==0) sum[i] = a[i];
        else sum[i] = (a[i] + sum[i-1]) % MOD;
    }
    sum[n-1] += MOD;
    lln ans = 0;
    for(int i=0;i<n-1;i++){
        lln val = (a[i] * (sum[n-1] - sum[i])) % MOD; 
        ans = (ans + val) % MOD;
    }
    cout << ans << endl;
    return 0;    
}

Measured memory_bytes: 6288
N = int(input())
T,A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
m = -float("inf")
p = -1
for i,h in enumerate(H,1):
    t = T - (h * 6 / 1000)
    if abs(A - t) < abs(A - m):
        m = t
        p = i
print(p)

Measured memory_bytes: 9196
import sys
input = sys.stdin.readline

N = int(input())
A = [int(x) for x in input().strip().split()]
S = sum(A)
x = [0 for _ in range(N)]

x[0] = S - 2 * sum(A[1::2])
for i in range(1, N):
    x[i] = 2 * A[i-1] - x[i-1]

print(*x)

Measured memory_bytes: 14028
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >>S;
  int ans=0;
  
  for(int i=0;i<S.size();i++){
    if(S.at(i)=='+')ans++;
    else ans--;
  }
  cout<<ans<<endl;
}
  
  

Measured memory_bytes: 256