akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    let (n, q) = read!(usize, usize);
    let s: String = read!(String);
    let lr: Vec<(usize, usize)> = read!(usize, usize; q);

    let lr: Vec<_> = lr.into_iter().map(|x| (x.0 - 1, x.1 - 1)).collect();

    let c: Vec<char> = s.chars().collect();

    // dp[i] := 文字列Sの半開区間 [0, i) に「左隣がAであるようなC」が現れる回数
    let mut dp = vec![0usize; n + 1];
    for i in 2..(n + 1) {
        dp[i] = if c[i - 2] == 'A' && c[i - 1] == 'C' {
            dp[i - 1] + 1
        } else {
            dp[i - 1]
        }
    }

    // lからr（両端含む）部分文字列は区間でいうと [l, r+1)
    // この区間内にある'AC'の個数を数えるには、[l+1, r+1)にある「左隣がAであるようなC」をカウントすればよい
    // つまり dp[r+1] - dp[l+1]
    for &(l, r) in &lr {
        println!("{}", dp[r + 1] - dp[l + 1]);
    }
}


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

int main() {
  string S;
  cin >> S;

  if (S[0] != 'A') {
    cout << "WA" << endl;
    return 0;
  }

  bool ok = false;
  int pos = 0;
  for (int i = 2; i < S.size()-1; i++) {
    if (S[i] == 'C') {
      ok = true;
      pos = i;
      break;
    }
  }
  if (!ok) {
    cout << "WA" << endl;
    return 0;
  }

  for (int i = 1; i < S.size(); i++) {
    if (isupper(S[i]) && pos != i) {
      cout << "WA" << endl;
      return 0;
    }
  }
  cout << "AC" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define len(x) (int) (x.size())
using namespace std;
typedef long long ll;

int main() {
    vector<int> myvs {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    
    int k;
    cin >> k;
    cout << myvs[k-1] << '\n';

    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    X = int(input())
    if X >= 30:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()


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

using namespace __gnu_pbds;
template<typename T> 
using gmap = cc_hash_table<T, T, hash<T> >;

//INSERT ABOVE HERE
signed AGC023_A(){
  using ll = long long;
  int n;
  cin>>n;
  vector<ll> a(n);
  for(int i=0;i<n;i++) cin>>a[i];

  map<ll, ll> m;
  ll ans=0,s=0;
  m[s]++;
  for(int i=0;i<n;i++){
    s+=a[i];
    ans+=m[s];
    m[s]++;
  }
  
  cout<<ans<<endl;
  return 0;
}

signed main(){
  AGC023_A();
  return 0;
}


Measured memory_bytes: 14336
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


int main(){
    ll x;
    cin>>x;
    for(ll i=-1000;i<=1000;i++){
        for(ll j=-1000;j<=1000;j++){
            if(i*i*i*i*i-j*j*j*j*j==x){
                cout<<i<<" "<<j<<endl;
                return 0;
            }
        }
    }
}



Measured memory_bytes: 3576
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define _GLIBCXX_DEBUG

vector<int> rest(int a) {
    vector<int> p(2);
    if (a == 0) p = {1, 2};
    else if (a == 1) p = {2, 0};
    else if (a == 2) p = {0, 1};
    return p;
}

int max_list(const vector<int>& l) {
    int ans = 0;
    for (int i : l) {
        ans = max(ans, i);
    }
    return ans;
}

int main() {
    int n;
    cin >> n;
    vector<vector<int>> a(n, vector<int>(3));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> a[i][j];
        }
    }
    vector<vector<int>> dp(n + 1, vector<int>(3));
    // 初期条件はすでにゼロなので必要なし
    for (int k = 1; k < n + 1; ++k) {
        for (int i = 0; i < 3; ++i) {
            vector<int> p = rest(i);
            int x = dp[k - 1][p[0]] + a[k - 1][p[0]];
            int y = dp[k - 1][p[1]] + a[k - 1][p[1]];
            dp[k][i] = max(x, y);
        }
    }
    cout << max_list({dp[n][0], dp[n][1], dp[n][2]}) << endl;
}


Measured memory_bytes: 11136
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <random>

using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
void Calc(){
	long K = rei();
	long X = rei();
	long Y = rei();
	if((X+Y) % 2 != 0 && K % 2 == 0){
		cout << -1 << endl;
		return;
	}
	if(abs(X)+abs(Y) == K){
		cout << 1 << endl;
		cout << X << " " << Y << endl;
		return;
	}
	vector<pair<long,long>> ans;
	long px = 0;
	long py = 0;
	while(1){
		long Dist = abs(X-px)+abs(Y-py);
		if(Dist % 2 == 0 && Dist <= 2*K){
			long mx,my;
			if(abs(X-px) >= abs(Y-py)){
				if(X >= px){
					mx = px + Dist / 2;
				}
				else{
					mx = px - Dist / 2;
				}
				if(Y >= py){
					my = py - (K - Dist / 2);
				}
				else{
					my = py + (K - Dist / 2);
				}
			}
			else{
				if(Y >= py){
					my = py + Dist / 2;
				}
				else{
					my = py - Dist / 2;
				}
				if(X >= px){
					mx = px - (K - Dist / 2);
				}
				else{
					mx = px + (K - Dist / 2);
				}
			}
			
			ans.push_back({mx,my});
			ans.push_back({X,Y});
			break;
		}
		long D = K;
		long nx,ny;
		if(X >= px){
			long v = min(D,X-px);
			D -= v;
			nx = px + v;
		}
		else{
			long v = min(D,px-X);
			D -= v;
			nx = px - v;
		}
		if(Y >= py){
			ny = py + D;
		}
		else{
			ny = py - D;
		}
		px = nx;
		py = ny;
		ans.push_back({px,py});
	}
	cout << ans.size() << endl;
	for(int i=0;i<ans.size();i++){
		cout << ans[i].first << " " << ans[i].second << "\n";
	}
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 6384
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define len(x) (int)(x.size())
#define all(vs) vs.begin(), vs.end()
using ii = pair<int, int>;
using ll = long long;
#define MAXN 200000100


int32_t main(){
	ios::sync_with_stdio(0);
	int n;
	cin >> n;
	string s1, s2;
	cin >> s1 >> s2;
	string ans;
	for(int i=0; i<n; ++i){
		ans.push_back(s1[i]);
		ans.push_back(s2[i]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for a in range(A+1):
    for b in range(B+1):
            if 0 <= (X - 500 * a - 100 * b) <= 50 * C:
                ans += 1
print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
long long a[200001],n,x[200001],c,t;
int main()
{
	int i;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(i=n-1;i>=1;i--)
	{
		x[i]=x[i+1]+a[i+1];
		x[i]%=1000000007;
	}
	for(i=1;i<=n;i++)
	{
		t=(a[i]*x[i])%1000000007; 
		c=(c+t)%1000000007;
	}
	cout<<c<<endl;
	return 0;
}


Measured memory_bytes: 6780
n, k = gets.chomp.split(" ").map(&:to_i)
h = gets.chomp.split(" ").map(&:to_i).sort.reverse!
sum = 0

for i in 0..k
  if n <= k then
    puts 0
    break
  elsif i == k
    h.each{|x| sum += x}
    puts sum
  else
    h[i] = 0
  end
end

Measured memory_bytes: 21380
/*
O(V^3)
負辺があっても動作する。負閉路が存在する場合はそれも検出する(ある頂点 kから kへの最短路が負ならば負閉路が存在)。
↑らしい
*/

#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
template<class T,class U>constexpr bool chmin(T&a,const U b){if(a<=b)return false;a=b;return true;}
template<class T,class U>constexpr bool chmax(T&a,const U b){if(a>=b)return false;a=b;return true;}


template<class T>
struct WarshallFloyd{
    int n;
    T inf;
    vector<vector<T>> table;

    inline WarshallFloyd(int n):n(n),inf(numeric_limits<T>::max()){
        init();
    }
    inline void init(){
        table.assign(n,vector<T>(n,inf));
    }

    inline void add(const int from,const int to,const T v){
        table[from][to]=v;
    }

    void build(){
        for(int k=0;k<n;k++){
            for(int i=0;i<n;i++){
                for(int j=0;j<n;j++){
                    if(table[i][k]==inf || table[k][j]==inf) continue;
                    chmin(table[i][j],table[i][k]+table[k][j]);
                }
            }
        }
    }
    inline T query(const int from,const int to){
        return table[from][to];
    }

    inline void adbuild(const int from,const int to,const T v){
        chmin(table[from][to],v);
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                if(table[i][from]==inf || table[to][j]==inf) continue;
                chmin(table[i][j],table[i][from]+table[to][j]+v);
            }
        }
    }
};

signed main(){
    int v,e;
    cin>>v>>e;
    WarshallFloyd<ll> d(v);
    for(int i=0;i<v;i++){
        d.adbuild(i,i,0);
    }

    while(e--){
        int s,t;
        ll c;
        cin>>s>>t>>c;
        d.adbuild(s,t,c);
    }
    ll inf=numeric_limits<ll>::max();
    for(int i=0;i<v;i++){
        if(d.query(i,i)<0){
            cout<<"NEGATIVE CYCLE"<<endl;
            return 0;
        }
    }
    for(int i=0;i<v;i++){
        for(int j=0;j<v;j++){
            if(j) cout<<" ";
            if(d.query(i,j)==inf) cout<<"INF";
            else cout<<d.query(i,j);
        }
        cout<<endl;
    }
}


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

int main(){
  string s;cin>>s;
  int r=0;
  for(int i=1;i<s.size();++i){
    if(s[i]=='C'&&s[i-1]=='A'){r=1;break;}
  }
  cout<<(r?"Yes":"No");
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

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; }

typedef long long ll;

using namespace std;


class UnionFind
{
public:
  UnionFind(int n)
  {
    parent=vector<int>(n,-1);
  }
  int root(int a)
  {
    if(parent[a]<0)return a;
    return parent[a]=root(parent[a]);
  }
  int size(int a)
  {
    return -parent[root(a)];
  }
  bool connect(int a,int b)
  {
    int A=root(a);
    int B=root(b);
    if(A==B)return false;
    if(size(A)>size(B))swap(A,B);
    parent[B]+=parent[A];
    parent[A]=B;
    return true;
  }
private:
  vector<int> parent;

};
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n,m;
  cin>>n>>m;
  vector<int>p(n),q(n);
  rep(i,n){cin>>p[i];p[i]--;q[p[i]]=i;}
  UnionFind uf(n);
  rep(i,m)
  {
    int a,b;
    cin>>a>>b;
    a--;b--;
    uf.connect(a,b);
  }
  vector<vector<int>>gr(n);
  rep(i,n)
  {
    gr[uf.root(i)].push_back(i);
  }
  int res=0;
  rep(i,n)
  {
    set<int>s1;

    for(auto t:gr[i])
    {
      s1.insert(q[t]);
    }
    for(auto t:gr[i])
    {
      if(s1.count(t))res++;
    }
  }
cout<<res<<endl;
  return 0;

}


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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()


int main() {
  LL a,b,x,ans=0;
  cin >> a >> b >> x;
  
  if(a%x==0)ans++;
  
  ans += b/x-a/x;
  
  cout << ans << endl;
  
  
  return 0;
}

Measured memory_bytes: 256
from heapq import heappush,heappop
H,W = map(int,input().split())
inf=10**10
#[k][j][i]
dp=[[[inf]*10 for i in range(10)]for i in range(11)]
for j in range(10):
    c=[int(k) for k in input().split()]
    for i in range(10):
        dp[0][i][j]=c[i]#jiへのコスト

A=[[int(i) for i in input().split()] for i in range(H)]
for k in range(1,11):
    for j in range(10):
        for i in range(10):
            dp[k][j][i]=min(dp[k-1][j][i],dp[k-1][j][k-1]+dp[k-1][k-1][i])
ans =0
for i in range(W):
    for j in range(H):
        if A[j][i]!=-1 and A[j][i]!=1:
            ans += dp[10][1][A[j][i]]
print(ans)

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  string s;
  cin>>s;
  string t;
  REP(i,s.size())if(s[i]!='x')t+=s[i];
  REP(i,t.size())if(t[i]!=t[t.size()-1-i]){
    puts("-1");
    return 0;
  }
  int ans = 0;
  deque<char> S;
  REP(i,s.size())S.push_back(s[i]);
  while(S.size()){
    if(S.front() == S.back()){
      S.pop_front();
      if(S.size())S.pop_back();
    }else if(S.front()=='x'){
      S.pop_front();
      ans++;
    }else if(S.back()=='x'){
      S.pop_back();
      ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string.h>
using namespace std;

int n, u = 0, w;
long long m = 0;
int a[600][600];
int b[26];

int main()
{
	cin >> n;

	memset(a, -1, sizeof(a));
	memset(b, 0, sizeof(b));

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			char ct;
			int t;
			cin >> ct;
			t = ct - 'a';
			a[i][j] = t;
			a[i + n][j] = t;
			a[i][j + n] = t;
			a[i + n][j + n] = t;
			b[t]++;
		}
	}

	for (int i = 0; i < 26; i++) {
		if (b[i] % 2 == 1)
			u++;
	}

	if (u <= n) {
		for (int j = 0; j < n; j++) {
			bool f = 0;
			for(int k = 0; k < n - 1; k++){
				for(int s = k + 1; s < n; s++){
					if (a[k][j + s] != a[s][j + k]) {
						f = 1;
						break;
					}
				}
				if (f)
					break;
			}									
			if (!f)
				m++;
		}
	}

	cout << m * n << endl;

	return 0;
}

Measured memory_bytes: 1664
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <map>
#include <set>
#include <stdlib.h>
#include <ctype.h>
#include <stack>
#include <bitset>
#include <iterator>
using namespace std;
#define ull unsigned long long
#define ll long long
#define ls k<<1
#define rs k<<1|1
#define lson l,mid,k<<1
#define rson mid+1,r,k<<1|1
typedef pair<int,int> pii;
typedef pair<double,double> pdd;
typedef pair<double,int> pdi;
int lowbit(int x){return x&(-x);}
const int maxn=1e5+5,P=1e9+7;
vector<int> G[maxn];
int n,k;
ll fac[maxn],dp[maxn];
ll fp(ll x,ll y){
    if(y==0) return 1;
    else if(y==1) return x;
    ll t=fp(x*x%P,y>>1)%P;
    if(y&1ll) return t*x%P;
    else return t;
}
ll dfs(int u,int fa){
    int num=(u==1?G[u].size():G[u].size()-1);
    if(u==1){
            if(k-1>=num) dp[u]=fac[k-1]*fp(fac[k-1-num],P-2)%P;
            else dp[u]=0;
    }
    else{
            if(k-2>=num) dp[u]=fac[k-2]*fp(fac[k-2-num],P-2)%P;
            else dp[u]=0;
    }
    for(int i=0;i<G[u].size();++i)if(G[u][i]!=fa)
        dp[u]=dp[u]*dfs(G[u][i],u)%P;
    return dp[u];
}
int main(void){
    scanf("%d%d",&n,&k);
    fac[0]=fac[1]=1;
    for(int i=2;i<=k;++i) fac[i]=fac[i-1]*i%P;
    for(int i=1;i<n;++i){
            int u,v;scanf("%d%d",&u,&v);
            G[u].push_back(v);G[v].push_back(u);
    }
    printf("%lld\n",k*dfs(1,0)%P);
    return 0;
}


Measured memory_bytes: 12416
package main

import (
	"fmt"
  	"bufio"
  	"os"
  	"strings"
)

func main(){
  var sc = bufio.NewScanner(os.Stdin)
  sc.Scan()
  spStr := strings.Split(sc.Text()," ")
  A := spStr[0]
  s := spStr[1]
  C := spStr[2]
  var str string
  str = string(A[0])
  str += string(s[0])
  str += string(C[0])
  fmt.Println(str)
}

Measured memory_bytes: 640
let n = Scanf.scanf " %d" @@ (+) 0
let txys = Array.init n @@ fun _ -> Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let f (t0, x0, y0) (t, x, y) =
  let d = abs (x - x0) + abs(y - y0) in
  if t - t0 < d || (t - t0 - d) mod 2 = 1 then (print_endline "No"; exit 0);
  t, x, y
let _ =
  Array.fold_left f (0, 0, 0) txys |> ignore;
  print_endline "Yes"

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

/*
提出前に確認!
- setとmultisetを間違えない
*/

int	main(void)
{
	int n, d;
	cin >> n >> d;
	int x, y;
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		cin >> x >> y;
		long long distance = (long long)x * x + (long long)y * y;
		if (distance <= (long long)d * d) ans++;
	}
	cout << ans << endl;
	return (0);
}


Measured memory_bytes: 3568
/*まずうちさあ屋上あんだけど、焼いてかない？*/
	#include <bits/stdc++.h>
	using namespace std;
	#define IOS ios::sync_with_stdio(false), cin.tie(0)
	#define REP(i, n) for (int i = 0; i < n; i++)
	#define FOR(i, a, b) for (int i = a; i < b; i++)
	#define ALL(x) (x).begin(), (x).end()
	#define dump(x) cout << (x) << endl
	#define LMAX 9223372036854775807LL
	#define LMIN -9223372036854775807LL

	using ll = long long;
	template<typename T>
	using vec = vector<T>;
	using P = pair<ll, ll>;

	template <typename A, size_t N, typename T>
	void Fill(A (&array)[N], const T &val){
		fill((T *)array, (T *)(array + N), val);
	}
	
	ll pas[51][52];
	const ll INF = 1e18;
	const ll mod = 1e9 + 7;

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

	const ll nmax = 41,abmax = 401;
	ll dp[nmax][abmax][abmax];

	int main(){
		IOS;
		string s;
		cin >> s;
		int n = s.size();
		int x = n / 2; //p出せる回数
		ll ans = 0;
		string t = "";
		REP(i,x)t = t + "p";
		FOR(i,x,n)t = t + "g";
		REP(i,n){
			if(s[i] == 'g' && t[i] == 'p')ans++;
			if(s[i] == 'p' && t[i] == 'g')ans--;
		}
		dump(ans);
	}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int a, b;
  	cin >> a >> b;
 	auto keta = [&](int x){
    	int ans=0;
      	while(x>0){
        	x /= 10;
          	ans++;
        }
      	return ans;
    };
  	rep(i,keta(b)) a *= 10;
  	int c = a+b;
	int r = floor(sqrt(c));
	if(r*r==c) puts("Yes");
  	else puts("No");
  	return;
}

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

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <limits>

