akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

long long int gcd(long long int a, long long int b) {
    if (a < b)swap(a, b);
    while (b) {
        a %= b;
        swap(a, b);
    }
    return a;
}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);
    int K; cin >> K;
    LL ans = 0;
    FOR(a,1,K+1){
        FOR(b,1,K+1){
            FOR(c,1,K+1){
                LL tmp = gcd(a,b);
                ans += gcd(tmp,c);
            }
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define bp __builtin_popcountll
#define pb push_back
#define in(s) freopen(s, "r", stdin);
#define out(s) freopen(s, "w", stdout);
#define inout(s, end1, end2) freopen((string(s) + "." + end1).c_str(), "r", stdin),\
		freopen((string(s) + "." + end2).c_str(), "w", stdout);
#define fi first
#define se second
#define bw(i, r, l) for (int i = r - 1; i >= l; i--)
#define fw(i, l, r) for (int i = l; i < r; i++)
#define fa(i, x) for (auto i: x)
using namespace std;
const int mod = 1e9 + 7, inf = 1061109567;
const long long infll = 4557430888798830399;
const int N = 3e5 + 5, M = 1e5 + 5;
int n, m;
struct Seg {
	int l, r;
} s[N];
vector<int> divi[M];
void sieve() {
	fw (i, 1, M) {
		for (int j = i; j < M; j += i) divi[j].pb(i);
	}
}
struct BIT {
	int t[M], n;
	void init(int _n) {
		n = _n;
		fw (i, 0, n + 1) t[i] = 0;
	}
	void add(int pos, int val) {
		pos++;
		for (; pos <= n; pos += (pos & (-pos))) t[pos] += val;
	}
	int get(int pos) {
		pos++;
		int ans = 0;
		for (; pos > 0; pos -= (pos & (-pos))) ans += t[pos];
		return ans;
	}
	int getRange(int l, int r) {
		int ans = get(r);
		if (l > 0) ans -= get(l - 1);
		return ans;
	}
} bit;
vector<int> leBounds[M];
int ans[M];
signed main() {
	#ifdef BLU
	in("blu.inp");
	#endif
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m;
	fw (i, 0, n) cin >> s[i].l >> s[i].r, s[i].l--, s[i].r--;
	bit.init(m);
	fw (i, 0, n) {
		bit.add(s[i].l, 1);
		leBounds[s[i].r].pb(s[i].l);
	}
	sieve();
	fw (i, 0, m) {
		fa (j, divi[i + 1]) {
			int lst = i - j + 1;
			ans[j] += bit.getRange(lst, i);
		}
		
		fa (j, leBounds[i]) bit.add(j, -1);
	}
	fw (i, 1, m + 1) cout << ans[i] << "\n";
	return 0;
}

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

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

	int N, D;
	int x[15][15];
	int c = 0;
	cin >> N >> D;
	for (int i = 0; i < N; i++)for (int j = 0; j < D; j++) {
		cin >> x[i][j];
	}
	for (int i = 0; i < N; i++)for (int j = i+1; j < N; j++) {
		int sum = 0;
		for (int k = 0; k < D; k++) {
			sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
		}
		if ((int)sqrt(sum) == sqrt(sum)) {
			c++;
		}
	}
	cout << c;
}

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int MD = (int)1e9 + 7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T> void amin(T& a,T b){ a=min(a,b);}


int main(){
	//cin.tie(0); ios_base::sync_with_stdio(false);
	ll n,m;
	cin >>n >>m;
	
	ll ans = min( n, m/2);
	ans += max(0LL, (m - 2*n)/4);
	
	cout << ans <<endl;
	return 0;
}

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

using namespace std;

int main() {
	string s;
	getline(cin, s);
	for (int i = 0; i < s.size(); ++i) {
		if (islower(s[i])) {
			s[i] = toupper(s[i]);
		}
		else {
			s[i] = tolower(s[i]);
		}
	}
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 3172
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int mod = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}


ll calc(ll n, ll m, ll k) {
    ll sigma_ij = 0;
    rep(d, n) {sigma_ij += d * (n - d) * (m * m); sigma_ij %= mod;}
    return sigma_ij % mod;
}

ll nck(ll n, ll m, ll k) {
    ll sigma_comb;
    ll a = 1, b = 1, c = 1;
    rrep(i, 1, m * n - 2 + 1) {a *= i; a %= mod;}
    rrep(i, 1, m * n - k + 1) {b *= i; b %= mod;}
    rrep(i, 1, k - 2 + 1) {c *= i; c %= mod;}
    sigma_comb = a * power(b * c % mod, mod - 2) % mod;
    return sigma_comb;
}

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    ll n, m, k;
    cin >> n >> m >> k;
    ll ansx = calc(n, m, k), ansy = calc(m, n, k);
    ll ans = ansx + ansy;
    (ans *= nck(n, m, k)) %= mod;
    cout << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int i,j;
  for(i=1;i<10;i++){
    for(j=1;j<10;j++){
      if(n==i*j){
        cout << "Yes" << "\n";
        return 0;
      }
    }
  }
  cout << "No" << "\n";
  return 0;
}

