akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
int n, m, field[11][11], si, sj, num;
 
int dfs(int x, int y){
  int ans = 0;
  if(num == 0){
    if(x == si || y == sj)return 1;
    else return 0;
  }
  field[x][y] = 0;
  for(int i = x + 1;i < m;i++){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  }
  for(int i = x - 1;i >= 0;i--){
    if(field[i][y] == 1){
      num--;
      ans += dfs(i, y);
      num++;
      break;
    }
  }
  for(int i = y + 1;i < n;i++){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  }
  for(int i = y - 1;i >= 0;i--){
    if(field[x][i] == 1){
      num--;
      ans += dfs(x, i);
      num++;
      break;
    }
  } 
  field[x][y] = 1;
  return ans;
}
 
int main(){
  while(1){
    scanf("%d%d", &n, &m);
    if(n == 0 && m == 0)return 0;
    memset(field, 0, sizeof(field));
    num = 0;
    for(int i = 0;i < m;i++){
      for(int j = 0;j < n;j++){
    scanf("%d", &field[i][j]);
    if(field[i][j] == 2){
      si = i;
      sj = j;
    }
    else num += field[i][j];
      }
    }
    printf("%d\n", dfs(si, sj));
  }
}

Measured memory_bytes: 1028
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class EGetEverything {
public:
    static constexpr int kStressIterations = 0;

    static void generateTest(std::ostream& test) {
    }

    void solve(std::istream& cin, std::ostream& cout) {
        int N, M;
        cin >> N >> M;
        vector<int> a(M);
        vector<int> c(M);
        REP(i, M) {
            int b;
            cin >> a[i] >> b;
            REP(j, b) {
                int cc;
                cin >> cc;
                c[i] |= 1 << (cc - 1);
            }
        }

        vector<vector<int>> dp(M + 1, vector<int>(1 << N, INF));
        dp[0][0] = 0;
        REP(i, M) {
            REP(j, 1 << N) {
                int cc = c[i];
                dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
                dp[i+1][j | cc] = min(dp[i+1][j | cc], dp[i][j] + a[i]);
            }
        }

        int ans = dp[M][(1 << N) - 1];
        if (ans == INF) {
            cout << -1 << endl;
            return;
        }
        cout << ans << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    EGetEverything solver;
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 32384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pint = pair<int,int>;
ll mod = 1000000007;
int dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};
ll dp[100100][13];

ll gcd(ll a,ll b)
{
    if (a%b==0)
    {
        return(b);
    }
    else
    {
        return(gcd(b,a%b));
    }
}

int main() {
    ll x,y;
    cin >> x >> y;
    ll g = gcd(x,y);
    ll cnt = 1;
    for (ll i = 2; i*i < g; ++i) {
        if(g%i == 0){
            cnt++;
            while(g%i == 0){
                g /= i;
            }
        }
    }
    if(g != 1) cnt++;
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  char S[11];
  char T[12];
  scanf("%s\n%s",&S,&T);
  int i;
  int len;
  i = 0;
  while (S[i])
  {
    if (S[i] != T[i])
    {
      printf("No\n");
      return (0);
    }
    i++;
  }
  len = i;
  i = 0;
  while (T[i])
  {
    i++;
  }
  if (i == len + 1)
  {
    printf("Yes\n");
  }
  else
  {
    printf("No\n");
  }
}

Measured memory_bytes: 1660
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int height,width;
    bool isOver = false;
    while(!isOver){
        cin>>height>>width;
        if(height ==0 && width == 0){
            isOver = true;
            break;
        }else{
            for(int i=0;i<height;i++){
                for(int j = 0;j<width;j++){
                cout<<'#';
                }
                cout<<endl;
            }
        }
        
        cout<<endl;
        
    
    }
	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  VL a(n), d(n);
  ll sum = 0;
  rep(i, n)
  {
    cin >> a[i];
    sum += a[i];
  }
  ll de = (n * (n + 1) / 2);
  ll k = sum / de;

  rep(i, n - 1) d[i] = a[i + 1] - a[i] - k;
  d[n - 1] = a[0] - a[n - 1] - k;

  bool ans = true;

  if (sum % de != 0)
  {
    ans = false;
  }

  rep(i, n)
  {
    if (d[i] < 0 && d[i] % n == 0)
    {
      k -= -d[i] / n;
    }
    else if (d[i] == 0)
    {
      continue;
    }
    else
    {
      ans = false;
    }
  }
  puts(ans && (k == 0) ? "YES" : "NO");

  return 0;
}


Measured memory_bytes: 1792
// AOJ 2717: Where is the Boundary
// 2018.1.5 bal4u@uu

#include <stdio.h>

#define MAX 10003
int se[MAX], sw[MAX], w[MAX];
char d[MAX];

