akhauriyash/Code-Regression huggingface dataset:
import itertools
import math
N = int(input())
P = tuple(map(int,input().split()))
Q = tuple(map(int,input().split()))
lis = [[] for _ in range(math.factorial(N))]
l = list(range(1,N+1))
lis = list(itertools.permutations(l,N))
a = lis.index(P)
b = lis.index(Q)
print(abs(a - b))

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

#define rep(i,a,b) for(auto i=(a); i<(b); ++i)
#define trav(a,x) for(auto& a: x)
#define all(x) begin(x),end(x)
#define sz(x) (int)size(x)
#define PB push_back
using ll = long long;
using ld = long double;
using pii = pair<int,int>;
using vi = vector<int>;

struct edge{int to;};
using graph = vector<vector<edge>>;

int main() {
  cin.sync_with_stdio(0); cin.tie(0);
  cin.exceptions(cin.failbit);

  int n;
  cin >> n;

  vi comp(n + 1);
  vi fac(n + 1);
  rep(i, 2LL, n + 1) {
    if (comp[i]) continue;
    fac[i] = i;
    for (auto j = i * i; j <= n; j += i) {
      comp[j] = true;
      fac[j] = i; 
    }
  }

  auto num_factors = [&](int i) {
		       if (i == 1) return 1LL;
		       ll res = 1;
		       while (i != 1) {
			 auto f = fac[i];
			 int cnt = 0;
			 while (i % f == 0) {
			   cnt++;
			   i /= f;
			 }
			 res *= (cnt + 1);
		       }
		       return res;
		     };
  ll res = 0;
  rep(i, 1, n) {
    res += num_factors(i);
  }
  cout << res << '\n';
}


Measured memory_bytes: 11096
n, m = map(int, input().split())
shops = sorted([list(map(int, input().split())) for i in range(n)])

def main():
  cost = 0
  got = 0
  for shop in shops:
    if got + shop[1] <= m:
      got += shop[1]
      cost += shop[0] * shop[1]
    else:
      cost += (m - got) * shop[0]
      return cost
  return cost
  
print(main())

Measured memory_bytes: 28644
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define INF 10000000000000
#define MOD 1000000007LL
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
// input vector
template<typename T>
void invec(vector<T> &A){for(T& a : A) cin >> a;}

struct UnionFind {
    vector<int> par, rank; //根，木の高さ

    UnionFind(int n) : par(n), rank(n, 1) {
        iota(par.begin(), par.end(), 0);  // 初期では親は自分自身
    }
    void init(int n) {
        iota(par.begin(), par.end(), 0);
        rank.assign(n, 1);
    }

    int root(int x) {
        if (par[x] == x) return x;
        else return par[x] = root(par[x]); //径路圧縮
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y); // 径路圧縮
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};

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

i64 N, M; cin >> N >> M;
VI p(N); invec(p);
UnionFind uf(N+1); // p の連結性
rep(i, 0, M){
    int x, y; cin >> x >> y;
    uf.merge(p[x-1], p[y-1]);
}
int cnt = 0;
rep(i, 0, N)
    if (uf.issame(i+1, p[i])) ++cnt;

cout << cnt << "\n";
}
// 書いて考える．場合分け
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，次にDP
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり
// 実行エラー：vector添え字超え．0割り．



Measured memory_bytes: 1792
#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
#include<stack>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>
int main(void)
{
    int ans =0;
    int l,r,d;
   cin>>l>>r>>d;

   for(int i=l;i<=r;i++)
   {
       if(i%d==0) ans ++;

   }

cout<<ans<<endl;

}

Measured memory_bytes: 3184
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

signed main(){
    int n,m;
    cin >> n >> m;
    cout << n * m << endl;
    return 0;
}


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

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

  vector<int> d(n);
  int sum = 0;
  for(int i = 0; i < n; i++){
    cin >> d.at(i);

    int plus = 1;
    for(int j = 0; j < i; j++){
      if(d.at(i) == d.at(j)){
        plus = 0;
        break;
      }
    }
    sum += plus;
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    int a;
    cin >> a;
    int b;
    cin >> b;
    if (a>b){
        cout << "a > b"<<"\n";
    }else if (a==b){
        cout << "a == b" <<"\n";
    }else if (a<b){
        cout << "a < b" <<"\n";
    }
}


Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define INF 1000000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec) rep(i, vec.size()) cout << vec[i] << " "; print("");
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
typedef long long ll;
using namespace std;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;

void Main(){

	string s;
	cin >> s;
	ll size = s.size();
	
	if(size == 2 && s[0] == s[1]){
		print2(1, 2);
		return;
	}
	
	rep2(i, 2, size){
		char t = s[i - 2];
		char u = s[i - 1];
		char v = s[i];
		if(t == u){
			print2(i - 1, i);
			return;
		}
		if(t == v){
			print2(i - 1, i + 1);
			return;
		}
		if(u == v){
			print2(i, i + 1);
			return;
		}
	}
	print2(-1, -1);
	
}

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





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



