akhauriyash/Code-Regression huggingface dataset:
/*
    ASEEN AAN 
            PINDAN AALE JATT!!!
                                */
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
//#include <boost/functional/hash.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
lli M=1000000007;   
lli INF=1e17;
#define sqr(x) (x) * (x)
#define bip(n) __builtin_popcount(n)//no of ones bit in binary!!
#define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!!
#define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!!
#define bffs(n) __builtin_ffs(n)//index of first one bit!!
typedef pair<lli,lli> ll;
#define mem1(a,x) fill(&a[0], &a[0] + sizeof(a) / sizeof(a[0]), x)
#define mem2(a,x) fill(&a[0][0], &a[0][0] +sizeof(a)/sizeof(a[0][0]),x)
#define mem3(a,x) fill(&a[0][0][0], &a[0][0][0] +sizeof(a)/sizeof(a[0][0][0]),x)
#define fi1 ifstream fin("input.txt")
#define of1 ofstream fout("output.txt")
typedef tree<lli,null_type,less<lli>,rb_tree_tag,tree_order_statistics_node_update> ost;
lli n,q,z,y,k,m;
const double pi1=3.14159265358979323846;
//unordered_map<pair<ll,lli>,lli> mp;
lli me(lli a,lli b,lli M)
{
    if(b==0)
    return 1;
    else if(b%2==0)
    return me((a*a)%M,b/2,M);
    else
    return (a%M*me((a*a)%M,(b-1)/2,M)%M)%M;
}
lli mI(lli a,lli m)
{
    return me(a,m-2,m);
}
//lli tot=0;
vector<lli> pf(string s) {
    int n = (int)s.length();
    vector<lli> pi(n);
    for (int i = 1; i < n; i++) {
        int j = pi[i-1];
        while (j > 0 && s[i] != s[j])
            j = pi[j-1];
        if (s[i] == s[j])
            j++;
        pi[i] = j;
    }
    return pi;
}
//map<ll,lli> dp;
//set<lli> s[100005];
//lli dp[3005][3005];
lli dp[3005][3005];
map<lli,lli> vis;
//string sdp[3005][3005];
int main()
{
    ios_base::sync_with_stdio(0);
    cin>>n>>m;
    char a[n+1][m+1];
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        cin>>a[i][j];
    }
    dp[1][1]=1;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=m;j++)
        {
            if(i==1&&j==1)
            continue;
            if(i==1)
            {
                if(a[i][j-1]=='.')
                dp[i][j]=dp[i][j-1];
            }
            else if(j==1)
            {
                if(a[i-1][j]=='.')
                dp[i][j]=dp[i-1][j];
            }
            else
            {
                if(a[i-1][j]=='.')
                dp[i][j]=dp[i-1][j];
                if(a[i][j-1]=='.')
                dp[i][j]+=dp[i][j-1];
            }
            dp[i][j]%=M;
        }
    }
    cout<<dp[n][m];
}

Measured memory_bytes: 24832
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
 
int N, Q;
struct LazySegmentTree {
private:
    int n;
    vector<ll> node, lazy;
 
public:
    LazySegmentTree(vector<ll> v) {
        int sz = (int)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, 0);
 
        for(int i=0; i<sz; i++) node[i+n-1] = v[i];
        for(int i=n-2; i>=0; i--) node[i] = node[i*2+1] + node[i*2+2];
    }
 
    void eval(int k, int l, int r) {
        if(lazy[k] != 0) {
            node[k] += lazy[k];
            if(r - l > 1) {
                lazy[2*k+1] += lazy[k] / 2;
                lazy[2*k+2] += lazy[k] / 2;
            }
            lazy[k] = 0;
        }
    }
 
    void add(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] += (r - l) * x;
            eval(k, l, r);
        }
        else {
            add(a, b, x, 2*k+1, l, (l+r)/2);
            add(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = node[2*k+1] + node[2*k+2];
        }
    }
 
    ll getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return 0;
        if(a <= l && r <= b) return node[k];
        ll vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        ll vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return vl + vr;
    }
};
int main() {
    cin >> N >> Q;
    LazySegmentTree seg( vector<ll>(N, 0) );
    for(int i=0; i<Q; i++) {
        int query; cin >> query;
        if(query == 0) {
            int s, t, x; cin >> s >> t >> x;
            seg.add(s-1, t, x);
        }
        else {
            int s, t; cin >> s >> t;
            cout << seg.getsum(s-1, t) << endl;
        }
    }
    return 0;
}


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

int main(){
  int n, k;
  cin >> n >> k;
  vi h(n+1);
  rep(i,n) cin >> h[i+1];
  h[0] = h[1];
  vi dp(n+1);
  dp[0] = 0; dp[1] = 0;
  for(int i=2; i<=n; i++){
    dp[i] = 1000000000;
    for(int j=1; j<=k; j++){
      if(i-j < 0) continue;
      dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]));
    }
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 4004
from fractions import gcd