Measured memory_bytes: 3596
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	string s;
	s = "NO";
	if (a == 7)
	{
		if (b == c && b == 5)
			s = "YES";
	}
	if (b == 7)
	{
		if (a == c && a == 5)
			s = "YES";
	}
	if (c == 7)
	{
		if (b == a && b == 5)
			s = "YES";
	}
	cout << s << endl;
} 

Measured memory_bytes: 3536
#![allow(non_snake_case)]

fn main() {
    let mut a = String::new();
    let mut s = String::new();
    std::io::stdin().read_line(&mut a).unwrap();
    std::io::stdin().read_line(&mut s).unwrap();
    let a: i32 = a.trim().parse().unwrap();
    println!("{}", if a >= 3200 {s.trim()} else {"red"});
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);

		long n = scn.nextLong();
		long a = scn.nextLong();
		long b = scn.nextLong();
		
		long diff = b - a; //
		if (diff % 2 == 0) System.out.println("Alice");
		else System.out.println("Borys");
	}

}


Measured memory_bytes: 23124
#include<cstdio>
#include<queue>
#define int long long
struct node{
	int C0,C1,id;
	bool operator<(node b)const{
		return C1*b.C0>C0*b.C1;
	}
}a[300100];
std::priority_queue<node>qu;
int father[300100],n,p[300100],val[300100],ans;
int find(int x){
	if(father[x]==x)return x;
	return father[x]=find(father[x]);
}
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++)
		scanf("%lld",&p[i]);
	for(int i=1;i<=n;i++){
		scanf("%lld",&val[i]);
		if(val[i]==1)a[i]=(node){0,1,i};
		else a[i]=(node){1,0,i};
		if(i!=1)qu.push(a[i]);
		father[i]=i;
	}
	while(!qu.empty()){
		node x=qu.top();
		int now=find(x.id);
		qu.pop();
		if(a[now].C0!=x.C0||a[now].C1!=x.C1)continue;
		int fa=find(p[now]);
		ans+=a[fa].C1*a[now].C0;
		a[fa].C1+=a[now].C1;
		a[fa].C0+=a[now].C0;
		father[find(now)]=father[find(fa)];
		if(fa!=1)qu.push(a[fa]);
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 18668
#include<bits/stdc++.h>
using namespace std;
int main()
{  int n,ans=0,a1[110];
   long long k;
   string a;
   cin>>a>>k;
   k--;
   for(int i=0;i<a.size();i++)
   {
     if(a[i]=='1')
       k--;
	 else 
	 {
	   cout<<a[i]-'0';
	   return 0;
	 }
     if(k==-1)
     { 
       cout<<1;
       return 0;
	 }
   }
   return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

double t, x;
int main() {
    cin>>t>>x;

    cout<<t/x<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
const double PI=4*atan(1);
using namespace std;
#define MOD 1000000007

int findmin(int a,int b) {
    return a<b?a:b;
}
int findmax(int a,int b) {
    return a>b?a:b;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long n;
    cin>>n;
    long a[n];
    ull xors=0;
    for(long i=0;i<n;i++) {
		cin>>a[i];
		xors^=a[i];
	}
	for(long i=0;i<n;i++) {
		cout<<(xors^a[i])<<" ";
	}
	cout<<"\n";
    cout.flush();
    return 0;
}


Measured memory_bytes: 5196
#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void run(void){
  int n;
  scanf("%d",&n);
  char *s=(char *)calloc(n+1,sizeof(char));
  scanf("%s",s);
  int64 way=0;
  int64 cntD=0;
  int64 cntDM=0;
  int i;
  for(i=0;i<n;i++){
    if(s[i]=='D'){
      cntD++;
    } else if(s[i]=='M'){
      cntDM+=cntD;
    } else if(s[i]=='C'){
      way+=cntDM;
    }
  }
  int q;
  scanf("%d",&q);
  while(q--){
    int k;
    scanf("%d",&k);
    int64 cntM=0;
    for(i=0;i<k;i++){
      if(s[i]=='M'){
	cntM++;
      }
    }
    int64 local=0;
    int64 cntLD=0;
    int64 cntLDM=0;
    for(i=k;i<n;i++){
      if(s[i-k]=='D'){
	cntLD++;
	cntLDM+=cntM;
      } else if(s[i-k]=='M'){
	cntM--;
      }
      if(s[i]=='C'){
	local+=cntLDM;
      } else if(s[i]=='M'){
	cntLDM+=cntLD;
	cntM++;
      }
    }
    printf("%lld\n",way-local);
  }
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 1152
#include <stdio.h>
#include <stdlib.h>
#define ABS(x, y) ((x < y) ? y - x : x - y)

void solve(int *a, int n, int k) {
  int i, j, flag = 1;
  for(i = 0; i < n; ++i) {
    for(j = 0; j < n; ++j) {
      if(i == j) { continue; }
      if(ABS(a[i], a[j]) > k) { flag = 0; break; }
    }
  }
  if(flag == 1) { printf("Yay!\n"); }
  else { printf(":(\n"); }
}

int main(void)
{
  int i, k, n = 5;
  int *a = (int*)malloc(6*sizeof(int));
  for(i = 0; i < n; ++i) { scanf("%d", &a[i]); }
  scanf("%d", &k);
  solve(a, n, k);
  return 0;
}

Measured memory_bytes: 128
from itertools import accumulate

N = int(input())
L, R = [0], [0]
for i in range(N):
    li, ri = map(int, input().split())
    L.append(li)
    R.append(ri)

L = list(accumulate(sorted(L, reverse=True)))
R = list(accumulate(sorted(R)))

ans = 0
for k in range(N):
    ans = max(ans, 2*(L[k] - R[k]))

print(ans)


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

#define all(c) (c).begin(),(c).end()
#define INF (1L << 61)

using namespace std;

typedef long long ll;

int main(void){

  int n,k;
  cin >> n >> k;
  vector<ll> h(n);

  for(int i=0;i<n;i++)cin >> h[i];
  sort(all(h));

  ll ans=INF;
  for(int i=0;i+k-1<n;i++)
    ans=min(ans, h[i+k-1]-h[i]);
  cout << ans << endl;
  return 0;
}


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

using namespace std;
using ll = long long;

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

  ll a, b;
  cin >> a >> b;

  auto is_prime = [&](ll n) -> bool {
    for (ll i = 2; i * i <= n; i++) {
      if (n % i == 0)
        return false;
    }
    return true;
  };

  auto divisor = [&](ll n) -> set<ll> {
    set<ll> d;
    for (ll i = 1; i * i <= n; i++) {
      if (n % i != 0)
        continue;
      if (i == 1 || is_prime(i))
        d.insert(i);
      if (is_prime(n / i))
        d.insert(n / i);
    }
    return d;
  };

  auto d1 = divisor(a);
  auto d2 = divisor(b);

  ll ans = 0;
  for (const auto &x : d1) {
    if (d2.count(x) > 0)
      ans++;
  }

  cout << ans << endl;

  return 0;
}


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

typedef long long int ll;

int main () {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n,x,t;
    cin >> n >> x >> t;
    
    cout << (ll)ceil((double)n/x)*t << "\n";
}


Measured memory_bytes: 3728
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a, b, c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n >> a >> b >> c >> d;
  rep(i, n - 1) {
    ll mi, ma;
    mi = -d * i + (n - i - 1) * c + a;
    ma = -c * i + (n - i - 1) * d + a;
    if (mi <= b && b <= ma) {
      Cout("YES");
      return 0;
    }
  }
  Cout("NO");
  return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
using namespace std;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
signed main() {
	int n, k;
	cin >> n >> k;
	if ((n - 1) / 2+1 >=k)puts("YES");
	else puts("NO");
	getchar(); getchar(); return 0;
}


Measured memory_bytes: 256
import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

enum MOD = 1_000_000_007;

struct Number {
    long x;
    this(long x) {
        this.x = (x % MOD + MOD) % MOD;
    }

    Number opBinary(string op)(long x) {
        return Number(mixin("this.x"~op~"x"));
    }

    Number opBinary(string op)(Number n) {
        return Number(mixin("this.x"~op~"n.x"));
    }
}

void main() {
    auto tmp = readln.split.to!(long[]);

    Number fact(Number n) {
        if (n.x == 0) return Number(1);
        return n * fact(n-1);
    }
    auto solve() {
        if (tmp[0] > tmp[1]+1) return Number(0);
        if (tmp[1] > tmp[0]+1) return Number(0);
        if (tmp[0] == tmp[1]) return fact(Number(tmp[0])) * fact(Number(tmp[1])) * 2;
        return fact(Number(tmp[0])) * fact(Number(tmp[1]));
    }
    solve().x.writeln;
}



Measured memory_bytes: 3436
n,d=map(int,input().split())

a=[list(map(int,input().split())) for _ in range(n)]

count=0
sum=0
for i in range(n):
    for k in range(i+1,n):
        for j in range(d):
            sum+=int((a[i][j]-a[k][j])*(a[i][j]-a[k][j]))
        for l in range(sum+1):
            if sum==l*l:
                count+=1
        sum=0

print(count)


Measured memory_bytes: 3064
import java.util.*;

class Main {
	Scanner sc = new Scanner(System.in);

	public void run() {
		while(sc.hasNext()){
			P p1=new P(sc.nextDouble(),sc.nextDouble());
			P p2=new P(sc.nextDouble(),sc.nextDouble());
			P p3=new P(sc.nextDouble(),sc.nextDouble());
			P px=new P(sc.nextDouble(),sc.nextDouble());
			
			if(P.ccw(p1,p2,px)*P.ccw(p2,p3,px)>=0
			&&P.ccw(p2,p3,px)*P.ccw(p3,p1,px)>=0	
			&&P.ccw(p3,p1,px)*P.ccw(p1,p2,px)>=0
				){
				ln("YES");
			}else{
				ln("NO");
			}
		}
	}
	public static String join(double[] array, String separator) {
		StringBuilder str = new StringBuilder(array[0] + "");
		for (int i = 1; i < array.length; i++) {
			str.append(separator).append(array[i] + "");
		}
		return str.toString();
	}

	
	
	public static void main(String[] args) {
		new Main().run();
	}

	public static void pr(Object o) {
		System.out.print(o);
	}

	public static void ln(Object o) {
		System.out.println(o);
	}

	public static void ln() {
		System.out.println();
	}
}


class P{
	double x;
	double y;
	P(double _x,double _y){
		x=_x;
		y=_y;
	}
	
	public static double dot(P a,P b){
			return a.x*b.x+a.y*b.y;
	}
	public static  double cross(P a,P b){
		return a.x*b.y-a.y*b.x;
	}
	public P a(P a){
		return new P(x+a.x,y+a.y);
	}
	public P s(P a){
		return new P(x-a.x,y-a.y);
	}
	
	public double norm(){
		return Math.sqrt(x*x+y*y);
	}
	
	public static int ccw(P a,P b,P c){
		if(P.cross(b.s(a),c.s(a))>Double.MIN_NORMAL){
			return 1;
		}
		if(P.cross(b.s(a),c.s(a))<-Double.MIN_NORMAL){
			return -1;
		}
		if(P.dot(b,c)<-Double.MIN_NORMAL)return 2;
		if(b.norm()<c.norm()-Double.MIN_NORMAL)return -2;
		return 0;
	}
}

Measured memory_bytes: 12000
n=int(input())
e=[[] for i in range(n+1)]
for i in range(n-1):
 [a,b,c]=[int(j) for j in input().split()]
 e[a].append([b,c])
 e[b].append([a,c])
[q,k]=[int(j) for j in input().split()]
xy=[]
for i in range(q):
 xy.append([int(j) for j in input().split()])
def dfs(v,n):
    s=[]
    d=[-1 for i in range(n+1)]
    d[v]=0
    s.append(v)
    while len(s):
        v=s.pop()
        
        for i in e[v]:
            if d[i[0]]<0:
                d[i[0]]=d[v]+i[1]
                s.append(i[0])
    return d
d=dfs(k,n)
for i in range(q):
 print(d[xy[i][0]]+d[xy[i][1]])

Measured memory_bytes: 67900
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

int Gauss(vector<ll> A){//binary
    int rank=0;
    for(int d=0;d<60;d++){//d reverse??
        int pivot=-1;
        for(int i=rank;i<(int)A.size();i++){
            if(A[i]&(1ll<<d)){
                pivot=i;
                break;
            }
        }
        if(pivot==-1) continue;
        swap(A[rank],A[pivot]);
        for(int j=0;j<(int)A.size();j++){
            if(j==rank) continue;
            if(!(A[j]&(1ll<<d))) continue;
            A[j]^=A[rank];
        }
        rank++;
    }
    return rank;
}

void solve(){
  int N;
  cin>>N;
  vector<ll> A(N);
  rep(i,N) cin>>A[i];
  string S;
  cin>>S;

  if(S[N-1]=='1'){
    cout<<'1'<<"\n";
    return;
  }

  int now=N-1;
  vector<ll> P;
  vector<ll> Q;
  while(now>=0){
    vector<ll> B;
    int nex=now;
    while(nex>=0&&S[nex]=='0'){
      P.push_back(A[nex]);
      Q.push_back(A[nex]);
      nex--;
    }
    if(nex==-1) break;

    int orirank=Gauss(P);

    while(nex>=0&&S[nex]=='1'){
      Q.push_back(A[nex]);
      nex--;
    }

    int chrank=Gauss(Q);
    if(orirank!=chrank){
      cout<<'1'<<"\n";
      return;
    }

    now=nex;
  }

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

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

  int T;
  cin>>T;
  rep(i,T) solve();

  return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;

int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    vector<ll> l(N + 2);
    for(int i = 0; i < N; ++i) {
        cin >> a[i];
        l[i + 1] = l[i] + a[i];
    }

    ll ans = LLINF;
    for(int i = 1; i < N; ++i)
        ans = min(ans, abs(l[N] - 2 * l[i]));
    cout << ans << endl;
    return 0;
}


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

int main()
{
  int N,I[256],R[256],A,S,C,a,s,c,M=256,r;
  double H,h,eps=1e-8;
  while(1){
    cin>>N;
    if(N==0)break;
    for(int i=0;i<N;i++)cin>>I[i];
    H=10000000.0;
    for(a=0;a<16;a++){
      for(s=0;s<16;s++){
	for(c=0;c<16;c++){
	  for(int i=0;i<M;i++)R[i]=0;
          r=s;
	  for(int i=0;i<N;i++){
	    r=(a*r+c)%M;
	    R[(I[i]+r)%M]++;
	  }
	  h=0.0;
          for(int i=0;i<M;i++){
	    if(R[i]!=0){
	      h-=(double)R[i]/N*log((double)R[i]/N);
	    }
	  }
	  if(h+eps<H){
	    A=a;
	    S=s;
	    C=c;
	    H=h;
	  }
	}
      }
    }
    cout<<S<<" "<<A<<" "<<C<<endl;
  }
  return 0;
}

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

int main(){
  int n;
  cin >>n;
  vector<string> s(n);
  rep(i,n) cin >> s.at(i);
  
  map<string, int > time;
  for(string x:s){
    if(time.count(x)){
      time.at(x)++;
    }
    else{
      time[x]=1;
    }
  }
  int timemax=0;;
  for(string x:s){
    timemax= max(timemax,time.at(x));
  }
  for(pair<string,int> p :time){
   string k=p.first;
    int v=p.second;
    if(v==timemax){
      cout << k << endl;
    }
  }
}

Measured memory_bytes: 28544
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            while (true)
            {
                int n = int.Parse(Console.ReadLine());

                if (n == 0) break;

                int sum = 0;

                for (int i = 0; i < n; i++)
                {
                    int[] input = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
                    int s = input[0] + input[1] + input[2];
                    int w = input[3];

                    if (s > 160 || w > 25) continue;

                    int rank = Math.Max(CheckS(s), CheckW(w));

                    sum += (600 + (200 * rank));
                }
                sb.AppendLine(sum.ToString());
            }
            Console.Write(sb);
        }

        static int CheckS(int s)
        {
            if (s > 140) return 5;
            if (s > 120) return 4;
            if (s > 100) return 3;
            if (s > 80) return 2;
            if (s > 60) return 1;
            return 0;
        }

        static int CheckW(int w)
        {
            if (w > 20) return 5;
            if (w > 15) return 4;
            if (w > 10) return 3;
            if (w > 5) return 2;
            if (w > 2) return 1;
            return 0;
        }
    }
}

