akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll N, T;
    cin >> N >> T;

    ll sum = T;
    ll preb = 0;
    REP(i, N)
    {
        ll t;
        cin >> t;

        sum += std::min(T, t - preb);
        preb = t;
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
s = str(input())
ls = ["dream","dreamer","erase","eraser"]
while True:
    k = s[-5:]
    if k not in ls:
        t = s[-6:]
        if t not in ls:
            l = s[-7:]
            if l not in ls:
                print("NO")
                sys.exit()
            else:
                s = s[:-7]
                if s == "":
                    print("YES")
                    break
        else:
            s = s[:-6]
            if s == "":
                print("YES")
                break
    else:
        s = s[:-5]
        if s == "":
            print("YES")
            break

Measured memory_bytes: 78816
import java.util.HashSet;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		String ans = "IMPOSSIBLE";
		int n = sc.nextInt();
		int m = sc.nextInt();
		int a;
		int b;
		int[][] list = new int[m][2];
		HashSet<Integer> hash = new HashSet<Integer>();
		for (int i=0; m > i; i++) {
			a = sc.nextInt();
			b = sc.nextInt();
			list[i][0] = a;
			list[i][1] = b;
			if (b == n){
				if(a == 1 && hash.contains(b)){
					ans = "POSSIBLE";
					break;
				}
				hash.add(a);
			}
		}
		if (ans != "POSSIBLE") {
			for (int i=0; m > i; i++) {
				if(list[i][0] == 1 && hash.contains(list[i][1])){
					ans = "POSSIBLE";
					break;
				}
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 109916
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		boolean flg = true;
		ArrayList<Integer> list = new ArrayList<Integer>();

		int ans = 0;

		while (flg) {
			scanner.hasNext();

			int a = scanner.nextInt();
			String op = scanner.next();
			int b = scanner.nextInt();

			if ("?".equals(op)) {
				flg = false;
				break;
			}else if("+".equals(op)){
				ans = a + b;
			}else if("-".equals(op)){
				ans = a - b;
			}else if("/".equals(op)){
				ans = a / b;
			}else if("*".equals(op)){
				ans = a * b;
			}

			list.add(ans);
		}

		for (int ttt : list) {
			System.out.println(ttt);
		}

	}
}

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

using namespace std;

#define INF LLONG_MAX
#define ll long long int
#define MP make_pair
#define PF push_front
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define F first
#define S second
#define tr(i,c) for(__typeof(c.begin()) i = (c).begin(); i != (c).end(); i++)
#define rtr(i,v) for(__typeof(v.rbegin()) i = (v).rbegin() ; i != (v).rend() ; i++)
#define sint(n); scanf("%d",&n);
#define sll(n); scanf("%lld",&n);
#define pint(n); printf ("%d\n",n);
#define pll(n); printf ("%lld\n",n);
#define sst(n); scanf("%s",n);
#define pst(n); printf ("%s\n",n);
#define f(i,a,b) for(ll i=a;i<b;i++)
#define set(a,b) memset(a, b, sizeof(a))
#define DRT() ll tst;cin>>tst;for(ll test=1;test<=tst;test++)
#define present(c,x) ((c).find(x) != (c).end())

#define TRACE

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

const ll MOD = 1000000007;

/*
    Inbuilt GCC compiler functions
    __gcd(x, y)
    
    int __builtin_ffs (int x)    [ Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero ]
    int __builtin_ffsll (long long) [ Similar to __builtin_ffs, except the argument type is long long ]
    
    int __builtin_clz (unsigned int x)  [ Returns the number of leading 0-bits in x, starting at the most significant bit position. If x is 0, the result is undefined ]
    int __builtin_clzll (unsigned long long)   [ Similar to __builtin_clz, except the argument type is unsigned long long ]
    
    int __builtin_popcount (unsigned int x)  [ Returns the number of 1-bits in x ]
    int __builtin_popcountll (unsigned long long)  [ Similar to __builtin_popcount, except the argument type is unsigned long long ]
*/


inline void add(ll &x, ll y){x+=y; if(x>=MOD)x-=MOD; if(x<0)x+=MOD;}
inline ll mul(ll x, ll y){ return ((ll)x * y)%MOD;}
ll gcd(ll a, ll b){ if(b)return gcd(b,a%b); return a;}
ll power(ll a ,ll p){ll ret = 1; while(p){if(p&1)ret=mul(ret,a); a=mul(a,a); p/=2;}return ret;}
ll phi(ll n){ ll ret=n; ll i = 2;                    // Counts the positive integers up to a given integer n that are relatively prime to n
    if(n%i==0){ ret-=ret/i; while(n%i==0)n/=i;}
    for(i=3; i*i<=n; i++)if(n%i==0){ ret-=ret/i; while(n%i==0)n/=i;}
    if(n>1)ret-=ret/n;return ret;
}

typedef pair<ll, ll> PLL;
typedef vector<ll> VLL;

int main()
{
    char a[10][10];
    sst(a[0]);
    sst(a[1]);
    sst(a[2]);

    ll z=0;
    z+=(ll)(a[2][0]-'0');
    z+=(ll)(a[1][0]-'0')*10;
    z+=100*(ll)(a[0][0]-'0');
    if (z%4==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>


using namespace std;

int main() {
    int a, b;
    char op;

    
    while(std::cin >> a >> op >> b)
    switch(op)
    {
        case '+':
        cout << a + b << endl;
        break;
        case '-':
        cout << a - b << endl;
        break;
        case '*':
        cout << a * b << endl;
        break;
        case '/':
        cout << a / b << endl;
        break;
        case '?':
        break;
    }
}


Measured memory_bytes: 3088
#include <stdio.h>
 
int main(){
    int i,j;
    int a[101][101]={{0}};
    int x,y;
    scanf("%d %d",&x,&y);
    for(j=0;j<x;j++){
        for(i=0;i<y;i++){
            scanf("%d",&a[j][i]);
            a[j][y]+=a[j][i];
            a[x][i]+=a[j][i];
        }
        a[x][y]+=a[j][y];
    }
    for(j=0;j<=x;j++){
        for(i=0;i<=y;i++){
            printf("%d",a[j][i]);
            if(i!=y){
                printf(" ");
            }
        }
         
            printf("\n");
         
    }
    return 0;
}


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

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new PrintStream(System.out));
        int n=Integer.parseInt(f.readLine());
        long[]arr=new long[n];
        for(int i=0;i<n;i++){
            arr[i]=Long.parseLong(f.readLine());
        }
        long ans=0;
        for(int i=0;i<n;i++){
            if(i!=0 && arr[i]!=0)arr[i]+=arr[i-1];
            ans+=arr[i]/2;
            arr[i]%=2;
        }
        System.out.print(ans);
        f.close();
        out.close();
    }
}
class pair implements Comparable <pair>{
    int num;
    int idx;