int main() {
  string S;
  cin>>S;
  
  vector<char> vec(20,'2');
  
  int m=0;
  for(int i=0;i<S.size();i++){
    if(S.at(i)=='1'){
      m++;
      vec.at(m)='1';
    }
    else if(S.at(i)=='0'){
      m++;
      vec.at(m)='0';
    }
    else{
      vec.at(m)='2';
      m--;
      m=max(0,m);
    }
  }
  for(int i=1;i<20;i++){
    if(vec.at(i)=='1'||vec.at(i)=='0'){
      cout<<vec.at(i);
    }
    else break;
  }
  cout<<endl;
      
}

Measured memory_bytes: 3552
#include<stdio.h>
int main(){
int x,y;
char op;
scanf("%d %c %d",&x,&op,&y);
while(op!='?')
{
switch(op)
{
case '+':
printf("%d\n",x+y);
break;
case '-':
printf("%d\n",x-y);
break;
case '*':
printf("%d\n",x*y);
break;
case '/':
printf("%d\n",x/y);
break;
}
scanf("%d %c %d",&x,&op,&y);
}
return 0;
}


Measured memory_bytes: 2036
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
using namespace std;

constexpr int N = 100000;

vector<int> sieve()
{
    vector<bool> nums(N+1, true);
    for (int i = 2; i <= N; ++i)
    {
        if (nums[i])
        {
            for (int j = i+i; j <= N; j+=i)
            {
                nums[j] = false;
            }
        }
    }
    
    vector<int> result;
    result.reserve(N>>1);
    for (int i = 2; i <= N; ++i)
    {
        if (nums[i])
        {
            result.push_back(i);
        }
    }
    return result;
}

vector<int> gather_like(const vector<int>& primes)
{
    vector<int> like;
    like.reserve(N>>1);
    for (auto itr = primes.begin(); *itr <= (N>>1); ++itr)
    {
        int like_num = (*itr) * 2 - 1;
        if (find(primes.begin(), primes.end(), like_num) != primes.end())
        {
            like.push_back(like_num);
        }
    }
    return like;
}


int main(void){
    int Q, l[N+10], r[N+10];
    scanf("%d", &Q);
    for (int i = 1; i <= Q; ++i)
    {
        scanf("%d %d", l+i, r+i);
    }
    
    vector<int> primes = sieve();
    vector<int> like = gather_like(primes);
    
    for (int i = 1; i <= Q; ++i)
    {
        auto itr_l = lower_bound(like.begin(), like.end(), l[i]);
        auto itr_r = upper_bound(like.begin(), like.end(), r[i]);
        printf("%ld\n", itr_r - itr_l);
    }
    return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long arr[n];
    unordered_map<long long,long long > m;
    vector<pair<long long ,long long >> v1;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
       // m[arr[i]]++;
    }
    sort(arr,arr+n);
    for(int i=0;i<n;i++)
    {
       // cin>>arr[i];
        m[arr[i]]++;
    }
    long long sum1=0;
    for(auto itr=m.begin();itr!=m.end();itr++)
    {
        v1.push_back(make_pair(itr->first,itr->second));
    }
   // cout<<v1.size();
   sort(v1.begin(),v1.end());
//   for(int i=0;i<v1.size();i++)
//   cout<<v1[i].first<<" "<<v1[i].second<<" ";
    for(int i=0;i<v1.size();i++)
    {
        for(int j=i+1;j<v1.size();j++)
        {
            for(int k=j+1;k<v1.size();k++)
            {
              if(v1[i].first+v1[j].first>v1[k].first)
              {
                  sum1=sum1+v1[i].second*v1[j].second*v1[k].second;
              }
            }
        }
    }
    cout<<sum1;
}

Measured memory_bytes: 3612
def main():


   A = int(input())
   bList = list(map(int,input().split()))
   ansList = []
   flag = False
   ansList.append(bList[0])

   if A==2:
      print(bList[0]*2)
      exit()

   for i in range(1,A-1):
      if i == A-2:
         if bList[i-1] <= bList[i]:
            ansList.append(bList[i-1])
            ansList.append(bList[i])
         else:
            ansList.append(bList[i])
            ansList.append(bList[i])
         break


      if bList[i-1] <= bList[i]:
         ansList.append(bList[i-1])
      else:
         ansList.append(bList[i])
   print(sum(ansList))









if __name__== "__main__":
    main() 



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

N = int(input())

answer = 0
for _ in range(N):
    x,u = input().split()
    if u == "JPY":
        money = int(x) 
    else:
        money = float(x)*380000.0
    answer += money
print(answer)


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

int main() {
    int n,k;
    int a[100005],b[100005];
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(int i=0;i<=n+1;i++) b[i]=INT_MAX;
    b[1]=0;
    for(int i=1;i<n;i++)
    {
        for(int j=1;j<=k && i+j<=n;j++)
        {
            b[i+j]=min(b[i+j],b[i]+abs(a[i+j]-a[i]));
        }
    }
    cout<<b[n]<<endl;
    return 0;
}


Measured memory_bytes: 4372
import bisect
import heapq
import sys
import queue


input = sys.stdin.readline
sys.setrecursionlimit(100000)


