akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <functional>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <ctime>
#include <complex>

#define enp 	printf("**Entry Point**\n")
#define A		first
#define B		second
#define MP		make_pair

using namespace std;

typedef long long ll;

const int INF = 0x6fffffff;
const int MINF = 0x80000000;
const ll mod = 1000000007;
const int cons = 100001;
const double pi = 3.141592653589793;

int ans[300001];
bool chk[300001];

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

	if (n == 1)
	{
		puts("Yes");
		printf("1");
		return 0;
	}

	if (x == 1 || x == 2 * n - 1)puts("No");
	else
	{
		puts("Yes");

		if (n == 2)
		{
			printf("1\n2\n3\n");
			return 0;
		}

		ans[n] = x;
		chk[x] = true;
		if (x == 2 * n - 2)
		{
			ans[n - 1] = 2 * n - 1;
			chk[2 * n - 1] = true;
			ans[n - 2] = x - 1;
			ans[n + 1] = x - 2;
			chk[x - 1] = true;
			chk[x - 2] = true;

			int cur = 1;
			for (int i = 1; i <= 2 * n - 1; i++)
			{
				if (ans[i])continue;
				while (chk[cur])cur++;
				ans[i] = cur;
				//		chk[cur] = true;
				cur++;
			}
		}
		else
		{
			ans[n - 1] = x - 1;
			chk[x - 1] = true;
			ans[n - 2] = x + 1;
			ans[n + 1] = x + 2;
			chk[x + 1] = true;
			chk[x + 2] = true;

			int cur = 2*n - 1;
			for (int i = 1; i <= 2 * n - 1; i++)
			{
				if (ans[i])continue;
				while (chk[cur])cur--;
				ans[i] = cur;
				//		chk[cur] = true;
				cur--;
			}
		}

		for (int i = 1; i <= 2*n - 1; i++)
		{
			printf("%d\n", ans[i]);
		}
	}

	return 0;
}

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

using namespace std;

int main(int argc, const char *argv[]) {
  vector<vector<int>> g{{2}, {4, 6, 9, 11}, {1, 3, 5, 7, 8, 10, 12}};
  int x, y;
  cin >> x >> y;

  auto group = [&](int n) {
    int ans = 0;
    for (int i = 0; i < g.size(); ++i) {
      for (int j = 0; j < g[i].size(); ++j) {
        if (g[i][j] == n) {
          ans = i;
          break;
        }
      }
    }

    return ans;
  };

  cout << (group(x) == group(y) ? "Yes" : "No") << '\n';
  return 0;
}

Measured memory_bytes: 3488
function toInt(d) {
  return parseInt(d)
}

function Main(input) {
  const data = input.split("\n")
  const field = data[0].split(' ').map(toInt)
  const A = field[0]
  const B = field[1]
  const K = field[2]

  var a = A
  var b = B

  var t = 'a'

  for (var i = 0; i < K; i++) {
    if (t === 'a') {
      if (a % 2 !== 0) {
        a--;
      }

      var pa = a / 2

      a = a - pa
      b = b + pa
      t = 'b'
    } else {
      if (b % 2 !== 0) {
        b--;
      }

      var pb = b / 2

      a = a + pb
      b = b - pb
      t = 'a'
    }
  }

  console.log(a + ' ' + b)
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"))

Measured memory_bytes: 21064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main(int argc, char *argv[]) { ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);


  ll n;cin>>n;
  map<ll,ll> mp;
  ll sum=0;
  for(ll i=0;i<n;i++){
    ll t;cin>>t;mp[t]++;
    sum+=t;
  }
  ll q;cin>>q;
  for(ll i=0;i<q;i++){
    ll b,c;cin>>b>>c;
    sum -= b*mp[b];
    sum += c*mp[b];
    cout<<sum<<endl;
    mp[c]+=mp[b];
    mp[b]=0;
  }
  
  return 0;
}


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

#define mod 1000000007

using namespace std;
 
int main(void){
	
	int n, count=0;
	
	cin >> n;
	
	int p[n];
	
	for(int i=0; i<n; i++)
		cin >> p[i];
	
	for(int i=1; i<n-1; i++){
		if((p[i-1] < p[i] && p[i] < p[i+1]) || (p[i-1] > p[i] && p[i] > p[i+1])){
			count++;
		}
	}
	
	cout << count;
	
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Numerics;
namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().Trim().Split(' ').Select(Decimal.Parse).ToArray();
            var b = a[0] * a[1];
            Console.WriteLine(Math.Floor(b));
        }
    }
}


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



// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    // Failed to predict input format
    string S;
    int Q;
    deque<char> first;
    deque<char> last;

    cin >> S >> Q;
    int f;
    char c;
    int inv_count = 0;
    for(int i = 0; i < Q; i++) {
        int t;
        cin >> t;
        if(t == 1) {
            // 反転する
            // vector<string> temp = first;
            // first = last;
            // last = temp;
            inv_count++;
        } else {
            cin >> f >> c;
            if(f == 1) { // 
                if(inv_count % 2 == 0) {first.push_back(c);}
                else {last.push_back(c);}
            }else {
                // last.push_back(c);
                if(inv_count % 2 == 0) {last.push_back(c);}
                else {first.push_back(c);}
            }
        }
    }

    if(inv_count % 2 == 0) {
        // cout << "b";
        for(int i = first.size()-1; i >= 0; i--) cout << first[i];
        for(int i = 0; i < S.size(); i++) cout << S[i];
        for(int i = 0; i < last.size(); i++) cout << last[i];
    }else{
        // cout << "c";
        for(int i = last.size()-1; i >= 0; i--) cout << last[i];
        for(int i = S.size() -1; i >= 0; i--) cout << S[i];
        for(int i = 0; i < first.size(); i++) cout << first[i];
        
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 896
//#define _GLIBCXX_DEBUG

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++){cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++){for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>vector<vector<T>>vec(ll x, ll y, T w){vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v(ts...))>(a,make_v(ts...));}
template<typename T1, typename T2>ostream &operator<<(ostream &os, const pair<T1, T2>&p){return os << p.first << " " << p.second;}
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v){for(auto &z:v)os << z << " ";cout<<"|"; return os;}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  string s;cin>>s;
  rep(i,0,s.size())res+=s[i]-'0';
  ans1(res%9==0);
  return 0;
}

Measured memory_bytes: 3780
#include<stdio.h>
#include<math.h>
#define ll long long
int main()
{
    ll N,i,t=1,a=1;
    scanf("%lld",&N);
    ll A[N+1],l[N+1];
    for(i=0;i<N+1;i++)scanf("%lld",&A[i]);
    l[N]=A[N];
    for(i=N-1;i>0;i--)l[i]=A[i]+l[i+1];
    for(i=1;i<=N;i++){
        if(2*t<A[i]){
            a=-1;
            break;
        }
        if(t*2<l[i])t*=2;
        else t=l[i];
        a+=t;
        t-=A[i];
    }
    if(A[0]!=0)a=-1;
    if(N==0 && A[0]==1)a=1;
    printf("%lld",a);
    return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
   
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin>>n;
    int a[n];
    for (int i=0;i<n;i++) cin>>a[i];
    long long int sum=0;
    for (int i=1;i<n;i++){
        if(a[i]<a[i-1]){
            sum+=a[i-1]-a[i];
            a[i]=a[i-1];
        }
    }
    cout<<sum<<"\n";
	return 0;
}

Measured memory_bytes: 4396
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <bitset>
#include <cstring>
#include <map>
#include <math.h>
#include <queue>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> P;
#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1<<30;
const ll LINF = 1LL<<58;
const int mod = 1000000007;

