akhauriyash/Code-Regression huggingface dataset:
//g++ -std=c++17 -Wshadow -Wall -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG -g PROGRAM -o OUTPUT -DLOCAL -lasan -lubsan
#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define eps 1e-6
#define pi 3.141592653589793
using namespace std;

typedef vector<int> VII;
typedef vector<ll> VLL;
typedef pair<int, int> PII;
typedef vector<pair<int, int>> VPII;
typedef vector<pair<int, PII>> VPPI;
const int MOD = 1e9 + 7;
const int INF = 1e9;


inline ll modulo(ll a, ll m)
{
    return (a % m + m) % m;
}

inline ll modInverse(ll a, ll m)
{
    assert(__gcd(a, m) == 1);
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
        return 0;

    while (a > 1)
    {
        ll q = a / m;
        ll t = m;

        m = a % m, a = t;
        t = y;

        y = x - q * y;
        x = t;
    }

    if (x < 0)
        x += m0;

    return x;
}

inline ll modPow(ll x, ll y, ll m)
{ //x^y % m
    if (y == 0)
        return 1LL;
    else if (y == 1)
        return x;
    else
    {
        ll ans = modPow(x, y / 2, m) % m;
        if (y & 1)
        {
            return (((ans * ans) % m) * x) % m;
        }
        else
        {
            return (ans * ans) % m;
        }
    }
}