class V:
    def __init__(self, f):
        self.f = f
        self.v = None

    def __str__(self):
        return str(self.v)

    def ud(self, n):
        if self.v is None:
            self.v = n
        else:
            self.v = self.f(self.v, n)

    def get(self):
        return self.v


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def main():
    N = int(input())
    A = read_list()
    print(
        "APPROVED"
        if all(map(lambda a: a % 2 == 1 or (a % 3 == 0 or a % 5 == 0), A))
        else "DENIED"
    )


if __name__ == "__main__":
    main()


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

using namespace std;

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

	int a, b, c;
	cin >> a >> b >> c;
	if ((a == 7 && b == 5 && c == 5)
	    || (a == 5 && b == 7 && c == 5)
	    || (a == 5 && b == 5 && c == 7)) {
		cout << "YES\n";
	} else {
		cout << "NO\n";	
	}

	return 0;
}



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

int main(){
  map<string,int> table;
  string word, frequent, longest;
  size_t N=0;
  while(cin >> word){
    table[word]+=1;
    if(table[word]>N){
      N = table[word];
      frequent = word;
    }
    if(word.size()>longest.size()){
      longest = word;
    }
    
  }

  cout << frequent << " " << longest << endl;
  return 0;
  
}
  

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

using namespace std;
using ll = long long;

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

    cout << ((1800ll * M + 100ll * N) << M) << endl;
    
    return 0;
}

Measured memory_bytes: 888
#include <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#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 gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

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

    int maxV;
    while (cin >> maxV, maxV)
    {

        int sum = 0;
        REP(i, 9)
        {
            int a;
            cin >> a;
            sum += a;
        }

        cout << maxV - sum << endl;
    }
    return 0;
}



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

using namespace std;

struct Node
{
    int key;
    Node *right, *left, *parent;
};

Node *root, *nullNode;

Node *createNode(int key)
{
    Node *n = (Node *)malloc(sizeof(Node));
    n->key = key;
    n->left = nullNode;
    n->right = nullNode;
    return n;
}

void insert(int k)
{
    Node *y = root, *z = createNode(k);
    for (Node *i = root; i != nullNode; z->key < i->key ? i = i->left : i = i->right)
    {
        y = i;
    }

    z->parent = y;
    if (y == nullNode)
        root = z;
    else if (z->key < y->key)
        y->left = z;
    else
        y->right = z;
}

void inorder(Node *n)
{
    if (n == nullNode)
        return;
    inorder(n->left);
    printf(" %d", n->key);
    inorder(n->right);
}

void preorder(Node *n)
{
    if (n == nullNode)
        return;
    printf(" %d", n->key);
    preorder(n->left);
    preorder(n->right);
}

void deleteNode(Node *n)
{
    if (n == nullNode)
        return;
    deleteNode(n->left);
    deleteNode(n->right);
    free(n);
}

void deleteTree()
{
    deleteNode(root);
}

int main()
{
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        string ord;
        cin >> ord;
        if (ord == "insert")
        {
            int k;
            cin >> k;
            insert(k);
        }
        else
        {
            inorder(root);
            printf("\n");

            preorder(root);
            printf("\n");
        }
    }

    deleteTree();

    return 0;
}



Measured memory_bytes: 26712
#include <iostream>
#include <cmath>
#define INF 1e+9
using namespace std;

int n;
int cost[15][15];
int dp[1 << 15][15];

int rec(int S,int v){
	if(dp[S][v] >= 0) return dp[S][v];
	if(S == (1 << n) - 1 && v == 0) return dp[S][v] = 0;
	int res = INF;
	for(int i = 0;i < n;i++){
		if(!(S >> i & 1)){
			res = min(res,rec(S | 1 << i,i) + cost[v][i]);
		}
	}
	return dp[S][v] = res;
}

int main(){
	int e;
	cin >> n >> e;
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++) cost[i][j] = INF;
	}
	for(int i = 0;i < e;i++){
		int s,t,d;
		cin >> s >> t >> d;
		cost[s][t] = d;
	}
	for(int i = 0;i < (1 << n);i++){
		for(int j = 0;j < n;j++) dp[i][j] = -1;
	}
	int res = rec(0,0);
	if(res == INF) cout << -1 << endl;
	else cout << res << endl;
	return 0;
}

Measured memory_bytes: 5004
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <set>
#include <queue>
#include <map>
#include <numeric>
#include <functional>
#include <math.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

#define INF ((int)1e9)
#define INFLL ((ll)1e18)
#define MOD (998244353LL)


int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    int N, S;
    cin >> N >> S;
    vector<int> A(N);
    for (int n = 0; n < N; ++n) {
        cin >> A[n];
    }
    
    vector<vector<ll>> DP(N+1, vector<ll>(S+1));
    DP[0][0] = 1;
    for (int n = 1; n <= N; ++n) {
        for (int s = 0; s <= S; ++s) {
            DP[n][s] = 2 * DP[n-1][s] % MOD;
            if (s-A[n-1] >= 0) {
                (DP[n][s] += DP[n-1][s-A[n-1]]) %= MOD;
            }
        }
    }
    cout << DP[N][S] << endl;

    return 0;
}