    public int compareTo(pair other){
        return num- other.num;
    }


    pair(int a, int b)
    {
        num=a;
        idx=b;
    }
}


Measured memory_bytes: 31956
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll h,w,k,ans=1e9+7;cin>>h>>w>>k;
  vector<string> choco(h);
  rep(i,h) cin>>choco[i];
  rep(b,1<<(h-1)) {
    ll tmp=__builtin_popcount(b),nb=tmp+1;
    lvector c(nb);
    bool isok=false;
    rep(j,w) {
      ll now=0;
      rep(i,h) {
        if(choco[i][j]=='1') c[now]++;
        if((b>>i)&1) now++;
      }
      if(*max_element(c.begin(),c.end())>k) {
        if(isok) {tmp=1e9+7;break;}
        tmp++;
        for(auto &x:c) x=0;
        j--;
        isok=true;
        continue;
      }
      isok=false;
    }
    if(ans>tmp) ans=tmp;
  }
  print(ans);
  return 0;
}

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

int main(){
  int n, m; cin >> n >> m;
  vector<pair<int, int>> a(n), b(m);
  for(int i = 0; i < n; i++){
  	int A, B; cin >> A >> B;
  	a[i].first = A; a[i].second = B;
  }
  for(int i = 0; i < m; i++){
  	int A, B; cin >> A >> B;
  	b[i].first = A; b[i].second = B;
  }
  
  vector<int> ans(n);
  
  for(int i = 0; i < n; i++){
    int mn = 1000000000;
  for(int j = 0; j < m; j++){
  	mn = min(mn, abs(a[i].first-b[j].first)+abs(a[i].second-b[j].second));
  }
  for(int j = 0; j < m; j++){
  	if(abs(a[i].first-b[j].first)+abs(a[i].second-b[j].second)==mn){
    	ans[i]=j+1; break;
    }
  }
  }
  
  for(int i = 0; i < n; i++) cout << ans[i] << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cassert>
#include <utility>
#include <set>
#include <map>
using namespace std;

typedef pair<int, int> ii;
typedef long long ll;

ll n, T;
const int maxn = 2e5+1;
ll t[maxn];

int main()
{
  scanf("%lld %lld", &n, &T);
  for (int i = 0; i < n; ++i)
    scanf("%lld", t+i);
  sort(t, t+n);
  ll ans = T;
  for (int i = 1; i < n; ++i)
    {
      ans += min(T, t[i]-t[i-1]);
    }
  printf("%lld\n", ans);
}


Measured memory_bytes: 1664
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N=int(input())
A=list(map(int,input().split()))
A.sort()
X=A.pop()
N-=1
c=0
lst=deque()
count=1
while N:
    lst.append(A.pop())
    if count:
        count-=1
    else:
        X=lst.popleft()
        count=1
    c+=X
    N-=1
print(c)


Measured memory_bytes: 96708
#include <iostream>
#include<algorithm>
#include<vector>
using namespace std;
using ll = long long;
#define INF 1e9

int main() {
	int N;
	cin >> N;
	int C[500], S[500], F[500];
	for (int i = 0; i < N - 1; ++i) {
		cin >> C[i] >> S[i] >> F[i];
	}
	for (int i = 0; i < N; ++i) {
		int t = 0;
		for (int j = i; j < N - 1; ++j) {
			//関数使わなくてもこれで書き下せる
			if (t < S[j]) {
				t = S[j];
			}
			else if (t%F[j] == 0);
			else {
				t = t + F[j] - t % F[j];
			}
			t += C[j];
		}
		cout << t << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll arr[100010];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    //cout << fixed << setprecision(15);

    int N;
    cin >> N;
    REP(i, N)
    {
        cin >> arr[i];
    }
    ll cnt = 0;

    REP(i, N)
    {

        while (arr[i] % 2 == 0)
        {
            arr[i] /= 2;
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


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

int solve(ll x) {
	int cnt = 0;
	while(x % 2 == 0) {
		x /= 2;
		cnt++;
	}
	return cnt;
}

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];

	int ans = 0;
	rep(i, n) ans += solve(a[i]);
	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll N, M;
  cin >> N >>M;
  priority_queue<ll> que;
  for(ll i=0; i<N; ++i){
    ll A;
    cin >> A;
    que.push(A);
  }
  for(ll i=0; i<M; ++i){
    ll tmp = que.top();
    que.pop();
    que.push(tmp/2);
  }
  ll ans=0;
  while(!que.empty()){
    ans += que.top();
    que.pop();
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1400
#include<iostream>
using namespace std;
int main(){
	int N,sum=0;
	cin>>N;
	int Y[N],C[N];
	for(int i=0;i<N;i++){
		cin>>Y[i];
	}
	for(int i=0;i<N;i++){
		cin>>C[i];
	}
	for(int i=0;i<N;i++){
		if(Y[i]>C[i]){
			sum+=Y[i]-C[i];
		}
	}
	cout<<sum<<endl;
	return 0;	
}

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

int main() {
  using namespace std;
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int X, Y;
  cin >> X >> Y;
  int x = 2 * X - Y / 2, y = Y / 2 - X;
  bool ans = Y % 2 == 0 && 0 <= x && 0 <= y;
  cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include<string>
using namespace std;
typedef long long ll;
typedef vector < int > vi;
typedef pair<int,int> pi;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define re(i,a,b) for(ll i=a;i<b;i++)
//add below to remove endl in input just before getline()
//cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n');
int main(){
	//ios::sync_with_stdio(0);cin.tie(0);
	//freopen("input.txt", "r", stdin);
	int a,b;
	cin>>a>>b;
	if(a<=8 && b<=8)cout<<"Yay!";
	else cout<<":(";


	
return 0;}


Measured memory_bytes: 3620
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <utility>
#include <vector>

using namespace std;

int main() {
  int x, ans = 0;
  scanf("%d", &x);
  ans += x / 500 * 1000 + x % 500 / 5 * 5;
  printf("%d\n", ans);
}

Measured memory_bytes: 128
s = list(input())
a = [0]*len(s)
b = [0]*len(s)
dif1 = 0
dif2 = 0
for i in range(0,len(s)):
    if i%2 == 0:
        a[i] = 0
        b[i] = 1
    else:
        a[i] = 1
        b[i] = 0
for i in range(0,len(s)):
    if a[i] != int(s[i]):
        dif1 += 1
    if b[i] != int(s[i]):
        dif2 += 1
print(min(dif1,dif2))


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

char Array[2000][2000];
int count;

void DFS(int h,int w,char c){

  if(Array[h][w] != c || Array[h][w] == '.'){
    return;
  }

  char tmp=Array[h][w];

  Array[h][w] = '.';

  DFS(h-1,w,tmp);
  DFS(h,w+1,tmp);
  DFS(h+1,w,tmp);
  DFS(h,w-1,tmp);

}

int main(){
    int H,W;

    while(1){
      cin >> H >> W;

      if(H == 0 && W == 0){
        break;
      }
      for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
          cin >> Array[i][j];
        }
      }

      for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
          if(Array[i][j] != '.'){
            count++;
            DFS(i,j,Array[i][j]);
          }
        }
      }
      cout << count << endl;

      for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
          Array[i][j] = '.';
        }
      }
      count = 0;
  }
    return 0;
}

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