vector<string> split(char d,string s)
{
    stringstream ss(s);
    string t;
    vector<string> words;
    while(getline(ss,t,d))
    {
        words.pb(t);
    }

    return words;
}
ll solve(ll a,ll b){
    return a * b * 1LL;
}
int main(int argc, char *argv[])
{
    
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    VLL c1(2), c2(2);
    for(auto &x:c1)
        cin >> x;
    for(auto &x:c2)
        cin >> x;

    ll ans = -1e18;
    for (int i = 0; i < 2;++i){
        for (int j = 0; j < 2;++j){
            ans = max(ans, solve(c1[i], c2[j]));
        }
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
using Edges = std::vector<Edge<Cost>>;

struct UnionFind {
    std::vector<int> par, sz;
    int gnum;

    explicit UnionFind(int n)
        : par(n), sz(n, 1), gnum(n) {
        std::iota(par.begin(), par.end(), 0);
    }

    int find(int v) {
        return (par[v] == v) ? v : (par[v] = find(par[v]));
    }

    void unite(int u, int v) {
        u = find(u), v = find(v);
        if (u == v) return;

        if (sz[u] < sz[v]) std::swap(u, v);
        sz[u] += sz[v];
        par[v] = u;
        --gnum;
    }

    bool same(int u, int v) { return find(u) == find(v); }
    bool ispar(int v) { return v == find(v); }
    int size(int v) { return sz[find(v)]; }
};

using lint = long long;

void solve() {
    int n, m;
    std::cin >> n >> m;

    std::vector<lint> xs(n);
    for (auto& x : xs) std::cin >> x;

    Edges<lint> es(m);
    for (auto& e : es) {
        std::cin >> e.src >> e.dst >> e.cost;
        --e.src, --e.dst;
    }
    std::sort(es.begin(), es.end());

    int sum = 0, ans = 0;
    std::vector<int> esz(n, 1), iesz(n, 0);
    UnionFind uf(n);

    for (auto e : es) {
        int u = e.src, v = e.dst, c = e.cost;
        u = uf.find(u);
        v = uf.find(v);

        if (u == v) {
            if (c <= xs[v]) {
                ++sum, ++esz[v];
            } else {
                ++iesz[v];
            }
        } else {
            uf.unite(u, v);
            int p = uf.find(v);

            xs[p] = xs[u] + xs[v];
            esz[p] = esz[u] + esz[v];
            iesz[p] = iesz[u] + iesz[v];

            if (c <= xs[p]) {
                sum += iesz[p];
                esz[p] += iesz[p];
                iesz[p] = 0;

                ++sum, ++esz[p];
            } else {
                ++iesz[p];
            }
        }
        ans = std::max(ans, sum);
    }

    std::cout << m - ans << std::endl;
}

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

    solve();

    return 0;
}


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

int main() {
	int x,a,b,c,e;
	cin >> x ;
	a = x / 3600;
	b = x - a * 3600;
	e = b / 60;
	c = (x%3600)%60;
	cout <<a<<":"<< e<<":"<<c<< endl;
	return 0;
}

Measured memory_bytes: 3056
from io import StringIO

class BinaryTree:

    class Node:
        def __init__(self, key):
            self.key = key
            self.left = None
            self.right = None
            self.parent = None


    def __init__(self):
        self.root = None
        self.output = StringIO()

    def insert(self, key):
        if self.root is None:
            self.root = self.Node(key)
        else:
            root = self.root
            temp = None
            while True:
                temp = root
                if key > root.key:
                    root = root.right
                    if root is None:
                        temp.right = self.Node(key)
                        break
                else:
                    root = root.left
                    if root is None:
                        temp.left = self.Node(key)
                        break

    def ini_print_inorder(self):
        self.output = StringIO()
        self.print_inorder(self.root)
        return self.output.getvalue()

    def ini_print_preorder(self):
        self.output = StringIO()
        self.print_preorder(self.root)
        return self.output.getvalue()

    def print_inorder(self, node):
        if node is not None:
            self.print_inorder(node.left)
            print(node.key, end = " ", file = self.output)
            self.print_inorder(node.right)

    def print_preorder(self, node):
        if node is not None:
            print(node.key, end = " ", file = self.output)
            self.print_preorder(node.left)
            self.print_preorder(node.right)

    def test_insert(self, keys):
        for k in keys:
            self.insert(k)

    def ini_find(self, key):
        print(self.find(key))

    def find(self, key):
        root = self.root
        while root is not None:
            if key == root.key:
                return "yes"
            elif key < root.key:
                root = root.left
            else:
                root = root.right
        return "no"


length = int(input())
b = BinaryTree()
for _ in range(length):
    comm = input()
    if comm[0] == "i":
        com, num = comm.split(" ")
        b.insert(int(num))
    elif comm[0] == "p":
        print(" ", end = "")
        print((b.ini_print_inorder())[:-1])
        print(" ", end = "")
        print(b.ini_print_preorder()[:-1])
    else:
        com, num = comm.split(" ")
        b.ini_find(int(num))


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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t m, k;
  std::cin >> m >> k;
  if (m == 1) {
    if (k == 0) {
      std::cout << "0 0 1 1" << std::endl;
    } else {
      std::cout << -1 << std::endl;
    }
  } else if ((1 << m) <= k) {
    std::cout << -1 << std::endl;
  } else {
    const auto max = (1 << m) - 1;
    for (int64_t i = 0; i <= max; i++) {
      if (i != k) {
        std::cout << i << " ";
      }
    }
    std::cout << k << " ";
    for (int64_t i = max; 0 <= i; i--) {
      if (i != k) {
        std::cout << i << " ";
      }
    }
    std::cout << k << std::endl;
  }

  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
/*---------------------DEBUGGING--------------------------------------------*/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
/*-------------------------------------------------------------------------------------*/
//#define mp make_pair
#define pb push_back
#define ll long long
#define pii pair<int,int>
#define pcc pair<char,char>
#define F first
#define S second
#define int long long
#define pi 3.141592653589793238462643383279502
#define M  1000000007
#define rep(i,a,n) for(int i=a;i<n;i++)
#define INF 10000000000000
#define N 200005
#define vi vector<int>
#define all(v) v.begin(),v.end()
//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
int intersection(int l1,int r1,int l2,int r2)
{
    if(l2 > r1 || l1 > r2)
        return 0;
    int ans=0;
    int l=max(l1,l2);
    int r=min(r1,r2);
    if(r - l + 1 > 0)
        return r - l + 1;
    else
        return 0;
}
signed main()
{
   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
   int n;
   cin>>n;
   int a[n],b[n];
   rep(i,0,n)cin>>a[i]>>b[i];
   sort(a,a+n);
   sort(b,b+n);
   if(n & 1)
   {
       int x=a[n/2];
       int y=b[n/2];
       cout<<(y-x+1);
   }
   else
   {
       int ans=0;
       int x=a[n/2];
       int y=b[n/2];
       int x1=a[n/2 - 1];
       int y1=b[n/2 - 1];
       ans+=(y1 + y + 1)-(x1 + x + 1);
       cout<<ans + 1<<endl;

   }
}


Measured memory_bytes: 6772
#include<stdio.h>

int main(){

	int i,n,q,s[10000+1],t,c=0,k;

	scanf("%d",&n);

	for(i=0;i<n;i++)
		scanf("%d",&s[i]);

	scanf("%d",&q);

	for(i=0;i<q;i++)
    {
		scanf("%d",&t);
	
		s[n]=t;
		k=0;
		while(s[k]!=t)
        {
			k++;
		}
		if(k!=n) c++;
		
	}
	printf("%d\n",c);

	return 0;
	
}


Measured memory_bytes: 2108
import heapq


def one_direction(a, j):
    res = 0
    for u in range(0, min(len(a)+1,j+1)):
        l = []
        heapq.heapify(l)
        sum = 0
        for w in range(u):
            sum += a[w]
            heapq.heappush(l, a[w])
        for y in range(j-u):
            if len(l) > 0:
                f = heapq.heappop(l)
                if f < 0:
                    sum -= f
                else:
                    break
        res = max(res, sum)
    return res




n,k = [int(_) for _ in input().split()]
v = [int(_) for _ in input().split()]
a = []
dp = [[0 for _ in range(k+1)] for _ in range(n+1)]
for i in range(1, n+1):
    x = v.pop()
    a.append(x)
    for j in range(1, k+1):
        ans1 = dp[i-1][j-1] + x
        ans2 = -float('inf')
        if j >= 2:
            ans2 = dp[i-1][j-2]
        ans3 = one_direction(a, j)
        dp[i][j] = max(ans1, ans2, ans3)
        # print(i, j, a)
        # print(ans1, ans2, ans3)
        # print(dp)
print(dp[n][k])

Measured memory_bytes: 82140
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {	
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		
		if(a==b&&b==c) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 21844
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		List<Integer> lst = new ArrayList<Integer>();
		for(int i = 0 ; i < N ; ++i){
			lst.add(sc.nextInt());
		}
		int k = 1;
		TreeSet<Integer> rangeSet = new TreeSet<Integer>();
		for(int i = 0 ; i < K - 1; ++i){
			rangeSet.add(lst.get(i));
			if(lst.get(i) < lst.get(i + 1)){
				++k;
			}else{
				k = 1;
			}
		}
		rangeSet.add(lst.get(K -1));
		int fix = k >= K ? 1 : 0;
		int same = 0;
		int sameFix = 0;
		for(int i = K ; i < lst.size() ; ++i){
			if(lst.get(i - 1) < lst.get(i)){
				++k;
			}else{
				k = 1;
			}
			boolean isFix = false;
			if(k >= K){
				isFix = true;
				fix++;
			}
			rangeSet.add(lst.get(i));
			int min = rangeSet.first();
			int max = rangeSet.last();
			if(lst.get(i - K) == min && lst.get(i) == max){
				++same;
				if(isFix){
					++sameFix;
				}
			}
//			System.out.println(rangeSet);
			rangeSet.remove(lst.get(i - K));
		}
//		System.out.println(fix+" "+same+" "+sameFix);
		int ans = N - K + 1;
		if(fix > 1){
			ans -= fix - 1;
		}
		ans -= same - sameFix;
		// m m2 K max max+1
		// 
		// min K-1 max
		// min K-1 max
		// min K-1 max
		// 021453
		// 021453
		System.out.println(ans);
		/*
		for(int i = 0 ; i + K <= N ; ++i){
			List<Integer> head = new ArrayList<>(lst.subList(0, i));
			List<Integer> middle = new ArrayList<>(lst.subList(i, i + K));
			List<Integer> tail = new ArrayList<>(lst.subList(i + K, lst.size()));
			Collections.sort(middle);
			head.addAll(middle);
			head.addAll(tail);
			System.out.println(head);
		}
		*/
		// 10 4
		//2 0 1 3 7 5 4 6 8 9
	}
}


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


