akhauriyash/Code-Regression huggingface dataset:
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)

int main()
{
    string S;
    cin >> S;
    if (count(S.begin(), S.end(), 'x') >= 8)
    {
        cout << "NO";
    }
    else
    {
        cout << "YES";
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 998244353
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
ll modpow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1) res=res*x%mod;
		x=x*x%mod;
		n>>=1;
	}
	return res;
}
ll F[1000005],R[1000005];
void make(){
	F[0] = 1;
	for(int i=1;i<1000005;i++) F[i] = F[i-1]*i%mod;
	for(int i=0;i<1000005;i++) R[i] = modpow(F[i],mod-2);
}
ll C(int a,int b){
	if(a<b || 0>b) return 0LL;
	return F[a]*R[b]%mod*R[a-b]%mod;
}
int main(){
	int n,k;
	cin>>n>>k;
	make();
	ll ans = 0;
	for(int i=0;i<=k;i++){
		//R-B = i
		if(i%2 != k%2) continue;
		if(i >= n){
			//all ok
			ans += C(k,(k-i)/2);
		}
		else if(i){
			//B = (k-i)/2 - (n-i) ga max
			if((k-i)/2-(n-i) < 0) continue;
			//R-B >= (n-i)-(k-i)/2
			ans += C(k,(k-i)/2) - C(k,n-i-1);
		}
		else{
		    //last B
		    //k -> k-1
		    //i -> i+1
		    if(k/2 < n) continue;
		    ans += C(k-1,(k-i)/2-1) - C(k-1,n-i-1-1);
		}
	}
	cout << (ans%mod+mod)%mod << endl;
}

Measured memory_bytes: 15872
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m;
  cin >> n >> m;
  vector<long>x(n);
  vector<long>y(m);
  int i,j;
  long const mod = 1000000007;
  for(i=0;i<n;i++){
    cin >> x[i];
  }
  for(j=0;j<m;j++){
    cin >> y[j];
  }
  long xx = 0;
  long yy = 0;

  long tmp = n-1;
  i= 0;
  j = n-2;
  while(i<=j){
    xx += (x[i+1]-x[i])*tmp;
    if(i!=j)xx += (x[j+1]-x[j])*tmp;
    tmp += j-i-1;
    i++;
    j--;

    xx%=mod;
  }

  tmp = m-1;
  i= 0;
  j = m-2;
  while(i<=j){
    yy += (y[i+1]-y[i])*tmp;
    if(i!=j)yy += (y[j+1]-y[j])*tmp;
    tmp += j-i-1;
    i++;
    j--;

    yy%=mod;
  }

  cout << xx*yy%mod << endl;

}


Measured memory_bytes: 1792
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include "bits/stdc++.h"
#include <unordered_set>
#include <unordered_map>
#include <random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
const int dx[4]={ 1,0,-1,0 };
const int dy[4]={ 0,1,0,-1 };

int N;
ll A[80];

signed main(){
    cin >> N;
    rep(i, N) cin >> A[i];

    ll ans = 1000;
    ll cnt = 0;
    rep(i, N){
        ans += cnt*A[i];
        cnt = 0;
        if(i != N-1 && A[i] < A[i+1]){
            cnt = ans / A[i];
            ans -= cnt*A[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3620
//#pragma GCC target("avx2")
#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int n, q;
    cin >> n >> q;

    string s;
    cin >> s;

    vector<char> l(q), d(q);
    REP(i, q) cin >> l[i] >> d[i];

    //left
    int ok = -1, ng = s.size();
    while (ng - ok > 1) {
        int mid = (ng + ok) / 2;

        int cur = mid;
        REP(i, q) {
            if (s[cur] != l[i]) continue;

            if (d[i] == 'L') cur--;
            else cur++;

            if (cur == -1 || cur == s.size()) break;
        }

        if (cur == -1) ok = mid;
        else ng = mid;
    }

    ll ans = ok + 1;

    // right
    reverse(ALL(s));
    ok = -1, ng = s.size();
    while (ng - ok > 1) {
        int mid = (ng + ok) / 2;

        int cur = mid;
        REP(i, q) {
            if (s[cur] != l[i]) continue;

            if (d[i] == 'L') cur++;
            else cur--;

            if (cur == -1 || cur == s.size()) break;
        }

        if (cur == -1) ok = mid;
        else ng = mid;
    }

    ans += ok + 1;

    print(n - ans);
}


Measured memory_bytes: 3944
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;
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; }
const ll INF = 1LL << 60;
#define MOD 1000000007
#define MAX_V 100010
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}

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

ll junnretu(ll n){
    ll ans=1;
    for (ll i=1;i<=n;i++){
        ans*=i;
    }
    return ans;
}

map<ll,ll> prime_factor(ll n){
    map<ll,ll> mp;
    for(ll i=2; i*i<=n; i++){
        while(n % i == 0){
            mp[i]++;
            n /= i;
        }
    }
    if(n != 1) mp[n] = 1;
    return mp;
}

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}
ll h,n;
ll a[30000],b[30000];
ll dp[30000];
int main(){
    ll ans=INF;
    cin >> h >> n;
    for (ll i=0;i<n;i++){
        cin >> a[i] >> b[i];
    }
    fill(dp,dp+30000,INF);
    dp[0]=0;
    for (ll i=0;i<h;i++){
        for (ll j=0;j<n;j++){
            chmin(dp[i+a[j]],dp[i]+b[j]);
        }
    }
    for (ll i=h;i<30000;i++){
        ans=min(ans,dp[i]);
    }
    cout << ans << endl;
    return 0;
}






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

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;
typedef long long LL;
using Graph = vector<vector<int>>;

