akhauriyash/Code-Regression huggingface dataset:
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End


/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

#define int long long

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Ciniii(R,G,B);
    Cini(N);
    int ans = 0;
    for(int i=0;i*R<=N;i++){
        for(int j=0;j*G<=N-i*R;j++){
            int k = N - i*R - j*G;
            if(k%B==0)ans++;
        }
    }
    cout << ans << nn;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int x = sc.nextInt();
		int[] c = new int[n];
		int[][] a = new int[n][m];
		for (int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
			for (int j = 0; j < m; j++) {
				a[i][j] = sc.nextInt();
			}
		}
		sc.close();

		int ans = Integer.MAX_VALUE;
		int end = 1 << n;
		for (int i = 0; i < end; i++) {
			int[] r = new int[m];
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i >> j & 1) == 1) {
					for (int j2 = 0; j2 < m; j2++) {
						r[j2] += a[j][j2];
					}
					sum += c[j];
				}
			}
			boolean ok = true;
			for (int j2 = 0; j2 < m; j2++) {
				if (r[j2] < x) {
					ok = false;
					break;
				}
			}
			if (ok) {
				ans = Math.min(ans, sum);
			}
		}
		if (ans == Integer.MAX_VALUE) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
}


Measured memory_bytes: 37460
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

int n, q;
vector<int> G[200010]; 
int d[200010];

void dfs(int v, int p, int sum){
    d[v] += sum;
    for(auto i : G[v]){
        if(i == p) continue;
        dfs(i, v, d[v]);
    }
}

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> n >> q;
    rep(i, 0, n - 1){
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    while(q--){
        int p, x;
        cin >> p >> x;
        p--;
        d[p] += x;
    }
    dfs(0, -1, 0);
    rep(i, 0, n){
        if(i) cout << " ";
        cout << d[i];
    }
    cout << endl;
}


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

using namespace std;

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

int n, m;
int ma[610][610];
int ps[610][610];

int sum(int a, int b, int c, int d) {
    return ps[c][d]-ps[a-1][d]-ps[c][b-1]+ps[a-1][b-1];
}

char buf[310];
int main() {
    int i, j, k;

    scanf("%d%d",&n,&m);
    for (i=1;i<=n;i++) {
        scanf("%s",buf);
        for (j=1;j<=m;j++) ma[i+j-1][i-j+m] = (buf[j-1]=='#');
    }
    for (i=1;i<n+m;i++) {
        for (j=1;j<n+m;j++) {
            ps[i][j]=ps[i-1][j]+ps[i][j-1]-ps[i-1][j-1]+ma[i][j];
        }
    }
    ll su = 0;
    for (i=1;i<n+m;i++) {
        for (j=1;j<n+m;j++) {
            if (!ma[i][j]) continue;
            for (k=1;k<n+m;k++) {
                if (k==j) continue;
                if (!ma[i][k]) continue;
                if (abs(k-j)<i)su += sum(i-abs(k-j),min(j,k),i-abs(k-j),max(j,k))-ma[i-abs(k-j)][j];
                if (abs(k-j)+i<n+m)su += sum(i+abs(k-j),min(j,k),i+abs(k-j),max(j,k))-ma[i+abs(k-j)][j];
            }
            for (k=1;k<n+m;k++) {
                if (k==i) continue;
                if (!ma[k][j]) continue;
                if (abs(k-i)<j)su += sum(min(i,k),j-abs(k-i),max(i,k),j-abs(k-i))-ma[i][j-abs(k-i)];
                if (abs(k-i)+j<n+m)su += sum(min(i,k),j+abs(k-i),max(i,k),j+abs(k-i))-ma[i][j+abs(k-i)];
            }
        }
    }
    printf("%lld\n",su/2);

    return 0;
}


Measured memory_bytes: 3072
first_line = STDIN.gets.strip

buttons = first_line.split(' ').map(&:to_i)
total = 0

2.times do |_i|
  v = 0
  if buttons[0] >= buttons[1] then
    v = buttons[0]
    buttons[0] = buttons[0] - 1
  else
    v = buttons[1]
    buttons[1] = buttons[1] - 1
  end
  total += v
end

puts total

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

int calc(int i, int j, int k) {
    int f =(i+j)*(i+j)+(j+k)*(j+k)+(k+i)*(k+i);
    return f;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >>n;
  vector<int> v(n+1,0);
  for(int i=1;calc(i,1,1)<=2*n;i++){
    for(int j=1;calc(i,j,1)<=2*n;j++){
      for(int k=1;calc(i,j,k)<=2*n;k++){
        if(calc(i,j,k)%2==0){
          if(i==j&&j==k){
          	v[calc(i,j,k)/2]++;
          }else if(i==j||j==k){
            v[calc(i,j,k)/2]+=3;
          }else{
            v[calc(i,j,k)/2]+=6;
          }
        }
        if(j==k)break;
      }
      	if(i==j)break;
    }
  }
  rep(i,n)cout <<v[i+1]<<endl;
}

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
    int h1,h2,w1,w2;
    cin>>h1>>w1>>h2>>w2;
    cout<<(h1-h2)*(w1-w2)<<endl;
    return 0;
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std;
#define int lint
typedef long long lint;
typedef pair<int,int> P;
const int    INF=(int)1e9;
const int    MOD=(int)1e9+7;
const double EPS=(double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);
    };
};