int main() {
    
    int a,b;
    cin >> a >> b;
    cout<<a*b<<endl;


 return 0;
}


Measured memory_bytes: 3632
//ｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｹｰｰｰｰｯ!!!wwwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwｺｹｯwwwｺｹｯｺｯwwwｺｯwwｺｯwwｺｹｯwwwｺｯwwwｺｹｯwwwｺｹｯｺｯwwwｺｹｰｰｰｰｯ!!!wwwwwｺｹｯｺｯｯｺｰｰｰｰ!!!!!!wwwwwwwwwww
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = 0;
        for(int i = 0 ; i < 4 ; i++){
            if(s.charAt(i) == '-'){
                n++;
            }else{
                n--;
            }
        }
        System.out.println(-1 * n);
    }
}

Measured memory_bytes: 35480
//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<pair<int,int>> red(n);
  vector<pair<int,int>> blue(n);
  for(int i = 0; i < n; i++){
    cin >> red[i].first >> red[i].second;
  }
  for(int i = 0; i < n; i++){
    cin >> blue[i].first >> blue[i].second;
  }
  sort(red.begin(),red.end());
  sort(blue.begin(),blue.end());

  vector<bool> chk(n,true);

  int ans = 0;

  for(int i = 0; i < n; i++){
    int x = blue[i].first;
    int y = blue[i].second;
    int maxY = -1;
    int index = -1;
    for(int j = 0; j < n; j++){
      if(red[j].first<x&&red[j].second<y&&chk[j]==true){
        if(red[j].second > maxY){
          maxY = red[j].second;
          index = j;
        }
      }
    }
    if(index != -1){
        ++ans;
        chk[index]  = false;
    }
  }

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main()
{
	int n = 0;
	cin >> n;
	vector<int> v(n), c(n);
	for (int& v_s : v) {
		cin >> v_s;
	}
	for (int& c_s : c) {
		cin >> c_s;
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		if (v[i] > c[i]) {
			sum += v[i] - c[i];
		}
	}
	cout << sum;
}

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

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  vector<vector<int> > mat;
  mat.resize(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int tmp;
      cin >> tmp;
      mat[i].push_back(tmp);
    }
  }

  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      ans += min(mat[i][j], mat[j][i]);
    }
  }
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 1268
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

 
const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }
ll LCM(ll a, ll b) { return a * b / GCD(a, b); }

int main(){
  int n,k; cin>>n>>k;
  vi h(n);
  rep(i,n) cin>>h[i];
  
  int ans=0;
  rep(i,n){
    if(h[i]>=k)ans++;
  }
  cout<<ans<<endl;
}

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

const int INF = 1001001001;

ll pow(ll base, ll order) {
	ll ans = 1;
	rep(i,order - 1) ans *= base;
	return ans;
}

int gcd(int a, int b) {
	if (a < b) {
		int c = a;
		a = b;
		b = c;
	}
	if (b == 0) return a;
	return gcd (b, a % b);
}

int main() {
	int n, m, tot = 0;
	cin >> n >> m;
	rep(i,m) {
		int x;
		cin >> x;
		tot += x;
	}
	if (tot > n) {
		cout << -1 << endl;
		return 0;
	}
	cout << n - tot << endl;
}


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

int n;
long long ans;

