akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define lli long long int
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;
int main()
{
    fio
    string s,t,ans="";
    cin>>s>>t;
    long int dp[3004][3004];
    memset(dp,0,sizeof(dp));
    long int i,j;
    for(i=1;i<=s.length();i++)
    {
        for(j=1;j<=t.length();j++)
        {
            if(s[i-1]==t[j-1])
                dp[i][j]=dp[i-1][j-1]+1;
            else
                dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }
    i=s.length(); j=t.length();
    while(true)
    {
        if(i>0 && dp[i][j] == dp[i-1][j]) i--;
        else if(j>0 && dp[i][j] == dp[i][j-1]) j--;
        else if(i>0 && j>0&&s[i-1]==t[j-1])
            {ans += s[i-1];i--;j--;}

        else break;
    }
    reverse(ans.begin(),ans.end());
    cout<<ans;



return 0;
}


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

int main() {
    int N;
    cin >> N;
    int P[N];

    for (int i = 0; i < N; i++) cin >> P[i];
    
    int ans = 0;
    int mini = P[0];

    for (int i = 0; i < N; i++) {
        if (P[i] <= mini) {
            mini = P[i];
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, m;
  cin >> n >> m;
  
  vector<int> cities(n);

  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    cities.at(a - 1) = cities.at(a - 1) + 1;
    cities.at(b - 1) = cities.at(b - 1) + 1;
  }
    
  for (int i = 0; i < n; i++) {
    cout << cities.at(i) << endl;
  }
}

Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	a := getNextInt(scanner)
	b := getNextInt(scanner)
	c := getNextInt(scanner)
	d := getNextInt(scanner)

	for {
		c -= b
		if c <= 0 {
			fmt.Fprintln(writer, "Yes")
			return
		}
		a -= d
		if a <= 0 {
			fmt.Fprintln(writer, "No")
			return
		}
	}
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    set<int> s;
    rep(i, 3){
        int a; cin >> a;
        s.insert(a);
    }
    cout << s.size() << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7756
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
const int INF = 2000000000;
// const ll MOD = 1000000007;

vector<int> vec(5);

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int min_d = INF;
  int min_idx = 0;
  for (int i = 0; i < 5; i++) {
    cin >> vec[i];
    int d = vec[i] % 10;
    if (d == 0) {
      continue;
    }
    if (d < min_d) {
      min_d = d;
      min_idx = i;
    }
  }

  int ans = 0;
  for (int i = 0; i < 5; i++) {
    if (vec[i] % 10 == 0) {
      ans += vec[i];
      continue;
    }
    if (i == min_idx) {
      ans += vec[i];
    } else {
      ans += vec[i] + (10 - (vec[i] % 10));
    }
  }

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

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

int main(){
  if(df) printf("*debug mode*\n");
  int h,w,a,b; cin >>h >>w >>a >>b;
  if(a+a>w || b+b>h){
    printf("No");
    return 0;
  }
  for(int i=0;i<b;i++){
    for(int j=0;j<a;j++){
      cout << "1";
    }
    for(int j=a;j<w;j++){
      cout << "0";
    }
    cout << "\n";
  }
  for(int i=b;i<h;i++){
    for(int j=0;j<a;j++){
      cout << "0";
    }
    for(int j=a;j<w;j++){
      cout << "1";
    }
    cout << "\n";
  }
}

/// confirm df==0 ///


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

int n;
vector<long long> a, sum, osum, esum;

bool check(int mid, long long x){
    int l = lower_bound(a.begin(), a.end(), x * 2LL - a[mid]) - a.begin();
    l = max(l, 1);
    return mid - l + 1 <= n - mid;
}

int meguru_search(int ok, int ng, long long x){
    while(abs(ok - ng) > 1){
        int mid = (ok + ng) / 2;
        if(check(mid, x)){
            ok = mid;
        }else{
            ng = mid;
        }
    }
    return ok;
}

long long query(long long x){
    int ar = meguru_search(0, n, x);
    int al = max(ar * 2 - n, 0);
    long long res = sum[n] - sum[ar] + (al % 2 == 0 ? esum[al] : osum[al]);
    return res;
}

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

    int q;
    cin >> n >> q;

    a.resize(n + 1);
    for(int i = 1 ; i <= n ; ++i){
        cin >> a[i];
    }

    sum.resize(n + 1);
    osum.resize(n + 1);
    esum.resize(n + 1);
    for(int i = 1 ; i <= n ; ++i){
        sum[i] = sum[i - 1] + a[i];
        osum[i] = osum[i - 1] + (i % 2 == 1 ? a[i] : 0);
        esum[i] = esum[i - 1] + (i % 2 == 0 ? a[i] : 0);
    }

    for(int i = 0 ; i < q ; ++i){
        long long x;
        cin >> x;
        long long ans = query(x);
        cout << ans << endl;
    }

    return 0;
}

Measured memory_bytes: 4864
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            String S = in.next();
            int K = in.nextInt();
            char c = S.charAt(K - 1);
            char[] ss = S.toCharArray();
            for (int i = 0; i < ss.length; i++) {
                if (ss[i] != c) {
                    ss[i] = '*';
                }
            }
            out.println(new String(ss));
        }

    }
}