signed main(){
  int a,b;cin>>a>>b;
  cout<<ceil((double)(a+b)/2)<<"\n";
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[10001],ans=0,bns=0,n,i;
    cin>>n; 
    for(i=1;i<=2*n;i++)
  		cin>>a[i];
    sort(a+1,a+1+2*n);    
    for(i=1;i<=2*n;i+=2)
        bns+=a[i];
    cout<<bns<<endl;
    return 0;
}

Measured memory_bytes: 256
(let ((s (read))
      (tt (read))
      (a (read))
      (b (read))
      (u (read))
     )
     (cond 
       ((equal s u) (princ (- a 1)) (princ " ") (princ b))
       ('(t) (princ a) (princ " ") (princ (- b 1)))
     )
)

Measured memory_bytes: 24088
from collections import deque
n = int(input())
q = deque()
for i in range(n):
    c = input()
    if c[0] == 'i':
        q.appendleft(c[7:])
    elif c[6] == ' ':
        try:
            q.remove(c[7:])
        except:
            pass
    elif c[6] == 'F':
        q.popleft()
    else:
        q.pop()
print(*q)

Measured memory_bytes: 71980
#include <cstdio>
#include <cstring>
#include <algorithm>
#define lf (x<<1)
#define rg (lf|1)
#define mem(a) memset(a,0,sizeof(a))
#define rep(i,j,k) for (i=j;i<=k;i++)
using namespace std;
const int N=5e5+5,INF=1e9;
int n,k,wh,mode,i,a[N],p[N],deg[N],out[N];
int Min[N*4],cs[N*4],dec[N*4];
int sum[N];
template <typename T> void read(T &ret)
{
	char ch; ret=0;
	for (ch=getchar();ch<'0' || ch>'9';ch=getchar());
	for (;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
}
int lowbit(int x) {return x&(-x);}
void add(int x) {
	while (x<=n) { sum[x]++; x+=lowbit(x); }
}
int query(int x) {
	if (x<1) return 0;
	if (x>n) x=n;
	int ret=0; while (x>0) {ret+=sum[x]; x-=lowbit(x);}
	return ret;
}
void merge(int x)
{
	Min[x]=min(Min[lf],Min[rg]);
	cs[x]=min(cs[lf],cs[rg]);
}
void build(int x,int l,int r)
{
	if (l==r)
	{
		if (!deg[l]) { Min[x]=INF; cs[x]=l; }
		else Min[x]=deg[l],cs[x]=INF;
		return ;
	}
	int mid=(l+r)>>1;
	build(lf,l,mid);
	build(rg,mid+1,r);
	merge(x);
}
void Init()
{
//	freopen("permutation.in","r",stdin);
//	freopen("permutation.out","w",stdout);
	read(n); read(k);
	rep(i,1,n) read(a[i]),p[a[i]]=i;
	rep(i,1,n) {
		deg[p[i]]=query(p[i]+k-1)-query(p[i]-k);
		add(p[i]);
	}
	build(1,1,n);
}
void pushdown(int x)
{
	Min[lf]-=dec[x]; dec[lf]+=dec[x];
	Min[rg]-=dec[x]; dec[rg]+=dec[x];
	dec[x]=0;
}
void recalc(int x,int l,int r)
{
	if (l==r)
	{
		if (Min[x]<1) {
			Min[x]=INF; cs[x]=l;
		}
		return;
	}
	int mid=(l+r)>>1;
	pushdown(x);
	if (Min[lf]<1) recalc(lf,l,mid);
	if (Min[rg]<1) recalc(rg,mid+1,r);
	merge(x);
}
void modify(int x,int L,int R,int l,int r)
{
	if (l>R || r<L) {
		if (Min[x]<1) recalc(x,l,r);
		return;
	}
	if (L<=l && r<=R)
	{
		if (mode==1) cs[x]=INF;
		else {
			Min[x]--; dec[x]++;
		}
		if (Min[x]<1) recalc(x,l,r);
		return ;
	}
	int mid=(l+r)>>1;
	pushdown(x);
	modify(lf,L,R,l,mid);
	modify(rg,L,R,mid+1,r);
	merge(x);
}
void Solve()
{
	int L,R;
	rep(i,1,n)
	{
		wh=cs[1];
		out[wh]=i;
		mode=1;
		modify(1,wh,wh,1,n);
		mode=2;
		L=max(1,wh-k+1); R=min(n,wh+k-1);
		modify(1,L,R,1,n);
	}
}
void Outit()
{
	rep(i,1,n) printf("%d\n",out[i]);	
}
int main()
{
	Init();
	Solve();
	Outit();
	return 0;
}

Measured memory_bytes: 30592
n = int(input())
list = [[0 for i in range(10)] for j in range(12)]
for i in range(n):
    b,f,r,v = map(int,input().split())
    list[3*(b - 1)+(f - 1)][r - 1] += v
for i in range(12):
    if i % 3 == 0 and i != 0:
        print('####################')
    for j in range(10):
        print(' {}'.format(list[i][j]),end = "")
        if j == 9:
            print('')

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

int main() {
  int H, W, i, j;
  cin >> H >> W;
  
  vector<char> vec(W + 2, 0);
  
  i = 0;
  while (i < H + 2)
  {
    j = 0;
    while (j < W + 2)
    {
      if (i == 0 || i == (H + 1) || j == 0 || j == (W + 1))
        cout << '#';
      else
      {
        char	c;
        cin >> c;
        cout << c;
      }
      j++;
    }
    cout << '\n';
    i++;
  }
  return (0);
}


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

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a; }

int main(void){
    ll n, x;
    cin >> n >> x;

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

    city[n] = x;

    sort(city, city + n + 1);

    ll diff[n];
    rep(i, n)
        diff[i] = city[i+1] - city[i];
    rep(i, n-1)
        diff[i+1] = gcd(diff[i], diff[i+1]);

    cout << diff[n-1] << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int maxn = 1000 + 5;
int n, m;
int mem[maxn];

bool Input()
{
 cin >> n >> m;
 if(!n && !m) return false;
 for(int i = 0; i < n; i++)
 {
  cin >> mem[i];
 }
 return true;
}

int solve()
{
 sort(mem, mem+n);
 int ans = -1, tmp;
 for(int i = n-1; i >= 0; i--)
  for(int j = i-1; j >= 0; j--)
  {
   //cout << mem[i] << " " << mem[j] << endl;
   tmp = mem[i]+mem[j];
   if(tmp > ans && tmp <= m) ans = tmp;
  }
 if(ans >= 0) return ans;
 return -1;
}

void Init()
{
 memset(mem, 0, sizeof(0));
}

int main()
{
 while(1)
 {
  Init();
  if(!Input()) break;
  int res = solve();
  if(res >= 0) printf("%d\n", res);
  else printf("NONE\n");
 }
}


Measured memory_bytes: 3184
#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long int
#define pb push_back
#define mp make_pair
const int mod=1e9+7;
void solve()
{
  int n;
  cin>>n;
  int val=n+(n*n)+(n*n*n);
  cout<<val<<endl;
}

int main()
{
  fastio
  solve();
}


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

using ll = long long int;

constexpr int M = 2019;

int main(){
    string s;
    cin >> s;
    int n = s.size();
    ll ans = 0, cnt[M]{};
    cnt[0] = 1;
    for(int i=n-1,r=0,d=1;i>=0;i--,d=d*10%M){
        r += (s[i]-'0')*d;
        r %= M;
        ans += cnt[r];
        cnt[r]++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3732
import java.io.*;
import java.util.*;
import java.math.*;

public class Main {


    public static void solve() {
        int mod = 1000000000 + 7;

        int n = in.nextInt();
        int m = in.nextInt();

        int[][] grid = new int[n][m];

        for(int i = 0; i < n; i += 1) {
            String s = in.nextLine();
            for(int j = 0; j < m; j += 1){
                grid[i][j] = s.charAt(j) == '.' ? 1 : 0;
            }
        }

        long[][] paths = new long[n][m];

        paths[0][0] = grid[0][0];

        for(int j = 1; j < m; j += 1)
            paths[0][j] = grid[0][j] == 0 ? 0 : paths[0][j-1];

        for(int i = 1; i < n; i += 1)
            paths[i][0] = grid[i][0] == 0 ? 0 : paths[i-1][0];

        for(int i = 1; i < n; i += 1) {
            for(int j = 1; j < m; j += 1){
                if(grid[i][j] == 0)
                    paths[i][j] = 0;
                else
                    paths[i][j] = paths[i-1][j]%mod + paths[i][j-1]%mod;
            }
        }

         out.println(paths[n-1][m-1]%mod);
        
    }


    public static InputReader in = new InputReader();
    public static PrintWriter out;

    public static void main(String[] args) {
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }


    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader() {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

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

        /**
         * When you call next(), that entire line will be skipped.
         * No flushing buffers.
         * Doesn't work when you want to scan the remaining line.
         *
         * @return entire line
         */
        public String nextLine() {
            String str = "";
            try {
                str = reader.readLine();
                tokenizer = null;
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return str;
        }
    }
}

Measured memory_bytes: 39172
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

double fc(int h, int m, int rh, int rm){
  pair<double, double> ph, pm;
  double pi = acos(-1);
  double th = pi/2 - (double)m/60.0*2*pi;
  if(th < 0) th += 2*pi;
  pm.first = rm*cos(th);
  pm.second = rm*sin(th);

  th = pi/2 - (double)h/12.0*2*pi - (double)m/60.0*1/12.0*2*pi;
  // cerr << th << endl;
  if(th < 0) th += 2*pi;
  // cerr << th << endl;
  ph.first = rh*cos(th);
  ph.second = rh*sin(th);
  // cerr << fixed << pm.first << " " << pm.second << endl;
  // cerr << ph.first << " " << ph.second << endl;
  double ans = sqrt(fabs(ph.first-pm.first)*fabs(ph.first-pm.first) + fabs(ph.second-pm.second)*fabs(ph.second-pm.second));

  return ans;
}

int main(){
  int a, b;
  cin >> a >> b;
  int h, m;
  cin >> h >> m;

  double ans = fc(h, m, a, b);
  printf("%.10f\n", ans);
  return 0;
}

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

int main() {
 string a;
 cin >> a;
 if(a == "A")cout << "T" << endl;
 else if(a =="C")cout << "G" << endl;
 else if(a == "G")cout << "C" << endl;
 else cout << "A" << endl;
 }


Measured memory_bytes: 256
#include<stdio.h>

#define NUMBER 100

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

void insertSort(int array[],int num)
{
	int i, v, j;
	for(i = 1; i <= num - 1; i++)
	{
		print_array(array,num);
		
		v = array[i];
		j = i - 1;
		
		while(j >= 0 && array[j] > v)
		{
			array[j + 1] = array[j];
			j--;
		}
		
		array[j + 1] = v;
    }
}
	
int main(void)
{
	int i, num;
	int array[NUMBER];

	scanf("%d", &num);
	
	for(i = 0; i < num; i++)
	{
		scanf("%d", &array[i]);
	}
	
	insertSort(array , num);
	
	print_array(array , num);
	
	return 0;
}


Measured memory_bytes: 2048
// STLのlistを使う p.113

#include <iostream>
#include <list>
#include <cstdio>

using namespace std;

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

    list<int> v;
    scanf("%d", &q);
    for (int i = 0; i < q; i++) {
        scanf("%s", &com);
        if (com[0] == 'i') {
            scanf("%d", &x);
            v.push_front(x);
        } else if (com[6] == 'L') {
            v.pop_back();
        } else if (com[6] == 'F') {
            v.pop_front();
        } else if (com[0] == 'd') {
            scanf("%d", &x);
            for (list<int>::iterator it = v.begin(); it != v.end(); it++) {
                if (*it == x) {
                    v.erase(it);
                    break;
                }
            }
        }
    }

    int i = 0;
    for (list<int>::iterator it = v.begin(); it != v.end(); it++) {
        if (i++) printf(" ");
        printf("%d", *it);
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 34460
/* {{{ */
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
/* }}} */

fn factorization(n: u64) -> Vec<(u64,u64)> {
    let mut n = n;
    let mut v = Vec::new();
    let mut p = 2u64;
    while p * p <= n {
        let mut x = 0;
        while n % p == 0 {
            n /= p;
            x += 1;
        }
        if x != 0 { v.push((p,x)) }
        p += 1;
    }
    if n != 1 { v.push((n,1)) }
    v
}

fn main() {
    input! {
        n: u64
    }
    let fs = factorization(n).into_iter().collect::<Vec<_>>();
    // println!("{:?}", fs);
    let mut res = 0;
    for (_p,e) in fs {
        let mut e = e;
        let mut i = 1;
        while i <= e {
            res += 1;
            e -= i;
            i += 1;
        }
    }
    println!("{}", res);
}
/* vim:set foldmethod=marker: */


Measured memory_bytes: 2140
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()


int main() {
  ll n;
  cin >> n;
  vector<pair<ll, ll>> limit(n);
  rep(i, n) {
    ll a, b;
    cin >> a >> b;
    limit[i].first = b;
    limit[i].second = a;
  }
  sort(all(limit));
  
  
  ll time = 0;
  bool flag = true;
  rep(i, n) {
    time += limit[i].second;
    if (time > limit[i].first) {
      flag = false;
      break;
    }
  }
  if (flag) puts("Yes");
  else puts("No");
  return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <stdio.h>
#include <vector>
#define int long long
#define endre getchar();getchar();return 0
using namespace std;
bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return (y, x%y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int n) {
	if (n == 0)return 1;
	return kai(n - 1)*n;
}
int mod_pow(int x, int y, int mod) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x%mod;
		}
		x = x * x%mod;
		y >>= 1;
	}
	return res;
}

signed main() {
	string s;
	cin >> s;
	if (s == "ani")cout << "square1001" << endl;
	else cout << "e869120" << endl;
	endre;
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<char , char> pcc;
#define pb push_back
#define mp make_pair
#define ft first
#define se second
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)


int main()
{
	ios_base::sync_with_stdio(0);
  	cin.tie(0);
  	ll n;
  	cin>>n;
  	double p[n+5];
  	for(ll i=1;i<=n;i++)
  	{
  		cin >> p[i];
  	}
  	double dp[n+5][n+5];
  	dp[0][0]=1;	
  	for(ll i=1;i<=n;i++)
  	{
  		dp[i][0]=dp[i-1][0]*(1-p[i]);
  		dp[i][i]=dp[i-1][i-1]*p[i];
  	}
  	for(ll i=2;i<=n;i++)
  	{
  		for(ll j=1;j<i;j++)
  		{
  			dp[i][j]=dp[i-1][j]*(1-p[i])+dp[i-1][j-1]*(p[i]);
  		}
  	}
  	// for(ll i=0;i<=n;i++)
  	// {
  	// 	for(ll j=0;j<=i;j++)
  	// 	{
  	// 		cout << dp[i][j] << " ";
  	// 	}
  	// 	cout << endl;
  	// }
  	double ans=0;
  	for(ll i=n;i>n/2;i--)
  	{
  		ans+=dp[n][i];
  	}
  	cout << setprecision(10)<< ans << endl;
	return 0;
}

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

int main()
{
        int N, x;
        cin >> N >> x;
        int a[N];
        for (int i = 0; i < N; ++i) {
                cin >> a[i];
        }
        long long ans = 0;
        for (int i = 0; i < N-1; ++i) {

                long long tmp = a[i] + a[i+1];
                if (tmp <= x) continue;
                else {
                        long long t = tmp - x;
                        if (t > a[i+1]) {
                                ans += a[i+1];
                                ans += (t-a[i+1]);
                                a[i+1] = 0;
                        }
                        else {
                                ans += t;
                                a[i+1] -= t;
                        }
                }
        }
        cout << ans << endl;

}


Measured memory_bytes: 640
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2,]
x,y=map(int,input().split())
if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
elif x in c and y in c:
  print('Yes')
else:
  print('No')

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

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

using namespace std;

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

	int ans=0;
	rep(i,n-2) if(s.substr(i,3)=="ABC") ans++;
	cout<<ans<<'\n';

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#define fo(i,n) for(long long i=0;i<n;i++)
#define ll long long int
#define inf 999999999999999999
#define pb push_back
#define MOD 1000000007
#define tr(c,it) for(auto it = (c).begin(); it != (c).end(); ++it)
#define fio ios_base::sync_with_stdio(false);cin.tie(0);
using namespace std;
//cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
 
void SieveOfEratosthenes() 
{ 
    bool prime[10000001];
    memset(prime, true, sizeof(prime)); 
  
    for (ll p=2; p*p<=10000000; p++) 
    { 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (ll i=p*p; i<=10000000; i += p) {
                prime[i] = false; 
            }
        } 
    }  
} 
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
	if(b%a==0)
	   return a;
	return gcd(b%a,a);
}
ll nCrModpDP(ll n, ll r, ll p) 
{ 
    ll C[r+1]; 
    memset(C, 0, sizeof(C));   
    C[0] = 1;
    for (ll i = 1; i <= n; i++) 
    {
        for (ll j = min(i, r); j > 0; j--) 
            C[j] = (C[j] + C[j-1])%p; 
    } 
    return C[r]; 
} 
ll nCrModp(ll n, ll r, ll p) 
{ 
   // Base case 
   if (r==0) 
      return 1; 
   ll ni = n%p, ri = r%p; 
  
   return (nCrModp(n/p, r/p, p) * 
           nCrModpDP(ni, ri, p)) % p; 
} 
int32_t main() 
{
    fio
	ll j,i,n,t,l,r,c,h,k,y,m,maxi,d,x;
	cin>>x>>y;
	k=0;
	for(i=0;i<=100;i++)
	{
		for(j=0;j<=100;j++)
		{
			if(i+j==x && 2*i+4*j==y)
			{
				k=1;
			}
		}
	}
	if(k)cout<<"Yes";
	else
		cout<<"No";
}



	

		

Measured memory_bytes: 3652
n = int(input())

x = list(map(int, input().split()))

if 0 in x:
  print(0)
else:
  res = 1
  ok = False
  for i in x:
    res = res * i
    if res > int(1e18):
      print(-1)
      ok = True
      break
  if not ok :
    print(res)

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


class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int n=sc.nextInt();
        int[]f=new int[n];
        for(int i=0;i<n;++i){
            for(int j=0;j<10;++j){
                int s=sc.nextInt();
                f[i]|=s<<j;
            }
        }
        int[][]p=new int[n][];
        for(int i=0;i<n;++i)
            p[i]=sc.nextIntArray(11);
        int ans=Integer.MIN_VALUE;
        for(int b=1;b<1<<10;++b){
            int t=0;
            for(int i=0;i<n;++i)
                t+=p[i][Integer.bitCount(b&f[i])];
            ans=Math.max(ans,t);
        }
        out.println(ans);
        out.close();
    }
    // http://codeforces.com/blog/entry/7018
    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;
    //-----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;
        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        int[] nextIntArray(int n){
            int[]r=new int[n];
            for(int i=0;i<n;++i)r[i]=nextInt();
            return r;
        }
    }
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); i++)
#define repi(i,a,b) for (int i=a;i<(b);i++)
using namespace std;
typedef long long ll;
  
  int main(void){
    cin.tie(0); //cin高速化
    ios::sync_with_stdio(false); //cin高速化
	
    int a,b,x;
    cin >> a >> b >> x;
    int n = x-a;
    if(n<0){
      cout << "NO" << endl;
      return 0;
    }
    if(b-n>=0){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
    }
    return 0;
  }    

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

