akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <numeric>
#include <random>
#include <algorithm>
#include <functional>
#include <cassert>

using namespace std;
typedef long long ll;

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;
}

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  string S;
  cin>>S;
  if(S[2]==S[3]&&S[4]==S[5]){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


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

int main() {
  char a,b;
  cin >> a >> b;
  if(a == 'H'){
    cout << b << endl;
  }
  else {
    if(b == 'H'){
      cout << 'D' << endl;
    }
    else{
      cout << 'H' << endl;
    }
  }
  
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	
	int n, k, x, y;
	int ans;

	scanf("%d %d %d %d", &n, &k, &x, &y);

	if (n > k) {
		ans = x * k + y * (n - k);	
	}else {
		ans = x * n;
	}

	printf("%d\n", ans);
	return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
    int h,w;
    cin >> h >> w;
    vector <string> a(h);
    for(int i=0;i<h;++i) {
      cin >> a[i];
    }
    vector <bool> row(h,false);
    vector <bool> col(w,false);
    for(int i=0;i<h;++i) {
        for(int j=0;j<w;++j) {
            if(a[i][j]=='#') {
                row[i]=true;
                col[j]=true;
            }
        }
    }
    for(int i=0;i<h;++i) {
        if(row[i]) {
            for(int j=0;j<w;++j) {
                if(col[j]) {
                    cout << a[i][j];
                }
            }
          cout << endl;
        }
    }
}



Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int n,a,b,res;
    
    scanf("%d %d %d",&n,&a,&b);
    
    res= n*a;
    
    if(res<=b){
        printf("%d\n",res);
    }
    
    else{
        printf("%d\n",b);
        
    }
    
    return 0;
}

Measured memory_bytes: 128
object Main extends App {
      val sc = new java.util.Scanner(System.in)
      val line = sc.nextLine().split(" ")
      val ret = (for {
        x <- line
      } yield {
        x.toInt
      }).reduce((a, b) => a * b) match {
        case i if (i % 2) == 0 => "Even"
        case _ => "Odd"
      }
      println(ret)
}

Measured memory_bytes: 25676
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
 


