akhauriyash/Code-Regression huggingface dataset:
n = int(input())

ab = []
for _ in range(n):
    a,b = map(int,input().split())
    ab.append([a,b])

ab.sort(key=lambda x:x[1])

wrk = 0
for i in range(n):
    wrk += ab[i][0]
    if wrk > ab[i][1]:
        print('No')
        exit()   

print('Yes')

Measured memory_bytes: 38036
#include <bits/stdc++.h>
using namespace std;
typedef int int__;
#define int long long
#define pb push_back
#define pi pair<int,int>
#define vpi vector<pi>
#define vi vector<int>
#define vvi vector<vi>
#define all(x) x.begin(), x.end()
#define fi first
#define se second
#define forn(i, n) for(int i = 0; i < int__(n); i++) 
#define sz(a) int__(a.size())
template<class A>ostream& operator<<(ostream& out,const vector<A>&v){out<<"[";forn(i,sz(v)){if(i)out<<", ";out<<v[i];}return out<<"]";}
const int MAX = 1e9 + 7;
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
int Mod(int x){const int mm=998244353;x%=mm;if(x<0)x+=mm;return x;}
int Pow(int x,int n){if(n==0)return 1;int t=Pow(x,n/2);t=Mod(t*t);if(n&1)t=Mod(t*x);return t;}
#define watch(x) cout << #x << " : " << x << endl;
int gcd(int x,int y){return y!=0 ? gcd(y,x%y) : x;}

const int nax = 305;

double dp[nax][nax][nax];

int__ main() {
	fast;
	memset(dp,0,sizeof(dp));
	vi cnt(4,0);
	int n; cin >> n;
	for(int i=0;i<n;i++) {
		int x; cin >> x; cnt[x]++;
	}

	for(int c = 0; c <= cnt[3]; c++) {
		for(int b = 0; b <= n; b++) {
			for(int a = 0; a <= n; a++) {
				double res = 0;
				if(a) res += ((1.0*a)/(a+b+c)) * dp[a-1][b][c];
				if(b) res += ((1.0*b)/(a+b+c)) * dp[a+1][b-1][c];
				if(c) res += ((1.0*c)/(a+b+c)) * dp[a][b+1][c-1];

				if(a+b+c) res += (1.0*n)/(a+b+c);

				dp[a][b][c] = res;
			}
		}
	}

	cout << fixed << setprecision(10) <<dp[cnt[1]][cnt[2]][cnt[3]] << endl;
}

Measured memory_bytes: 221952
import math

def lcm(a,b):
  return (a*b)//math.gcd(a,b)


A,B,C,D=map(int, input().split())

CL=(A-1)//C
CH=B//C
DL=(A-1)//D
DH=B//D
ACD=(A-1)//lcm(C,D)
BCD=B//lcm(C,D)

#print(CL,CH,DL,DH,ACD,BCD)

ans=(B-A+1)-((CH-CL)+(DH-DL)-(BCD-ACD))
print(ans)

Measured memory_bytes: 9160
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
using namespace std;

int syc(long i,long Min,long Max){
	if(Min <= i && i <= Max){
		return 1;
	}else{
		exit(1);
		//return 0;
	}
}


int main(){
	
	int a;
	int i;
	int count=0;
	cin >> a;
	syc(a,3,20);
	int b[a];
	for(i=0;i<a;i++){
			cin >> b[i];
	}
	for(i=1;i<a-1;i++){
			if( (b[i-1]<b[i] && b[i]<b[i+1]) || (b[i+1]<b[i] && b[i]<b[i-1])){
				count++;	
			}
	}
	cout << count << endl;
	return 0;
}


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

int main() {
  int x;
  cin >> x;
  
  int n;
  n = x%1000;

   if (n==0) {
     cout << 0 << endl;
   }
   else {
     cout << 1000-n << endl;
   }
}


Measured memory_bytes: 3624
//teja349
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);   
int a[123456];
map<int,int> mapi;
int main(){
    std::ios::sync_with_stdio(false);
    int n;
    cin>>n;
    int i,mini=inf,flag=0;
    rep(i,n){
    	cin>>a[i];
    	//sumi+=a[i];
    	//haha[a[i]]=1;
    	if(a[i]!=n-1) flag=1;
    	mini=min(a[i],mini);
    	mapi[a[i]]++;
    }
    if(flag==0)
    {
    	cout<<"Yes"<<endl;
    	return 0;
    }
    if(mapi.size()>2){
    	cout<<"No"<<endl;
    }
    else if(mapi.size()==1){
    	//it=mapi.begin();
    	if(mini *2<=n){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		cout<<"No"<<endl;
    	}

    }
    else{
    	if(mapi[mini+1]==0){
    		cout<<"No"<<endl;
    		return 0;
    	}
    	int val=n-mapi[mini];
    	int val2=mini-mapi[mini]+1;

    	if(val2>0 && val2*2<=val){
    		cout<<"Yes"<<endl;
    	}
    	else{
    		cout<<"No"<<endl;
    	}
    }
    
}



Measured memory_bytes: 5376
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>
#include <numeric>
#include <iomanip>

using namespace std;