int main(){
	int x, a;
	cin >> x >> a;
	if(x<a) cout << 0 << endl;
	else cout << 10 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F(i, l, r) for(int i = (l), _end_ = (int)(r); i <= _end_; ++i)
#define f(i, r, l) for(int i = (r), _end_ = (int)(l); i >= _end_; --i)
#define Set(a, v) memset(a, v, sizeof(a))
#define file(a) freopen(a".in","r",stdin),freopen(a".out","w",stdout)
using namespace std;

bool chkmin(int &a, int b) {return b < a ? a = b, 1 : 0;}
bool chkmax(int &a, int b) {return b > a ? a = b, 1 : 0;}

inline int read() {
 int x = 0, fh = 1; char ch = getchar();
    for (; !isdigit(ch); ch = getchar() ) if (ch == '-') fh = -1;
    for (; isdigit(ch); ch = getchar() ) x = (x<<1) + (x<<3) + (ch ^ '0');
    return x * fh;
}
int n,m;
int a[100005];
int vis[100005];
int cnt;
int fa[100005];
vector<int>e[100005];
int find(int x){return x==fa[x]?fa[x]:fa[x]=find(fa[x]);}
int main () {
    n=read();
	m=read();
	cnt=n;
	F(i,1,n)a[i]=read(),fa[i]=i;
	F(i,1,m){
	    int x=read(),y=read();
		x++;
		y++;
		 if(find(x)!=find(y))fa[find(x)]=find(y),cnt--;
	}
	if(cnt*2-2>n){
	  puts("Impossible");
	  return 0;
	}
	if(cnt==1){
	   puts("0");
	   return 0;
	}
	long long ans=0,tot=cnt*2-2;
	F(i,1,n){
	   e[find(i)].push_back(a[i]);
	}
	F(i,1,n){
	   if(e[i].size()){
	      sort(e[i].begin(),e[i].end());
		  ans+=e[i][0];
		  for(int j=1;j<e[i].size();j++)e[n+1].push_back(e[i][j]);
	       tot--;
	   }
	}
	sort(e[n+1].begin(),e[n+1].end());
	F(i,0,tot-1)ans+=e[n+1][i];
	printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 5504
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>
#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define GI(i) (scanf("%d",&i))
#define GLL(i) (scanf("%lld",&i))
#define GD(i)  (scanf("%lf",&i))
#define PB          push_back
#define MP          make_pair
#define MT          make_tuple
#define GET0(x)     (get<0>(x))
#define GET1(x)     (get<1>(x))
#define GET2(x)     (get<2>(x))
#define ALL(X)      (X).begin(),(X).end()
#define LLMAX       (1LL<<60)
#define LLMIN       -(1LL<<60)
#define IMAX        (1<<30)
#define IMIN        -(1<<30)
typedef long long LL;
using namespace std;

int N;
int cache[100+1][100+1][2];

int rec(int A,int B,int isA){
    int &r = cache[A][B][isA];
    if(r!=-1)
        return r;
    r = false;
    if(isA){
        if(A+1<B)
            r |= (~rec(A+1,B,isA^1));
        else if(1<A)
            r |= (~rec(A-1,B,isA^1));
    }else{
        if(A+1<B)
            r |= (~rec(A,B-1,isA^1));
        else if(B<N)
            r |= (~rec(A,B+1,isA^1));
    }
    return r;
}

int main(void){
    int A,B;
    cin>>N>>A>>B;
    memset(cache,-1,sizeof(cache));
    if(rec(A,B,1))
        cout<<"Alice"<<endl;
    else
        cout<<"Borys"<<endl;
    return 0;
}

Measured memory_bytes: 384
n,m = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
x = sorted(x)

cost = 0
for i in range(n):
    cost += x[i][0] * min(m, x[i][1])
    m -= x[i][1]
    if m < 1: break

print(cost)

Measured memory_bytes: 28656
#include<stdio.h>
#include<math.h>
#define MAX_X 21
int hights_m[MAX_X];
int hights_p[MAX_X];

double solve(double r)
{
  int i, prev = 0;
  double ans = (double)((hights_p[0] < hights_m[20])? hights_p[0] : hights_m[20] );
  double x, y, l;
  for(i = 1; i < MAX_X; i++)
    {

      prev = hights_m[i - 1];
      if(MAX_X - i > r -1 )
	continue;
      //      printf("ans = %lf\n", ans);
      y = (double)((prev > hights_m[i])? hights_m[i]: prev);
      x = (double)(i - MAX_X);
      //      printf("(%lf, %lf)\n", x, y);
      l = y - sqrt(r * r - x * x) + r;
      ans = (double)((l < ans)? l: ans);
    }
  prev = hights_m[MAX_X - 1];
  for(i = 0; i < MAX_X - 1; i++)
    {
      //      printf("ans = %lf\n", ans);
      if(i > r - 1)
	break;
      y = (double)((prev > hights_p[i])? hights_p[i]: prev);
      x = (double)i;
      //      printf("(%lf, %lf)\n", x, y);
      l = y - sqrt(r * r - x * x) + r;
      ans = (double)((l < ans)? l: ans);
      prev = hights_p[i];
    }
  return ans;
}
  


int main(void)
{
  int n, r, i, j, right, left, hight;

  while(scanf("%d %d", &r, &n), n != 0 || r != 0)
    {
      for(i = 0; i < MAX_X; i++)
	{
	  hights_m[i] = 0;
	  hights_p[i] = 0;
	}
  
      for(i = 0; i < n; i++)
	{
	  scanf("%d %d %d", &left, &right, &hight);
	  for(j = left; j < right; j++)
	    {
	      if(j < 0)
		if(hights_m[MAX_X + j] < hight)
		  hights_m[MAX_X + j] = hight;
		else
		  ;
	      else
		if(hights_p[j] < hight)
		  hights_p[j] = hight;
	    }
	}

      printf("%.4lf\n", solve((double)r));
    }
  return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define pb push_back

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b); i >= (a); i--)
#define R0F(i, a) ROF(i, 0, a-1)
#define trav(x, a) for (auto& x: a)

const int MX  = 2e5+5;
const int MOD = 1e9+7;
const ll  INF = 1061109567; // 4557430888798830399LL
const ld  EPS = 1e-9;
const ld  PI  = acos(-1);

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    ll x; cin >> x;

    if (x%11 == 0) {
        cout << x/11*2 << "\n";
    } else if (x%11 <= 6) {
        cout << x/11*2+1 << "\n";
    } else {
        cout << x/11*2+2 << "\n";
    }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#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 fi first
#define se second
#define emb emplace_back

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

template<typename T> void pv(vector<T> vec) {
  cout << "[";
  for(auto& v : vec) { cout << v << ","; }
  cout << "]" << endl;
}

template<>
void pv(vector<P> vec) {
  cout << "[";
  for(auto& v : vec) {
    cout << "<" << v.fi << ","<< v.se << ">" << ",";
  }
  cout << "]" << endl;
}

int main() {
  ll a,b,n;
  cin >> n >> a >> b;
  if(a==0) {
    cout << 0 << endl;
    return 0;
  }
  ll r = n % (a + b);
  ll q = (n - r) / (a+b);
  ll ans = q * a;
  if(a <= r) ans += a;
  else ans += r;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }
template<class T>
ostream &operator<<(ostream &os,const vector<T> &v){
	for(int i = 0;i < v.size();i++) os << (i ? "," : "[") << v[i];
	os << "]";
	return os;
}

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }

const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	int n;
	string s;
	cin >> n >> s;
	int r = 0,g = 0,b = 0;
	for(int i = 0;i < n;i++){
		if(s[i] == 'R') r++;
		else if(s[i] == 'G') g++;
		else b++;
	}
	int ans = r * g * b;
	for(int i = 0;i < n;i++){
		for(int j = 1;;j++){
			if(i - j < 0 || i + j >= n) break;
			if(s[i] != s[i - j] && s[i - j] != s[i + j] && s[i] != s[i + j]) ans--;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3616
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

typedef long long ll;

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

    return 0;
}


Measured memory_bytes: 3624
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
vector<int> v;
int main() {
    int n;
    cin>>n;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        v.push_back(a);
    }
    bool ok = 1;
    for (int i = 0; i < v.size(); i++) {
        if (!(v[i] & 1)) {
            if (v[i] % 3 != 0 && v[i] % 5 != 0) ok = 0;
        }
    }
    if(ok) cout<<"APPROVED";
    else cout<<"DENIED";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long
const int mx = 1005;
const int mod = 1000000007;
char grid[mx][mx];
ll val[mx][mx];
ll func(int h, int w)
{
    bool f = false;
    for(int j=0; j<=w; j++){
        if(grid[0][j]=='#')f=true;
        if(!f)val[0][j]=1;
        else if(f)val[0][j]=0;
    }
    f = false;
    for(int i=0; i<=h; i++){
        if(grid[i][0]=='#')f=true;
        if(!f)val[i][0]=1;
        else if(f)val[i][0]=0;
    }
    for(int i=1; i<=h; i++)
        for(int j=1; j<=w; j++)
            if(grid[i][j]!='#')
                val[i][j] = (val[i-1][j] + val[i][j-1])%mod;
    return val[h][w];
}
int main()
{
    int h,w;
    cin >> h >> w;
    for(int i=0; i<h; i++)
        for(int j=0; j<w; j++)
            cin >> grid[i][j];
    memset(val,0,sizeof val);
    ll res = func(h-1,w-1);
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 9088
N, M, C = map(int, input().split())
B = [int(i) for i in input().split()]
A = []
for i in range(N):
    A.append([int(j) for j in input().split()])

ans = 0
for i in range(N):
    tmp = 0
    for j in range(M):
        tmp += A[i][j]*B[j]

    if tmp + C > 0:
        ans += 1

print(ans)

Measured memory_bytes: 3064
import sys
def input(): return sys.stdin.readline().strip()


def main():
    x1, y1, x2, y2 = map(int, input().split())
    vec = (x2 - x1, y2 - y1)
    x3, y3 = x2 - vec[1], y2 + vec[0]
    x4, y4 = x3 - vec[0], y3 - vec[1]
    print("{} {} {} {}".format(x3, y3, x4, y4))


if __name__ == "__main__":
    main()


Measured memory_bytes: 38256
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))
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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

int main() {
    SS(ll,k,n)
    SV(ll,a,n)
    ll p1=0;
    vl dis(n);
    rep(i,n-1)dis[i]=a[i+1]-a[i];
    dis[n-1]=k-a[n-1]+a[0];
    sort(dis.begin(),dis.end());

    rep(i,n-1){
        
        p1+=dis[i];
        debug(dis[i]);
    }
    p(p1);
}


Measured memory_bytes: 3456
N = int(input())
S = list(input())
w = 0
e = 0

lw = 0
le = 0

for i in range(len(S)):
    if S[i] == "W":
        w+= 1
    else:
        e+= 1

min = 100000000
for i in range(len(S)):
    temp = 0
    if S[i] == "W":
        temp = lw+e
        lw+=1
        w-=1
    else:
        temp = lw+e
        le +=1
        e -= 1
        temp-=1
    if temp<min:
        min = temp

print(min)

Measured memory_bytes: 6048
#include <algorithm>
#include <climits>
#include <iostream>

using namespace std;

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

  int m = 0;
  int d = INT_MIN;
  int x;
  cin >> m;
  for (int i = 0; i < n - 1; ++i) {
    cin >> x;
    d = max(d, x - m);
    m = min(m, x);
  }

  cout << d << endl;
  return 0;
}

Measured memory_bytes: 1160
require 'pp'

def gets; ARGF.gets; end

class Solver

  def initialize
  end

  def main
    n = gets.chomp.to_i
    as = gets.chomp.split.map(&:to_i)

    asum = as.inject(:+)
    # puts asum

    lsum = 0
    min_diff = 2020202020000000
    as.each do |a|
      lsum += a
      rsum = asum - lsum
      diff = (lsum - rsum).abs
      # puts diff
      min_diff = diff if diff < min_diff
    end

    puts min_diff
  end