public class Main {
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static long mod =1000000007;
	//static 	ArrayList<Integer> cc = new ArrayList<>(100);
	public static void main(String[] args) {
		int N=sc.nextInt();
		
		int a[]=new int[8];
		
		int ans=0;
		int ansP=0;
		
		for(int i=0;i<N;i++) {
			int v=sc.nextInt();
			int x;
			if(v<400)x=0;
			else if(v<800)x=1;
			else if(v<1200)x=2;
			else if(v<1600)x=3;
			else if(v<2000)x=4;
			else if(v<2400)x=5;
			else if(v<2800)x=6;
			else if(v<3200)x=7;
			else {ansP++;
			continue;
			}
			
			if(a[x]==0) {
				a[x]++;
				ans++;
			}
			
		}
		if(ans==0) {
			if(ansP>0) {
				p(1+" "+(ans+ansP));
			}else {
				p(0+" "+0);
			}
		}else p(ans+" "+(ans+ansP));
		
		
		
	}
	
	
	
	
	/*static boolean v(int i,long sum1,long sum2) {
		if(i==N) {
			long b=Math.abs(sum1-sum2);
			if(b==0) {
				if(sum1<=K) {
					return true;
				}else return false;
			}else if(b%D==0) {
				if(Math.max(sum1, sum2)<=K)return true;
				else return false;
			}
			else return false;
		}
		
		if(v(i+1,sum1,sum2+v[i]%D))return true;
		
		if(v(i+1,sum1+D-v[i]%D,sum2))return true;
		return false;
		
	}*/
	
	
	
	
	

	


	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 24148
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(int i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define inf 1e18
#define five 100005;
#define six 1000005;
#define prllclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//___________________________________________________________________________________________________________________________________________________________
int main()
{
       int H,W,h,w;
       cin>>H>>W>>h>>w;
       int xx = H*w+W*h-h*w;
       cout<<H*W-xx<<endl;
}


Measured memory_bytes: 256
n = int(input())
a = [0]
a.extend(list(map(int, input().split())))
a.append(0)
b = []
for i in range(1,n + 2):
    b.append(abs(a[i] - a[i - 1]))

s = sum(b)
for i in range(1, n+1):
    print(s - (b[i] + b[i - 1]) + abs(a[i + 1] - a[i - 1]))


Measured memory_bytes: 13920
#include<cstdio>
#include<algorithm>
using namespace std;
#define mod 1000000007
#define N 200005
typedef long long LL;
LL f1[N],s[N];
int n;
inline LL pow(LL a,int k)
{
    LL x=1;
    while(k)
	{
        if(k&1)
			x=x*a%mod;
        a=a*a%mod;
        k>>=1;
    }
    return x;
}
inline void prepare() 
{
    s[0]=1;
    for(int i=1;i<=n;i++)
        s[i]=s[i-1]*i%mod;
    f1[0]=1;
    f1[n]=pow(s[n],mod-2);
    for(int i=n-1;i>0;i--)
        f1[i]=f1[i+1]*(i+1)%mod;
}
inline LL C(int a,int b)
{
    if(a<0||b<0)
		return 1;
    return s[a]*f1[b]%mod*f1[a-b]%mod;
}
int main()
{
    int h,w,a,b;
    scanf("%d%d%d%d",&h,&w,&a,&b);
    n=h+w-2;
    prepare();
    LL ans=C(h+w-2,h-1);
    for(int i=1;i<=b;i++) 
	{
        ans-=C(h-a+i-2,h-a-1)*C(a-1+w-i,a-1)%mod;
        ans=(ans+mod)%mod;
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 3328
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;


int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int ans=0;
    int flag=0;
    while(a%2==0&&b%2==0&&c%2==0&&flag==0){
        int na,nb,nc;
        na=b/2+c/2;
        nb=c/2+a/2;
        nc=a/2+b/2;
        a=na;
        b=nb;
        c=nc;
        
        ans++;
        if(a==b&&a==c)flag=1;
    }
    if(flag==1)ans=-1;
    printf("%d",ans);
    
    return 0;
}


Measured memory_bytes: 128
#include"bits/stdc++.h"


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(ll x = (l);x<=(u);x++)
#define RREP(x,l,u) for(ll x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 210;
const int mod = 1e9+7;
const int MAX = 0x7f7f7f7f;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n,m,Odd;

int A[maxn],B[maxn];

struct Edge{
	int to,cap;
	Edge *next,*oppo;
};
Edge *E[maxn],Pr[maxn*maxn<<2];int cnt=0;
void addedge(int u,int v,int cap){
	Pr[++cnt].to=v;Pr[cnt].cap=cap;Pr[cnt].oppo=&Pr[cnt+1];Pr[cnt].next=E[u];E[u]=&Pr[cnt];
	Pr[++cnt].to=u;Pr[cnt].cap=0;  Pr[cnt].oppo=&Pr[cnt-1];Pr[cnt].next=E[v];E[v]=&Pr[cnt];
}

int s,t;
int H[maxn];

bool Makelevel(){
	memset(H,127,sizeof(H));H[s]=0;
	static queue<int> Q;Q.push(s);
	while(!Q.empty()){int u=Q.front();Q.pop();
		for(Edge *P=E[u];P;P=P->next)
			if(P->cap&&H[P->to]>H[u]+1){
				H[P->to]=H[u]+1;Q.push(P->to);
			}
	}
	return H[t]!=MAX;
}

int extend(int u,int left){int r=0;
	if(u==t)return left;
	for(Edge *P=E[u];P&&r<left;P=P->next)
		if(P->cap&&H[P->to]==H[u]+1){int t;
			t=extend(P->to,min(P->cap,left-r));
			r+=t;P->cap-=t;P->oppo->cap+=t;
		}
	if(!r)H[u]=MAX;
	return r;
}

bool check(int n){
	if(n<=2)return false;
	for(int i=2;1LL*i*i<=n;i++)if(n%i==0)return false;
	return true;
}

void Work(){
	int ans=0;
	while(Makelevel())ans+=extend(s,MAX);
	ans+=(Odd-ans)/2*2+(n-Odd-ans)/2*2+((Odd-ans)%2==1?3:0);
	iout(ans);
}

void Init(){
	read(n);
	REP(i,1,n)read(A[i]);
	
	sort(A+1,A+n+1);A[0]=-1;
	REP(i,1,n){
		if(A[i]!=A[i-1]+1)B[++m]=A[i];
		if(A[i+1]!=A[i]+1)B[++m]=A[i]+1;
	}
	
	n=m;memcpy(A,B,sizeof(A));
	
	s=0;t=n+1;
	REP(i,1,n)if(A[i]&1)Odd++,addedge(s,i,1);else addedge(i,t,1);
	REP(i,1,n)if(A[i]&1)
		REP(j,1,n)if(A[j]&1);else if(check(abs(A[i]-A[j])))addedge(i,j,1);
}

int main(){
	Init();
	Work();
	return 0;
}


Measured memory_bytes: 512
#include <string>
#include <iostream>
using namespace std;
int H, W, c[26]; string s;
int main() {
	cin >> H >> W;
	for (int i = 0; i < H; i++) {
		cin >> s;
		for (int j = 0; j < W; j++) {
			c[s[j] - 97]++;
		}
	}
	int p1 = (H % 2 == 1 && W % 2 == 1 ? 1 : 0);
	int p2 = (H % 2 == 1 ? W / 2 : 0) + (W % 2 == 1 ? H / 2 : 0);
	int c1 = 0, c2 = 0;
	for (int i = 0; i < 26; i++) {
		if (c[i] & 1) c1++;
		if (c[i] & 2) c2++;
	}
	cout << (c1 <= p1 && c2 <= p2 ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 256
//テンプレ
#include <bits/stdc++.h>
//#define int long long
#define REP(i,n) for(int i = 0; i < (n); ++i)
#define FOR(i,a,b)  for(int i = (a); i <= (b); ++i)
#define ALL(v) (v).begin(),(v).end()

using namespace std;
//constexpr int MOD = 10e9+7;
//constexpr int INF = 1LL << 60;
template <class T> inline bool chmin(T& a, T b){if(a > b){ a = b; return 1;} return 0;}  
template <class T> inline bool chmax(T& a, T b){if(a < b){ a = b; return 1;} return 0;}  
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
//

int f(int n)
{
    if(n%2 == 0)
    {
        return n/2;
    } else {
        return 3*n+1;
    }
}

signed main (){
   ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
   int s;
   cin >> s;
   int a = s;
   int n = 1;
    while(true)
    {
        if( a == 1 || a == 2 || a== 4)
        {
            cout << n +3 <<endl;
            return 0;
        }
        a=f(a);
        n++;
    }
}

Measured memory_bytes: 256
#!/usr/bin/env python3

import sys
import heapq
from collections import namedtuple

DEBUG = False

def read(t):
    return t(sys.stdin.readline().rstrip())


def read_list(t, sep = " "):
    return [t(s) for s in sys.stdin.readline().rstrip().split(sep)]


def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return


edge = namedtuple("edge", ("cost", "to"))
vertex_route = namedtuple("vertex_route", ("routecost", "vertex"))

def main():
    v, e, r = read_list(int)
    edges_of_v = {}
    for _ in range(e):
        s, t, d = read_list(int)
        if s not in edges_of_v:
            edges_of_v[s] = []
        edges_of_v[s].append(edge(d, t))
    
    min_costs = [1 << 33] * v
    que = [vertex_route(0, r)]
    heapq.heapify(que)
    while que:
        route = heapq.heappop(que)
        if min_costs[route.vertex] <= route.routecost:
            continue
        min_costs[route.vertex] = route.routecost
        if route.vertex not in edges_of_v:
            continue
        for e in edges_of_v[route.vertex]:
            if min_costs[e.to] <= e.cost + min_costs[route.vertex]:
                continue
            heapq.heappush(que, vertex_route(e.cost + min_costs[route.vertex], e.to))
    
    for i in range(v):
        if min_costs[i] == 1 << 33:
            print("INF")
        else:
            print(min_costs[i])

if __name__ == "__main__":
    main()



Measured memory_bytes: 108968
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
cerr << "\n\n" << "Time elapsed: " << \
(endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define inf 1000000000000000007
#define eps 0.000000000001
#define pi acosl(-1)
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound 
#define stp fixed<<setprecision(20)
#define endl '\n'
ll a[1100][1100];
ll mat[1100][1100];
ll e[1100][1100];
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
queue<pll> q;
void fill(ll x,ll y)
{
    if(mat[x][y]==1)
        return;
    for(ll i=x-2;i<x+3;i++)
    {
        for(ll j=y-2;j<y+3;j++)
        {
            a[i][j]=min(a[i][j],a[x][y]+1);
            q.push({i,j});
        }
    }
}
void dfs(ll x,ll y)
{
    if(mat[x][y]==1)
        return;
    e[x][y]=1;
    fill(x,y);
    for(ll i=0;i<4;i++)
    {
        ll c=x+dx[i];
        ll d=y+dy[i];
        a[c][d]=min(a[c][d],a[x][y]);
        if(mat[c][d]==0&&e[c][d]==0)
            dfs(c,d);
    }
}
void solve()
{
    for(ll i=0;i<=1020;i++)
    {
        for(ll j=0;j<=1020;j++)
        {
            mat[i][j]=1;
            a[i][j]=inf;
        }
    }
    ll n,m;
    cin>>n>>m;
    ll cx,cy,dx,dy;
    cin>>cx>>cy>>dx>>dy;
    cx+=4;
    cy+=4;
    dx+=4;
    dy+=4;
    char ch;
    for(ll i=5;i<n+5;i++)
    {
        for(ll j=5;j<m+5;j++)
        {
            cin>>ch;
            if(ch=='.')
                mat[i][j]=0;
        }
    }
    a[dx][dy]=0;
    dfs(dx,dy);
    while(q.size())
    {
        pll p=q.front();
        q.pop();
        if(e[p.ff][p.ss]==0&&mat[p.ff][p.ss]==0)
            dfs(p.ff,p.ss);
    }
    if(a[cx][cy]==inf)
        cout<<-1;
    else
        cout<<a[cx][cy];
}
int main()
{
    FAST
    #ifdef ayk_16
    freopen("input.txt","rt",stdin);
    freopen("output.txt","wt",stdout);
    #endif
    time_taken_start
    ll t=1;
    //cin>>t;
    for(ll i=0;i<t;i++)
    {
        //cout<<"Case #"<<i+1<<": ";
        solve();
    }
    time_taken_end
}



Measured memory_bytes: 33828
def factorization(n):
    from collections import Counter
    arr = Counter()
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if len(arr.keys()) == 0 and n != 1:
        arr[n] = 1

    return arr


def solve(m, N):
    MOD = 10 ** 9 + 7
    dp = [[0] * (m + 1) for _ in range(N + 1)]
    dp[0][0] = 1
    for i in range(N):
        for j in range(m + 1):
            dp[i + 1][j] = dp[i + 1][j - 1] + dp[i][j]
            dp[i + 1][j] %= MOD
    return dp[-1][-1]


def main():
    # import sys
    # readline = sys.stdin.readline
    # readlines = sys.stdin.readlines
    MOD = 10 ** 9 + 7
    N, M = map(int, input().split())
    primes = factorization(M)

    ans = 1
    for p in primes.values():
        cnt = solve(p, N)
        ans *= cnt
        ans %= MOD
    
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 127520
#include <algorithm>
#include <cmath>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
static inline void fast_io()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}
using ll = long long;
using ld = long double;

int main()
{
    fast_io();

    char ch;
    ch = cin.get();
    if (isupper(ch)) {
        cout << 'A';
    } else {
        cout << 'a';
    }
}


Measured memory_bytes: 3060
//#include <bits/stdc++.h>
 
#include <iostream>
#include <algorithm>
 
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <utility>
#include <array>
#include <complex>
#include <valarray>
 
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>
 
 
using namespace std;
#define int long long
 
typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
 
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll INFLL = 1LL<<62;
const double EPS = 1e-12;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
 
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod
#define inside(y, x, h, w) (0 <= (y) && (y) < (h) && 0 <= (x) && (x) < (w)) ? true : false

int n, a, b;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> a >> b;
    cout << min(n * a, b) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <set>
#include <deque>
#include <map>
#include <bitset>
#include <functional>
#include <cmath>

#define INF 10000000000
using namespace std;
using P = pair<long, long>;

const long long MOD = 1000000007;
int main(){
	long long n, p;
	cin >> n >> p;
	string s;
	cin >> s;
	
	long long ans = 0;
	if(p == 2){
		for(long long i = 0; i < n; i++){
			if((s[i]-'0')%2 != 0) continue;
			ans += (i+1);
		}
		cout << ans << endl;
	}else if(p == 5){
		for(long long i = 0; i < n; i++){
			if((s[i]-'0')%5 != 0) continue;
			ans += (i+1);
		}
		cout << ans << endl;
	}else{
		map<long long, long long> m;
		m[0]++;
		long long sum = 0;
		long long pow = 1;
		for(long long i = n-1; i >= 0; i--){
			sum += (s[i] - '0') * pow;
			sum %= p;
			m[sum]++;
			pow *= 10;
			pow %= p;
		}
		for(auto t : m){
			ans += (t.second - 1)*t.second / 2;
		}

		cout << ans << endl;
	}
}

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

def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    # 標準入力を取得
    N = int(input())
    A = list(map(int, input().split()))

    return N, A


def main(N: int, A: list) -> None:
    """
    メイン処理.

    Args:\n
        N (int): 整数(2 <= N <= 2 * 10**5)
        A (list): 整数(0 <= A_i <= 10**9)
    """
    # 求解処理
    mod = 10**9 + 7
    ans = 0
    sum_A_j = sum(A)
    for i in range(N):
        A_i = A[i]
        sum_A_j -= A_i
        ans += A_i * sum_A_j
        ans %= mod

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    N, A = get_input()

    # メイン処理
    main(N, A)


Measured memory_bytes: 30752
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define fr(i,s,e) for(i=s;i<e;i++)
#define ms(arr,val) memset(arr,val,sizeof(arr))
using namespace std;

const int mxn=2e5+1;

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

  int t=1;
//  cin>>t;
  int tt=1;
  while(t--){
   int n;
   cin>>n;
   for(int i=1;i<=9;i++)
   {
    if(n%i==0)
    {
      int a=n/i;
      if(a<=9)
      {
        cout<<"Yes";
        return 0;
      }
    }
   }
   cout<<"No";
   // cout<<"Case #"<<tt<<": ";
   // tt++;
    }
  return 0;
}



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

int mojicount(char c,string s){
  int ans = 0;
  for (int i = 0; i < s.size(); i++){
    if (c == s.at(i)) ans++;
  }
  //cout << c << "の数は" << ans << endl;
  return ans;
}

int main(){
  string N; cin >> N;
  vector<char> suuji = {'0','1','2','3','4','5','6','7','8','9'};
  int sum = 0;
  for (int i = 0; i < 10; i++) sum += i*mojicount(suuji.at(i),N);
  if (sum%9 == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3836
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

const std::string A_to_Z = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main() {
  i64 H, W;
  std::cin >> H >> W;
  std::vector<std::vector<std::string>> S(H, std::vector<std::string>(W));
  for (i64 y = 0; y < H; ++y) {
    for (i64 x = 0; x < W; ++x) {
      std::cin >> S[y][x];
    }
  }

  for (i64 y = 0; y < H; ++y) {
    for (i64 x = 0; x < W; ++x) {
      if (S[y][x] == "snuke") {
        std::cout << A_to_Z[x] << (y + 1) << std::endl;
        return 0;
      }
    }
  }

  return EXIT_FAILURE;
}

Measured memory_bytes: 256
import fractions
# import math
from functools import reduce
 
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
n = int(input())
a = [int(value) for value in input().split(" ")]

from_right_gcd = []
from_left_gcd = []

# 左から
for index in range(len(a)):
    if index == 0:
        from_left_gcd.append(a[index])
        continue
    from_left_gcd.append(fractions.gcd(from_left_gcd[index - 1], a[index]))

# 右から
for index in range(len(a) - 1, -1, -1):
    if index == len(a) - 1:
        from_right_gcd.append(a[index])
        continue
    from_right_gcd.append(fractions.gcd(from_right_gcd[len(a) - index - 1 - 1], a[index]))

maybe_answer_list = []

for index in range(len(a)):
    if index == 0:
        maybe_answer_list.append(from_right_gcd[len(a) - 1 - 1])
        continue
    if index == len(a) - 1:
        maybe_answer_list.append(from_left_gcd[index - 1])
        continue
    maybe_answer_list.append(fractions.gcd(from_left_gcd[index - 1], from_right_gcd[len(a) - index - 1 - 1]))

print(max(maybe_answer_list))

Measured memory_bytes: 16124
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;
const int mod = 1e9 + 7;
int n, a, b, c, d;
int dp[1002][1002];
int lad[1002];
int ilad[1002];

int main(int argc, char const* argv[])
{
	cin >> n >> a >> b >> c >> d;
	lad[0] = 1;
	for(int i = 1; i <= n; i++){
			lad[i] = ((ll)lad[i - 1] * i) % mod;
	}
	int tmp = mod - 2;
	int pmp = lad[n];
	ilad[n] = 1;
	while(tmp > 0){
			if((tmp & 1) == 1)ilad[n] = (ll)ilad[n] * pmp % mod;
			pmp = pmp * (ll)pmp % mod;
			tmp = tmp >> 1;
	}
	ilad[0] = 1;
	for(int i = n - 1; i > 0; i--){
			ilad[i] = (ll)ilad[i+1] * (i + 1) % mod;
	}
	dp[a][0] = 1;
	for(int i = a; i < b+1; i++){
			for(int j = 0;j <= n; j++){
					dp[i+1][j] = dp[i][j];
					for(int k = c; k <= min(j / i, d); k++){
							int ttmp = (dp[i][j - k * i] * (ll)lad[n - j + k * i]) % mod;
							ttmp = ((ll)ttmp * ilad[n - j]) % mod;
							ttmp = ((ll)ttmp * ilad[k]) % mod;
							for(int l = 0; l < k; l++){
									ttmp = ((ll)ttmp * ilad[i]) % mod;
							}
							dp[i+1][j] = ((ll)dp[i+1][j] + ttmp) % mod;
					}
			}
	}
	cout << dp[b+1][n] << endl;
	return 0;
}


Measured memory_bytes: 4224
# include <bits/stdc++.h>
using namespace std;
# define lowbit(x) ((x)&(-x))
const double pi=acos(-1.0);
# define eps 1e-8
# define MOD 1000000007
# define INF 1000000000
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FDR(i,a,n) for(int i=a; i>=n; --i)
# define bug puts("H");
# define lch p<<1,l,mid
# define rch p<<1|1,mid+1,r
# define mp make_pair
# define pb push_back
typedef pair<int,int> PII;
typedef vector<int> VI;
# pragma comment(linker, "/STACK:1024000000,1024000000")
typedef long long LL;
inline char nc(){
    static char buf[1000000],*p1=buf,*p2=buf;
    return p1==p2&&(p2=(p1=buf)+fread(buf,1,1000000,stdin),p1==p2)?EOF:*p1++;
}
inline int Scan(){
    char ch=nc();int sum=0, f=1;
    if (ch=='-') f=-1, ch=nc();
    while(!(ch>='0'&&ch<='9'))ch=nc();
    while(ch>='0'&&ch<='9')sum=sum*10+ch-48,ch=nc();
    return sum*f;
}
const int N=200005;
//Code begin....

char s[N];
int vis[30];

int main ()
{
    scanf("%s",s+1);
    int n=strlen(s+1);
    for (int i=1; i<=n; ++i) ++vis[s[i]-'a'];
    LL ans=0;
    FOR(i,0,25) ans+=(LL)vis[i]*(vis[i]-1)/2;
    printf("%lld\n",(LL)n*(n-1)/2-ans+1);
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false)
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL;
const int maxn = 3e5 + 20;
int a[maxn], dp[maxn], pre[maxn];
const int MOD = 1e9 + 7;
LL fac[maxn];
void init() {
    fac[0] = 1;
    for (int i = 1; i <= maxn - 20; ++i) {
        fac[i] = fac[i - 1] * i % MOD;
    }
}
LL quick_pow(int a, int b, int MOD = 1e9 + 7) {
    LL ans = 1, base = a;
    while (b) {
        if (b & 1) ans = ans * base % MOD;
        b >>= 1;
        base = base * base % MOD;
    }
    return ans;
}
LL C(int n, int m) {
    if (n < m) return 0;
    if (n == m) return 1;
    return fac[n] * quick_pow(fac[m], MOD - 2) % MOD * quick_pow(fac[n - m], MOD - 2) % MOD;
}
int pos[maxn];
void work() {
    int n;
    scanf("%d", &n);
    int val;
    int one, two;
    for (int i = 1; i <= n + 1; ++i) {
        scanf("%d", &val);
        if (pos[val]) {
            one = pos[val], two = i;
        }
        pos[val] = i;
    }
    ++n;
    printf("%d\n", n - 1);
    for (int i = 2; i <= n; ++i) {
        printf("%d\n", (C(n, i) + MOD - C(one - 1 + n - two, i - 1)) % MOD);
    }
}

int main() {
#ifdef local
    freopen("data.txt", "r", stdin);
//    freopen("data.txt", "w", stdout);
#endif
    init();
    work();
    return 0;
}


Measured memory_bytes: 4480
#include<stdio.h>

int main(void)
{
    int w,h,x,y;

    scanf("%d %d %d %d",&w,&h,&x,&y);
    double s;
    int res=0;
    s=(double)w*(double)h/2;

    if(x==(double)w/2&&y==(double)h/2)
    {
        res = 1;
    }

    printf("%f %d",s,res);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
using namespace std;
int s[100005];
int main(){
	int i,j,k;
	int n;
	string c;
	cin>>c>>k;
	for(i=0;i<c.size();i++){
		if(c[i]=='a')continue;
		for(char a='z',j=1;a>='a';a--,j++){
			if(c[i]==a)s[i]=j;
		}
	}
	for(i=0;i<c.size();i++){
		if(k>=s[i]){
			k-=s[i];
			c[i]='a';
		}
	}
	if(k>0){
		k%=26;
		for(i=0;i<k;i++){
			c[c.size()-1]++;
		}
	}
	cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}


int main(){
  string s;
  cin >> s;
  int d = 0;
  rep(i,s.size()){
    d += s[i] - '0';
  }
  int n = toInt(s);
  cout <<((n%d==0)?("Yes"):("No")) << endl;
  return 0;
}


Measured memory_bytes: 256
def merge as, left, mid, right
  l_as = as.slice(left..mid)
  r_as = as.slice((mid + 1)..right)
  l_as << Float::INFINITY
  r_as << Float::INFINITY

  l_i, r_i = [0, 0]
  cnt = 0
  left.upto(right) do |i|
    cnt += 1
    if l_as[l_i] <= r_as[r_i]
      as[i] = l_as[l_i]
      l_i += 1
    else
      as[i] = r_as[r_i]
      r_i += 1
    end
  end
  return cnt
end

def merge_sort as, left, right
  cnt = 0
  if left < right
    mid = (left + right) / 2
    cnt += merge_sort as, left, mid
    cnt += merge_sort as, mid + 1, right
    cnt += merge as, left, mid, right
  end
  return cnt
end

n = gets.chomp.to_i
as = gets.chomp.split(' ').map(&:to_i)
cnt = merge_sort as, 0, n - 1
puts as.join(' ')
puts cnt


Measured memory_bytes: 68100
// https://atcoder.jp/contests/abc079/tasks/abc079_b
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <set>
#include <unordered_set>
#include <bitset>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(size_t i = 0; i < (n); ++i)

int main()
{
    int N;
    cin >> N;
    vector<ll> lucas(N+1);
    lucas[0] = 2;
    lucas[1] = 1;
    for (int i = 2; i < N + 1; ++i)
    {
        lucas[i] = lucas[i - 1] + lucas[i - 2];
    }
    cout << lucas[N] << endl;
    return 0;
}


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


MOD = 1000000007


N,M = map(int, input().split())
dp = [1 for _ in range(N+1)]
for i in range(M):
  a = int(input())
  dp[a] = 0

for i in range(2,N+1):
  if dp[i] > 0:
    dp[i] = (dp[i-1]+dp[i-2]) % MOD
print(dp[-1])

Measured memory_bytes: 45040
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <math.h>
#include <cmath>
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include<bitset>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
using namespace std;
using ll = long long;
template<typename T>using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;
const ll inf = 1LL << 60;
#define all(x) (x).begin(),(x).end()
#define puts(x) cout << x << endl
#define rep(i,m,n) for(ll i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(ll i = m;i >= n;--i)

ll imos_sl[303030];
ll imos_co[303030];


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

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

	for (int i = 0; i < n - 1; i++) {
		int X = a[i];
		int Y = a[i + 1];
		if (X < Y) {
			//pattern1
			imos_sl[X + 1] -= 1;
			imos_sl[Y + 1] += 1;
			imos_co[X + 1] += 1 + Y;
			imos_co[Y + 1] -= 1 + Y;
			//pattern2
			imos_co[Y + 1] += Y - X;
			//pattern3
			imos_co[0] += Y - X;
			imos_co[X + 1] -= Y - X;
		}
		else {
			//pattern1
			imos_sl[X+1] -= 1;
			imos_co[X+1] += 1+m+Y;
			//pattern2
			imos_co[Y+1] += m-X+Y;
			imos_co[X+1] -= m-X+Y;
			//pattern3
			imos_sl[0] -= 1;
			imos_sl[Y+1] += 1;
			imos_co[0] += 1 + Y;
			imos_co[Y + 1] -= 1 + Y;
		}
	}

	for (int i = 0; i < 100010; i++) {
		imos_sl[i+1] += imos_sl[i];
		imos_co[i+1] += imos_co[i];
	}

	ll ans = inf;
	for (ll x = 0; x < m; x++)ans = min(ans, imos_sl[x] * x + imos_co[x]);
	puts(ans);

	return 0;
}

Measured memory_bytes: 3456
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    string a;
    cin>>a;
    string c=a;
    reverse(a.begin(),a.end());
    for(int i=0;i<a.size();++i)
    {
        if(a[i]=='b') 
            a[i]='d';
        else if(a[i]=='d') 
            a[i]='b';
        else if(a[i]=='p') 
            a[i]='q';
        else if(a[i]=='q') 
            a[i]='p';
    }
    if(a==c)
    {
        cout<<"Yes"; 
    }
    else
    {
         cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 512
package main

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

const MOD = 1e9 + 7

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	//ns := sc.Text()
	sc.Scan()
	N, _ := strconv.Atoi(sc.Text())

	//N, _ := strconv.Atoi(ns)
	A := make([]int, 60)
	AZ := make([]int, 60)

	for i := 0; i < N; i++ {
		sc.Scan()
		a, err := strconv.Atoi(sc.Text())
		if err != nil {
			continue
		}
		for i := 0; i < 60; i++ {
			if a&(1<<uint(i)) == 0 {
				AZ[i] += 1
			} else {
				A[i] += 1
			}
		}
	}

	sum := 0
	for i := 0; i < 60; i++ {
		p := ModPow(2, i)
		sum = (sum + ModMul(ModMul(AZ[i], A[i]), p)) % MOD
	}
	fmt.Println(sum)
}

func ModPow(a, n int) int {
	var r int = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModMul(a, b int) int {
	return a * b % MOD
}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
using namespace std;
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

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

    // 素数である
    return true;
}

int main(){
    int N;
    cin >> N;
    if(N<=10){
        cout << "Yes" << endl;
    }
    else if(N>=82){
        cout << "No" << endl;
    }
    else if(IsPrime(N)==true){
        cout << "No" << endl;
    }
    else{
        if(N%11==0){
            cout << "No" << endl;
        }
        else if(N%13==0){
            cout << "No" << endl;
        }
        else if(N%17==0){
            cout << "No" << endl;
        }
        else if(N%19==0){
            cout << "No" << endl;
        }
        else if(N%23==0){
            cout << "No" << endl;
        }
        else if(N%29==0){
            cout << "No" << endl;
        }
        else if(N%31==0){
            cout << "No" << endl;
        }
        else if(N%37==0){
            cout << "No" << endl;
        }
        else if(N%50==0){
            cout << "No" << endl;
        }
        else if(N%60==0){
            cout << "No" << endl;
        }
        else if(N%70==0){
            cout << "No" << endl;
        }
        else if(N%80==0){
            cout << "No" << endl;
        }
        else{
            cout << "Yes" << endl;
        }
    }
}



Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#define F first
#define S second
#define vec vector
#define pb push_back
#define pll pair<ll,ll>
#define pdd pair<ld, ld>
#define umap unordered_map
#define uset unordered_set
#define pii pair<int, int>
#define pnn pair<Node*, Node*>
#define all(m) m.begin(), m.end()
#define uid uniform_int_distribution
#define init(m, x) memset(m, x, sizeof(m));
#define FILE ifstream in("input.txt");ofstream out("output.txt");
#define fast cin.tie(0);cout.tie(0);cin.sync_with_stdio(0);cout.sync_with_stdio(0);
using namespace std;
typedef string str;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

int main() {
    fast;
    const ll G = 1e6+6;
    ll a; cin>>a;
    ll erat[G], was[G], gc = 0;
    init(was, 0);
    init(erat, 0);
    for(int q=2; q<G; q++){
        if(erat[q]) continue;
        for(int w=q; w<G; w+=q){
            erat[w] = q;
        }
    }
    int fl = 1;
    for(int q=0; q<a; q++){
        ll x; cin>>x;
        gc = __gcd(x, gc);
        uset<ll> s;
        for(; x>1; x/=erat[x]) s.insert(erat[x]);
        for(ll i : s) fl &= !was[i], was[i] = 1;
    }
    cout<<(fl ? "pairwise coprime" : gc==1 ? "setwise coprime" : "not coprime");
}

Measured memory_bytes: 19284
#include<iostream>
using namespace std;
int main(){
    int n,a,c;
    cin>>n>>a;
    long x[n],dp[n][5001];
    for(int i=0;i<n;i++){cin>>c;x[i]=c-a;}
    dp[0][2500]++;dp[0][2500+x[0]]++;
    for(int i=1;i<n;i++)for(int j=0;j<5001;j++)dp[i][j]=dp[i-1][j]+(0<=j-x[i]&&j-x[i]<=5000?dp[i-1][j-x[i]]:0L);
    cout<<dp[n-1][2500]-1L<<endl;
    return 0;
}

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

const char p[7] = {'R','G','B','Y','P','O','.'};
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
string f[12];
int cnt = 0;

void downPuyo(int x,int y){
	char t = f[y+1][x] ;
	f[y+1][x] = f[y][x];
	f[y][x] = t;
	
	if( y+1 != 11 && f[y+2][x] == '.' ){
		downPuyo( x , y+1 );
	}
}

void checkPuyo(int x,int y,char color){
	f[y][x] += 'a' - 'A';
	for(int i=0 ; i<4 ; ++i ){
		int mx = x + dx[i];
		int my = y + dy[i];

		if( mx < 0 || my < 0 || mx >= 6 || my >= 12 )
			continue;

		if( f[my][mx] == color ){
			++cnt;
			checkPuyo( mx , my , color );
		}
	}
}
void eracePuyo(int x,int y,char color){
	f[y][x] = '.';
	for(int i=0 ; i<4 ; ++i ){
		int mx = x + dx[i];
		int my = y + dy[i];

		if( mx < 0 || my < 0 || mx >= 6 || my >= 12 )
			continue;

		if( f[my][mx] == color ){
			eracePuyo( mx , my , color );
		}
		if( f[my][mx] == 'O' ){
			f[my][mx] = '.';
		}
	}
}

int main(){
	int n, chain;
	
	cin >> n;
	for(int i=0 ; i<n ; ++i ){
		for(int y=0 ; y<12 ; ++y ){
			cin >> f[y];
		}

		//ú»
		bool flag = true;
		chain = 0;

		//Á¦éÕæªÈ­ÈéÜÅ[v
		while( flag ){
			flag = false;

			for(int i=0 ; i<5 ; ++i ){
				for(int y=0 ; y<12 ; ++y ){
					for(int x=0 ; x<6 ; ++x ){
						cnt = 0;
						//àµFÕæ¾Á½ç
						if( f[y][x] == p[i] ){
							cnt++;
							checkPuyo( x , y , p[i] );
							//àµSÂÈã­ÁÂ¢Ä¢½ç¯·
							if( cnt >= 4 ){
								flag = true;
								eracePuyo( x , y , p[i] + ('a'-'A') );
							}
						}
					}
				}
			}

			//ú»
			for(int i=0 ; i<5 ; ++i ){
				for(int y=0 ; y<12 ; ++y ){
					for(int x=0 ; x<6 ; ++x ){
						char c = p[i] + ('a'-'A');
						if( f[y][x] == c ){
							f[y][x] -= ('a'-'A');
						}
					}
				}
			}

			//Á¦éÕæª éÆ«
			if( flag ){
				chain++;

				for(int j=0 ; j<4 ; ++j ){
					for(int i=0 ; i<6 ; ++i ){
						for(int y=10 ; y>=0 ; --y ){
							for(int x=0 ; x<6 ; ++x ){
								if( f[y][x] == p[i] && f[y+1][x] == '.' ){
									downPuyo( x , y );
								}
							}
						}
					}
				}
			}		
		}
		cout << chain << endl;
	}
}

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

typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<int> a(n+1), l(n+2), r(n+2), m(n);
    a[0] = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }

    int ans = 1;
    l[0] = 0;
    r[n+1] = 0;
    for (int i = 0; i < n+1; i++) {
        l[i+1] = __gcd(l[i], a[i]);
    }
    for (int i = n; i >= 1; i--) {
        r[i] = __gcd(r[i+1], a[i]);
    }
    for (int i = 1; i <= n; i++) {
        ans = max({ans, __gcd(l[i], r[i+1])});
    }
    cout << ans << endl;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);

/* -----  2019/07/20  Problem: ABC 134 D / Link: http://abc134.contest.atcoder.jp/tasks/abc134_d  ----- */


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

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


	auto  divn = [](LL n) {
		vector<LL> res;
		for (LL i = 1; i*i <= n; i++) {
			if (n%i == 0) {
				res.push_back(i);
				if (n / i != i)res.push_back(n / i);
			}
		}
		SORT(res);
		return res;
	};

	VI ans;
	VI cnt(N + 1);
	for (int x = N; x >= 1; x--) {
		LL n = x;
		int idx = x - 1;
		if (cnt[n] % 2 == a[idx])continue;

		auto divs = divn(n);
		ans.emplace_back(n);
		for (auto d : divs) {
			cnt[d]++;
		}
	}
	bool corner = 1;
	FOR(i, 0, N) {
		corner &= a[i] == 0;
	}
	if (SZ(ans) < 1 && !corner) {
		cout << -1 << "\n";
		return 0;
	}

	cout << SZ(ans) << "\n";
	FOR(i, 0, SZ(ans)) {
		cout << ans[i] << " \n"[i + 1 == SZ(ans)];
	}


	return 0;
}



Measured memory_bytes: 3832
#include <iostream>
#include <vector>
#include <numeric>
#include <tuple>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <unordered_map>
#include <type_traits>
#include <map>
#include <cstdio>
#include <string>

using namespace std;
using str = string;

#define rep(a,l,r) for(int a=(l);a<(r);a++)
#define get cin>>
#define put cout<<

int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v; u = v; v = r; /* swap */
  }
  return u;
}

// 最大公約数算出
int calc_gcd(const vector<int> vec){
	int gcd = *min_element(vec.begin(), vec.end());
	for (const int ele: vec){
		gcd = gcd_euclid(gcd,ele);
	}
	return gcd;
}

// 最小公倍数
int calc_lcm(const vector<int> vec) {
	int tmp = 1;
	for (const int ele: vec){
		tmp *= ele;
	}
	int gcd = calc_gcd(vec);
	return tmp/gcd;
}

std::string join(const std::vector<std::string>& v, const char* delim = 0) {
  std::string s;
  if (!v.empty()) {
    s += v[0];
    for (decltype(v.size()) i = 1, c = v.size(); i < c; ++i) {
      if (delim) s += delim;
      s += v[i];
    }
  }
  return s;
}

// nが奇数、偶数の場合の場合分け
// n & 1 ? odd : even

// distinctはsortしてunique + erase
// https://qiita.com/ysk24ok/items/30ae72f4f1060b088588
//sort(vec.begin(), vec.end());
//vec.erase(unique(vec.begin(), vec.end()), vec.end());

void run() {

	int n;
	vector<int> a(100);
	get n;
	rep(i,0,n){
		get a[i];
	}

	int r = accumulate(a.begin(), a.end(), 0);
	int l = 0;
	int distance = 2147483647;
	rep(i,0,n){
		l+= a[i];
		r-= a[i];
		int b = abs(r - l);
		if (distance <= b) {
			put distance;
			return;
		} else {
			distance = b;
		}
	}
}


int main() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);run();return 0;}