void solve(long long A, long long B) {
  if (A == B)
    cout << "Draw";
  else if (A == 1)
    cout << "Alice";
  else if (B == 1)
    cout << "Bob";
  else {
    cout << ((A < B) ? "Bob" : "Alice");
  }
  cout << endl;
}

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

  long long A;
  scanf("%lld", &A);
  long long B;
  scanf("%lld", &B);
  solve(A, B);
  return 0;
}


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

using namespace std;

int main(){
  int N, M;
  cin >> N;
  vector<int> D(N);
  for(int i = 0 ; i < N ; i++){
    cin >> D[i];
  }
  cin >> M;
  vector<int> T(M);
  for(int i = 0 ; i < M ; i++){
    cin >> T[i];
  }
  sort(D.begin(),D.end());
  sort(T.begin(),T.end());
  string ans = "YES";
  if(N < M){
    ans = "NO";
  }else{
    int cnt = 0;
    for(int i = 0; i < M ; i++){
      if(T[i] == D[cnt]){

          //cout << "cnt is " << cnt << "T[i] is " << T[i] << "D[cnt] is " << D[cnt] << endl;

          cnt++;
          continue;
      }else if(T[i] > D[cnt]){
        cnt++;
        i--;
      }else{
        ans = "NO";
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 4744
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    char c;
    cin>>c;
    if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o'){
        cout<<"vowel"<<endl;
    }
    else{
        cout<<"consonant"<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rer(i, a, b) for(ll i = ll(a) - 1; i >= ll(b); i--)
#define sz(v) (int)(v).size()
#define pb push_back
#define sc second
#define fr first
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
using namespace std;
typedef long long int ll;
typedef pair <int, int> P;

const ll MOD=1000000007;
vector<ll> a;
int n;
ll lef[200010], righ[200010];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n;
    a.resize(n);
    rep(i,0,n) cin>>a[i];
    lef[0]=0;
    rep(i,1,n+1){
        lef[i]=max(lef[i-1],a[i-1]);
    }
    righ[n]=0;
    rer(i,n,0){
        righ[i]=max(righ[i+1],a[i]);
    }
    rep(i,0,n){
        cout <<max(lef[i], righ[i+1])<<"\n";
    }
}

Measured memory_bytes: 6272
#[allow(dead_code)]
fn main() {
    let n = i::u();
    if n % 10 == 3 {
        println!("{}", "bon");
        return;
    }
    if n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8 {
        println!("{}", "pon");
        return;
    }
    println!("{}", "hon");
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }

    pub fn str() -> String {
        read()
    }

    pub fn s() -> Vec<char> {
        str().chars().collect()
    }

    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


Measured memory_bytes: 2168
N, H, W =(int(i) for i in input().split())
A = [[int(i) for i in input().split()]for i in range(N)]
a = 0

for i in range(N):
    if A[i][0]>=H and A[i][1]>=W:
        a += 1
    else:
        a = a

print(a)


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

namespace atcoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var buffer = Console.ReadLine().Split();
            var N = int.Parse(buffer[0]);
            var M = int.Parse(buffer[1]);
            var union = new UnionFind(N);
            for (int i = 0; i < M; i++)
            {
                buffer = Console.ReadLine().Split();
                var x = int.Parse(buffer[0]) - 1;
                var y = int.Parse(buffer[1]) - 1;
                union.Unite(x, y);
            }

            decimal group = 0;
            decimal noGroup = 0;
            for (int i = 0; i < N; i++)
            {
                if (union.IsRoot(i)) group++;
                if (union.IsNotAff(i)) noGroup++;
            }

            decimal ans = group - 1 + noGroup;
            Console.WriteLine(ans);
        }
    }

    class UnionFind
    {
        List<int> list;

        public bool IsRoot(int n) => list[n] < -1;
        public bool IsNotAff(int n) => list[n] == -1;

        public UnionFind(int n)
        {
            list = Enumerable.Repeat(-1, n).ToList();
        }

        public int Root(int x)
        {
            if (this.list[x] < 0) return x;
            return this.list[x] = Root(this.list[x]);
        }

        public bool Unite(int x, int y)
        {
            x = Root(x);
            y = Root(y);
            if (x == y) return false;
            if (this.list[x] > this.list[y]) Swap(ref x, ref y);
            this.list[x] += this.list[y];
            this.list[y] = x;
            return true;
        }

        public void Swap(ref int x, ref int y)
        {
            var tmp = x;
            x = y;
            y = tmp;
        }

        public int Size(int x)
        {
            return -this.list[Root(x)];
        }
    }
}


