akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  char s;
  cin>>s;
  if(s>='a' && s<='z') cout<<'a'<<endl;
  else cout<<'A'<<endl;
}



Measured memory_bytes: 3604
#include<bits/stdc++.h>
 
#define fi first
#define se second
#define pb push_back
 
#define limit (int) (1e6 + 5) 
#define mod (long long int) (1e9 + 7)
 
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
using ld = long double;

lli power(lli b,lli p)
{
	lli ans = 1;
	while(p > 0)
	{
		if (p%2 == 1)
		{
			ans *= b;
			ans %= mod;
		}

		b *= b;
		b %= mod;
		p /= 2;
	}

	return ans;
}

int main()
{
	// ios_base::sync_with_stdio(false);cin.tie(NULL);   
   	int n;
   	cin >> n;

   	if (n == 1)
   	{
   		cout << 0;
   		return 0;
   	}

   	lli ans;
   	ans = power(10,n);
   	ans -= 2*power(9,n);
   	ans += power(8,n);
   	// ans *= 2;
   	ans %= mod;

   	if (ans < 0)
   	{
   		ans += mod;
   	}
   	cout << ans;
    return 0;
}




Measured memory_bytes: 3592
N,M=map(int,input().split())
h=list(map(int,input().split()))
t=[0]*N
for i in range(M):
    A,B=map(int,input().split())
    t[A-1] = max(t[A-1], h[B-1])
    t[B-1] = max(t[B-1], h[A-1])

ct=0
for j in range(N):
    if h[j]>t[j]:
        ct+=1
print(ct)


Measured memory_bytes: 20152
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

S = IL()
S.sort()

d1 = S[2]-S[0]
d2 = S[2]-S[1]


c1 = d1//2
c2 = d2//2

if d1%2 == d2%2 == 1:
  a = 1
elif d1%2 == d2%2 == 0:
  a = 0
else:
  a = 2
  
P(c1+c2+a)

Measured memory_bytes: 38256
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>

using namespace std;



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

    int64_t result = 1;
    for (int64_t i = 0; i < N; ++i) {
        int64_t t;
        std::cin >> t;

        result = boost::math::lcm(result, t);
    }

    std::cout << result << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int main()
{
	int c=0,i;
	string s,t;
	cin>>s>>t;
	for(i=0;i<t.length();i++)
	{
		if(s[i]!=t[i])
		++c;
	}
	cout<<c;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

inline int popcount(int x){
	x=((x>>1)&0x55555555)+(x&0x55555555);
	x=((x>>2)&0x33333333)+(x&0x33333333);
	x=((x>>4)+x)&0x0f0f0f0f;
	x+=(x>>8);
	x+=(x>>16);
	return x&0x3f;
}

template<class G>
class Fenwick_tree{
	vector<G> a;
public:
	Fenwick_tree(int n):a(n){}
	void add(int i,G val){
		for(i++;i<=a.size();i+=i&-i) a[i-1]+=val;
	}
	G sum(int l,int r)const{
		if(l==0){
			G res{};
			for(;r>0;r-=r&-r) res+=a[r-1];
			return res;
		}
		return sum(0,r)-sum(0,l);
	}
	int lower_bound(G val)const{
		if(val<=G{}) return 0;
		int x=0,k;
		for(k=1;k<=a.size();k<<=1);
		for(k>>=1;k>0;k>>=1) if(x+k<=a.size() && a[x+k-1]<val) val-=a[x+k-1], x+=k;
		return x;
	}
	int upper_bound(G val)const{
		if(val<G{}) return 0;
		int x=0,k;
		for(k=1;k<=a.size();k<<=1);
		for(k>>=1;k>0;k>>=1) if(x+k<=a.size() && a[x+k-1]<=val) val-=a[x+k-1], x+=k;
		return x;
	}
};

class permutation{
	vector<int> f;
public:
	permutation(){}
	permutation(int n){
		f.resize(n);
		iota(f.begin(),f.end(),0);
	}
	permutation(const vector<int>& p):f(p){}

	permutation operator*(const permutation& p)const{
		int n=f.size();
		permutation res(n);
		rep(i,n) res.f[i]=f[p[i]];
		return res;
	}
	int operator[](int i)const{ return f[i]; }

	int size()const{ return f.size(); }

	friend permutation inverse(const permutation& p){
		int n=p.f.size();
		permutation res(n);
		rep(i,n) res.f[p.f[i]]=i;
		return res;
	}
};

permutation pow(permutation p,long long k){
	permutation res(p.size());
	for(;k>0;k>>=1,p=p*p) if(k&1) res=res*p;
	return res;
}

long long inversion_number(const permutation& p){
	int n=p.size();
	long long res=0;
	Fenwick_tree<int> F(n);
	rep(i,n){ res+=F.sum(p[i]+1,n); F.add(p[i],1); }
	return res;
}

const int INF=1<<29;

int main(){
	int n; scanf("%d",&n);
	vector<int> a(n),b(n);
	rep(i,n) scanf("%d",&a[i]);
	rep(i,n) scanf("%d",&b[i]);

	int ans=INF;
	rep(S,1<<n) if(popcount(S)==(n+1)/2) {
		int ne=0,no=0;
		pair<int,int> even[9],odd[9];
		rep(i,n){
			if(S>>i&1) even[ne++]={i%2==0?a[i]:b[i],i};
			else       odd [no++]={i%2==1?a[i]:b[i],i};
		}

		sort(even,even+ne);
		sort(odd ,odd +no);

		bool ok=true;
		rep(i,ne) if(i  <no && even[i].first>odd [i  ].first) ok=false;
		rep(i,no) if(i+1<ne && odd [i].first>even[i+1].first) ok=false;
		if(!ok) continue;

		vector<int> p(n);
		rep(i,n) p[i]=(i%2==0?even:odd)[i/2].second;

		ans=min(ans,(int)inversion_number(permutation(p)));
	}
	printf("%d\n",ans<INF?ans:-1);

	return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#include<algorithm>
#include<queue>
#include<string.h>
using namespace std;
#define NIL -2000000001
#define MAX 101
#define WHITE 0
#define GRAY 1
#define BLACK 2

int n = 0;
int adl[MAX][MAX], deg[MAX];
int adm[MAX][MAX];
int color[MAX];
int d[MAX];
queue<int> queueBfs;


void bfs() {
  for ( int i = 0; i < n; i++ ) {
    color[i] = WHITE;
    d[i] = -1;
  }
  queueBfs.push(0);
  color[0] = GRAY;
  d[0] = 0;

  while (!queueBfs.empty()) {
    int top = queueBfs.front();

    for (int i = 0; i < n; i++) {
      if (adm[top][i] == 1 && color[i] == WHITE) {
        queueBfs.push(i);
        color[i] = GRAY;
        d[i] = d[top]+1;
      }
    }

    queueBfs.pop();
  }
}

int main() {
  scanf("%d", &n);
  for ( int i = 0; i < n; i++ ) {
    for ( int j = 0; j < n; j++ ) {
      adm[i][j] = 0;
    }
  }
  for ( int i = 0; i < n; i++ ) {
    int num;
    scanf("%d", &num);
    num--;
    scanf("%d", &deg[num]);
    for ( int j = 0; j < deg[num]; j++) {
      scanf("%d", &adl[num][j]);
      adl[num][j]--;
      adm[num][adl[num][j]] = 1;
    }
  }

  bfs();

  for ( int i = 0; i < n; i++ ) {
    printf("%d %d\n", i+1, d[i]);
  }



  return 0;
}



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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}

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

    int res = 0;
    int result = 0;
    for(int i = 0; i < N; ++i) {
        if(S[i] == 'I') {
            res++;
        } else {
            res--;
        }

        if(res > result) {
            result = res;
        }
    }

    cout << result << endl;
}


