akhauriyash/Code-Regression huggingface dataset:
/*																													   
 Templatka c++ Kacper Fis																							   																											   //
*/																													  																						   
#include <bits/stdc++.h>																							   
																													   
using namespace std; 																								   
																													   
const int INF = 1000000001;																						   
const float PI = 3.14;	
const int mod = 1e9+7;																							   
typedef long long LL;																								   
																													   
typedef vector<int> vi;																								   
typedef list<int> li;																								   
typedef queue<int> qi; 																								   
typedef pair<int,int> ii; 																							   
typedef map<string,int> msi; //np msi['nazwa'] = 'liczba'															   
typedef vector<ii> vii; //vector par<int>, do tworzenia tablicy dla grafów wagowych #dijkstra #Bellman_Ford			   
typedef priority_queue< ii, vector<ii>, greater<ii> > pq; //kolejka priorytetowa vectorów par(top()=min) #dijkstra																													   																				   list<int>::iterator it;																								   
																				   
vector<ii>::iterator iter;																							   
																													   																				   
#define print_list(x) for(it = (x).begin(); it != (x).end(); it++) {cout << *it << " ";}							   
#define print_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++) {cout << *it2 << " ";}						   
#define search_list(x) for(it = (x).begin(); it != (x).end(); it++)													   
#define search_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++);											   
#define pb(x) push_back(x) 																							   
#define pf(x) push_front(x)																							   
#define mp(x, y) make_pair(x, y)                                                                                       
///////////////////////////////////////////////GLOBAL DEFINITIONS//////////////////////////////////////////////////////


///////////////////////////////////////////////FUNCTIONS/////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////MAIN////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])																					 
{ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);                  												       
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	int tab[1005];
	for(int i = 0; i < 3; i++){
		cin >> tab[i];
	}
	
	sort(tab, tab+3);
	cout << abs(tab[0] - tab[2]) << endl;
	
	
	
	
	
	

						
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <set>
 
using namespace std;
 
typedef long long int ll;
typedef pair<int, int> Pii;
 
const ll mod = 1000000007;
 
struct segtree {
  int n;
  vector<int> data;
 
  segtree(const int s) {
    init(s);
  }
 
  segtree(const int s, const int u) {
    init(s);
    for (int i = 0; i < s; i++) {
      data[i+n-1] = u;
    }
    for (int i = n-2; i >= 0; i--) {
      data[i] = min(data[i*2+1], data[i*2+2]);
    }
  }
 
  segtree(const vector<int> &v) {
    int s = v.size();
    init(s);
    for (int i = 0; i < s; i++) {
      data[i+n-1] = v[i];
    }
    for (int i = n-2; i >= 0; i--) {
      data[i] = 0;
    }
  }
 
  void init(const int s) {
    n = 1;
    while (n < s) n <<= 1;
    data = vector<int>(2*n-1);
  }
 
  void update(int x, int v) {
    int p = x + n - 1;
 
    // update bottom
    data[p] = v;
 
    // update rest
    while (p > 0) {
      p = (p - 1) >> 1;
      data[p] = min(data[p*2+1], data[p*2+2]);
    }
  }
 
  int query(int l, int r, int p = 0, int a = 0, int b = -1) {
    if (b < 0) b = n; // init
    if (r <= a || b <= l) return 0x7fffffff; // out of range
 
    if (l <= a && b <= r) return data[p];// fully covered
 
    int vl = query(l, r, p*2+1, a, (a + b) / 2); // left
    int vr = query(l, r, p*2+2, (a + b) / 2, b); // right
    return min(vl, vr);
  }
};
 
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
 
  int h, w;
  cin >> h >> w;
  vector<Pii> ab(h);
  for (auto &x: ab) {
    cin >> x.first >> x.second;
    x.first--;
    x.second--;
  }
 
  segtree st(w+1, 0);
  set<int> relevant;
  for (int i = 0; i < w; i++) relevant.insert(i);
 
  vector<int> ans(h);
  for (int i = 0; i < h; i++) {
    auto it = relevant.lower_bound(ab[i].first);
    if (it != relevant.end()) {
      int next_blocked = *it;
      int minimum_move = 1000000007;
      while (next_blocked <= ab[i].second) {
        minimum_move = min(minimum_move, ab[i].second - next_blocked + st.query(next_blocked, next_blocked+1) + 1);
        st.update(next_blocked, 1000000007);
        it = relevant.erase(it);
        if (it != relevant.end()) next_blocked = *it;
        else break;
      }
      st.update(ab[i].second+1, min(st.query(ab[i].second+1, ab[i].second+2), minimum_move));
      if (ab[i].second+1 < w && st.query(ab[i].second+1, ab[i].second+2) < 1000000007) relevant.insert(ab[i].second+1);
    }
    ans[i] = st.query(0, w) + i + 1;
    if (ans[i] >= 1000000007) ans[i] = -1;
  }
 
  for (auto &x: ans) cout << x << endl;
 
  return 0;
}

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