int cnt[50];

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

	int *a = new int[M];
	int *b = new int[M];
	
	for (int i = 0; i < M; ++i) {
		cin >> a[i] >> b[i];
		++cnt[a[i]-1];
		++cnt[b[i]-1];
	}

	for (int i = 0; i < N; ++i) {
		cout << cnt[i] << endl;
	}


	return 0;
}

Measured memory_bytes: 256
a, b = map(int, input().split())
L = []
for i in range(a):
    l = input()
    if not l.count('.') == b:
        L.append(l)

M = []
for i in range(b):
    l = list(map(lambda x: x[i], L))
    if not l.count('.') == len(l):
        M.append(l)

for i in range(len(M[0])):
    for m in M:
        print(m[i],end='')
    print()

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

const int INF = 100100100;

int main()
{
    ll s;
    cin >> s;

    int x;
    int ans = INF;
    while (s > 100)
    {
        x = s % 1000;
        ans = min(abs(753 - x), ans);
        s /= 10;
    }

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

Measured memory_bytes: 3540
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	a,b,c = readline() |> split |> parseMap
	if a==b==c
		if a%2==0
			println(-1)
		else
			println(0)
		end
	else
		k = 0
		while a%2==0&&b%2==0&&c%2==0
			d = div(a,2)
			e = div(b,2)
			f = div(c,2)
			a = e+f
			b = d+f
			c = d+e
			k += 1
		end
		println(k)
	end
end
main()

Measured memory_bytes: 168348
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int N = stdIn.nextInt();
		int[][] X = new int[N][4];
		
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < 4; j++) {
				X[i][j] = stdIn.nextInt();
			}
		}
		
		for(int i = 0; i < N; i++) {
			if(X[i][2] - 5 > 0) {
				if(X[i][3] - 2 > 0) {
					int ans = (int) ((X[i][0]*X[i][2] + X[i][1] * X[i][3]) * 0.8);
					System.out.println(ans);
				}
				else {
					if((X[i][0] * X[i][2] + X[i][1] * 2) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
						int ans = (int) ((X[i][0] * X[i][2] + X[i][1] * 2) * 0.8);
						System.out.println(ans);
					}
					else {
						System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
					}
				}
			}
			else if(X[i][3] - 2 > 0) {
				if((X[i][0] * 5 + X[i][1] * X[i][3]) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
					int ans = (int) ((X[i][0] * 5 + X[i][1] * X[i][3]) * 0.8);
					System.out.println(ans);
				}
				else {
					System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
				}
			}
			else {
				if((X[i][0] * 5 + X[i][1] * 2) * 0.8 < X[i][0] * X[i][2] + X[i][1] * X[i][3]) {
					int ans = (int) ((X[i][0] * 5 + X[i][1] * 2) * 0.8);
					System.out.println(ans);
				}
				else {
					System.out.println(X[i][0] * X[i][2] + X[i][1] * X[i][3]);
				}
			}
		}
	}
		
}