Measured memory_bytes: 256
/* Author rumoisen */
/* created 2018/11/08 */

#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <iostream>

using namespace std;
 
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

void no(){cout<<"No"<<endl;exit(0);}
void yes(){cout<<"Yes"<<endl;exit(0);}
void No(){cout<<"NO"<<endl;exit(0);}
void Yes(){cout<<"YES"<<endl;exit(0);}

using namespace std;

int main(void)
{
    int a,b;
    cin>>a>>b;
    cout<<(a+b+1)/2<<endl;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 2e5+23;

pair<long long, long long> a[N];
int n;

int closest(int x, int y) {
  long long d = 2e9;
  int ret = -1;
  for (int i = 0; i < n; ++i) {
    long long nd = abs(x-a[i].first)+abs(y-a[i].second);
    if (nd < d) {
      d = nd;
      ret = i;
    }
  }
  return ret;
}

void solve() {
  scanf("%d", &n);
  long long maX = -1e9, maY = -1e9, miX = 1e9, miY = 1e9;
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", &a[i].first, &a[i].second);
    maX = max(maX, a[i].first);
    miX = min(miX, a[i].first);
    maY = max(maY, a[i].second);
    miY = min(maY, a[i].second);
  }
  int corners[8] = {closest(miX, maY), closest(maX, maY),
		    closest(miX, miY), closest(maX, miY),
                    closest(0  , maY), closest(0  , miY),
		    closest(maX, 0  ), closest(miX, 0  )};
  long long ans = 0;
  for (int i = 0; i < 7; ++i) {
    for (int j = i+1; j < 8; ++j) {
      if (corners[i] == corners[j]) continue;
      long long nd = abs(a[corners[j]].first-a[corners[i]].first)+
	             abs(a[corners[j]].second-a[corners[i]].second);
      ans = max(nd, ans);
    }
  }
  printf("%lld", ans);
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 6932
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))
 
using namespace std;
 
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=1e9+7;

const long double pi=acos(-1);