end

if __FILE__ == $0
  Solver.new.main
end


Measured memory_bytes: 18556
n, m = map(int, input().split())
switch = [0] * m
for i in range(m):
    s = list(map(int, input().split()))
    for j in s[1:]:
        switch[i] |= 1 << (j - 1)
p = list(map(int, input().split()))
ans = 0
for bit in range(1 << n):
    for i in range(m):
        if bin(bit & switch[i]).count('1') % 2 != p[i]:
            break
    else:
        ans +=1
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 2e6 + 5;
const int mod = 1e9 + 7;
int k, ans, f[M], inv[M];
string s;

int power(int a, int b)
{
	int res = 1;
	while(b)
	{
		if(b & 1)
			res = (res * a) % mod;
		b >>= 1;
		a = (a * a) % mod;
	}
	return res % mod;
}

int modInv(int a)
{
	return power(a, mod - 2);
}

void precompute()
{
	f[0] = f[1] = 1;
	for(int i = 2; i < M; i++)
		f[i] = (f[i - 1] * i) % mod;
	inv[M - 1] = modInv(f[M - 1]);
	for(int i = M - 2; i >= 0; i--)
		inv[i] = (inv[i + 1] * (i + 1)) % mod;
}

int nCr(int n, int r)
{
	if(n < r)	return 0;
	int res = f[n];
	res = (res * inv[r]) % mod;
	res = (res * inv[n - r]) % mod;
	return res % mod;
}

int32_t main() 
{
	ios_base::sync_with_stdio(0);	cin.tie(0);	cout.tie(0);
	precompute();
	cin >> k >> s;
	int n = s.size();
	for(int i = 0; i <= k; i++)
	{
		int cur = nCr(n + k, n + i);
		cur = (cur * power(25, k - i)) % mod;
		ans = (ans + cur) % mod;
	}
	cout << ans << "\n";
    	return 0;
}

Measured memory_bytes: 35488
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define MAX_N 2020