Measured memory_bytes: 23400
#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <queue>
#include <map>

//#include <bits/stdc++.h>
using namespace std;
#define print(x) cout<<(x)<<endl
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define ll long long int
#define pb push_back

int main() {
  int a, b;
  cin >> a >> b;
  print(max(a+b, max(a-b, a*b)));

}


Measured memory_bytes: 888
N = int(input())
A = list(map(int, input().split()))

cnt = {}
for i, Ai in enumerate(A):
    key = str(Ai)
    cnt[key] = cnt.setdefault(key, 0) + 1

tab_full = {}
tab_sub  = {}
for key, val in cnt.items():
    if val == 0: continue
    tab_full[key] = val * (val - 1) // 2
    tab_sub[key] = (val - 1) * (val - 2) // 2

ans_base = sum(tab_full.values())
for i, Ai in enumerate(A):
    key = str(Ai)
    ans = ans_base
    ans -= tab_full[key]
    ans += tab_sub[key]
    print(ans)

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

int N;
long long prime_count[200] = {};

int main(){
  cin >> N;
  for(int i = 1; i <= N; i++){
    int i_copy = i;
    int j = 2;
    while(i_copy > 1){
      if(i_copy % j == 0){
	prime_count[j]++;
	i_copy /= j;
      }else{
	j++;
      }
    }
  }

  long long res = 0;
  // 3 * 5 * 5
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N; j++){
      for(int k = j + 1; k <= N; k++){
	if(i != j && j != k && k != i && prime_count[i] >= 2 && prime_count[j] >= 4 && prime_count[k] >= 4){
	  res++;
	}
      }
    }
  }

  // 3 * 25, 5 * 15
  for(int i = 0; i <= N; i++){
    for(int j = 0; j <= N; j++){
      if(i != j && prime_count[i] >= 2 && prime_count[j] >= 24){
	res++;
      }
      if(i != j && prime_count[i] >= 4 && prime_count[j] >= 14){
	res++;
      }
    }
  }

  // 75
  for(int i = 0; i <= N; i++){
    if(prime_count[i] >= 74){
      res++;
    }
  }

  cout << res << endl;

}
	


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