int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) {
		if (n%i==0) ans--;
		ans+=n/i;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 3836
module ABC123

  ! <module>s to import
  use, intrinsic :: iso_fortran_env

  ! require all variables to be explicitly declared
  implicit none

  ! accessibility of <subroutine>s and <function>s in this <module>
  public :: ABC123_A

  ! constants for this <module>
  character(len=4, kind=1), parameter, private :: string_communicatable     = 'Yay!'
  character(len=2, kind=1), parameter, private :: string_NOT_communicatable = ':('
  integer  (kind=INT8),     parameter, private :: num_antenna               = 5_INT8

  ! contained <subroutine>s and <function>s are below
  contains

  subroutine ABC123_A

    ! variables for this <subroutine>
    integer(kind=INT8) :: coordinate(1:num_antenna)
    integer(kind=INT8) :: distance_max

    ! support variables for this <subroutine>
    integer(kind=INT8) :: itr_Lv1, itr_Lv2

    ! STEP.01
    ! read out the coordinate of the antennas
    do itr_Lv1 = 1, num_antenna, 1
      read(unit=INPUT_UNIT, fmt='(I3)') coordinate(itr_Lv1)
    end do

    ! STEP.02
    ! read out the maximum communicatable distance
    read(unit=INPUT_UNIT, fmt='(I3)') distance_max

    ! STEP.03
    ! judge the distance among the antennas
    do itr_Lv1 = 1_INT8,         num_antenna-1_INT8, 1_INT8
    do itr_Lv2 = itr_Lv1+1_INT8, num_antenna,        1_INT8
      if ( coordinate(itr_Lv2) - coordinate(itr_Lv1) .gt. distance_max ) then
        write(unit=OUTPUT_UNIT, fmt='(A)', advance='yes') string_NOT_communicatable
        return
      end if
    end do
    end do

    ! STEP.END
    write(unit=OUTPUT_UNIT, fmt='(A)', advance='yes') string_communicatable
    return

  end subroutine ABC123_A

end module ABC123

program main

  ! <module>s to import
  use, non_intrinsic :: ABC123

  ! require all variables to be explicitly declared
  implicit none

  call ABC123_A

end program main

Measured memory_bytes: 768
from collections import defaultdict
N=int(input())
alist=list(map(int,input().split()))

adic=defaultdict(int)
for a in alist:
  adic[a]+=1
alist2=list(adic.items())
alist2.sort(reverse=True)
#print(alist2)

x1,x2=0,0
for a2 in alist2:
  if a2[1]>=4:
    x1=max(x1,a2[0])
    x2=max(x2,a2[0])
  elif a2[1]>=2:
    if x1==0:
      x1=a2[0]
    else:
      x2=a2[0]

  if x1*x2>0:
    print(x1*x2)
    break
else:
  print(0)

Measured memory_bytes: 21412
tp = 0
hp = 0
n = int(input())
for i in range(n):
    card = input().split()
    #print(n,card)
    if card[0] < card[1]:
        hp = hp + 3
    elif card[0] > card[1]:
        tp = tp + 3
    else:
        tp = tp + 1
        hp = hp + 1
print(tp,hp)


Measured memory_bytes: 5596
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<cstdlib>
using namespace std;
int main(){
	string s;
	char ans='a';
	int count=0;
	cin>>s;
	for(int i=0;i<26;i++){
		for(int j=0;j<s.size();j++){
			if(ans==s[j]){
				count++;
			}
		}
		if(count==0){
			cout<<ans<<endl;
			return 0;
		}
		count=0;
		ans++;
	}
	cout<<"None"<<endl;
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include <unordered_map>
#include <cmath>
#include <functional>
#include <map>

using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
template <class T>
using Vvec = vector<vector<T> >;

template <class T>
void debug(T& v)
{
    for(auto& x: v) cout << x << " ";
    cout << endl;
}

int main()
{
    ll X;
    cin >> X;
    ll ans = X / 500 * 1000;
    X %= 500;
    ans += X / 5 * 5;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <set>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;

struct cake{
	int number, w, d;
	cake(int w = -1, int d = -1, int n = -1)
		: number(n), w(w), d(d) {}
	
	bool operator<(const cake &c) const{
		return number < c.number;
	}
	
	int square() const{
		return w * d;
	}
};

int main(){
	int n, w, d;
	int p, s;
	set<cake>::iterator it;
	while( scanf("%d%d%d", &n, &w, &d), w != 0 ){
		set<cake> st;
		st.insert( cake(w, d, 0) );

		for(int i = 1; i <= n; ++i){
			scanf("%d%d", &p, &s);

			it = st.begin();
			advance(it, p - 1);

			s %= (it->w + it->d);

			cake c1, c2;
			if( s < it->w ){
				c1 = cake(s, it->d);
				c2 = cake(it->w - s, it->d);
			}
			else{
				c1 = cake(it->w, s - it->w);
				c2 = cake(it->w, it->d - (s - it->w) );
			}
			
			if( c1.square() < c2.square() ){
				c1.number = i * 2;
				c2.number = i * 2 + 1;
			}
			else{
				c1.number = i * 2 + 1;
				c2.number = i * 2;
			}
			
			st.erase(it);
			st.insert(c1);
			st.insert(c2);
		}
		
		vector<int> v;
		v.reserve(n + 1);
		for(it = st.begin(); it != st.end(); ++it){
			v.push_back(it->square());
		}
		
		sort(v.begin(), v.end());
		for(int i = 0; i < v.size(); ++i){
			if( i != 0 ) putchar(' ');
			printf("%d", v[i]);
		}
		puts("");
	}
}

Measured memory_bytes: 1072
#include<bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
using namespace std;
#define ll long long
const int maxn=100000+10;
int x[maxn],xx[maxn],w[maxn];
int i,j,k,l,r,s,t,n,m;
ll c;
inline int read()
{
    int k=1;int x=0;
    char ch=getchar();
    while ((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
    if(ch=='-')
    k=-1,ch=getchar();
    while(ch>='0'&&ch<='9')
    x=x*10+ch-'0',ch=getchar();
    return k*x;
}
int main()
{
    n=read(),l=read(),t=read();
    fo(i,1,n)
        x[i]=read(),w[i]=read();
    fo(i,1,n)
    {
        if (w[i]==2) w[i]=-1;
        r=x[i]+w[i]*t;
        if (r>0) (c+=r/l)%=n;
        else if (r<0) (c+=(r+1)/l-1)%=n;
        xx[i]=(r%l+l)%l;
    }
    sort(xx+1,xx+n+1);
    c=(c+n)%n;
    fo(i,c+1,n)
        printf("%d\n",xx[i]);
    fo(i,1,c) printf("%d\n",xx[i]);
}

Measured memory_bytes: 2432
#include <iostream>
using namespace std;
int main(void){
    long long n,a,b,c;
    cin>>n>>b;
    c=b/2;
    b=b%2;
    for(int i=1;i<n;i++){
        cin>>a;
        if(b==1&&a>0){
            c++;
            a--;
        }
        c+=a/2;
        b=a%2;
    }
    cout<<c<<endl;
}


Measured memory_bytes: 256
use std::collections::HashSet;

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let _n: i32 = s.trim().parse().ok().unwrap();
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let a: Vec<i32> = s
        .trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect();
    let uniq: HashSet<i32> = a.into_iter().collect();
    let uniq: i32 = uniq.len() as i32;

    println!("{}", ((uniq + 1) / 2) * 2 - 1)
}


Measured memory_bytes: 6396
#include<stdio.h>
int main(void)
{
  char S[100];
  char T[100];
  char Re[200];
  int N;
  int i;
  scanf("%d",&N);
  scanf("%s",S);
  scanf("%s",T);
  for(i=0;i<N;i++){
      Re[i*2] = S[i];
  }
  for(i=0;i<N;i++){
      Re[i*2 +1] = T[i];
  }
  for(i=0;i<2*N;i++){
    printf("%c",Re[i]);
  }
  return 0;
}
           

Measured memory_bytes: 128
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W, N = MAP()
sr, sc = MAP()
S = input()
T = input()

x = sc
for s, t in zip(S, T):  # 左を目指す
	if s == "L":
		x -= 1
		if x == 0:
			print("NO")
			exit()
	if t == "R" and x+1 <= W:
		x += 1

x = sc
for s, t in zip(S, T):  # 右を目指す
	if s == "R":
		x += 1
		if x == W+1:
			print("NO")
			exit()
	if t == "L" and x-1 >= 1:
		x -= 1

y = sr
for s, t in zip(S, T):  # 上を目指す
	if s == "U":
		y -= 1
		if y == 0:
			print("NO")
			exit()
	if t == "D" and y+1 <= H:
		y += 1

y = sr
for s, t in zip(S, T):  # 下を目指す
	if s == "D":
		y += 1
		if y == H+1:
			print("NO")
			exit()
	if t == "U" and y-1 >= 1:
		y -= 1

print("YES")


Measured memory_bytes: 5972
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(int)(b); i++)
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define st first
#define nd second
#define KW(a) ((a)*(a))
using namespace std;
 
const int maxN = 1 << 19;

int x[maxN], y[maxN];
long long fact[maxN];

void solve()
{
	int n;
	scanf ("%d", &n);
	FOR(i, 0, n)
		scanf("%d%d", x+i, y+i);
		
	fact[0] = 1;
	FOR(i, 1, n+1)
		fact[i] = fact[i-1] * i;
		
	long double res = 0;
	FOR(i, 1, n) FOR(j, 0, i)
	{
		long long d2 = KW(x[i]-x[j]) + KW(y[i]-y[j]);
		d2 *= KW(fact[n-1]) * 4;
		res += sqrt(d2);
	}
	
	res /= fact[n];
	printf("%.9Lf\n", res);		
}
 
int main()
{
	int t;
	t=1;//scanf ("%d", &t);
	while (t--)
		solve();
	return 0;
}



Measured memory_bytes: 4352
#! env python
# -*- coding: utf-8 -*-

import os
import sys


# ac_py.main
# Date: 2020/06/14
# Filename: main 
# Author: acto_mini

def main():
    A, B, C = map(int, input().split())

    # if A % 2 != C % 2:
    #     print("NO")
    #     exit()

    for i in range(1, C*1000):
        if ((i * A) % B) == C:
            print("YES")
            break
    else:
        print("NO")

    return


if __name__ == '__main__':
    main()


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

public class Main {

	public static long CONST = (long) Math.pow(10, 9) + 7L;

	static Main instance = new Main();

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		//入力値
		int N = scan.nextInt();

		HashSet<String> set = new HashSet<>();

		for (int i = 0; i < N; i++) {
			set.add(scan.next());
		}

		//WK変数

		//演算

		//結果出力
		System.out.println(set.size());
	}
}

Measured memory_bytes: 77184
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
//typedef tree<int,null_type,less<int >,rb_tree_tag,tree_order_statistics_node_update>indexed_set;
template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v);
#ifdef APURBA
#define debug(a) cout<<#a<<" --> "<<(a)<<"\n";
#define debug2(a) cout<<#a<<" --> "<<(a)<<" ";
#define HERE cout<<"here - "<<__LINE__<<"\n";
#else
#define debug(a)
#define debug2(a)
#define HERE
#endif
const ll mod = 1e9+7;
const int N = 5e5 +5;
typedef pair<int,int> pii;
ll n,k;
vector<ll>a;

bool check(ll val)
{
    ll cnt =0;
    for(ll i=0;i<n;i++)
    {
        ll now = a[i];
        if(now<=val)
            continue;
        ll tmp = now/val;
        if(now%val)
        {
            tmp++;
        }
        cnt+= tmp-1;
    }
    return cnt<=k;
}

void TEST_CASES(int cas)
{
    scanf("%lld %lld",&n,&k);
    a.resize(n);
    for(ll &i:a)
    {
        scanf("%lld",&i);
    }
    ll ans = -1;
    ll low = 1, high = *max_element(a.begin(),a.end());
    while(low<=high)
    {
        ll mid = (low+high)/2;
        if(check(mid))
        {
            ans = mid;
            high = mid-1;
        }
        else{
            low = mid+1;
        }
    }
    printf("%lld\n",ans);



}


/*

*/

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    int t=1,cas=0;
    //scanf("%d",&t);
    while(t--)
    {
        TEST_CASES(++cas);
    }
    return 0;
}