using ull = unsigned long long;

constexpr ull INF = std::numeric_limits<ull>::max();

ull H, W;

int main(){
	
	std::cin >> H >> W;

	if(H % 3 == 0 || W % 3 == 0){
		std::cout << 0 << std::endl;
		return 0;
	}

	ull ans = INF;

	for(int i = 1; i < H; ++i){
		ull s1[3] = {i * W, (H - i) * (W / 2), (H - i) * (W - (W / 2))};
		std::sort(s1, s1 + 3);
		ans = std::min(ans, s1[2] - s1[0]);
		ull s2[3] = {i * W, ((H - i) / 2) * W, ((H - i) - (H - i) / 2)  * W};
		std::sort(s2, s2 + 3);
		ans = std::min(ans, s2[2] - s2[0]);
	}
	for(int i = 1; i < W; ++i){
		ull s1[3] = {i * H, (W - i) * (H / 2), (W - i) * (H - (H / 2))};
		std::sort(s1, s1 + 3);
		ans = std::min(ans, s1[2] - s1[0]);
		ull s2[3] = {i * H, ((W - i) / 2) * H, ((W - i) - (W - i) / 2)  * H};
		std::sort(s2, s2 + 3);
		ans = std::min(ans, s2[2] - s2[0]);
	}
	std::cout << ans << std::endl;

	return 0;
}


