akhauriyash/Code-Regression huggingface dataset:
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Gosu_Hiroo
 */

#include <iostream>
#include <fstream>

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

typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define intv(x, a, b)((x)>=a && (x)<=b)
#define  rep(i, _begin, _end) for (__typeof(_end) end = _end, begin = _begin,  i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define  _for(i, end) for (__typeof(end) i = 0, _len = (end); i < (_len); i += 1)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define F first
#define S second
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define what_is(x) cerr << #x << " is " << x << endl;
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define mod(x, m) ((((x) % (m)) + (m)) % (m))
#define bit(n) (1LL<<(n))
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define readint ({int t;cin >> t;t;})
const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const ll LLINF = 1000000000000000005LL;;
const ll MOD = (ll) (1e9) + 7;
void _mod(ll &x){x = mod(x, MOD);}
//const ll MOD = (ll) 998244353 ;
const double EPS = 1e-10;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
    std::fill((T *) array, (T *) (array + N), val);
}

template <typename T>
ostream& operator << (ostream& os, const vector<T> V) {
    for(auto v : V)os << v << " ";
    return os;
}

template <typename T>
ostream& operator << (ostream& os, const set<T> V) {
    for(auto v : V)os << v << " ";
    return os;
}

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

//#define int ll

class ADodecagon {
public:

void solve(std::istream& cin, std::ostream& cout) {
    int r;
    cin >> r;
    cout << 3 * r *r << endl;}


};


