akhauriyash/Code-Regression huggingface dataset:
fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut v : Vec<i32> = Vec::new();
    for i in 0..4 {
        v.push(s.chars().nth(i).unwrap().to_digit(10).unwrap_or(0) as i32);
    }
    let mut end = false;
    for f1 in 0..2 {
        for f2 in 0..2 {
            for f3 in 0..2 {
                let mut ans = v[0];
                if f1 == 0 {
                    ans += v[1];
                }
                else {
                    ans -= v[1];
                }
                if f2 == 0 {
                    ans += v[2];
                }
                else {
                    ans -= v[2];
                }
                if f3 == 0 {
                    ans += v[3];
                }
                else {
                    ans -= v[3];
                }
                if ans == 7 {
                    println!("{}{}{}{}{}{}{}=7", v[0], if f1==0 {'+'} else {'-'}, v[1], if f2==0 {"+"} else {"-"}, v[2], if f3==0 {"+"}  else {"-"}, v[3]);
                    end = true;
                    break;
                }
            }
            if end {
                break;
            }
        }
        if end {
            break;
        }
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <math.h>

int main(void) {

    int N = 0;
    int X = 0;

    scanf("%d", &N);

    X = (N / 1.08);

    if ((int)(X * 1.08) == N) {
        printf("%d\n", X); 
    } else if ((int)((X - 1) * 1.08) == N) {
        printf("%d\n", X - 1);
    } else if ((int)((X + 1) * 1.08) == N) {
        printf("%d\n", X + 1);
    } else {
        printf(":(\n");
    }

    return 0;
}

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

namespace TOPSIC
{
    partial class Program
    {
        static void Main(string[] args)
        {
          int N = int.Parse(Console.ReadLine());

            //入力値をスペース区切りで配列に格納
            string[] inputStr = Console.ReadLine().Split(' ');

            //入力値をintにした配列
            int[] A = new int[N];

            //入力値をintに変換
            for (int i = 0; i < N; i++)
            {
                A[i] = int.Parse(inputStr[i]);
            }

            for (int i = 0; i < N; i++)
            {
                if (A[i] % 2 == 0)
                {
                    if (A[i] % 3 != 0 && A[i] % 5 != 0)
                    {
                        Console.WriteLine("DENIED");
                        return;
                    }
                }
            }

            Console.WriteLine("APPROVED");


        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>  
using namespace std;  
  
const int N = 3000;  
  
int a,b,c,d,e,f,ans,total;  
int dp[N+10][N+10];  
  
void dfs(int sugar,int water){  
    if (dp[sugar][water]!=-1) return;  
    dp[sugar][water] = 1;  
    if (sugar*100>e*water) return;  
    if (sugar+water>f) return;  
    if (total==0 || sugar*total>ans*(sugar+water)){  
        if (water>0){  
            ans = sugar;  
            total = sugar + water;  
        }  
    }  
    dfs(sugar,water+100*a);  
    dfs(sugar,water+100*b);  
    dfs(sugar+c,water);  
    dfs(sugar+d,water);  
}  
  
int main(){  
    //freopen("F:\\rush.txt","r",stdin);  
    memset(dp,255,sizeof dp);  
    ios::sync_with_stdio(0),cin.tie(0);  
    cin >> a >> b >> c >> d >> e >> f;  
    dfs(0,0);  
    cout << total << ' '<< ans << endl;  
    return 0;  
}  

Measured memory_bytes: 35712
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

score=sum(b)

for i in range(n-1):
    if a[i]+1==a[i+1]:
        score+=c[a[i]-1]
        
print(score)
              


Measured memory_bytes: 3060
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t

#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))

int get_int2(int *a1, int *a2) {
  scanf("%d %d", a1, a2);
  return 0;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int64_t *arr, int size) {
    int i;
    for(i = 0; i < size; i++) {
        scanf("%lld", &arr[i]);
    }
    return 0;
}

#define NUM_MAX 100000
#define DIVISOR 1000000007

int main(void) {
    int xs, ys;
    get_int2(&xs, &ys);
    static int64_t xrr[NUM_MAX];
    static int64_t yrr[NUM_MAX];
    fget_array(xrr, xs);
    fget_array(yrr, ys);
    
    int i;
    int64_t prev = xrr[0];
    int64_t ans_x = 0;
    for(i = 1; i < xs; i++) {
        int64_t cur = xrr[i];
        int64_t res = cur-prev;
        res = (res * i)%DIVISOR;
        res = (res * (xs-1-i+1))%DIVISOR;
        ans_x = (ans_x + res)%DIVISOR;
        prev = cur;
    }

    prev = yrr[0];
    int64_t ans_y = 0;
    for(i = 1; i < ys; i++) {
        int64_t cur = yrr[i];
        int64_t res = cur-prev;
        res = (res * i)%DIVISOR;
        res = (res * (ys-1-i+1))%DIVISOR;
        ans_y = (ans_y + res)%DIVISOR;
        prev = cur;
    }

    int64_t ans = (ans_x * ans_y)%DIVISOR;
    printf("%d\n", (int)ans);
    return 0;
}

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

int main(void){
	string str;
	int count;
	int h;

	while(true){
		cin >> str;

		if (str == "-")break;

		cin >> count;

		for (int i = 0; i < count; i++){
			cin >> h;
			
			str.append(str.begin(), str.begin() + h);
			str.erase(0, h);
		}

		cout << str << "\n";
	}	

	return 0;
}

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

using namespace std;

typedef long long ll;

int n, q;
int a[2000];
int m[2000];

bool solve(int i, int j) {
  bool r;
  if(i == n) r = false;
  else if(a[i] == j) r = true;
  else if(a[i] > j) r = solve(i+1, j);
  else r = solve(i+1, j) || solve(i+1, j - a[i]);
  return r;
}

int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> m[i];
    if(solve(0, m[i])) cout << "yes" << endl;
    else cout << "no" << endl;
  }
}

Measured memory_bytes: 3036
#include <iostream>
#include <string>
using namespace std;
int main(){
  string c;
  cin >> c;

  for(int i = 0; i < (int)c.length(); i++){
	if(c[i] == 'C'){
	  for(int j = i; j < (int)c.length(); j++){
		if(c[j] == 'F'){
		  cout << "Yes" << endl;
		  return 0;
		}
	  }
	}
  }
  cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
const ll mod = ll(1e9) + 7;
const int INF = int(1e9);
int main()
{
    int N;
    cin >> N;
    vector<int> A(N);
    vector<int> B(N);
    rep(i, N) cin >> A[i] >> B[i];
    vector<pair<int, int>> work(N);
    rep(i, N)
    {
        work[i].first = B[i];
        work[i].second = A[i];
    }
    sort(work.begin(), work.end());
    int time = 0;
    rep(i, N)
    {
        time += work[i].second;
        if (time > work[i].first)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define Pct puts("------ Yes ------");
#define rep(a, b, c) for(int a = (b); a <= (c); ++ a)
#define per(a, b, c) for(int a = (b); a >= (c); -- a)
#define fir first
#define sec second
#define ls son[u][0]
#define rs son[u][1]
#define eps 1e-8
#define PI acos(-1.0)
using namespace std;
template <class T> void rd(T &x){ x = 0; int f = 1; char ch = getchar(); while(ch < '0' || ch > '9'){ if(ch == '-') f = -1; ch = getchar(); } while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + ch - '0', ch = getchar(); x *= f; }

int du[5];

int main(){
	rep(i, 1, 3){
		int a, b; rd(a), rd(b);
		du[a] ++; du[b] ++;
	}
	sort(du + 1, du + 5);
	if(du[1] == 1 && du[2] == 1 && du[3] == 2 && du[4] == 2) puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main (String[] args) {
	Scanner scan = new Scanner(System.in);
	int a, b;
	String[] input;
	while (scan.hasNext()) {
	    input = scan.nextLine().split(" ");
	    a = Integer.parseInt(input[0]);
	    b = Integer.parseInt(input[1]);
	    System.out.println(determineDigits(a+b));
	}
    }
    static int determineDigits (int a) {
	int digits = 0;
	while (a > 0) {
	    digits ++;
	    a /= 10;
	}
	return digits;
    }
}

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

int main() {
    string s;
    cin >> s;
    int ans=s.size();
    for(int i=0;i<s.size()-1;i++){
        if(s[i]==s[i+1]){
            ans--;
            i+=2;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
N=input()
S=raw_input()
L=[0]

for i,x in enumerate(S):
	if x=="#":
		L.append( L[-1]+1 )
	else:
		L.append( L[-1] )
			

ans=float("inf")
for i in range(N+1):
	b=L[i]			# black on left
	w=N-i-(L[-1]-L[i])	# white on right
	ans=min(ans , b+w)

print ans

Measured memory_bytes: 46364
//MISHON69
//DATE:6/22/2020
#include<bits/stdc++.h>
using namespace std;
#define FOR(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
   long long n;
   cin>>n;
  long long temp1=sqrt(n);
  while(1){
    if(n%temp1==0)
    break;
    else
    temp1--;
  }
  long long temp2=n/temp1;
  cout<<(temp1+temp2)-2<<endl;
}  


Measured memory_bytes: 3648
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int N = saori.saori_hayami();
		int[] dp = new int[N+1];
		dp[0] = 0;
		dp[1] = 1;

		for(int i = 2; i <= N;i++){
			int ans = dp[i - 1] + 1;

			for(int j = 6; j <= i;j *= 6){
				if(ans > dp[i - j] + 1){
					ans = dp[i - j] + 1;
				}
			}

			for(int k = 9; k <= i;k *= 9){
				if(ans > dp[i - k] + 1){
					ans = dp[i - k] + 1;
				}
			}
			dp[i] =  ans;
		}
		System.out.println(dp[N]);
		
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

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

void fnInput(vector<int>& rvnNum)
{
  string sNum;
  cin >> sNum;

  for (int i = 0; i < rvnNum.size(); i++)
    rvnNum[i] = sNum[i] - '0';                 // char → int 変換
}

int fnBitFullSch(const vector<int>& cnrvnNum)
{
  for (int n = 0; n < (1 << 3) - 1; n++)
  {
    int nSum = cnrvnNum[0];
    for (int i = 0; i < 3; i++)
      if (n & (1 << i)) nSum += cnrvnNum[i + 1];
      else              nSum -= cnrvnNum[i + 1];

    if (nSum == 7)  return n;
  }
  return (1 << 3) - 1;                         // 必ず答えが存在するため
}
    
void fnResult(const vector<int>& cnrvnNum, int nReslt)
{
  cout << cnrvnNum[0];
  for (int i = 0; i < 3; i++)
  {
    if (nReslt & (1 << i)) cout << "+";
    else                   cout << "-";

    cout << cnrvnNum[i + 1];
  }
  cout << "=7" << endl;
}

int main()
{
  vector<int> vnNum(4);
  
  fnInput(vnNum);
  int nReslt = fnBitFullSch(vnNum);
  fnResult(vnNum, nReslt);

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(pair<int, int>a, pair<int, int>b) {
	if (a.first == b.first) {
		return a.second > b.second;
	}
	else {
		return a.first < b.first;
	}
}

int main() {
	llint a, b, c, d;
	cin >> a >> b >> c >> d;
	a--;
	llint tmp = c * d / GCD(c, d);
	llint cntc = b / c - a / c, cntd = b / d - a / d, cnttmp = b / tmp - a / tmp;
	llint ans = cntc + cntd - cnttmp;
	ans = b - a - ans;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
in n,m,q;
vector<set<in> > lofn;
set<in> rmg;
VI lat;
VI mar;
void imp(){
  cout<<"No"<<endl;
  exit(0);
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin>>n>>m;
  cin>>q;
  mar.resize(q);
  forn(i,q){
    cin>>mar[i];
    --mar[i];
  }
  lat.resize(n,q+2);
  forn(i,m)
    rmg.insert(i);
  lofn.resize(m);
  forn(i,q){
    lofn[mar[i]].insert(i);
  }
  bool isb;
  set<in>::iterator it;
  for(in i=q-1;i>=0;--i){
    if(rmg.find(mar[i])==rmg.end())
      continue;
    in u=mar[i];
    isb=(*rmg.begin()==u);
    forv(j,lat){
      it=lofn[u].upper_bound(lat[j]);
      if(it==lofn[u].begin()){
	if(!isb)
	  imp();
	if(lat[j]==-1)
	  break;
	lat[j]=-1;
	continue;
      }
      --it;
      lat[j]=*it;
      lofn[u].erase(it);
    }
    rmg.erase(u);
  }
  cout<<"Yes"<<endl;
  return 0;
}


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

#define SZ(a) int((a).size())
#define _REP(_1,_2,_3,_4,name,...) name
#define _REP4(i,b,e,s) for(decltype(e) _b=(b),_e=(e),i=_b+(0<(s)?0:(s));(0<(s)?i<_e:_e<=i);i+=(s))
#define _REP3(i,b,e) for(decltype(e) _b=(b),_e=(e),i=(_b<_e?_b:_b-1);(_b<_e?i<_e:_e<=i);(_b<_e?i++:i--))
#define _REP2(i,n) for(decltype(n) i=0,_n=(n);i<_n;i++)
#define _REP1(n) for(decltype(n) _i=0,_n=(n);_i<_n;_i++)
#define REP(...) _REP(__VA_ARGS__,_REP4,_REP3,_REP2,_REP1)(__VA_ARGS__)
#define FOR(it,c) for(auto&& it=begin(c);it!=end(c);it++)
#define ROF(it,c) for(auto&& it=rbegin(c);it!=rend(c);it++)
#define EB emplace_back
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define INT(n) int n;assert(0<scanf("%d",&n))

class union_find {
public:
  vector<unsigned int> par, rank;
  union_find(unsigned int n) {
    for(unsigned int i = 0; i < n; i++){
      par.push_back(i);
      rank.push_back(1);
    }
  }
  unsigned int root(unsigned int x){
    return par[x] == x ? x : par[x] = root(par[x]);
  }
  unsigned int getrank(unsigned int x){
    return rank[root(x)];
  }
  bool same(unsigned int x, unsigned int y){
    return root(x) == root(y);
  }
  void unite(unsigned int x, unsigned int y){
    x = root(x);
    y = root(y);
    if (x == y){return;}
    if (rank[x] < rank[y]){
      par[x] = y;
      rank[y] += rank[x];
    } else {
      par[y] = x;
      rank[x] += rank[y];
    }
  }
};

int main(){
  INT(n); INT(m);
  union_find uf(n + 1);
  REP(m){INT(a); INT(b); uf.unite(a, b);}
  set<int> s;
  REP(i, 1, n + 1){
    s.insert(uf.root(i));
  }
  int ans = s.size() - 1;
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 7904
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <functional>
#include <string>
#include <stack>
#include <queue>
#include <map>

typedef long long ll;
ll mod = 1e9 + 7;
  
using namespace std;

int main()
{
    int h, w;
    cin >> h >> w;
    vector <vector <char> > c (h, vector<char>(w));

    for(int i= 0; i < h; ++i)
    {
        for(int j = 0; j < w; ++j)
        {
            cin >> c[i][j];   
        }
    }

    vector<vector <int> > yoko (h, vector <int>(w));
    vector<vector <int> > tate (h, vector <int>(w));

    for(int i = 0; i < h; ++i)
    {
        int max = 0;
        int lastidx = 0;
        for(int j = 0; j < w; ++j)
        {
            if(c[i][j] == '.')
            {
                max++;
            }
            else
            {
                for(;lastidx < j;lastidx++)
                {
                    yoko[i][lastidx] = max;
                }
                lastidx ++;
                yoko[i][j] = 0;
                max = 0;
            }           
            if(j == w -1 && c[i][j] == '.')
            {
                for(; lastidx < w; lastidx++)
                {
                    yoko[i][lastidx] = max;
                }
            }
        }
    }

    for(int i = 0; i < w; ++i)
    {
        int max = 0;
        int lastidx = 0;
        for(int j = 0; j < h; ++j)
        {
            if(c[j][i] == '.')
            {
                max++;
            }
             else
            {
                for(;lastidx < j;lastidx++)
                {
                    tate[lastidx][i] = max;
                }
                lastidx ++;
                tate[j][i] = 0;
                max = 0;
            }           
            if(j == h -1 && c[j][i] == '.')
            {
                for(; lastidx < h; lastidx++)
                {
                    tate[lastidx][i] = max;
                }
            }         
        }
    }

    int max = 0;
    for(int i = 0; i < h; ++i)
    {
        for(int j = 0; j < w; ++j)
        {
            if(yoko[i][j] + tate[i][j] - 1 > max)
                max = yoko[i][j] + tate[i][j] - 1;
        }
    }

    cout << max << endl;

	return 0;
}

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

int main(){
  int count5 = 0, count7 = 0;
  int x;
  for ( int i = 0; i < 3; i++ ){
    cin >> x;
    if ( x == 5 ){
      count5++;
    }else if ( x == 7 ){
      count7++;
    }
  }
  
  if ( count5 == 2 && count7 == 1 ) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <sstream>

#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

#include <chrono>
#include <random>

using namespace std;
using i64 = int_fast64_t;
using ui64 = uint_fast64_t;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<i64>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<i64, i64>;

//////////////////////////////////////////////////

int main() { 
  int a, b, c;
  cin >> a >> b >> c;
  cout << (a + b + c < 22 ? "win" : "bust") << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		int[] dp = new int[n+1];
		
		for (int i = 1; i <= n; i++) {
			// 先換1元
			dp[i] = dp[i-1] + 1;
			
			// 再換6^n元
			int power6 = 6;
			while (i >= power6) {
				dp[i] = Math.min(dp[i], 1 + dp[i - power6]);
				power6 *= 6;
			}
			
			// 再換9^n元
			int power9 = 9;
			while (i >= power9) {
				dp[i] = Math.min(dp[i], 1 + dp[i - power9]);
				power9 *= 9;
			}
		}
		
		System.out.println(dp[n]);
		
	}
  
  static class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new InputStreamReader(System.in));
    }
  
    String next() { 
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException  e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    double nextDouble() { 
      return Double.parseDouble(next());
    }

    String nextLine() {
      String str = "";
        try{
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
      }
  }
}


Measured memory_bytes: 23124
n=int(input())
w=list(map(int,input().split()))
k=sum(w)
s1=w[0]
mi=abs(k-2*w[0])
for i in range(1,n-1):
    s1=s1+w[i]
    if abs(k-2*s1)<mi:
        mi=abs(k-2*s1)
print(mi)

Measured memory_bytes: 3064
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;

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

    int N;
    cin >> N;
    vector<int> A(N), B(N), C(N);
    REP(i, N) cin >> A[i];
    REP(i, N) cin >> B[i];
    REP(i, N) cin >> C[i];

    SORT(A);
    SORT(B);
    SORT(C);

    ll ans = 0;
    REP(i, N) {
        ll low = lower_bound(ALL(A), B[i]) - A.begin();
        ll top = C.end() - upper_bound(ALL(C), B[i]);
        ans += (ll)low * top;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1408
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
#define EPS (1e-5)
#define bit(n,k) ((n>>k)&1)
const ll Mod = 1000000007;
const ll mod = 998244353;
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
template<typename T, typename U>
void chmin(T &a, U b) {
	if (a > b) a = b;
}
template<typename T, typename U>
void chmax(T &a, U b) {
	if (a < b) a = b;
}
template<typename T>
T max_0(T a) {
	if (a < 0) return 0;
	return a;
}
template<typename T>
T min_0(T a) {
	if (a > 0) return 0;
	return a;
}
ll read() {
	ll u;
	ll k = scanf("%lld", &u);
	return u;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
vector<string>split(string s, char c = ' ') {
	vector<string>vec;
	string h = "";
	for (int i = 0; i < s.size();) {
		int j = i;
		while (j < s.size() && s[j] != ' ') {
			h += s[j++];
		}
		if (h.size() > 0) vec.push_back(h);
		h = "";
		i = j + 1;
	}
	return vec;
}
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
int a[200000];
int b[200000], c[200000];
signed main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (i == 0) b[i] = a[i];
		else b[i] = gcd(b[i - 1], a[i]);
	}
	for (int i = n - 1; i >= 0; i--) {
		if (i == n - 1) c[i] = a[i];
		else c[i] = gcd(c[i + 1], a[i]);
	}
	int ans = max(b[n - 2], c[1]);
	for (int i = 1; i < n-1; i++) {
		ans = max(ans, gcd(b[i - 1], c[i + 1]));
	}
	cout << ans << endl;
}

Measured memory_bytes: 3584
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

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

int main(){
    int n,m;
    cin >> n >> m;
    int a,b;
    vector<int> vec(100010,0);
    rep(i,m){
        cin >> a >> b;
        vec[a]++;
        vec[b+1]--;
    }
    reps(i,1,n){
        vec[i+1] += vec[i]; 
    }
    // rep(i,n+1){
    //     cout << vec[i] << " ";
    // }
    // cout << endl;
    int cnt = 0;
    rep(i,n+1){
        if(vec[i] == m){
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 640
/**
Author : Dhruvil Patel (Dp)
**/

#include <bits/stdc++.h>

using namespace std;

long long int gcd(long long int a , long long int b)
{
    if(b==0)
    {

        return a;
    }
    return gcd(b,a%b);


}
long long int maxix(long long int a,long long int b)
{
    if(a>b)
    {

        return a;
    }
    return b;

}
long long int minix(long long int a,long long int b)
{

    if(a<b)
    {

        return a;
    }
    return b;
}

int isprime(long long int n)
{
  if(n==1) {return 0;}
long long int c=0,i;

for(i=1;i<=sqrt(n);i++)
{
  if(n%i==0)
  {c++;}
}

  if(c==1)
  {
    return 1;
  }
  return 0;
}


void solve()
{

int n,k;
int a[100000];
cin>>n>>k;
for(int i=0;i<n;i++)
{
  cin>>a[i];

}
sort(a,a+n);
int s=0;
int i=0;
while(k--)
{
  s+=a[i];
  i++;
}

cout<<s<<endl;
}


int main()
{

  // #ifndef ONLINE_JUDGE
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  // #endif


  solve();


  return 0;
}


Measured memory_bytes: 3636
K = int(input())
A = list(map(int, input().split()))

def is_ok(arg,flg):
  # 条件を満たすかどうか？問題ごとに定義
  N0 = arg
  for a in A:
    N0 -= N0 % a
  if flg:
    return  N0 >= 2
  else:
    return  N0 <= 2
    
def meguru_bisect(ng, ok, flg):
  '''
    初期値のng,okを受け取り,is_okを満たす最小(最大)のokを返す
    まずis_okを定義すべし
    ng ok は  とり得る最小の値-1 とり得る最大の値+1
    最大最小が逆の場合はよしなにひっくり返す
  '''
  while (abs(ok - ng) > 1):
    mid = (ok + ng) // 2
    if is_ok(mid, flg):
      ok = mid
    else:
      ng = mid
    #print(ok,ng)
  return ok
      
ok,ng = K * max(A) + 100, -1
m = meguru_bisect(ok,ng,False)
#print()
ok,ng = 0, K * max(A) + 100
M = meguru_bisect(ok,ng,True)

if M <= m:
  print(M,m)
else:
  print(-1)

Measured memory_bytes: 85008
n, k = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

l = 1
r = a.max
while l < r
    m = (l + r) / 2

    sum = 0
    a.each {|e| sum += (e.fdiv(m) - 1).ceil}
    sum > k ? l = m + 1 : r = m
end

p l

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

using namespace std;

using ll = long long;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll K;
	cin >> K;
	int n = 50;
	vector<ll> ans(n);
	for (int i = 0; i < n; i++) {
		ans[i] = i + K / n;
	}
	for (int i = 0; i < K % n; i++) {
		ans[n - i - 1]++;
	}
	cout << n << endl;
	cout << ans[0];
	for (int i = 1; i < n; i++) {
		cout << " " << ans[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

const int N = 110;

int n, m, a[N][N], s[N], f[N], res;

void Check()
{
    for (int i = 1; i <= m; ++i) {
        int ct = 0;
        for (int j = 1; j <= a[i][0]; ++j) ct += f[a[i][j]];
        if (ct%2 - s[i] != 0) return;
    } ++res;
}

void Dfs(int k)
{
    for (int i = 0; i < 2; ++i) {
        f[k] = i;
        if (k == n) Check(); else Dfs(k+1);
    }
}

int main()
{
//    freopen("SWITCHES.INP", "r", stdin);
//    freopen("SWITCHES.OUT", "w", stdout);

    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) {
        scanf("%d", &a[i][0]);
        for (int j = 1; j <= a[i][0]; ++j) scanf("%d", &a[i][j]);
    }
    for (int i = 1; i <= m; ++i) scanf("%d", &s[i]);
    Dfs(1);
    printf("%d", res);

    return 0;
}


Measured memory_bytes: 256
//master
import java.io.*;
import java.util.*;

public class Main {
    static int n, m, q;
    static int[][] p;
    static int[] ans;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        String s = sc.next();
        if(s.equals("ABC")) p("ARC");
        else p("ABC");
    }

    public static <T> void p(T message) {
        System.out.println(message);
    }

    public static <T> void pe(T message) {
        System.err.println(message);
    }

    public static <T> void pp(T message) {
        System.out.print(message);
    }
    
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
 
    private int readByte() {
        if (hasNextByte())
            return buffer[ptr++];
        else
            return -1;
    }
 
    private boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
 
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }
 
    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
 
    public long nextLong() {
        if (!hasNext())
            throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
 
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }
 
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 25344
#include<stdio.h>
int main()
{
    int n, k, p[10000], i, j, a, s=0;
    scanf("%d%d",&n,&k);
    for(i=0;i<n;i++) scanf("%d",&p[i]);
    for(i=0;i<k;i++){
        for(j=i+1;j<n;j++){
            if(p[i]>p[j]){
                a = p[i];
                p[i]=p[j];
                p[j] = a;
            }
        }
    }
    for(i=0;i<k;i++){
        s+=p[i];
    }
    printf("%d\n",s);
    return 0;
}

Measured memory_bytes: 1736
using System;
using System.Linq;
using System.Collections;
namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var foo = Console.ReadLine().Trim().Split(' ');
            var N = int.Parse(foo[0]);
            var K = int.Parse(foo[1]);
            var having = new ArrayList();
            
            while(K > 0){
                var d = Console.ReadLine().Trim();
                var tmp = Console.ReadLine().Trim().Split(' ');
                foreach (var item in tmp)
                {
                    having.Add(item);
                }
                K--;
            }
            Console.WriteLine(N - having.ToArray().Distinct().Count());
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 19564
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string input;
  cin >> input;
  
  if (input[input.size() - 1] == 's')
  {
    input += "es";
  }
  else
  {
    input += "s";
  }
  
  cout << input << endl;
}

Measured memory_bytes: 3620
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstdlib>
#include<queue>
#include<map>
using namespace std;
string s,t;
int main(){
    cin>>s>>t;
    int ans=t.size();
    for (int j=0;j<=s.size()-t.size();j++){
        int pos=0;
        for(int i=0;i<t.size();i++) if(t[i]!=s[j+i]) pos++;
        ans=min(ans,pos);
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 3716
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		Scanner scan = new Scanner(System.in);
		while(true){
		//Scanner scan = new Scanner(System.in);


		int H = scan.nextInt();
	    int W = scan.nextInt();


	    if(H == 0 && W == 0)break;
	    for(int i = 1;i <= H ;i++){
	    	for(int j = 1;j <= W; j++){
	    		if((i + j)% 2 == 0){

	    			System.out.print("#");
	    		}else{

	    			System.out.print(".");
	    		}

	    	}
	    	System.out.println();

	    }

	    System.out.println();
	   }

	}
}

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

int n;
int p[101010], a[101010], b[101010];

int main() {
  cin >> n;

  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    p[i]--;
  }

  for (int i = 1; i <= n; ++i) {
    a[i - 1] = i * n;
    b[n - i] = a[i - 1];
  }

  for (int i = 0; i < n; ++i) {
    a[p[i]] += i;
  }

  for (int i = 0; i < n; ++i) {
    cout << a[i] << (i == n - 1 ? "\n" : " ");
  }
  for (int i = 0; i < n; ++i) {
    cout << b[i] << (i == n - 1 ? "\n" : " ");
  }
}


Measured memory_bytes: 896
n = int(input())
dp = [i for i in range(n + 1)]
for i in range(1, n+1):
    pow = 6
    while i - pow > -1:
        dp[i] = min(dp[i], dp[i - pow] + 1)
        pow *= 6
    pow = 9
    while i - pow > -1:
        dp[i] = min(dp[i], dp[i - pow] + 1)
        pow *= 9
# print(dp)
print(dp[n])

Measured memory_bytes: 44912
n,k=[int(i) for i in input().split()]

a_list=[int(i) for i in input().split()]
#print(a_list)

dic={}
for i in a_list:
    if i not in dic:
        dic[i]=1
    else:
        dic[i]+=1

#print(dic)
#print(len(dic))


#書き換えなくてよい    
if len(dic)<=k:
    print(0)
else:
    ans=sorted(dic.items(),key=lambda x:x[1],reverse=True)
    b_list=ans[k:]
    ans_sum=0
    for i in b_list:
        ans_sum+=i[1]
    print(ans_sum)
    


Measured memory_bytes: 42872
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

#define FOR(i, a, b) for(int (i)=(a); (i)<(b); (i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)

using namespace std;

int main() {
	int k, s;
	cin >> k >> s;
	int cnt = 0;
	IFOR(x, 0, k) {
		IFOR(y, 0, k) {
			int z = s - x - y;
			if (0 <= z && z <= k)
				cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
using System;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ss = Console.ReadLine().Split();
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);
            int c = int.Parse(ss[2]);
            int d = int.Parse(ss[3]);


            if (c <= a && b <= d)
            {
                Console.WriteLine(b - a);
            }
            else if (a <= c && d <= b)
            {
                Console.WriteLine(d - c);
            }
            else if (c <= b && b <= d && a <= c)
            {
                Console.WriteLine(b - c);
            }
            else if (c <= a && a <= d && d <= b )
            {
                Console.WriteLine(d - a);
            }
            else
            {
                Console.WriteLine(0);
            }
        }
    }
}

Measured memory_bytes: 13140
x,n = map(int, input().split())
p = set(map(int, input().split()))
a = set(range(-200, 200))
b = a - p

mi = 10**6
ans = -1
for bi in b:
    if abs(bi - x) < mi:
        mi = abs(bi - x)
        ans = bi
print(ans)

Measured memory_bytes: 9220
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <map>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


int main() {
    int a, b, c, d, ans;
    cin >> a >> b >> c >> d;
    ans = min(b, d) - max(a, c);
    if (ans < 0) cout << 0 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<math.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950


int main () {
    string s;
    cin >> s;
    string a;
    a = s;
    reverse(s.begin(), s.end());
    int t = s.size() / 2 ;
    int ans = 0;
    rep (i, t){
        if (s[i] != a[i]){
            ans++ ;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int h,w,d,t1,t2;
int main(){
	cin>>h>>w>>d;
	for(int i=1;i<=h;++i,putchar(10))
		for(int j=1;j<=w;++j){
			t1=((i-j+w)/d)&1;
			t2=((i+j)/d)&1;
			putchar((t1<<1|t2)["RYGB"]);
		}
	return 0;
}

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


int main() {
    int A[5];
    for (int i = 0; i<3; i++) {
        cin >> A[i];
    }
    sort(A, A+3);
    
    cout << A[2]*10+A[1]+A[0] << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>
#include <cmath>

using namespace std;
int main(){
    string a, b;
    cin >> a >> b;
    int c = stoi(a+b);
    string ans = "No";
    for (size_t i = 0; i < c; i++)
    {
        if(i*i == c) ans = "Yes";
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const int MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)
//std::sort(v.begin(), v.end(), std::greater<Type>());
//set_intersection(x, x+7, y, y+6, back_inserter(v));
//set_union(x, x+7, y, y+6, back_inserter(v));
//set_difference(x, x+7, y, y+6, back_inserter(v));

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

bool isPrime(int n){
  if(n < 2) return false;
  else if(n == 2) return true;
  else if(n%2==0) return false;

  for(int i=3;i<=sqrt(n);i++){
    if(n%i==0) return false;
  }
  return true;
}

int main(){
  int a,b;
  cin >> a >> b;
  cout<< a*b <<endl;
}

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

int main() {
	ll N,T,A,vT=1,vA=1;

	cin >> N;
	rep(i,N) {
		ll x,y,n;
		cin >> T >> A;

		x = vT/T;
		if(vT%T) ++x;
		y = vA/A;
		if(vA%A) ++y;
		n = max(x, y);

		vT=n*T, vA=n*A;
	}

	cout << vT+vA << endl;
}

Measured memory_bytes: 256
open System
let R T = stdin.ReadLine()|> T
let RS T = stdin.ReadLine().Split()|>Array.map T
let Mod = (1e9|>int64)+7L
[<EntryPoint>]
let main argv =
    let N = R int
    let S = R string
    for c in S do
        c
        |>int
        |>fun c -> (((c - ('A'|>int) + N)%26)+('A'|>int))
        |>char
        |>stdout.Write
    stdout.WriteLine ""
    0


Measured memory_bytes: 11292
#include <iostream>
#include <atcoder/scc>
using namespace std;
using namespace atcoder;

int main() {
	int N, M;
	cin >> N >> M;
	scc_graph graph(N);
	for (int i = 0; i < M; i++) {
		int a, b;
		cin >> a >> b;
		graph.add_edge(a, b);
	}
	auto ans = graph.scc();
	cout << ans.size() << endl;
	for (auto v : ans) {
		cout << v.size() << " ";
		for (int u : v) cout << u << " ";
		cout << endl;
	}
}


Measured memory_bytes: 40544
D, N = map(int, input().split(" "))

if N != 100:
    if D == 0:
        print(N)
    elif D == 1:
        print(100*N)
    else:
        print(10000*N)
else:
    if D == 0:
        print(101)
    elif D == 1:
        print(101*N)
    else:
        print(10100*N)

Measured memory_bytes: 3064
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)



print(ans)


Measured memory_bytes: 134416
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)
#define REPLL(i, n) for(ll i = 0;i < (n);++i)

#define endl "\n"
#define pb push_back
#define MOD 1000000007LL
#define PI 3.1415926

typedef long long ll;

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template <typename T> inline T POW(T a,T b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}

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

	int a, b;
	cin >> a >> b;
	if(b % a == 0) cout << a+b << endl;
	else cout << b-a << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
 
// 重みなしグラフ
class GraphWithoutWeight{
private:
    const int infinityInGWW = 2e9 + 334 + 810 + 893 + 114514; // 無限大
    const int Vsize; // グラフの頂点の数
    std::vector<std::vector<int>> EdgeFrom; // EdgeFrom[a] = b ; a -> b の矢印
    std::vector<int> NodeIn; // 頂点に入ってくる枝の数 (a-> b => NodeIn[b]++;)
    std::vector<int> Topological; // 順序
public:
    // コンストラクタ その①  : 長さを受け取る ; 枝はなしで初期化
    GraphWithoutWeight(int n): Vsize(n){ 
        EdgeFrom.resize(n, std::vector<int>(0));
        Topological.resize(n); NodeIn.resize(n, 0);
    }
    // コンストラクタ その②  : 枝の情報の配列を受け取る
    GraphWithoutWeight(std::vector<std::vector<int>>& E): Vsize(E.size()){
        EdgeFrom = E; Topological.resize(Vsize);
    }
    // from -> toへの枝を追加する関数
    void add(int from, int to){
        EdgeFrom.at(from).push_back(to);
        NodeIn.at(to)++;
    }
    // 順序を計算の実行をする関数 : 閉路検出 => trueを返す
    bool findLoop(){
        // 順序無限大で埋める : 初期設定
        std::fill(Topological.begin(), Topological.end(), infinityInGWW);
        std::vector<int> copyNodeIn = NodeIn; // 枝の数の配列のコピー
        std::queue<int> Que;
        int count_vertexes = 0; // 訪れた頂点を数える
 
        // 入ってくる枝の数が0の頂点を詰める
        for(int v = 0; v < Vsize; v++) if(copyNodeIn[v] == 0){
            Que.push(v); Topological[v] = 0; count_vertexes++;
        }
        while(not Que.empty()){ // 非再帰 dfs
            int v = Que.front(); Que.pop();
            for(int nv : EdgeFrom[v]){ // 次のノード
                // 無限大の場合
                if(Topological[nv] == infinityInGWW){
                    --copyNodeIn[nv];
                    if(copyNodeIn[nv] == 0){
                        Topological[nv] = Topological[v] + 1;
                        Que.push(nv); count_vertexes++;
                    }
                }
                /*
                else{ // すでに訪れている場合
                    if(Topological[v] >= Topological[nv]){ // 順序がおかしいなら返す
                        return false;
                    }
                }
                */
            }
        }
        return count_vertexes == Vsize;
    }
    // 順序(Topological)を表示する関数
    void showTopological(){
        puts("Topological");
        for(int v = 0; v < Vsize; v++){
            printf("  %d : %d\n", v, Topological[v]);
        }
    }
};
 
int main(void){
    int n, m; scanf("%d%d", &n, &m);
    GraphWithoutWeight GWW(n);
    REP(_, m){
        int a, b; 
        scanf("%d", &a);
        scanf("%d", &b);
        GWW.add(a, b);
    }
    puts(GWW.findLoop() ? "0" : "1");
 
    return 0;
}


Measured memory_bytes: 3216