static long long INF = (1LL<<62);

int N;
string S;

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N;
	cin >> S;

	string s;
	for(int i=0; i<S.size(); i++){
		if(S[i] == '('){
			s.push_back(S[i]);
		}
		else{
			if(s[s.size()-1] == '('){
				s.pop_back();
			}
			else{
				s.push_back(S[i]);
			}
		}
	}
	if(s[0] == '('){
		printf("%s", S.c_str());
		for(int i=0; i<s.size(); i++){
			printf(")");
		}
		printf("\n");
		return 0;
	}
	else{
		int c1 = 0, c2 = 0;
		for(int i=0; i<s.size(); i++){
			if(s[i] == ')'){
				c1++;
			}
			else{
				c2++;
			}
		}
		for(int i=0; i<c1; i++){
			printf("(");
		}
		printf("%s", S.c_str());
		for(int i=0; i<c2; i++){
			printf(")");
		}
		printf("\n");
		return 0;
	}
	return 0;
}

Measured memory_bytes: 3740
#include<bits/stdc++.h>
#define INF 2147483647
#define SYOU(x) setprecision(x)
using namespace std;
int i[1111111];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c,d=0,e,f;
  string s;
  cin >>s;
  if(s[0]==s[1]){
    if(s[2]==s[3]) d++;
  }
  if(s[0]==s[2]){
    if(s[1]==s[3]) d++;
  }
  if(s[0]==s[3]){
    if(s[1]==s[2]) d++;
  }
  if(s[0]==s[1]&&s[0]==s[2]) d=0;
  if(d>0) cout <<"Yes\n";
  else cout <<"No\n";
  return (0);
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  long long n,a,b;
  cin>>n>>a>>b;
    long long ans=a*(n/(a+b));
    ans+=min(n%(a+b),a);
  if(a==0)
    ans=0;
    cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
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; }


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

    int num = s<1e9 ? s+1 : s-1;
    vector<int> res(n, num);
    rep(i, k) res[i] = s;

    for(int m: res) cout << m << " ";
    cout << ln;
}


Measured memory_bytes: 1664
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main() {
	char a, b,output;
	scanf("%c %c", &a, &b);
	if (a < b)output = '<';
	else if (a == b) output = '=';
	else output = '>';

	printf("%c", output);
	return 0;
	
}

Measured memory_bytes: 128
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
count=0
all=sum(B)-sum(A)
for a,b in zip(A,B):
   if a>b:count -=a-b
   elif b>a:count +=(b-a)//2

print("Yes" if count>=0 else "No")

Measured memory_bytes: 4596
a, b = map(int, input().split())
a = str(a)
b = str(b)
count = 0
c = int(a)
d = int(b)
for i in range(c, d + 1):
    i = str(i)
    if i[0] == i[4] and i[1] == i[3]:
        count += 1
print(count)

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

N,M=map(int,input().split())
L=[]
PL=[2**x for x in range(N)]
for i in range(M):
    cost,_=map(int,input().split())
    k=sum([PL[i-1] for i in map(int,input().split())])
    L.append((cost, k))

p=2**N
dp=[10**7]*p
dp[0]=0
for i in range(M):
    cost, k=L[i]
    for j in range(p):
        m=j|k
        dp[m]=min(dp[m],dp[j]+cost)
print(dp[-1] if dp[-1]<10**7 else -1)

Measured memory_bytes: 3316
import java.util.*;

class Main{
  public static void main(String args[]){
    Scanner scan = new Scanner(System.in);
    int y = scan.nextInt();
    int x = scan.nextInt();
    int[] ignorey = new int[y];
    int[] ignorex = new int[x];
    char[][] board = new char[y][x];
    String a = "takagi";
    for(int i = 0; i < y;i++){
      a = scan.next();
      for(int j = 0;j<x;j++){
        board[i][j] = a.charAt(j);
      }
    }

    for(int i = 0;i < y ;i++){
      for(int j = 0;j<x;j++){
        if(!(board[i][j] == '.')){
          break;
        }
        if(j == x-1){
          ignorey[i] = 1;
        }
      }
    }
    for(int i = 0;i < x ;i++){
      for(int j = 0;j<y;j++){
        if(!(board[j][i] == '.')){
          break;
        }
        if(j == y-1){
          ignorex[i] = 1;
        }
      }
    }
    for (int i = 0;i < y;i++) {
      if(ignorey[i] == 1){
        continue;
      }
      for (int j = 0;j < x ;j++) {
        if(ignorex[j] == 1){
          continue;
        }
        System.out.print(board[i][j]);
      }
      System.out.println();
    }
  }
}


Measured memory_bytes: 27220
# coding: utf-8
import sys


# 標準入力
n = int(sys.stdin.readline().strip())
aArray = list(map(int, sys.stdin.readline().strip().split(" ")))


# aArrayから最大となるコンビネーションの組を探し出す
sortedArray = sorted(aArray)
maxNum = max(aArray)
idealHalfNum = maxNum / 2

i = 0
while abs(idealHalfNum - sortedArray[i]) > abs(idealHalfNum - sortedArray[i+1]):
    i = i + 1