int main()
{
    long double a,b,h,m;
    cin >> a >> b >> h >> m;
    long double k=abs(pi*h/6+pi*m/360-pi*m/30);
    long double s=a*a+b*b-2*a*b*cos(k);
    //cout << k << endl;
    long double ans=sqrt(s);
    cout << fixed << setprecision(30);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4156
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

vector<int> used;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	vector<int> edge(n,0);
	REP(i,m){
		int a,b;
		cin>>a>>b;
		a--;b--;
		edge[a]++;edge[b]++;
	}
	bool out = false;
	REP(i,n){
		if(edge[i]&1)out = true;
	}
	if(out)cout<<"NO" << endl;
	else cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#include <iomanip>
#include <stdio.h>

using namespace std;

int main(){

        int a,b,c;

        scanf("%d %d %d",&a,&b,&c);

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

        return 0;
}


Measured memory_bytes: 3148
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long N;
  cin>>N;
  vector<int>A(N-1);
  vector<int>B(N,0);
  for(int i=0;i<N-1;i++){
    cin>>A.at(i);
    B.at(A.at(i)-1)=B.at(A.at(i)-1)+1;
  }
  for(int i=0;i<N;i++){
    cout<<B.at(i)<<endl;
  }
}
  


Measured memory_bytes: 4844
using System;
class Program
 {
        static void Main(string[] args)
        {
    　　	　 int a,b;            
            string[] str = Console.ReadLine().Split(' ');
            a = int.Parse(str[0]);
            b = int.Parse(str[1]);
          	if(a == b){
            	Console.Write("Yes");
            }else{
            	Console.Write("No");
            }
        }
 }

Measured memory_bytes: 13140
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

int main() {
	LL N;
	cin >> N;
	if(N%2==1){
		cout << 0 << endl;
		return 0;
	}
	LL ret=0;
	N/=10;
	while(N){
		ret+=N;
		N/=5;
	}
	cout << ret << endl;

	return 0;
}



Measured memory_bytes: 888
#include <stdio.h>

int main()
{
    while(1) {

            int i, j, h, w;

            scanf("%d %d", &h, &w);

            if(h == 0 && w == 0) {

                break;
            }

            for(i = 1; i <= h; i++) {

                for(j = 1; j <= w; j++) {

                    if(i != 1 && i != h && j != 1 && j != w) {
                        printf(".");
                    }

                    else {

                        printf("#");
                    }
                }

                printf("\n");
            }

            printf("\n");
    }

    return 0;
}



Measured memory_bytes: 2036
import java.util.Scanner;

public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args){
		//C
		int N = sc.nextInt();
		//int[] a = new int[N];
		int sum = 0;
		for(int i = 0 ; i < N ; i++){
			//a[i]= sc.nextInt();
			sum += (sc.nextInt()-1);
		}
		System.out.println(sum);
	}
}

Measured memory_bytes: 24656
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
using namespace std;
#define REP(i,m,n) for (int i = (int) (m); i < (int) (n); i++)
#define REP1(i,m,n) for (int i = (int) (m); i <= (int) (n); i++)
#define all(x)     (x).begin(), (x).end()
#define SZ(x)      ((int) (x).size())

int gcd(int a,int b,int c){
    int ma,ret;
    ma=min(a,min(b,c));
    for(int i=ma;i>0;i--){
        if(a%i==0 && b%i==0 && c%i==0){
            ret=i;
            break;
        }
    }
    return ret;
}

int main(void){
    int K,i,j,k,g;
    long long int sum=0;
    cin>>K;
    REP1(i,1,K){
        REP1(j,1,K){
            REP1(k,1,K){
                g=gcd(i,j,k);
                sum+=g;
            }
        }
    }
    cout<<sum<<endl;
}

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

int main() {
    int N;
    cin >> N;
    int f = N % 10;
    if (f == 3) cout << "bon" << endl;
    else if (f == 0 || f == 1 || f == 6 || f == 8) cout << "pon" << endl;
    else cout << "hon" << endl;
    return 0;
}

Measured memory_bytes: 3580
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <random>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)



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

	ANS(t / a*b);
	


	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main (void)
{
	int H[1000], W[1000];
	int i,j,h,w;

	for(i=0;;i++){
		scanf("%d %d", &H[i], &W[i]);
		if(H[i]==0 && W[i]==0) break;
	}

	for(j=0;j<i;j++){
		for(h=0;h<H[j];h++){
			for(w=0;w<W[j];w++){
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}

	return 0;
}

Measured memory_bytes: 580
#include <cstdio>
#include <cstring>

using namespace std;

const int mod = 1'000'000'007;

int mul(int a, int b) {
  return (int)((long long)a * b % mod);
}

const int N = 4'009;

int c[N][N];

int calc(int n, int m) {
  return c[n + m - 1][n];
}

int main() {
  memset(c, 0, sizeof c);
  for (int i = 0; i < N; ++i) {
    c[i][0] = 1;
    c[i][i] = 1;
    for (int j = 1; j < i; ++j) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    if (i - 1 > n - m) {
      puts("0");
      continue;
    }
    printf("%d\n", mul(calc(m - i, i), calc(n - m - (i - 1), (i - 1) + 2)));
  }
}


Measured memory_bytes: 62976
from bisect import *
N = int(input())
A = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
C = sorted(map(int, input().split()))
 
cnt = []
 
for b in B:
    cnt.append(bisect_left(A, b) * (N - bisect_right(C, b)))
print(sum(cnt))

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

bool MakePair(int idx, vector<int> &cand, vector<bool> &check);
int GetNext2n(int num);

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

	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; ++i) cin >> a[i];
	sort(a.begin(), a.end(), greater<int>());
	vector<bool> check(n);
	for (int i = 0; i < n; ++i) check[i] = false;

	int count = 0;
	for (int i = 0; i < n; ++i) {
		if (!check[i] && MakePair(i, a, check))
			++count;
	}

	cout << count << "\n";

	return 0;
}