template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(int i=0; i<v.size(); i++)
    {
        os<<v[i]<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os,set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}
template <class T1, class T2>
ostream &operator <<(ostream &os, map<T1,T2>&v)
{
    for(auto i:v)
    {
        os<<"Key : "<<i.first<<" , Value : "<<i.second<<endl;
    }
    return os;
}


Measured memory_bytes: 4864
import std.stdio;
import std.algorithm;
import std.string;
import std.range;
import std.array;
import std.conv;
import std.complex;
import std.math;
import std.ascii;
import std.bigint;
import std.container;


int nReturn(int a, int m){
	int ret = 1;
	int p = a%m;
	while(p > 1){
		p = (p*a)%m;
		++ret;
	}
	return ret;
}
long gcd(long a, long b) {
	if(a < b)
		swap(a,b);
	if(a%b == 0)
		return b;
	return gcd(b, a%b);
}
long lcm(long a, long b) {
	long g = gcd(a,b);
	return (a/g)*(b/g)*g;
}

int sum(int[] a) {
	int s;
	foreach(b; a)
		s += b;
	return s;
}

void main() {
	auto s = array(map!(a=>to!int(a))(readln().strip().split()));
	while(sum(s) > 0) {
		long n1 = nReturn(s[0], s[1]);
		long n2 = nReturn(s[2], s[3]);
		long n3 = nReturn(s[4], s[5]);
		writeln(lcm(lcm(n1, n2),n3));

		s = array(map!(a=>to!int(a))(readln().strip().split()));
	}
}