Measured memory_bytes: 9432
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        int n = in.nextInt();
        int k = in.nextInt();

        int ans = 0;
        while (n > 0) {
            n /= k;
            ans++;
        }
        out.println(ans);
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
// #pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;

namespace Math {
// Generic modular integer.
    template<int MOD, typename IntType = int>
    struct GModint {
        IntType val;

        GModint() : val(0) {}

        GModint(int v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        GModint(ll v, bool safe = false) { val = safe ? v : ((v % MOD) + MOD) % MOD; }

        explicit operator bool() const { return val != 0; }

        const bool operator==(const GModint &g) const { return val == g.val; }

        const bool operator!=(const GModint &g) const { return val != g.val; }

        const GModint operator+=(const GModint &g) { return *this = *this + g; }

        const GModint operator-=(const GModint &g) { return *this = *this - g; }

        const GModint operator*=(const GModint &g) { return *this = *this * g; }

        const GModint operator/=(const GModint &g) { return *this = *this / g; }

        const GModint operator^=(const GModint &g) { return *this = *this ^ g; }

        const GModint operator-() const { return GModint(val == 0 ? 0 : MOD - val, true); }

        const GModint operator+(const GModint &g) const {
            ll newval = val + g.val;
            if (newval >= MOD)
                newval -= MOD;
            return GModint(newval, true);
        }

        const GModint operator-(const GModint &g) const { return *this + (-g); }

        const GModint operator*(const GModint &g) const { return GModint(1ll * val * g.val); }

        const GModint operator/(const GModint &g) const { return *this * g.inv(); }

        template<class T>
        const GModint operator^(const T t) const { return GModint(modpow(val, t, MOD)); }

        const GModint inv() const { return GModint(modinv(val, MOD)); }
    };