long long A[100000];
int main(){ 
    int N;
    int M;
    cin >> N >> M;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    priority_queue <long long> pq;
    for(int i = 0; i < N; i++){
        pq.push(A[i]);
    }
    for(int i = 0; i < M; i++){
        auto a = pq.top();
        pq.pop();
        a /= 2;
        pq.push(a);
    }

    long long ans = 0;
    while(!pq.empty()){
        ans += pq.top();
        pq.pop();
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2168
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<math.h>
#include<limits.h>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
using namespace std;

long long  mod = 1000000007;

long max(long x, long y) {
	return x > y ? x : y;
}

long min(long x, long y) {
	return x < y ? x : y;
}

long factorial(long n) {
	if (n == 1) {
		return 1;
	}
	else {
		return n * factorial(n - 1);
	}
}

long long  fel(long long  n,long long  f) {

		if (f == 1) {
			return n % mod;
		}
		else if (f % 2 == 0) {
			return (fel(n,f / 2) * fel(n,f / 2)) % mod;
		}
		else {
			return ((n  * fel(n,f / 2) %mod) * fel(n,f / 2))% mod;
		}
	

}


int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int sum = a + b + c;
	if (sum <= 21) {
		cout << "win";
	}
	else {
		cout << "bust";
	}
}




Measured memory_bytes: 764
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i];}
#define pb push_back
#define PI 3.141592653589793
#define MOD 1000000007

using namespace std;
int main(){
    FAST
    ll a,b,n; cin >> a >> b >> n;
    ll res1,res2;
    if(b>=n){
        res1= floor((double)a*n/b) - ((double)a*(floor(n/b)));
        res2= floor((double)a*(n-1)/b) - ((double)a*(floor((n-1)/b)));
        cout << max(res1,res2) << endl;
        return 0;
    }
    if(b<n){
        res1= floor((double)a*b/b) - ((double)a*(floor(b/b)));
        res2= floor((double)a*(b-1)/b) - ((double)a*(floor((b-1)/b)));
        cout << max(res1,res2) << endl;
        return 0;
    }



    return 0;
}


Measured memory_bytes: 3764
N, M = map(int, input().split())

Pi = []
for i in range(M):
     p, y = map(int, input().split())
     Pi.append([p, y, i])

def fill(t):
    s = str(t)
    while len(s) < 6:
        s = "0" + s
    return s

Pi.sort(key=lambda x: x[1])
counts = [1] * (N + 1)
for p in Pi:
    city = p[0]
    num = counts[city]
    counts[city] += 1
    p.append(fill(city) + fill(num))

Pi.sort(key=lambda x: x[2])
for p in Pi:
    print(p[3])

Measured memory_bytes: 34992
#include <bits/stdc++.h>
#define int long long int
using namespace std;
 
signed main()
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
    //cout<<"I must do it...Yeahhh";
    
    int t=1;
    //cin>>t;
    while(t--)
    {
        string s;
        cin>>s;
        int n=s.size();
        int f1=0,f2=0,f3=0;
        for(int i=0;i<n/2;i++)
        {
            if(s[i]!=s[n-1-i])
            {
                f1=1;
                break;
            }
        }
 
        for(int i=0;i<n/4;i++)
        {
            if(s[i]!=s[n/2-1-i])
            {
                f2=1;
                break;
            }
        }
        for(int i=(n+1)/2;i<n;i++)
        {
            if(s[i]!=s[n-1-i+(n+1)/2])
            {
                f3=1;
                break;
            }
        }
        //cout<<f1<<' '<<f2<<' '<<f3<<' ';
        if(f1==0 && f2==0 && f3==0)
            cout<<"Yes";
        else
            cout<<"No";
    }
    return 0;
}

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

int main()
{
    int n;
    cin >> n;
    vector<int> a(3 * n);
    for (int i = 0; i < 3 * n; i++)
    {
        cin >> a[i];
    }

    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());

    long long ans = 0;
    for (int i = 0; i < n; i++)
    {
        ans += a[1 + 2 * i];
    }
    
    cout << ans << endl;
}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    int n; cin >> n;
    cout << n/3 << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pld pair<long double, int>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define ff first
#define ss second
#define SZ(x) ((int)(x).size())
#define ld long double
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int MAXN = 2e5+100;
int N, M;
bool vis[MAXN];
vector<int> adj[MAXN];

void read(){
    cin >> N >> M;
    while(M--){
        int u, v;
        cin >> u >> v;
        u--, v--;
        adj[u].pb(v);
        adj[v].pb(u);
    }
}

int dfs(int v){
    vis[v] = true;
    int ans = 1;
    for(auto x : adj[v]){
        if(!vis[x])
            ans += dfs(x);
    }
    return ans;
}

void solve(){
    read();
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(!vis[i]){
            ans = max(ans, dfs(i));
        }
    }
    cout << ans;
}

int main(){
    ios_base::sync_with_stdio(false);
    solve();
    return 0;
}



Measured memory_bytes: 24068
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int ans = 0;
    rep(i, 0, 100){
        if(A <= i && i + 1 <= B && C <= i && i + 1 <= D){
            ans++;
        }
    }
    output(ans);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>

#define rep(i,p) for(int i=1;i<=p;i++)
#define ll long long

using namespace std;

int main(){

	ll int r;
	cin >> r;
	cout << r*r;










	return 0;

}



Measured memory_bytes: 256
n, x, m = map(int,input().split())
k = (x ** 2) % m
l = [0] * (m+1)
l[(x ** 2) % m] == 0
a = [x]
flag = True
for i in range(n-1):
    x = (x ** 2) % m
    a.append(x)
    if l[x] != 0:
        flag = False
        break
    else:
        l[x] += 1
    
    