int main()
{
	int n, m, i, j, x, total_w, min, ans;
	char *p;

	fgets(d, 15, stdin), sscanf(d, "%d%d", &n, &m);
	se[0] = sw[0] = total_w = 0;
	j = m; while (j--) {
		fgets(p=d, MAX, stdin);
		for (i = 1; *p > ' '; i++) {
			if ((*p++ >> 1) & 1) w[i]++, total_w++;
		}
	}
	for (i = 1; i <= n; i++) se[i] = se[i-1]+(m-w[i]), sw[i] = sw[i-1]+w[i];
	se[n+1] = se[n], sw[n+1] = sw[n];

	ans = 0, min = 0x7fffff;
	for (i = 0; i <= n; i++) {
		x = se[i]+total_w-sw[i];
		if (x < min) min = x, ans = i;
	}
	printf("%d %d\n", ans, ans+1);
	return 0;
}


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

namespace my {
/*汎用*/
template <typename T>
void input_vec(vector<T> &a, ll n) {
  assert(a.empty());
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.push_back(tmp);
  }
}
template <typename T>
void input_set(set<T> &a, ll n) {
  assert(a.empty());
  for (ll i = 0; i < n; i++) {
    T tmp;
    cin >> tmp;
    a.insert(tmp);
  }
}

char itoc(int i) { return i + '0'; }
int ctoi(char c) { return c - '0'; }

/*整数*/
ll gcd(ll a, ll b) {  // O( log(max(a,b)) )
  a = abs(a);
  b = abs(b);
  if (a < b) swap(a, b);
  while (b != 0) {
    a %= b;
    swap(a, b);
  }
  return a;
}
ll lcm(ll a, ll b) { return a * (b / my::gcd(a, b)); }  // O( log(max(a,b)) )
ll modinv(ll n, ll mod) {                               // O( log(max(n,mod)) )
  assert(mod > 0 && my::gcd(n, mod) == 1);
  n %= mod;
  if (n < 0) n += mod;
  ll a = mod, b = n, x = 1, y = 0;
  while (b != 0) {
    ll q = a / b, r = a % b;
    a = b;
    b = r;
    y -= q * x;
    swap(x, y);
  }
  y %= mod;
  if (y < 0) y += mod;
  return y;
}

bool is_prime(ll n) {  // O( sqrt(n) )
  bool flag = true;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      flag = false;
      break;
    }
  }
  return flag;
}
vector<pair<ll, ll>> prime_factorize(ll n) {  // O( sqrt(n) )
  vector<pair<ll, ll>> ret;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i != 0) continue;
    ll exp = 0;
    while (n % i == 0) {
      n /= i;
      exp++;
    }
    ret.push_back(make_pair(i, exp));
  }
  if (n != 1) ret.push_back(make_pair(n, 1));
  return ret;
}

/*union find*/
class unionfind {
 private:
  /*根のparの値は「-(その木の要素数)」とする*/
  ll n_;
  vector<ll> par;

  ll root(ll a) {  // O( log(n) )
    if (par.at(a) < 0)
      return a;
    else {
      par.at(a) = root(par.at(a));  //経路圧縮
      return par.at(a);
    }
  }

 public:
  unionfind(ll n) : n_(n), par(n, -1) {}  // O(n)

  void unite(ll a, ll b) {  // O( log(n) )
    assert(0 <= a && a < n_);
    assert(0 <= b && b < n_);
    if (root(a) == root(b))
      return;
    else {
      ll ra = root(a), rb = root(b);
      if (-par.at(ra) < -par.at(rb)) swap(ra, rb);  //サイズによる併合
      par.at(ra) += par.at(rb);
      par.at(rb) = ra;
    }
  }

  bool is_same(ll a, ll b) {  // O( log(n) )
    assert(0 <= a && a < n_);
    assert(0 <= b && b < n_);
    return root(a) == root(b);
  }

  ll size(ll a) {  // O( log(n) )
    assert(0 <= a && a < n_);
    return -par.at(root(a));
  }
};
}  // namespace my
////////////////////////////////////////////////

int main() {
  int n;
  cin >> n;
  vector<ll> a;
  my::input_vec(a, n);
  map<ll, int> cntx;
  for (int i = 0; i < n; i++) {
    ll x = i + a.at(i);
    if (!cntx.count(x))
      cntx[x] = 1;
    else
      cntx.at(x)++;
  }

  ll ans = 0;
  for (int i = 0; i < n; i++) {
    ll y = i - a.at(i);
    if (cntx.count(y)) ans += cntx.at(y);
  }

  cout << ans << endl;
}

Measured memory_bytes: 17116
s = gets.chomp.split("")
dir = [["R", "U", "D"], ["L", "U", "D"]]
flag = 1
id = 0
s.each do |c|
  tmpflag = 0
  dir[id%2].each do |d|
    if c == d
      tmpflag = 1
      break
    end
  end
  if tmpflag == 0
    flag = 0
    break
  end
  id += 1