#undef int
int main() {


	ADodecagon solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	in.tie(0); ios::sync_with_stdio(0); out<<fixed<<setprecision(20);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::HashMap;

fn main() {
    input!(n: usize, xs: [i64; n]);
    let mut vs = vec![0i64; n + 2];
    for i in 1..n + 1 {
        vs[i] = xs[i - 1];
    }
    let mut sum = 0;
    for i in 0..n + 1 {
        sum += (vs[i] - vs[i + 1]).abs();
    }

    for i in 1..n + 1 {
        let mut ans = sum;
        ans -= (vs[i] - vs[i - 1]).abs() + (vs[i] - vs[i + 1]).abs();
        ans += (vs[i - 1] - vs[i + 1]).abs();
        println!("{}", ans);
    }
}


Measured memory_bytes: 7292
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define y1 y122
/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/STACK: 20000000005")
*/

using namespace std;

ll M = 1e9;




ll S;

ll x1, y1, x2, y2;
ll x, y;


main()
{
    //freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    S = 1e18;
    cin >> S;
    ll l = 0, r = M;
    while (l < r){
        ll mid = l + r + 1 >> 1;
        if (mid * mid < S)
            l = mid;
        else
            r = mid - 1;
    }
    ll X = l + 1;
    ll Y = X - 1;
    ll d1 = X * X - S;
    ll d2 = S - Y * Y;
    if (d1 <= d2){
        x1 = X;
        y2 = X;
        x2 = 1;
        y1 = d1;
    }
    else {
        x = 1;
        x1 = Y + 1;
        y2 = Y;
        x2 = 0;
        y1 = d2;
    }
    cout << x << " " << y << " " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(s) cout<<s<<endl;
typedef long long LL;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}


int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    a<=b?b/a<c?cout<<b/a<<endl:cout<<c<<endl:cout<<0<<endl;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
A.sort()

if A[0] == 0:
        print(0)
        exit()

ans = 1
for i in A:
        ans = ans * i
        if ans > 1000000000000000000:
                print(-1)
                exit()

print(ans)


Measured memory_bytes: 21600
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){

    string S;
    cin >> S;

    vector <char> T;
    for (int i = 0; i < S.length(); i++){
        if (S[i] == 'B' && S[i + 1] == 'C'){
            T.push_back('X');
            i++;
        }else{
            T.push_back(S[i]);
        }
    }
    
    long long count = 0, ans = 0;
    for (int i = 0; i < T.size(); i++){
        if (T[i] == 'A'){
            count++;
        }else if(T[i] == 'X'){
            ans += count;
        }else{
            count = 0;
        }
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 772
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<long long>;
using pll = pair<long long, long long>;
#define rep(i,n) for(long long i(0);(i)<(n);(i)++)


void solve(long long A, long long B, long long T){
    cout << (T/A)*B << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long T;
    scanf("%lld",&T);
    solve(A, B, T);
    return 0;
}


Measured memory_bytes: 256
sp = input()
t = input()
len_t = len(t)
len_s = len(sp)
cand = []
part_start = -1

for i in range(len_s - len_t + 1):
    num = 0
    for j in range(len_t):
        if (sp[i + j] == '?' or sp[i + j] == t[j]):
            num += 1

    if (num == len_t):
        part_start = i

if part_start != -1:
    # 部分文字列は最後にあったほうがいい?はaで最小化できる可能性があり、文字列の先頭に近い部分にそれらがあったほうがよい
    ans = sp[:part_start] + t + sp[part_start + len_t:]
    ans = ans.replace('?', 'a')
    print(ans)
else:
    print('UNRESTORABLE')


Measured memory_bytes: 3064
#include<stdio.h>

int main(){
    int M, D;
    scanf("%d %d",&M,&D);
    
    int cnt=0;
    for(int i=4;i<=M;i++){
        for(int j=22;j<=D;j++){
            int f = j%10;
            int d = j/10;
            if(d>=2 && f>=2 && d*f == i){
                cnt++;
            }
        }
    }
    
    printf("%d",cnt);
}

Measured memory_bytes: 128
// BWOTSHEWCHB

#include <bits/stdc++.h>

using namespace std ;

#define int long long
#define pb push_back
#define in insert
#define X first
#define Y second

const int MAXN = 1e6 + 69 , MOD = 1e9 + 7 ;

int n , arr[MAXN] , dp[MAXN] , last[MAXN] ;

int32_t main() {
	ios::sync_with_stdio(false) ;
	cin.tie(0) ; cout.tie(0) ;
	cin >> n ;
	int ip , cnt = 0 ;
	for ( int i = 1 ; i <= n ; i ++ ) {
		cin >> ip ;
		if ( ip == arr[cnt] )
			continue ;
		cnt ++ , arr[cnt] = ip ;
	}
	dp[1] = 1 , last[arr[1]] = 1 ;
	for ( int i = 2 ; i <= cnt ; i ++ ) {
		dp[i] = (dp[i - 1] + last[arr[i]]) % MOD ;
		last[arr[i]] = dp[i] ;
	}
	cout << dp[cnt] << "\n" ;
}


Measured memory_bytes: 9984
#include<cstdio>
using namespace std;

bool grid[1000][1000];
int num[1001][1001],i,j,h,w,n,t;

int main(){
  while(scanf("%d%d%d",&h,&w,&n) && (h||w||n)){
    for(i=0;i<h;i++)
      for(j=0;j<w;j++){
	scanf("%d",&t);
	grid[i][j] = t?true:false;
	num[i][j] = 0;
      }

    num[0][0] = n-1;
    for(i=0;i<h;i++)
      for(j=0;j<w;j++){
	int N=num[i][j];
	if(grid[i][j]){
	  num[i+1][j] += N/2;
	  num[i][j+1] += N-N/2;
	}else{
	  num[i][j+1] += N/2;
	  num[i+1][j] += N-N/2;
	}
	if(N&1)grid[i][j] = !grid[i][j];
      }

    i=j=0;
    while(i<h && j<w)grid[i][j]?j++:i++;
    printf("%d %d\n",i+1,j+1);
  }
}

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

int main()
{
 int N,V[21],C[21];
 cin >> N;
 for(int i = 0; i < N; i++) cin >> V[i];
 for(int i = 0; i < N; i++) cin >> C[i];
 int bet[21];
 for(int i = 0; i < N; i++) bet[i] = V[i] - C[i];
 int ans = 0;
 for(int i = 0; i < N; i++){
  if(bet[i] > 0) ans += bet[i]; 
 }
 cout << ans;
 return 0;
}

Measured memory_bytes: 256
from collections import deque

N = int(input())
L = [[] for i in range(N)]
for i in range(N-1) :
    u,v = map(int,input().split())
    u -= 1
    v -= 1
    L[u].append(v)
    L[v].append(u)

da = [0]*N
db = [0]*N

qa = deque([0])
visited = [False]*N
visited[0] = True
while qa :
    u = qa.popleft()
    for v in L[u] :
        if not visited[v] :
            visited[v] = True
            da[v] = da[u] + 1
            qa.append(v)

qb = deque([N-1])
visited = [False]*N
visited[N-1] = True
while qb :
    u = qb.popleft()
    for v in L[u] :
        if not visited[v] :
            visited[v] = True
            db[v] = db[u] + 1
            qb.append(v)

c = sum(da[i] <= db[i] for i in range(N))
ans = "Fennec" if c > N-c else "Snuke"
print(ans)


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

#define ll long long
#define UN unsigned
#define pb push_back
#define mod 1000000007
#define mt make_tuple
typedef tuple<int, int> tii;
typedef pair<int, int> pii;

void solve(){
    string s;
    cin >> s;

    if(s[2] == s[3] && s[4] == s[5])
        cout << "Yes";
    else
        cout << "No";
}

int main(void){
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cerr.tie(nullptr);
    solve();
    return 0;
}

Measured memory_bytes: 256
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    k, x = map(int, input().split())
    ans = []
    for i in range(max(-1000000, x-k+1), min(1000000, x+k)):
        ans.append(str(i))
    print(" ".join(ans))
    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 10376
#define loop(i, n) for (int i = 0; i < n; i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
const ll m = 1e9 + 7;

ll power(ll a, ll n) {
	if (n == 0) {
		return 1;
	} else {
		ll res = power(a, n / 2);
		res = (res * res) % m;
		if (n % 2 != 0) {
			res = (res * a) % m;
		}
		return res;
	}
}

int main() {
	int n;	ll lcm = 1, final = 0;	cin >> n;
	vector <ll> v(n);		map <ll, ll> p;
	for (int i = 0; i < n; i++) {
		cin >> v[i];
		ll temp = v[i];
		for (int i = 2; i * i <= temp; i++) {
			ll cnt = 0;
			while (temp % i == 0) {
				temp /= i;
				cnt++;
			}
			if (cnt)
				p[i] = max(p[i], cnt);
			if (temp == 1)		break;
		}
		if (temp > 1)	p[temp] = max(p[temp], (ll)1);
	}
	for (auto &i : p) {
		lcm = (lcm * power(i.first, i.second)) % m;
	}
	for (int i = 0; i < n; i++) {
		final += (lcm * power(v[i], m - 2)) % m;
		final %= m;
	}
	cout << final << endl;
	return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int r,k=0;
  while(n!=0)
  {
     r=n%10;
    if(r==7)
    {
    cout<<"Yes";
      k++;
      break;
    }
    n=n/10;
  }
  if(k==0)
    cout<<"No";
}

Measured memory_bytes: 3612
#include<algorithm>
#include<cassert>
#include<cmath>
#include<cstdio>
#include<iostream>
#include<numeric>
#include<stack>
#include<string>
#include<deque>
#include<queue>
#include<vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll mod = 1e9+7;
const double PI = acos(-1);  // PI = 3.141593...

void print(deque<int> &q) {
    rep(i, q.size()) {
        if(i) cout << " ";
        cout << q[i];
    }
    cout << endl;
}
int main() {
    int n;
    deque<int> q;
    cin >> n;

    string cmd;
    int v;
    rep(i, n) {
        cin >> cmd;
        if(cmd == "insert") {
            cin >> v;
            q.push_front(v);
        }
        else if(cmd == "delete") {
            cin >> v;
            for(int i=0; i<q.size(); ++i) {
                if(v == q[i]) {
                    q.erase(q.begin()+i);
                    break;
                }
            }
        }
        else if(cmd == "deleteFirst") {
            q.pop_front();
        }
        else if(cmd == "deleteLast") {
            q.pop_back();
        }
    }
    print(q);

    return 0;
}


Measured memory_bytes: 7028
#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(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    int one = 0, two = 0, three = 0;
    rep(i, N) {
        int P;
        cin >> P;
        if (P <= A) one += 1;
        else if (P >= B + 1) three += 1;
        else two += 1;
    }
    cout << min({one, two, three}) << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e18;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N,K;
    cin >> N >> K;
    vector<int>V(N);
    for(int i = 0; i < N; i++) {
        cin >> V[i];
    }
    int ans = 0;
    for(int i = 0; i <= min(N,K); i++) {
        for(int j = 0; i+j <= min(N,K); j++) {
            int cnt = 0;
            vector<int>res = {};
            for(int k = 0; k < i; k++) {
                cnt += V[k];
                if(V[k] < 0) {
                    res.push_back(V[k]);
                }
            }
            for(int k = N-1; k >= N-j; k--) {
                cnt += V[k];
                if(V[k] < 0) {
                    res.push_back(V[k]);
                }
            }
            sort(res.begin(),res.end());
            for(int k = 0; k < res.size() && k < K-i-j;  k++) {
                cnt += abs(res[k]);
            }
            ans = max(ans,cnt);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3612
#include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
	double x,h;
	while(cin >> x >> h){
		if(!x) break;
		double s;
		s=x*(x+2*sqrt(h*h+x*x/4));
		printf("%f\n",s);
	}
	return 0;
}

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

int main(){
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    double argm = m/60*360;
    double argh = ((h*60)/720)*360+((360/12)*(m/60));
    //cout << argm << ", " << argh;
    double arghm = abs(argh-argm);
    double arghmRAD = arghm * (3.141592653589/180);
    double ans = sqrt(pow(a,2) + pow(b,2) - 2*a*b*cos(arghmRAD));
    cout << setprecision(20) << ans << endl;
    }
    

Measured memory_bytes: 4224
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long x = Long.parseLong(scan.next());
        scan.close();

        int ans = 0;
        long value = 100;
        while (value < x) {
            long add = value / 100;
            value += add;
            ans++;
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 35764
n,m = (int(i) for i in input().split())
ab = [[int(i) for i in input().split()] for i in range(m)]

class UnionFind:
    def __init__(self, n):
        self.par = [-1 for _ in range(n)]
        #self.rank = [-1] * (n+1)
        #print(self.par)

    # 検索
    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            return self.find(self.par[x])

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.par[x] <= self.par[y]:
            self.par[x] += self.par[y]
            self.par[y] = x
        else:
            self.par[y] += self.par[x]
            self.par[x] = y
        return self.par

    # 同じ集合に属するか判
    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self,x):
        tmp = self.find(x)
        tmp2 = self.par[tmp]
        return -tmp2

#print()
ans = [n*(n-1)//2]
uf = UnionFind(n)
i = 0
for a,b in ab[::-1]:
    a -= 1
    b -= 1
    res = 0
    if not uf.same(a,b):
        #print(uf.size(a),uf.size(b))
        res = uf.size(a)*uf.size(b)
        tmp = uf.union(a,b)
    #print(tmp)
    ans.append(ans[i]-res)
    i += 1

for i in range(m)[::-1]:
    print(ans[i])


Measured memory_bytes: 28644
#include<bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pll = pair<ll, ll>;
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define sz(x) ((x).size())
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define rep(i, a, b) for(ll i = ll(a); i < ll(b); i++)
const double PI = acos(-1);
const int mod = 1e9+7;
const long long INF = (1LL << 60);
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(ll a, ll b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmax(T &a, const T &b){ if(a < b){ a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b){ if(a > b){ a=b; return 1; } return 0; }

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  
  ll n;
  cin >> n;
  vector<ll> h(n);
  rep(i, 0, n) cin >> h[i];

  ll ans = 0, cnt = 0;
  rep(i, 0, n-1){
    if(h[i] < h[i+1]) cnt = 0;
    else{
      cnt++;
      chmax(ans, cnt);
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3944
package main

import (
	"fmt"
)

func main() {
	var h, w int64
	fmt.Scanf("%d %d", &h, &w)

	ans := int64(1e18)
	for rep := 1; rep <= 2; rep++ {
		for i := int64(1); i <= h; i++ {
			a := make([]int64, 3)
			a[0] = i * w
			if (h-i)*w%2 == 0 {
				a[1], a[2] = (h-i)*w/2, (h-i)*w/2
			} else {
				a[1] = ((h-i)*w - min(h-i, w)) / 2
				a[2] = a[1] + min(h-i, w)
			}
			ans = min(ans, max(a[2], max(a[1], a[0]))-min(a[2], min(a[1], a[0])))
		}
		h, w = w, h
	}

	fmt.Printf("%d\n", ans)
}

func min(a, b int64) int64 {
	if a <= b {
		return a
	}
	return b
}

func max(a, b int64) int64 {
	if a >= b {
		return a
	}
	return b
}


Measured memory_bytes: 512
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
using namespace std;

int main() {
    int n;
    scanf("%d", &n);
    int q = 1;
    while (q * (q + 1) / 2 < n) {
        q++;
    }
    int rem = n;
    vector<int> ans;
    while (rem > 0) {
        assert(q != 0);
        if (q <= rem) {
            rem -= q;
            ans.push_back(q);
        }
        q--;
    }
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < (int)ans.size(); i++) {
        printf("%d\n", ans[i]);
    }
}


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

int main() {
    int n,q;
    cin>>n>>q;
    string s;
    cin>>s;
    //since its tle for basic approach we will store all values already
    int ans[n]={0};
    for(int i=0;i<n-1;i++){
        if(s[i]=='A' && s[i+1]=='C')ans[i+1]=1;
    }
    //prefix sum
    int a[n]={0};
    a[0]=ans[0];
    for(int i=1;i<n;i++)a[i]=a[i-1]+ans[i];
    while(q--){
        int l,r;
        cin>>l>>r;
        cout<<a[r-1]-a[l-1]<<endl;
    }
    return 0;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<cstdlib>
#include<iomanip>
#include<queue>
#include<set>
#include <valarray>
#include<stack>
#include<sstream>
using namespace std;

double Solution2( int a, int b )  //pythagoras
{
    return 2 * sqrt( (double)( a * b ) );
}

void Solution()
{
    int length;
    
    while(cin>>length)
    {
        string s;
        
        getline(cin, s);
        
        vector<int> curcles;
        
        stringstream ss(s);
        
        while(!ss.eof())
        {
            int r;
            ss>>r;  //<< で書き込んだデータを >> で読み出す事も出来ますので、文字列バッファとして利用できます。
            curcles.push_back(r);
        }
        
        sort(curcles.begin(), curcles.end());
        
        double width = 0.f;
        
        int f = 0;
        int b = curcles.size() - 1;
        
        int minR = 0, maxR = 0;
        
        int edge1 = curcles[ f++ ];
        int edge2 = edge1;
        
        for( int i = 0; i < (int)curcles.size() - 1; ++i )
        {
            minR = curcles[f];
            maxR = curcles[b];
            
            if( maxR - edge1 > edge2 - minR )
            {
                width += Solution2( edge1, maxR );
                edge1 = maxR;
                --b;
            }
            else
            {
                width += Solution2( edge2, minR );
                edge2 = minR;
                ++f;
            }
            
            if( edge1 > edge2 )
            {
                swap(edge1, edge2);
            }
        }
        
        width += edge1 + edge2;
        
        cout<<(width <= length ? "OK" : "NA" ) << endl;
    }
    
}

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

Measured memory_bytes: 1232
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

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

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int n; cin>>n;
    vector<int> val2index(n);
    for(int i=0; i<n; i++){
        int p; cin>>p;
        p--;
        val2index[p] = i;
    }
    
    multiset<int> st{-1, -1, val2index[n-1], n, n};

    ll ans = 0;
    for(int i=n-2; i>=0; i--){
        st.insert(val2index[i]);

        auto mid = st.find(val2index[i]);
        auto ub = mid; ub++;
        auto uub = ub; uub++;
        auto lb = mid; lb--;
        auto llb = lb; llb--;

        ans += (ll)(*uub - *ub) * (*mid - *lb) * (i + 1);
        ans += (ll)(*lb - *llb) * (*ub - *mid) * (i + 1);
    }

    cout << ans << endl;
}

Measured memory_bytes: 6400
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define inf int(1e9)
#define half_inf int(1e5)
#define ll_inf ll(1e9)*ll(1e9)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int mod = 1000000007;


ll q, h, s, d, n;

void solve() {
    ll min_one = min(q * 4, min(h * 2, s));
    if (min_one * 2 > d) {
        cout << d * (n / 2) + (n - 2 * (n / 2)) * min_one << endl;
    } else {
        cout << min_one * n << endl;
    }
}

int main() {
    cin >> q >> h >> s >> d >> n;
    solve();
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def main():
#  A,B = map(int, input().split())
  r1 = input().rstrip()
  r2 = input().rstrip()

  if r1 == r2[::-1]:
    print('YES')
  else:
    print('NO')
  
if __name__ == "__main__":
  main()

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int cnt1,cnt2,i;
    cin>>s;
    for(i=0;i<s.length();i++)
    {
        if(s[i]=='h'&&s[i+1]=='i')
            i++;
        else
        {
            cout<<"No\n";
            return 0;
        }
    }
    cout<<"Yes\n";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int m,d,ans=0;
    cin>>m>>d;
    for(int k=4;k<=m;k++){
        for(int i=2;i<=9;i++){
            for(int j=2;j<=9;j++){
                if(i*j==k&&i*10+j<=d){
                    ans++;
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

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

  vector<ll> a(n, 0);
  for (ll i = 0; i < n; ++i) {
    cin >> a[i];
  }

  vector<ll> ans(n, 0);
  for (ll i = 0; i < n; ++i) {
    if (i % 2 == 0) ans[0] += a[i];
    else ans[0] -= a[i];
  }

  for (ll i = 1; i < n; ++i) {
    ans[i] = (2 * a[i-1]) - ans[i-1];
  }

  for (ll i = 0; i < n; ++i) {
    cout << ans[i];
    if (i == n-1) cout << endl;
    else cout << " ";
  }
  
  return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(k,i,n) for(ll i=k;i<n;++i)
int main(void){
    // Your code here!
    string s,t;
    cin>>s>>t;
    sort(s.begin(),s.end());
    sort(t.rbegin(),t.rend());
    if(s<t)cout<<"Yes";
    else cout<<"No";
}


Measured memory_bytes: 3632
#include <stdio.h>
int main(){
	int n, a, b, c, temp;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%d %d %d", &a, &b, &c);
		if(a > b){
			if(c > a){
				temp = c;
				c = a;
				a = temp;
			}
		}else{
			if(c > b){
				temp = c;
				c = a;
				a = temp;
			}else{
				temp = b;
				b = a;
				a = temp;
			}
		}
		if(b*b + c*c == a*a){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
using namespace std;
int main() {
	double c, distance, count =0, x, y;
	cin >> c >> distance;
	distance *= distance;
	for (int i = 0; i < c; i++) {
		cin >> x >> y;
		x *= x;
		y *= y;
		if (distance >= (x + y)) {
			count++;
		}
	}
	cout << count;
}

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

int n;
void dfs(string s, char mx) {
  if (s.size() == n) {
    cout << s << endl;
    return;
  }
  for (char c = 'a'; c <= mx+1; c++) {
    string t = s;
    t += c;
    dfs(t, max(mx, c));
  }
}

int main() {
  cin >> n;
  dfs("", 'a'-1);
  return 0;
}

Measured memory_bytes: 1536
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a = [0]
b = [0]
T = 0
ans = 0

for i in range(N):
  a.append(a[i] + A[i])

for i in range(M):
  b.append(b[i] + B[i])

j = M

for i in range(N+1):
  if a[i] > K:
    break
  while a[i] + b[j] > K:
    j -= 1
  ans = max(ans, i + j)


print(ans)

Measured memory_bytes: 47556
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define sortr(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define MAX 100000
#define SENTINEL 2000000000
constexpr int inf = 100000000;

int a[MAX],n;

int partition(int p,int r){
    int i=p-1;
    for(int j=p;j<r;j++){
        if(a[j]<=a[r]){
            i++;
            swap(a[i],a[j]);
        }
    }
    swap(a[i+1],a[r]);
    return i+1;
}

int main(){
    cin>>n;
    rep(i,n)cin>>a[i];
    int q=partition(0,n-1);
    rep(i,n){
        if(i){
            cout<<" ";
        }
        if(i==q){
            cout<<"["<<a[i]<<"]";
        }else{
            cout<<a[i];
        }
    }
    cout<<endl;
   return 0;
}












Measured memory_bytes: 3464
use std::collections::VecDeque;

use proconio::input;
use proconio::marker::Usize1;

fn bfs(g: &Vec<Vec<usize>>, v: usize) -> Vec<usize> {
    let n = g.len();
    let mut d = vec![n; n];
    let mut q = VecDeque::<usize>::new();
    q.push_back(v);
    d[v] = 0;
    while q.len() > 0 {
        let v = *q.front().unwrap();
        q.pop_front();
        for &u in &g[v] {
            if d[u] > d[v] + 1 {
                d[u] = d[v] + 1;
                q.push_back(u);
            }
        }
    }
    d
}

fn diameter(g: &Vec<Vec<usize>>) -> usize {
    let n = g.len();
    let d = bfs(&g, 0usize);
    let mut v = 0;
    for i in 1..n {
        if d[i] > d[v] {
            v = i;
        }
    }
    let d = bfs(&g, v);
    return *d.iter().max().unwrap();
}

fn main() {
    input! {
        n: usize,
        es: [(Usize1, Usize1); n-1],
    }

    let mut g = vec![vec![]; n];
    for (a, b) in es {
        g[a].push(b);
        g[b].push(a);
    }

    let diam = diameter(&g);
    println!("{}", if diam % 3 != 1 { "First" } else { "Second" });
}


Measured memory_bytes: 21444
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

S = str(input())
T = str(input())
ans = 0
for i in range(3):
    if S[i]==T[i]:
        ans += 1
print(ans)

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

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

    int a[60];
    int idx = 0;
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        if (abs(a[i]) > abs(a[idx])) {
            idx = i;
        }
    }
    cout << 2 * N - 1 << endl;
    for (int i = 0; i < N; i++) {
        cout << idx + 1 << " " << i + 1 << endl;    // i+1にidxを加算

        a[i] += a[idx];
    }
    if (a[idx] >= 0) {
        for (int i = 0; i < N - 1; i++) {
            cout << i + 1 << " " << i + 2 << endl;
            a[i + 1] += a[i];
        }
    } else {
        for (int i = N - 1; i > 0; i--) {
            cout << i + 1 << " " << i << endl;
            a[i - 1] += a[i]; 
        }
    }

    cerr << "======" << endl;
    for (int i = 0; i < N; i++) {
        cerr << a[i] << " ";
    }
    cerr << endl;

    return 0;
}

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

int main(){
	int N;
	ll x;
	cin >> N >> x;
	ll a[N];
	rep(i,N) cin >> a[i];
	sort(a,a+N);
	int ans = N-1;
	rep(i,N) {
		x -= a[i];
		if (x==0) {
			ans = i+1;
			break;
		}
		else if (x<0) {
			ans = i;
			break;
		}
	}
	cout << ans << endl;


	return 0;
}


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

struct state{
  ll a,b,bit,cost;
  bool operator < (const state &p) const {
    return cost > p.cost;
  }
};

int n,m;
int d[50],e[50];
int G[50][50];
unordered_map<ll,ll> dist[50][50];

void f(ll a,ll b,ll bit){
  if(dist[a][b].count(bit)==0){
    dist[a][b][bit]=1e8;
  }
}

int solve(){
  priority_queue< state > Q;
  dist[0][0][0]=0;
  Q.push( (state){0,0,0,0} );
  
  while(!Q.empty()){
    state s=Q.top();Q.pop();
    if(s.a==n-1&&s.b==n-1){
      return s.cost;
    }
    

    for(int na=0;na<n;na++){
      if(e[s.a]>e[na])continue;
        
      ll ncost=s.cost+G[s.a][na]+d[na];
      if(s.bit>>na&1)ncost-=d[na];
        
      ll nbit=s.bit;
      if(e[na]>e[s.b])nbit=(1LL<<na);
      else if(e[na]==e[s.b])nbit=s.bit|(1LL<<na);
        
      f(na,s.b,nbit);
      if(dist[na][s.b][nbit] > ncost ){
        dist[na][s.b][nbit]=ncost;
        Q.push( (state){na,s.b,nbit,ncost} );
      }
    }

    for(int nb=0;nb<n;nb++){
      if(e[s.b]>e[nb])continue;
      ll ncost=s.cost+G[nb][s.b]+d[nb];
      if(s.bit>>nb&1)ncost-=d[nb];
        
      ll nbit=s.bit;
      if(e[nb]>e[s.a])nbit=(1LL<<nb);
      else if(e[nb]==e[s.a])nbit=s.bit|(1LL<<nb);
        
      f(s.a,nb,nbit);
      if(dist[s.a][nb][nbit] > ncost ){
        dist[s.a][nb][nbit]=ncost;
        Q.push( (state){s.a,nb,nbit,ncost} );
      }

    }
  }
  
  return -1;
}

int main(){
  while(1){
    cin>>n>>m;
    if(n==0&&m==0)break;

    for(int i=0;i<50;i++){
      d[i]=e[i]=0;      
      for(int j=0;j<50;j++){
        dist[i][j].clear();
        G[i][j]=1e8;
      }
    }
    
    for(int i=1;i<n-1;i++)cin>>d[i]>>e[i];
    e[n-1]=1000;
    
    for(int i=0;i<m;i++){
      int a,b,c;
      cin>>a>>b>>c;
      a--,b--;
      G[a][b]=min(G[a][b],c);
    }
    cout<<solve()<<endl;
  }
  return 0;
}

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

template<class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

constexpr int MAX_N = 100;
constexpr int MAX_W = 10000;
int v[MAX_N];
int w[MAX_N];
int dp[MAX_N + 1][MAX_W + 1];

int main() {
  int N, W;
  cin >> N >> W;
  for (int i{}; i < N; ++i) {
    cin >> v[i] >> w[i];
  }

  for (int i{}; i < N; ++i) {
    for (int j{}; j <= W; ++j) {
      if (j >= w[i]) {
        chmax(dp[i + 1][j], dp[i][j - w[i]] + v[i]);
      }
      chmax(dp[i + 1][j], dp[i][j]);
    }
  }

  cout << dp[N][W] << endl;
  return 0;
}



Measured memory_bytes: 6968
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#define test ll t; cin>>t; while(t--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<1000007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{
	int n;
	cin>>n;
	int a[n];
	int cnt=0;
	int x;
	forci(1,n+1){
		cin>>x;
		if(i%2!=0 && x%2!=0)
			cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}







Measured memory_bytes: 3652
def examC():
    N, M = LI()
    cur = 2**M
    ans = cur*(N*100+M*1800)
    print(ans)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()


Measured memory_bytes: 3432
//
//  main.swift
//  AtCoderSwift
//
//  Created by burita083 on 2020/08/25.
//  Copyright © 2020 burita083. All rights reserved.
//

import Foundation
func readInt() -> Int {
    return Int(readLine()!)!
}
 
func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}
 
func readTwoInts() -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: " ").map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

func abc080_b() {
    let N = readLine()!
    let sum = N.map { Int(String($0))! }.reduce(0, +)
    print(Int(N)! % sum == 0 ? "Yes" : "No")
}

//abc080_b()

func abc078_b() {
    let input = readInts()
    var X = input[0]
    let Y = input[1]
    let Z = input[2]
    var ans = 0
    X -= Y+Z*2
    ans += 1
    ans += X/(Y+Z)
    
    print(ans)
}

func abc085_b() {
    let N = readInt()
    var l: [Int] = []
    for _ in 0..<N {
        let d = readInt()
        l.append(d)
    }
    print(l.reduce([], { $0.contains($1) ? $0 : $0 + [$1] }).count)
}

func isSquare(n: Double) -> Bool {
    let sqrt = floor(n.squareRoot())
    return sqrt * sqrt == n
}

func abc077_b() {
    let N = readInt()
    for n in (1...N).reversed() {
        if isSquare(n: Double(n)) {
            print(n)
            return
        }
    }
}

func abc020_b () {
    let inputs = readInts()
    print(Int(String(inputs[0]) + String(inputs[1]))! * 2)
}

func abc073_b () {
    var ans = 0
    let N = readInt()
    for _ in 0..<N {
        let inputs = readInts()
        ans += inputs[1] - inputs[0] + 1
    }
    print(ans)
}



abc073_b()



Measured memory_bytes: 13512
import sys

N,Y = map(int,input().split())

for i in reversed(range(N+1)):
    if Y < i * 10000:
        continue
    for j in reversed(range(N+1)):
        k = N - i - j
        if k >= 0 and Y == i * 10000 + j * 5000 + k * 1000:
            print(i,j,k)
            sys.exit()
print("-1 -1 -1")


Measured memory_bytes: 2940
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long N = sc.nextLong();
            long A = sc.nextLong();
            long B = sc.nextLong();
            long r = N / (A + B);
            long count = r * A;
            count += Math.min(N - r * (A + B), A);
            System.out.println(count);
        }
    }
}


Measured memory_bytes: 22996
import bisect
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

SA = [0]
for i in range(N):
    SA.append(SA[-1]+A[i])

C = []
for i in range(N):
    for j in range(i+1, N+1):
        C.append(SA[j]-SA[i])
C.sort()


ans = 0
for i in range(41, -1, -1):
    B = 1 << i
    ind = bisect.bisect_left(C, B)
    if len(C)-ind >= K:
        ans += B
        C = C[ind:]
    for j in range(len(C)):
        C[j] &= B-1
    C.sort()
    # print(i, B, C)
print(ans)


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

int main(){
  int x,y,a,b,c,ans=0;
  cin>>y>>x;
  x/=1000;
REP(i,(int)(x-y)/36+1){
  int s=(int)((-x+y)/4)+i;
  a=4*s+x-y;
  b=-9*s-2*x+2*y;
  c=y-a-b;
  //cout<<a<<" "<<b<<" "<<c<<"\n";
  if(a>=0 && b>=0 && c>=0){
    cout<<a<<" "<<b<<" "<<c<<"\n";
    return 0;
  }

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dofloat cout<<fixed<<setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(),vec.end()
#define rall(vec) vec.rbegin(),vec.rend()
using namespace __gnu_pbds;
using namespace std;
//typedef
typedef long long ll;
typedef long double ld;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vll;
typedef vector<pair<int,int> > vii;
typedef vector<int> vi;
typedef pair<int,int> ii;
//constants
const long long MOD=1000000007;
const long long MAX=100005;
const long double PI=3.14159265359;
const long double G=9.807;
const long long INF=1e18;
const long double EPS=1e-6;
// gcd of a and b
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
// distance between (a,b) and (c,d)
long double dis(long long a,long long b,long long c,long long d){return sqrt( ((a)-(c))*((a)-(c))+((b)-(d))*((b)-(d)) );}
// simple prime check
bool isprime(long long a){
if(a==2)return 1;
if(!(a&1))return 0;
for(ll i=3;i*i<=a;i+=2){
	if(a%i==0)return 0;
}
return 1;
}
// fast expo
long long mpow(long long base,long long exponent,long long modulus){
if(modulus==1)return 0;
long long result = 1;
base=base%modulus;
while(exponent){
		if(exponent%2 == 1)
			result=(result*base)%modulus;
		exponent=exponent>>1;
		base=(base*base)%modulus;
	}
return result;
}
// modular inverse
ll minv(ll a,ll mod){
	ll _gcd=gcd(a,mod);
	assert(_gcd==1);
	return mpow(a,mod-2,mod);
}

/*
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/

/*
ll dx[]={1,0,-1,0,1,1,-1,-1};
ll dy[]={0,-1,0,1,1,-1,-1,1};
*/

/*
void sieve(int N){
	for(int i=0;i<=N;i++){
		spf[i]=i;
	}
	for(int i=2;i*i<=N;i++){
		if(spf[i]==i){
			for(int j=i*i;j<=N;j+=i){
				spf[j]=min(spf[j],i);
			}
		}
	}
	return;
}
*/

/*
void nCr(ll n,ll k){
	ll i,j;
	for(i=0;i<=n;i++){
		for(j=0;j<=min(i,k);j++){

			if(j==0 or j==i)C[i][j]=1LL;
			else  C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;

		}
	}
	return;
}
*/
/*
ll ncr(ll N,ll K){
	if(N<K)return 0;
	if(K==0)return 1;
	if(N==0)return 0;

	ll den=1;
	for(ll i=1;i<=K;i++)den*=i;
	ll num=1;
	while(K--){
		num*=N;
		if(num%den==0){
			num/=den;
			den=1;
		}
		N--;
	}

	return num;
}
*/
ll n;
ll p[25],ans;
int main(){FAST;
cin>>n;
for(ll i=1;i<=n;i++)cin>>p[i];
for(ll i=2;i<=n-1;i++){
	if(p[i]>p[i-1] and p[i+1]>p[i] or p[i]>p[i+1] and p[i]<p[i-1]){
		ans++;
	}
}
cout<<ans;
return 0;
}

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

int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int A,B,C,X,Y;
  cin>>A>>B>>C>>X>>Y;
  int ans=A*X+B*Y;
  for (int k=1; k<=100000; k++) {
    ans=min(ans,2*C*k+max(X-k,0)*A+max(Y-k,0)*B);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int n;
  scanf("%d", &n);
  
  if(n == 1){
    printf("Hello World\n");
  }else{
    int a, b;
    scanf("%d %d", &a, &b);
    printf("%d\n", a + b);
  }
  
  return 0;
}

Measured memory_bytes: 128
#![allow(clippy::needless_range_loop)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use num::integer::Integer;
use proconio::input;
use proconio::marker::*;

fn main() {
    input! {
        a: [String],
    }
    let mut cnt = [[0usize; 20]; 20];
    let tf: Vec<_> = a.iter().map(|x| {
        let mut q = if let Some(p) = x.find('.') {
            let mut a = x[0..p].parse::<usize>().unwrap() * 1000000000;
            let mut r = 100000000;
            for x in x[(p + 1)..].chars() {
                a += (x as u8 - b'0') as usize * r;
                r /= 10;
            }
            a
        } else {
            x.parse::<usize>().unwrap() * 1000000000
        };
        let mut two = 0;
        let mut five = 0;
        while q % 2 == 0 {
            q /= 2;
            two += 1;
        }
        while q % 5 == 0 {
            q /= 5;
            five += 1;
        }
        (std::cmp::min(two, 18), std::cmp::min(five, 18))
    }).collect();
    for &(two, five) in tf.iter() {
        for c in cnt[0..=two].iter_mut() {
            for item in c[0..=five].iter_mut() {
                *item += 1;
            }
        }
    }
    let mut s = 0;
    let mut t = 0;
    for &(two, five) in tf.iter() {
        if two >= 9 && five >= 9 {
            t += 1;
        }

        s += cnt[18 - two][18 - five];
    }
    let ans = (s - t) / 2;
    println!("{}", ans);
}


Measured memory_bytes: 18800
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;


	public class Main {
		
		 

		public static void main(String[] args) {

			Scanner sc = new Scanner(System.in);
			
			int n = sc.nextInt();
			int[] a = new int[n];
			HashMap<Integer,Long> m = new HashMap<Integer,Long>(); 
			
			
			for(int i=0;i<n;i++) {
				a[i] = sc.nextInt();
				m.merge(a[i], 1L, Long::sum);
			}
			
			long ret = 0L;
			
			for(Map.Entry<Integer, Long> e :m.entrySet()) {
	  			int key = e.getKey();
	  			long val = e.getValue();
	  			ret+=val*(val-1)/2;
	  		}
			
			for(int k=0;k<n;k++) {
		  		System.out.println(ret-(m.get(a[k])-1));
			}
			
	    }
				
	}
	


Measured memory_bytes: 70380
#include<stdio.h>
int main(){
	long T,D,L,x[100000]={};
	while(1){
		int count=0;
		scanf("%d %d %d",&T,&D,&L);
		if(T==0&&D==0&&L==0)break;
		for(int i=0;i<T;i++){
			scanf("%d",&x[i]);
		}
		for(int i=0;i<T;i++){
			if(x[i]>=L){
				for(int j=1;j<=D;j++){
					if((i+j)==T)goto end;
					if(x[i+j]<L){
						count++;
					}
					else{
						count++;
						break;
					}
				}
			}
		}
end:		
		printf("%d\n",count);
	}
	return 0;
}

Measured memory_bytes: 3408