constexpr int64_t mod = 1'000'000'007;
int64_t mpow(int64_t x, int64_t y){
    if(y==0) return 1;
    if(y==1) return x%mod;
    if(y%2==0) return mpow(x*x%mod, y/2);
    return mpow(x*x%mod, y/2)%mod * x % mod;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout.precision(12);
    cout.setf(ios_base::fixed, ios_base::floatfield);
    
    int64_t fact[200001], finv[200001];
    fact[0] = 1;
    for(int i=1;i<=200000;i++) fact[i] = i*fact[i-1]%mod;
    finv[200000] = mpow(fact[200000], mod-2);
    for(int i=199999;i>=0;i--) finv[i] = finv[i+1]*(i+1)%mod;

    int64_t n, m, k;
    cin >> n >> m >> k;

    int64_t sum1 = 0, sum2 = 0, sum3 = 0;
    for(int64_t x=1;x<=n;x++) sum1 = (sum1 + (n-x)*(n-x+1)/2%mod) % mod;
    sum1 = sum1 * m % mod * m % mod;
    for(int64_t l=1;l<=m-1;l++) sum2 = (sum2 + l*(l+1)%mod) % mod;
    int64_t p = n*(n-1)/2%mod;
    sum2 = p * sum2 % mod;
    for(int64_t y=1;y<=m;y++) sum3 = (sum3 + (m-y)*(m-y+1)/2%mod) % mod;
    sum3 = sum3 * n % mod;
    cout << (sum1+sum2+sum3) % mod * fact[n*m-2] % mod * finv[k-2] % mod * finv[n*m-k] % mod << endl;
    
    return 0;
}