    using Modint = GModint<1000000007>;
}

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

    int n, r; cin >> n >> r;

    if (n >= 10) {
        cout << r << endl;
    } else {
        cout << r + 100 * (10 - n) << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)




int main() {
	int X,Y;
	cin >>X>>Y;
	int su = 0;
	if (X==1) {
		su+=300000;
	}
	if (X == 2) {
		su += 200000;
	}
	if (X == 3) {
		su += 100000;
	}
	if (Y == 1) {
		su += 300000;
	}
	if (Y == 2) {
		su += 200000;
	}
	if (Y == 3) {
		su += 100000;
	}
	if (Y == 1&&X==1) {
		su += 400000;
	}
	cout << su<< endl;
}

Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

typedef long long ll ;
typedef double db;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define for0(i,n)          for(int i=0;i<n;i++)
#define for1(i,n)          for(int i=1;i<=n;i++)
#define forab(a,b)       for(int i=a;i<=b;i++)
//#define gcd(a, b)     __gcd(a, b)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)     cout<<"Case "<<z<<": "<<x<<"\n"
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)

using namespace std;

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

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

int main(){
  double n,m;
  cin >> n >> m;
  vector<int>a(n);
  rep(i,n) cin >> a[i];
  sort(a.rbegin(),a.rend());

   double num = accumulate(a.begin(), a.end(),0)/(4*m);
  a[m-1]<num ? cout << "No" : cout << "Yes";
  return 0;
}

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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll A, B, K;
  IN(A,B,K);
  if(A>=K){
    OUT(A-K, B);
  }else if(A+B>=K){
    OUT(0, B-(K-A));
  }else{
    OUT(0,0);
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    int p[n];
    int q[n];
    rep(i,n) cin >> p[i];
    rep(i,n) cin >> q[i];

    int  a,b;
    int ary[n];
    rep(i,n) ary[i] = i+1;
    
    int cnt = 0;
    do {
        bool f1 = true;
        bool f2 = true;

        rep(i,n) if (p[i]!=ary[i]) f1 = false;
        rep(i,n) if (q[i]!=ary[i]) f2 = false;

        if (f1) a=cnt;
        if (f2) b=cnt;
        cnt++;
    } while(next_permutation(ary, ary+n));

    cout << abs(a-b) << endl;
}




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