def count_n(mini, maxi, n):
    min_n = n*(mini//n) if mini%n == 0 else n*(mini//n+1)
    max_n = n * (maxi//n)
    return (max_n-min_n)//n+1

a,b,c,d = [int(i) for i in input().split()]
cd = c * d // gcd (c, d)
count_1 = count_n(a,b,c)
count_2 = count_n(a,b,d)
count_3 = count_n(a,b,cd)
count = b-a+1 - (count_1 + count_2 - count_3) 
print(count)

Measured memory_bytes: 63980
#include<iostream>
using namespace std;
int n,m,l,r,ans;
int main()
{
	cin>>n>>m>>l>>r;
	for(int i=1;i<m;i++)
	{
		int nl,nr;
		cin>>nl>>nr;
		l=max(l,nl),r=min(r,nr);
	}
	ans=r-l+1;
	if(ans<=0)
		cout<<0;
	else
		cout<<ans;
} 

Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string[] cin = Console.ReadLine().Split();
        int n = int.Parse(cin[0]);
        int k = int.Parse(cin[1]);

        Console.WriteLine(k * Math.Pow(k - 1, n - 1));
    }
}

Measured memory_bytes: 13140
import collections

n = int(input())
a = []
max_list = []
max_i = 1

a = [str(input()) for x in range(n)]

c = collections.Counter(a)
c = c.most_common()
max_i = c[0][1]

for i in range(len(c)):
    if max_i == c[i][1]:
        max_list.append(c[i][0])
    else:
        break

max_list.sort()

for i in max_list:
    print(i)       
    

Measured memory_bytes: 45036
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n, m, a;
        cin >> n >> m >> a;
        if(n == 0)
            return 0;

        multimap<int, pair<int, int> > mm;
        for(int i=0; i<m; ++i){
            int h, p, q;
            cin >> h >> p >> q;
            mm.insert(make_pair(-h, make_pair(p, q)));
        }

        for(multimap<int, pair<int, int> >::iterator it=mm.begin(); it!=mm.end(); ++it){
            int p = it->second.first;
            int q = it->second.second;
            if(a == p || a == q)
                a = p + q - a;
        }

        cout << a << endl;
    }
}

Measured memory_bytes: 1252
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF = 1LL << 60;