Measured memory_bytes: 256
lis = input().split()
N, A, B = [int(x) for x in lis]

def digit_sum(num):
    nstr = str(num)
    cdigs = list(nstr)
    idigs = [int(x) for x in cdigs]
    
    return sum(idigs)

nums = range(1, N + 1) 

focus = [
    x for x in nums 
    if digit_sum(x) in range(A, B + 1)
    ]

s = sum(focus)

print(s)

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

using namespace std;

int H, W;
string S[105];

int main(void)
{
	cin >> H >> W;
	for(int i = 0; i < H; i++){
		cin >> S[i];
	}
	
	for(int i = 0; i < H; i++){
		cout << S[i] << endl;
		cout << S[i] << endl;
	}
	
	return 0;
}

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

int main(){
  int N, M;
  cin >> N >> M;
  vector<int> L(M);
  vector<int> R(M);
  for(int i = 0; i < M; i++){
    cin >> L.at(i) >> R.at(i);
  }
  sort(L.begin(), L.end());
  sort(R.begin(), R.end());
  if(L.at(M - 1) > R.at(0)){
    cout << 0 << endl;
  }
  else{
    cout << R.at(0) - L.at(M - 1) + 1;
  }
}

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

int main() {
  int n;
  cin >> n;
  
  int total = 0;
  for (int i = 1; i <= 1e7; ++i) {
    total = (total*10 + 7) % n;
    if (!total) {
      cout << i; return 0;
    }
  }
  
  cout << -1;
}

Measured memory_bytes: 3604