bool MakePair(int idx, vector<int> &cand, vector<bool> &check)
{
	check[idx] = true;
	int target = GetNext2n(cand[idx]) - cand[idx];
	
	int left = idx + 1;
	int right = cand.size() - 1;
	int ans = cand.size();

	while (left <= right) {
		int mid = (left + right) / 2;
		if (cand[mid] > target || (cand[mid] == target && check[mid])) {
			left = mid + 1;
		}
		else if (cand[mid] < target || (cand[mid] == target && !check[mid])) {
			if (cand[mid] == target) {
				ans = min(ans, mid);
			}
			right = mid - 1;
		}
	}

	if (ans != cand.size()) {
		check[ans] = true;
		return true;
	}
	else {
		return false;
	}
}

int GetNext2n(int num)
{
	int ret = 1;
	while (ret <= num) ret = ret << 1;
	return ret;
}

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

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

    int n; cin >> n;

    vector<int> h(n);
    for(int& x : h) cin >> x;


    vector<int> dp(n);
    dp[n - 1] = 0;

    for(int i = n - 2; i >= 0; --i) {
        dp[i] = dp[i + 1] + abs(h[i] - h[i+1]);
        if(i + 2 < n) {
            dp[i] = min(dp[i], dp[i + 2] + abs(h[i] - h[i + 2]));
        }
    }

    cout << dp[0] << '\n';
}


Measured memory_bytes: 1024
program sample
    implicit none
    character(100),allocatable::s(:),t(:)
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) n,m
    allocate(s(n),t(m))
    do i=1,n
        read(*,*)s(i)
    end do
    do i=1,m
        read(*,*)t(i)
    end do
    if(m==1)then
        do i=1,n
            do j=1,n
                if(s(i)(j:j) .eq. t(1))then
                    write(*,*)'Yes'
                    stop
                end if
            end do
        end do
        write(*,*)'No'
        stop
    end if
    
    do i=1,n+1-m
        do j=1,n+1-m
            if(s(i)(j:j+m-1) .eq. t(1))then
                do k=2,m
                    if(s(i-1+k)(j:j+m-1) .ne. t(k))then
                        exit
                    elseif(k==m)then
                        write(*,*)'Yes'
                        stop
                    endif
                end do
            end if
        end do
    end do
    write(*,*)'No'
    stop
end program sample
  



Measured memory_bytes: 2676
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int N;
	int s[100];
	int i,j,k;
	int total=0;
	
	cin>>N;
	for(i=0;i<N;i++){
		cin>>s[i];
		total=total+s[i];
	}
	if(total%10==0){
		sort(s, s+N);
		for(i=0;i<N;i++){
			if((total-s[i])%10!=0){
				total=total-s[i];
				break;
			}
		}
	}
	if(total%10==0){
		cout<<0;
	}else{
		cout<<total;
	}
}
		
	

	
	
	
	

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int INF = 1000000000;
  int h, n;
  cin >> h >> n;
  vi a(n), b(n);
  rep(i,n) cin >> a[i] >> b[i];
  vi dp(h+1, INF);
  dp[0] = 0;
  for(int i=1; i<=h; i++){
    rep(j,n){
      if(i-a[j] >= 0) dp[i] = min(dp[i], dp[i-a[j]] + b[j]);
      else dp[i] = min(dp[i], b[j]);
    }
  }
  cout << dp[h] << endl;
}

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

typedef long long ll;
typedef long double ld;

#define pb push_back
#define sort(s) sort(s.begin(),s.end())
#define reverse(s) reverse(s.begin(),s.end())
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)

const ll mod = 1e9+7;

//最大公約数
ll gcd(ll a, ll b) {
    return b ? gcd(b, a%b) : a;
}

//最小公倍数
ll lcm(ll a, ll b) {
    return a / gcd(a, b) * b;
}

//素数判定
bool isPrime(ll x){
    ll i;
    if(x < 2)return 0;
    else if(x == 2) return 1;
    if(x%2 == 0) return 0;
    for(i = 3; i*i <= x; i += 2) if(x%i == 0) return 0;
    return 1;
}