# 標準出力
print(maxNum, sortedArray[i])


Measured memory_bytes: 14060
import Data.List (foldl')
import Data.Array

main :: IO ()
main = do
  s <- read <$> getLine
  let
    f a = if a `mod` 2 == 0 then a `div` 2 else 3 * a + 1
    cs = fmap iter [0..1000000] where
      memo = listArray (0, 1000000) $ fmap iter [0..1000000]
      iter 0 = s
      iter i = f $ memo ! (i - 1)
    step (ts, True) _ = (ts, True)
    step (ts, _) a = (a : ts, a `elem` ts)
    n = length $ fst $ foldl' step ([], False) cs
  print n


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

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
            int a = line[0], p = line[1];

            p += a * 3;

            Console.WriteLine($"{p/2}");
        }
    }
}

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

#include <set>
#include <map>
#include <iomanip>

using namespace std;

#define rep(i, n) for(long long i = 0; i < (long long)(n); i++)
#define all(x) (x).begin(),(x).end()

using ll = long long;

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

	double ans = 0;
	rep(i, N)
	{
		double A;
		cin >> A;

		ans += 1.0 / A;
	}

	ans = (1.0 / ans);

	cout << setprecision(20) << ans << endl;

	return 0;
}

Measured memory_bytes: 256
def cal(N, i):
    if N > 0:
        return 2 * cal(N - 1, i) + i
    elif N == 0:
        return 1
    else:
        return 0

def pCal(N ,X):
    total = cal(N, 3)
    half = total // 2
    pTmp = cal(N - 1, 1)
    if X == 1 and N == 0:
        return 1
    elif X <= N:
        return 0
    elif X < half:
        return pCal(N - 1, X - 1)
    elif X == half:
        return pTmp
    elif X == half + 1:
        return pTmp + 1
    elif total > X > half + 1:
        return (pTmp + 1) + pCal(N - 1, X - (half + 1))
    elif X == total:
        return cal(N, 1)
N, X = list(map(int, input().split()))
print(pCal(N, X))