Measured memory_bytes: 3328
n = input()

ans = [0 for i in range(n)]
f = []

for i in range(n):
  f.append(map(int, raw_input().split()))

for i in range(3):
  for j in range(n):
    ans[j] += f[j][i]
    for k in range(n):
      if j != k and f[j][i] == f[k][i]:
        ans[j] -= f[j][i]
        break

for i in range(n):
  print ans[i]

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

int main() {
	int n;
	cin >> n;
	set<string> w;
	string ans = "Yes";
	string pre;
	rep(i, n) {
		string now;
		cin >> now;
		if(i>0) if(now[0] != pre[pre.size()-1]) {
			ans = "No";
		}
		if(w.count(now)) {
			ans = "No";
		}
		w.insert(now);
		pre = now;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*

fun main(args:Array<String>){
    val scn= Scanner(System.`in`)
    val n=scn.nextInt()
    val m=scn.nextInt()
    val c=scn.nextInt()
    var b=IntArray(m)
    var a:Int
    var cnt=0
    var sum=0

    for (i in 0 until m){
        b[i]=scn.nextInt()
    }
    for (k in 0 until n) {
        sum=0
        for (j in 0 until m) {
            a = scn.nextInt()
            sum+=a*b[j]
        }
        if (sum>-c) cnt++
    }

    println(cnt)
}

Measured memory_bytes: 31392
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    H, W, M = map(int, input().split())

    row = [0] * H
    col = [0] * W
    bomb = set()

    for i in range(M):
        h, w = map(int, input().split())
        h -= 1
        w -= 1
        row[h] += 1
        col[w] += 1
        bomb.add((h, w))

    # print(row, col, bomb)

    rowmax = max(row)
    colmax = max(col)

    rows = []
    cols = []
    for i in range(H):
        if row[i] == rowmax:
            rows.append(i)
    for i in range(W):
        if col[i] == colmax:
            cols.append(i)

    for r in rows:
        for c in cols:
            if (r, c) in bomb:
                continue
            else:
                print(rowmax + colmax)
                exit()

    print(rowmax + colmax - 1)


if __name__ == "__main__":
    main()


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

int main() {
    int n;
    int a[110];
    cin >> n;
    for(int i = 0; i < n; ++i) cin >> a[i];
    
    sort(a, a + n);
    cout << a[n-1] - a[0] << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
	int n,i,f,g=1;
	long long a[100000];
	scanf("%lld",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lld",&a[i]);
	}
	if(a[1]>a[0])f=1;
	if(a[1]<a[0])f=-1;
	if(a[1]==a[0])f=0;
	for(i=2;i<n;i++)
	{
		if(f==0&&a[i]>a[i-1]){f=1;}
		if(f==0&&a[i]<a[i-1]){f=-1;}
		if(f==1&&a[i]<a[i-1]){g++;f=0;}
		if(f==-1&&a[i]>a[i-1]){g++;f=0;}
	}
	printf("%d\n",g);
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)
#define ll long long

int main()
{
    int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int k;
    cin >> k;
    cout << a[k-1] << endl;
    return 0;
}

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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'
#define rep(i,n) for(int_fast32_t i = 0; i < ((int_fast32_t)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int_fast32_t i = 1; i <= ((int_fast32_t)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int_fast32_t i = ((int_fast32_t)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int_fast32_t i = ((int_fast32_t)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

using namespace std;

template<typename T>
using vec = vector<T>;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using ll = long long;
using ld = long double;
using vi = vec<int_fast32_t>;
using vl = vec<int_fast64_t>;
using vld = vec<ld>;
using vii = vec<vi>;  // 2次元配列
using PII = pair<int_fast32_t, int_fast32_t>;

template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
constexpr ll infll = (1LL<<62)-1;
constexpr int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;

i32 h,w, tmp_cnt, tmp;
char ch;
bool can;
/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
//    cout << fixed << setprecision(15);

    can = true;

    cin >> h >> w;
    map<char, i32> mp;
    rep(i,h) rep(j,w) {
        cin >> ch;
        ++mp[ch];
    }
//    // DEBUG
//    for(auto p : mp) cout << p.second << ' ';
//    cout << '\n';

    i32 odd_cnt = 0;
    for(auto p : mp) if(p.second&1) ++odd_cnt;
    if(odd_cnt > 1) can = false;

    /**
     * 各要素について、
     * 必ず同じ数にならなければならない箇所が存在し、それらこは同じであればどの文字を入れても条件を満たす
     * 貪欲に決めていく
     */

    maxheap<i32> hp;
    for(i32 i = 0; i <= h-i-1; ++i) {
        for(i32 j = 0; j <= w-j-1; ++j) {
            tmp_cnt = 4;
            if(i == h-i-1) tmp_cnt -= 2;
            if(j == w-j-1) tmp_cnt -= 2;
            if(!tmp_cnt) tmp_cnt = 1;
            hp.push(tmp_cnt);
//            // DEBUG
//            for(auto p : mp) cout << p.second << ' ';
//            cout << '\n';
        }
    }

    while(hp.size()) {
        tmp = hp.top(); hp.pop();
        for(auto iter = mp.begin(); iter != mp.end(); ++iter) {
            if(iter->second >= tmp) {
                iter->second -= tmp;
                tmp = -1;
                break;
            }
        }
        if(tmp != -1) can = false;
    }

    if(can) cout << "Yes" << '\n';
    else cout << "No" << '\n';

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}


Measured memory_bytes: 384
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var nk = Add.ar;
        var res = 0L;
        for(var i = 1; i <= nk[0]; i++)
        {
            res += nk[0] / i * Max(0, i - nk[1]);
            res += Max(0, nk[0] % i - nk[1] + 1);
        }
        WriteLine(res - (nk[1] == 0 ? nk[0] : 0));
    }
}