Measured memory_bytes: 1096
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	static int[] G => ReadLine().Split().Select(int.Parse).ToArray();
	static T[] MakeArray<T>(int n, Func<int, T> f) { var a = new T[n]; for (var i = 0; i < n; i++) a[i] = f(i); return a; }
	static int N;
	public K()
	{
		var I = G;
		N = I[0];
		WriteLine(ToString(Calc(Get(), Get(), I[1] - 1)));
	}
	static int[] Get() => G.Select(i => i - 1).ToArray();
	static string ToString(int[] p) => string.Join(" ", p.Select(i => i + 1));
	static int[] Calc(int[] p, int[] q, int K)
	{
		int[] P = Inv(p), Q = Inv(q), x = Mult(q, P, Q, p), y = Mult(P, q, p, Q);
		switch (K % 6)
		{
			case 0: return Mult(Pow(x, K / 6), q, p, Q, Pow(y, K / 6 - 1));
			case 1: return Mult(Pow(x, K / 6), q, Pow(y, K / 6));
			case 2: return Mult(Pow(x, K / 6), q, P, Pow(y, K / 6));
			case 3: return Mult(Pow(x, K / 6), q, P, Q, Pow(y, K / 6));
			case 4: return Mult(Pow(x, K / 6), q, P, Q, p, Q, Pow(y, K / 6));
			default: return Mult(Pow(x, K / 6), q, P, Q, p, p, Q, Pow(y, K / 6));
		}
	}
	static int[] Inv(int[] a)
	{
		var c = new int[N];
		for (var i = 0; i < N; i++) c[a[i]] = i;
		return c;
	}
	static int[] Mult(int[] a, int[] b) => MakeArray(N, i => a[b[i]]);
	static int[] Mult(params int[][] a) => a.Aggregate(Mult);
	static int[] Pow(int[] a, int b)
	{
		if (b < 0) return Inv(Pow(a, -b));
		var p = new int[N];
		var f = new bool[N];
		for (var i = 0; i < N; i++)
			if (!f[i])
			{
				var l = new List<int>();
				var x = i;
				while (!f[x]) { l.Add(x); f[x] = true; x = a[x]; }
				var C = l.Count;
				for (var j = 0; j < C; j++) p[l[j]] = l[(j + b) % C];
			}
		return p;
	}
}


Measured memory_bytes: 44076
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    string s,t;
    cin>>s>>t;
    int ans=0;
    for(int i=0; i<s.size(); i++)
    {
        if(s[i]!=t[i]) ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3856
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include<algorithm> 
#include <iomanip>
#include <math.h>

#define db double
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define ll long long
#define ld long double
#define maxn 5005
#define mod 998244353
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define vv(z,a,b) vector<vector<int>>z(a,vector<int>(b))
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(c) begin(c),end(c)
using namespace std;


int main(){
   int x,y;
   cin>>x>>y;
   for(int i=0;i<=x;i++){
       int sum=2*i+4*(x-i);
        if(sum==y){
            cout<<"Yes"<<endl;
            return 0;
        }

   }
   cout<<"No"<<endl;


}

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

using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); ++i)
double const PI = 3.1415926535897932384626433;
using P = pair<int, int>;

int main() {
    int a, b, h;
    cin >> a >> b >> h;
    cout << (a + b) * h / 2 << endl;
    return 0;
}

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

void	output_op(bool is_minus)
{
	if (is_minus)
		cout << "-";
	else
		cout << "+";
}