Measured memory_bytes: 384
import numpy as np
h,w=list(map(int,input().split()))
n=[list(input())for i in range(h)]
s=np.array(n)
s=s.T
s=s.tolist()
s=[t for t in s if t!=["."]*h]
k=len(s)
p=np.array(s)
p=p.T
p=p.tolist()
p=[t for t in p if t!=["."]*k]
for i in range(len(p)):
    h=p[i]
    d=len(h)
    c=""
    for j in range(d):
        c+=h[j]
    print(c)    

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

int main() {
  int n,T,ans = 10000;
  cin >> n >> T;
  for(int i = 0;i < n;i++){
    int c,t;
    cin >> c >> t;
    if(t <= T && c < ans) ans = c;
  }
  if(ans == 10000) cout << "TLE" << endl;
  else cout << ans << endl;
}


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

int main(int argc, char *argv[]){
  int n;
  std::cin >> n;
  std::vector<int> p(n);
  for(auto &_p: p)
    std::cin >> _p;
  int cnt = 0;
  for(int i=1;i<n-1;i++){
    if(p[i] > p[i-1] && p[i] <= p[i+1])
      cnt++;
    else if(p[i] > p[i+1] && p[i] <= p[i-1])
      cnt++;
  }
  std::cout << cnt << std::endl;
  return 0;
}