if not flag:
    p = i+1
    ku = n - p 
    f = False
    loops = []
    for i in range(len(a)-1):
        if f:
            loops.append(a[i])
        else:
            if (a[i]) == a[-1]:
                loops.append(a[i])
                p = len(a) - (i+1)
                f = True
    k = max(1, len(loops))
    w = (ku) // k
    x = (ku) % k


if flag:
    ans = sum(a)
else:
    sss = 0
    for i in range(x):
        sss += loops[i]
    ans = sum(a) - a[-1] + sum(loops) * w + sss
print(ans)

Measured memory_bytes: 11996
N = int(input())
xyz = []

for _ in range(N):
    temp = list(map(int, input().split()))
    xyz.append(temp)


if N == 1:
    ans = [str(xyz[0][0]), str(xyz[0][1]), str(xyz[0][2])]
else:
    for i in range(101):
        for j in range(101):
            for k in range(N):
                if xyz[k][2] >= 1:      
                    h = max(xyz[k][2] + abs(xyz[k][0] - i) + abs(xyz[k][1] - j),0)

                    count = N
                    for n in range(0,N):
                        g = max(h - abs(i - xyz[n][0]) - abs(j - xyz[n][1]),0)
                        if g == xyz[n][2]:
                            count -= 1
                    
                    if count == 0:
                        ans = [str(i), str(j), str(h)]
                        break
                    break

ans_s = ' '.join(ans)
print(ans_s)

Measured memory_bytes: 3064
#include<stdio.h>
int main() {

	int L, R, d, i, count = 0;

	scanf("%d%d%d", &L, &R, &d);

	for (i = L; i <= R; i++) {
		if (i % d == 0)
			count++;
	}

	printf("%d", count);

	return 0;
}

Measured memory_bytes: 2112
#include <stdio.h>