int	main() {
	string str;
	cin >> str;
	vector<int>	vec(4);
	for (int i = 0; i < 4; ++i) 
		vec.at(i) = str.at(i) - '0';
	int	result;
	for (int idx = 0; idx < (1 << 3); ++idx) {
		bitset<3> op_b(idx);
		result = vec.at(0);
		for (int i = 1; i < 4; ++i)
			result += op_b.test(i - 1) ? -vec.at(i): vec.at(i);
		if (result == 7) {
			cout << vec.at(0);
			for (int i = 1; i < 4; ++i) {
				output_op(op_b.test(i - 1));
				cout << vec.at(i);
			}
			cout << "=7" << endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   A.c                                                :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: kotaro666 <kotaro0726@gmail.com>           +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/02/28 16:53:53 by kotaro666         #+#    #+#             */
/*   Updated: 2020/02/28 17:09:56 by kotaro666        ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

/*
与えられた文字列の小文字と大文字を入れ替えるプログラムを作成してください。
 */

#include <stdio.h>

#define MAX 1200

int main(void)
{
    char string[MAX + 1];

    fgets(string, MAX + 1, stdin);

    for (int i = 0; string[i] != '\0'; i++)
    {
        if (string[i] >= 'a' && string[i] <= 'z')
        {
            string[i] += 'A' - 'a';
        }
        else if (string[i] >= 'A' && string[i] <= 'Z')
        {
            string[i] -= 'A' - 'a';
        }
    }
    printf("%s", string);
    return (0);
}


Measured memory_bytes: 2056
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

static class P
{
    static void Main()
    {
        var ab = Console.ReadLine().Split().Select(int.Parse).ToArray();
        Console.WriteLine((ab[0] * ab[1]) % 2 == 1 ? "Yes" : "No");
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    clr(v,d)      memset( v, d ,sizeof(v))
typedef  long long     ll ;
typedef  unsigned long long ull;
const double EPS= (1e-9);
using namespace std;
int getBit(int num, int idx) {return ((num >> idx) & 1) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(int num, int idx) {return num ^ (1<<idx);}
void GO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
const int N=200000+9,mod=998244353;
ll n,tree[4*N];
ll mem[N],arr[N];
vector< pair<ll,ll> > v;
bool cmp(pair<ll,ll> a,pair<ll,ll> b){

  if(a.first!=b.first) return (a.first<b.first);
  if(a.second!=b.second) return (a.second<b.second);
  return 0;
}
ll solve(int id){

  if(id>=n) return 1;
  ll &ret=mem[id];
  if(ret!=-1) return ret;
  ll ans=0;
  ans+=solve(id+1);
  if(ans>=mod) ans-=mod;

  auto it=upper_bound(all(v),mp(arr[id],100000000000),cmp);
  int idx=it-v.begin();
  ans+=solve(idx);
  if(ans>=mod) ans-=mod;
  return ret=ans;
}
void update(int pos,int val,int s=0,int e=n-1,int p=1){

   if(s==e){
     tree[p]=val;
     return ;
   }
   int m=(s+e)/2;
   if(pos<=m)
   update(pos,val,s,m,p*2);
   else{
    update(pos,val,m+1,e,p*2+1);
   }
   tree[p]=max(tree[p*2],tree[p*2+1]);
}
ll query(int a,int b,int s=0,int e=n-1,int p=1){

   if(b<s||a>e) return -100000000000;
   if(s>=a&&e<=b){
      return tree[p];
   }
   int m=(s+e)/2;
   return max(query(a,b,s,m,p*2),query(a,b,m+1,e,p*2+1));
}
int main(){
    GO();
    cin>>n;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        v.pb(mp(a,b));
    }
    sort(all(v));

    for(int i=n-1;i>=0;i--){
        ll aa=v[i].first;
        ll d=v[i].second;
        d--;
        update(i,aa+d);
        auto it=upper_bound(all(v),mp(aa+d,100000000000),cmp);
        it--;
        if((*it).first==aa){
            arr[i]=aa+d;
            continue;
        }
        int idx=it-v.begin();
        int res=query(i,idx);
        update(i,res);
        arr[i]=res;
    }
  //  for(int i=0;i<n;i++) cout<<arr[i]<<endl;
    clr(mem,-1);
    cout<<solve(0)<<"\n";
}


















































































Measured memory_bytes: 21996
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
	static void Main(){
		int n=int.Parse(Console.ReadLine());
		int[] h=new int[100],p=new int[5];
		for(int i=2;i<=n;i++){
			int a=i,b=2;
			while(a!=b){
				if(a%b==0){
					a/=b;
					h[b]++;
					b=2;
				}
				else{b++;}
			}
			h[a]++;
		}
		for(int i=2;i<100;i++){
			if(h[i]>=74){p[0]++;}
			if(h[i]>=24){p[1]++;}
			if(h[i]>=14){p[2]++;}
			if(h[i]>=4){p[3]++;}
			if(h[i]>=2){p[4]++;}
		}
		int t=0;
		for(int i=1;i<p[3];i++){t+=i;}
		Console.WriteLine("{0}",p[0]+p[1]*Math.Max(p[4]-1,0)+p[2]*Math.Max(p[3]-1,0)+t*Math.Max(p[4]-2,0));
	}
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll max(ll a, ll b)
{
    if(a>=b) return a; else return b;
}

int main() {

ll n,W;
cin>>n>>W;
ll a[W+1];
for(ll i=0;i<=W;i++) a[i]=0; 
ll w,v;
for(ll i=0;i<n;i++)
{
    cin>>w>>v;
    for(ll j=W;j>=w;j--)
    {
        a[j]=max(a[j],v+a[j-w]);
    }
}
cout<<a[W];
	return 0;
}


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

typedef long long ll;
#define rep(i, a, n) for(ll i = a; i<n; i++)
#define ALL(a) begin(a), end(a)
#define mii map<int, int>
#define msi map<string, int>
#define vi vector<int>
#define vl vector<ll>
#define MOD 1000000007
#define INF 1e9
#define showVector(v) rep(i,0,v.size()){p(v[i]);p(" ")} pl("")
#define p(s) std::cout << s ;
#define pl(s)  std::cout << s << endl;
using namespace std;

class UnionFind {
public:
    vector<ll> par;
    void init(ll n) {
        rep(i, 0, n) {
            //par[i] == iのとき、iの親はiとなるから初期化では全て根であるとする。
            par.push_back(i);
        }
    }
    void clear() {
        rep(i, 0, par.size()) {
            par[i] = i;
        }
    }

    ll root(ll x) {
        if (par[x] == x) {
            return x;
        } else {
            return par[x] = root(par[x]);
        }
    }

    // これは併合するために使う
    bool unite(ll x, ll y) {
        x = root(x);
        y = root(y);
        // 併合済ならばfalse
        if (x == y) return false;

        par[y] = x;
        return true;
    }

    bool isSame(ll x, ll y) {
        return root(x) == root(y);
    }
};

int main() {
    ll N, M;;
    cin >> N >> M;
    vector<pair<ll, ll> > e(M);
    ll u, v;
    rep(i, 0, M) {
        cin >> u >> v;
        --u; --v;
        e[i] = make_pair(u, v);
    }

    UnionFind T;
    T.init(N);
    int ans = 0;
    rep(i, 0, M) {
        ll p, b, c;
        T.clear();
        bool flag = true;
        rep(j, 0, M) {
            if (i == j) continue;
            T.unite(e[j].first, e[j].second);
        }

        rep(j, 0, N) {
            if (!T.isSame(0, j)) {
                flag = false;
            }
        } 
        if (!flag) ++ ans;
    }
    cout << ans << endl;
    return 0;
}

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

const int N = 2e5 + 7;
int dir[4][2] = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
int ok[N];

int main()
{
	ios::sync_with_stdio(false);
	long long a, b;
	cin >> a >> b;
	for(int i = 0; i < a; i++) cin >> ok[i];
	sort(ok, ok + a);
	if(b >= a) {
		cout << 0 << endl;
		return 0;
	}
	long long sum = 0;
	for(int i = 0; i < a - b; i++){
		sum += ok[i];
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 1024
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main() {
    ll n,m;
    std::cin >> n>>m;
    
    std::cout << (1900*m+100*(n-m))*(ll)pow(2,m) << std::endl;
}


Measured memory_bytes: 256
N = int(input())
A = []
x = []
y = []
xy = [[] for _ in range(N)]
for i in range(N):
    A1 = int(input())
    A.append(A1)
    for _ in range(A1):
        x, y = map(int, input().split())
        xy[i].append((x-1, y))

c_max = 0
cnt = 0
for i in range(1 << N):
    ok = True
    for j in range(N):
        if (i >> j) & 1:
            for x, y in (xy[j]):
                if (i >> x) & 1 != y:
                    ok = False
                    break
        if not ok:
            break

    if ok:
        cnt = bin(i)[2:].count('1')
        if cnt > c_max:
            c_max = cnt

print(c_max)


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

const int N = 6e5, T = 1 << 12;

struct data { int a, b, c; };
struct point { int y, color; };
struct rec { int l, r, color, type, ind; };

int n, m, q;
int x, y, x1, x2, y1, y2;
int id, color, l, r, type, ind, Sum;
int ans[N][4], aa[3010][3010];
data t[N];
vector <rec> ev[N];
vector <point> p[N];
set < pair <int, int> > A;
char sym;

data merge(data x, data y) {
	data res;
	res.a = x.a + y.a;
	res.b = x.b + y.b;
	res.c = x.c + y.c;
	return res;
}

data get(int v, int tl, int tr, int l, int r) {
	if (r < tl || l > tr || r < l)
		return {0, 0, 0};
	if (l <= tl && tr <= r)
		return t[v];
	int mid = (tl + tr) >> 1;
	data x = get(v * 2, tl, mid, l, r);
	data y = get(v * 2 + 1, mid + 1, tr, l, r);
	return merge(x, y);
}

void update(int v, int tl, int tr) {
	if (tr < id || tl > id)
		return;
	if (tl == tr) {
		if (color == 1) t[v].a++;
		if (color == 2) t[v].b++;
		if (color == 3) t[v].c++;
		return;
	}
	int mid = (tl + tr) >> 1;
	update(v * 2, tl, mid);
	update(v * 2 + 1, mid + 1, tr);
	t[v] = merge(t[v * 2], t[v * 2 + 1]);
}

int main() {
    scanf("%d%d%d", &n, &m, &q);
    for (int i = 1; i <= n; ++i) {
        string s;
        cin >> s;
        for (int j = 1; j <= m; ++j)
            aa[i][j] = s[j - 1] - '0';
    }

    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            if (aa[i][j]) {
                p[i].push_back({j, 1});
                if (i + 1 <= n && aa[i + 1][j]) {
                    p[i + 1].push_back({j, 2});
                } if (j + 1 <= m && aa[i][j + 1]) {
                    p[i].push_back({j + 1, 3});
                }
            }
        }
    }

		/*cin >> sym;
		scanf("%d %d", &x, &y);
		A.insert({x, y});
		if (sym == 'h') {
			A.insert({x + 1, y});
			p[x + 1].push_back({y, 2});
		} else if (sym == 'v') {
			A.insert({x, y + 1});
			p[x].push_back({y + 1, 3});
		}
	}
	for (auto i: A) {
		x = i.first;
		y = i.second;
		p[x].push_back({y, 1});
	}*/
	for (int i = 0; i < q; ++i) {
		scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
		//--x1, --y1, --x2, --y2;
		ev[x1 - 1].push_back({y1, y2, 1, -1, i});
		ev[x2].push_back({y1, y2, 1, +1, i});
		ev[x1].push_back({y1, y2, 2, -1, i});
		ev[x2].push_back({y1, y2, 2, +1, i});
		ev[x1 - 1].push_back({y1 + 1, y2, 3, -1, i});
		ev[x2].push_back({y1 + 1, y2, 3, +1, i});
	}
	for (int i = 0; i <= n; ++i) {
		for (auto j: p[i]) {
			id = j.y;
			color = j.color;
			update(1, 1, T);
		}
		for (auto j: ev[i]) {
			l = j.l, r = j.r;
			color = j.color;
			type = j.type;
			ind = j.ind;
			auto res = get(1, 1, T, l, r);
			if (color == 1) Sum = res.a;
			if (color == 2) Sum = res.b;
			if (color == 3) Sum = res.c;
			ans[ind][color] += type * Sum;
		}
	}
	for (int i = 0; i < q; ++i)
		ans[i][0] = ans[i][1] - ans[i][2] - ans[i][3];
	for (int i = 0; i < q; ++i)
		printf("%d\n", ans[i][0]);
	return 0;
}


Measured memory_bytes: 146432