//桁和
int digsum(ll n) {
    int res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

//桁数
int dignum(ll n) {
    int res = 0;
    while(n > 0) {
        res++;
        n /= 10;
    }
    return res;
}

//文字列中の特定の文字カウント
ll stringcount(string s,char c){
    return count(s.cbegin(),s.cend(),c);
}

//階乗
ll ka(ll i){
    ll res=1;
    while(i>0){
        res=res*i;
        i--;
    }
    return res;
}
 
//ncr
ll ncr(ll x,ll y){
    ll a = x;
    ll b = 1;
    if(y>(x/2)){
        y=x-y;
    }
    for(ll i=1;i<y;i++){
        a*=x-i;
        b*=i+1;
    }
    return a/b;
}



int main(){
    int n;
    cin >> n;
    int a[n+1];

    int ans=-1;
    int count=1;

    rep(i,n) cin >> a[i+1];

    int p=1;

    for(int i=0;i<n;i++){
        if(a[p]==2){
            ans=count;
            break;
        }else{
            p=a[p];
            count++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
using namespace std;
//**********************************************DO IT NOW***************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        double x=n/3.0;
        double ans=(x*x*x);
        cout<<fixed<<setprecision(10)<<ans;
    }
}
// 🍪 🍪 🍪


Measured memory_bytes: 3780
use std::io;

fn read_line() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

macro_rules! from_line {
    ($($a:ident : $t:ty),+) => {
        $(let $a: $t;)+
        {
            let _line = read_line();
            let mut _it = _line.trim().split_whitespace();
            $($a = _it.next().unwrap().parse().unwrap();)+
                assert!(_it.next().is_none());
        }
    };
}

fn main() {
    from_line!(S: i32);
    let h: i32 = S / 3600;
    let m: i32 = (S - h * 3600) / 60;
    let s: i32 = (S - (h * 3600 + m * 60));
    println!("{}:{}:{}", h, m, s);
}



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

using namespace std;

int main(){
	int X,T,N;

	cin >> N >> X >> T;

	if(N%X > 0)
		cout << (N/X + 1) * T << endl;
	else{
		cout << (N/X) * T << endl;
	}
	return 0 ;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int l = s.length();
  string a;
  for(int i = 0; i < l; i++){
    if(i % 2 == 0) a += s[i];
  } 
  cout << a << endl;
}


Measured memory_bytes: 512
#include<stdio.h>

#define MAX 25
#define NIL -1

struct Node{ int p, l, r;};
struct Node T[MAX];

void Preorder(int z){
  printf(" %d",z);
  if(T[z].l!=NIL)Preorder(T[z].l);
  if(T[z].r!=NIL)Preorder(T[z].r);
}

void Inorder(int z){
  if(T[z].l!=NIL)Inorder(T[z].l);
  printf(" %d",z);
  if(T[z].r!=NIL)Inorder(T[z].r);
}

void Postorder(int z){
  if(T[z].l!=NIL)Postorder(T[z].l);
  if(T[z].r!=NIL)Postorder(T[z].r);
  printf(" %d",z);
}

int search(int n){
  int i,root;
  for(i=0;i<n;i++){
    if(T[i].p==NIL){
      root=i;
      break;
    }
  }
  return root;
}

main(){
  int n,i,j,z,l,r,root;

  scanf("%d", &n);
  for(i=0;i<n;i++) {
    T[i].p=NIL;
    T[i].l=NIL;
    T[i].r=NIL;
  }
  for(i=0;i<n;i++){
    scanf("%d %d %d",&z,&l,&r);
    T[z].l=l;
    T[z].r=r;
    T[l].p=z;
    T[r].p=z;
  }
  root=search(n);
  printf("Preorder\n");
  Preorder(root);
  printf("\n");

  printf("Inorder\n");
  Inorder(root);
  printf("\n");

  printf("Postorder\n");
  Postorder(root);
  printf("\n");
  return 0;
}

Measured memory_bytes: 616
#include <stdio.h>
#include <ctype.h>

int main(void)
{
  char s1[11], s2[11], s3[11];
  char u[11] = "";
  scanf("%s %s %s", s1, s2, s3);
  u[0] = toupper(s1[0]);
  u[1] = toupper(s2[0]);
  u[2] = toupper(s3[0]);
  puts(u);
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int n;
    cin >> n;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    int k = 0;
    rep(i,n){
        if(p[i] != i+1) k++;
    }
    if(k < 3) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 3692
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;

    char a[n];

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


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


    int count=0;
    for(int i=0;i<n;i++)
    {
        if(a[i]>='a' && a[i]<='z')
            count++;

    }

    cout<<count<<endl;



    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>

using namespace std;

int gcd(int n, int m){
  if(n % m == 0){
    return m;
  }
  else{
    return gcd(m, n % m);
  }
}

int main()
{
  int a, b, k;
  cin >> a >> b >> k;
  int g = gcd(max(a, b), min(a, b));
    int count = 0;
    for(int i = g; 0 < i; i--){
        if(g % i == 0){
            count++;
        }
        if(count == k){
            cout << i << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
    int n;
    scanf("%d",&n);
    long int sum=0;
    for(int i=1;i<=n;i++)
    {
        if(i%3!=0&&i%5!=0)
        sum+=i;
    }
    printf("%ld",sum);
    

    return 0;
}


Measured memory_bytes: 1732
const int isDebugMode = 1;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long gcd(T1 a, T2 b){return a % b ? gcd(b , a % b) : b;}
template<class T1, class T2> void reduce(T1 &a, T2 &b){ll g = gcd(a, b); a /= g; b /= g; return;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

vector<long long> div_list(long long n){
    vector<long long> list;
    for(long long i = 1; i * i <= n; i++){
        if (n % i == 0){
            if (i == n / i){
                list.emplace_back(i);
            }else{
                list.emplace_back(i);
                list.emplace_back(n / i);
            }
        } 
    }
    sort(list.begin(), list.end());
    return list;
}

int main(){
    ll N; cin >> N;
    vector<ll> a(N);
    rep(i, N) cin >> a[i];
    sort(all(a));
    set<ll> set;
    ll ans = 0;
    rep(i, N){
        vector<ll> list = div_list(a[i]);
        bool ok = true;
        if(0 < i && a[i] == a[i - 1]) ok = false;
        if(i < N - 1 && a[i] == a[i + 1]) ok = false;
        for(auto &e : list){
            if(set.count(e)) ok = false;
        }
        if(ok) ans++;
        set.insert(a[i]);
    }
    pt(ans);
}

Measured memory_bytes: 14028
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define F first
#define S second
#define vec(x) vector<x> 
#define pi(x,y) pair<x,y>
#define pqq(x) priority_queue<x> 
#define min_heap(x) priority_queue<x, vector<x>, greater<x> >
#define all(x) x.begin(),x.end()
#define rep(i,x,y) for(int i=x;i<y;i++)
#define repd(i,x,y,k) for(int i=x;i<y;i+=k)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define rev(x) reverse(all(x))
#define uniq(x) x.resize(distance(x.begin(),unique(all(x))))
#define full(x,a) memset(x,a,sizeof(x))
#define lcm(x,y) ((x*y)/__gcd(x,y))
#define mod 1000000007
#define bitcount __builtin_popcountll
#define pb push_back
#define indexof order_of_key
#define valueat find_by_order

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int dxx[8]={0,0,1,-1,-1,-1,1,1};
int dyy[8]={1,-1,0,0,-1,1,1,-1};

int gcdextended(int a,int b,int &x,int &y){if(!a){x=0,y=1;return b;}int x1,y1;int ans=gcdextended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return ans;}
int inv(int a){int x,y;int ans=gcdextended(a,mod,x,y);return(x%mod+mod)%mod;}
int nCr(int n,int k){int res=1;k=(k>n-k)?n-k:k;rep(i,0,k){res*=(n-i);res/=(i+1);}return res;}
int POW(int x,int y){int res=1;x=x%mod;while(y>0){if(y&1)res=(res%mod*x)%mod;y=y>>1;x=(x*x)%mod;}return res;}
//void seive(){prime[0]=0;prime[1]=0;rep(i,2,10002)prime[i]=1;for(int i=2;i*i<=10000;i++){if(prime[i]){for(int j=i*i;j<=10000;j+=i)prime[j]=0;}}} 

int a,b;

void input(){
	cin>>a>>b;
}

void solve(){
	if(a<=9 && b<=9)
		cout<<a*b<<endl;
	else
		cout<<-1<<endl;
}

main(){
	fastio;
	int t;
	t=1;
	while(t--){
		input();
		solve();
	}
}

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

int main(){
  int N, M, L;
  cin >> N >> M >> L;
  vector<vector<long long>> Map(N, vector<long long>(N, 1e13));
  vector<vector<long long>> Graph(N, vector<long long>(N, 1e13));
  int a, b, c;
  for (int i=0;i<M;i++){
    cin >> a >> b >> c;
    if (c <= L){
      Map.at(a-1).at(b-1) = c, Map.at(b-1).at(a-1) = c;
    }
  }
  for (int k=0;k<N;k++){
    for (int i=0;i<N;i++){
      for (int j=0;j<N;j++){
        if (Map.at(i).at(j) > Map.at(i).at(k) + Map.at(k).at(j)){
          Map.at(i).at(j) = Map.at(i).at(k) + Map.at(k).at(j);
        }
      }
    }
  }
  for (int i=0;i<N;i++){
    for (int j=0;j<N;j++){
      if (i == j){
        Map.at(i).at(i) = 0;
        Graph.at(i).at(i) = 0;
      }
      else if (Map.at(i).at(j) <= L){
        Graph.at(i).at(j) = 1;
      }
    }
  }
  for (int k=0;k<N;k++){
    for (int i=0;i<N;i++){
      for (int j=0;j<N;j++){
        if (Graph.at(i).at(j) > Graph.at(i).at(k) + Graph.at(k).at(j)){
          Graph.at(i).at(j) = Graph.at(i).at(k) + Graph.at(k).at(j);
        }
      }
    }
  }
  int Q;
  cin >> Q;
  int s, t;
  for (int i=0;i<Q;i++){
    cin >> s >> t;
    s -= 1;
    t -= 1;
    if (Graph.at(s).at(t) == 1e13){
      cout << -1 << endl;
    }
    else{
      cout << Graph.at(s).at(t) - 1 << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1920
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>

double area(double a, double b, double c)
{
	double s = (a+b+c)/2;
	return sqrt(s*(s-a)*(s-b)*(s-c));
}
double distance(double x1, double y1, double x2, double y2)
{
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main()
{
	double x[3], y[3];
	double xp, yp;
	while (scanf("%lf %lf %lf %lf %lf %lf %lf %lf"
		, &x[0], &y[0], &x[1], &y[1], &x[2], &y[2], &xp, &yp) != EOF)
	{
		double edge[3];
		for (int i = 0; i < 3; ++i)
			edge[i] = distance(x[i], y[i], x[(i+1)%3], y[(i+1)%3]);
		double correctArea = area(edge[0], edge[1], edge[2]);
		double totalArea = 0;
		for (int i = 0; i < 3; ++i)
		{
			totalArea += area(distance(x[i], y[i], xp, yp)
				, distance(x[(i+1)%3], y[(i+1)%3], xp, yp), edge[i]);
		}
		if (abs(correctArea - totalArea) < 0.0001)
			puts("YES");
		else
			puts("NO");
	}

	return 0;
}

Measured memory_bytes: 0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def main():
	in_n = input()
	n = str(in_n)
	num = list(map(int, list(n)))
	SUM_num = sum(num)

	if int(in_n) % SUM_num == 0:
		print('Yes')
	else:
		print('No')

if __name__ == '__main__':
	main()


Measured memory_bytes: 2940
#include<cstdio>
#include<iostream>
#include<string>

using namespace std;

int main(void){
	
	int n,k;
	double  x[10],yen;
	yen = 0;

	string u[10];
	
	cin >> n;

	for (k = 0; k < n; k++) {
		cin >> x[k] >> u[k];

		if (u[k]=="JPY") {
			yen += x[k];
		}
		else if (u[k] == "BTC") {
			yen += (x[k] * 380000);
		}
	}

	printf("%lf\n", yen);

	return 0;
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

void solve()
{
  ll lnum[87] = {2, 1};
  for(int i = 2; i <= 86; ++i)
  {
    lnum[i] = lnum[i - 1] + lnum[i - 2];
  }

  int n;
  cin >> n;
  cout << lnum[n];
}

int main()
{
  fastio;
  solve();

  return 0;
}

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

using namespace std;
using llong = long long;
using ldbl = long double;
using P = pair<llong, llong>;

#define BE(x) x.begin(), x.end()

const llong inf = llong(1e18)+7;
const llong mod = 1e9+7;

int main(){
	llong N;
	vector<llong> a,w[2];

	cin >> N;
	a.resize(N);
	for(int i = 0; i < N; i++)
		cin >> a[i];
	llong in;
	for(int i = 0; i < N; i++){
		cin >> in;
		w[a[i]].push_back(in);
	}

	sort(BE(w[0]));
	sort(BE(w[1]));

	llong ans = 0;
	if(w[0].size() && w[1].size())
		ans += w[0][0] + w[1][0];

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
#define IN(a, x, b) (a<=x && x<b)
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;}
constexpr long long INF = 1e18;

void pr(bool f){
	if(f)cout<<"Yay!"<<endl;
	else cout<<":("<<endl;
};

signed main(){
	int H,W,K;
	cin>>H>>W>>K;
	vector<string>s(H);
	REP(i,H){
		cin>>s[i];
	}
	vector<vector<int>>grid(H,vector<int>(W,-1));
	vector<int>has(H,0);
	REP(i,H){
		int flg = 0;
		REP(j,W)if(s[i][j]=='#')flg=1;
		if(flg)has[i]=true;
	}
	int now = 0;
	int had = 0;
	REP(i,H){
		if(!has[i]&&!had)continue;
		had=1;
		int flg = 0;
		int isOK = 0;
		if(has[i]){
		REP(j,W){
			if(flg==0&&s[i][j]!='#')grid[i][j]=now;
			else if(flg==0&&s[i][j]=='#'){
				grid[i][j]=now;
				flg=1;
				K--;
				isOK = 1;
			}else if(s[i][j]!='#')grid[i][j]=now;
			else{
				grid[i][j]=++now;
				K--;
				isOK = 1;
			}
		}
		}
		if(K&&isOK)now++;
		if(i!=H-1&&!has[i+1]){
			REP(j,W)grid[i+1][j]=grid[i][j];
		}
	}
	had = -1;
	REP(i,H){
		if(has[i]){
			had = i;
			break;
		}
	}
	RREP(i,had){
		REP(j,W){
			grid[i][j]=grid[i+1][j];
		}
	}
	REP(i,H){
		REP(j,W){
			if(j)cout<<" ";
			cout<<grid[i][j]+1;
		}
		cout<<endl;
	}
}

Measured memory_bytes: 1664
import static java.lang.Math.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };
	static int[] mh8 = { -1, -1, -1, 0, 0, 1, 1, 1 };
	static int[] mw8 = { -1, 0, 1, -1, 1, -1, 0, 1 };

	static class TaskX {

		public void solve(int testNumber, InputReader in, PrintWriter out) {

			int n = in.nextInt();
			long W =in.nextLong();
			int[] v = new int[n];
			long[] w = new long[n];
			for (int i = 0; i < n; i++) {
				v[i] = in.nextInt();
				w[i] = in.nextLong();
			}

			int vsum = Arrays.stream(v).sum();

			long[][] dp = new long[n+1][vsum+1];
			for (int i = 0; i <= n; i++) {
				Arrays.fill(dp[i], INF);
			}

			for (int i = 0; i <= n; i++) {
				dp[i][0] = 0;
			}
			for (int i = 0; i < n; i++) {
				for (int j = 0; j <= vsum; j++) {
					if (j-v[i] >= 0) {
						dp[i+1][j] = min(dp[i][j], dp[i][j-v[i]] + w[i]);
					} else {
						dp[i+1][j] = dp[i][j];
					}
				}
			}

			long ans = -INF;
			for (int i = 0; i <= vsum; i++) {
				if (dp[n][i] <= W) {
					ans = max(ans, i);
				}
			}
			out.println(ans);

		}

		public static int lowerBound(long[] a, long obj) {
			int l = 0, r = a.length - 1;
			while (r - l >= 0) {
				int c = (l + r) / 2;
				if (obj <= a[c]) {
					r = c - 1;
				} else {
					l = c + 1;
				}
			}
			return l;
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}
	}

}



Measured memory_bytes: 38692
n = int(input())
a = list(map(int, input().split()))
k = 0
num = sum(a)

for i in range(n):
    k = k + (a[i] * num) - (a[i] ** 2)

x = k // 2
t = 10 ** 9 + 7
ans = x % t
print(ans)


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

using namespace std;

#define ll long long
#define mod 1000000007

const ll INF = 1e11;

void solve(){

    string s1, s2; cin >> s1 >> s2;
    vector<vector<int>> dp (s1.length()+1, vector<int> (s2.length()+1));

    for(int i = 1; i <= s1.length(); ++i){
        for(int j = 1; j <= s2.length(); ++j){
            if(s1[i-1] == s2[j-1]) dp[i][j] = dp[i-1][j-1] + 1;
            else dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    string ans = "";
    int x = s1.length(), y = s2.length();
    while(x > 0 && y > 0){
        if(s1[x-1] == s2[y-1]){
            ans += s1[x-1];
            x--;
            y--;
        } else dp[x-1][y] > dp[x][y-1] ? x-- : y--;
    }
    reverse(ans.begin(), ans.end());

    cout << ans << endl;
    
    return;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	solve();
	return 0;
}

Measured memory_bytes: 38556
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
	public static void main (String[] args) throws java.lang.Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    StringBuffer line = new StringBuffer(br.readLine());
		
		System.out.println(line.reverse().toString());
	}
}

Measured memory_bytes: 24100
n=int(input())
T=[[]]*n
P=[-1]*(n+1)#n=1の対策、場当たり的だが
for i in range(n):
    id, left, right = map(int,input().split( ))
    T[id] =[left,right]
    P[right] = id
    P[left] = id

root=0

while P[root] !=-1:
    root = P[root]

#再帰的に行う

def preorder(u):
    global T
    L = []
#    if u != -1:
#        L.append(u)
#        L += (preorder(T[u][0]))
#        L += (preorder(T[u][1]))
#他も同様の変更
    L.append(u)
    if T[u][0] != -1:
        L += (preorder(T[u][0]))
    if T[u][1] != -1:
        L += (preorder(T[u][1]))
    return L

def inorder(u):
    global T
    L = []
    if T[u][0] != -1:
        L += (inorder(T[u][0]))
    L.append(u)
    if T[u][1] != -1:
        L += (inorder(T[u][1]))
    return L


def postorder(u):
    global T
    L = []
    if T[u][0] != -1:
        L += (postorder(T[u][0]))
    if T[u][1] != -1:
        L += (postorder(T[u][1]))
    L.append(u)
    return L
Pre= preorder(root)
In = inorder(root)
Post=postorder(root)
print("Preorder",end="\n ")
print(*Pre)
print("Inorder",end="\n ")
print(*In)
print("Postorder",end="\n ")
print(*Post)



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

using namespace std;

int main()
{
    string s;
    cin>>s;
    int i=-1;
    map<char,int>m;
    while(s[++i]!='\0'){

        ++m[s[i]];

    }
    if(m.size()!=2)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    return 0;

}


Measured memory_bytes: 256