int main(void){
  	int N;
  	vector<double> x;
  	vector<string> u;
  	//input 
  	cin >> N;
  	for(int i=0; i<N; i++){
   		double tmp_x;
      	string tmp_u;
      	cin >> tmp_x >> tmp_u;
      	x.push_back(tmp_x);
      	u.push_back(tmp_u);
    }
  	double ans = 0;
  	for(int i=0; i<N; i++){
    	if(u[i] == "BTC"){
        	ans += x[i]*380000.0;
        }else{
          	ans += x[i];
        }
    }
  
  	//compute
  	//output
  	cout << ans << endl;
  	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <complex>
#include <cmath>
#include <algorithm>
using namespace std;

typedef complex<double> P;
const int MAX_N = 59;
int N;
double SX, SY, GX, GY;
double minx[MAX_N], maxx[MAX_N], miny[MAX_N], maxy[MAX_N], hs[MAX_N], ds[MAX_N];
P S, G;

const double EPS = 1e-12;

double sq(double x){ return x*x; }

int sig(double a){
	return a==0?0:a>0?1:-1;
}

double iprod(P p1, P p2){
	return (p1.real()*p2.real()) + (p1.imag()*p2.imag());
}

double oprod(P p1, P p2){
	return (p1.real()*p2.imag()) - (p1.imag()*p2.real());
}

double disLP(P p1, P p2, P q){
	return abs( oprod( (p2-p1), (q-p1) ) ) / abs(p2-p1);
}

double disSP(P p1, P p2, P q){
	if(iprod( (p2-p1), (q-p1) ) < 0) return abs(q-p1);
	if(iprod( (p1-p2), (q-p2) ) < 0) return abs(q-p2);
	return disLP(p1, p2, q);
}

bool crsSS(P p1, P p2, P q1, P q2){
	if(max(p1.real(), p2.real()) + EPS < min(q1.real(), q2.real())) return false;
	if(max(q1.real(), q2.real()) + EPS < min(p1.real(), p2.real())) return false;
	if(max(p1.imag(), p2.imag()) + EPS < min(q1.imag(), q2.imag())) return false;
	if(max(p1.imag(), p2.imag()) + EPS < min(q1.imag(), q2.imag())) return false;
	return sig(oprod(p2-p1, q1-p1)) * sig(oprod(p2-p1, q2-p1)) < EPS
		&& sig(oprod(q2-q1, p1-q1)) * sig(oprod(q2-q1, p2-q1)) < EPS;
}


bool init(){
	for(int i=0; i<N; i++){
		if(crsSS(S,G,P(minx[i],miny[i]),P(minx[i],maxy[i])) ||
			crsSS(S,G,P(minx[i],miny[i]),P(maxx[i],miny[i])) || 
			crsSS(S,G,P(maxx[i],maxy[i]),P(minx[i],maxy[i])) || 
			crsSS(S,G,P(maxx[i],maxy[i]),P(maxx[i],miny[i]))){
			return false;
		}
		if(minx[i] <= SX && SX <= maxx[i] && miny[i] <= SY && SY <= maxy[i]){
			return false;
		}
		if(minx[i] <= GX && GX <= maxx[i] && miny[i] <= GY && GY <= maxy[i]){
			return false;
		}
	}

	for(int i=0; i<N; i++){
		ds[i] = 1e10;
		ds[i] = min(ds[i], disSP(S,G,P(minx[i],miny[i])));
		ds[i] = min(ds[i], disSP(S,G,P(minx[i],maxy[i])));
		ds[i] = min(ds[i], disSP(S,G,P(maxx[i],miny[i])));
		ds[i] = min(ds[i], disSP(S,G,P(maxx[i],maxy[i])));

		ds[i] = min(ds[i], disSP(P(minx[i],miny[i]),P(minx[i],maxy[i]),S));
		ds[i] = min(ds[i], disSP(P(minx[i],miny[i]),P(maxx[i],miny[i]),S));
		ds[i] = min(ds[i], disSP(P(maxx[i],maxy[i]),P(minx[i],maxy[i]),S));
		ds[i] = min(ds[i], disSP(P(maxx[i],maxy[i]),P(maxx[i],miny[i]),S));

		ds[i] = min(ds[i], disSP(P(minx[i],miny[i]),P(minx[i],maxy[i]),G));
		ds[i] = min(ds[i], disSP(P(minx[i],miny[i]),P(maxx[i],miny[i]),G));
		ds[i] = min(ds[i], disSP(P(maxx[i],maxy[i]),P(minx[i],maxy[i]),G));
		ds[i] = min(ds[i], disSP(P(maxx[i],maxy[i]),P(maxx[i],miny[i]),G));
	}

	return true;
}

bool check(double r){
	for(int i=0; i<N; i++){
		if(ds[i] < sqrt(sq(r) - sq(r-min(r,hs[i])))){
			return false;
		}
	}
	return true;
}

double solve(){
	if(!init()){
		return 0;
	}
	double low = 0.0, high = 1009;
	for(int i=0; i<100; i++){
		double mid = (low + high)*0.5;
		if(check(mid)) low = mid;
		else high = mid;
	}
	return low;
}

int main(){
	while(scanf("%d",&N),N){
		scanf("%lf%lf%lf%lf",&SX,&SY,&GX,&GY);
		S = P(SX,SY); G = P(GX,GY);
		for(int i=0; i<N; i++){
			scanf("%lf%lf%lf%lf%lf",minx+i,miny+i,maxx+i,maxy+i,hs+i);
		}
		printf("%.7f\n",solve());
	}
	return 0;
}

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

int main()
{
	int n;
	cin >> n;
	int H[100001];
	for (int i = 0; i < n; ++i)
	{
		cin >> H[i];
	}
	int ans = 1;
	int ma = 1;
	int now = H[0];
	for (int i = 1; i < n; ++i)
	{
		ans = (now >= H[i]?ans + 1:1);
		ma = max(ans, ma);
		now = H[i];
	}
	cout << ma - 1 << endl;
	return 0;
}

Measured memory_bytes: 640
def sum_of_digits(n):
    sum = 0
    while(n>0):
        #一の位から切り出していく
        sum += n % 10
        n //= 10
    return sum

N,A,B = map(int,input().split())

total = 0
for i in range(1,N+1):
    sum = sum_of_digits(i)
    if A <= sum <= B:
        total += i

print(total)


Measured memory_bytes: 39536
let () = Scanf.scanf "%d %d %d" @@ fun a b k ->
  let rec loop i count =
    let cond = a mod i = 0 && b mod i = 0 in
    match (cond, (count = k - 1)) with
    | (true, true) -> i
    | (true, false) -> loop (i - 1) (count + 1)
    | _ -> loop (i - 1) count
  in
  let ans = loop a 0 in
  Printf.printf "%d\n" ans

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

#define FOR(i,a,n) for (int i = a; i < (int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define whole(f,x,...) ([&](decltype((x)) whole) { \
    return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
template<typename T> bool chmin(T &a, const T &b) {if (a > b) { a = b; return true; }return false;}
template<typename T> bool chmax(T &a, const T &b) {if (a < b) { a = b; return true; }return false;}

using ll = int_fast64_t;

constexpr ll INF = (1e9);
constexpr ll MOD = (1e9+7);

int main() {
  int n; cin >> n;
  vector<int> t(n+1, 0), x(n+1, 0), y(n+1, 0);
  REP(i,n) cin >> t[i+1] >> x[i+1] >> y[i+1];
  bool f = true;
  FOR(i,1,n+1) {
    int d = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1]);
    if (t[i]-t[i-1] < d || d%2 != (t[i]-t[i-1])%2) {
      f = false; break;
    }
  }
  if (f) cout << "Yes" <<endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 1408