Measured memory_bytes: 3064
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	string s;
	cin>>s;
	while(!s.empty()){
		s.pop_back();
		int n=s.size();
		if(n&1) continue;
		bool nuee=0;
		for(int i=0; i<n/2; i++){
			if(s[i]!=s[i+n/2]){
				nuee=1;
				break;
			}
		}
		if(!nuee){
			cout<<n<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#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 INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  int n, m;
  cin >> n >> m;
  int ans = (n * (n-1)/2) + (m * (m-1)/2);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
int min(int a,int b)
{
	if(a<b)
		return a;
	else
		return b;
}
int main()
{
	int n,t,i,pos,old,ans=0;
	scanf("%d%d",&n,&t);
	int min_pic=0x3f3f3f3f,max_value=0;
	for(i=0;i<n;i++)
	{
		scanf("%d",&pos);
		if(i==0)
		{
			min_pic=pos;
			old=pos;
		}
		else
		{
			if(pos>old)
			{
				if(pos-min_pic>max_value)
				{
					max_value=pos-min_pic;
					ans=1;
				}
				else if(pos-min_pic==max_value)
					ans++;
			}
			else
				old=pos;
			if(min_pic>pos)
				min_pic=pos;
		}
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 128
#include <cstdio>
#include <cmath>
using namespace std;

double q;

int main() {
  while (1) {
    scanf("%lf", &q);
    if (q == -1.0) return 0;
    
    double ans = q/2;
    while (abs(ans*ans*ans - q) >= 1e-5*q) {
      ans = ans - (ans*ans*ans-q)/(3*ans*ans);
    }

    printf("%f\n", ans);
  }
}

Measured memory_bytes: 2616
import java.util.Scanner;

public class Main {

	void run() {
		Scanner sc = new Scanner(System.in);

		while (sc.hasNext()) {
			double a = sc.nextInt();
			double b = sc.nextInt();
			double c = sc.nextInt();
			double d = sc.nextInt();
			double e = sc.nextInt();
			double f = sc.nextInt();

			// 連立方程式の解
			double x = (b * f - c * e) / (b * d - a * e);
			double y = (c * d - a * f) / (b * d - a * e);

			if (x == 0)
				x = 0;
			if (y == 0)
				y = 0;

			System.out.printf("%.3f %.3f\n", x, y);

			// BigDecimal ax = new BigDecimal(x);
			// BigDecimal ay = new BigDecimal(y);
			//
			// // 小数第4位を四捨五入
			// ax = ax.setScale(3, BigDecimal.ROUND_HALF_UP);
			// ay = ay.setScale(3, BigDecimal.ROUND_HALF_UP);
			//
			// System.out.println(ax + " " + ay);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

}

Measured memory_bytes: 18180
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <map>
#include <string>
#include <vector>
 
using namespace std;
 
int main()
{
    int n, k;
    cin >> n >> k;
    int *p = new int[n];
 
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
 
    int *e = new int[k];
    int now_e = 0;
    int max_e = 0;
 
    for (int i = 0; i < k; i++) {
        e[i] = p[i] + 1;
        now_e += e[i];
    }
    max_e = now_e;
    for (int i = k; i < n; i++) {
        int tmp = e[i%k];
        e[i%k] = p[i] + 1;
        if (tmp > e[i%k]) {
            now_e -= (tmp - e[i%k]);
        }
        else {
            now_e += (e[i%k] - tmp);
        }
        if (max_e < now_e) {
            max_e = now_e;
        }
    }
    printf("%.10f\n", (double)max_e / 2);
 
    delete[] e;
    delete[] p;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
  if(a==1) {
    a=14;
  }
  if(b==1) {
    b=14;
  }
    if (a>b) {
        cout << "Alice" << endl;
    }
    else if (a<b) {
        cout << "Bob" << endl;
    }
    else if (a=b) {
        cout << "Draw" << endl;
    }
    return 0;
}


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

int main(){
    Int M ; cin >> M;
    vector<Int>d(M), c(M); Int sum = 0;
    for(int i = 0; i < M;++i) cin >> d[i] >> c[i], sum += d[i] * c[i];
    cout << accumulate(c.begin(),c.end(),0LL) - 1+ (sum-1)/9 << endl;
}



Measured memory_bytes: 3328
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
using namespace std;

int main() {
    string a;
    cin >> a;
    bool d = false;
    for (int i = 0; i < 3; i++) {
        if (a.at(i) == '7')d = true;
    }
    if (d)cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3596
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

ll N, K;
vector<int> A;
map<ll, ll> mp;

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

  vector<ll> route;
  ll loop_begin = 0;
  ll loop_num = 0;
  ll pos = 0;
  ll cnt = 0;
  route.push_back(pos);
  mp[pos] = cnt;
  while (true) {
    pos = A[pos];
    cnt++;
    if (cnt == K) {
      cout << (pos + 1) << endl;
      return 0;
    }
    if (mp.find(pos) != mp.end()) {
      loop_begin = mp[pos];
      loop_num = cnt - loop_begin;
      break;
    }
    route.push_back(pos);
    mp[pos] = cnt;
  }

  ll ans_pos = (K - loop_begin) % loop_num;
  ll ans = route[loop_begin + ans_pos];
  cout << ans + 1 << endl;
  return 0;
}


Measured memory_bytes: 14844
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define N 100005
#define pb push_back
int main()
{

	int n,i,count1=0,count2=0;
	cin>>n;
	vector<int> p(n);
	vector <int> q(n);
	vector<int> a(n);
	vector<int> b(n);
	for(i=0;i<n;i++)
		cin>>p.at(i);
	for(i=0;i<n;i++)
		cin>>q.at(i);
    for(i=1;i<=n;i++)
    	{a.at(i-1)=i;
    	  b.at(i-1)=i;}
   do{
   	    if(a!=p)
   	    	count1++;
   	    else
   	    	break;
   }while(next_permutation(a.begin(),a.end()));
   do{
   	    if(b!=q)
   	    	count2++;
   	    else
   	    	break;
   }while(next_permutation(b.begin(),b.end()));
   cout<<abs(count2-count1);
}

Measured memory_bytes: 256
class vertex(object):
    def __init__(self,a):
        self.x=a[0]
        self.y=a[1]
class circle(object):
    def __init__(self,p,r):
        self.px=p.x
        self.py=p.y
        self.r=r
class triangle(object):
    def __init__(self,a,b,c):
        self.a=a
        self.b=b
        self.c=c
        import math
        self.ab=math.sqrt((self.a.x-self.b.x)**2+(self.a.y-self.b.y)**2)
        self.bc=math.sqrt((self.b.x-self.c.x)**2+(self.b.y-self.c.y)**2)
        self.ca=math.sqrt((self.c.x-self.a.x)**2+(self.c.y-self.a.y)**2)
        c=self.ab
        a=self.bc
        b=self.ca
        self.cosA=(b**2+c**2-a**2)/(2*b*c)
        self.cosB=(a**2+c**2-b**2)/(2*a*c)
        self.cosC=(b**2+a**2-c**2)/(2*b*a)
        self.sinA=math.sqrt(1-self.cosA**2)
        self.sinB=math.sqrt(1-self.cosB**2)
        self.sinC=math.sqrt(1-self.cosC**2)
        self.sin2A=2*self.sinA*self.cosA
        self.sin2B=2*self.sinB*self.cosB
        self.sin2C=2*self.sinC*self.cosC
    def area(self):
        import math
        s=(self.ab+self.bc+self.ca)/2
        S=math.sqrt(s*(s-self.ab)*(s-self.bc)*(s-self.ca))
        return S
    def circumscribed(self):
        R=self.ab/(2*self.sinC)
        px=(self.sin2A*self.a.x+self.sin2B*self.b.x+self.sin2C*self.c.x)/(self.sin2A+self.sin2B+self.sin2C)
        py=(self.sin2A*self.a.y+self.sin2B*self.b.y+self.sin2C*self.c.y)/(self.sin2A+self.sin2B+self.sin2C)
        px=round(px,3)
        py=round(py,3)
        R=round(R,3)
        p=vertex((px,py))
        return circle(p,R)
n=eval(input())
p1=[]
p2=[]
p3=[]
for i in range(n):
    a,b,c,d,e,f=list(map(float,input().split()))
    p1.append(vertex((a,b)))
    p2.append(vertex((c,d)))
    p3.append(vertex((e,f)))
for i in range(n):
    Triangle=triangle(p1[i],p2[i],p3[i])
    Circle=Triangle.circumscribed()
    print('%.3f %.3f %.3f'%(Circle.px,Circle.py,Circle.r))

Measured memory_bytes: 7704
import math

A, B ,H, M = map(int, input().split())
C = 0

s = abs(30*H + 0.5*M - 6*M)
if(s > 180):
    s = 360-s

C = A*A + B*B - 2*A*B*math.cos(math.radians(s))

print(math.sqrt(C))


Measured memory_bytes: 9496
N,M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
threshold = float(sum(A) / (4 * M))
cnt=0
for i in A:
  if i >= threshold:
    cnt += 1
if cnt >= M:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int M=1000000007;
const int inv2=(M+1)/2;
int dp[5005][5005],inv[5005],p2[5005],s[5005],n,m;
void add(int &x,int y){x+=y;if (x>=M)x-=M;}

int solve(int x,int y){
	if (x==n) return 1;
	if (dp[x][y]!=-1) return dp[x][y];
	int ret=1ll*solve(x+1,y)*(y+1)%M;
	for (int k=2;k<=y;k++) add(ret,1ll*p2[k-2]*(y+1-k)%M*solve(x+1,y+1-k)%M);
	return dp[x][y]=ret;
}
int main(){
	cin >> n >> m;
	p2[0]=1; for (int i=1;i<=5000;i++) p2[i]=p2[i-1]*2%M;
	inv[0]=1; for (int i=1;i<=5000;i++) inv[i]=1ll*inv[i-1]*inv2%M;
	for (int i=1;i<=m;i++) dp[n][i]=1;
	for (int i=n-1;i>=0;i--){
        for (int j=1;j<=m;j++){
            s[j]=s[j-1];
            add(s[j],1ll*inv[j]*j%M*dp[i+1][j]%M);
        }
        for (int j=1;j<=m;j++){
            dp[i][j]=1ll*(j+1)*dp[i+1][j]%M;
            add(dp[i][j],1ll*p2[j-1]*s[j-1]%M);
        }
	}
	cout << dp[0][m] << endl;
}


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

int main(){
    
    ll ans = 1;
    ll A, B;
    cin >> A >> B;
    char c;
    for(ll i = 0; i < A; i++){
        cin >> c;
        if(!('0' <= c && c <= '9'))ans = 0;
    }
    cin >> c;
    if(c != '-')ans = 0;
    for(ll i = 0; i < B; i++){
        cin >> c;
        if(!('0' <= c && c <= '9'))ans = 0;
    }
    if(ans)cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <sstream>
#include <cstdlib>
using namespace std;
int main(){
	int n,A[101],i,flag,j,con=0;
	cin>>n;
	for(i=0;i<n;i++){
		cin>>A[i];
	}
	flag=1;
	while(flag){
		flag=0;
		for(j=n-1;j>0;j--){
			if(A[j]<A[j-1]){
				swap(A[j],A[j-1]);
				flag=1;
				con++;
			}
		}
	}
	for(i=0;i<n;i++){
		if(i==n-1)cout<<A[i]<<endl;
		else cout<<A[i]<<" ";
	}
	cout<<con<<endl;
	return 0;
}


Measured memory_bytes: 3072
arr = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = $stdin.gets.to_i
puts arr[n-1]

Measured memory_bytes: 1788
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
  int n;
  cin >> n;
  int a, b;
  ll x = 1, y = 1;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;

    ll j = max((a + x - 1) / a, (b + y - 1) / b);

    x = a * j;
    y = b * j;
  }

  cout << x + y << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int k = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        if ((500 * k) >= x) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
}


Measured memory_bytes: 35624
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<climits>
#include<iostream>
#include<sstream>
#include<utility>
#include<map>
#include<vector>
#include<queue>
#include<algorithm>
#include<set>
#include<stack>
#include<functional>
using namespace std;
typedef long long ll;
typedef pair<int,int>P;
typedef vector<vector<int>> MX;

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

vector<ll>X;

int main()
{
	ll N,A,B;
	cin>>N>>A>>B;
	for(int i=0;i<N;i++)
	{
		ll a;
		cin>>a;
		X.push_back(a);
	}
	vector<ll>C(N,0);
	for(int i=1;i<N;i++)
	{
		C[i]=C[i-1]+min((X[i]-X[i-1])*A,B);
	}
	cout<<C[N-1]<<endl;
}


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

int main() {
  int N, L, i;
  cin >> N >> L;
  string sum;
  vector<string> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  for (int i = 0; i < N; i++) {
    sum += vec.at(i);
  }
  cout << sum << endl;
}

Measured memory_bytes: 3596
// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, 1, -1};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int N, board[300][300];
 
int solve(int row, int col) {
    int res = 0;
    for(int k=0; k<6; k++) {
        int x = row, y = col, cons = 0;
        while(x >= 0 and x < N and y >= 0 and y < N) {
            if(board[x][y] > 0) cons++;
            else chmax(res, cons), cons = 0;
            x += dx[k], y += dy[k];
        }
        chmax(res, cons);
    }
    return res;
}

signed main() {
    while(cin >> N, N) {
        for(int i=0; i<N; i++) {
            for(int j=0; j<N; j++) {
                char c; cin >> c;
                board[i][j] = c - '0';
            }
        }

        int ans = 0;
        for(int i=0; i<N; i++) {
            chmax(ans, solve(i, 0));
            chmax(ans, solve(0, i));
            chmax(ans, solve(N-1, i));
            chmax(ans, solve(i, N-1));
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3692
#include "bits/stdc++.h"
    using namespace std;
    //#define MOD 1000000007
    //#define MOD 998244353
    #define MOD 2019
    const double EPS = 1e-9;
    #define INF (1LL<<60)
    #define D double
    #define fs first
    #define sc second
    #define int long long
    #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
    #define RFOR(i,a,b) for(int i = (int)(b-1);i>=(int)(a);--i)
    #define REP(i,n)  FOR(i,0,(n))
    #define RREP(i,n) RFOR(i,0,(n))
    #define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
    #define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
    #define range(i,a,b) ((a)<=(i) && (i)<(b))
    #define debug(x)  cout << #x << " = " << (x) << endl;
    #define SP << " " << 
    typedef pair<int,int> P;
    typedef vector<int> vec;
    typedef vector<vector<int>> mat;
     
    signed main(){
      ios::sync_with_stdio(false);
      cin.tie(0);
      cout.precision(20);
     
      int n;
      cin >> n;
      vector<int> a(n);
      REP(i,n) cin >> a[i];
      
      int all = abs(a[0]);
      REP(i, n - 1){
        all += abs(a[i + 1] - a[i]);
      }
      all += abs(a[n - 1]);

      vec b(n + 2);
      b[0] = 0; b[b.size() - 1] = 0;
      REP(i, n) b[1 + i] = a[i];

      FOR(i, 1, n + 1){
        cout << all + abs(b[i - 1] - b[i + 1]) - ( abs(b[i] - b[i - 1]) + abs(b[i] - b[i + 1] )) << endl; 
      }

      return 0;
    }

Measured memory_bytes: 2816
N = int(input())
x = {}
for _ in range(N):
    s = input()
    if s in x:
        x[s] += 1
    else:
        x[s] = 1

maxcount = max(x.values())
ans = []
for s, count in x.items():
    if count == maxcount:
        ans.append(s)
ans.sort()
for a in ans:
    print(a)

Measured memory_bytes: 35280
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	N := getInt()
	ans := 0
	for k := 1; k <= N; k++ {
		n := N / k
		ans += n * (n + 1) / 2 * k
	}
	out(ans)
}


Measured memory_bytes: 1788
import math

EPS = 1e-10

def equals(a, b):
    return abs(a - b) < EPS


class Point:
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y

    def __add__(self, p):
        return Point(self.x + p.x, self.y + p.y)

    def __sub__(self, p):
        return Point(self.x - p.x, self.y - p.y)

    def __mul__(self, a):
        return Point(self.x * a, self.y * a)

    def __rmul__(self, a):
        return self * a

    def __truediv__(self, a):
        return Point(self.x / a, self.y / a)

    def norm(self):
        return self.x * self.x + self.y * self.y

    def abs(self):
        return math.sqrt(self.norm())

    def __lt__(self, p):
        if self.x != p.x:
            return self. x < p.x
        else:
            return self.y < p.y

    def __eq__(self, p):
        return equals(self.x, p.x) and equals(self.y, p.y)


def dot(a, b):
    return a.x * b.x + a.y * b.y


def cross(a, b):
    return a.x * b.y - a.y * b.x


COUNTER_CLOCKWISE = 1
CLOCKWISE = -1
ONLINE_BACK = 2
ONLINE_FRONT = -2
ON_SEGMENT = 0


def ccw(p0, p1, p2):
    a = p1 - p0
    b = p2 - p0
    if cross(a, b) > EPS:
        return COUNTER_CLOCKWISE
    if cross(a, b) < -EPS:
        return CLOCKWISE
    if dot(a, b) < -EPS:
        return ONLINE_BACK
    if a.norm() < b.norm():
        return ONLINE_FRONT
    return ON_SEGMENT


def andrewScan(s):
    n = len(s)
    if n < 3:
        return s
    u = []
    l = []
    s.sort()
    u.append(s[0])
    u.append(s[1])
    l.append(s[-1])
    l.append(s[-2])

    for i in range(2, n):
        for m in range(len(u), 1, -1):
            if ccw(u[m-2], u[m-1], s[i]) != COUNTER_CLOCKWISE:
                break
            u.pop()
        u.append(s[i])

    for i in range(n-3, -1, -1):
        for m in range(len(l), 1, -1):
            if ccw(l[m-2], l[m-1], s[i]) != COUNTER_CLOCKWISE:
                break
            l.pop()
        l.append(s[i])

    l.reverse()
    l.extend(u[-2:0:-1])
    return l


if __name__ == '__main__':
    n = int(input())
    g = []
    for i in range(n):
        x, y =  [int(v) for v in input().split()]
        g.append(Point(x, y))

    ans = andrewScan(g)

    minv = ans[0]
    mini = 0
    for i in range(1, len(ans)):
        if ans[i].y < minv.y or (ans[i].y == minv.y and ans[i].x < minv.x):
            minv = ans[i]
            mini = i
    ans = ans[mini:] + ans[:mini]

    print(len(ans))
    for v in ans:
        print('{0} {1}'.format(v.x, v.y))


Measured memory_bytes: 29808
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int a, b;
	scanf("%d%d", &a, &b);
	if (a > 8 || b > 8)printf(":(\n");
	else printf("Yay!\n");

	Please AC;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
int a,b;
scanf("%5d",&a);
scanf("%5d",&b);
 if(a>b){
   printf("a > b\n",a,b);
 }
 if(a<b){
   printf("a < b\n",a,b);
 }
 if(a==b){
   printf("a == b\n",a,b);
 }
}


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

int gcd(int x, int y){
    int a,b;
    a=max(x,y);
    b=min(x,y);
    if(a%b == 0) return b;
    else return gcd(b, a%b);
}

int main(){
    int n;
    cin >> n;
    int ans;
    cin >> ans;
    for(int i=0; i<n-1; i++){
        int k;
        cin >> k;
        ans = gcd(ans, k);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3608
#include <vector>
#include <map>
#include <string>
#include <iostream>
#include <cmath>
#include <random>
#include <cctype>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define MK make_pair
#define PB push_back
#define VI vector<int>
#define VII vector<int,int>
#define MSI map<string,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define W1 while(1);
const int MOD = 1000000007;
int main()
{
	int a, b,c;
	cin >> a >> b >> c;
	if (a==b+c)
	{
		cout << "Yes" << endl;
		return 0;
	}
	else if (b == a + c)
	{
		cout << "Yes" << endl;
		return 0;
	}
	else if (c == b + a)
	{
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
//! Framework <https://github.com/vain0x/procon>

#![allow(non_snake_case)]
#![allow(unused_imports)]

use std::collections::*;

pub struct Scan(Box<dyn Iterator<Item = &'static str>>); // '

impl Scan {
    fn new() -> Self {
        let mut buf = String::new();
        let read_line = move || {
            std::io::stdin().read_line(&mut buf).unwrap();
            Box::leak(buf.split_off(0).into_boxed_str()).split_whitespace()
        };
        Scan(Box::new(std::iter::repeat_with(read_line).flatten()))
    }

    pub fn word<T: std::str::FromStr>(&mut self) -> T {
        self.0.next().unwrap().parse().ok().unwrap()
    }

    pub fn list<T: std::str::FromStr>(&mut self, len: usize) -> Vec<T> {
        std::iter::repeat_with(|| self.word()).take(len).collect()
    }
}

fn main() {
    let mut scan = Scan::new();

    let N = scan.word::<usize>();

    let mut ac = 0;
    let mut wa = 0;
    let mut tle = 0;
    let mut re = 0;

    for _ in 0..N {
        let s = scan.word::<String>();
        match s.as_str() {
            "AC" => ac += 1,
            "WA" => wa += 1,
            "TLE" => tle += 1,
            "RE" => re += 1,
            _ => unreachable!(),
        }
    }

    println!("AC x {}", ac);
    println!("WA x {}", wa);
    println!("TLE x {}", tle);
    println!("RE x {}", re);
}


Measured memory_bytes: 5252
t=int(input())
a=[[0 for i in range(3)] for j in range(t)]
res=0
for i in range (t):
  a[i][0],a[i][1],a[i][2]=list(map(int, input().split()))
 
   
dp = [[0] * 3 for _ in range(t + 1)]
#for i in range(3):
#  dp[0][i]=a[0][i]
 # res=max(res,dp[0][i])
for i in range (0,t):
  for curr in range(3):
    for last in range(3):
      if last!=curr:
        dp[i+1][curr]=max(dp[i+1][curr],dp[i][last]+a[i][curr])
    
    if i==t-1:
      res=max(res,dp[i+1][curr])
      
print(res)

  
  

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

using namespace std;


#define all(c) (c).begin(),(c).end()
typedef vector <int> vi;

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n;cin>>n;
    vi v(n);
    for( int &x: v ) cin>>x;
    sort(all(v));
//    vi ac(n,0);
//    for( int i = 1 ; i < n ; i++ ) {
//        ac[i] = ac[i-1] + v[i];
//    }
    int ans = 0;
    for( int i = 0 ; i < n ; i++ )
        for( int j = i+1 ; j < n ; j++ ) {
            int lo = j;
            int hi = n;
            while( lo + 1 < hi ) {
                int mt = (lo+hi)>>1;
                if( v[i] + v[j] > v[mt] ) {
                    lo = mt;
                }
                else hi = mt;
            }
            ans += (lo-j);
        }
     cout<<ans<<"\n";
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
    int flag=0;
    long int h=0,n=0;
    long int A[100000]={};
    scanf("%ld %ld",&h,&n);
    for(int i=0;i<n;i++) scanf("%ld",&A[i]);
    for(int i=0;i<n;i++){
        h-=A[i];
        if(h<=0){
            flag=1;
            break;
        }
    }
    if(flag==1) printf("Yes");
    if(flag==0) printf("No");
    return 0;
}


Measured memory_bytes: 2512
#include<stdio.h>
#define N 101
struct card{
  char suit;
  char value;
};

int main()
{
  struct card C1[N],C2[N],C;
  int i,j,n,min,flag=0;
  char cha;

  scanf("%d%c",&n,&cha);

  for(i=0;i<n;i++){
    scanf("%c%c%c",&C1[i].suit,&C1[i].value,&cha);
  }
  for(i=0;i<n;i++){
    C2[i]=C1[i];
  }
  for(i=0;i<=n-1;i++){
    for(j=n-1;j>=i+1;j--){
      if(C2[j].value<C2[j-1].value){
	C=C2[j];
	C2[j]=C2[j-1];
	C2[j-1]=C;
      }
    }
  }
  for(i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%c%c",C2[i].suit,C2[i].value);
  }
  printf("\n");

  printf("Stable\n");

  for(i=0;i<=n-1;i++){
    min=i;
    for(j=i;j<=n-1;j++){
      if(C1[j].value<C1[min].value){
	min=j;
      }
    }
    C=C1[i];
    C1[i]=C1[min];
    C1[min]=C;
  }
  for(i=0;i<n;i++){
    if(i>0)
      printf(" ");
    printf("%c%c",C1[i].suit,C1[i].value);
    
    if(!(C1[i].suit==C2[i].suit&&C1[i].value==C2[i].value)) flag=1;
    
  }
  printf("\n");

  if(flag==1) printf("Not stable\n");
  else printf("Stable\n");

  return 0;
}

Measured memory_bytes: 612
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pii pair<int,int>
#define pb push_back
const int maxn = 1e5 + 5;
int a[maxn];
int main()
{
    ios::sync_with_stdio(false);
    ll a , b , c; cin >> a >> b >> c;
    if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0){
        cout << 0 << endl;
        return 0;
    }
    cout << min (a * b , min(a * c , b * c)) <<endl;
    return 0;
}


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

using namespace std;

int main()
{
    int n;
    cin >> n;
    int x=2*n;
    string s, p;
    cin >> s >> p;
    for(int i=0;i<n;i++){
        cout<<s[i]<<p[i];
    }
    cout<<endl;
    return 0;
}

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

class Program
{
    public static void Main( )
    {
        var AB = Console.ReadLine( ).Split( );
        long A = long.Parse( AB[ 0 ] );
        decimal B = decimal.Parse( AB[ 1 ] );
        var ans =  Math.Floor(  A * B );
        Console.WriteLine( ans );

    }


}



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

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    
    sort(arr.begin(), arr.end());
    int arrMax = arr.back();
    vector<int> dp(arrMax + 1, true);
  
    int count = 0;
    for (int i = 0; i < n; i++) {
        int a = arr[i];
        if (dp[a]) {
            for (int j = 0; j * a <= arrMax; j++) {
                dp[j * a] = false;
            }
            if (i == n - 1 || a != arr[i + 1]) {
                count++;
            }
        }
    }
    cout << count;
}


Measured memory_bytes: 7936
#include <iostream>
#include <string>
#include <algorithm>


using namespace std;

int main(void) {
	int N, A[100001], tmp;

	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> tmp;
		A[tmp] = i;
	}

	for (int i = 1; i < N; i++) {
		printf("%d ", A[i]);
	}

	printf("%d", A[N]);

	return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
#define maxn 100020
#define rep(i,l,r) for(register int i = l ; i <= r ; i++)
#define repd(i,r,l) for(register int i = r ; i >= l ; i--)
#define rvc(i,S) for(register int i = 0 ; i < (int)S.size() ; i++)
#define rvcd(i,S) for(register int i = ((int)S.size()) - 1 ; i >= 0 ; i--)
#define fore(i,x)for (register int i = head[x] ; i ; i = e[i].next)
#define pb push_back
#define prev prev_
#define stack stack_
#define mp make_pair
#define fi first
#define se second
#define inf 0x3f3f3f3f
typedef long long ll;
typedef pair<int,int> pr;

char s[maxn];
int n;
vector <pr> edge;

bool check(){
	int rt = 1;
	if ( s[1] != '1' || s[n] != '0' ) return 0;
	rep(i,1,n - 1){
		if ( s[i] != s[n - i] ) return 0;
		if ( s[i] == '1' ){
			edge.pb(mp(rt,i + 1));
			rt = i + 1;
		}
		else{
			edge.pb(mp(rt,i + 1));
		}
	}
	return 1;
}
int main(){
	scanf("%s",s + 1);
	n = strlen(s + 1);
	if ( check() ){
		rvc(i,edge){
			printf("%d %d\n",edge[i].fi,edge[i].se);
		}
	}
	else{
		printf("-1\n");
	}
}


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

using namespace std;

long long n, a[200002], v[200002];
long long k;

bool ok (long long x) {
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    long long t = x / v[i];
    sum += max(0ll, a[i] - t);
  }
  if (sum <= k)
    return 1;
  else
    return 0;
}

int main()
{
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  for (int i = 1; i <= n; i++)
    cin >> v[i];
  sort(a + 1, a + n + 1);
  sort(v + 1, v + n + 1);
  reverse(v + 1, v + n + 1);
  long long  st = 0, dr = 0, ans;
  for (int i = 1; i <= n; i++)
    dr = max(dr, a[i] * v[i]);
  while (st <= dr) {
    long long mij = (st + dr) / 2;
    if (ok(mij)) {
      ans = mij;
      dr = mij - 1;
    }
    else
      st = mij + 1;
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 3328
#include<stdio.h>

int main(){
	int A;
	int B;
	scanf("%d %d",&A,&B);

	if(A>B){
		printf("%d",2*A-1);
	}else if(A==B){
		printf("%d",A+B);
	}else{
		printf("%d",2*B-1);
	}

	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int K,N;
    cin>>K>>N;
    vector<int> A(N);
    for(int i=0;i<N;++i)cin>>A[i];
    A.push_back(A[0]+K);
    int d = 0;
    for(int i=0;i<N;++i){
        d = max(d,A[i+1]-A[i]);
    }
    cout<<K-d<<endl;
}


Measured memory_bytes: 4848