public class Add
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public  static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


Measured memory_bytes: 13140
import java.util.*;
public class Main{
  public static void main(String[]args){
  	Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    String ans = "No";
    
    int []kuku = new int [81];
    int c=0;
    for(int x=1; x<=9; x++){
    	for(int y=1; y<=9; y++){
          kuku[c]=x*y;
          c++;
        }
    }
    for(int i=0; i<81; i++){
    	if(a==kuku[i])ans="Yes";
    }
    
    System.out.println(ans);
  }
}

Measured memory_bytes: 21716
#include <iostream>
#include <vector>

using namespace std;
using PII = pair<int,int>;
#define INF (1e9+7)

int main() {
    int d, g;
    cin >> d >> g;
    g /= 100;

    vector<PII> vp;
    int p, c;
    for (int i=0; i<d; ++i) {
        cin >> p >> c;
        c /= 100;
        vp.push_back({p,c});
    }

    vector<vector<int>> dp(d+1,vector<int>(g+1,INF));
    dp[0][0] = 0;
    for (int i=0; i<d; ++i) {
        for (int k=0; k<=vp[i].first; ++k) {
            int point = (k == vp[i].first) ? vp[i].second : 0;
            int d = k * (i+1) + point;
            for (int j=0; j<=g; ++j) {
                int nj = min(j+d,g);
                dp[i + 1][nj] = min(dp[i + 1][nj], dp[i][j] + k);
            }
        }
    }

    cout << dp[d][g] << endl;
}