Measured memory_bytes: 41744
H, W = map(int, input().split())
S = [input() for _ in range(H)]


def main():
    cnt = [[0] * W for _ in range(H)]
    for h in range(H):
        done = [0] * W
        for w in range(W):
            if S[h][w] == '#' or done[w] == 1:
                continue
            c = 0
            while W > w + c:
                if S[h][w + c] == '#':
                    break
                c += 1
            for k in range(c):
                cnt[h][w + k] += c
                done[w + k] = 1
    for w in range(W):
        done = [0] * H
        for h in range(H):
            if S[h][w] == '#' or done[h] == 1:
                continue
            c = 0
            while H > h + c:
                if S[h + c][w] == '#':
                    break
                c += 1
            for k in range(c):
                cnt[h + k][w] += c
                done[h + k] = 1
    ans = 0
    for r in cnt:
        for c in r:
            ans = max(ans, c - 1)
    print(ans)


main()


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

int main() {
	int N;
	cin >> N;
	int l[N],r[N];
	for(int i=0;i<N;i++){
		cin >> l[i] >> r[i];
	}
	
	int ans=0;
	for(int i=0;i<N;i++){
		ans+=r[i]-l[i]+1;
	}
	
	cout << ans << endl;
}

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

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n);
	for (auto &&a : as)
	{
		cin >> a;
	}

	long double ans = 0;
	for (auto &&a : as)
	{
		ans += 1.0 / a;
	}

	ans = 1 / ans;

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

	return 0;
}

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

int main(){
	int n, T;
	cin >> n >> T;
	vector<int> c(n), t(n);
	rep(i,n) cin >> c[i] >> t[i];
	int m=INF;
	rep(i,n){
		if(T>=t[i]){
			m = min(m,c[i]);
		}
	}
	if(m==INF){
		cout << "TLE" << endl;
	}else cout << m << endl;
	return 0;
}




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