// In the name of GOD
#include<bits/stdc++.h>
using namespace std;

#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";

#define     IOS         ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define 	setprecn(x) cout<<fixed<<setprecision(x);
#define 	ll          long long int
#define 	pb          push_back
#define 	pll         pair<ll,ll>
#define 	vll         vector<ll>
#define 	ff          first
#define 	ss          second
#define 	all(a)      (a).begin(),(a).end()
#define 	sz(x)       (ll)x.size()
#define 	mod         1000000007
#define 	inf         10000000000000007
#define 	rep(i,n)    for(ll i=0;i<n;i++)
#define 	repe(i,a,b) for(ll i=a;i<b;i++)
#define 	lbnd        lower_bound
#define 	ubnd        upper_bound
#define 	bs          binary_search

ll power(ll a,ll b,ll m=mod)
{
	if(b==0)
		return 1;
	if(b==1)
		return a;
	ll c=power(a,b/2,m);
	if(b%2==0)
		return((c%m)*(c%m))%m;
	return ((((c%m)*(c%m))%m)*(a%m))%m;
}
/********************************************************/
//	d.erase(unique(all(d)), d.end());



int main()
{
	IOS;
	ll n,k,m,i,j,c=0,cs=0,t;
	t=1;

	// cin>>t;
	string s;
	while(t--)
	{
		cin>>n>>m;
		// n=s.length();
		// ll a[n];
		c=n*m;
		cout<<c;

		
		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 3616
import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

k = int(input())
s = input()

tmp = 0
res = 0

if len(s) <= k:
    res = s
else:
    res = s[:k] + "..."

print(res)


Measured memory_bytes: 31008
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x, acc=100, i;
int y=0;
int main() {
	cin >> x;
  	while (acc<x) {
       	y++;
      	i=acc/100;
      	acc+=i;
       //cout << y << " " << acc << "\n";
    }
  	cout << y;
}

Measured memory_bytes: 3636
// in the name of Allah
// and begin ... 

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int cnt[100011];
	memset(cnt, 0, sizeof cnt);
	int n, x;
	cin >> n;
	for(int i=0; i<n; i++) {
		cin >> x;
		cnt[x++]++;
		cnt[x++]++;
		cnt[x]++;
	}
	int mx = 0;
	for(int i=0; i<100011; i++) mx = max(mx, cnt[i]);
	cout << mx;
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
int main(){
    int i[2]={0,0};
    std::cin>>i[0]>>i[1];
    if(i[0]%3==0)printf("Possible");
    else if(i[1]%3==0)printf("Possible");
    else if((i[0]+i[1])%3==0)printf("Possible");
    else printf("Impossible");
    return 0;
}

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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

bool IsPrime(ll num)
{
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  ld sqrtNum = sqrt(num);
  for (ll i = 3; i <= sqrtNum; i += 2)
  {
    if (num % i == 0)
      return false;
  }
  return true;
}

//実行部
void Main()
{
  ll n, m; cin >> n >> m;
  ll ans = 0;
  for(ll i = 2;i * 10 <= m&&i <= 9;i++)
  {
    for(ll j = 2;i * 10 + j <= m&&j <= 9;j++)
    {
      if(i * j <= n)
      {
        ans++;
      }
    }
  }
  fin(ans);
}
//前処理
int main()
{
  ifstream in("text.txt");
  cin.rdbuf(in.rdbuf());
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      string S;
      cin >> S;
      
      if(S.at(S.size()-1)=='s'){
        cout << S << "es" << endl;
      }else{
        cout << S << "s" << endl;
      }
      
    }

Measured memory_bytes: 3624
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;;

public class Main{
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		
		int N=sc.nextInt();
		int[] W=new int[N];
		for(int i=0;i<N;i++) {
			W[i]=sc.nextInt();
		}
		int min=0;
		
		
		
		for(int i=1;i<N;i++) {
			int S1=0;
			int S2=0;
			
			for(int j=0;j<i;j++) {
				S1+=W[j];
			}
			
			for(int k=i;k<N;k++) {
				S2+=W[k];
			}
			
			
			if(i==1) {
				min=Math.abs(S2-S1);
			}else {
				if(Math.abs(S2-S1)<min) {
					min=Math.abs(S2-S1);
				}
			}
		}
		
		
		System.out.println(min);
		
		
		
	}

	
}

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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni(),k=ni(),arr[]=new int[n+1];
    	for(int i=1;i<=n;i++) arr[i]=ni()+1;

    	long sum=0l;

    	for(int i=1;i<=k;i++)
    		sum+=arr[i];
    	long res=sum;
    	for(int i=2;i<=n-k+1;i++){
    		sum=sum-arr[i-1]+arr[i+k-1];
    		res=Math.max(sum, res);
    	}

    	double pp=res/2.0d;
    	pn(pp);
    }


   	static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

    	//oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();  
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;



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

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
	
	
	