int main()
{
  string s, t;
  cin >> s >> t;
  sort (s.begin(), s.end());
  sort (t.begin(), t.end());
  reverse(t.begin(), t.end());

  if (s < t) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

typedef long long ll;

const int MOD = 1000000007;

struct modint {
    int val;
    modint inv() const{
        int tmp,a=val,b=MOD,x=1,y=0;
        while(b)tmp=a/b,a-=tmp*b,swap(a,b),x-=tmp*y,swap(x,y);
        return modint(x);
    }
public:
    modint():val(0){}
    modint(ll x){if((val=x%MOD)<0)val+=MOD;}
    modint pow(ll t){modint res=1,b=*this; while(t){if(t&1)res*=b;b*=b;t>>=1;}return res;}
    modint& operator+=(const modint& x){if((val+=x.val)>=MOD)val-=MOD;return *this;}
    modint& operator-=(const modint& x){if((val+=MOD-x.val)>=MOD)val-=MOD; return *this;}
    modint& operator*=(const modint& x){val=(ll)val*x.val%MOD; return *this;}
    modint& operator/=(const modint& x){return *this*=x.inv();}
    bool operator==(const modint& x) const{return val==x.val;}
    bool operator!=(const modint& x) const{return val!=x.val;}
    bool operator<(const modint& x) const{return val<x.val;}
    bool operator<=(const modint& x) const{return val<=x.val;}
    bool operator>(const modint& x) const{return val>x.val;}
    bool operator>=(const modint& x) const{return val>=x.val;}
    modint operator+(const modint& x) const{return modint(*this)+=x;}
    modint operator-(const modint& x) const{return modint(*this)-=x;}
    modint operator*(const modint& x) const{return modint(*this)*=x;}
    modint operator/(const modint& x) const{return modint(*this)/=x;}
};

modint dp[100010];
modint dp2[100010];

int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> lx(n);
  vector<ll> ly(m);
  for (ll& x: lx) cin >> x;
  for (ll& y: ly) cin >> y;
  ll bx = lx[0];
  for (ll i = 1; i < n; ++i) {
    ll x = lx[i];
    modint s = x-bx;
    s *= i;
    dp[i+1] = modint(2)*dp[i];
    dp[i+1] -= dp[i-1];
    dp[i+1] += s;
    bx = x;
  }
  // cout << dp[n] << endl;
  ll w = dp[n].val;
  ll by = ly[0];
  for (ll i = 1; i < m; ++i) {
    ll y = ly[i];
    modint s = y-by;
    s *= w;
    s *= i;
    dp2[i+1] = modint(2)*dp2[i];
    dp2[i+1] -= dp2[i-1];
    dp2[i+1] += s;
    by = y;
  }
  cout << dp2[m].val << endl;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define lp3(i,a,b) for(int i=a;i<b;i++)
#define lp2(i,n) for(int i=0;i<n;i++)
#define ll long long
#define W 1000000007
using namespace std;

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


Measured memory_bytes: 256
def resolve():
    '''
    code here
    '''
    import collections
    N, M = [int(item) for item in input().split()]
    Xs = [int(item) for item in input().split()]
    if N < M:
        Xs.sort()
        ds = [Xs[i] - Xs[i-1] for i in range(1, M)]
        ds.sort()
        # print(ds)
        print(sum(ds[:M-N]))

    else:
        print(0)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 21140
import re

S = input()
r, ans, tmp = 0, 0, ''
N = len(S)
for l in range(N):
    while r < N and re.match(r'[ACGT]', S[r]):
        tmp += S[r]
        r += 1
    ans = max(ans, r - l)
    if l == r:
        r += 1
    else:
        tmp = tmp[l:]
print(ans)


Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<cstdio>
#include <cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int r; cin >> r;
    int ans = 3 * r * r;
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
from collections import Counter 

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

N,M= map(int, input().split())
uf1=UnionFind(N)

for _ in range(M):
    x, y = map(int, input().split())
    uf1.union(x-1,y-1)

for i in range(N):
    uf1.find(i) 
c = list(Counter(uf1.par).values())
print(max(c))

Measured memory_bytes: 33856
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = ReadInts();
            if (Math.Abs(s[0] - s[2]) <= s[3]) WriteLine("Yes");
            else
            {
                if (Math.Abs(s[0] - s[1]) <= s[3] && Math.Abs(s[1] - s[2]) <= s[3]) WriteLine("Yes");
                else WriteLine("No");
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 13140
from collections import defaultdict
n,p = map(int, input().split())
s = input()

if p==2 or p==5:
    res = 0
    for i in range(n-1,-1,-1):
        if int(s[i])%p==0:
            res += i+1
    print(res)
    exit()

u = defaultdict(int)
u[0] = 1
f = 1
d = 0
for i in range(n-1,-1,-1):
    d = (d + int(s[i])*f)%p
    f = (f*10)%p
    u[d%p] += 1

res = 0
for v in u.values():
    res += v*(v-1)//2

print(res)

Measured memory_bytes: 43212
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1e18;

int main() {
  //
  ll n;
  cin >> n;
  vector<pll> x;
  rep(i, n) {
    ll a;
    cin >> a;
    x.push_back(make_pair(a, i));
  }
  sort(ALL(x));
  reverse(ALL(x));
  rep(i, n) {
    pll m = x[0];
    if (m.second == i) {
      cout << x[1].first << endl;
    } else {
      cout << m.first << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 6512
integer(8) A,B,C,D,E
integer(8) ans,minus
read*,A,B,C,D
E=C*D/gcd(C,D)
ans=B-A+1

minus=B/C-(A-1)/C + B/D-(A-1)/D - B/E+(A-1)/E

print"(i0)",ans-minus

contains

pure function gcd(a,b)
integer(8),intent(in)::a,b
integer(8) gcd
integer(8) s,t
s=a
gcd=b

t=mod(s,gcd)
do while(t/=0)
  s=gcd
  gcd=t
  t=mod(s,gcd)
end do
end function gcd
end

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for (int i = a; i < b; i++)
using namespace std;

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <stack>
#include <bitset>

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

	vector<string> S(H);
	for (int i = 0; i < H; i++) {
		cin >> S.at(i);
	}

	for (int i = 0; i < W + 2; i++)	{
		cout << '#';
	}
	cout << endl;

	for (int i = 0; i < H; i++) {
		cout << '#' << S.at(i) << '#' << endl;
	}

	for (int i = 0; i < W + 2; i++) {
		cout << '#';
	}
	cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  long long A;
  string B;
  cin >> A >> B;
  int x = (B[0] - '0')*100 + (B[2] - '0')*10 + (B[3] - '0');
  cout << ll(A*x/100) << endl;
  return 0;
}


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

#define N 100000
#define M 100000007

long long int dp[N+2][2]={0};

void init(){
  int loop[2]={5,3};
  for(int t=0;t<2;t++){
    dp[0][t]=1;
    dp[1][t]=1;
    for(int i=2;i<=loop[t];i++)dp[i][t]=dp[i-1][t]*2;
    for(int i=loop[t]+1;i<N+2;i++){
      dp[i][t]=1;
      for(int j=1;j<=loop[t];j++){
	dp[i][t]+=dp[i-j][t];
	dp[i][t]%=M;
      }
    }
  }
  return;
}

int main()
{
  string s;
  long long int ans;
  int i,cnt;
  init();
  while(cin>>s,s!="#"){
    ans=1;
    cnt=1;
    for(i=1;i<s.size();i++){
      if(s[i-1]==s[i]){
	cnt++;
      }else{
	int t;
	if(s[i-1]=='8'||s[i-1]=='0')t=1;
	else t=0;
	ans*=dp[cnt][t];
	ans%=M;
	cnt=1;
      }
    }
    i=s.size()-1;
    if(s[i-1]==s[i]){
      int t;
      if(s[i-1]=='8'||s[i-1]=='0')t=1;
      else t=0;
      ans*=dp[cnt][t];
      ans%=M;
    }
    cout<<ans<<endl;
  }
}

Measured memory_bytes: 2704
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#define nmax_def 110000
#define Cmax_def 2200
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main() {
	string S;
	cin >> S;
	int N = S.length();
	string ans;
	ans = "Yes";
	rep(i, N) {
		if (i % 2 == 0 && S[i] == 'L')
			ans = "No";
		if (i % 2 == 1 && S[i] == 'R')
			ans = "No";
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
char table[12][13];
void del(int i,int j){
	table[i][j]='0';
	if(i>0&&table[i-1][j]=='1')del(i-1,j);
	if(j>0&&table[i][j-1]=='1')del(i,j-1);
	if(i<11&&table[i+1][j]=='1')del(i+1,j);
	if(j<11&&table[i][j+1]=='1')del(i,j+1);
	return ;
}
int main(){
	while(~scanf("%s",table[0])){
		for(int i=1;i<12;i++)scanf("%s",table[i]);
		int ret=0;
		for(int i=0;i<12;i++)
			for(int j=0;j<12;j++)
				if(table[i][j]=='1'){
					ret++;
					del(i,j);
				}
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main(){
  
  int m,d;
  cin >> m >> d;
  
  int sum = 0;
  
  for(int i = 1 ; i <= m ; i++){
    
    for(int j = 1 ; j <= d ; j++){
      int a = j%10;
      int b = (j - a)/10;
      if( a >= 2 &&  b >= 2){
        
        if(a*b == i){
          sum++;
        }
      }
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 256