int main()
{
	int n; cin >> n;
	ll ans = 1, maxvalue = 1e18;

	for (int i = 0; i < n; ++i)
	{
		ll a; cin >> a;
		if (a == 0)
		{
			cout << 0 << endl;
			return 0;
		}
		if (a <= maxvalue/ans)
			ans *= a;
		else 
			ans = -1;
	}
	cout << ans << endl;
}



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

int main(){
    int d,t,s;
    cin >> d >> t >> s;
    if(t*s >= d){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3620
#include <iostream>
#include <utility>
using namespace std;
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if (a > b) swap(a, b);
	if (a > c) swap(a, c);
	if (b > c) swap(b, c);
	cout << a << ' ' << b << ' ' << c << endl;
	return 0;
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int N,M;
  ll X;
  cin >> N >> M >> X;
  vv(ll) G(N,vl(M));
  vl cost(N);
  rep(i,N) {
    cin >> cost[i];
    rep(j,M) {
      cin >> G[i][j];
    }
  }
  ll ans = LINF;
  rep(i,1<<N) {
    vl sum(M,0);
    ll c = 0;
    rep(j,N) {
      if((i>>j)&1) {
        c += cost[j];
        rep(k,M) {
          sum[k] += G[j][k];
        }
      }
    }
    bool ok=true;
    rep(j,M) {
      if(sum[j]<X) {
        ok=false;
        break;
      }
    }
    if(ok) {
      chmin(ans,c);
    }
  }
  if(ans==LINF) {
    cout << -1 << endl;
    return 0;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
#include <cstdio>
#include <algorithm>
#include <functional>
#include <cmath>
#include <utility>

using namespace std;

double d,w,h,r[10000];

int main()
{
    while( 1 )
    {
        scanf( "%lf %lf %lf\n", &d, &w, &h );
        if( d == 0 && w == 0 && h == 0 ) break;
        if( d > w )
        {
            swap( d, w );
        }
        if( w > h )
        {
            swap( w, h );
        }
        if( d > w )
        {
            swap( d, w );
        }
        double mini = sqrt( d * d + w * w ) / 2;
        int n;
        scanf( "%d\n", &n );
        for( int i = 0; i <n; i++ )
        {
            scanf( "%lf\n", &r[i] );
            if( mini < r[i] )
            {
                printf( "OK\n" );
            }
            else
            {
                printf( "NA\n" );
            }
        }      
    }
    return 0;
}


Measured memory_bytes: 2664
def main():
    from sys import stdin
    def input():
        return stdin.readline().strip()
    
    n, c = map(int, input().split())
    d = [list(map(int, input().split())) for _ in range(c)]

    '''
    # if I can change the color of the same square many times
    # Warshall-Floyd algorithm
    for k in range(c):
        for i in range(c):
            for j in range(c):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
    '''

    color = [list(map(int, input().split())) for _ in range(n)]

    counters = [[0] * c for _ in range(3)]
    for i in range(n):
        for j in range(n):
            counters[(i+j) % 3][color[i][j] - 1] += 1
    
    # full search
    cost = []
    for group in counters:
        l = []
        # from j to i
        for i in range(c):
            num = 0
            for j in range(c):
                num += d[j][i] * group[j]
            l.append((num, i))
        l.sort()
        cost.append(l[:3])

    ans = 10 ** 9
    for i in range(3):
        for j in range(3):
            for k in range(3):
                if cost[0][i][1] != cost[1][j][1] and cost[1][j][1] != cost[2][k][1] and cost[2][k][1] != cost[0][i][1]:
                    if ans > cost[0][i][0] + cost[1][j][0] + cost[2][k][0]:
                        ans = cost[0][i][0] + cost[1][j][0] + cost[2][k][0]
    
    print(ans)

main()

Measured memory_bytes: 76044
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i< (n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX = 100005;
//頂点番号と距離を記録したい.

/*
方針
rootから見ていく。親との距離が偶数なら同じ色、違うなら違う色を塗れば
よさそう。それで任意の組み合わせについて条件が達成されるが...?

λ関数でdfsを実装するのは理由がわからないけど無理そう。なので外部に.
*/

vector<P> ale[MAX];
int n;
vector<int> color(MAX,-1);

void dfs(int v,bool clr = 0,int p = -1){
    color[v] = clr;
    for(P u : ale[v]){
        if(u.first == p)continue;
        if(u.second%2 == 0){
            dfs(u.first,clr,v);
        }else{
            dfs(u.first,!clr,v);
        }
    }
}

int main(){
    cin>>n;
    rep(i,n-1){
        int u,v,w;cin>>u>>v>>w;u--;v--;
        ale[u].push_back(make_pair(v,w));
        ale[v].push_back(make_pair(u,w));
    }
    dfs(0);
    rep(i,n){
        cout<<color[i]<<endl;
    }
    return 0;
}

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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}


// 最大公約数
ll gcd(ll a, ll b)
{
  if(b == 0) return a;
  return gcd(b, a % b);
}

// mod m におけるa の逆元
ll modinv(ll a, ll m) {
  ll b = m, u = 1, v = 0;
  while (b) {
    ll t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  // ll N; cin >> N;
  ll N, M; cin >> N >> M;
  vector<ll> a(N), b(N); rep(i, N) cin >> a[i] >> b[i];
  vector<ll> c(M), d(M); rep(i, M) cin >> c[i] >> d[i];

  rep(i, N) {
    ll ans = -1;
    ll md = -1;
    rep(j, M) {
      ll di = abs(a[i]-c[j]) + abs(b[i]-d[j]);
      if(md<0 || md > di) {
	ans = j+1;
	md = di;
      }
    }
    cout << ans << endl;
  }
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 3628
import java.util.Scanner;
import java.lang.Math;

public class Main{
    public static void main(String args[]){
        Scanner input = new Scanner(System.in);
        int a = input.nextInt();
        int b = input.nextInt();
        int C = input.nextInt();
        double degree = Math.PI * (double)(C / 180.0);
        double L = a + b + (Math.sqrt(a * a + b * b - 2 * a * b * Math.cos(degree)));
        double S = 0.5 * a * b * Math.sin(degree);
        double h = b * Math.sin(degree);
        System.out.println(S);
        System.out.println(L);
        System.out.println(h);
    }
}


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

int main() {
    int n, k, x[110], sum = 0;
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        x[i] = 0;
        cin >> x[i];
    }

    for (int i = 1; i <= n; i++) {
        sum += min(x[i] * 2, (k - x[i]) * 2);
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
    return x*f;
}
inline void write(int x)
{
    if(x<0)putchar('-'),x=-x;
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
int a[20];
inline long long dfs(int l,int lt,int r,int rt)
{
	if(l==r-1)return 0;
	long long ans=1LL<<62;
	for(int i=l+1;i<r;i++)
	{
		ans=min(ans,dfs(l,lt,i,lt+rt)+dfs(i,lt+rt,r,rt)+1LL*a[i]*(lt+rt));
	}return ans;
}
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    int n=read();
    for(int i=1;i<=n;i++)a[i]=read();
    printf("%lld\n",a[1]+a[n]+dfs(1,1,n,1));
    return 0;
}

Measured memory_bytes: 256
N = gets.to_i
A = gets.split.map &:to_i
B = gets.split.map &:to_i

aa = A.dup
N.times{|i|
  b = B[i]
  sub_0 = [aa[i], b].min
  aa[i] -= sub_0
  b -= sub_0
  sub_1 = [aa[i+1], b].min
  aa[i+1] -= sub_1
}
p A.inject(:+) - aa.inject(:+)

Measured memory_bytes: 20236
def insertion_sort(l, n, g):
    global count
    for i in range(g, n):
        v = l[i]
        j = i - g
        while j >= 0 and l[j] > v:
            l[j + g] = l[j]
            j -= g
            count += 1
        l[j + g] = v


def shell_sort(l, n):
    for i in range(m):
        insertion_sort(l, n, G[i])


def make_g(length):
    if length == 1:
        return [1]

    G = []
    while True:
        if length == 1:
            break
        G.append(length // 2)
        length //= 2
    return G


n = int(input())
l = []
for i in range(n):
    l.append(int(input()))

count = 0
G = make_g(len(l))
m = len(G)

shell_sort(l, n)

print(m)
print(' '.join(map(str, G)))
print(count)
for i in l:
    print(i)



Measured memory_bytes: 45516
#include <bits/stdc++.h>
using namespace std;
#define MD 1000000007
typedef long long int ll;
typedef pair<ll, ll> P;
template <typename T>
std::string tostr(const T &t){std::ostringstream os;os << t;return os.str();}
int dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};

int main()
{
    int H,W;
    cin>>H>>W;
    int N;
    cin>>N;
    vector<int> a(N);
    vector<vector<int>> ans(H, vector<int>(W, 0));
    for(int i=0;i<N;i++) cin>>a[i];
    int pos=0;
    for(int i=0;i<H;i++){
        if(i%2==0){
            for(int j=0;j<W;j++){
                if(a[pos]==0) pos++;
                ans[i][j]=(pos+1);
                a[pos]--;
            }
        }else{
            for(int j=W-1;j>=0;j--){
                if(a[pos]==0) pos++;
                ans[i][j]=(pos+1);
                a[pos]--;
            }
        }
    }
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(j!=W-1) cout<<ans[i][j]<<' ';
            else cout<<ans[i][j];
        }
        cout<<endl;
    }
    return 0;
}

Measured memory_bytes: 384
N=input()
K=int(input())

LEN=len(N)

from functools import lru_cache
@lru_cache(maxsize=None)
def dfs(keta,use,coin):
    ANS=0

    if keta==LEN:
        if use==K:
            return 1
        return 0
        
    if coin==0:
        if use<K:
            ANS+=dfs(keta+1,use+1,0)*9
        ANS+=dfs(keta+1,use,0)

        return ANS

    else:
        kn=int(N[keta])

        if kn==0:
            return dfs(keta+1,use,1)

        ANS+=dfs(keta+1,use,0)
        ANS+=dfs(keta+1,use+1,0)*(kn-1)
        ANS+=dfs(keta+1,use+1,1)

        return ANS

print(dfs(0,0,1))

Measured memory_bytes: 4836
def main():
  sFlag=False
  X= int(input())
  for i in range(-1000,1000):
    for j in range(-1000,1000):
      X_n=i**5-j**5
      if(X_n==X):
        print(i,j)
        sFlag=True
        break
    if(sFlag==True):
      break
 
if __name__=='__main__':
  main()

Measured memory_bytes: 64856
#include <bits/stdc++.h>
//#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
 
 
int main(){
   
  int64_t h,ans=0;
  cin>>h;
  for(int i=0;i>=0;i++){
      if(h==1){
          ans+=pow(2,i);
          break;
      }
      else{
          h=h/2;
          ans+=pow(2,i);
      }
  }
  
  
  
  
  cout<<ans<<endl;
      
  
  
}

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

typedef long long int ll;

const int N = 1e5 + 9;

pair< int, int > el[ N ];
ll dp[ 109 ][ N ];

int main(){
    ios::sync_with_stdio( false );
    int n, m;

    cin >> n >> m;

    for( int i = 1; i <= n; i++ )
        cin >> el[ i ].first >> el[ i ].second;

    sort( el + 1, el + 1 + n );

    for( int i = 1; i <= n; i++ ){
        for( int j = 1; j <= m; j++ ){

            if( j >= el[ i ].first )
                dp[ i ][ j ] = max( dp[ i - 1 ][ j ], dp[ i - 1 ][ j - el[ i ].first ] + el[ i ].second );

            else
                dp[ i ][ j ] = dp[ i - 1 ][ j ];
        }
    }

//    for( int i = 1; i <= n; i++ ){
//        for( int j = 1; j <= m; j++ ){
//            cout << dp[ i ][ j ] << " ";
//        }
//        cout << endl;
//    }

    cout << dp[ n ][ m ];
    return 0;
}

Measured memory_bytes: 79360
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int main(){
    int n;
    const int max = 50000;
    int a[max];
    a[1] = 0;
    for(int i = 2; i < max; i++) a[i] = 1;
    for(int i = 2; i * i <= max; i++){
        for(int j = 2; j*i <= max; j++){
            a[i*j] = 0;
        }
    }
    while(cin >> n){
        if(n == 0) break;
        int count = 0;
        if(n % 2 == 1){
            if(a[n-2]){
                cout << 1 << endl;
            }else{
                cout << 0 << endl;
            }
        }else{
            for(int i = 2; i <= n-i; i++)
                if(a[i] && a[n-i])
                    count++;
            cout << count <<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3252
import java.util.*;
public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
      	int[] array = new int[S.length()-2];
      	for(int i=0;i<S.length()-2;i++){
        	array[i] = Integer.parseInt(S.substring(i,i+3));
          	array[i] = Math.abs(array[i]-753);
        }
      	Arrays.sort(array);
      	System.out.println(array[0]);
    }
}

Measured memory_bytes: 21972
from collections import deque

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

b = deque()

for i, v in enumerate(a):
    if i % 2 == 0:
        b.append(v)
    else:
        b.appendleft(v)

if n % 2 == 1:
    b.reverse()

for num in b:
    print(num, end=' ')
print()


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

using namespace std;

int main() {

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


    vector<int> num(110);

    for (int j = 0; j < N; ++j) {
        num.at(A.at(j))++;
    }

    int res =0;
    for (int i = 1; i < 101; ++i) {
        // cout << num.at(i);
        if(num.at(i)){
            res++;
        }
    }
    cout << res << endl;

}


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

int main() {
	// your code goes here
	long x;
	cin >> x;
	long ans = x/11 * 2;
	if(x%11 == 0);
	else if(x%11 <= 6) ans += 1;
	else ans += 2;
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        String[] grid = new String[3];
        Scanner sc = new Scanner(System.in);

        for (int i=0; i<grid.length; i++)
        	grid[i] = sc.next();

        for (int i=0; i<grid.length; i++)
        	System.out.print(grid[i].charAt(i));

        System.out.print("\n");

        sc.close();
    }
}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
string S,ans;
int pos,acnt,d;
int X,Y;


string get_str(){
  string res;
  while(S[pos]!='>') res+=S[pos++];
  pos++;
  return res;
}

int get_xy(){
  int res=0;
  while(S[pos]!=','&&S[pos]!='<')res=res*10+S[pos++]-'0';
  if(S[pos]==',')pos++;
  return res;
}

void bnf(string str){
  string name;
  int cnt=0,f=0;
  
  while(S[pos]=='<'&&S[pos+1]!='/'){
    pos++;
    name=get_str();
    int x1=get_xy();
    int y1=get_xy();
    int x2=get_xy();
    int y2=get_xy();
    if(x1<=X&&X<=x2&&y1<=Y&&Y<=y2)f=1,bnf(name);
    else cnt++;
    string res;
    while(res!=name){
      if(S[pos+1]=='/')pos+=2;
      else pos++;
      res=get_str();
    }
  }
  if(!f)ans=str,acnt=cnt;
}

int main(){
  int n;
  while(cin>>n,n){
    cin>>S;
    S+="</OUT OF MAIN PANEL>";
      while(n--){
	cin>>X>>Y;
	pos=0;
	acnt=0;
	bnf("OUT OF MAIN PANEL");
	cout <<ans<<" "<<acnt<<endl;
      }
  }
  return 0;
}

Measured memory_bytes: 1224
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
ll fact(ll n) { ll res = 1; for(ll i=2;i<=n;++i) res = res * i; return res;}
ll nCr(ll n, ll r) {return (fact(n)/fact(n-r)*fact(r)) ;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const int inf = 1 << 30;
// clang-format on

int N;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N;
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      if (i * j == N) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <cstring>
#include <algorithm>
#include <functional>
using namespace std;

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

inline void init() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

int m, nmin, nmax, ans, dif;
int tester[205];

int main(void) {
    init();

    while (cin >> m >> nmin >> nmax, m | nmin | nmax) {
        memset(tester, 0, sizeof(tester));
        ans = dif = -1;
        rep (i,m) cin >> tester[i];

        sort(tester, tester + m, greater<int>());

        for (int i = nmin; i <= nmax; ++i) {
            int tmp = tester[i-1] - tester[i];
            if (dif <= tmp) {
                ans = i;
                dif = tmp;
            }
        }
        cout << ans << endl;
        /*rep(i,m) {
            cout << tester[i] << endl;
        }*/
    }
    return 0;
}

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

using namespace std;

typedef vector<int> Vec;
typedef vector<Vec> Mat;

Mat a(5, Vec(5));
int score[5];

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

bool inField(int x, int y)
{
    return (0 <= x && x < 5 && 0 <= y && y < 5);
}

bool up;

int erase(Mat &m, int bp)
{
    bool e[5][5] = {{}};
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {                        
            if (m[i][j] == 0) {
                continue;
            }
            int cnt[2] = {1, 1};
            for (int k = 0; k < 4; k++) {
                int ni = i + dy[k];
                int nj = j + dx[k];
                while (inField(ni, nj) &&
                       m[i][j] == m[ni][nj]) {
                    ni += dy[k];
                    nj += dx[k];
                    ++cnt[k&1];
                }
            }
            if (cnt[0] >= 3 || cnt[1] >= 3) {
                e[i][j] = 1;
            }
        }
    }
    int point = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {
            if (e[i][j]) {
                up = 1;
                point += score[m[i][j]-1] * bp;
                m[i][j] = 0;
            }
        }
    }
    return point;
}

void fall(Mat &m)
{
    for (int j = 0; j < 5; j++) {
        for (int i = 4; i >= 1; i--) {
            if (m[i][j] == 0) {                
                for (int k = i-1; k >= 0; k--) {
                    if (m[k][j] != 0) {
                        swap(m[i][j], m[k][j]);
                        break;
                    }
                }
            }
        }
    }
}

int calc(Mat &m, int bp)
{
    int point = erase(m, bp);
    fall(m);
    return point;
}

int get_point()
{
    Mat b = a;
    int point = 0, bp = 1;
    bool update = 1;
    
    while (update) {
        update = 0;        
        Mat nb = b;
        up = 0;
        int p = calc(nb, bp++);
        if (up) {
            point += p;
            update = 1;
            b = nb;
        }
    }
    return point;
}

int dfs(int y, int x, int n)    
{
    int point = get_point();
    if (n > 0) {
        for (int i = 0; i < 4; i++) {
            int nx = x + dx[i];
            int ny = y + dy[i];
            if (inField(nx, ny)) {
                swap(a[ny][nx], a[y][x]);
                point = max(point, dfs(ny, nx, n-1));
                swap(a[ny][nx], a[y][x]);
            }        
        }
    }
    return point;
}

int main()
{
    int n;
    while (cin >> n, n != -1) {
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                cin >> a[i][j];
            }
        }
    
        for (int i = 0; i < 5; i++) {
            cin >> score[i];
        }

        int max_point = 0;
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                max_point = max(max_point, dfs(i, j, n));
            }
        }   
        cout << max_point << endl;
    }
    return 0;
}