Measured memory_bytes: 5248
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a),end(a)
#define FOR(x,val,to) for(int x=(val);x<int((to));++x)
#define FORE(x,val,to) for(auto x=(val);x<=(to);++x)
#define FORR(x,arr) for(auto &x: arr)
#define FORS(x,plus,arr) for(auto x = begin(arr)+(plus); x != end(arr); ++x)
#define FORREV(x,plus,arr) for(auto x = (arr).rbegin()+(plus); x !=(arr).rend(); ++x)
#define REE(s_) {cout<<s_<<'\n';exit(0);}
#define GET(arr) for(auto &i: (arr)) sc(i)
#define whatis(x) cerr << #x << " is " << (x) << endl;
#define e1 first
#define e2 second
#define INF 0x7f7f7f7f
typedef std::pair<int,int> pi;
typedef std::vector<int> vi;
typedef std::vector<std::string> vs;
typedef int64_t ll;
typedef uint64_t ull;
#define umap unordered_map
#define uset unordered_set
using namespace std;
using namespace __gnu_pbds;

#ifdef _WIN32
#define getchar_unlocked() _getchar_nolock()
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
template<class L, class R> ostream& operator<<(ostream &os, map<L, R> P) { for(auto const &vv: P)os<<"("<<vv.first<<","<<vv.second<<")"; return os; }
template<class T> ostream& operator<<(ostream &os, set<T> V) { os<<"[";for(auto const &vv:V)os<<vv<<","; os<<"]"; return os; }
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os<<"[";for(auto const &vv:V)os<<vv<<","; os<<"]"; return os; }
template<class L, class R> ostream& operator<<(ostream &os, pair<L, R> P) { os<<"("<<P.first<<","<<P.second<<")"; return os; }
inline int fstoi(const string &str){auto it=str.begin();bool neg=0;int num=0;if(*it=='-')neg=1;else num=*it-'0';++it;while(it<str.end()) num=num*10+(*it++-'0');if(neg)num*=-1;return num;}
inline void getch(char &x){while(x = getchar_unlocked(), x < 33){;}}
inline void getstr(string &str){str.clear(); char cur;while(cur=getchar_unlocked(),cur<33){;}while(cur>32){str+=cur;cur=getchar_unlocked();}}
template<typename T> inline bool sc(T &num){ bool neg=0; int c; num=0; while(c=getchar_unlocked(),c<33){if(c == EOF) return false;} if(c=='-'){ neg=1; c=getchar_unlocked(); } for(;c>47;c=getchar_unlocked()) num=num*10+c-48; if(neg) num*=-1; return true;}template<typename T, typename ...Args> inline void sc(T &num, Args &...args){ bool neg=0; int c; num=0; while(c=getchar_unlocked(),c<33){;} if(c=='-'){ neg=1; c=getchar_unlocked(); } for(;c>47;c=getchar_unlocked()) num=num*10+c-48; if(neg) num*=-1; sc(args...); }
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; //s.find_by_order(), s.order_of_key() <- works like lower_bound
template<typename T> using ordered_map = tree<T, int, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 1000001

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
    int n,k;
    sc(n,k);
    int ans = 0;
    for(int i = 0; i+k <= n; ++i)
        ++ans;
    cout << ans;
}



Measured memory_bytes: 256