Measured memory_bytes: 43832
using System;

class Program
{
  static readonly int COUNTER_CLOCKWISE = 1;
  static readonly int CLOCKWISE = -1;
  static readonly int ONLINE_BACK = 2;
  static readonly int ONLINE_FRONT = -2;
  static readonly int ON_SEGMENT = 0;

  public class Vector
  {
    public double x, y;
    public Vector(double x, double y)
    {
      this.x = x;
      this.y = y;
    }

    public static Vector operator-(Vector v1, Vector v2)
    {

      return new Vector(v1.x-v2.x, v1.y-v2.y);
    }
  }
  public static double dot(Vector v1, Vector v2)
  {

    return v1.x*v2.x + v1.y*v2.y;
  }

  public static double cross(Vector v1, Vector v2)
  {

    return v1.x*v2.y - v1.y*v2.x;
  }

  public static double norm(Vector v)
  {

    return v.x*v.x + v.y*v.y;
  }

  public static int ccw(Vector p1, Vector p2, Vector p3)
  {
    Vector a = p2 - p1;
    Vector b = p3 - p1;
    if(cross(a, b) > Double.Epsilon) { return COUNTER_CLOCKWISE; }
    if(cross(a, b) < -Double.Epsilon) { return CLOCKWISE; }
    if(dot(a, b)< -Double.Epsilon) { return ONLINE_BACK; }
    if(norm(a) < norm(b)) { return ONLINE_FRONT; }
    return ON_SEGMENT;
  }

  public static void Main()
  {
    string[] s = Console.ReadLine().Split(' ');
    Vector v1 = new Vector(int.Parse(s[0]), int.Parse(s[1]));
    Vector v2 = new Vector(int.Parse(s[2]), int.Parse(s[3]));

    int n = int.Parse(Console.ReadLine());
    for(int i=0; i<n; i++)
      {
	string[] s1 = Console.ReadLine().Split(' ');
        Vector v = new Vector(int.Parse(s1[0]), int.Parse(s1[1]));

	int ans = ccw(v1, v2, v);
	if(ans == COUNTER_CLOCKWISE) {
	  Console.WriteLine("COUNTER_CLOCKWISE");
	}
	if(ans == CLOCKWISE) {
	  Console.WriteLine("CLOCKWISE");
	}
	if(ans == ONLINE_BACK){
	  Console.WriteLine("ONLINE_BACK");
	}
	if(ans == ONLINE_FRONT){
	  Console.WriteLine("ONLINE_FRONT");
	}
	if(ans == ON_SEGMENT){
	  Console.WriteLine("ON_SEGMENT");
	}
      }
  }
}

Measured memory_bytes: 8964
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#define ll long long
#define mod 998244353
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
int x[maxn],y[maxn],fa[maxn];
int n;
int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		x[i]=read(),y[i]=read();
	int ans=n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++)
				fa[k]=k;
			for(int k=1;k<=n;k++)
				for(int l=1;l<=n;l++)
					if(x[k]-x[l]==x[i]-x[j]&&y[k]-y[l]==y[i]-y[j])fa[find(k)]=find(l);
			int cnt=0;
			for(int k=1;k<=n;k++)
				if(fa[k]==k)++cnt;
			ans=std::min(ans,cnt);
		}
	writeln(ans);
	return 0;
}

Measured memory_bytes: 128
N=int(input())
A,B=map(int,input().split())
P=sorted(list(map(int,input().split())))
X=0
Y=0
Z=0
for i in range(N):
  if P[i]<=A:
    X+=1
  elif A+1<=P[i]<=B:
    Y+=1
  else:
    Z+=1
X=min(X,Y)
print(min(X,Z))

Measured memory_bytes: 61700
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#define PB push_back

const int MAX = 21000;
const int INF = 1<<29;
template<class T> int LIS(vector<T> a) {
    T dp[MAX];
    int n = a.size();
    for (int i = 0; i < n; ++i) dp[i] = INF;
    for (int i = 0; i < n; ++i) {
        *lower_bound(dp, dp + n, a[i]) = a[i];
    }
    return lower_bound(dp, dp + n, INF) - dp;
}

int n, k;
int a[MAX];