Measured memory_bytes: 256
import sys
def main():
  N,M = map(int, input().split())
  AB = []
  for _ in range(N):
    AB.append(list(map(int,input().split()))) 
  AB.sort(key = lambda x: x[0])
  ans = 0
  sumB = 0
  for row in AB:
    if row[1] > (M - sumB):
      ans += row[0] * (M - sumB)
      print(ans)
      sys.exit()
    else:
      ans += row[0] * row[1]
      sumB += row[1]
  print(ans)
main()

Measured memory_bytes: 29024
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define endl "\n"
#define f(i, a, b) for(ll i=a; i<b; i++)
#define fb(i, a, b) for(ll i=a; i>=b; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define vi vector <int>
#define vl vector <long long>
#define pi pair <int, int>
#define sz(x) (int) x.size()
#define M 100005
#define mod 1000000007
using namespace std;

void solve()
{
	string s;
	cin>>s;
	if(s == "ABC") cout<<"ARC";
	else cout<<"ABC";
}

int main()
{
    IOS
    int t = 1;
    //cin>>t;
    f(tno, 1, t+1)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define Max(a,b) a>b?a:b
int dp[2010][2010];
int a[2010],b[2010];
const int mod=1000000007;
int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    for(int i=1;i<=m;i++)
        scanf("%d",&b[i]);
    for(int i=0;i<=n;i++)
        for(int j=0;j<=m;j++)
            dp[i][j]=0;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            dp[i][j]=dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1];// 可能出现负
            if(a[i]==b[j]) dp[i][j]+=dp[i-1][j-1]+1;
            if(dp[i][j]<0) dp[i][j]+=mod;
            if(dp[i][j]>=mod) dp[i][j]%=mod;
        }
    printf("%d\n",(dp[n][m] + 1) % mod);
}