int main(void){
    long double a,b,c;
    cin >> a >> b >> c;
    long double ans = sqrt(a/c) + sqrt(b/c);
    if(ans < 1){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

while True:
    d = str(input())
    if d == "0":
        exit(0)

    d_list = list(d)
    ans = 0
    for num in d_list:
        ans += int(num)
    print(ans)




Measured memory_bytes: 6928
def extended_gcd(a, b)
  last_remainder, remainder = a.abs, b.abs
  x, last_x, y, last_y = 0, 1, 1, 0
  while remainder != 0
    last_remainder, (quotient, remainder) = remainder, last_remainder.divmod(remainder)
    x, last_x = last_x - quotient*x, x
    y, last_y = last_y - quotient*y, y
  end

  return last_remainder, last_x * (a < 0 ? -1 : 1)
end

def modinv(e, et)
  g, x = extended_gcd(e, et)
  if g != 1
    raise 'The maths are broken!'
  end
  x % et
end

require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n,a,b = gets.chomp.split.map(&:to_i)
require 'openssl'

def all(n)
  ret = 2.to_bn.mod_exp(n, MOD) - 1
  ret
end

def nck(n,k)
  ans = 1
  k.times do |i|
    ans = ans * (n-i) % MOD
    ans = ans * modinv(i+1, MOD) % MOD
  end
  ans
end

aa = nck(n,a)
bb = nck(n,b)
bb = 0 if a==b
ans = all(n) - aa - bb
while ans < 0
  ans += MOD
end
puts (ans + MOD)%MOD


Measured memory_bytes: 3580
#include<bits/stdc++.h>
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define len(x) (int)(x).size()
#define rep(i,x) for(int i=0;i<x;++i)

typedef long long ll;
typedef long double ld;

using namespace std;
#define int long long
const int N = 111;
int dp[N][4][2];
signed main(){
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    string n;cin >> n;
    int k;cin >> k;
    ll answer = 0;
    for(int j = 1; j < len(n); ++j){
        if(j < k)continue;
        if(k == 1)answer += 1ll * 9;
        if(k == 2)answer += 1ll * 9 * (j - 1) * 9;
        if(k == 3)answer += 1ll * 9 * (j - 1) * (j - 2) / 2 * 9 * 9;
    }
    dp[1][1][0] = (n[0]-'0'-1);
    dp[1][1][1] = 1;
    for(int i = 2; i <= len(n); ++i){
        for(int j = 0 ; j < 4; ++j){
            dp[i][j][0] = dp[i-1][j][0] ;
            if(n[i-1]=='0')dp[i][j][1] = dp[i-1][j][1];
            else dp[i][j][0] += dp[i-1][j][1];
        }
        for(int done = 1; done < k; ++done){
            dp[i][done + 1][0] += 9 * dp[i-1][done][0];
            if(n[i-1]!='0')
            dp[i][done + 1][0] += (n[i-1]-'0'-1) * dp[i-1][done][1];
            if(n[i-1]!='0')
            dp[i][done + 1][1] += dp[i - 1][done][1];
        }
    }
//    cout << len(n) << ' ' << N << endl;
//    cerr << answer << endl;
//    cerr << dp[len(n)][k][1] << ' ' << dp[len(n)][k][0];
    answer += dp[len(n)][k][0] + dp[len(n)  ][k][1];
    cout << answer;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;


class Main
{

	public static void main (String[] args) throws java.lang.Exception
	 {
		InputStreamReader is = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(is);
		Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        if (a < b) {
        	System.out.println("a < b");
        }else if (a > b) {
        	System.out.println("a > b");
        }else if ( a == b) {
        	System.out.println("a == b");
        }
        scan.close();






	 }
}


Measured memory_bytes: 26220
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <set>
#include <algorithm>

typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL<<60;
const double PI=3.14159265358979323846;
const int NMAX=100005;
using namespace std;

int main(){
    ll n,m;
    cin >> n >> m;
    vector<int> to[n+1];
    for(int i = 0; i < m; i++){
        int a,b;
        cin >> a >> b;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    ll mp[n+1];
    ll pre[n+1];
    for(int i = 0; i <= n; i++){
        mp[i] = -1;
    }
    priority_queue<pair<ll,pair<int,int> >, vector<pair<ll,pair<int,int>> >, greater<pair<ll,pair<int,int>> > > q;
    q.push(make_pair(0,make_pair(1,0)));
    while(q.size() > 0){
        auto tmp = q.top();
        q.pop();
        ll w = tmp.first;
        int node = tmp.second.first;
        int p_node = tmp.second.second;
        if(mp[node] != -1) continue;
        mp[node] = w;
        pre[node] = p_node;
        for(int i = 0; i < to[node].size(); i++){
            if(mp[to[node][i]] == -1){
                q.push(make_pair(w+1,make_pair(to[node][i],node)));
            }
        }
    }

    bool ans = true;
    for(int i = 2; i <= n; i++){
        if(mp[i] == -1){
            ans = false;
            break;
        }
    }
    if(ans){
        cout << "Yes" << endl;
        for(int i = 2; i <= n; i++){
            cout << pre[i] << endl;
        }
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 13044
#include <bits/stdc++.h>
#define rep(i,a,b) for(auto i=(a);i<(b);i++)
#define per(i,a,b) for(auto i=(a);i>=(b);i--)
#define Min(a,b) ((a) < (b) ? (a) : (b))
#define Max(a,b) ((a) > (b) ? (a) : (b))
#define int_inf 0x3f3f3f3f
#define int_max 2147483647
#define ll_max 9223372036854775807
#define ull_max 18446744073709551615
#define ll_inf 0x7f7f7f7f7f7f7f7f
#define lowbit(x) (x)&(-x)
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define eps 1e-8
#define all(v) (v.begin(),v.end())
#define db double
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const double pi=acos(-1.0);
const double inf = 1e100;
template<class T>
inline T read()
{
	T x=0,f=1;char s=getchar();
	while(s<'0'||s>'9') {if(s=='-')f=-1;s=getchar();};
	while(s>='0'&&s<='9'){x=(x<<3)+(x<<1)+s-48;s=getchar();};
	return x*f;
}
template<typename T>
inline void wri(T x)
{
	if(x<0){x=-x;putchar('-');};
	if(x/10) wri(x/10);
	putchar(x%10+48);
}
template<typename T>
inline void print(T x,char s)
{
	wri(x);
	putchar(s);
}
template<typename T>
T gcd(T a,T b)
{
	return b==0?a:gcd(b,a%b);
}
//关闭流同步就不能手写读入优化啦
ll ans;
int n;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cin>>n;
    rep(i,1,n+1){
    	ans+=1ll*(n-i+1)*i;
	}
	rep(i,1,n){
		int a,b;
		cin>>a>>b;
		if(a>b)swap(a,b);
		ans-=1ll*a*(n-b+1);
	}
	cout<<ans;
    return 0;
}



Measured memory_bytes: 3608
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

u=input().rstrip().split(" ")
print("A"+u[1][0]+"C")

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

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

using ll = long long;
using ull = unsigned long long;

int main() {
  string s;
  int a[26] = {0};
  while(cin >> s) {
    transform(s.begin(), s.end(), s.begin(), ::tolower);
    rep(i, s.size()) a[s[i] - 'a']++;
  }
  rep(i, 26) cout << (char)('a' + i) << " : " << a[i] << endl;
  return 0;
}



Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/range/adaptor/reversed.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define dumppairs(x) cerr << #x ; for(auto elem: x){cerr << "(" << elem.first << " " << elem.second << ") ";} cerr << endl;
#define dumpline cerr << "**********************" << endl;
#define dumpwline(x) cerr << "******** " << #x << "=" << (x) << " ********" << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))


int main(void){
    string s; cin >> s;
    for (auto &c: s){
        if (c == '1'){
            c = '9';
        } else if (c == '9'){
            c = '1';
        }
    }
    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define int long long
 
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define pb push_back
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
 
struct edge{
    int to,cap,cost,rev;
    edge(int to,int cap,int cost,int rev):to(to),cap(cap),cost(cost),rev(rev){}
};
 
const int INF=1001001001;
const int MAX_V=300;
int src=MAX_V-2,snk=MAX_V-1;
 
vector<edge>G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V],preve[MAX_V];
 
void add_edge(int from,int to,int cap,int cost){
    G[from].pb(edge(to,cap,cost,G[to].size()));
    G[to].pb(edge(from,0,-cost,G[from].size()-1));
}
 
int min_cost_flow(int s,int t,int f){
    int res=0;
    while(f>0){
        fill(dist,dist+MAX_V,INF);
        dist[s]=0;
        bool update=true;
        while(update){
            update=false;
            for(int v=0;v<MAX_V;v++){
                if(dist[v]==INF)continue;
                for(int i=0;i<G[v].size();i++){
                    edge &e=G[v][i];
                    if(e.cap>0&&dist[e.to]>dist[v]+e.cost){
                        dist[e.to]=dist[v]+e.cost;
                        prevv[e.to]=v;
                        preve[e.to]=i;
                        update=true;
                    }
                }
            }
        }
        if(dist[t]==INF)return -1;
 
        int d=f;
        for(int v=t;v!=s;v=prevv[v]){
            d=min(d,G[prevv[v]][preve[v]].cap);
        }
        f-=d;
        res+=d*dist[t];
        for(int v=t;v!=s;v=prevv[v]){
            edge &e=G[prevv[v]][preve[v]];
            e.cap-=d;
            G[v][e.rev].cap+=d;
        }
    }
    return res;
}
 
const int C=100000;
int N,M,K;
int a[111],b[111][111];
int T[111];
 
signed main(){
    cin>>N>>M>>K;
    K=N-K;
    rep(i,N)cin>>a[i];
    rep(i,M)rep(j,N)cin>>b[i][j];
    rep(i,M)cin>>T[i];
 
    add_edge(src,snk,K,C);
 
    rep(i,M)add_edge(src,i,T[i],0);
    rep(i,M)rep(j,N){
        int tmp=b[i][j]-a[j];
        add_edge(i,j+M,1,C-tmp);
    }
    rep(j,N)add_edge(j+M,snk,1,0);
 
    int ans=min_cost_flow(src,snk,K);
    cout<<-ans+K*C+accumulate(a,a+N,0ll)<<endl;
    return 0;
}

Measured memory_bytes: 3884
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
 
    String s = sc.next();
 String[]ss = s.split("");
 sc.close();
 int r = 0; int b =0;
 for(int i=0; i<n; i++) {
	 if(ss[i].equals("R")) {r++;}
	 else if(ss[i].equals("B")) {b++;}
 }


  if(r>b) {System.out.println("Yes");}
  else {System.out.println("No");}
 
    		}
}


Measured memory_bytes: 21844
use std::io::*;
use std::str::FromStr;

fn main() {
    let n: usize = read();

    let mut x: Vec<i64> = Vec::new();
    let mut y: Vec<i64> = Vec::new();
    for i in 0..n {
        let xi: i64 = read();
        let yi: i64 = read();
        x.push(xi);
        y.push(yi);
    }

    let mut ans = n;
    for i in 0..n {
        let sx = x[i];
        let sy = y[i];
        for j in 0..n {
            if i == j {
                continue;
            }
            let dx = sx - x[j];
            let dy = sy - y[j];

            let mut uf = UnionFind::new(n);
            for k in 0..n {
                for l in 0..n {
                    if k == l {
                        continue;
                    }
                    if x[k] - x[l] == dx && y[k] - y[l] == dy {
                        uf.unite(k, l);
                    }
                }
            }

            let mut cnt = 0;
            for k in 0..n {
                if !uf.check(k) {
                    cnt += 1;
                }
            }
            ans = std::cmp::min(ans, cnt);
        }
    }
    println!("{}", ans);
}

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

#[derive(Debug)]
struct UnionFind {
    used: Vec<bool>,
    par: Vec<usize>,
    rank: Vec<usize>,
}

impl UnionFind {
    fn new(n: usize) -> UnionFind {
        UnionFind {
            used: vec![false; n],
            par: (0..n).collect(),
            rank: vec![0; n],
        }
    }

    fn find(&mut self, x: usize) -> usize {
        let par = self.par[x];
        if par != x {
            self.par[x] = self.find(par);
        }
        self.par[x]
    }

    fn unite(&mut self, x: usize, y: usize) {
        let x = self.find(x);
        let y = self.find(y);
        if x == y {
            return;
        }

        let rx = self.rank[x];
        let ry = self.rank[y];
        if rx < ry {
            self.par[x] = y;
        } else {
            self.par[y] = x;
            if rx == ry {
                self.rank[x] += 1;
            }
        }
    }

    fn same(&mut self, x: usize, y: usize) -> bool {
        self.find(x) == self.find(y)
    }

    fn check(&mut self, x: usize) -> bool {
        let x = self.find(x);
        let po = self.used[x];
        self.used[x] = true;
        po
    }
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
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;
}


class osak{
    vector<long long> res;

    public:
    osak(long long n){//sieve(n),O(N);
        res=vector<long long>(n);
        iota(res.begin(), res.end(), 0);
        for (int i = 2; i*i < n; ++i) {
            if (res[i] < i) continue;
            for (int j = i*i; j < n; j += i)
            if (res[j] == j) res[j] = i;
        }
    }

    vector<long long> factor(int n) {//O(logN)
    // min_factor は sieve() で得られたものとする
        vector<long long> factor;
        while (n > 1) {
            factor.push_back(res[n]);
            n /= res[n];
            // 割った後の値についても素因数を知っているので順次求まる
        }
        return factor;
    }

    vector<long long> divisor(int N){//O(div.size())
        vector<long long> facs=factor(N);
        int n=facs.size();
        vector<long long> ret={1};
        for(int i=0;i<n;i++){
            int cnt=1,range=ret.size(),p=1;
            while(i+1<n&&facs[i]==facs[i+1]){
                cnt++;i++;
            }
            while(cnt--){
                p*=facs[i];
                for(int j=0;j<range;j++)ret.push_back(ret[j]*p);
            }
        }
        sort(ret.begin(),ret.end());
        return ret;
    }
};

int main(){
    ll n;cin >> n;
    ll ans=0;
    osak os(1000010);
    rep(i,n){
        ll c=i+1;
        ll p=n-c;
        if(p==0)continue;
        ans+=os.divisor(p).size();
    }
    cout << ans <<endl;
}

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void solve() {
  int n;
  cin >> n;
  cout << 48 - n << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


Measured memory_bytes: 3592
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N, M, C = map(int, readline().split())
  B = np.array(readline().split(), np.int64)
  A = list(list(map(int, readline().split()))for _ in range(N))
  A = np.array(A, np.int64)
  ABC = np.dot(A,B) + C
  print(np.where(ABC>0, 1, 0).sum())
  
  
  
  
if __name__ == '__main__':
  main()

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

int main(){
  int n;
  cin >> n;
  vector<int> vec;
  int tmp;
  for(int i=0; i<n; i++){
    cin >> tmp;
    vec.push_back(tmp);
  }
  int ans = 100000000;
  for(int i=-100; i<=100; i++){
    tmp = 0;
    for(auto v : vec){
      tmp += pow((v-i),2);
    }
    ans = min(ans,tmp);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
s = input()
lists = []
for i in s:
    lists.append(i)

preword = lists[0]
count = 0
for i in range(1,len(lists)):
    if lists[i] == preword:
        count += 1
        if lists[i] == "0":
            preword = "1"
        else:
            preword = "0"
    else:
        preword = lists[i]

print(count)

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

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

using namespace std;

using ll = long long;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

    ll result = 0;
    int first = 0;
    int last = 0;
    int x = 0;
    while (first < N) {
        while (last < N && ((x & A[last]) == 0)) {
            x ^= A[last++];
        }
        result += last - first;
        x ^= A[first++];
    }
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 1024
import copy
import math
import string
import heapq
import bisect
import sys
sys.setrecursionlimit(10**7)

A,B = map(int,input().split())
flag = 0
for i in range(100000):
    if(math.floor(i*0.08) == A and math.floor(i*0.1) == B):
        print(i)
        flag = 1
        break
if(flag == 0):
    print(-1)

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

using namespace std;

#define DUMP(x) std::cout << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++ i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define pb push_back

template<typename T> T DUP(T x, T y) { return (x + y - 1) / y; };
template <typename A, size_t N, typename T>
void arrayFill(A(&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using setint = unordered_set<int32_t>;
using setstr = unordered_set<string>;
using qint = queue<int32_t>;

constexpr std::int32_t INF = 1001001001;

void Main() {
    int n, i;
    cin >> n >> i;
    cout << n - i + 1 << endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pb push_back

# define inOut(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
# define RESET(a) memset(a,0,sizeof(a))
# define MEMO(a) memset(a,-1,sizeof(a))
# define DEBUG puts("Debug-Has-Come-Until-Here")


typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int main(){
	cin.tie(NULL);
	
	int a,b,c,d,e,f;
	double x,y;
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		//DEBUG;
		x = (double)(c*e - b*f)/(double)(a*e - b*d);
		y = (double)(c*d - a*f)/(double)(b*d - e*a);
		if (fabs(x) < 0.001) x = fabs(x);
		if (fabs(y) < 0.001) y = fabs(y);
		printf("%.3lf %.3lf\n", x,y);
	}

	return 0;
}

Measured memory_bytes: 3104
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	[ a, b ] <- readInts
	print $ maximum [ a + b, a - b, a * b ]

Measured memory_bytes: 380
#include <bits/stdc++.h>
#define scan(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
char _;
using namespace std;
int A,B,C,K;
double valueE(double d)
{
    return log(d);
}

int op(double a,double b)
{
// b needs to be bigger than a
    if(b>a)
        return 0;
    return floor(valueE(a/b)/valueE(2))+1;
}


int main()
{
    scan(A);
    scan(B);
    scan(C);
    scan(K);
    int tot=op(A,B);
    B*=(1<<tot);
    tot+=op(B,C);
    //cout<<tot<<endl;
    string out="Yes";
    if(tot>K)
    {
        out="No";
    }
    cout<<out<<endl;

}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
int n,k;
int arr[3][3];
bool found[3][3];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    for (int i=0;i<3;i++){
        for (int j=0;j<3;j++){
            cin>>arr[i][j];
        }
    }
    cin>>n;
    while (n--){
        cin>>k;
        for (int i=0;i<3;i++){
            for (int j=0;j<3;j++){
                if (arr[i][j]==k){
                    found[i][j]=true;
                }
            }
        }
    }
    for (int i=0;i<3;i++){
        bool lols=true;
        for (int j=0;j<3;j++){
            if (!found[i][j]) lols=false;
        }
        if (lols){
            cout<<"Yes";
            return 0;
        }
    }
    for (int i=0;i<3;i++){
        bool lols=true;
        for (int j=0;j<3;j++){
            if (!found[j][i]) lols=false;
        }
        if (lols){
            cout<<"Yes";
            return 0;
        }
    }
    if (found[1][1]){
        if (found[0][0] && found[2][2]){
            cout<<"Yes";
            return 0;
        }
        if (found[0][2] && found[2][0]){
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(){
	int a,b,area,perimeter;
	scanf ("%d %d",&a,&b);
	area = a*b;
	perimeter = (2*a)+(2*b);
	printf ("%d %d\n",area,perimeter);
	return 0;
}


Measured memory_bytes: 2076
#include<stdio.h>
#include<math.h>
long long int pwo(long long int x,long long int y)
{
    long long int i,a,mod = 1000000000 + 7;
    a = x;
    if(y == 0)
    {
        return 1;
    }
    for(i = 1 ; i < y ; i++)
    {
        x = x*a;
        x = x;
    }
    return x;
}
int main(void)
{
    long long int n,i,j,mod = 1000000000 + 7,sum = 0,x[200001],y[200001],d,count = 0;
    long  double a;
    scanf("%lld %lld",&n,&d);
    for(i = 0 ; i < n ; i++)
    {
        scanf("%lld %lld",&x[i],&y[i]);
        a = pow(x[i] * x[i] + y[i] * y[i],0.5);
        if(a <= d)
        {
            count++;
        }
    }
    printf("%lld\n",count);
    return 0;
}

Measured memory_bytes: 5760
#include <iostream>
#include <algorithm>
#include <vector>
#define WMAX 100
#define HMAX 1000
#define INF  9999999
using namespace std;

string M[HMAX];
int h;

int ha;
int hb;
int wa;
int wb;

bool visited[HMAX][WMAX];
int flag45_1, flag45_2;

class A {
public:
  int S;
  int N;
  A(int S, int N) {
    this->S = S;
    this->N = N;
  }
  bool operator <(const A &a) const {
    return S < a.S;
  }
};

void rec(int x, int y, int bi) {
  static int dx[8] = {1,1,0,-1,-1,-1, 0, 1};
  static int dy[8] = {0,1,1, 1, 0,-1,-1,-1};
  ha = min(ha, y);
  hb = max(hb, y);
  wa = min(wa, x);
  wb = max(wb, x);

  for(int i = 0; i < 8; i++) {
    int nx = x + dx[i];
    int ny = y + dy[i];
    if(ny < 0 || ny >= h) continue;
    if(nx < 0 || nx >= M[ny].length()) continue;

    if(visited[ny][nx]) continue;
    if(M[ny][nx] != '*') continue;
    visited[ny][nx] = true;
    if(i != bi) {
      if(i == 1 || i == 5) flag45_1++;
      if(i == 3 || i == 7) flag45_2++;
    }
    rec(nx, ny, i);
  }
}

void solve() {
  int cnt[WMAX*HMAX];
  int smax, smin;
  vector<A> V;
  smax = -INF;
  smin = INF;
  for(int i = 0; i < WMAX*HMAX; i++) cnt[i] = 0;
  for(int i = 0; i < HMAX; i++) {
    for(int j = 0; j < WMAX; j++) {
      visited[i][j] = false;
    }
  }

  for(int i = 0; i < h; i++) {
    for(int j = 0; j < M[i].length(); j++) {
      if(!visited[i][j] && M[i][j] == '*') {
	ha = wa = INF;
	hb = wb = -INF;
	flag45_1 = flag45_2 = 0;
	visited[i][j] = true;
	//cout << i << ", " << j << endl;
	rec(j, i, -1);
	//cout << "(" << ha << ", " << wa << ", " << hb << ", " << wb << ")";
	int nh = hb-ha+1;
	int nw = wb-wa+1;
	int S;
	S = nh * nw;
	//cout << nh << "*" << nw << "=" << S << endl;
	if(!flag45_1 && !flag45_2) {
	} else if(flag45_1 == 2 || flag45_2 == 2){
	  S -= (nh-1) * nh;
	} else if(flag45_1 && flag45_2) {
	  S -= (nh-1) * nh;
	} else if(flag45_1 + flag45_2 == 1) {
	  S -= (nh-1) * nh / 2;
	}
	cnt[S]++;
	smax = max(smax, S);
	smin = min(smin, S);
      }
    }
  }

 
  for(int i = smin; i <= smax; i++) {
    if(cnt[i]) {
      V.push_back(A(i, cnt[i]));
    }
  }

  sort(V.begin(), V.end());
  for(int i = 0; i < V.size(); i++) {
    cout << V[i].S << " " << V[i].N << endl;
  }
}

main() {
  bool first = true;
  while((cin >> h) && h != 0) {
    getchar();
    for(int i = 0; i < h; i++) {
      getline(cin, M[i]);
    }

    if(first) first = false;
    else      cout << "----------" << endl;

    solve();
  }
}

Measured memory_bytes: 0
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <sstream>
#include <string>
#include <climits>
#include <set>
#include <array>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <map>
#include <utility>
using namespace std;

int main()
{
    int s, w;
    cin >> s >> w;
    if (w >= s)
        cout << "unsafe";
    else cout << "safe";
}

Measured memory_bytes: 3568
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
template <class T> using vec = vector<T>;
using ll = long long;
using vi   = vec<int>;
using vvi  = vec<vi>;
using vvvi = vec<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int a, b; cin >> a >> b;
  int c = 1;
  int cnt = 0;
  while(c<b){
    c = c-1+a; cnt++;
  }
  cout << cnt << endl;
  return 0;
}


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

int main(){

    int n,x;
    cin >> n >> x;
    vector<int> l(n);
    rep(i,n){
        cin >> l[i];
    }

    int ans=0;
    int d=0;
    rep(i,n){
        if(d<=x){
            ans++;
        }
        d+=l[i];
    }
    if(d<=x){
        ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n==1){System.out.println(1);return;}
        String s = sc.next();
        int result = 1;
        char a = s.charAt(0);
        for(int i = 1;i<n;i++){
            if(a != s.charAt(i)){
                result++;
                a = s.charAt(i);
            }
        }
        System.out.println(result);
        sc.close();
    }
}

Measured memory_bytes: 25584
import java.util.Scanner;                      
                                               
 class Main {                                  
    public static void main(String[] args) {   
     Scanner scanner = new Scanner(System.in);      
     int a=0;
     int b=0;
    		 
     while(true){
    	    a = scanner.nextInt();
    	    b = scanner.nextInt();
    	    if ( a == 0 && b == 0 ) break;
            if(a<b)
    	    System.out.println(a+" "+b);
            else
            System.out.println(b+" "+a);
    	}

     scanner.close();
    }                                          
 }             


Measured memory_bytes: 36316
#include<bits/stdc++.h>
#define ipa pair<lld,lld>
#define lld long long int
#define x first
#define y second
#define ld long double
#define pb push_back
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PI (atan(1)*4)
#define mp make_pair
#define mlog 21
#define mod 1000000000
using namespace std;
const int maxn=1e6+2;
vector<lld> graph[maxn];
bool found[maxn];
lld parent[maxn],dp[maxn],ans;
void dfs(lld u)
{
	found[u]=true;
	vector<lld>::iterator it;
	for(it=graph[u].begin();it!=graph[u].end();++it)
	{
		if(!found[*it])
			dfs(*it);
		dp[u]=max(dp[*it]+1,dp[u]);
	}
	if(graph[u].size()==0)
		dp[u]=1;
}
main()
{
	fastread;
	lld i,j,n,m;
	cin>>n>>m;
	for(i=1;i<=m;++i)
	{
		lld u,v;
		cin>>u>>v;
		graph[u].push_back(v);
	}
	for(i=1;i<=n;++i)
	{
		if(!found[i])
		{
			dfs(i);
		}
	}
	for(i=1;i<=n;++i)
	{
	//	cout<<dp[i]<<" ";
		ans=max(dp[i],ans);
	}
	cout<<ans-1;
}

Measured memory_bytes: 31232
#include <iostream>
#include <algorithm>
#include <vector>


using namespace std;


void security()
{
  string s;
  cin >> s;

  for (int i = 1; i < s.size(); ++i)
  {
    if (s[i - 1] == s[i])
    {
      cout << "Bad\n";
      return;
    }
  }
  cout << "Good\n";
}


void fifty_fify()
{
  string s;
  cin >> s;

  sort(s.begin(), s.end());

  if (s[0] == s[1] && s[1] != s[2] && s[2] == s[3]) cout << "Yes\n";
  else cout << "No\n";
}


void dodecagon()
{
  int r;
  cin >> r;

  cout << 3 * r * r << "\n";
}


void harmony()
{
  int a, b;
  cin >> a >> b;

  if (a % 2 == b % 2) cout << (a + b) / 2 << "\n";
  else cout << "IMPOSSIBLE\n";
}


void transfer()
{
  int a, b, c;
  cin >> a >> b >> c;

  cout << max(0, c - (a - b)) << "\n";
}


void A_137()
{
  int a, b;
  cin >> a >> b;

  cout << max(a + b, max(a - b, a * b)) << "\n";
}


void red_or_not()
{
  int a;
  cin >> a;
  string s;
  cin >> s;

  if (a >= 3200) cout << s << "\n";
  else cout << "red\n";
}



int main()
{
  //security();
  //fifty_fify();
  //dodecagon();
  //harmony();
  //transfer();
  //A_137();
  red_or_not();
}

Measured memory_bytes: 256
n, m, l = map(int, input().split())
A = [list(map(int, input().split())) for i in range(n)]
B = [list(map(int, input().split())) for i in range(m)]
for ARow in A:
    result = []
    for BCol in zip(*B):
        result.append(sum([ARow[i] * BCol[i] for i in range(m)]))
    print(*result)

Measured memory_bytes: 8716
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>
using namespace std;
#define INF 1000000007
#define ll long long
#define rep(i, start, end) for(ll i=(ll)start; i<(ll)end; i++)
#define print(a) cout << a << endl;
#define printarray(a, len) rep(i,0,len) cout << a[i] << " ";

int main(){
  ll n, d, ans;
  cin >> n >> d;
  ans = n % (2*d+1) == 0 ? n / (2*d+1) : n / (2*d+1) + 1;
  print(ans);
  
  return 0;
}

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

int main() {
   int A, B;
   cin >> A >>B;
   int plague_count = A;
   int count = 1;

   if(B <= 1) {
      cout << 0 << endl;
      return 0;
   }

   for(;;) {
      if(plague_count >= B) {
         cout << count << endl;
         return 0;
      }
      plague_count += A-1;
      count++;
   }

}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x)  cout << #x << " = " << (x) << endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  string s,t; cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end(), greater<char>());
  COUT(s < t ? "Yes" : "No");

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

ll modpow(ll a,ll b,ll c){
  ll res=1;
  while(b>0){
    if(b&1) res=mod(res*a,c);
    a=mod(a*a,c);
    b>>=1;
  }
  return res;
}

int main() {
  int n,m,x;
  cin>>n>>m>>x;
  int c[n],a[n][m];
  for(int i=0;i<n;i++){
    cin>>c[i];
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  bool ans=false;
  int cnt=10000000;
  for(int bit=0;bit<(1<<n);bit++){
    vector<int>S;
    for(int i=0;i<n;i++){
      if(bit&(1<<i)) S.push_back(i);
    }
    int b[m];
    for(int i=0;i<m;i++) b[i]=0;
    for(int i=0;i<S.size();i++){
      for(int j=0;j<m;j++){
        b[j]+=a[S[i]][j];
      }
    }
    bool temp=true;
    for(int i=0;i<m;i++){
      if(b[i]<x) temp=false;
    }
    if(!temp)continue;
    else {
      ans=true;
      int res=0;
      for(int i=0;i<S.size();i++){
        res+=c[S[i]];
      }
      cnt=min(res,cnt);
    }
  }
  if(ans) cout<<cnt<<endl;
  else cout<<-1<<endl;
  return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    char x,y;
    cin>>x>>y;
    if(x<y)cout<<"<"<<endl;
    else if(x>y)cout<<">"<<endl;
    else cout<<"="<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <cmath>

#define rep(i,b,e) for (int (i) = (b); (i) < (e); (i)++)
typedef long long ll;


int vector_finder(std::vector<int> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
} 

using namespace std;

int main() {
    ll H, W;
    cin >> H >> W;

    vector<string> a(H);

    rep(i,0,H) {
        cin >> a[i];
    }

    // 行の削除
    vector<int> del_row;
    rep(i,0,H) {
        bool all_white = true;
        rep(j, 0, W) {
            //cout << a[i][j] << endl;
            if (a[i][j] == '#') {
                all_white = false;
                break;
            }
        }
        if (all_white) del_row.push_back(i);
    }

    // 列の削除
    vector<int> del_col;
    rep(j,0,W) {
        bool all_white = true;
        rep(i, 0, H) {
            //cout << a[i][j] << endl;
            if (a[i][j] == '#') {
                all_white = false;
                break;
            }
        }
        if (all_white) del_col.push_back(j);
    }

    rep(i, 0 , H) {
        if (vector_finder(del_row, i)) continue;
        rep(j, 0 , W) {
            if (vector_finder(del_col, j)) continue;
            cout << a[i][j];
        }
        cout << endl;
    }

}

Measured memory_bytes: 256
a=[1]
b=[1]
for i in range(50):
    a.append(3+2*a[-1])
    b.append(1+2*b[-1])
def paty(n,x):
    if n==1:return 'bpppb'[-x:].count('p')
    if x==a[n]:return b[n]
    if x==1:return 0
    if x==a[n]//2+1: return b[n-1]+1
    if x<a[n]//2+1: return paty(n-1,x-1)
    if x>a[n]//2+1: return b[n-1]+1+paty(n-1,x-a[n]//2-1)
n,x=map(int, input().split())
print(paty(n,x))

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int prime[55555];
bool is_prime[55556];

int main(void) {
    int p = 0;
    for (int i = 0; i <= 55555; ++i) {
        is_prime[i] = true;
    }
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i <= 55555; ++i) {
        if (is_prime[i]) {
            prime[p++] = i;
            for (int j = 2 * i; j <= 55555; j += i) {
                is_prime[j] = false;
            }
        }
    }

    int N;
    cin >> N;
    int pos = 0;
    for (int i = 0; i < N; ++i) {
        if (i != 0) {
            cout << " ";
        }
        while (prime[pos] % 5 != 1) {
            pos++;
        }
        cout << prime[pos];
        pos++;
    }
    return 0;
}

Measured memory_bytes: 384
//IN THE NAME OF GOD;
//Test By Dev-C++5.11
#include<bits/stdc++.h>
#define ll  long long
#define isc ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define ld long double
#define ss string
#define ww while
#define vl vector<ll>
#define pb push_back
#define in insert
#define itr iterator
#define gt goto
#define rep(i,n,j) for(ll i=n;i<j;i++)
#define tep(i,n,j) for(ll i=n;i>=j;i--)
#define co(n) cout << n ;
#define pll pair<ll,ll>
#define bft bool f=true
#define bff bool f=false
using namespace std;

ll bmm(ll a, ll b) {
	if (b == 0) return a;
	else return bmm(b, a%b);
}
ll kmm(ll a, ll b) {
	return(a*b) / bmm(a, b);
}


const ll mod = 1e9 + 7;
const ll MAXN = 3e5+5;

ll n;ld a,b;ss s;
int main() {
	isc;
	cin >> n;
	a=n;
	if(n%2==0)
		cout <<0.5000000000;
	else {
		n/=2;
		n++;
		b=n;
		s=to_string(b/a);
		cout << s;
	} 
	return 0;
}



Measured memory_bytes: 256