int main(){
  ll x;
  cin >> x;

  ll count = 0;
  ll a = 100;
  while(true){
    a = a * 1.01;
    count += 1;
    if(a >= x){
      break;
    }
  }
  cout << count <<endl;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define mp make_pair
#define pb push_back
#define pf push_front
#define ss second
#define ff first
#define sz(x) (int)x.size()
#define newl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vll vector<pll>
#define mem(x, val) memset(x, val, sizeof(x))
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define all(v) (v).begin(), (v).end()

const ld pi = 3.14159265359;
ll INF = 1e18 + 10;
ll MOD = 998244353;
ll mod = 1e9 + 7;

inline ll add(ll a, ll b, ll m)
{
    if ((a + b) >= m)
        return (a + b) % m;
    return a + b;
}

inline ll mul(ll a, ll b, ll m)
{
    if ((a * b) < m)
        return a * b;
    return (a * b) % m;
}

ll power(ll x, ll y, ll m)
{
    ll res = 1;
    x = x % m;
    if (x == 0)
        return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % m;
        y = y >> 1;
        x = (x * x) % m;
    }
    return res;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

void solve()
{
    int n,m;
    cin>>n>>m;
    vector<vi> a(n + 1);
    for(int i=0;i<m;i++) {
        int x,y;
        cin>>x>>y;
        a[x-1].pb(y-1);
        a[y-1].pb(x-1);
    }

    queue<int> q;
    vector<bool> used(n,false);
    vector<int> d(n,0), p(n,-1);

    q.push(0);
    used[0] = true;
    p[0] = -1;
    while (!q.empty())
    {
        int v = q.front();
        q.pop();
        for (int u : a[v])
        {
            if (!used[u])
            {
                used[u] = true;
                q.push(u);
                d[u] = d[v] + 1;
                p[u] = v;
            }
        }
    }

    for(int i=1;i<n;i++) {
        if(p[i]==-1) {
            cout<<"No";
            return;
        }
    }
    cout<<"Yes"<<newl;
    for(int i=1;i<n;i++) {
        cout<<p[i]+1<<newl;
    }
}

int main()
{
    fastio;
    int t;

    t = 1;
    //cin >> t;
    //int test=t;
    while (t-- > 0)
    {
        //cout<<"Case #"<<(test-t)<<": ";
        solve();
        cout << newl;
    }

    return 0;
}

Measured memory_bytes: 10652
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int solve()
{
    const int absMinIndex = -1000000;
    const int absMaxIndex = 1000000;

    int K, X;

    std::cin >> K >> X;

    int minIndex = std::max(absMinIndex, X - K + 1);
    int maxIndex = std::min(absMaxIndex, X + K - 1);

    while (minIndex <= maxIndex)
        cout << minIndex++ << " ";

    cout << endl;

    return 0;
}

int main()
{
    solve();

    return 0;
}

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

typedef long long ll;
void solve(long long N){

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    cin >> N;
    ll ans = 0;
    for(ll i = 0; i <= N; i++){
        if(i % 3 == 0){
            continue;
        } else if(i % 5 == 0){
            continue;
        }  else { 
            ans += i;
        }

    }
    cout << ans << endl;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define I INT32_MAX
#define IM INT_MIN
#define MOD 1000000007
#define ll long long
#define lli long long int
#define rep(i,n) for (int i = 0; i < n; i++)
#define repk(i,k,n) for (int i = k; i <= n; i++)
#define repr(i,k,n) for (int i = k; i >= n; i--)
#define all(v) (v).begin(),(v).end()
typedef vector<int> vi;
typedef set<int> si;


void solve() {
	ll n, k;
	cin >> n >> k;
	vi arr(n + 1);
	vi dp(n + 1, INT_MAX);
	rep(i, n) {
		cin >> arr[i];
	}
	dp[0] = 0;
	dp[1] = abs(arr[1] - arr[0]);
	for (int i = 2; i < n; ++i)
	{
		for (int j = i - 1, jump = 0; j >= 0 and jump < k ; j-- , jump++) {
			dp[i] = min(dp[i] , dp[j] + abs(arr[i] - arr[j]));
		}
	}
	cout << dp[n - 1] << endl;
}

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

	int t = 1;
	// cin >> t;
	while (t--)
		solve();

}






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

int main(){
  int n;
  cin>>n;
  vector<ll> vec(n);
  rep(i,n){
      cin>>vec[i];
  }
  ll ans=0, zan=0;
  rep(i,n-1){
      if(vec[i]>=vec[i+1]) zan++;
      else{
          if(zan>ans) ans= zan;
          zan = 0;
      }
      if(i==n-2){
          if(zan>ans) ans= zan;
      }
  }
    cout<<ans;
    

}


Measured memory_bytes: 3992
#include <stdio.h>

int main()
{   int n;
    scanf("%d",&n);
    char s[100001];
    scanf("%s",s);
    int ans=1;
    for(int i=0;i<n-1;i++){
        if(s[i]==s[i+1])continue;
        else ans++;
    }
    
    printf("%lld",ans);

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long a,b;
long long fans;
int main()
{
    cin>>a>>b;
    if((a<0&&b>0)||a==0||b==0)
    {
        cout<<"Zero"<<endl;
        return 0;
    }
    for(int i=a;i<=b;i++)
    {
        if(i<0)
         fans++;
    }
    if(fans%2==1)
      cout<<"Negative"<<endl;
    else
      cout<<"Positive"<<endl;
    return 0;
}

Measured memory_bytes: 256
N, W = map(int, input().split())
goods = [list(map(int, input().split())) for i in range(N)]
dp = [0 for i in range(W+1)]
for i in range(N):
    for j in range(W, goods[i][1]-1, -1):
        dp[j] = max(dp[j-goods[i][1]] + goods[i][0], dp[j])
print(dp[W])


Measured memory_bytes: 5924
package main

import "fmt"

func main() {
	var x, y int
	fmt.Scan(&x, &y)
	sum := 0
	for i := 0; i < 2; i++ {
		if x > y {
			sum += x
			x--
		} else {
			sum += y
			y--
		}
	}
	fmt.Println(sum)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll MOD = 1000000007;

#define vec                vector<int>
#define vecll              vector<ll>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>> var(n, vector<int>(m, 0))
#define vecll2(var, n, m)  vector<vector<ll>> var(n, vector<ll>(m, 0))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define mp(v1, v2)       make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << var;
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "Yes" : "No");}
//----------------------------------------------------------------

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

  if(n%10==3){prt("bon");}
  else if(n%10==0 || n%10==1 || n%10==6 || n%10==8){prt("pon");}
  else {prt("hon");}
}


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

# define pb push_back
# define fr first
# define sc second
# define mk make_pair

using namespace std;

const int inf = 1e9 + 7;
const int N = 1e5 + 5;

typedef long long ll;

int n, m, u[N], u1[N];
vector <int> g[N], a[N];

void dfs(int v, int type)
{
      if(type)
      {
            u1[v] = 1;
            for(int to : g[v])
            {
                  if(u[to]) continue;
                  dfs(to, 1 - type);
            }
      }
      else
      {
            u[v] = 1;
            for(int to : a[v])
            {
                  if(u1[to]) continue;
                  dfs(to, 1 - type);
            }
      }
}

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

      for(int i = 1; i <= n; i ++)
      {
            int k, x;
            scanf("%d", &k);
            for(int j = 1; j <= k; j ++)
            {
                  scanf("%d", &x);
                  g[i].pb(x);
                  a[x].pb(i);
            }
      }

      int cnt = 0;

      for(int i = 1; i <= n; i ++)
            if(!u1[i])
            {
                  cnt ++;
                  dfs(i, 1);
            }

      if(cnt == 1)
            cout << "YES" << endl;
      else
            cout << "NO" << endl;
}