Measured memory_bytes: 16000
#include<iostream>
#include<string>
#include<cstdio>
#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>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = (ll)(1e+9) + 7;
const ll INF = (ll)1000000007 * 1000000007;
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 long double ld;
typedef complex<ld> Point;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
#include<cstring>
struct edge { int to, cap, rev; };
vector<edge> G[100000];
bool used[100000];
void add_edge(int from, int to, int cap) {
	G[from].push_back(edge{ to, cap, (int)G[to].size() });
	G[to].push_back(edge{ from, 0, (int)G[from].size() - 1 });
}
int dfs(int v, int t, int f) {
	if (v == t)return f;
	used[v] = true;
	for (int i = 0; i < (int)G[v].size(); i++) {
		edge &e = G[v][i];
		if (!used[e.to] && e.cap > 0) {
			int d = dfs(e.to, t, min(f, e.cap));
			if (d > 0) {
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}
int max_flow(int s, int t) {
	int flow = 0;
	for (;;) {
		memset(used, 0, sizeof(used));
		int f = dfs(s, t, mod);
		if (f == 0)return flow;
		flow += f;
	}
}
char lake[100][100];
int main() {
	int h, w; cin >> h >> w;
	int sta, goal;
	rep(i, h) {
		rep(j, w) {
			cin >> lake[i][j];
			if (lake[i][j] == 'S') {
				sta = i * w + j;
			}
			else if (lake[i][j] == 'T') {
				goal = i * w + j;
			}
		}
	}
	int t = h * w;
	rep(i, h) {
		rep(j, w) {
			add_edge(t + i * w + j, i*w + j, 1);
			if (lake[i][j] == '.')continue;
			rep(k, w) {
				if (lake[i][k] == '.')continue;
				add_edge(i*w + j, t+i*w + k, mod);
			}
			rep(k, h) {
				if (lake[k][j] == '.')continue;
				add_edge(i*w + j, t+k*w + j, mod);
			}
		}
	}
	int out = max_flow(sta, t + goal);
	if (out >= (int)mod)cout << -1 << endl;
	else cout << out << endl;
	return 0;
}


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

using namespace std;
typedef long long ll;

int main() {
  string S; cin >> S;
  ll ans = 1000;
  for (ll j=0; j < S.length()-2; ++j) {
    ll v = stoi(S.substr(j, 3));
    ans = min(ans, abs(753-v));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
// Problem Link: 
// Tutorial Link: 

#include<bits/stdc++.h>
 
using namespace std;
 
#define LL long long
#define pb push_back
#define pLL pair<LL,LL>
#define ff first
#define ss second
#define rep(i,a,b) for(LL i=a;i<=b;++i)
#define repb(i,a,b) for(LL i=a;i>=b;--i)
#define ld double
#define mp make_pair
#define vLL vector<LL>
#define vpLL vector<pLL>
#define vld vector<ld>
#define pld pair<ld,ld>
#define vpld vector<pld>
#define SLL set<LL>
#define SpLL set<pLL>
#define FIO ios::sync_with_stdio(false)
#define mod 1000000007

int main()
{
    char c;
    cin >> c;
    if(isupper(c)) {
        cout << 'A';
    }
    else {
        cout << 'a';
    }
}

Measured memory_bytes: 3620
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define INIT    \
    cin.tie(0); \
    ios::sync_with_stdio(false);

template <class T>
inline bool chmax(T& a, T b) {
    return a = (a < b) ? b : a;
}
template <class T>
inline bool chmin(T& a, T b) {
    return a = (a > b) ? b : a;
}

ll const INF = 1LL << 60;
ll const MOD = 1000000007;

ll euclidean_gcd(ll a, ll b) {
    if (a < b) return euclidean_gcd(b, a);

    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }

    return b;
}

vector<ll> divisor(ll n) {
    vector<ll> res;

    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            res.push_back(i);
            if (i != n / i) res.push_back(n / i);
        }
    }

    return res;
}

int main() {
    INIT;

    ll N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];

    auto itr = max_element(ALL(A));
    ll idx = (ll)(distance(A.begin(), itr));
    ll maxA = A[idx];

    vector<pair<ll, bool>> cnt;
    rep(i, maxA + 5) {
        pair<ll, bool> p = make_pair(0, false);
        cnt.pb(p);
    }
    rep(i, SZ(A)) {
        cnt[A[i]].first++;
        cnt[A[i]].second = true;
    }

    sort(ALL(A), greater<ll>());

    ll ans = 0;
    rep(i, SZ(A)) {
        if (cnt[A[i]].first > 1 && cnt[A[i]].second) {
            cnt[A[i]].second = false;
            continue;
        }

        vector<ll> divs = divisor(A[i]);
        rep(j, SZ(divs)) {
            if (A[i] == divs[j]) {
                continue;
            }

            if (cnt[divs[j]].first > 0) {
                cnt[A[i]].second = false;
            }
        }

        // cout << "A:" << A[i] << " ------" << endl;
        // rep(j, SZ(cnt)) {
        //     if (cnt[j].first > 0) {
        //         cout << j << ": " << cnt[j].first << ", " << cnt[j].second
        //              << endl;
        //     }
        // }
    }

    rep(i, SZ(A)) {
        if (cnt[A[i]].second) ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 21208
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Cost {
	int y, x;
	int cost;

	public Cost(int y, int x, int cost) {
		this.y = y;
		this.x = x;
		this.cost = cost;
	}
}

final class Solver {
	void solve(Supplier<String> sc) {
		int H = Integer.parseInt(sc.get());
		int W = Integer.parseInt(sc.get());
		int Sy = Integer.parseInt(sc.get()) - 1;
		int Sx = Integer.parseInt(sc.get()) - 1;
		int Ty = Integer.parseInt(sc.get()) - 1;
		int Tx = Integer.parseInt(sc.get()) - 1;
		var maze = new char[H][];
		Arrays.setAll(maze, $ -> sc.get().toCharArray());

		var queue = new PriorityQueue<>(Comparator.comparingInt((Cost c) -> c.cost));
		queue.add(new Cost(Sy, Sx, 0));
		var visited = new BitSet[H];
		var queuedCost = new int[H][W];
		Arrays.setAll(visited, $ -> new BitSet());
		{
			var inf = new int[W];
			Arrays.fill(inf, Integer.MAX_VALUE);
			Arrays.setAll(queuedCost, $ -> Arrays.copyOf(inf, W));
		}
		int[] dy = {1, -1, 0, 0};
		int[] dx = {0, 0, 1, -1};
		while (!queue.isEmpty()) {
			var next = queue.remove();
			visited[next.y].set(next.x);

			if (next.y == Ty && next.x == Tx) {
				System.out.println(next.cost);
				return;
			}

			for (int i = 0; i < 4; i++) {
				var e = new Cost(next.y + dy[i], next.x + dx[i], next.cost);
				if (isValid(maze, e) && !visited[e.y].get(e.x) && e.cost < queuedCost[e.y][e.x]) {
					queuedCost[e.y][e.x] = e.cost;
					queue.add(e);
				}
			}
			for (int i = -2; i <= 2; i++) {
				for (int j = -2; j <= 2; j++) {
					if (i == 0 && j == 0) continue;
					var e = new Cost(next.y + i, next.x + j, next.cost + 1);
					if (isValid(maze, e) && !visited[e.y].get(e.x) && e.cost < queuedCost[e.y][e.x]) {
						queuedCost[e.y][e.x] = e.cost;
						queue.add(e);
					}
				}
			}
		}
		System.out.println(-1);
	}

	boolean isValid(char[][] maze, Cost yx) {
		if (yx.y < 0 || maze.length <= yx.y) return false;
		if (yx.x < 0 || maze[0].length <= yx.x) return false;
		return maze[yx.y][yx.x] != '#';
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().solve(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  ll n;
  cin >> n;
  multiset<ll> s;
  REP(i,n) {
    ll ai;
    cin >> ai;
    ai *= -1;
    auto it = s.upper_bound(ai);
    if(it!=s.end()){
      s.erase(it);
    }
    s.insert(ai);
  }

  cout << s.size() << endl;
  return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;

int main(){
	int N,M;
	cin >> N >> M;
	vector<vector<int>> A(M);
	rep(i,N){
		int a,b;
		cin >> a >> b;
		if(a>M)continue;
		A[M-a].push_back(b);
	}

	priority_queue<int> q;
	ll ans = 0;
	for(int i=M-1; i>=0; i--){
		for(int b: A[i]){ q.push(b); }
		if(!q.empty()){ ans += q.top(); q.pop(); }
	}
	cout << ans << endl;
	
}


Measured memory_bytes: 5504
n = int(input())

a = list(map(int, input().split()))

d = {}

for i in a:
  for j in range(i - 1, i + 2): #aの値の両隣まで
    d[j] = d.get(j, 0) + 1#getは第一引数で指定したキーがなかったら第二引数で指定した値を戻す
    
    
print(max(d.values()))

Measured memory_bytes: 19708
#include <iostream>

using namespace std;
const int MAX=3000+1;
string a, b;
int n, m;

int dp[MAX][MAX];
int vis[MAX][MAX];
string ans[MAX][MAX];

int solve(int i, int j){
    if(i >= n || j >= m) return 0;
    int &ret=dp[i][j];
    if(~ret) return ret;
    if(a[i]==b[j]) return ret=1+solve(i+1, j+1);
    ret=max(solve(i+1, j), solve(i, j+1));
    return ret;
}

string build(int i, int j){
    if(i >= n || j >= m) return "";
    string &res=ans[i][j];
    if(vis[i][j]) return res;
    vis[i][j]=1;
    int ret=dp[i][j];
    if(a[i]==b[j]) {
        return res=a[i]+build(i+1, j+1);
    }
    if(solve(i+1, j)==ret){
        res = build(i+1, j);
    } else {
        res =build(i, j+1);
    }
    return res;
}


int main(){

    cin >> a >> b;
    n=a.length(), m=b.length();
    for(int i=0;i<n;i++) for(int j=0;j<m;j++) dp[i][j]=-1;
    int cost=solve(0, 0);
    cout << build(0, 0) << endl;

    return 0;
}


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



void rectangle(int H, int W) {

    for (int i = 0; i < H; i++) {
        if (i == 0 || i == H-1)  {
            for (int j = 0; j < W; j++) {
                cout << "#";
            }
        } else {
            for (int j = 0; j < W; j++) {
                if (j == 0 || j == W-1) {
                    cout << "#";
                } else {
                    cout << ".";
                }
            }
        }
        printf("\n");
    }
    printf("\n");

}

int main(int argc, char const *argv[]) {

    while (1) {
        int H, W;
        cin >> H >> W;
        
        if (H == 0 && W == 0) {
            break;
        } else {
            rectangle(H, W);
        }
    }

    return 0;
}



Measured memory_bytes: 3032
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp makepair
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n" 
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
int main()
{
  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
  ll n;
  cin>>n;
  cout<<fixed<<setprecision(15)<<2*n*3.141592653589793238;
}

Measured memory_bytes: 3796
#include <bits/stdc++.h>
using namespace std;
int mat[105][105];
int v[105];
int main(){
	int n,m;cin>>n>>m;
	for(int i=0;i<n;i++)for(int j=0;j<m;j++)cin>>mat[i][j];
	for(int i=0;i<m;i++)cin>>v[i];
	for(int i=0;i<n;i++){
		int res=0;
		for(int j=0;j<m;j++)res+=mat[i][j]*v[j];
		cout<<res<<endl;
	}
	return 0;
}





Measured memory_bytes: 3144
#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main(void){
    // Your code here!
    int a,b,d,r;
    double f;
    cin>>a>>b;
    d=a/b;
    r=a%b;
    f=(double)a/b;
    cout<<d<<" "<<r<<" ";
    printf("%f\n",f);
    return 0;
}



Measured memory_bytes: 3204
// inputに入力データ全体が入る
function Main(input) {
  var ar = input.split(' ').map(v=>Number(v));
  var M = ar[0];
  var D = ar[1];
  var cnt = 0;
  for(var m = 1; m <= M; m++){
    for(var d = 10; d <= D; d++){
      var d1 = String(d)[0];
      var d10 = String(d)[1];
      if(d1 >= 2 && d10 >= 2 && d1*d10==m) cnt++;
    }
  }
  console.log(cnt);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7628
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main implements Closeable {

  private InputReader in = new InputReader(System.in);
  private PrintWriter out = new PrintWriter(System.out);

  public void solve() {
    int x = in.ni(), n = in.ni();
    boolean[] forbidden = new boolean[201];
    for (int i = 0; i < n; i++) {
      int next = in.ni();
      forbidden[next] = true;
    }
    int result = 500, diff = 500;
    for (int i = 0; i <= 200; i++) {
      if (!forbidden[i]) {
        int abs = Math.abs(x - i);
        if (abs < diff) {
          result = i;
          diff = abs;
        } else if (abs == diff) {
          result = Math.min(result, i);
        }
      }
    }
    out.println(result);
  }

  @Override
  public void close() throws IOException {
    in.close();
    out.close();
  }

  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int ni() {
      return Integer.parseInt(next());
    }

    public long nl() {
      return Long.parseLong(next());
    }

    public void close() throws IOException {
      reader.close();
    }
  }

  public static void main(String[] args) throws IOException {
    try (Main instance = new Main()) {
      instance.solve();
    }
  }
}


Measured memory_bytes: 33072
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
	int n, m;
	cin >> n >> m;
	int count = 0;
	count += n * (n - 1) / 2;
	count += m * (m - 1) / 2;
	cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define INF             1e14
#define dd              double
#define MOD             1000000007
#define my_sizeof(type) ((char *)(&type+1)-(char*)(&type)) 
#define nl              cout<<endl
#define fill(a,val)     memset(a,val,sizeof(a))
#define mp              make_pair
#define endl            "\n"
#define pb              push_back
#define ff              first    
#define ss              second
#define SIZE            200005
#define all(v)          v.begin(),v.end()
#define s(ar,n)         sort(ar,ar+n)
#define rs(ar,n)        sort(ar, ar+n, greater<ll>()) 
#define oa(a,n)         for(ll i=0;i<n;i++)cout<<a[i]<<" ";nl
#define cn(a,n)         for(ll i=0;i<n;i++)cin>>a[i];
#define maxa(ar,N)      *max_element(ar,ar+N)
#define mina(ar,N)      *min_element(ar,ar+N)
#define fastio()        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define printclock      cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
ll power(ll x, ll y){
    ll res=1;x=x;
    while(y>0){
        if(y&1)
            res = (res*x);
        y = y>>1;
        x = (x*x);
    }
    return res;
}  
ll logtwo(ll n){
    if(n==1)
        return 0;
    return logtwo(n/2)+1;
}
vector<string> vec;
ll N,M,Q;
void permutation(string s)
{
    if(s.size()==N)
        vec.pb(s);
    else
    {
        ll k=(int)(s.back()-'0');
        for(ll i=k;i<=M;i++)
        {
            string st=s;
            st+=(char)(i+'0');
            permutation(st);
        }
    }
}
signed main()
{
    fastio();   
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    int t=1;
    //cin>>t;
    while(t--)
    {
        cin>>N>>M>>Q;
        ll ar[4][Q];
        for(ll i=0;i<Q;i++)
        {
            cin>>ar[0][i]>>ar[1][i]>>ar[2][i]>>ar[3][i];
        }
        for(ll i=1;i<=M;i++)
        {
            string s="";
            s+=(char)(i+'0');
            permutation(s);
        }
        ll ans=0;
        for(ll i=0;i<vec.size();i++)
        {
            string s=vec[i];
            ll temp=0;
            for(ll i=0;i<Q;i++)
            {
                if(s[ar[1][i]-1]-s[ar[0][i]-1]==ar[2][i])
                    temp+=ar[3][i];
            }
            ans=max(ans,temp);
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 7428
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
int n;
ll W,weight,v,w0,ans=0,savew,savev;
ll dp[4][101];
int main(int argc,char const* argv[])
{
  cin >> n >> W;
  vector<ll> w[4];
  for(ll i=0;i<n;i++)
    {
      cin >> weight >> v;
      if(i==0)
  {
    w0=weight;
    w[0].push_back(v);
  }
      else if(weight==w0) w[0].push_back(v);
      else if(weight==(w0+1)) w[1].push_back(v);
      else if(weight==(w0+2)) w[2].push_back(v);
      else if(weight==(w0+3)) w[3].push_back(v);
    }
  for(int i=0;i<4;i++) sort(w[i].rbegin(),w[i].rend());
  for(int i=0;i<4;i++)
    {
      for(int j=0;j<w[i].size();j++) dp[i][j+1]=dp[i][j]+w[i][j];
    }
  for(int i=0;i<=w[0].size();i++)
    {
      for(int j=0;j<=w[1].size();j++)
  {
    for(int k=0;k<=w[2].size();k++)
      {
        for(int l=0;l<=w[3].size();l++)
    {
      savew=w0*i+(w0+1)*j+(w0+2)*k+(w0+3)*l;
      savev=dp[0][i]+dp[1][j]+dp[2][k]+dp[3][l];
      if(savew<=W) ans=max(ans,savev);
    }
      }
  }
    }
  cout << ans << endl;
  return 0;
}


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

int main() {
  vector<int> x(5,0);
  for (int i=0;i<5;++i) {
    cin >> x[i];
  }
  string s = "Yay!";
  int k;
  cin >> k;
  for (int i=0; i<5; ++i) {
    for (int j=i+1; j<5; ++j) {
      if (x[j] - x[i] > k) {
        s = ":(";
      }
    }
  }
  cout << s << endl;
  return 0;
}




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

result = 1
bt=0
bx=0
by= 0

for i in range(N):
	t, x, y = map(int, input().split())
	distance = abs(x-bx) + abs(y-by)
	dur = t - bt
#	print(t,x,y,distance, dur)
	if dur - distance >= 0 and (dur - distance) %2 == 0:
		(bt,bx,by) = (t,x,y)
		continue
	else:
		result = 0
		break

if result:
	print("Yes")
else:
	print("No")




Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if((a*b)>(c*d))
	cout<<a*b;
	else if((c*d)>(a*b))
	cout<<c*d;
	else if((c*d)==(a*b))
	cout<<c*d;
	
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){

    int N;cin>>N;
    int mochi[110];
    for(int i=0;i<N;i++)cin>>mochi[i];
    int num[110]={0};
    for(int j=0;j<N;j++){
        num[mochi[j]]++;
    }
    int output=0;
    
    for(int k=1;k<=100;k++){
        if(num[k])output++;
    }

    
    
    cout<<output<<endl;
    return 0;
    
}

Measured memory_bytes: 256
n = int(input())
n1 = n

count = 0
while(n1 > 0):
    n1 = n1 // 10
    count = count + 1

if count == 1:
    print(n)
elif count == 2:
    print(9)
elif count == 3:
    print(9 + (n - 100) + 1)
elif count == 4:
    print(909)
elif count == 5:
    print(909 + (n - 10000) + 1)
else:
    print(90909)


Measured memory_bytes: 3064
#include<iostream>

using namespace std;

int main(){

    string key;
    cin>> key;
    int N;
    cin>> N;
    string s[N];
    for(int i=0; i<N; i++){
        cin>> s[i];
    }

    for(int i=0; i<N; i++){
        s[i]+=s[i];
    }

    int ans=0;
    for(int i=0; i<N; i++){
        if(s[i].find(key)!=-1) ans++;
    }

    cout<< ans<< endl;

    return 0;
}

Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
     
int main(){
  string O,E;
  cin>>O>>E;
  if(O.size()-E.size()==0){
    for(int i=0;i<O.size();i++)cout<<O[i]<<E[i];
  }
  else {
    for(int i=0;i<O.size()-1;i++)cout<<O[i]<<E[i];
    cout<<O[O.size()-1];
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <string>
#include <map>
#include <set> 
#include <queue> 
#define ll long long
#define FAST_IO ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
ll n,m;
struct node{
	ll from,to;
}road[5000005];
ll num;
ll flag[5000005],first[5000005];
queue<int> q;
void add(ll u,ll v){
	road[++num].from=v;
	road[num].to=first[u];//u
	first[u]=num;
}
void bfs(ll tv,ll c){
	flag[tv]=c;
	q.push(tv);
	while(!q.empty()){
		ll tmp=q.front();
		q.pop();
		for(ll i=first[tmp];i;i=road[i].to){
			if(flag[road[i].from]==0){
				q.push(road[i].from);
				flag[road[i].from] = tmp;
			}
		}
	}
}
int main() 
{
	FAST_IO;
	cin>>n>>m;
	ll u,v;
	ll f=1;
	for(ll i=1;i<=m;i++){
		cin>>u>>v;
		add(u,v);
		add(v,u);
	}
	bfs(1,1);
	for(ll i=1;i<=n;i++){
		if(flag[i]==0)f=0;
	}
	if(f==0)cout<<"No"<<endl;
	else{
		cout<<"Yes"<<endl;
		for(ll i=2;i<=n;i++){
			cout<<flag[i]<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 11388