int main() {
	while (cin >> n >> k) {
		for (int i = 0; i < n; ++i) cin >> a[i], --a[i];

		int res = 1;
		for (int i = 0; i < n; ++i) {
			if (i >= 1) a[a[i-1]] += n;
			if (a[i] < i || a[i] >= n) continue;
			vector<int> vec;
			for (int j = i; j < a[i]; ++j) {
				if (a[i] > j && a[j] >= a[i]) vec.PB(a[j]);
			}
			int num = LIS(vec);
			chmax(res, num);
		}
		res += k;
		chmin(res, n/2);
		cout << res << endl;
	}
    return 0;
}


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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  if(abs(c-a)<=d || (abs(b-a)<=d && abs(c-b)<=d)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 888
import math
def ips():return input()
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

s=ips()
first=int(s[:2])
second=int(s[2:])
if first<=12 and second<=12 and first>0 and second>0:print("AMBIGUOUS")
elif first<=12 and first>0 :print("MMYY")
elif second<=12 and second>0:print("YYMM")
else:print("NA")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }

int main(){
  ll n,m,l; cin>>n>>m>>l;
  ll a[n][m]; CINA2(a,n,m);
  ll b[m][l]; CINA2(b,m,l);
  REP(i,n){
    REP(j,l){
      ll c=0;
      REP(k,m){
        c += a[i][k]*b[k][j];
      }
      if(j<l-1){ printf("%Ld ",c);}
      else{ printf("%Ld\n",c);}
    }
  }
}


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

int main(){
  int N,K;
  string S;
  cin >> N >> K >> S;

  if(S.at(K-1)=='A')
  S.at(K-1) = 'a';
  else if(S.at(K-1)=='B')
  S.at(K-1) = 'b';
  else if(S.at(K-1)=='C')
  S.at(K-1) = 'c';

  cout << S << endl;
}

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

#define pb push_back
#define mp make_pair
#define sqr(a) ((a) * (a)) 
#define io() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define co() cout.precision(10); 
#define F for(li i=0;i<n;i++)

typedef long long li;
typedef long double ld;

const li mod = 1000000007;
 
 
li mul(li a,li b) {
    return (1LL * a * b) % mod;
}
 
li add(li a,li b) {
    li s = (a+b);
    if (s>=mod) s-=mod;
    return s;
}
 
li sub(li a,li b) {
    li s = (a+mod-b);
    if (s>=mod) s-=mod;
    return s;
}
 
li po(li a,li deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    li t = po(a, deg/2);
    return mul(t, t);
}
 
li inv(li n)
{
    return po(n,mod-2);
}

int main()
{
    io();
    int t,cs=1;
    li a,b,c,k;
    cin>>a>>b>>c>>k;
    li ans=(a+b);
    if((a+b)>=k)
    {
        if(a>k)
        cout<<k;
        else cout<<a;
    }
    else 
    {
        
        cout<<(li)(a-(li)(k-(li)(a+b)));
    }
}
/*
      ███        ▄▄▄▄███▄▄▄▄   
▀█████████▄  ▄██▀▀▀███▀▀▀██▄ 
   ▀███▀▀██  ███   ███   ███ 
    ███   ▀  ███   ███   ███ 
    ███      ███   ███   ███ 
    ███      ███   ███   ███ 
    ███      ███   ███   ███ 
   ▄████▀     ▀█   ███   █▀  
   
   
   
   
 */

Measured memory_bytes: 3648
n=int(input())
p=[int(input()) for i in range(n)]
q=[0]*n

cnt=0
maxcnt=0


for i in range(n):
  q[p[i]-1]=i+1

for i in range(n-1):
  if q[i]<q[i+1]:
    cnt+=1
    maxcnt=max(maxcnt,cnt)
  else:
    cnt=0

print(n-maxcnt-1)

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

typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<int> A(N+1);
  vector<int> B(N);
  for(int i=0; i<N+1; i++) cin >> A[i];
  for(int i=0; i<N; i++) cin >> B[i];
  ll sum=0;
  for(int i=0; i<N; i++){
    if (B[i]<A[i]){
      sum+=B[i];
    }
    else if (B[i]>=A[i]){
      sum+=A[i];
      B[i]-=A[i];
      
      if(B[i]<A[i+1]){
        A[i+1]-=B[i];
        sum+=B[i];
      }
      else if(B[i]>=A[i+1]){
        sum+=A[i+1];
        A[i+1]=0;
      }
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 1024
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
a.sort(key=lambda x:(x[1],x[0])) 
t = 0
for s,b in a:
    t += s
    if t > b:
        print("No")
        break
else:
    print("Yes")

Measured memory_bytes: 66280
#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 vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;

int main() {
    int n;
    cin >> n;
    bool ans = false;
    for(int i =0; 4 * i <= n; i++) {
        for(int j =0; 7 * j <= n; j++) {
            if(4 * i + 7 * j == n) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    if(!ans) cout << "No" << endl;
}

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

int main() {
    string S;
    cin >> S;
    vector<int> num(3, 0);
    for (char c : S) {
        num[c - 'a']++;
    }

    for (int i = 0; i < 3; i++) {
        if (num[i] != 1) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
typedef long long int ll;
const int N=1e5+5,MAX=1e9+2;
int n,a[N],dp[N];
int main(){
    cin.tie(NULL);
    cout.tie(NULL);
    ios_base::sync_with_stdio(false);
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        dp[i]=MAX;
    }
    dp[0]=0;
    for(int i=0;i<n;i++){
        dp[i+1]=min(dp[i+1],dp[i]+abs(a[i]-a[i+1]));
        dp[i+2]=min(dp[i+2],dp[i]+abs(a[i]-a[i+2]));
    }
    cout<<dp[n-1]<<'\n';
    return 0;
}


Measured memory_bytes: 1024
/*
ID: tohoast1
TASK: gymnastics
LANG: C++
*/
#include <bits/stdc++.h>
#define speedup ios_base::sync_with_stdio(NULL)
#define fin freopen("gymnastics.in", "r", stdin)
#define fout freopen("gymnastics.out", "w", stdout)
#define FILENAME
#define PUBG push_back
#define p_b pop_back
#define mp make_pair
#define fi first
#define se second
#define cls clear
#define INF const int ci = 1e6 + 100
#define K_INF 1e9 + 7
#define time cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
#define MIN_INT -999999999
#define MOD 1000000007
#define d109 1000000000
#define basay break
#define bmbr exit(0)

using namespace std;
typedef long long LL;
typedef long L;
typedef unsigned long long ULL;
typedef unsigned long UL;
typedef string STR;
int a, b;
STR pm;

int main() {
    #ifdef FILENAMEs
        fin;
        fout;
    #endif // FILENAME
    cin >> a >> pm >> b;
    if (pm == "+") cout << a + b;
    else cout << a - b;
    ///time;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int A, B, K;
	cin >> A >> B >> K;

	for(int i = 0; i < K; i++){
		if(i % 2 == 0){
			if(A % 2 != 0){
				A--;
			}
			A /= 2;
			B += A;
		} else {
			if(B % 2 != 0){
				B--;
			}
			B /= 2;
			A += B;
		}
	}
	cout << A << " " << B << endl;

	return 0;
}

Measured memory_bytes: 256
n = gets.to_i
ary = gets.split.map(&:to_i)
ans = 0

(n - 1).times do |i|
  max = [ary[i], ary[i+1]].max
  if ary[i] > ary[i+1]
    ans += ary[i] - ary[i+1]
    ary[i+1] = max
  end
end

p ans

Measured memory_bytes: 28088
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cstring>
//#include <search.h>
#include <algorithm>
//#include <vector>
using namespace std;
int main()
{
  string s,s2;
  cin>>s;
  for(int i=0;i<s.length();++i){
    if(s[i]==','){
        s2+=' ';
    }
    else{
        s2+=s[i];
    }
  }
  cout<<s2;
return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt(),w=sc.nextInt();
		String[] c=new String[h];
		for(int i=0;i<h;i++){
			c[i]=sc.next();
		}
		for(int i=0;i<h;i++){
			System.out.println(c[i]);
			System.out.println(c[i]);
		}
	}
}

Measured memory_bytes: 24404
#include <iostream>
#include <math.h>
#include <stdio.h>

typedef long long ll;

using namespace std;

int main() {
  ll N, P;
  cin >> N >> P;
  ll M = (ll)pow(P, 1.0 / N + 1.0e-7);
  for (ll i = M; i > 0; --i) {
    if (P % (ll)pow(i, N) == 0) {
      printf("%lld\n", i);
      return 0;
    }
  }
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

signed main()
{
  int N, K;
  cin >> N >> K;
  vector<bool> D(10, false);
  for (int i = 0; i < K; i++)
  {
    int d;
    cin >> d;
    D.at(d) = true;
  }
  
  while (true)
  {
    int n = N;
    bool ok = true;
    while (n > 0)
    {
      if (D.at(n % 10))
      {
        ok = false;
        break;
      }
      n /= 10;
    }

    if (ok)
    {
      cout << N << endl;
      return 0;
    }

    N++;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
using namespace std;
using ll = long long;
 
int main() {
	char a[3][3];
	for (int i = 0;i<3;i++) {
		for (int j = 0;j<3;j++) {
			cin >>a[i][j];
		}
	}
	cout << a[0][0] << a[1][1] << a[2][2] << endl;
	return 0;
}


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

typedef long long ll;

int digits(ll d) {
	int siz = 0;
	while (d > 0) {
		d /= 10;
		siz++;
	}

	return siz;
}

int main() {
	ll N; cin >> N;
	int ans = digits(N);

	for (ll A = 1LL; A*A <= N; ++A) {
		if (N % A != 0) continue;
		const ll B = N / A;

		const int cur = max(digits(A), digits(B));

		if (ans > cur) {
			ans = cur;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
#define D10 fixed<<setprecision(10)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

string s; int n, p;

int num()
{
	int res = 0;
	while (isdigit(s[p]))
	{
		res *= 10;
		res += s[p] - '0';
		p++;
	}
	return res;
}

string parse()
{
	string res;
	int t;
	if (isdigit(s[p])) t = num();
	else t = 1;
	if (s[p] == '(')
	{
		p++;
		string tmp = parse();
		p++;
		REP(i, t)
		{
			res += tmp;
			if (res.size() > n) return res;
		}
	}
	else
	{
		REP(i, t)
		{
			res += s[p];
			if (res.size() > n) return res;
		}
		p++;
	}
	while (p < s.size()&&s[p]!=')')
	{
		if (res.size() > n) return res;
		res += parse();
	}

	return res;
}

int main()
{
	while (cin >> s >> n, s != "0")
	{
		p = 0;
		string res = parse();
		if (res.size() > n) cout << res[n] << endl;
		else puts("0");
	}
	return 0;
}

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

int main() {
	string s;
	cin >> s;
	string t;
	cin >> t;
	int flag = 1;
	for(int i = 0; i < s.size(); i++){
		if(s[i] != t[i]){
			flag = 0;
			break;
		}
	}
	if(flag == 0){
		cout << "No";
	} else {
		cout << "Yes";
	}
}

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

using namespace std;
  map<int, int> mp;
void solve() {
  int N;
  
  int  crown = 0;
  cin >> N;
  for(int i=1;i<=N;i++) {
    int a;
    cin >> a;
    if (a < 3200) mp[a / 400]++;
    else crown++;
  }
  int minimum = mp.size();
  if (minimum == 0 and crown != 0) minimum = 1;
  int maximum1 = mp.size()+crown;
  cout << minimum << " " << maximum1 << endl;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX 55
int c[MAX];
int depth[MAX];
int graph[MAX][MAX];
int Cut[MAX];
int Brige[MAX][MAX];
int Root;
int Ancestor[MAX];
int vis[MAX];
int n,m;
int cnt=0;
int cnt2=0;
void findnode(int k,int kfather,int deep)
{
	int i,tot;
	c[k]=1;depth[k]=deep;
	Ancestor[k]=deep;tot=0;
	for(i=0;i<n;i++)
	{
		if(graph[i][k]&&i!=kfather&&c[i]==1)
		Ancestor[k]=min(Ancestor[k],depth[i]);
		if(graph[i][k]&&c[i]==0){
			findnode(i,k,deep+1);
			tot++;
			Ancestor[k]=min(Ancestor[k],Ancestor[i]);
			if((k==Root&&tot>1)||(k!=Root&&Ancestor[i]>=depth[k])) 
			{
			cnt2++;
			Cut[k]=1;
	//		cout<<"k="<<k<<endl;
			}
			if(Ancestor[i]>depth[k]) 
			{
			Brige[k][i]=1;
	//		cout<<"bridge is"<<k<<" "<<i<<endl;
			cnt++;
			}
		}
	}
	c[k]=2;
}

int main (void)
{
	int tmp1,tmp2;
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++)
	{
		scanf("%d%d",&tmp1,&tmp2);
		tmp1--;tmp2--;
		graph[tmp1][tmp2]=1;
		graph[tmp2][tmp1]=1;	
	}
	findnode(tmp1-1,0,0);
	printf("%d\n",cnt);
	return 0;
}

Measured memory_bytes: 384
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%I64d", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%I64d\n", (n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
vi adj[MAXN], radj[MAXN];
int dp[MAXN], deg[MAXN], vis[MAXN];

void dfs(int u) {
    if (!deg[u]) return;
    if (dp[u]) return;
    for (int v: radj[u])
        dfs(v);
    for (int v: radj[u])
        dp[u] = max(dp[v] + 1, dp[u]);
}

int main()
{
    int n, m;
    ni(n), ni(m);
    for (int i= 0; i < m; i++) {
        int u, v;
        ni(u), ni(v);
        u--, v--;
        adj[u].pb(v);
        radj[v].pb(u);
        deg[v] = 1;
    }
    for (int i = 0; i < n; i++)
        if (adj[i].empty())
            dfs(i);
    pri(*max_element(dp, dp + n));
    return 0;
}


Measured memory_bytes: 67712
#include<bits/stdc++.h>
using namespace std;
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define pa pair<int,int>
#define mod 998244353
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define cl(x) memset(x,0,sizeof x)
#ifdef Devil_Gary
#define bug(x) cout<<(#x)<<" "<<(x)<<endl
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define bug(x)
#define debug(...)
#endif

const int INF = 0x7fffffff;
const int N=1e5+5;
/*
char *TT,*mo,but[(1<<15)+2];
#define getchar() ((TT==mo&&(mo=(TT=but)+fread(but,1,1<<15,stdin),TT==mo))?-1:*TT++)//*/
inline int read(){
    int x=0,rev=0,ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')rev=1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<1)+(x<<3)+ch-'0';ch=getchar();}
    return rev?-x:x;
}/*
struct Edge{
	int nxt,v;
//	int w;
//	int id;
}e[N<<1];
void add(int u,int v){
	e[++tot].v=v,e[tot].nxt=head[u],head[u]=tot;
	e[++tot].v=u,e[tot].nxt=head[v],head[v]=tot;
}*/

int main(){
#ifdef Devil_Gary
    freopen("in.txt","r",stdin);
//  freopen("out.txt","w",stdout);
#endif
	ll d,t,s;
	cin >>d>>t>>s;
	if(t*s>=d) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <stack>
using namespace std;
string s;
bool ischar(char c){
	if('a'<=c && c<='z') return true;
	if('A'<=c && c<='Z') return true;
	if(c==' ') return true;
	return false;
}
bool solve(){
	stack<int> st;
	for(int i=0;i<s.size();i++){
		if(ischar(s[i])) continue;
		if(s[i]=='(') st.push(0);
		if(s[i]=='[') st.push(1);
		if(s[i]==')'){
			if(st.empty()) return 0;
			int s=st.top();
			st.pop();
			if(s==1) return 0;
		}
		if(s[i]==']'){
			if(st.empty()) return 0;
			int s=st.top();
			st.pop();
			if(s==0) return 0;
		}
		if(s[i]=='.'){
			if(st.empty()) return 1;
			else return 0;
		}
	}
	return 1;
}
int main(){
	while(true){
		getline(cin,s);
		if(s[0]=='.') break;
		if(solve()) printf("yes\n");
		else printf("no\n");
	}
	return 0;
}

Measured memory_bytes: 1168
import sys

int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,k=MI()
    a=LI()
    for _ in range(k):
        na=[0]*(n+1)
        for i in range(n):
            l=max(0,i-a[i])
            r=min(n,i+a[i]+1)
            na[l]+=1
            na[r]-=1
        if na[0]==n and na[-1]==-n:
            a=[n]*n
            break
        for i in range(n):
            na[i+1]+=na[i]
        a=na
    print(*a[:n])

main()

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

long long f(long long a, long long b){
    if(a < 0)
        return 0;
    return a / b + 1;
}

int main(int argc, const char * argv[]) {
    long long a, b, c;
    cin >> a >> b >> c;
    
    long long n = f(b, c) - f(a-1, c);
    
    
    cout << n << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define sz(a) int(a.size())
#define clr(a) memset(a,0,sizeof(a))
#define all(a) a.begin(),a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int inf=1e9;
const ll Inf=1e18;
const int N=1e5+10;
const int mod=0;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
template<typename T> bool chkmax(T &a,T b) { return a<b?a=b,1:0; };
template<typename T> bool chkmin(T &a,T b) { return a>b?a=b,1:0; };
int add(int a,int b) { return a+b>=mod?a+b-mod:a+b; }
int sub(int a,int b) { return a-b<0?a-b+mod:a-b; }
void inc(int &a,int b) { a=(a+b>=mod?a+b-mod:a+b); }
void dec(int &a,int b) { a=(a-b<0?a-b+mod:a-b); }
int n,m;
char s[N],t[N];
int main() {
    n=gi(),m=gi();
    scanf("%s",s),scanf("%s",t);
    for(int j=0;j<m;j++) {
        if(1ll*j*n%m==0) {
            int i=1ll*j*n/m;
            if(s[i]!=t[j]) return puts("-1"),0;
        }
    }
    printf("%lld\n",1ll*n*m/__gcd(n,m));
    return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<queue>
#include<utility>
#include<cmath>

using namespace std;


int main()
{
  int K, X;
  cin >> K >> X;

  for(int i = X-K+1; i <= X+K-1; i++){
    cout << i << " ";
  }

  return 0;
}


Measured memory_bytes: 256
K =  int(input())

a = [0]*1000001
ans = -1
a[1] = 7%K

for i in range(2,K+1):
    a[i] = (10*a[i-1]+7)%K
for i in range(1,K+1):
    if a[i] == 0:
        ans = i
        print(i)
        break
if ans == -1:
    print(-1)


Measured memory_bytes: 48476
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void) {
    int n, m, x;
    cin >> n >> m >> x;
    vector<int> c(n);
    vector<vector<int>> a(n,vector<int>(m));
    rep(i,n) {
        cin >> c[i];
        rep(j,m) cin >> a[i][j];
    }

    ll ans = 1e18;
    for(int bit = 0; bit < (1<<n); ++bit) {
        ll tmp = 0;
        vector<int> algo(m,0);
        bool flag = true;
        for(int i = 0; i < n; ++i) {
            if(bit & (1<<i)) {
                tmp += c[i];
                rep(j,m) {
                    algo[j] += a[i][j];
                }
            }
        }
        for(int i = 0; i < m; ++i) {
            if(algo[i]<x) {
                flag = false;
                break;
            }
        }
        if(flag) {
            ans = min(ans, tmp);
        }
    }
    if(ans != 1e18) {
        cout << ans << endl;
    }else {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3604
function Main(input) {
	const [L, R, d] = input.split(" ").map(Number);
	
	var ans = 0;
	for(i=L; i<=R; i++){
	  if(i % d == 0){
	    ans++;
	  }
	}
	console.log(ans);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

typedef long long LL;

const int N=50000,M=100000;

int n,m,opt,x[M+9],y[M+9];

void into(){
  scanf("%d%d%d",&n,&m,&opt);
  for (int i=1;i<=m;++i)
	scanf("%d%d",&x[i],&y[i]);
}

bitset<N+9>dp[N+9];
int vis[N+9];
int ans0,ans[M+9];

void Get_dp(){
  for (int i=1;i<=n;++i) dp[i][i]=1;
  for (int i=1;i<=m;++i){
	dp[x[i]]|=dp[y[i]];
	dp[y[i]]|=dp[x[i]];
  }
  int p=0;
  for (int i=1;i<=n;++i)
	if (dp[i].count()==n) {p=i;break;}
  if (!p) return;
  ans0=1;
  vis[p]=1;
  for (int i=m;i>=1;--i){
	if (!vis[x[i]]&&vis[y[i]]) ans[i]=1;
	vis[x[i]]=vis[y[i]]|=vis[x[i]];
  }
}

int to[N+9],siz[N+9];

void Get_ans(){
  if (n==2&&m) return;
  ans0=1;
  for (int i=1;i<=n;++i) to[i]=i,siz[i]=1;
  for (int i=m;i>=1;--i){
	int u=x[i],v=y[i];
	ans[i]=0;
	if (siz[to[u]]==n-1) swap(u,v),ans[i]=1;
    --siz[to[v]];
	++siz[to[v]=to[u]];
  }
}

void work(){
  opt==1?Get_dp():Get_ans();
}

void outo(){
  if (!ans0) puts("-1");
  else{
	for (int i=1;i<=m;++i)
	  putchar(ans[i]?'v':'^');
    puts("");
  }
}

int main(){
  into();
  work();
  outo();
  return 0;
}

Measured memory_bytes: 310348
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.stdio;
import std.string;
import std.range;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    int n = readint();
    writefln("ABC%03d", n);
}


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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  
  long long r = 0, g = 0, b = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 'R')
      r++;
    if (s.at(i) == 'G')
      g++;
    if (s.at(i) == 'B')
      b++;
  }
  
  int exc = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if ((2 * j - i) < n) {
        if (s.at(i) != s.at(j) && s.at(j) != s.at(2 * j - i) && s.at(2 * j - i) != s.at(i))
          exc++;
      }
    }
  }
  
  cout << r * g * b - exc << endl;

  return 0;
}

Measured memory_bytes: 3556