Measured memory_bytes: 8960
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll  = long long;
using v   = vector<int>;
using P   = pair<int,int>;
using vp  = vector<P>;
using vvp = vector<vp>;

int main(){
    int n,m,a,b;
    cin>>n>>m>>a>>b;
    cout << (n-a)*(m-b) << endl;
    
    return 0;
}

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

namespace ABC125cs
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var vi = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var ci = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var result = 0;
            foreach (var i in Enumerable.Range(0,n))
            {
                int tmp = vi[i] - ci[i];
                if(tmp > 0) { result += tmp; }
            }
            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 13396
using System.Linq;
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var d = new Dictionary<char, int>();
        var s = Console.ReadLine().Trim();
        for (int i = 0; i < s.Length; i++)
            if (d.ContainsKey(s[i])) d[s[i]]++;
            else d[s[i]] = 1;
        var u2 = new List<int>();
        var count1 = 0;
        foreach (var x in d)
            if (x.Value % 2 == 1)
            {
                count1++;
                if (x.Value != 1) u2.Add((x.Value - 1) / 2);
            }
            else u2.Add(x.Value / 2);
        if (count1 >= 2) { Console.WriteLine(0); goto end; }
        var r1 = fact(u2.Sum());
        foreach (var x in u2)
            r1 /= fact(x);
        Console.WriteLine(r1);
        end:;
    }
    public static long fact(int n)
    {
        var ret = 1L;
        for (long i = 1; i <= n; i++) ret *= i;
        return ret;
    }
}



Measured memory_bytes: 9976
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define INF 1000000000

int main() {
    int n,ans;
    cin >> n;
    ans = 0;
    vector<ll> L(n);
    rep(i,n) cin >> L.at(i);
    rep(i,n) rep(j,n) rep(k,n){
        if (i==j or j==k or k==i) continue;
        if (L[i]==L[j] or L[j]==L[k] or L[k]==L[i]) continue;
        ans += bool(2*max({L[i],L[j],L[k]}) < (L[i]+L[j]+L[k]));
    }
    ans = ans / 6;
    cout << ans << endl;
}

Measured memory_bytes: 3628
count = gets.to_i
  a = gets.chomp.split(' ').map(&:to_i)
ans = "APPROVED"
a.each do |i|
  if i % 2 == 0
    if i % 3 != 0 && i % 5 != 0
      ans = "DENIED"
    end 
  end
end

puts ans

Measured memory_bytes: 1916
if __name__=="__main__":
    N = int(input())
    S = input()
    K = int(input())

    match = S[K-1]
    S = list(S)
    for x in range(N):
        if S[x] != match:
            S[x]= '*'
    S = "".join(S)
    print(S)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#define INF 1000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);



signed main(){

    int N; cin >> N;
    vec a(N); readvec(a);

    vec n(100000, 0);
    REP(i, N){
        n[a[i]]++;
    }

    int ans = 0;
    FOR(i, 1, 99999){
        ans = max(ans, n[i - 1] + n[i] + n[i + 1]);
    }

    cout << ans;
    
    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

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

signed main() {
	int a, b, d;
	cin >> a >> b >> d;
	int ans = 0;
	for(int i = a; i <= b; i++){
		if(i%d == 0)ans++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3588
#include"bits/stdc++.h"
using namespace std;
 
#define MAX 502
#define ull unsigned long long int 
int n;
int ty_r[MAX];
ull val_r[MAX];
int ty_c[MAX];
ull val_c[MAX];
bool tmp[MAX][MAX];
int emp[MAX];
ull ans[MAX][MAX];
void transpose(){
	for(int i=0;i<n;i++){
		for(int j=0;j<i;j++)swap(tmp[i][j],tmp[j][i]);
		swap(val_r[i],val_c[i]);
		swap(ty_r[i],ty_c[i]);
	}
}
void fi(long long int pos){
	memset(emp, 0, sizeof(emp));
	for (int j = 0; j < n; j++) {
		if (ty_c[j] == false) {
			emp[j] = n - 1;
			for (int k = 0; k < n; k++) emp[j]-=tmp[k][j];
		}
	}
	for (int i = 0; i < n; i++) {
		if (ty_r[i]) {
			if (((val_r[i]) >> pos) & 1ULL) {
				bool valid = false;
				for (int j = 0; j < n; j++) valid|=tmp[i][j];
				if (valid == false) {
					for (int j = 0; j < n; j++) {
						if (emp[j]>0) { 
							emp[j]--;
							tmp[i][j] = true;
							break;
						}
					}
				}
			}
		}
	}
}
void solve(ull pos) {
	memset(tmp, false, sizeof(tmp));
	for (int i = 0; i < n; i++) {
		if (ty_r[i]==false&&((val_r[i]) >> pos) & 1ULL) for (int j = 0; j < n; j++) tmp[i][j] = 1;
		if(ty_c[i]==false&&((val_c[i]) >> pos) & 1ULL) for (int j = 0; j < n; j++) tmp[j][i] = 1;
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (ty_r[i] == ty_c[j]) {
				if (ty_r[i] == false) tmp[i][j] = ((val_r[i] >> pos) & 1ULL)| ((val_c[j] >> pos) & 1ULL);
				else tmp[i][j] = ((val_r[i] >> pos) & 1ULL)& ((val_c[j] >> pos) & 1ULL);
			}
		}
	}
	fi(pos);
	transpose();
	fi(pos);
	transpose();
	for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) ans[i][j] += ((ull)(tmp[i][j]) << pos);
}
void fo(){
	puts("-1");
	exit(0);
}
void check() {
	for (int i = 0; i < n; i++) {
		ull AN = -1; ull O = 0; ull AN2 = -1; ull O2 = 0;
		for (int j = 0; j < n; j++) {
			AN &= ans[i][j];
			O |= ans[i][j];
			AN2&=ans[j][i];
			O2|=ans[j][i];
		}
		if (ty_r[i] == false&&AN != val_r[i]) fo();
		else if(ty_r[i] == true&&O!=val_r[i]) fo();
		if (ty_c[i] == false&&AN2 != val_c[i]) fo();
		else if (ty_c[i] && O2 != val_c[i]) fo();
	}
}
int main() {
		cin>>n;
		for (int i = 0; i < n; i++) scanf("%d", &ty_r[i]);
		for (int j = 0; j < n; j++) scanf("%d", &ty_c[j]);
		for (int i = 0; i < n; i++) scanf("%llu", &val_r[i]);
		for (int j = 0; j < n; j++) scanf("%llu", &val_c[j]);
		for (int i = 0; i < 64; i++) solve(i);
		check();
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				if (j)printf(" ");
				printf("%llu", ans[i][j]);
			}
			puts("");
		}
	return 0;
}