Measured memory_bytes: 73748
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18

ll mod = 1e9+7;
  
int main() {
	// 入力
	ll N;cin>>N;
	ll A[N];
    REP(i,N)cin>>A[i];
    
	// 解法
	bool ans = true;
	REP(i,N){
		// printf("%d \n", i);
		if (A[i]%2==0){
			// printf("flag A: %d \n", A[i]);
			if (A[i]%3!=0 & A[i]%5!=0){
				// printf("flag B: %d \n", A[i]);
				ans = false;
			}
		}
	}

	//出力
	if (ans) printf("APPROVED\n");
	else printf("DENIED\n");
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
//    class Main {
        public static void main(String args[]) {
            Scanner sc=new Scanner(System.in);
            int a=sc.nextInt();
            int b=sc.nextInt();
            int c=sc.nextInt();
            int k=sc.nextInt();
            while(a>=b&&k>0) {
                b*=2;
                k--;
            }
            while(k>0) {
                c*=2;
                k--;
            }
            if(a<b&&b<c) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
//    }
}

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

#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//以降 cin の入力元が 'input.txt' になる
//std::ifstream in("input.txt");
//std::cin.rdbuf(in.rdbuf());


signed main()
{
    gearup;
    ll n,m; cin >> n >> m;
    vs a(n),b(m);
    rep(i,n)cin>>a[i];
    rep(i,m)cin>>b[i];
    for(int i=0;i<n-m+1;i++){
        for(int j=0;j<n-m+1;j++){
            bool res = true;
            rep(ii,m)rep(jj,m)if(a[i+ii][j+jj] != b[ii][jj] )res=false;
            if(res){
                out("Yes");
                return 0;
            }
        }
    }
    out("No");
}

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

using namespace std;

int p, q, a, n;

int dfs(int x, int y, int prod, int cnt) {
	// printf("%d/%d %d %d\n", x, y, prod, cnt);
	if(q*x == p*y) {
		// printf("%d/%d\n", x, y);
		return 1;
	}
	if(cnt == n) return 0;
	if(q*x > p*y) return 0; // p/q < x/y

	int ret = 0;
	for(int ny = prod; ny * y <= a; ny++) {
		// x/y + 1/ny 
		ret += dfs(x*ny+y, y*ny, ny, cnt+1);
	}
	return ret;
}

int main() {
	while(cin >> p >> q >> a >> n, p) {
		cout << dfs(0, 1, 1, 0) << endl;
	}

	return 0;
}

Measured memory_bytes: 3080
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

/*BigInteger
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace xxx = boost::multiprecision;
using Bint = xxx::cpp_int;
using Real = xxx::number<xxx::cpp_dec_float<1024>>;
*/

#define int long long
#define pb(x) push_back(x)
#define m0(x) memset((x), 0LL, sizeof(x))
#define mm(x) memset((x), -1LL, sizeof(x))

//container
#define ALL(x) (x).begin(), (x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
#define PERM(c) \
  sort(ALL(c)); \
  for (bool c##p = 1; c##p; c##p = next_permutation(ALL(c)))

// debug
#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;

// bit_macro
#define Bit(n) (1LL << (n))
#define Bitset(a, b) (a) |= (1LL << (b))
#define Bitunset(a, b) (a) &= ~(1LL << (b))
#define Bitcheck(a, b) ((((a) >> (b)) & 1LL) == 1LL)
#define Bitcount(a) __builtin_popcountll((a))

//typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

//constant
constexpr int INF = (int)1e18;
constexpr int MOD = (int)1e9 + 7;
constexpr double PI = (double)acos(-1);
constexpr double EPS = (double)1e-10;
constexpr int dx[] = {-1, 0, 0, 1, 0, -1, -1, 1, 1};
constexpr int dy[] = {0, -1, 1, 0, 0, 1, -1, 1, -1};

//
template <typename T>
void chmax(T &a, T b) { a = max(a, b); }
template <typename T>
void chmin(T &a, T b) { a = min(a, b); }
//
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

//
struct Accelerate_Cin {
  Accelerate_Cin() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);
  };
} Accelerate_Cin;