Measured memory_bytes: 1216
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

int p[15][15];
int dp[100050];

int main(void) {
    int N,D,X;
    memset(dp, 0, sizeof(dp));
    memset(p, 0, sizeof(p));

    scanf("%d%d%d",&N,&D,&X);
    for(int i=0; i<D; i++) {
        for(int j=0; j<N; j++)
            scanf("%d",&p[i][j]);
        p[i][N] = 1;
    }

    int now = X;
    int res;
    for(int i=0; i<D-1; i++) {
        res=0;
        memset(dp, 0, sizeof(dp));
        for(int m=0;m<=now; m++) {
            for(int t=0; t<=N; t++)
                if(m-p[i][t] >= 0)
                    dp[m] = max(dp[m], dp[m-p[i][t]] + p[i+1][t]);
            res = max(dp[m], res);
        }
        now = res;
    }
    printf("%d\n", now);
    return 0;
}

Measured memory_bytes: 1424
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;

int main() {

	int n,m;
	cin>>n>>m;
	vector<int>v;
	int sum=0;
	for(int i=0; i<m; i++){
		int ar; cin>>ar;
		v.push_back(ar);
		sum += v[i];
	}
	cout<<(sum > n ? -1 : n-sum)<<endl;
}


Measured memory_bytes: 3656
#include<iostream>
using namespace std; // 575

int main() {
	int K, N;
	cin >> N >> K;
	cout << N - K + 1;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

はい
*/

Measured memory_bytes: 256