Measured memory_bytes: 7808
/*
मनस्वी म्रियते कामं कार्पण्यं न तु गच्छति ।
अपि निर्वाणमायाति नानलो याति शीतताम् ॥
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
using namespace std;

#define mod 1000000007
#define pb push_back
#define ll long long int
#define ull unsigned ll
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define p2d(v) for(auto a:v){for(auto b:a)cout<<b<<" ";cout<<endl;}
#define p1d(v) for(auto a:v)cout<<a<<" ";cout<<endl;
#define ppd(v) for(auto a:v)cout<<a.ff<<" "<<a.ss<<endl;
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
#define test3(x,y,z) cout << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
#define test4(w,x,y,z) cout << #w " = " << w << " " << #x " = " << x << " " << #y " = " << y << " " << #z " = " << z << endl;
#define oset tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>

/*
const ll infinity = 9e18;

bool compare(ll a,ll b) {return a > b;}
bool compare1(ppl a,ppl b) {return a.ff > b.ff;}
bool compare2(ppl a,ppl b) {return a.ss < b.ss;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}

ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md = mod) {ll product = 1; while(b){if(b&1){product = (product*a)%md;}a = (a*a)%md;b = b>>1;} return product%md;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/




int main()
{
    fast

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

        
    ll n;
    ld d;
    cin>>n>>d;
    
    ll count = 0;

    forn(i,0,n)
    {
        ld a,b;
        cin>>a>>b;

        if(d*d >= (a*a + b*b))
        {
            count++;
        }
    }    
        

    cout<<count;










    return 0;
}       

Measured memory_bytes: 3808
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;
using static System.Console;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(ReadLine());
        }

        public static long[] Reads()
        {
            return ReadLine().Split().Select(long.Parse).ToArray();
        }


        public static long gcd(long x,long y)
        {
            if (y < x) gcd(y, x);
            while (y != 0)
            {
                var z = x % y;
                x = y;
                y = z;
            }
            return x;
        }

        public static long C(long n,long k)
        {
            long x=1;
            for (long i = 1; i <=k; i++)
            {
                x *= n - i + 1;
                x /= i;
            }
            return x;
        }
        static void Main(string[] args)
        {
            var sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var q = Reads();
            var n = q[0];
            var m = q[1];
            var to = new bool[n];
            var from = new bool[n];
            for (int i = 0; i < m; i++)
            {
                q = Reads();
                if (q[0] == 1) to[q[1]-1] = true;
                if (q[1] == n) from[q[0]-1] = true;
            }
            var ans = false;
            for (int i = 0; i < n; i++)
            {
                if (to[i] && from[i]) ans = true;
            }
            WriteLine(ans ? "POSSIBLE" : "IMPOSSIBLE");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 22980
#include<stdio.h>
#include<math.h>
int main()
{
//   freopen("input.txt","r",stdin);
//   freopen("output.txt","w",stdout);


   long long num,d;
   int count=0;
 
   scanf("%lld",&num);
   scanf("%lld",&d);

   d = d * d;
   long long x,y;
   while (num--)
   {
      scanf("%lld %lld",&x,&y);
      x = (x*x) + (y*y);
      if(d >= x)
         count++;
      
   }
   
   printf("%d\n",count);
   

   
}

Measured memory_bytes: 1736