int main(void){
  int Sec, h, m, s;

  scanf("%d", &Sec);
  s = Sec % 60;
  m = Sec / 60 % 60;
  h = Sec / 3600;
  printf("%d:%d:%d\n", h, m, s);

  return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long

const int N=1005;
const int MOD=1e9+7;

int32_t main()
{
 
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a,b;
  cin>>a>>b;
  if(a%b==0)
  	{
  		cout<<a/b;
  	}
  	else
  	{
  		cout<<(a/b)+1;
  	}
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ul;
typedef signed long long ll;
ul over = 1000000007;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  ll ans = 0;
  ll n;
  cin >> n;
  for (ll i = 0; i < n; ++i) {
    ll l, r;
    cin >> l >> r;
    ans += (r-l+1);
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    long long N;
    cin >> N;
    string res = "";
    while (N) {
        --N;
        res += (char)('a' + (N % 26));
        N /= 26;
    }
    reverse(res.begin(), res.end());
    cout << res << endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define int long long
using namespace std;
int n, b[234567], w[234567];
string s;
signed main() {
	cin >> n >> s;
	for (int i = 1; i <= n; i++) {
		if (s[i - 1] == '#')b[i]++; else w[i]++;
		b[i + 1] += b[i]; w[i + 1] += w[i];
	}
	int ans = n + 1;
	for (int i = 0; i <= n; i++) ans = min(ans, b[i] + w[n] - w[i]);
	cout << ans << endl;
}

Measured memory_bytes: 3716
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <random>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int x;
	cin>>x;
	if(x==7 || x==5 || x==3) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}

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

using namespace std;

struct CI{
  char c;
  int i;
  int first;
};

void swap(CI &a, CI &b){
  int tmpi = a.i;
  char tmpc = a.c;
  int tmpf = a.first;
  a.i = b.i;
  a.c = b.c;
  a.first = b.first;
  b.i = tmpi;
  b.c = tmpc;
  b.first = tmpf;
}

void print_vect(vector<CI> v){
  vector<CI>::iterator i = v.begin();
  cout << (*i).c << (*i).i;
   i++;
  while (i != v.end())
  {
    cout << " " << (*i).c << (*i).i;
    i++;
  }
  cout << endl;
}

void print_stable(const vector<CI> &v){
  bool isStable = true;
  for(int i = 0; i < (int)v.size()-1; i++){
    if(v[i].i == v[i+1].i && v[i].first > v[i+1].first){
      isStable = false;
      break;
    }
  }
  if (isStable)
    cout << "Stable" << endl;
  else
    cout << "Not stable" << endl;
}

void ssort(const int N, vector<CI> v){
  int mini;
  for(int i = 0; i < N; i++){
    mini = i;
    for(int j = i; j < N; j++){
      if(v[j].i < v[mini].i)
        mini = j;
    }
    if(i!=mini){
      swap(v[i], v[mini]);
    }
  }
  print_vect(v);
  print_stable(v);
}

void bsort(const int N, vector<CI> v){
  for(int i = 0; i < N; i++)
    for(int j = N-1; j >= i+1; j--)
      if(v[j].i<v[j-1].i){
        swap(v[j],v[j-1]);
      }
  print_vect(v);
  print_stable(v);
}

int main(){
  ios::sync_with_stdio(false);
  stringstream ss;
  int N;
  cin >> N;
  vector<CI> v(N);
  for(int i = 0; i < N; i++){
    cin >> v[i].c >> v[i].i;
    v[i].first = i;
  }
  bsort(N, v);
  ssort(N, v);
  return 0;
}

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

int main(){
  int n;cin >> n;
  vector<int> a(n);rep(i,n)cin >> a[i];
  vector<int> b(n);
  rep(i,n){
    b[a[i]-1] = i+1;
  }
  rep(i,n){
    cout << b[i] << endl;
  }
  return 0;
}


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

int main() {

  long long int n;
  cin >> n;

  long long int a = 0;
  long long int b = 0;
  long long int ab = 0;
  long long int ans = 0;

  for ( long long int i = 0; i < n; i++ ) {

    string s;
    cin >> s;
    if ( s[0] == 'B' && s[ s.size() - 1 ] == 'A' ) {
      ab++;
    } else {
      if ( s[0] == 'B' ) b++;
      if ( s[ s.size() - 1 ] == 'A' ) a++;
    }
    for ( long long int j = 0; j < s.size() - 1; j++ ) {
      if ( s[j] == 'A' && s[j+1] == 'B' ) ans++;
    }

  }

  ans += min( a, b ) + ab;
  if ( a == 0 && b == 0 && ab > 0 ) ans--;
  cout << ans << endl;

  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define repl(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//ミョ(-ω- ?)
int main() {
    ll n,m;
    cin >> n >> m;
    vector<vector<ll>> graph(n);
    rep(i,m){
        ll a,b;
        cin >> a >> b;
        graph[a-1].push_back(b-1);
        graph[b-1].push_back(a-1);
    }
    queue<ll> que;
    que.push(0);
    int cnt = 0;
    for(ll i  :graph[0]){
        for(ll j : graph[i]){
            if(j == n-1){
                cout << "POSSIBLE\n";
                return 0;
            }
        }
    }
    cout << "IMPOSSIBLE\n";
    return 0;
}

Measured memory_bytes: 12776
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

N, M = getNM()
print(N * M)


Measured memory_bytes: 68868
#include <stdio.h>

using namespace std;

struct Node{
	Node(){
		left_child = right_child = parent = -1;
	};
	int left_child,right_child,parent;
};

void preORDER(Node order[],int id){
	printf(" %d",id);
	if(order[id].left_child != -1) preORDER(order,order[id].left_child );
	if(order[id].right_child != -1) preORDER(order,order[id].right_child );
}

void inORDER(Node order[],int id){
	if(order[id].left_child != -1) inORDER(order,order[id].left_child );
	printf(" %d",id);
	if(order[id].right_child != -1) inORDER(order,order[id].right_child );
}

void postORDER(Node order[],int id){
	if(order[id].left_child != -1) postORDER(order,order[id].left_child );
	if(order[id].right_child != -1) postORDER(order,order[id].right_child );
	printf(" %d",id);
}

int main(){
	int n,id,left,right,root_id;
	scanf("%d",&n);
	Node order[n];
	for(int i = 0; i < n; i++){
		scanf("%d %d %d",&id,&left,&right);
		if(left != -1){
			order[id].left_child = left;
			order[left].parent = id;
		}
		if(right != -1){
			order[id].right_child = right;
			order[right].parent = id;
		}
	}

	for(root_id = 0; root_id < n; root_id++){
		if(order[root_id].parent == -1) break;
	}

	printf("Preorder\n");
	preORDER(order,root_id);
	printf("\n");

	printf("Inorder\n");
	inORDER(order,root_id);
	printf("\n");

	printf("Postorder\n");
	postORDER(order,root_id);
	printf("\n");
}



Measured memory_bytes: 2716
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

int main(){
  int w,h,n;
  cin >> w >> h >> n;
  vector<int> x(n),y(n),a(n);
  rep(i,n) cin >> x[i] >> y[i] >> a[i];
  int xl = 0;
  int xr = w;
  int yt = h;
  int yb = 0;
  
  rep(i,n){
    if(a[i] == 1){
      chmax(xl,x[i]);
    }
    if(a[i] == 2){
      chmin(xr,x[i]);
    }
    if(a[i] == 3){
      chmax(yb,y[i]);
    }
    if(a[i] == 4){
      chmin(yt,y[i]);
    }
  }
  
  if(xr < xl || yt < yb){
    cout << 0;
    return 0;
  }
  int ans = (xr - xl)*(yt - yb);
  cout << ans;
  
  return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
int main()
{
// #ifndef OJ
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	int x, y, z;
	cin >> x >> y >> z;
	cout << z << " " << x << " " << y;
	return 0;
}

Measured memory_bytes: 256
// ABC144_B
#include <iostream>
#include <string>
#include <vector>
#include <iterator>  // std::prev(iter, n) n 個分デクリメントしたイテレータ
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <cstring>  // std::memset 初期化
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>  // std::setprecision()
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> pll;

#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define MIN(vec) min_element(vec.begin(), vec.end())  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(vec.begin(), vec.end())
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(vec.begin(), vec.end(), 0LL)  // 0 は初期値
#define F first
#define S second
const ll INF = 1LL<<60;  // 10^18（const int inf   = 1<<29;）

int main() {
    // input(sunippets: inpv, inpn, inps)
    ll N;
    cin >> N;
    
    // calculation
    REP(i, 9) {
        REP(j, 9) {
            if ((i+1)*(j+1) == N) {
                cout << "Yes" << "\n";
                return 0;
            }
        }
    }
    cout << "No" << "\n";
    return 0;
}

Measured memory_bytes: 256
#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 <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/abc054/tasks/abc054_c

int ab[15][15];

int main() {
    int N, M; cin >> N >> M;
    REP(i, M) {
        int a, b; cin >> a >> b;
        ab[a][b] = 1;
        ab[b][a] = 1;
    }

    vector<int> perm(N-1);
    REP(i, N-1) {
        perm[i] = i+2;
    }
    sort(perm.begin(), perm.end());
    int cnt = 0;
    do {
        int now = 1;
        for (int i = 0; i < perm.size(); i++) {
            if (!ab[now][perm[i]]) break;
            now = perm[i];
            if (i == perm.size()-1) cnt++;
        }
    } while(next_permutation(perm.begin(), perm.end()));

    cout << cnt << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
int a, b, c, d, e, k, ch=0;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k);
int A[10]={a, b, c, d, e, k};
for(int i=0;i<5;i++){
    for(int j=0;j<5;j++){
        if((i!=j) && (A[i]>A[j]) && (A[i]-A[j] >= (k+1) )){
            ch+=1;
        }else if((i!=j) && (A[i]<A[j]) && (A[j]-A[i]>= (k+1) )){
            ch+=1;
        }
    }
}
if(ch==0){
    printf("Yay!\n");
}else{
    printf(":(\n");
}
return 0;
}

Measured memory_bytes: 128
n,s = map(int,input().split())
x = list(map(int,input().split()))

for i in range(n):
  x[i] = abs(x[i] - s)

import math
for i in range(1,n):
  x[i] = math.gcd(x[i],x[i-1])

print(x[n-1])

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

count = 0
for x in range(N):
    A_check = A[x]
    sumNum = 0
    for y in range(M):
        sumNum += A_check[y] * B[y]
    sumNum += C
    if sumNum > 0:
        count += 1
print(count)


Measured memory_bytes: 38384
#include <iostream>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#define Rep(i,a) for(int i = 0; i < (a); i++)
#define rep(i,a,b) for(int i = (a); i <= (b); i++)//(a)!
#define dep(i,a,b) for(int i = (a); i >= (b); i--)
#define ab(a) ((a) > 0 ? (a) : -(a))
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a)
using namespace std;
typedef long long LL;
typedef unsigned long long uLL;
int n, d1, x;
int main() {
	int n, d1, x; scanf("%d%d%d",&n,&d1,&x);
	double ans = 0; double D1 = d1, d = x;
	rep(i,1,n) {
		int c = 2 * (n - i + 1);
		ans += (D1 * 2 + d * (c - 1)) / 2;
		D1 = D1 * (c - 2) / c + (D1 * 4 + d * 5) / c;
		d *= (1 + double(2.0) / (n - i + 1));
	}
	printf("%.15lf\n",ans);
	return 0;
}

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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x"="<<x<<endl

bool IsTimeOut(clock_t start_timer){
  clock_t current_timer = clock();
  double T = static_cast<double>(current_timer - start_timer) / CLOCKS_PER_SEC;
  return T > 1.97;
}

unsigned long XorShift(){
    static unsigned long x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned long t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}

int penalty_func(int delta, int c) {
  return delta * (delta - 1) * c / 2;
}

int main(){

  clock_t start_timer = clock();

  const int N = 26;
  int D;
  cin >> D;
  vector<int> C(N);
  rep(i,N) cin >> C[i];
  vector<vector<int>> S(D, vector<int>(N));
  rep(i,D)rep(j,N) cin >> S[i][j];

  vector<int> schedule_table(D, 0), current_penalty(N, 0);
  int current_score = 0;
  rep(i,D){
    rep(j,N){
      current_penalty[j] += C[j];
    }

    int mx = 0;
    rep(j,N){
      if(S[i][mx]+current_penalty[mx]<S[i][j]+current_penalty[j])mx=j;
    }

    schedule_table[i] = mx;

    current_score+=S[i][mx];
    current_penalty[mx]=0;
    rep(j,N){
      current_score-=current_penalty[j];
    }
  }
  /*vector<vector<int>> last_table(D + 1, vector<int>(N, 0));
  repl(i,1,D+1){
    rep(j,N){
      if(schedule_table[i]==j) last_table[i][j]=i;
      else last_table[i][j]=last_table[i-1][j];
    }
  }*/

  while(!IsTimeOut(start_timer)) {
    int a = (int)(XorShift() % (unsigned long) D);
    int b = (int)(XorShift() % (unsigned long) D);
    int ca = schedule_table[a], cb = schedule_table[b];
    if(a == b || schedule_table[a] == schedule_table[b]) continue;
    if(a > b) swap(a, b);

    int next_score = current_score;
    vector<int> next_schedule_table = schedule_table;
    swap(next_schedule_table[a], next_schedule_table[b]);
    int cacnt = 0, cbcnt = 0;
    rep(i,D){
      if(schedule_table[i] == ca) {
        next_score += penalty_func(cacnt, C[ca]);
        next_score -= S[i][ca];
        cacnt = 0;
      } else {
        cacnt++;
      }
      if(schedule_table[i] == cb) {
        next_score += penalty_func(cbcnt, C[cb]);
        next_score -= S[i][cb];
        cbcnt = 0;
      } else {
        cbcnt++;
      }
    }
    next_score += penalty_func(cacnt, C[ca]);
    next_score += penalty_func(cbcnt, C[cb]);

    cacnt = cbcnt = 0;
    rep(i,D){
      if(next_schedule_table[i] == ca) {
        next_score -= penalty_func(cacnt, C[ca]);
        next_score += S[i][ca];
        cacnt = 0;
      } else {
        cacnt++;
      }
      if(next_schedule_table[i] == cb) {
        next_score -= penalty_func(cbcnt, C[cb]);
        next_score += S[i][cb];
        cbcnt = 0;
      } else {
        cbcnt++;
      }
    }
    next_score -= penalty_func(cacnt, C[ca]);
    next_score -= penalty_func(cbcnt, C[cb]);

    if(current_score < next_score) {
      current_score = next_score;
      schedule_table = next_schedule_table;
    }
  }
  rep(i,D)cout<<schedule_table[i]+1<<"\n";
  dbg(current_score);

  return 0;
}


Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int64_t n, ans=0;
  cin >> n;
  for(int i=1;i<n;i++) 
    ans += i;
  cout << ans;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<b;i++)
#define bFor(i,a,b) for(i=a;i>=b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;

long mmid(long a,long b,long c){return a<b?(b<c?b:max(a,c)):(b>c?b:min(a,c));}

double dist(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

ll modncr(ll n,ll r){
  ll i,plus=1;
  rep(i,r){
    plus=(plus*(n-i))%mod;
    plus=moddevide(plus,i+1);
  }
  return plus;
}

ll modncrlistp[200000],modncrlistm[200000];

ll modncrs(ll n,ll r){
  ll i,j;
  if(modncrlistp[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistp[i])break;
    }
    if(i<0){
      modncrlistp[0]=1;
      rep1(i,n+1){
        modncrlistp[i]=(modncrlistp[i-1]*i)%mod;
      }
    }else{
      For(j,i+1,n+1){
        modncrlistp[j]=(modncrlistp[j-1]*j)%mod;
      }
    }
  }
  if(modncrlistm[n]==0){
    for(i=n;i>=0;i--){
      if(modncrlistm[i])break;
    }
    if(i<0){
      modncrlistm[0]=1;
      rep1(i,n+1){
        modncrlistm[i]=(modncrlistm[i-1]*modinv(i))%mod;
      }
    }else{
      For(j,i+1,n+1)modncrlistm[j]=(modncrlistm[j-1]*modinv(j))%mod;
    }
  }
  return (((modncrlistp[n]*modncrlistm[r])%mod)*modncrlistm[n-r])%mod;
}

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

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

vec eratosthenes(ll N){
  ll i;
  vec ch(N+1,1),p;
  ch[0]=ch[1]=0;
  rep(i,N+1){
    if(ch[i]){
      p.push_back(i);
      for(ll j=2;i*j<=N;j++){
        ch[i*j]=0;
      }
    }
  }
  return ch;
}
int main(){
  ll i,j,N,M,a,b,ans=0;
  cin>>N>>M;
  vec v(N);
  rep(i,N){
    cin>>v[i];
    if(v[i]>=M)ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1024
s = str(input())
a = True
b = True
for i in range(0,len(s),2):
    if s[i] != "R" and s[i] != "U" and s[i] != "D":
        a = False
for i in range(1,len(s),2):
    if s[i] != "L" and s[i] != "U" and s[i] != "D":
        b = False
if a and b:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
long long gcd(long long a,long long b) {
	if(b==0)
		return a;
	return gcd(b,a%b);
}
int main()
{
	long long a,b,c,d,num1,num2,num3,ans;
	scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
	num1=b/c-(a-1)/c;
	num2=b/d-(a-1)/d;
	d=c*d/gcd(c,d);
	num3=b/d-(a-1)/d;
	num1=num1+num2-num3;
	ans=(b-a+1)-num1;
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>

using namespace std;

#define mod 1000000007

int main()
{
	int n;
	cin >> n;
	int a[2][101];
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < n; j++){
			cin >> a[i][j];
		}
	}
	int sum[2][101] = {};
	sum[0][0] = a[0][0];
	sum[1][n - 1] = a[1][n - 1];
	for(int i = 1; i < n; i++){
		sum[0][i] = sum[0][i - 1] + a[0][i];
	}
	for(int i = n - 2; i >= 0; i--){
		sum[1][i] = sum[1][i + 1] + a[1][i];
	}
	int ans = 0;
	for(int i = 0; i < n; i++){
		ans = max(ans, sum[0][i] + sum[1][i]);
	}
	cout << ans << endl;
	return 0;
 }

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

using namespace std;

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

typedef long long LL;
typedef vector<int> VI;

#define UB 1000000000

int main() {
  int64_t s;
  cin >> s;
  int64_t i = (int64_t)ceil(sqrt(s));
  int64_t x2 = i;
  int64_t y3 = i;
  while (x2*y3 - s > UB) {
    x2--;
  }
  int64_t x3 = x2*y3 - s;
  int64_t y2 = 1;
  cout << 0 << " " << 0 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
  return 0;
}


Measured memory_bytes: 256
/**
*    created: 05.05.2020 10:33:17
**/

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int inf =1000000000;

int main() {/*
    int a, b;
    cin >> a >> b;
    int nb = b,i=0;
    while(nb>0){
        i++;
        nb /= 10;
    }
    */
    char a[10],b[10];
    char str[110];
    scanf("%s%s",a,b);
	sprintf(str,"%s%s",a,b);
	int c;sscanf(str,"%d",&c);
    //nb = b + a * pow(10, i);
    bool w=0;

    rep(j,1000){
        //w =w||(j * j == c);
        if(j*j==c){
        cout << "Yes" << endl;
        return 0;
        }
    }
    /*
    if(w){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }*/
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void)
{
    int n;
    char u[256][16];
    char t[16];
    int m;
    int open;
    int i;

    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%s", u[i]);

    scanf("%d", &m);
    open = 0;
    while (m-- > 0){
        char t[16];

        scanf("%s", t);
        for (i = 0; i < n; i++){
            if (strcmp(t, u[i]) == 0){
                printf(open ? "Closed by %s\n" : "Opened by %s\n", u[i]);
                open = !open;
                break;
            }
        }
        if (i == n) printf("Unknown %s\n", t);
    }

    return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#define ll long long


using namespace std;

vector <int> g[200001];
int viz[200001];
int q[200001];

void bfs(int nod) {
    int b = 0, e = 1;
    q[0] = nod;
    viz[nod] = 1;
    do {
        for(auto it : g[q[b]])
        if(viz[it] == 0) {
            viz[it] = viz[q[b]] + 1;
            q[e++] = it;
        }
        b++;
    }while(b < e);
}

int main() {
   // fstream cin("A.in");
   // ofstream cout("A.out");
    int i,n,m,a,b;
    ios::sync_with_stdio(false);
    cin >> n >> m;
    for(i = 1; i <= m; i++) {
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    bfs(1);
    if(viz[n] == 3)
        cout << "POSSIBLE";
    else
        cout << "IMPOSSIBLE";
    //cin.close();
    //cout.close();
    return 0;
}


Measured memory_bytes: 13552
maxDiff :: Int -> Int -> [Int] -> Int
maxDiff minN maxN [] = maxN - minN
maxDiff minN maxN (x:xs) =
  maxDiff (min minN x) (max maxN x) xs

main = do
  _ <- getLine
  line <- getLine
  let
    xs = map read $ words line :: [Int]
    ans = maxDiff (10^10) 0 xs
  putStrLn $ show ans


Measured memory_bytes: 1020
def read_line(*types): return [f(a) for a, f in zip(input().split(), types)]

n, m = read_line(int, int)

x = []
for i in range(n):
    ai, bi = read_line(int, int)
    x.append((ai, bi))

x.sort(key=lambda xx: xx[0])

cost = 0
for a, b in x:
    buy = min(m, b)
    m -= b
    cost += a * buy
    if m <= 0:
        print(cost)
        break


Measured memory_bytes: 59992
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mst(a,b) memset((a),(b),sizeof(a))
#define mp(a,b) make_pair(a,b)
#define pi acos(-1)
#define pii pair<int,int>
#define pb push_back
#define lowbit(x) ((x)&(-x))
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;
const int maxn = 1e5 + 10;
const int maxm = 1e6 + 10;
const ll mod =  998244353;



int main() {
#ifdef local
    freopen("data.txt", "r", stdin);
//    freopen("data.txt", "w", stdout);
#endif
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%.10f\n",(double)a / b);
    return 0;
}


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

using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define FOR(i,n,m) for(ll i=n; i<(ll)m;i++)
#define FORr(i,n,m) for(ll i=n; i>(ll)m; i--)
#define FORm(i,m) for(auto i=m.begin();i!=m.end();i++)
#define cinv(v,n,m) FOR(i,n,m) cin>>v.at(i)
#define coutv(v,n,m) FOR(i,n,m) cout<<v.at(i) <<" "
#define cout(n) cout<<fixed<<setprecision(n)
int main(){
  int a,b;
  cin>>a>>b;
  cout<<a-b+1<<endl;
}


Measured memory_bytes: 256
loop do
  n = gets.to_i
  exit if n == 0
  a = n.times.map{gets.split.map{|l| l.split(":").map(&:to_i).inject{|s,i| s * 60 + i}}}.map{|a,b| [[a,1],[b-0.5,-1]]}.flatten(1)
  a = a.sort_by{|x,label| x}.map{|x,label| label}
  puts a.inject([0]){|s,label| s << (s.last + label)}.max
end

Measured memory_bytes: 10032
#include <stdio.h>

int main(){
  char s[3];
  int sevencheck = 0;
  scanf("%s",s);
  for(int i=0;i<3;i++){
    if(s[i]=='7'){
      sevencheck = 1;
    }
  }
  if(sevencheck){
    printf("Yes");
  }else{
    printf("No");
  }
  return 0;
}


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

using namespace std;


void solve() {
    int n; cin >> n;
    vector<int> a(n+1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    vector<long long> dp(n+1);
    vector<long long> dn(n+1);
    dp[1] = a[1]; dn[1] = -a[1];
    for (int i = 2; i <= n; i++) {
        dp[i] = max(dp[i-1]+a[i], dn[i-1]-a[i]);
        dn[i] = max(dp[i-1]-a[i], dn[i-1]+a[i]);
    }
    cout << dp[n];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    cout << endl;
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
#define x first
#define y second
#define mp make_pair
#define pb push_back
template <typename TYPE> inline void chkmax(TYPE &x,TYPE y){x<y?x=y:0;}
template <typename TYPE> inline void chkmin(TYPE &x,TYPE y){y<x?x=y:0;}
template <typename TYPE> void readint(TYPE &x)
{
    x=0;int f=1;char c;
    for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
    for(;isdigit(c);c=getchar())x=x*10+c-'0';
    x*=f;
}
const int MAXN=105;
const ull LIM=1ull<<63;

int n;
int x[MAXN],y[MAXN];
vector<int> G[MAXN];
int dep[MAXN],cnt[MAXN];
void dfs(int u,int pa)
{
	for(auto v:G[u])
	{
		if(v==pa)continue;
		dep[v]=dep[u]+1;
		dfs(v,u);
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
//	freopen("code.in","r",stdin);
//	freopen("code.out","w",stdout);
	#endif
	readint(n);
	for(int i=1;i<n;++i)
	{
		readint(x[i]),readint(y[i]);
		G[x[i]].pb(y[i]),G[y[i]].pb(x[i]);
	}
	int best=1<<30;
	ull leaf=LIM;
	for(int i=1;i<=n;++i)
	{
		memset(cnt,0,sizeof(cnt));
		dep[i]=1;
		dfs(i,-1);
		int m=0;
		for(int j=1;j<=n;++j)
		{
			chkmax(m,dep[j]);
			chkmax(cnt[dep[j]],(int)(G[j].size()-(i!=j)));
		}
		if(m>best)continue;
		ull t=LIM,lf=0;
		for(int j=1;j<m;++j)t/=cnt[j];
		if(!t)lf=LIM;
		else
		{
			lf=1;
			for(int j=1;j<m;++j)lf*=cnt[j];
			if(G[i].size()==1)++lf;
		}
		if(m<best || lf<leaf)best=m,leaf=lf;
	}
	for(int i=1;i<n;++i)
	{
		memset(cnt,0,sizeof(cnt));
		int u=x[i],v=y[i];
		dep[u]=dep[v]=1;
		dfs(u,v);dfs(v,u);
		int m=0;
		for(int j=1;j<=n;++j)
		{
			chkmax(m,dep[j]);
			chkmax(cnt[dep[j]],(int)G[j].size()-1);
		}
		if(m>best)continue;
		ull t=LIM/2,lf=0;
		for(int j=1;j<m;++j)t/=cnt[j];
		if(!t)lf=LIM;
		else
		{
			lf=1;
			for(int j=1;j<m;++j)lf*=cnt[j];
			lf*=2;
		}
		if(m<best || lf<leaf)best=m,leaf=lf;
	}
	cout<<best<<" "<<leaf<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ull mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int M=205;
int n,m;
vs a,b;
vi c;
map<ull,int> mp1[M],mp2;

ull Hash(string s,bool B){
	ull h=0,t=1;
	for(int i=0;i<s.size();i++){
		h+=s[i]*t;
		t*=mod;
		if(B) mp1[i][h]++;
	}
	if(B) mp2[h]++;
	return h;
}

void f(){
	mp2.clear();
	for(int i=0;i<M;i++) mp1[i].clear();
	for(int i=0;i<n;i++) Hash(a[i],1);
	for(int i=0;i<m;i++) if(b[i][0]!='*'){
		c[i]=0;
		string s=b[i];
		int N=s.size(),B=0,I=-1;
		if(s.back()=='*'){
			s=s.substr(0,N-1);
			N--;B=1;
		}
		for(int j=0;j<N;j++) if(s[j]=='?') I=j;
		if(I<0){
			ull h=Hash(s,0);
			if(B) c[i]=mp1[N-1][h];
			else c[i]=mp2[h];
		}
		else{
			for(int j=0;j<26;j++){
				s[I]=(char)('a'+j);
				ull h=Hash(s,0);
				if(B) c[i]+=mp1[N-1][h];
				else c[i]+=mp2[h];
			}
		}
	}
	for(int i=0;i<n;i++) reverse(a[i].begin(),a[i].end());
	for(int i=0;i<m;i++) reverse(b[i].begin(),b[i].end());
}

int main(){
	cin>>n>>m;
	a=vs(n);
	b=vs(m);
	c=vi(m);
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<m;i++) cin>>b[i];
	f();f();
	for(auto i:c) cout<<i<<endl;
}


Measured memory_bytes: 185480
#include <iostream>
#include <functional>
#include <algorithm>
#include <cstring>
using namespace std;

int main(){
	int H, W;
	int h, w;
	cin >> H >> W >> h >> w;
	int all = H * W;
	cout << all - h * W - w * H + (h * w) << endl;
}

Measured memory_bytes: 256
#include"bits/stdc++.h" 
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
typedef long long int ll;
vector<int>u;
vector<int>w;
vector<int>::iterator it;
priority_queue<int>pq;
const int N=1e5+10;
/*--------------------------hbp16@hbp16-Inspiron-3543:-$------------------------------*/
int main(int argc, char const *argv[])
{
	int n,k;
	cin>>n>>k;
	int cnt=0;

	while(n>0)
	{
		n -= k;
		cnt++;
	}
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<set>
#include<queue>
using namespace std;

int value[555555] = {0};

int main() 
{
	int n, score,m,mark;
	cin >> n >> score >> m;
	int t = m;
	while (t--)
	{
		cin >> mark;
		value[mark-1]++;
	}
	for (int i = 0; i < n; i++)
	{
		if (score > m - value[i])printf("Yes\n");
		else printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 1024
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


t, x = LI()

print(t / x)


Measured memory_bytes: 2940