end
if flag == 1
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) {
  return '"' + s + '"';
}
string to_string(const char* s) {
  return to_string((string) s);
}
string to_string(bool b) {
  return (b ? "true" : "false");
}
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
const long long mod = 998244353; // CHECK
long long power(long long a, long long b, long long m = mod) {
    if(b < 0) {
        return power(power(a, -b), mod-2);
    }
    long long x = 1;
    while(b) {
        if(b & 1) {
            x = 1ll * x * a % m;
        }
        a = 1ll * a * a % m;
        b /= 2;
    }
    return x;
}
#define ll long long
const int INT_INF = 1e9+9;
const ll LL_INF = 2e18;
const int N = 3e5+9;

signed main() {  
    ios_base::sync_with_stdio(false); 
    cin.tie(0); cout.tie(0);
    int n, s; cin >> n >> s;
    vector<int> a(n+1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }    
    ll inv2 = power(2, -1);
    vector<vector<ll>> f(n+1, vector<ll>(s+2));
    f[0][0] = power(2, n);
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= s; j++) {
            f[i][j] = (f[i-1][j] + (j-a[i]>=0 ? f[i-1][j-a[i]] : 0) * inv2 % mod) % mod;
        }
    }
    // debug(f);
    cout << f[n][s] << "\n";

    

    return 0;
}



Measured memory_bytes: 73648
#include<iostream>
#include<string>
using namespace std;
int main(){
  string str;
  char cup='A';
  while(cin>>str){
    char a,b;
    a=str[0];b=str[2];
    if(a==cup){
      cup=b;
    }else if(b==cup){
      cup=a;
    }
  }
  cout<<cup<<endl;
  return 0;
}

Measured memory_bytes: 3196
#include<stdio.h>
#include<string.h>
#define L 100005

typedef struct pp{
  char name[100];
  int t;
}A;

A deq();
void enq(A x);
A Q[L];
int t,h, n;

int min(int a,int b){ return a<b ? a : b;}

int main(){

  int elaps=0, c;
  int i, q;
  A u;

  scanf("%d %d", &n, &q);

  for(i=1;i<=n;i++){
    
    scanf("%s",Q[i].name);

    scanf("%d",&Q[i].t);

  }
  
  h=1; t=n+1;

  while(h !=t){

    u=deq();
    c=min(q, u.t);
    u.t -=c;
    elaps+=c;
    if(u.t>0) enq(u);
    else{
      printf("%s %d\n",u.name, elaps);
    }
  }

  return 0;
}



A deq(){
  A x =Q[h];
  h = (h+1)%L;
  return x;
}

void enq(A x){
  Q[t]=x;
  t=(t+1)%L;
}



Measured memory_bytes: 11860
N, X = map(int, input().split())
L = list(map(int, input().split()))
L.append(X)
L.sort()
cand = []
def gcd(x, y):
    while y != 0:
        (x, y) = (y, x % y)
    return x

for i in range(N):
    cand.append(abs(L[i] - L[i+1]))

for i, can in enumerate(cand):
    if i == 0:
        tmp = can
        continue
    tmp = gcd(tmp, can)
print(tmp)


Measured memory_bytes: 63640
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>
#include <bitset>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, 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 ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int calc_digit(int x){
  int res = 0;
  while (x > 0){
    res++;
    x /= 10;
  }
  return res;
}

int digit_sum(int x){
  int sum = 0;
  int digit = calc_digit(x);
  for (int i = 0; i < digit; ++i){
    sum += (x % 10);
    x /= 10;
  }
  return sum;
}