signed main() {
  int N;
  vector<pair<int, P>> v;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back({-a - b, P(a, b)});
  }

  sort(ALL(v));

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      ans += v[i].second.first;
    } else {
      ans -= v[i].second.second;
    }
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4980
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    x,y = LI()
    print(x+y//2)
    return

#B
def B():
    return

#C
def C():
    n = list(map(int,S()))
    l = len(n)
    dp = [[[0 for k in range(16)] for j in range(2)] for i in range(l+1)]
    dp[0][0][0] = 1
    for i in range(l):
        for j in range(2):
            for k in range(9):
                x = 9 if j else n[i]
                for d in range(x+1):
                    if d == 3:
                        f = 1
                    elif d == 5:
                        f = 2
                    elif d == 7:
                        f = 4
                    else:
                        if k == 0 and d == 0:
                            f = 0
                        else:
                            f = 8
                    dp[i+1][j or d < n[i]][k|f] += dp[i][j][k]
    ans = 0
    for i in range(2):
        ans += dp[l][i][7]
    print(ans)
#D
def D():
    def factorial(n):
        if n <= 3:
            return [n]
        l = []
        i = 2
        m = n
        while i**2 <= n:
            while m%i == 0:
                l.append(i)
                m //= i
            i += 1
        if m != 1:
            l.append(m)
        return l

    n = I()
    d = defaultdict(int)
    for i in range(2,n+1):
        l = factorial(i)
        for j in l:
            d[j] += 1
    a3 = 0
    a5 = 0
    a15 = 0
    a25 = 0
    a75 = 0
    for i in d.keys():
        if d[i] >= 74:
            a75 += 1
        if d[i] >= 24:
            a25 += 1
        if d[i] >= 14:
            a15 += 1
        if d[i] >= 4:
            a5 += 1
        if d[i] >= 2:
            a3 += 1
    ans = a75+(a3-1)*a25+(a5-1)*a15+(a3-2)*a5*(a5-1)//2
    print(ans)
#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


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

int main(void){
	int n;
	cin >> n;
	vector<int> v(n);
	for(auto& x : v){
		cin >> x;
	}
	sort(v.begin(), v.end());
	double ans = v[0];
	for(int i = 1; i < n; ++i){
		ans += v[i];
		ans /= 2.0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
long long a, b, c, d, most;
int main()
{
	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
	most=a*c;
	if((a*d)>most)most=a*d;
	if((b*c)>most)most=b*c;
	if((b*d)>most)most=b*d;
	printf("%lld", most);
}

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

int main()
{
    int n;
    while(cin>>n)
    {
        n%=10;
        if(n==2 || n==4||n==5||n==7||n==9)cout<<"hon"<<endl;
        else if(n==0||n==1||n==6||n==8)cout<<"pon"<<endl;
        else cout<<"bon"<<endl;
    }
}


Measured memory_bytes: 3636
import sys
X, N = map(int, input().split())
if N == 0:
    print(X)
    sys.exit()
p = list(map(int, input().split()))
lis = [i for i in range(102)]
for val in p:
    if val in lis:
        lis.remove(val)

d = {}
for i in lis:
    d[i] = abs(i - X)
ds = sorted(d.items(), key=lambda x: x[1])
print(ds[0][0])

Measured memory_bytes: 9208
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){

    std::fill( (T*)array, (T*)(array+N), val );
}

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

bool IsPrime(ll num){
    if(num < 2) return false;
    else if(num == 2) return true;
    else if(num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for(ll i = 3; i <= sqrtNum; i += 2){
        if(num%i==0){
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}

signed main(){
  int n,k; cin>>n>>k;
  int r,s,p; cin>>r>>s>>p;
  string t; cin>>t;
  ll ans = 0;
  rep(i,n){
    if(i>=k && t[i]==t[i-k]){
      t[i] = 'q';
    }
    else{
      if(t[i]=='r') ans += p;
      else if(t[i]=='s') ans += r;
      else ans += s;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
#define rep(i, n) for (ll i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef long double ld;




int main(){
    ll N;
    cin >> N;
    ll ans = 0;
    for(int i = 1;i < N; i++){
        ans += ( N - 1 ) / i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3548
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

template <class T, class U>
inline bool chmin(T &lhs, const U &rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

template <class T, class U>
inline bool chmax(T &lhs, const U &rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

// [l, r) from l to r
struct range {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr range(int l_, int r_): l(l_), r(std::max(l_, r_)) { }
  constexpr itr begin() const { return l; }
  constexpr itr end() const { return r; }
};

// [l, r) from r to l
struct revrange {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr revrange(int l_, int r_): l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr itr begin() const { return r; }
  constexpr itr end() const { return l; }
};

int main() {
  std::string T;
  std::cin >> T;
  for (auto &c: T) {
    if (c == '?') {
      c = 'D';
    }
  }
  std::cout << T << '\n';
  return 0;
}


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

using namespace std;

string s;

int main() {
	cin >> s;
	if (s[s.size() - 1] == 's') {
		cout << s << "es" << endl;
	}
	else {
		cout << s << "s" << endl;
	}
	return 0;
}

Measured memory_bytes: 3632
#include "bits/stdc++.h"
using namespace std;

int main() {
	long long N, A, B, C, D;
	string S;
	cin >> N >> A >> B >> C >> D >> S;
	A--, B--, C--, D--;
	if (C < D) {
		bool check = true;
		for (int i = A; i <= D - 1; i++) {
			if (S.substr(i, 2) == "##") check = false;
		}
		cout << (check ? "Yes" : "No") << endl;
	}
	else {
		bool check = true;
		for (int i = A; i <= C - 1; i++) {
			if (S.substr(i, 2) == "##") check = false;
		}
		if (!check) {
			cout << "No" << endl;
			return 0;
		}
		check = false;
		for (int i = B - 1; i <= D - 1; i++) {
			if (S.substr(i, 3) == "...") check = true;
		}
		cout << (check ? "Yes" : "No") << endl;
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define fin ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ii pair<int,int>
#define F first
#define S second
#define pb push_back
#define pf push_front
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fore(i,a,b) for(int i = a;i < b; i+= 1)
#define forr(i,a) for(int i = a; i >= 0; i--)
#define fori(i,m) for(auto i = m.begin(); i != m.end(); i++) 
#define sz(s) int(s.size())
#define cls(a,car) memset(a,car,sizeof (a))
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ii> vii;
const int N = 1 * 1e5 + 5;
const ll mod = 1e9 + 7;
const int INF = INT_MAX;
const ll INFCAD  = ll(INT_MAX) * 2 + 1;
const double E = 1e-9;
int P[N], rak[N];
int n;
int subset;
int FIND(int u){return P[u] == u?u:P[u] = FIND(P[u]);}
int main(){
   // freopen("in","r",stdin);
    //freopen("out","w",stdout);
    fin;
    cin >> n;
    subset = n;
    ii x[n + 1], y[n + 1];
    vector<pair<ll, pair<int, int> > > aux;
    fore(i, 0, n){
        P[i] = i;
        rak[i] = 0;
        cin >> x[i].F >> y[i].F;
        x[i].S = y[i].S = i;
    }
    sort(x, x + n);
    sort(y, y + n);
    fore(i, 1, n){
        aux.pb({x[i].F - x[i - 1].F, {x[i].S, x[i - 1].S}});
        aux.pb({y[i].F - y[i - 1].F, {y[i].S, y[i - 1].S}});
    }
    sort(all(aux));
    ll w = 0;
    fore(i, 0, sz(aux)){
        if(subset == 1)
            break;
        ll cost = aux[i].F;
        int u = aux[i].S.F;
        int v = aux[i].S.S;
        int x = FIND(u);
        int y = FIND(v);
        if(x != y){
            if(rak[x] > rak[y]){
                P[y] = x;
            }else{
                P[x] = y;
                if(rak[x] == rak[y])
                    rak[y]++;
            }
            subset--;
            w += cost;
        }
    }
    cout << w << '\n';
    return 0;
}   

Measured memory_bytes: 8560
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <set>
#include <cstdio>
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define P pair<int, int>

#define MOD 1000000007
#define INF 1012345678
#define NINF (-2147483647-1)
#define LLINF 9223372036854775807
using ll = long long;
using namespace std;

int main() {
    int N;
    cin >> N;
    ll ans = 0;
    vector<int> A(N);
    for (int i = 0; i < N; i++)
    {
        int v;
        cin >> v;
        A[i] = v;
    }
    for (int i = 0; i < N; i++)
    {
        int c;
        cin >> c;
        A[i] -= c;
        if (A[i] > 0) {
            ans += A[i];
        }
    }
    cout << ans << endl;
    getchar(); getchar();
    return 0;
}

Measured memory_bytes: 256
N = int(input())
P = list(map(int, input().split()))

M = [P[0]]
tmp_min = P[0]
for i in range(1, N):
    if P[i] < tmp_min:
        tmp_min = P[i]
    M.append(tmp_min)

ans = 0
for i in range(N):
    if P[i] <= M[i]:
        ans += 1

print(ans)

Measured memory_bytes: 26012
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

#define rep(i,n) for(ll i=0;i<(n);++i)
using ll = long long;
using pll = pair<ll, ll>;
constexpr ll INF = (1LL << 60);
constexpr ll MOD = (1e9 + 7);
//constexpr ll MOD = (998244353);

typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

ll maxVec(vector<ll> &v) {
	ll ans = -INF;
	rep(i, v.size()) {
		ans = max(ans, v[i]);
	}
	return ans;
}


int main() {
	ll n,w;
	cin >> n >> w;
	vvl wv = vvl(n, vl(2));
	vvl dp = vvl(n + 1, vl(w + 1, 0));
	rep(i, n) {
		cin >> wv[i][0] >> wv[i][1];
	}
	
	rep(i, n) {
		rep(j, w) {
			dp[i + 1][j + 1] = dp[i][j + 1];
			if (j + 1 - wv[i][0] >= 0)dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j + 1 - wv[i][0]] + wv[i][1]);
		}
	}
	cout << dp[n][w] << endl;
}

Measured memory_bytes: 80256
w = input()

if len(w) % 2 != 0:
    print('No')
    exit()

cnt = [0]*30
for i in range(len(w)):
    a = ord(w[i]) - ord('a')
    cnt[a] += 1

for i in range(len(cnt)):
    if cnt[i] % 2 != 0:
        print('No')
        exit()

print('Yes')

Measured memory_bytes: 9076
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define INF 0x3f3f3f3f
#define endl '\n'
#define ll long long
#define int long long
#define f first
#define s second
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int>> ppi;
typedef vector<vector<int>> mat;
const ll mod = 1e9+7;
const ll cfmod = 998244353;
const ll LINF = 0x3f3f3f3f3f3f3f;
const int MAXN = 2e5+5;

int a, b, c, n, m, k, v[MAXN];
string s, t, u;


int32_t main() {
	cin >> s;
	if(s == "Sunny") cout << "Cloudy" << endl;
	else if(s == "Cloudy") cout << "Rainy" << endl;
	else cout << "Sunny" << endl;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int r = parseInt(sc.next());
		sc.close();
		out.println(r*2*Math.PI);
	}
}


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

void MAIN() {
    int n, k;
    scanf("%d%d", &n, &k);
    std::vector<int> cnt(26);
    char str[11];
    for(int i = 0; i < n; ++ i) {
        scanf("%s", str);
        ++ cnt[str[0] - 'A'];
    }
    int ans = 0;
    while(true) {
        int meow = 0;
        std::sort(cnt.begin(), cnt.end());
        for(int i = 25; i >= 0; -- i) {
            if(cnt[i] > 0) {
                ++ meow;
                -- cnt[i];
            } else {
                break;
            }
            if(meow == k) {
                break;
            }
        }
        if(meow < k) {
            break;
        }
        ++ ans;
    }
    printf("%d\n", ans);
}

int main() {
    MAIN();
    return 0;
}


Measured memory_bytes: 256
n = int(input())
data = input().split(" ")
m = []

for i in range(n):
  count = 0
  number = int(data[i])
  bit = True
  while bit:
    if number % 2 == 0:
      count += 1
      number /= 2
    else:
      bit = False
  m.append(count)

print(min(m))

Measured memory_bytes: 3060
/***************************************************
	> File Name: Unkown_Error.cpp
	> Author: Zcorpio
	> Mail: 1113043195@qq.com 
	> Created Time: [Data_Deleted]
***************************************************/
#include<bits/stdc++.h>
//#define int long long
#define rint register int
#define mst(a,b) memset(a,b,sizeof(a))
#define go(u) for(int i=head[u],v=to[i];i;v=to[i=nxt[i]])
#define F(i,a,b) for(register int i=(a),i##_end=(b);i<=i##_end;++i)
#define R(i,a,b) for(register int i=(a),i##_end=(b);i>=i##_end;--i)
#define File(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
using namespace std;
//const int mod=1e9+7;
//const int mod=998244353;
typedef double db;
typedef long long ll;
typedef long double ldb;
typedef unsigned long long ull;
/*
template<typename T> inline T max(T a,T b){return a>b?a:b;}
template<typename T> inline T min(T a,T b){return a<b?a:b;}
template<typename T> inline T abs(T a){return a>0?a:-a;}
template<typename T> inline bool chkmin(T &a,T b){return a<b?a=b,1:0;}
template<typename T> inline bool chkmax(T &a,T b){return a>b?a=b,1:0;}
template<typename T> inline T gcd(T a,T b){T t;if(a<b)
{while(a){t=a;a=b%a;b=t;}return b;}else{while(b){t=b;b=a%b;a=t;}return a;}}
template<typename T> inline T sqr(T x){return x*x;}
inline void write(T k,char ch=0)
{
	if(k<0)k=-k,putchar('-');
	if(k>=10)write(k/10);
	putchar(k%10+'0');
	if(ch)putchar(ch);
}
inline void add(int u,int v)
{
	cnt++;
	nxt[cnt]=head[u];
	to[cnt]=v;
	head[u]=cnt;
}
*/
inline int read()
{
	int x=0;
	bool f=0;
	char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') f=1;
		ch=getchar();
	}
	while(isdigit(ch))
	{
		x=(x<<3)+(x<<1)+(ch^48);
		ch=getchar();
	}
	return f?-x:x;
}
int main()
{
	//File("");
	int n=read();
	bool bj=0;
	F(i,1,9) if(!(n%i)&&n/i<10)
	{
		cout<<"Yes"<<endl;
		bj=1;
		break;
	}
	if(!bj) cout<<"No"<<endl;
	return 0;
}


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

#define NIL NULL

struct node{
  int key;
  struct node *right;
  struct node *left;
  struct node *parent;
};
typedef struct node * Node;

Node g_root;

void insert(int k);
void inorder(Node u);
void preorder(Node u);

int main(){
  int n,i,x;
  char com[20];

  scanf("%d",&n);

  for(i = 0; i < n; i++){
    scanf("%s",com);
    if(com[0] == 'i'){
      scanf("%d",&x);
      insert(x);
    }else if(com[0] == 'p'){
      inorder(g_root);
      printf("\n");
      preorder(g_root);
      printf("\n");
    }
  }
  
  return 0;
}

void insert(int k){
  Node y = NIL;
  Node x = g_root;
  Node z;

  z = (Node)malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key) x = x->left;
    else x = x->right;
  }

  z->parent = y;
  if(y == NIL) g_root = z;
  else if(z->key < y->key){
    y->left = z;
  }else{
    y->right = z;
  }
}

void inorder(Node u){
  if(u == NIL) return;

  inorder(u->left);
  printf(" %d", u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u == NIL) return;

  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}



Measured memory_bytes: 25172
main :: IO ()
main = do
  [a, b, k] <- map read . words <$> getLine
  putStrLn . unwords . map show $ solve a b k

solve :: Int -> Int -> Int -> [Int]
solve a b k = [x, y]
  where x = max 0 $ a - k
        y = max 0 $ b - (k - (a - x))


Measured memory_bytes: 508
#include <stdio.h>          // printf(), scanf()
#include <math.h>           // sqrt(), sin(), cos(), M_PI

int
main(int argc, char** argv)
{
	int a, b, _th;
	double th;
	double S, L, h;

	scanf("%d %d %d\n", &a, &b, &_th);
	th = _th * M_PI / 180;

	S = 1.0 / 2.0 * a * b * sin(th);
	L = a + b + sqrt(a * a + b * b - 2 * a * b * cos(th));
	h = b * sin(th);

	printf("%.8f\n", S);
	printf("%.8f\n", L);
	printf("%.8f\n", h);
	return 0;
}

Measured memory_bytes: 644
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
using namespace std;

#define ll long long int

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  ll k,a,b;cin >> k>>a>>b;
  ll out0 = k+1;
  ll out = 1;
  if(k>=a+1LL&&a+2LL<=b){
    k -= a-1LL;
    out += a-1LL;
    out += (k/2LL)*(b-a);
    k -= 2LL * (k/2LL);
    out += k;
  }
  cout << max(out,out0) << endl;
  return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <cmath>
#include<iomanip>

using namespace std;

int main(){
    double r;
    cin>>r;
        cout<<fixed<<setprecision(5)<<r*r*M_PI<<" "<<fixed<<setprecision(5)<<2*r*M_PI<<endl;
    return 0;
}


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

using namespace std;

int main() {
	int A,B,C;
	int tmp = 0;
	cin >> A >> B >> C;
	tmp = A;
	A = B;
	B = tmp;

	tmp = A;
	A = C;
	C = tmp;

	cout << A << " " << B << " " << C <<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
    using namespace std;
    #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define REP(i,x) for(int i=0;i<(int)(x);i++)
    #define REPS(i,x) for(int i=1;i<=(int)(x);i++)
    #define mp(a,b) make_pair(a, b)
    #define pb push_back
    #define eb emplace_back
    #define ll long long
    #define MAX 10000000
    int main()
    { string s;
    vector<int>v,v1;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
       if(s[i]=='Z') v.pb(i);
       if(s[i]=='A') v1.pb(i);
    }
    int p=v[v.size()-1]-v1[0];
    cout<<p+1<<endl;
    
    }

Measured memory_bytes: 4524
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <deque>
 
#define Inf             987654321
using namespace std;
 
typedef long long int   ll;
typedef pair<ll, ll>    pii;
typedef vector<ll>      vi;
typedef vector<vi>      vii;
/*************************************************/
 
bool isPrime(int num)
{
    if (num < 2) return false;
    for (int i = 2; i * i <= num; i++)
        if (num % i == 0) return false;

    return true;
}
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(); cout.tie();
    int X;
    cin >> X;
 
    while (!isPrime(X)) X++;
  
    cout << X << '\n';
 
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> VI;
typedef vector<VI> VVI;
typedef pair<ll, ll> P;
#define FOR(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define ALL(n) begin(n),end(n)
const ll INF = numeric_limits<ll>::max();

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
  if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
  if (!t) return 1;
  mint a = pow(t>>1);
  a *= a;
  if (t&1) a *= *this;
  return a;
}
  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


int main()
{
    int n, a, b; cin >> n >> a >> b;
    mint ans = 2;
    ans = ans.pow(n) - 1;
    mint ca = 1, cb = 1;
    rep(i, a) {
        ca *= n - i;
        ca /= 1 + i;
    }
    cb = ca;
    FOR(i, a, b) {
        cb *= n - i;
        cb /= 1 + i;
    }
    ans -= ca + cb;
    cout << ans.x << endl;
    return 0;
}

Measured memory_bytes: 3624
N = int(input())
A = [int(input()) for x in range(N)]
A.sort()
l = len(A)//2
if  len(A)%2 == 1:
    one = 2*sum(A[l+1::])-2*sum(A[:l+1:])+A[l-1]+A[l]
    two = 2*sum(A[l::])-2*sum(A[:l:])-A[l]-A[l+1]
    print(max(one,two))
else:
    print(2*sum(A[l::])-2*sum(A[:l:])-A[l]+A[l-1])


Measured memory_bytes: 7512
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9+7;
ll fac[2000005];
ll qpow(ll x,ll n)
{
    ll res =1;
    while(n>0)
    {
        if(n&1) res=res*x%mod;
        x=x*x%mod;
        n>>=1;
    }
    return res;
}
ll C(ll n,ll m){
	return fac[n]*qpow(fac[m] , mod-2)%mod*qpow(fac[n-m] , mod-2)%mod;
}
int main(){
	//freopen("in.txt","r",stdin);
	fac[0] = 1;
	fac[1] = 1;
	for(ll i=2;i<2000002;i++){
		fac[i] = i * fac[i-1];
		fac[i] %= mod;
	}
	ll k;
	cin>>k;
	string ss;
	cin>>ss;
	ll s = ss.size();
	ll ans = 0;
	for(ll i=0;i<s;i++){
		ans += C(k+s , i) * qpow(25 , k+s-i);
		ans %= mod;
	}
	cout<<(qpow(26 , k+s) - ans + mod) % mod<<endl;
	return 0;
}

Measured memory_bytes: 20856