Measured memory_bytes: 22740
#include<iostream>
#define fi        first
#define se        second
#define pb        push_back
#define PI        acos(-1)
#define LC(a)     ((a<<1))
#define RC(a)     ((a<<1)+1)
#define MID(a,b)  ((a+b)>>1)
#define mem(a, b) memset(a, b, sizeof(a))
#define IOS()     std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<ll,ll>   PLL;
typedef pair<ll,int>  PLI;
const int INF = 0X3F3F3F3F;
const int MIN = -(1<<30);
const ll N = 1e5+7;
int C(int x)
{
	if(x<2) return 0;
	if(x==2) return 1;
	return x*(x-1)/2;
}
inline void solve()
{
	int n,m;cin>>n>>m;
	
	cout<<C(n)+C(m)<<endl; 

}
int main()
{
	IOS();
	 solve();
	return 0;
}




Measured memory_bytes: 256
#include <iostream>
using namespace std;
void ABC140(void);
void ABC141(void);
void ABC142(void);
void ABC143(void);
void ABC144(void);
void ABC145(void);
void ABC146(void);
void ABC147(void);
void ABC148(void);
void ABC149(void);

int main(void){
    ABC143();
}

void ABC143(){
    int a,b;
    cin>>a>>b;
    if(a<=2*b)cout<<0<<endl;
    else cout<<a-2*b<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int N, M, a, b, S, T, dist[100000][3];
vector<int>v[100000];
priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>, greater<pair<int, pair<int, int>>>>q;

int main() {
	cin >> N >> M;
	for (int i = 0; i < M; ++i) {
		cin >> a >> b;
		--a;
		--b;
		v[a].push_back(b);
	}
	cin >> S >> T;
	--S;
	--T;
	for (int i = 0; i < N; ++i) {
		dist[i][0] = dist[i][1] = dist[i][2] = -3;
	}
	q.push(mkp(0, mkp(S, 0)));
	while (!q.empty()) {
		int d = q.top().first;
		int x = q.top().second.first;
		int t = q.top().second.second;
		q.pop();
		if (dist[x][t] == -3) {
			dist[x][t] = d;
			t = (t + 1) % 3;
			for (int i : v[x]) {
				q.push(mkp(d + 1, mkp(i, t)));
			}
		}
	}
	cout << dist[T][0] / 3 << endl;
}

Measured memory_bytes: 7668
#import itertools

x,y,z,k=(int(i) for i in input().split())
#print(x,y,z,k)
a=list(int(i) for i in input().split())
a.sort(reverse=True)
b=list(int(i) for i in input().split())
b.sort(reverse=True)
c=list(int(i) for i in input().split())
c.sort(reverse=True)
#print(a,b,c)

#k=3000
#a=[int(i) for i in range(1000)]
#b=[int(i) for i in range(1000)]
#c=[int(i) for i in range(1000)]
x=[]
for h in range(len(a)):
    for i in range(len(b)):
        if (h+1)*(i+1) <=k:
            for j in range(len(c)):
                if (h+1)*(i+1)*(j+1) <=k:
                    x.append(a[h]+b[i]+c[j])

x.sort(reverse=True)
for i in range(k):
  print(x[i])
  


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

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

	string s;
	cin >> s;

	int c1 = 0;
	for (int i = 0; i < n; ++i) {
		if (s[i] == '1') {
			++c1;
		}
	}

	vector<int> am(n);
	vector<int> ap(n);
	int mw = c1 - 1;
	int pw = c1 + 1;

	bool special = false;
	if (mw == 0) {
		special = true;
		mw = 1;
	}
	am[0] = 1 % mw;
	ap[0] = 1 % pw;
	for (int i = 1; i < n; ++i) {
		am[i] = (am[i-1] * 2) % mw;
		ap[i] = (ap[i-1] * 2) % pw;
	}

	int bam = 0;
	int bap = 0;
	{
		int j = 0;
		for (int i = n - 1; 0 <= i; --i) {
			if (s[i] == '1') {
				bam = (bam + am[j]) % mw;
				bap = (bap + ap[j]) % pw;
			}
			++j;
		}
	}

	{
		int j = n - 1;
		for (int i = 0; i < n; ++i)
		{
			int check;
			if (s[i] == '1') {
				if (special) {
					cout << 0 << endl;
					--j;
					continue;
				}
				else {
					check = bam - am[j];
					if (check < 0) {
						check += mw;
					}
				}
			}
			else {
				check = (bap + ap[j]) % pw;
			}

			int ret = 1;
			while (check != 0) {
				int temp = check;
				int count2 = 0;
				while (temp != 0) {
					if (temp % 2 == 1) {
						++count2;
					}
					temp /= 2;
				}
				check = check % count2;
				++ret;
			}

			cout << ret << endl;

			--j;
		}
	}

	return 0;
}