int main(){
  int N, A, B; cin >> N >> A >> B;
  int ans = 0;
  for (int i = 1; i <= N; ++i){
    if (A <= digit_sum(i) && digit_sum(i) <= B) ans += i;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
package main

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

func main() {
	n := getInt()

	count2 := 0
	count4 := 0
	for i := 0; i < n; i++ {
		tmp := getInt()
		if tmp%4 == 0 {
			count4++
		} else if tmp%2 == 0 {
			count2++
		}
	}

	if count4*2+count2 >= n || count4 >= n/2 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

// -----------------------------------------

var scanner = wordScanner()

func wordScanner() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}

func getInt() int {
	scanner.Scan()
	i, err := strconv.Atoi(scanner.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func getString() string {
	scanner.Scan()
	s := scanner.Text()
	return s
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6+5;
const ll mod = 998244353;
char s[maxn];
ll b[maxn];
int main()
{
    int n,k;
    while(~scanf("%s",s))
    {
       int x = (s[0]-'0')*10 + s[1] - '0';
        int y = (s[2] - '0')*10 + s[3] - '0';
        int have1 = 0,have2 = 0;
        if(x >= 1&& x <= 12)have1 = 1;
        if(y >= 1&& y <= 12)have2 = 1;
        if(have1&&have2)cout<<"AMBIGUOUS"<<endl;
        else if(have1)cout<<"MMYY"<<endl;
        else if(have2)cout<<"YYMM"<<endl;
        else cout<<"NA"<<endl;
    }
}




















Measured memory_bytes: 2304
//coded by dsingh_24
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<long long,long long>
#define vll          vector<long long>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (long long)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
	ios
    ll n,i,j,mx=0;
    cin>>n;
    ll a[n+1];
    map<ll,ll>m;
    for(i=0;i<n;i++)
    {
    	cin>>a[i];
    	m[a[i]]++;
    	m[a[i]-1]++;
    	m[a[i]+1]++;
    	mx=max(mx,m[a[i]]);
    	mx=max(mx,m[a[i]-1]);
   		mx=max(mx,m[a[i]+1]);
	}
	cout<<mx;
	return 0;
}


Measured memory_bytes: 7040
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vv vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 100000000000
#define eps 1e-7
#define mod 1000000007
#define int ll
using namespace std;

int R, G, B, N;

signed main(void) {
    cin >> R >> G >> B >> N;

    int cnt=0;
    REP(r, 0, N/R) {
        int r_sum = r * R;
        REP(g, 0, N/G) {
            int g_sum = g * G;
            int rest = N - r_sum - g_sum;
            if (rest % B == 0 && rest / B >= 0) {
                cnt++;
//                cout << r << ", " << g << ", " << rest / B << endl;
            }
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

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

typedef long long ll;


int X, Y, Z;
int ans;

int main() {
  cin >> X >> Y >> Z;

  ans = (X-Z) / (Y+Z);

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


Measured memory_bytes: 256
import math
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

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


def main():
    N = int(input())
    s = math.ceil(N / 1000)
    print(1000 * s - N)


if __name__ == "__main__":
    main()


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

  int input;  cin >> input;
  while(input > 0){
    if(input % 10 == 9){
      cout << "Yes" << endl;
      break;
    }
    input /= 10;
    if(input == 0)    cout << "No" << endl;
  }


  return 0;
}


Measured memory_bytes: 256
use std::io::{Read, stdin};
use std::str::FromStr;

fn main() {
    let n: usize = read();
    let mut a: Vec<i64> = vec![0; n];
    let mut b: [bool;8] = [false; 8];
    let mut cnt = 0;
    for i in 0..n {
        a[i] = read();
        if a[i]/400 < 8{
            b[(a[i]/400) as usize] = true;
        }else{
            cnt += 1;
        }
    }
    let mut ans = 0;
    for fl in &b {
        if *fl {
            ans += 1;
        }
    }
    if ans == 0{
        println!("{} {}", 1, cnt);
    }else{
        println!("{} {}", ans, cnt + ans);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

Measured memory_bytes: 4352
/*
小数点　　cout <<fixed<< setpresicion(小数点以下の桁数）<<変数<<endl;

ライブラリのπ　→   M_PI

for(int i = 0;i < n;i++)

cd ..で戻る
ls  で一覧
cd  でchange directory
実行中止　cntrl + c

*/
#include <bits/stdc++.h>

using namespace std;

int A[100001],n;

/* binary search*/

int binarySearch(int key){

int left = 0;
int right = n;
int mid;
while(left < right){
  mid = (left + right)/2;
  if(key == A[mid]) return 1;/*keyを発見,trueをreturnしてもいい感じ？*/
  if(key > A[mid]) left = mid +1;/*後半を探索*/
  else if(key < A[mid]) right = mid;/*前半を探索*/
}
return 0;
}
int main() {
  int q,k;
  int ans = 0;

  cin >> n;

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

  cin >> q;

  for(int i = 0;i < q;i++){
    cin >> k;
    if(binarySearch(k)){
      ans++;
    }


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


Measured memory_bytes: 3432
Imports System

Module Program
	Public Function CountChar(ByVal s As String, ByVal c As Char)
		Return s.Length - s.Replace(c.ToString(), "").Length
	End Function
	Sub Main()
		Dim msg As String
		Dim S As String
		S = Console.ReadLine()
		Dim cnt As Integer
		Dim len As Integer = S.Length
		cnt = CountChar(S, "o")
		Dim nokori As Integer = 15 - len
		cnt = cnt + nokori

		If cnt >= 8 Then
			msg = "YES"
		Else
			msg = "NO"
		End If

		Console.WriteLine(msg)
	End Sub
End Module


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leading zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
string text="abcdefghijklmnopqrstuvwxyz";
const int maxn=1e6+7;
//        .--------------.
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    int n=s.size();
    string t="";
    for(int i=0;i<n;i++){
        if(i%2==0)t+="0";
        else t+="1";
    }
    int cnt=0,cnt1=0;
    for(int i=0;i<n;i++){
        if(s[i]!=t[i])cnt++;
    }
    t="";
    for(int i=0;i<n;i++){
        if(i%2==0)t+="1";
        else t+="0";
    }
    for(int i=0;i<n;i++){
        if(s[i]!=t[i])cnt1++;
    }
    cout<<min(cnt1,cnt)<<endl;
}


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

int main() {
  string n;
  cin>>n;
  if(n.at(0)==n.at(1) && n.at(1)==n.at(2)) cout<<"Yes"<<endl;
  else if(n.at(1)==n.at(2) && n.at(2)==n.at(3)) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


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

#define ll long long
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
#define PP pair<P,int>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define all(a) (a).begin(),(a).end()


signed main(){
    int n;
    cin>>n;
    int ans=0;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        ans+=b-a+1;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mo = 998244353;
const int N = 3010;
long long f[N][N];
int main() {
    int a,b,c,d;
    scanf("%d%d%d%d", &a,&b,&c,&d);
    f[a][b] = 1;
    for(int i = a; i<=c; ++i) {
        for(int j = b; j<=d; ++j) {
            if(i==a&&j==b) continue;
            f[i][j] = (f[i-1][j]*j%mo+f[i][j-1]*i%mo)%mo;
            f[i][j] = (f[i][j]-(i-1)*(j-1)*f[i-1][j-1]%mo+mo)%mo;
        }
    }
    printf("%lld\n",f[c][d]);
    return 0;
}

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



int main(){
   
    int N,M;cin>>N>>M;
    int ans=0;
    for(int i=1;i*i<=M;i++){
        if(M%i==0){
            if(i>=N&&M/i<=N) ans=max(ans,M/i);
            if(M/i>=N&&i<=N) ans=max(ans,i);
            if(M/i>=N&&i>=N) ans=max(ans,max(M/i,i));
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
#pragma GCC target("avx2")
#pragma GCC optimize("O3,unroll-loops")

#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(int a, int b){return a<b?b:a;}
char s[100001];
int main(void){
	int n=nextstr(s);
	int ans=n;
	for(int i=0; i<n-1; i++){
		if(s[i]!=s[i+1]){
			int now = max2(i+1, n-i-1);
			if(now<ans) ans=now;
		}
	}
	printf("%d\n", ans);
}


Measured memory_bytes: 1692
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
    int distx = x2-x1;
    int disty = y2-y1;

    cout << x2-disty << ' ' << y2+distx << ' ' << x1-disty << ' ' << y1+distx;
}



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

using namespace std;

int main()
{
    int n;
    cin>>n;
    long long a[n];
    map<long long,long long>d;
    map<long long,long long>::iterator itr;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        d[a[i]]++;
    }
    long long sum=0;
    long long x;
    for(itr=d.begin();itr!=d.end();itr++)
        {
            x=itr->second;
            sum+=(x*(x-1))/2;
        }
    for(int i=0;i<n;i++)
    {
        if (d[a[i]]>=2)
            cout<<sum-d[a[i]]+1<<endl;
        else
            cout<<sum<<endl;
    }


}


Measured memory_bytes: 11008
fun main() {
    val n = readLn().toLong()
    val pows26 = mutableListOf(26L)
    var p26 = 26L
    for (i in 1 until 11) {
        val last = pows26.last()
        pows26.add(last + p26 * 26)
        p26 *= 26
    }

    fun findNumberOfCharacters(): Int {
        for (i in pows26.indices) {
            if (n > pows26[i] && n <= pows26[i + 1]) return i + 2
        }

        return 1
    }

    val numOfChars = findNumberOfCharacters()

    var rep = n - 1
    if (numOfChars != 1) rep = n - pows26[numOfChars - 2] - 1

    val ans = mutableListOf<Char>()
    while (rep > 0) {
        ans.add(('a' + (rep % 26).toInt()))
        rep /= 26
    }

    while(ans.size < numOfChars) ans.add('a')

    println(ans.reversed().joinToString(""))
}

// Input Reader
private fun readLn() = readLine()!!

Measured memory_bytes: 36628
//102
#include<iostream>
#include<utility>
#include<string>
#include<vector>
#include<algorithm>
#include<deque>
#include<queue>
#include<set>
#include<map>
#include<functional>

using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>

LL H, W, h, w, A, B, C;
string s;

int main() {
	cin >> A;
	//int ans = max(A, max(B, C)) * 10 + A + B + C - max(A, max(B, C));
	cout << (A%2?2*A:A) << endl;

	return 0;
}

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

using namespace std;
#define int long long
const int MOD = 1000000007;

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int K, X;
	cin >> K >> X;
	if (K * 500 >= X) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}

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

int main(){
  int a,b;
  cin>>a>>b;
  if(max({a,b})>=10){
      cout<<"-1"<<endl;
  }else{
      cout<<a*b<<endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = sc.next();
		String x = a + b;
		int y = Integer.parseInt(x);
		String ans = "No";
		for(int i = 0;i < 1000;i++) {
			if(i * i == y) {
				ans = "Yes";
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23764
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

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

int main() {
	int n, m;
	while (cin >> m >> n, n || m) {
		int v[100];
		REP(i, n) scanf("%d", &v[i]);
		
		int ans = 1;
		REP(i, n) ans = max(ans, v[i]);
		
		while (true) {
			int cnt = 0, pos = 0;
			while (pos < n) {
				cnt++;
				int now = v[pos++];
				while (pos < n && now + v[pos] <= ans) now += v[pos++];
			}
			
			if (cnt <= m) {
				cout << ans << endl;
				break;
			}
			
			ans++;
		}
	}
	
	return 0;
}

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

int main(){
    int n;cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int count=0;
    for(int i=1;i<n-1;i++){
        if((arr[i-1]>arr[i]&&arr[i+1]<=arr[i])||(arr[i-1]<=arr[i])&&arr[i+1]>arr[i])count++;
    }
    cout <<count<<"\n";

}


Measured memory_bytes: 256
//#pragma GCC optimize "trapv"
#include<bits/stdc++.h>
using std::cout;
using std::cin;
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define S 5000001
#define M 1000000007
#define nl cout<<"\n";
#define er  cout<<"\n***********\n";
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define test lli t;  cin>>t; while(t--)
#define f0(s,a,b) for(lli s=a;s<b;s++)
#define f1(s,a,b) for(lli s=a;s<=b;s++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define T 100
#define print(x) cout<< #x <<"=" <<x<<"\n";


int main()
{
     fast
     lli n;
     cin>>n;
     lli sum=0;
     for(lli i=1;i<=n;i++)
     {
         for(lli j=1;j<=n;j++)
         {
             for(lli k=1;k<=n;k++)
             {
                 sum=sum+__gcd(i,__gcd(j,k));
             }
         }
     }
    cout<<sum;
}

Measured memory_bytes: 3652
#include <iostream>
#include<stdio.h>
#include<string>
#include<queue>
using namespace std;

int main()
{
	int n, tim, alltime = 0;
	cin >> n >> tim;
	queue<string> name;
	queue<int> num;
	queue<string>toukei;
	for (int i = 0; i < n; i++)
	{
		string a; int b;
		cin >> a >> b;
		name.push(a); num.push(b);
	}
	while (1) {
		if (num.empty() == true) {
			return 0;
		}
		if (num.front() > tim) {
			int front = num.front(); string ichijiteki = name.front();
			front -= tim;
			num.pop(); name.pop(); num.push(front); name.push(ichijiteki); alltime += tim;
		}
		else {
			int sa =  num.front();
			num.pop();
			alltime += sa;
			cout << name.front() << " " << alltime << endl;
			name.pop();
		}
	}
}

Measured memory_bytes: 5820
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<algorithm>
#include<map>
#include<bitset>
#include<math.h>
///////////////////////////////////////////
using namespace std;
#define _GLIBCXX_DEBUG
#define lint long long
#define ll long long
#define pq priority_queue
#define mp make_pair
#define pb push_back
#define vl vector<long long>
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end()
#define rep(x) for(int i = 0;i < (x);i++)
#define repj(x) for(int j = 0;j < (x);j++)
#define REP(i,x) for(int (i) = 0;(i) < (x);(i)++)
#define rrep(x) for(int i = (x);i >= 0;i--)
#define mod 1000000007
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define F first
#define S second
long long qp(int a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
int qp(int a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
long long INF = 1e18;


//////////////////////////////////////////////////

int main() {
	const int M = 1e5;
	const int m = 5e4;
	vector<int> pn(M, 1);
	for (int i = 2; i <= sqrt(M); i++) {
		for (int j = 1; j <= M; j++) {
			if (i != j && j %i == 0) pn[j] = 0;
		}
	}

	vector<int> cum;
	cum.pb(0);
	for (int i = 2; i <= m; i++) {
		if (pn[i] == 1 && pn[2 * i - 1] == 1) cum.pb(2 * i - 1);
	}
	int q; cin >> q;
	for (int i = 0; i < q; i++) {
		int l, r; cin >> l >> r;
		vector<int>::iterator lb = lower_bound(cum.begin(), cum.end(), l);
		vector<int>::iterator ub = upper_bound(cum.begin(), cum.end(), r);
		cout << ub-lb << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<map>
#include<unordered_set>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef unordered_set<ll> uset;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=0;i<=n;i++)
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define all(x) x.begin(),x.end()
#pragma gcc optimize("O3")
#pragma gcc optimize("unroll-loops")
#pragma gcc target("avx2,see4")
#define N (1<<16)
typedef struct OfflineDynamicConnectivity{
	typedef struct UndoAbleUnionFind{
		ll dat[N];
		stack<P> S;
		void init(){
			rep(i,N)dat[i]=-1;
		}
		ll find(ll x){
			return (dat[x]<0?x:find(dat[x]));
		}
		void unite(ll a,ll b){
			a=find(a),b=find(b);
			S.push(make_pair(a,dat[a]));
			S.push(make_pair(b,dat[b]));
			if(a==b)return;
			if(-dat[a]<-dat[b])swap(a,b);
			dat[a]+=dat[b];
			dat[b]=a;
		}
		bool same(ll a,ll b){
			return find(a)==find(b);
		}
		void rollback(){
			rep(i,2){
				dat[S.top().first]=S.top().second;
				S.pop();
			}
		}
	}UndoAbleUnionFind;
	UndoAbleUnionFind uf;
	vector<P> edges[2*N];
	void addedgedfs(ll k,ll a,ll b,ll l,ll r,P e){
		if(b<=l||r<=a)return;
		if(l<=a&&b<=r){
			edges[k].push_back(e);
			return;
		}
		ll m=(a+b)>>1;
		addedgedfs(k*2+1,a,m,l,r,e);
		addedgedfs(k*2+2,m,b,l,r,e);
	}
	int times;
	map<P,ll> mas;
	void change_edge(P e){
		if(mas.count(e)){
			addedgedfs(0,0,N,mas[e],times,e);
			mas.erase(e);
		}
		else{
			mas[e]=times;
		}
		times++;
	}
	vector<P> query[N];
	void add_query(P e){
		query[times-1].push_back(e);
	}
	void work(ll k,ll a,ll b){
		for(auto e:edges[k]){
			uf.unite(e.first,e.second);
			//cerr<<"unite("<<e.first<<","<<e.second<<")"<<endl;
		}
		if(a+1==b){
			for(auto e:query[a]){
				bool res=uf.same(e.first,e.second);
				cout<<(res?"YES":"NO")<<endl;
			}
		}
		else{
			ll m=(a+b)>>1;
			work(k*2+1,a,m);
			work(k*2+2,m,b);
		}
		rep(i,edges[k].size()){
			uf.rollback();
			//cerr<<"rollback()"<<endl;
		}
	}
	void init(){
		times=1;
	}
	void solve(){
		for(auto c:mas){
			addedgedfs(0,0,N,mas[c.first],times,c.first);
		}
		uf.init();
		work(0,0,N);
	}
}OfflineDynamicConnectivity;
OfflineDynamicConnectivity odc;
int main(){
	odc.init();
	ll n,q;
	cin>>n>>q;
	rep(i,q){
		ll t,a,b;
		cin>>t>>a>>b;
		if(a>b)swap(a,b);
		P e=make_pair(a,b);
		if(t==3)odc.add_query(e);
		else odc.change_edge(e);
	}
	odc.solve();
}



Measured memory_bytes: 16808
#include <bits/stdc++.h>
using namespace std;
int n;
int c[100100];
int main()
{
    c[0] = 0;
    cin >> n;
    for(int i = 1; i < 100100; i++)
    {
        c[i] = 100100;
        for(int k = 0; k < 7; k++)
        {
            int t = pow(6, k);
            if(i - t >= 0)
            {
                c[i] = min(c[i], c[i - t] + 1);
            }
        }
        for(int k = 0; k < 7; k++)
        {
            int u = pow(9, k);
            if(i - u >= 0)
            {
                c[i] = min(c[i], c[i - u] + 1);
            }
        }
    }
    cout << c[n] << endl;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
const int INF=1e9,MOD=1e9+7;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  std::vector<int> v(5);
  for(int i=0;i<5;i++)cin>>v[i];
  sort(v.begin(),v.end());
  int fans=LINF;
  do{
    int ans=0;
    for(int i=0;i<4;i++){
      ans+=v[i];
      if(v[i]%10)ans+=10-v[i]%10;
    }
    ans+=v[4];
    fans=min(ans,fans);
  }while (std::next_permutation(v.begin(), v.end()));
  cout<<fans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 300010;
int n, s1[maxn], s2[maxn], ans = 1e9;
char s[maxn];
int main() {
	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++i)
		s1[i] = s1[i - 1] + (s[i] == 'W');
	for (int i = n; i >= 1; --i)
		s2[i] = s2[i + 1] + (s[i] == 'E');
	for (int i = 1; i <= n; ++i)
		ans = min(ans, s1[i - 1] + s2[i + 1]);
	printf("%d", ans);
}


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

int main(){
  int n;
  cin >> n;
  map<string,int> mp;
  for(int i = 0; i < n ; i++){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    mp[s]++;
  }
  long long ans = 0;
  for(auto& p : mp){
    int num = p.second;
    ans += (long long) num * (num-1) / 2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 11136
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<limits.h>
#include<float.h>

int main(){
	int w, h, x, y;
	double area;
	scanf("%d%d%d%d\n", &w, &h, &x, &y);
	area = (double)h * w / 2;
	if(x * 2 == w && y * 2 == h)
		printf("%lf 1\n", area);
	else
		printf("%lf 0\n", area);
	return 0;
}




Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int n;
int main() {
  cin >> n;
  int a[27][51] = {0}; string S;
  for(int i = 1; i <= n; ++i) {
    cin >> S;
    for(int j = 0; j < S.size(); ++j) ++a[S.at(j)-'a'][i];
  }
  string ans = "";
  for(int i = 0; i < 27; ++i) {
    int cnt = 99;
    for(int j = 1; j <= n; ++j) cnt = min(cnt, a[i][j]);
    if(cnt == 0) continue;
    for(int j = 0; j < cnt; ++j) ans += (char)'a'+i;
  }
  cout << ans << endl;
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair 
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)

int main(){
	//input
	ll N; cin>>N;

	//solve
	rep1(h,3500)rep1(n,3500){
		if(4*h*n>N*(n+h) && (N*h*n)%(4*h*n-N*n-N*h)==0){
			cout<<h<<" "<<n<<" "<<(N*h*n)/(4*h*n-N*n-N*h)<<endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
#define ceil(a,b) (a+b-1)/b
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

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

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 3636
H,W = map(int,input().split())
if H%3==0 or W%3==0:
    print(0)
    exit()

ans = min(H,W)

for i in range(1,H):
    a = i*W
    m = W//2
    b = (H-i)*m
    c = (H-i)*(W-m)
    tmp = max(a,b,c) - min(a,b,c)
    ans = min(ans, tmp)

for i in range(1,W):
    a = i*H
    m = H//2
    b = (W-i)*m
    c = (W-i)*(H-m)
    tmp = max(a,b,c) - min(a,b,c)
    ans = min(ans, tmp)

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template<class T> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    string s, t;
    cin >> s >> t;
    int n = sz(s);
    REP(i, n) if (s[i] != t[i]) {
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
 
using namespace std;
#define sz(x) (int)(x).size()
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define ll long long
const int N=3e5+5,MOD=1e9+7;
 
int n,s;

ll dp[105][100005];
int main()
{	
	//#ifndef ONLINE_JUDGE
		//freopen("tst.txt","r",stdin);
	//#endif
 	
 	scanf("%d %d",&n,&s);

 	for(int i=0;i<n;i++)for(int j=0;j<100005;j++)dp[i][j]=1e12+5;
 	dp[0][0]=0;
 	for(int i=0;i<n;i++){
 		int w , x;

 		scanf("%d %d",&w,&x);
 		if(i)
 			for(int j=0;j<=100000;j++){
 				if(j<x){
 					dp[i][j]=dp[i-1][j];
 				}
 				else{
 					dp[i][j]=min(dp[i-1][j],dp[i-1][j-x]+w);
 				}
 			}
 		else
 			dp[i][x]=w;

 	}

 	for(int i=100000;i>=0;i--){
 		if(dp[n-1][i]<=s)return !printf("%d\n",i );
 	}
}
 

Measured memory_bytes: 80128
N = int(input())
x,y,h = [],[],[]
for i in range(N):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    h.append(c)

for cx in range(101):
    for cy in range(101):
        for i in range(N):
            H = abs(x[i] - cx) + abs(y[i] - cy) + h[i]
            if h[i] != 0:
                break
        for i in range(N):
            th = max( H - abs(x[i] - cx) - abs(y[i] - cy), 0 )
            if h[i] != th:
                break
        else:
            print(cx,cy,H)
            exit()


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

int main(){
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int N,L;
	cin>>N>>L;
	string a[N];
	for(int i=0;i<N;i++){
		cin>>a[i];
	}
	sort(a,a+N);
	for(int i=0;i<N;i++){
		cout<<a[i];
	}
	
	
	return 0;
	
}

Measured memory_bytes: 256
#include<iostream>
int main()
{
	for (double xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2; std::cin >> xa1 >> ya1 >> xa2 >> ya2 >> xb1 >> yb1 >> xb2 >> yb2;)std::cout << (xa1 > xb2 || ya1 > yb2 || xa2 < xb1 || ya2 < yb1 ? "NO" : "YES") << std::endl;
	return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int , int> pi;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	string a;
	cin>>a;
	if(a[2] == a[3] && a[4] == a[5])
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
};


Measured memory_bytes: 256