Measured memory_bytes: 5240
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
	    // input N M
        Scanner sc = new Scanner(System.in);
        int evenNum = sc.nextInt();
        int oddNum = sc.nextInt();
        int resultNum = 0;
        if(1 < evenNum){
            for(int i = 1; i < evenNum; i++){
                resultNum += i;
            }
        }
        if(1 < oddNum){
            for(int i = 1; i < oddNum; i++){
                resultNum += i;
            }
        }
        System.out.println(resultNum);
    }
}


Measured memory_bytes: 24916
N = int(input())
A = list(map(int,input().split()))
sum = 1
flag = 0
for i in range(N):
	if flag == 0:
		sum *= A[i]
		if sum > 10**18:
   			flag = 1
	if A[i] == 0:
		sum = 0
		flag = 0
		break  
if flag == 1:
	print('-1')
else:
	print(sum)

Measured memory_bytes: 21704
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC085
{
    class Program
    {
        static void Main(string[] args)
        {
            string s;
            s = Console.ReadLine();
            char[] cs = s.ToCharArray();
            cs[0] = '2';
            cs[1] = '0';
            cs[2] = '1';
            cs [3] = '8';
            Console.WriteLine(cs);
            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 13140
#include <iostream>

int main(int argc, char *argv[]){
	unsigned long long n, a, b;
	std::cin >> n >> a >> b;
	unsigned long long x1, x2;
	std::cin >> x1;
	unsigned long long sum = 0;
	for(int i = 1; i < n; i++){
		std::cin >> x2;
		sum += std::min(a * (x2 - x1), b);
		x1 = x2;
	}
	std::cout << sum << std::endl;
	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	log.SetFlags(log.Lshortfile)
	d := nextInt()
	if d == 25 {
		fmt.Println("Christmas")
	} else if d == 24 {
		fmt.Println("Christmas Eve")
	} else if d == 23 {
		fmt.Println("Christmas Eve Eve")
	} else if d == 22 {
		fmt.Println("Christmas Eve Eve Eve")
	}
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

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

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type Pair struct {
	a, b int
}

type Pairs []Pair

func (p Pairs) Len() int {
	return len(p)
}
func (p Pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e2+10;
long long Ans;
int f[maxn][maxn];
int main(){
	char ch;
	int n,m;
	cin>>n>>m;
	memset(f,-1,sizeof(f));
	for(register int i=1;i<=n;++i){
		for(register int j=1;j<=m;++j){
			cin>>ch;
			if(ch=='#')f[i][j]=0;
		}
	}int ans=0;
	for(register int i=1;i<=n;++i){
		for(register int j=1;j<=m;++j){
			if(!f[i][j]&&f[i][j-1]*f[i][j+1]*f[i-1][j]*f[i+1][j]!=0)ans=1;
		}
	}printf("%s",ans?"No":"Yes");
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int32_t main(){
	fastio();
	string s;
	cin>>s;
	cout<<s.substr(0,3); 	
}

Measured memory_bytes: 3612
#ABC113B
n = int(input())
T,a = list(map(int,input().split()))
h = list(map(int,input().split()))

t_ = [0]*n
tmp = float('inf')
for i in range(n):
    t_[i] = T-h[i]*0.006
    if tmp>abs(t_[i]-a):
        tmp = abs(t_[i]-a)
        ans = i
print(ans+1)

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

int main() {
	int M, N;
  	cin >> M >> N;
  vector<int>road(M + 1);
 for(int i = 0; i < N; i++){
   int a, b;
   cin >> a >> b;
   road.at(a) += 1;
   road.at(b) += 1;
}

for(int i = 0; i < M; i++){
  cout << road.at(i + 1) << endl;
}
}

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

int main()
{
    int N, T;
    cin >> N >> T;

    int ans = INT_MAX;
    for (int i = 0; i < N; i++) {
        int c, t;
        cin >> c >> t;
        if (t <= T) {
            ans = min(ans, c);
        }
    }
    cout << (ans == INT_MAX ? "TLE" : to_string(ans)) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int x,y,z;
int main()
{
	scanf("%d",&x);
	for(int i=1;i<=x;i++)
	{
		scanf("%d",&y);
		if(y%2==1)
		z++;
	}
	if(z%2==0)
		printf("YES");
	else
		printf("NO");
}


Measured memory_bytes: 384
#include<stdio.h>
int main() {
    int n, m, a[10000], temp = 0;
    scanf("%d %d", &n, &m);
    for (int i = 0; i < m; i++)
    {
        scanf("%d", &a[i]);
    }
    for (int p = 0; p < m; p++)
    {
        temp = temp + a[p];
    }
    if (n >= temp)
    {
        printf("%d\n", n-temp);
    }
    else
    {
        printf("-1");
    }






    return 0;
}

Measured memory_bytes: 1752
from math import factorial

def cmb(n, r):
  return factorial(n) // (factorial(n - r) * factorial(r))

N, K = map(int, input().split())

for i in range(1, K + 1):
  try:
    print((cmb(N - K + 1, i) * cmb(K - 1, i - 1)) % (10 ** 9 + 7))
  except:
    print(0)

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

int main(){
	string S;

	cin>>S;

	if(S=="SUN") cout<<"7"<<endl;
	if(S=="MON") cout<<"6"<<endl;
	if(S=="TUE") cout<<"5"<<endl;
	if(S=="WED") cout<<"4"<<endl;
	if(S=="THU") cout<<"3"<<endl;
	if(S=="FRI") cout<<"2"<<endl;
	if(S=="SAT") cout<<"1"<<endl;

	return 0;
}


Measured memory_bytes: 256
s = gets.chomp
n = s.size
ans = 0
s = s.split("")

[0, 1].repeated_permutation(n-1).each do |bits|
    formula = []
    n.times do |i|
        formula << s[i]
        formula << "+" if bits[i] == 1
    end
    ans += eval(formula.join(""))
end

puts ans

Measured memory_bytes: 2044
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <stdio.h>
using namespace std;

int main() {
	string s;
	int ans = 0,smc;
	char sm;
	cin >> s;
	sm = s[0];
	for (int i = 1; i < (int)s.size(); i++) {
		if (s[i] != sm ) {
			ans += 2;
			s.erase(i - 1, 2);
			if (i >= 2) {
				i -= 2;
				sm = s[i];
			}
			else {
				i = 0;
				sm = s[i];
			}
		}
		else {
			sm = s[i];
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
/*
██╗  ██╗ █████╗ ██████╗ ███████╗███████╗███╗   ███╗        ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝██╔══██╗██╔══██╗██╔════╝██╔════╝████╗ ████║        ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝ ███████║██████╔╝█████╗  █████╗  ██╔████╔██║        █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗ ██╔══██║██╔══██╗██╔══╝  ██╔══╝  ██║╚██╔╝██║        ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██║  ██║██║  ██║███████╗███████╗██║ ╚═╝ ██║███████╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝     ╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
Believe in yourself ,( try and try and then try ), You can do it  
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define clr(arr, x) memset(arr, x, sizeof arr)
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define OO 0x3f3f3f3f3f3f3f3fLL
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
void K_K(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
int n;
vector<int>arr;
int dp[100005];
int sol(int idx){
	if (idx == n - 1)
		return 0;
	if (idx == n - 2)
		return abs(arr[idx] - arr[idx + 1]);
	int &ret = dp[idx];
	if (~ret)
		return ret;
	return ret = min(sol(idx + 1) + abs(arr[idx] - arr[idx + 1]), sol(idx + 2) + abs(arr[idx] - arr[idx + 2]));
}
int main(){
	K_K();
	cin >> n;
	arr.resize(n);
	clr(dp, -1);
	for (auto &it : arr)
		cin >> it;
	cout << sol(0);
}

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

using ll=long long;
using vll=vector<ll>;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vpii=vector<pii>;


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

    int a, b, c;
    cin >> a >> b >> c;
    cout << min(b/a, c) << "\n";
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=sys.stdin.readline
def resolve():
    W=[0,2,5,5,4,5,6,3,7,6]
    n,m=map(int,input().split())
    A=list(map(int,input().split()))
    dp=[-1]*(n+1)
    dp[0]=0
    from itertools import product
    for i,a in product(range(n+1),A):
        if i-W[a]<0: continue
        dp[i]=max(dp[i],dp[i-W[a]]*10+a)
    print(dp[n])

resolve()

Measured memory_bytes: 51548
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<Integer> inputList = new ArrayList<>();

		try {
			while (input.ready()) {
				inputList.add(Integer.valueOf(input.readLine()));
			}
		} catch (IOException e) {
			e.printStackTrace();
		}

		int maxNum = 0;
		for (int num : inputList) {
			if (maxNum < num)
				maxNum = num;
		}

		ArrayList<Integer> primeNumberList = getPrimeNumberList(maxNum);

		for (int num : inputList) {
			int primeNumberCount = 0;
			for (int i = 0; i < primeNumberList.size(); i++) {
				if (num >= primeNumberList.get(i)) {
					primeNumberCount++;
				} else {
					break;
				}
			}
			System.out.println(primeNumberCount);
		}
	}

	public static ArrayList<Integer> getPrimeNumberList(int maxNumber) {
		ArrayList<Integer> primeNumberList = new ArrayList<>();
		primeNumberList.add(2);
		primeNumberList.add(3);
		primeNumberList.add(5);
		primeNumberList.add(7);

		int[] oneDigitList = {1,3,7,9};

		int tmp;
		int sqrtTmp;
		boolean addFlag;
		for (int i = 10; i <= maxNumber; i += 10) {
			for (int oneDigit : oneDigitList) {
				addFlag = true;
				tmp = i + oneDigit;
				sqrtTmp = (int) Math.sqrt(tmp);
				for (int primeNumber : primeNumberList) {
					if (tmp % primeNumber == 0) {
						addFlag = false;
						break;
					}
					if ( sqrtTmp < primeNumber) {
						break;
					}
				}
				if (addFlag) {
					primeNumberList.add(tmp);
				}
			}
		}
		return primeNumberList;
	}
}

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


int main(){
    vector<pair<int,int>> seg(100005);

    int n; cin>>n;
    for(int i=1;i<=n;++i)cin>>seg[i].first>>seg[i].second;

    auto cmpl=[&](const int &a,const int &b){ return tie(seg[a].first,a)<tie(seg[b].first,b); };
    auto cmpr=[&](const int &a,const int &b){ return tie(seg[a].second,a)<tie(seg[b].second,b); };

    set<int,decltype(cmpl)> lset(cmpl);
    set<int,decltype(cmpr)> rset(cmpr);

    for(int i=1;i<=n;++i)lset.insert(i);
    for(int i=1;i<=n;++i)rset.insert(i);

    cout<<max([=]()mutable->long long{
        long long rt=0,now=0;
        while(lset.size()){
            int rrr=*--lset.end();
            lset.erase(rrr); rset.erase(rrr);
            if(seg[rrr].first<=now && now<=seg[rrr].second);
            else if(now<=seg[rrr].first)rt+=seg[rrr].first-now,now=seg[rrr].first;
            else rt+=now-seg[rrr].second,now=seg[rrr].second;
            // cout<<"choose "<<rrr<<endl;
            if(lset.empty())break;
            int lll=*rset.begin();
            lset.erase(lll); rset.erase(lll);
            if(seg[lll].first<=now && now<=seg[lll].second);
            else if(now<=seg[lll].first)rt+=seg[lll].first-now,now=seg[lll].first;
            else rt+=now-seg[lll].second,now=seg[lll].second;
            // cout<<"choose "<<lll<<endl;
        }
        // cout<<"fi ov"<<endl;
        return rt+abs(now);
    }(),[=]()mutable->long long{
        long long rt=0,now=0;
        while(rset.size()){
            int lll=*rset.begin();
            lset.erase(lll); rset.erase(lll);
            if(seg[lll].first<=now && now<=seg[lll].second);
            else if(now<=seg[lll].first)rt+=seg[lll].first-now,now=seg[lll].first;
            else rt+=now-seg[lll].second,now=seg[lll].second;
            // cout<<"choose "<<lll<<endl;
            if(rset.empty())break;
            int rrr=*--lset.end();
            lset.erase(rrr); rset.erase(rrr);
            if(seg[rrr].first<=now && now<=seg[rrr].second);
            else if(now<=seg[rrr].first)rt+=seg[rrr].first-now,now=seg[rrr].first;
            else rt+=now-seg[rrr].second,now=seg[rrr].second;
            // cout<<"choose "<<rrr<<endl;
        }
        // cout<<"se ov"<<endl;
        return rt+abs(now);
    }())<<endl;
}


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

int main(){
	int m,max=0,cen=-1,min=-2;
	cin >> m;
	max=m;
	cen=-1;
	min=-2;
	for(int i=1;i<10;i++){
		cin >> m;
		if(max<m){
			min=cen;
			cen=max;
			max=m;
		}
		else if(cen<=m){
			min=cen;
			cen=m;
		}
		else if(min<=m) min=m;
	}
	cout << max << endl;
	cout << cen << endl;
	cout << min << endl;

		return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include <functional>
using namespace std;

int main() {

	int X, Y, A, B, C;
	cin >> X>> Y>> A>> B>> C;

	int total=0;
	vector<int>r, g, n;
	uint64_t happy=0;

	for (int i = 0; i < A; i++) {
		int a;
		cin >> a;
		r.push_back(a);
	}
	for (int i = 0; i < B; i++) {
		int a;
		cin >> a;
		g.push_back(a);
	}
	for (int i = 0; i < C; i++) {
		int a;
		cin >> a;
		n.push_back(a);
	}
	sort(r.begin(), r.end(), std::greater<int>());
	sort(g.begin(), g.end(), std::greater<int>());
	sort(n.begin(), n.end(), std::greater<int>());
	
	int i = 0,j=0,k=0,ma;
	while (total != X + Y) {
		ma = max(r[i], max(g[j], n[k]));
		if ( ma== r[i] &&i<X) {
			happy += r[i];
			i++;
			if (i == X) {
				r[i] = 0;
			}
			
		}
		if (ma == g[j]&&j<Y) {
			happy += g[j];
			j++;
			if (j == Y) {
				g[j] = 0;
			}
			
		}
		else if(ma==n[k] && k<C){
			happy += n[k];
			k++;
		}


		total = i + j+k;
		
	}

	cout << happy;
	return 0;
}

Measured memory_bytes: 1784
package main

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

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func main() {
	sc := NewScanner()
	N := sc.nextInt()
	S := sc.nextRuneSlice()
	str := ""
	for _, v := range S {
		num := (int(v) + N)
		if num >= (int('Z') + 1) {
			num = num - 26
		}
		str += string(num)
	}
	fmt.Println(str)
}


Measured memory_bytes: 7680
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    string s; cin>>s;
    int flag=0;
    if(s[0]==s[1]&&s[1]==s[2])flag=1;
    if(flag)cout<<"No";
    else cout<<"Yes";
    
}

Measured memory_bytes: 256
/*________________________Bismillahir Rahmanir Rahim___________________
|                                                                      |
|                    /\     |     | |\    |     /\     |-------        |
|                   /  \    |     | | \   |    /  \    |               |
|                  /----\   |-----| |  \  |   /----\   |-----          |
|                 /      \  |     | |   \ |  /      \  |               |
|                /        \ |     | |    \| /        \ |               |
|                     14th batch CSE , ID : 12008029                   |
|                     Comilla University                               |
|                     Email : sheikhahnafshifat@gmail.com              |
|______________________________________________________________________*/
#include<bits/stdc++.h>
#include<string>
#include<iostream>
using namespace std;
#define ll                      long long
#define MAX                     1000007
#define pb(x)                   push_back(x)
#define mp(x,y)                 make_pair(x,y)
#define vii                     vector<int>
#define vll                     vector<long long>
#define vp                      vector<pair<ll, ll> >
#define v_min(a)                *min_element(a.begin(),a.end())
#define v_max(a)                *max_element(a.begin(),a.end())
#define v_sum(a)                accumulate(a.begin(),a.end(),0)
#define un(a)                   a.erase(unique(a.begin(),a.end()),a.end())
#define SORT(a)                 sort(a.begin(),a.end())
#define AHNAF                   ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define gcd(a,b)                __gcd(a,b)
#define lcm(a,b)                ((a)*(b))/gcd(a,b)
#define YES                     cout<<"Yes"<<endl
#define NO                      cout<<"No"<<endl
#define testcase(t)             int t;cin>>t;while(t--)
#define reverse(a)              reverse(a.begin(),a.end())
#define ff                      first
#define ss                      second
#define print(a)                for(auto it: a) cout<<it<<" "
#define all(a)                  a.begin(),a.end()
///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

int main()
{
    AHNAF;
    int x;cin>>x;
    if(x>=30) {YES;}
    else NO;
}



Measured memory_bytes: 3608
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int32_t main()
{
	FIO;
	string s, t; cin >> s >> t;

	int dp[s.length() + 1][t.length() + 1];

	string ans = "";

	for (int i = 0; i <= (int)s.length(); i++) {
		for (int j = 0; j <= (int)t.length(); j++) {
			if (i == 0 || j == 0)
				dp[i][j] = 0;

			else if (s[i - 1] == t[j - 1]) {
				dp[i][j] = 1 + dp[i - 1][j - 1];
				// ans += s[i - 1];
			}

			else {
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
				// string a = dp[i - 1][j];
				// string b = dp[i][j - 1];

				// if (a.length() < b.length())
				// 	swap(a, b);

				// dp[i][j] = a;
			}
		}
	}

	int i = s.length(), j = t.length();

	while (i > 0 && j > 0) {
		if (dp[i][j] == dp[i][j - 1])
			j--;
		else if (dp[i][j] == dp[i - 1][j])
			i--;
		else {
			ans = s[i - 1] + ans;
			i--, j--;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 73984
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define REEP(i, N) for(ll i = N - 1; i >= 0; --i)
#define FOR(i,m,n) for(ll i = m; i < n; ++i)
#define RFOR(i,m,n) for(ll i = n - 1; i >= m; --i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define PB push_back
#define KIRIAGE(a, b) a += (b - a % b) % b // a を b の倍数値まで増やす
#define CEIL(c, a, b) if(a % b == 0) { c = a / b;} else { c = a / b + 1;} // a / b 以上の最小整数
#define sp(n) setprecision(n)
#define INF 1000000000
#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(void) {
	ll N, X;
	cin>>N>>X;
	ll ans = N;
	ll nokori = N - X;
	ll step = X;
	while(nokori % step) {
		ans += (nokori / step) * step * 2;
		ll gomi = nokori;
		nokori = step;
		step = gomi % step;
	}
	ans += 2 * nokori - step;
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>//random,NULL
#include <string.h>
#include <time.h>
#include <unistd.h>//sleep()
#include <math.h>
#include <stdbool.h>

#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000


int main(){
  char buf[1024];
  int N;

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%d", &N);

  char *s=(char *)malloc(sizeof(char)*N);

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%s", s);

  int count_r=0;
  int count_b=0;
  rep(i,N){
    if(s[i]=='R'){
      count_r++;
    }
    else{
      count_b++;
    }
  }

  if(count_r>count_b){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }

  return 0;

}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

template <typename T> void s_max(T& a, T b) {
	if (a < b) {
		a = b;
	}
}

class TaskU {
public:
	int N;
	vector<vector<int>> a;
	vector<ll> dp, scores;
	vector<int> rem;

	void solve(std::istream& in, std::ostream& out) {
		in >> N;
		a.resize(N, vector<int> (N));
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				in >> a[i][j];
			}
		}
		scores.resize(1 << N, 0);
		dp.resize(1 << N, 0);
		pre_calc();
		for (int mask = 0; mask < (1 << N); mask++) {
			rem.clear();
			for (int i = 0; i < N; i++) {
				if (!(mask & (1 << i))) rem.push_back(i);
			}
			rec(0, dp[mask], mask, 0);
		}
		out << dp[(1 << N) - 1];
	}

	void pre_calc() {
		for (int mask = 0; mask < (1 << N); mask++) {
			for (int i = 0; i < N; i++) {
				for (int j = i + 1; j < N; j++) {
					if ((mask & (1 << i)) && (mask & (1 << j)))
						scores[mask] += a[i][j];
				}
			}
		}
	}

	void rec(int pos, ll score, int mask, int group) {
		if (pos == (int) rem.size()) {
			s_max(dp[mask], score + scores[group]);
			return;
		}
		rec(pos + 1, score, mask ^ (1 << rem[pos]), group ^ (1 << rem[pos]));
		rec(pos + 1, score, mask, group);
	}
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	TaskU solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int K, A, B;
    cin >> K >> A >>B;
    for (int num=A; num<=B; num++) {
        if (num % K == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}


Measured memory_bytes: 3636
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
 
const int inf = 999999999;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define ret return
 
ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
 
///////////////////////////////////////////////////////////////////////////
 
ll n,a,b,h[100005] = {};
 
bool boon(ll cnt){
    ll t[100005] = {};
    ll kk  = cnt;
    rep(i,0,n){
        t[i] = h[i];
        t[i] -= b*cnt;
        if(t[i] > 0){
            kk -= (t[i]+(a-b)-1)/(a-b);
            if(kk < 0)return false;
        }
    }
    return true;
}
 
int main(){
	cin >> n >> a >> b;
    rep(i,0,n)cin >> h[i];
    sort(h,h+n);
    ll l = 1,r = (h[n-1]+b-1)/b;
    ll cnt = (l+r)/2;
    
    while(l < r){
        if(boon(cnt)) r = cnt;
        else l = cnt+1;

        cnt = (l+r)/2;
    }

 
    if(boon(cnt) || 1)cout << cnt << endl;
    else cout << cnt-1 << endl;
	return  0;
}

Measured memory_bytes: 1024
#n = int(input())
h, w = map(int,input().split())
#l = list(map(int,input().split()))
l = [list(input()) for i in range(h)]
def possible(i, j):
    if i == -1 or i == h:
        return False
    if j == -1 or j == w:
        return False    
    return True

for i in range(h):
    for j in range(w):
        count = 0
        if l[i][j] == '.':
            if possible(i-1, j) and l[i-1][j] == '#':
                count += 1
            if possible(i+1, j) and l[i+1][j] == '#':
                count += 1
            if possible(i, j+1) and l[i][j+1] == '#':
                count += 1
            if possible(i, j-1) and l[i][j-1] == '#':
                count += 1
            if possible(i-1, j+1) and l[i-1][j+1] == '#':
                count += 1
            if possible(i+1, j+1) and l[i+1][j+1] == '#':
                count += 1
            if possible(i-1, j-1) and l[i-1][j-1] == '#':
                count += 1
            if possible(i+1, j-1) and l[i+1][j-1] == '#':
                count += 1
            l[i][j] = str(count)
for li in l:
    print("".join(li))


Measured memory_bytes: 9152
n,m = map(int, input().split())
g = [0 for i in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    g[a] += 1
    g[b] += 1
for i in range(n):
    print(g[i])


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl '\n';

int main(){
    ios_base::sync_with_stdio(0); cin.tie(nullptr);
    int n,k; cin>>n>>k;
    int a[1001];
    for(int i=0; i<n; i++) cin>>a[i];
    sort(a,a+n);
    int sum=0;
    for(int i=0; i<k; i++) sum+=a[i];
    cout<<sum<<endl;
    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#define end 2019
using namespace std;

int main (){
    int N,M;
    cin >> N;
    int* x=  new int [N];
    for (int i = 0; i < N; i++) cin >> x[i];
    cin >> M;
    int* a=  new int [M];
    for (int i = 0; i < M; i++) cin >> a[i];
    for (int i = 0; i < M; i++)
    {
        if (x[a[i]-1]+1!=x[a[i]] && x[a[i]-1] < end) x[a[i]-1]++;
    }
    for (int i = 0; i < N; i++) cout << x[i] << endl;
    delete a,x;
    return 0;
}


Measured memory_bytes: 3116
import java.util.Scanner;
import java.lang.String;
public class Main
{
	public static void main(String args[])
	{
		Scanner input = new Scanner(System.in);
		char ch;
		String s;
		int b = 0;
		while (input.hasNext())
		{

			String st = "";
			s = input.next();
			for(int i = 0; i < s.length(); i++)
			{
				ch = s.charAt(i);
				if(ch >= 'A' && ch <= 'Z')
				{
					ch = Character.toLowerCase(ch);
				}
				else if(ch >='a' && ch <= 'z') {
					ch = Character.toUpperCase(ch);
					
				}
				st = st + ch;
			}
			if(b == 0)
			{
				System.out.print(st);
				b++;
			}
			else 
			{
				System.out.print(' ' + st);
			}
		}
		System.out.println();
	}
}

Measured memory_bytes: 26368
#include "bits/stdc++.h"
using namespace std;
 
int main(void) {
	int n, m;
	cin >> n >> m;
	int a[m], b[m];

	for(int i=0;i<m;i++) cin >> a[i] >> b[i];

	vector<int> count(n);

	for(int i=0;i<n;i++) {
		for(int j=0;j<m;j++) {
			if(i+1 == a[j] || i+1 == b[j]) count[i]++;
		}
	}

	for(int i=0;i<n;i++) cout << count[i] << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>

using namespace std;

const int INF = 1e9 + 5;

int main()
{
    int n;
    scanf("%d", &n);
    int k;
    scanf("%d", &k);
    vector<int> h(n);
    for (int &x : h)
    {
        scanf("%d", &x);
    }
    vector<int> dp(n, INF);
    dp[0] = 0;
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j <= i + k; ++j)
        {
            if (j < n)
            {
                dp[j] = min(dp[j], dp[i] + abs(h[i] - h[j]));
            }
        }
    }
    printf("%d\n", dp[n - 1]);
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
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;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  // ll n;
  // cin >> n;
  // ll n, m;
  // cin >> n >> m;
  ll w, h, x, y;
  cin >> w >> h >> x >> y;
  cout << (double)w * h / 2 << " " << (int)(x * 2 == w && y * 2 == h) << endl;
  // cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256