akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int num1 = scan.nextInt();

        long dp1[] = new long[num1+1];
        long dp2[] = new long[num1+1];
        long dp3[] = new long[num1+1];

        dp1[0] = dp2[0] = dp3[0] = 0;
                
        for(int i=1; i<num1+1; i++){
            int a = scan.nextInt();
            int b = scan.nextInt();
            int c = scan.nextInt();
            
            dp1[i] = Math.max(a + dp2[i-1], a + dp3[i-1]);
            dp2[i] = Math.max(b + dp1[i-1], b + dp3[i-1]);
            dp3[i] = Math.max(c + dp1[i-1], c + dp2[i-1]);
        }
        

        System.out.println(Math.max(Math.max(dp1[num1],dp2[num1]), dp3[num1]));
    }
}

Measured memory_bytes: 96596
package main

import (
	"bufio"
	"fmt"
	"log"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	log.SetFlags(log.Lshortfile)
	a := nextInt()
	b := nextInt()
	fmt.Println(max(a+b, a-b, a*b))
}

func nextString() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var MAX = math.MaxInt32

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type pair struct {
	a, b int
}

type pairs []pair

func (p pairs) Len() int {
	return len(p)
}
func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


Measured memory_bytes: 640
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()
points = 0
for i in range(K, N):
  if T[i] == T[i-K]:
    T = T[:i] + '#' + T[i+1:]
for i in range(N):
  if T[i] == 'r':
    points += P
  elif T[i] == 's':
    points += R
  elif T[i] == 'p':
    points += S
print(points)

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

int main() {
  int n, y;
  cin >> n >> y;
  y /= 1000;

  int ans[3] = {-1, -1, -1};
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; i+j <= n; ++j) {
      int k = n - (i+j);
      if (10*i + 5*j + k == y) {
        ans[0] = i; ans[1] = j; ans[2] = k;
      }
    }
  }

  printf("%d %d %d\n", ans[0], ans[1], ans[2]);
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
//typedef pair<int,int> pii;
#define int long long

int a[200010];

int n,k;
int cal(int x){
    if(x==0){
        return -1;
    }
    int ans=0;
    for(int i=1;i<=n;++i){
        if((a[i]-1)/x>k){
            return 1e9;
        }
        ans=ans+((a[i]-1)/x);
        if(ans>k){
            return 1e9;
        }
    }
    if(ans<0){
        return 1e9;
    }
    return ans;
}

signed main(){
    scanf("%lld%lld",&n,&k);
    for(int i=1;i<=n;++i){
        scanf("%lld",&a[i]);
    }
    int l=1,r=1e9+10,mid;
    while(l<=r){
        mid=(l+r)/2;
        int f=cal(mid);
        if(f>k)l=mid+1;
        else r=mid-1;
    }
    printf("%lld\n",l);


}


Measured memory_bytes: 5356
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cstdlib>
#define rep(i,n) for(int i = 0;i<(n);i++);
#define all(a) (a).begin(),(a).end()
using namespace std;
using ld = long double;
using ll = long long;
const ll INF = 100100100100100;


int main() {
	ll N;
	cin >> N;
	string S, T;
	cin >> S >> T;
	for (int i = 0; i < N; i++) {
		cout << S[i] << T[i];
	}
	cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cmath>
using namespace std;
#define pb push_back
#define fi first
#define sc second
#define mp make_pair
#define is insert

bool dp[4096][5001];

void solve(int n,int m){
	string e[12],T;
	int ans=0,mn=20;
	for(int i=0;i<n;++i){
		cin>>e[i];
		mn=min(mn,(int)e[i].size());
	}
	for(int j=0;j<m;++j){
		string t;
		cin>>t;
		T+=t;
	}
	bool f[12][5000];
	for(int i=0;i<n;++i){
		for(int j=0;j<=T.size()-mn;++j){
			if(T.substr(j,e[i].size())==e[i]) f[i][j]=true;
			else f[i][j]=false;
		}
	}
	fill(dp[0],dp[0]+T.size()+1,true);
	for(int s=1;s<(1<<n);++s) fill(dp[s],dp[s]+T.size()+1,false);
	for(int s=0;s<(1<<n)-1;++s){
		for(int j=0;j<=T.size()-mn;++j){
			if(dp[s][j]){
				for(int i=0;i<n;++i){
					if(!((s>>i)&1)&&f[i][j]) dp[s+(1<<i)][j+e[i].size()]=true;
				}
			}
		}
	}
	for(int j=1;j<=T.size();++j) ans+=dp[(1<<n)-1][j];
	printf("%d\n",ans);
}

int main(){
	while(true){
		int n,m;
		cin>>n>>m;
		if(n==0) break;
		solve(n,m);
	}
}

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

int main(void){
    int a,b;
    GI(a);GI(b);
    if(a+b==15)
        printf("+\n");
    else if(a*b==15)
        printf("*\n");
    else
        printf("x\n");
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double D = sc.nextInt();
		double X = sc.nextInt();
		int[] A = new int[N];
		int count = 0;
		count += X;
		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		for (int i = 0; i < N; i++) {
			count += Math.ceil(D / A[i]);
		}
		
		System.out.println(count);
	}

}

Measured memory_bytes: 23636
#include<iostream>
#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define rep(i, j) FOR(i, 0, j, 1)
#define rrep(i, j) RFOR(i, j, 0, 1)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define endl "\n"
#define MOD 1000000007
#define DEB(x) cout<<"##"<<x<<"##"<<endl;
void solve()
{
    int n,h[100005],dp[100005],k;
    cin>>n;
    cin>>k;
    rep(i,n)
    cin>>h[i];
    dp[0]=0;
    dp[1]=abs(h[1]-h[0]);
    for(int i=1;i<n;i++)
    {
        dp[i]=INF;
        for(int j=1;j<=k;j++)
        {
            if(i-j<0)
                break;
            dp[i]=min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));
        }
    }
    cout<<dp[n-1];
}
int main() 
{
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    cout.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
    solve();
    return 0;
}

Measured memory_bytes: 4344
#include <iostream>
#include <vector>
#include<climits>

using namespace std;

int n;
vector<int> g[100];
vector<int> w[100];
int d[100];
char color[100];

void dijkstra() {
    d[0] = 0;
    color[0] = 'b';

    for (int k = 1; k < n; ++k) {
        int next;
        int mine = INT_MAX;
        for (int i = 0; i < n; ++i) {
            if (color[i] == 'b') {
                for (int j = 0; j < g[i].size(); ++j) {
                    if (d[i] + w[i].at(j) <= d[g[i].at(j)] && color[g[i].at(j)] == 'w') {
                        d[g[i].at(j)] = d[i] + w[i].at(j);
                        if (d[g[i].at(j)] <= mine) {
                            next = g[i].at(j);
                            mine = d[next];
                        }
                    }
                }
            }
        }
        color[next] = 'b';
        d[next] = mine;
    }
}

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int u;
        int k;
        cin >> u >> k;
        int v, c;
        for (int j = 0; j < k; ++j) {
            cin >> v >> c;
            g[u].push_back(v);
            w[u].push_back(c);
        }
    }
    for (int m = 0; m < n; ++m) {
        color[m] = 'w';
        d[m] = INT_MAX;
    }

    dijkstra();

    for (int l = 0; l < n; ++l) {
        cout << l << " " << d[l] << endl;
    }

    return 0;
}



Measured memory_bytes: 3124
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+100;
int p[N],vis[N],st[N],len[N],tot[N];
int head[N],nxt[N];
bool rt[N];
int f[N],g[N];
inline int dfs(int k) {
	int s=0;
	for (int i=head[k];i;i=nxt[i])
		if (!rt[i]) {
			if (s) puts("0"),exit(0);
			s=dfs(i)+1;
		}
	return s;
}
int main()
{
	const int mod=1e9+7;
	int n,i,k,t,s,cnt=0,top,ans=1,p2=0;
	bool is;
	for (i=1,cin>>n;i<=n;i++) cin>>p[i],nxt[i]=head[p[i]],head[p[i]]=i;
	for (i=1;i<=n;i++)
		if (!vis[i]) {
			++cnt;
			for (k=i;!vis[k];k=p[k])
				vis[k]=cnt;
			if (vis[k]!=cnt) continue;
			for (t=k,top=0;st[1]!=t;t=p[t]) rt[st[++top]=t]=true;
			reverse(st+1,st+1+top);
			is=false;
			for (k=1;k<=top;k++)
				is|=len[k]=dfs(st[k]);
			if (is) {
				for (k=1;k<=top;k++)
					if (len[k]) {
						for (t=k%top+1,s=1;!len[t];t=t%top+1,s++);
						if (s<len[k]) return puts("0"),0;
						if (s!=len[k]) p2++;
					}
			} else tot[top]++,p2+=top>1&&(top&1);
		}
	const int inv4=1LL*(mod+1)*(mod+1)/4%mod;
	for (i=1;i<=n;i++) {
		for (k=f[0]=f[1]=g[0]=g[1]=1;k<=tot[i];k++) {
			f[k+1]=(1LL*f[k-1]*k%mod*inv4%mod*i+f[k])%mod;
			g[k+1]=(1LL*g[k-1]*k%mod*i+g[k])%mod;
		}
		ans=1LL*ans*(i==1||i%2==0?g[tot[i]]:f[tot[i]])%mod;
	}
	while (p2--) (ans<<=1)%=mod;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const ll MOD = (ll) (1e9 + 7);
//const ll MOD = 998244353;
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

void finish() {
    cout << -1 << endl;
    exit(0);
}

//------------------------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << setiosflags(ios::fixed);

    int k, x;
    cin >> k >> x;
    for (int i = max(x - k + 1, -1000000); i <= min(x + k - 1, 1000000); ++i) {
        cout << i << (i == min(x + k - 1, 1000000) ? "\n" : " ");
    }

    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int n;
	long double d, x, y;
	cin >> n >> d;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		if (sqrt(x * x + y * y) <= d) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3808
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

n = int(input())
ans = 0
for a in range(1,n+1):
    for b in range(1,n+1):
        for c in range(1,n+1):
            ans += gcd(a,b,c)
print(ans)


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


#define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++)
#define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++)
#define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--)



#define ll long long
#define fi first
#define se second
#define pb push_back
#define pop pop_back
#define mem(ara) memset((ara),0,sizeof(ara))
#define memn(ara) memset((ara),-1,sizeof(ara))
#define bb begin()
#define ee end()
#define em emplace
#define eb emplace_back





#define si set<int>
#define sd set<double>
#define sll set<long long int>
#define ss set<string>
#define sc set<char>

#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pci pair<char,int>
#define pic pair<int,char>
#define pcl pair<char,long long int>
#define plc pair<long long int,char>

#define pss pair<string,string>
#define pcc pair<char,char>

#define pis pair<int,string>
#define psi pair<string,int>
#define pls pair<long long int,string>
#define psl pair<string,long long int>
#define pdd pair<double,double>
#define pcs pair<char,string>
#define psc pair<string,char>



#define vi  vector<int>
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vii vector<pii>



#define mod 1000000007
#define mx (1<<30)-1
#define llmx (1ll<<62)
#define n_size 100005
#define g_size 10000005
double PI=acos(-1);
#define eps 1e-9



///unsigned int uMAX=4294967295;
///unsigned ll int ullMAX=18446744073709551615;





int arr[g_size];



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

	int n,m,T,res;

	int maxi=-mx,mini=mx,count=0;

	int i,j,k;

	bool flag;

	string s1,s2;

	char s[100000];

	int ara[n_size],ara2[n_size];

	cin>>m;

	cout<<24+(24-m)<<endl;



}


Measured memory_bytes: 256
import sys
from collections import deque

input = sys.stdin.readline
digtmp = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    H, W = map(int, input().split())
    grid = []; cnt = 0
    grid.append(['#'] * (W+2))
    for _ in range(H):
        tmp = list(input())
        cnt += sum([1 for x in tmp if x == '#'])
        grid.append(['#'] + tmp + ['#'])
    grid.append(['#'] * (W+2))

    que = deque([(1, 1)])
    grid[1][1] = 1
    for _ in range(10000):
        a, b = que.popleft()
        for dx, dy in digtmp:
            x, y = (a + dx, b + dy)
            if grid[x][y] == '.':
                grid[x][y] = grid[a][b] + 1
                que.append((x, y))
        if len(que) == 0:
            break
    if grid[H][W] in ['#', '.']:
        print(-1)
        return
    ans = H*W - grid[H][W] - cnt
    print(ans)

if __name__ == "__main__":
    main()


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

using namespace std;

#define ge getchar()
#define Re read()

inline int read() {
	int x = 0, ch;
	while(!isdigit(ch = ge)) ;
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	return x;
}

int main() {
	int n = Re, m = Re, A = Re, B = Re;
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= m; j++)
			putchar(48 + ((i <= B && j <= A) || (i > B && j > A)));
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long a[3*N], sum = 0, answer = LLONG_MIN;
  map<int,long long> b, c;
  multiset<int> d;
  for (int i = 0; i < 3*N; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < N; i++) {
    sum += a[i];
    d.insert(a[i]);
  }
  b[N-1] = sum;
  for (int i = N; i < 2*N; i++) {
    if (a[i] > *d.begin()) {
      sum -= *d.begin();
      sum += a[i];
      d.erase(d.find(*d.begin()));
      d.insert(a[i]);
    }
    b[i] = sum;
  }
  d.clear();
  sum = 0;
  for (int i = 2*N; i < 3*N; i++) {
    sum += a[i];
    d.insert(a[i]);
  }
  c[2*N] = sum;
  for (int i = 2*N-1; i >= N; i--) {
    if (a[i] < *d.rbegin()) {
      sum -= *d.rbegin();
      sum += a[i];
      d.erase(d.find(*d.rbegin()));
      d.insert(a[i]);
    }
    c[i] = sum;
  }
  for (int i = N-1; i < 2*N; i++) {
    answer = max(answer,b[i]-c[i+1]);
  }
  cout << answer;
}

Measured memory_bytes: 23076
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N = sc.nextLong()

    // 約数列挙するのに O(√N) で間に合う
    // 列挙した約数の個数 M <= √N なので
    // 約数ごとに F(A, B) を 調べ その最小値を求める
    // O(M + √N) = O(√N). 間に合う

    def solve(N: Long): Int = {
      val upper = Math.sqrt(N)

      def F(a: Long, b: Long): Int =
        a.toString.length max b.toString.length

      def loop(a: Long, min: Int): Int =
        if (a <= upper) {
          if (N % a == 0) loop(a + 1, min min F(a, N / a))
          else loop(a + 1, min)
        } else min

      loop(1, 10)
    }

    println(solve(N))
  }

}

Measured memory_bytes: 25644
#include<stdio.h>
#include<stdlib.h>
#include<strings.h>
int toptw=0,stacktw[1000];

void push(int x){
    stacktw[++toptw]=x;
}

int pop(){
    toptw--;
    return stacktw[toptw+1];
}

int main(){
  int a,b;
  char s[100];

  while(scanf("%s", s) != EOF){
        if ( s[0] == '+' ){
            a=pop();
            b=pop();
            push(a+b);
        }
        else if ( s[0] == '-' ){
            a=pop();
            b=pop();
            push(b-a);
        }
        else if ( s[0] == '*' ){
            a=pop();
            b=pop();
            push(a*b);
        }
        else {
            push(atoi(s));
        }
    }

  printf("%d\n",pop());  
  return 0;
}




Measured memory_bytes: 2048
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;

int main() {

	int N;
	cin >>N;
	std::vector<int> a(N);
	for (int i = 0; i < N; i++)
		cin >> a[i];

	int judge = 1;
	for (int i = 0; i < N; i++)
	{
		if (a[i] == judge)
		{
			judge++;

		}

	}

	if (judge == 1)
		cout << -1 << endl;
	else
		cout << N-judge+1 << endl;

	return 0;
}

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

int main() {
  int n; cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  int ans = 0;
  int t = 0;
  for (int i = n - 1; i >= 1; i --) {
    if (a[i] <= a[i - 1]) {
      t ++;
    } else if (a[i] > a[i - 1]) {
      ans = max(ans, t);
      t = 0;
    }
  }
  ans = max(ans, t);

  cout << ans << endl;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
#define cs ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;

using namespace std;

int main(){
    cs
    ll t,n=10,a=0;
    cin>>t;
    if(t&1) {cout<<0;return 0;}
    while(n<=t){
        a+=t/n;
        n*=5;
    }
    cout<<a;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define max		  1000000
#define pb		  push_back
#define pairs	  pair<int, int>
#define vi		  vector<int>
#define vb		  vector<bool>
#define vii		  vector<pairs>
#define lb		  lower_bound
#define ub		  upper_bound
#define lli		  long long int
#define endl	  '\n'
#define FastInput ios_base::sync_with_stdio(false), cin.tie(NULL);
#define Cases	  cout << "Case " << ++Case << ": ";
#define __test    \
	int tt;       \
	int Case = 0; \
	cin >> tt;    \
	while (tt--)
#define read(x)	 freopen(x, "r", stdin)
#define write(x) freopen(x, "w", stdout)
#define InputArray(a, n)        \
	for (int i = 0; i < n; i++) \
		cin >> a[i];
#define CopyArray(a, temp, n)   \
	for (int i = 0; i < n; i++) \
		temp[i] = a[i];
#define PrintArray(a, n)        \
	for (int i = 0; i < n; i++) \
		cout << a[i] << " ";    \
	cout << endl;
using namespace std;

vi graph[1000000];
int visited[1000000];

void bfs(int v) {
	queue<int> q;
	visited[v] = 1;
	q.push(v);

	while(!q.empty()) {
		int top = q.front();
		q.pop();

		for(int child : graph[top]) {
			if(!visited[child]) {
				q.push(child);
				visited[child] = top;
			}
		}
	}
}

void solve() {
	int n, m;
	cin >> n >> m;
	
	memset(visited, 0, sizeof(visited));

	for (int i = 1; i <= m; i++) {
		int a, b;
		cin >> a >> b;
		graph[a].pb(b);
		graph[b].pb(a);
	}

	bfs(1);

	cout << "Yes\n";
	for (int i = 2; i <= n; i++) {
		cout << visited[i] << endl;
	}
}

int main() {
#ifdef Niloy
	read("input.txt");
	write("output.txt");
#endif
	FastInput;
	solve();

	cerr << "time = " << (clock() / CLOCKS_PER_SEC) << " sec" << '\n';
	return 0;
}

Measured memory_bytes: 35068
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;
#define P 1000000007
#define rep(i,n) for(i=0;i<n;++i)
#define repp(i,a,n) for(i=a;i<n;++i)
#define repr(i,a,n) for(i=a;i>=n;--i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second

ll binpowmod(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return binpowmod(n, p-2, p);
}

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t,m,n,i,f=0,j,ans=0;
    cin >> n ;
    vector<ll> a(n);
    m=1e5+1;
    ll cnt[m]={};
    ll sum=0;
    rep(i,n)
    {
        cin >> a[i];
        cnt[a[i]]++;
        sum+=a[i];
    }
    ll q;
    cin >> q ;
    ll b,c;
    while(q--)
    {
        cin >> b >> c ;
        sum-=b*(cnt[b]);
        sum+=c*(cnt[b]);
        
        cnt[c]+=cnt[b];
        cnt[b]=0;
        cout << sum << endl ;
    }
    
    return 0;
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;

int main()
{
    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    vector<int> p(a), q(b), r(c);
    rep(i, a) cin >> p.at(i);
    rep(i, b) cin >> q.at(i);
    rep(i, c) cin >> r.at(i);

    sort(p.rbegin(), p.rend());
    sort(q.rbegin(), q.rend());

    vector<int> d;
    rep(i, x) d.push_back(p[i]);
    rep(i, y) d.push_back(q[i]);
    rep(i, c) d.push_back(r[i]);
    sort(d.rbegin(), d.rend());

    ll ans = 0;
    rep(i, x + y) ans += d[i];
    cout << ans << endl;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 5;
int n,k,ans;
int z[N],cnt[N];
int maxx[N],minn[N];
void build(int l, int r, int rt)
{
    if (l == r)
    {
        maxx[rt] = minn[rt] = z[l];
        return;
    }
    int mid = (l + r) >> 1;
    build(l, mid, rt << 1);
    build(mid + 1, r, (rt << 1) + 1);
    maxx[rt] = max(maxx[rt << 1], maxx[(rt << 1) + 1]);
    minn[rt] = min(minn[rt << 1], minn[(rt << 1) + 1]);
}
int querymax(int l, int r, int rt, int l1, int r1)
{
    if (l1 <= l && r <= r1)
        return maxx[rt];
    int mid = (l + r) >> 1;
    int ret = 0;
    if (l1 <= mid)
        ret = max(ret, querymax(l, mid, rt << 1, l1, r1));
    if (r1 > mid)
        ret = max(ret, querymax(mid + 1, r, (rt << 1) + 1, l1, r1));
    return ret;
}
int querymin(int l, int r, int rt, int l1, int r1)
{
    if (l1 <= l && r <= r1)
        return minn[rt];
    int mid = (l + r) >> 1;
    int ret = 0x3f3f3f3f;
    if (l1 <= mid)
        ret = min(ret, querymin(l, mid, rt << 1, l1, r1));
    if (r1 > mid)
        ret = min(ret, querymin(mid + 1, r, (rt << 1) + 1, l1, r1));
    return ret;
}
int main()
{
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; ++i)
        scanf("%d", z + i);
    for (int i = k; i <= n; ++i)
        cnt[i] = 1;
    build(1, n, 1);
    int f = 0;
    for (int i = 2; i <= n; ++i)
    {
        if (z[i] > z[i - 1])
        {
            int l = 2;
            if (l >= k)
                --cnt[i],f = 1;
            ++i;
            while (z[i] > z[i - 1])
            {
                ++l;
                if (l >= k)
                    --cnt[i], f = 1;
                ++i;
            }
        }
    }
    for (int i = k + 1; i <= n; ++i)
    {
        if (!cnt[i])
            continue;
        int p1 = querymax(1, n, 1, i - k + 1, i);
        if (p1 != z[i])
            continue;
        int p2 = querymin(1, n, 1, i - k, i - 1);
        if (p2 != z[i - k])
            continue;
        cnt[i] = 0;
    }
    for (int i = k; i <= n; ++i)
        if (cnt[i])
            ++ans;
    printf("%d\n", ans + f);
    return 0;
}

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



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

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

typedef long long ll;

using namespace std;


template <class Monoid>
class SegmentTree
{
public:
  using Func = function<Monoid(Monoid, Monoid)>;
  const Func F;
  const Monoid M1;
  int sz;
  vector<Monoid> seg;

  SegmentTree(int n,const Func fu, const Monoid &m1): F(fu) , M1(m1) {init(n);}
  void init(int n)
  {
      sz= 1;
      while (sz < n) sz *= 2;
      seg.assign(sz * 2, M1);
  }
  void update(int k,const Monoid &x)
  {
    k+=sz;
    seg[k]=x;
    while(k>>=1)
    {
      seg[k]=F(seg[k*2],seg[k*2+1]);
    }
  }
  void add(int k,const Monoid &x){
    update(k,x+seg[k+sz]);
  }
  Monoid query(int l,int r)
  {
    Monoid L=M1,R=M1;
    l+=sz;r+=sz;
    for(;l<r;l>>=1,r>>=1)
    {
      if(l&1)L=F(L,seg[l++]);
      if(r&1)R=F(seg[--r],R);
    }
    return F(L,R);
  }
};
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll q;cin>>q;
  vector<ll>query,ua,ub;
  vector<ll>x;
  rep(i,q){
    ll f;cin>>f;
    if(f==1){
      ll a,b;
      cin>>a>>b;
      ua.push_back(a);
      ub.push_back(b);
      x.push_back(a);
    }
    else query.push_back(ua.size());
  }
  sort(all(x));
  x.erase(unique(all(x)),x.end());
  map<ll,ll>ma,mai;
  ll id=0;
  for(auto tx:x){
    ma[tx]=id++;
  }
  SegmentTree<ll> st(2e5,[](ll a,ll b){return a+b;},0);
  auto st2=st;
  ll pre=0;
  set<ll>xx;
  ll sb=0;
  for(auto tq:query){
    repi(i,pre,tq){
      st.add(ma[ua[i]],ua[i]);
      st2.add(ma[ua[i]],1);
      sb+=ub[i];
    }
    pre=tq;
    ll ng=-1,ok=2e5;
    auto check=[&](ll num){
      return st2.query(0,num+1)>=(tq+1)/2;
    };
    while(ok-ng>1){
      ll nn=(ok+ng)/2;
      if(check(nn))ok=nn;
      else ng=nn;
    }
    ll cen=x[ok];
    cout<<cen<<" ";
    ll res=0;
    res+=-st.query(0,ma[cen])+st.query(ma[cen],2e5);
    res+=cen*st2.query(0,ma[cen])-cen*st2.query(ma[cen],2e5);
    cout<<res+sb<<"\n";
  }
  cout<<flush;


  return 0;

}


Measured memory_bytes: 20220
#include <iostream>
using namespace std;
int main(){
string A[3]={"Sunny","Cloudy","Rainy"};
string S;
cin>>S;
for (int i=0;i<3;i++){
	if(S==A[3-1]){
		cout<<A[i];
        break;	
	}
	else if(S==A[i]){
		cout<<A[i+1];
	}
		
		
	
	
}
}

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

namespace ABC107A
{
    class ABC107A
    {
        static void Main(string[] args)
        {
            var dg = Console.ReadLine().Split(' ').Select(v => int.Parse(v)).ToArray();
            var n = dg[0];
            var i = dg[1];

            Console.WriteLine(n - i + 1);
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;cin>>n;
    vector<int> a(n),b(n),c(n),dpa(n),dpb(n),dpc(n);
    rep(i,n)cin>>a[i]>>b[i]>>c[i];
    dpa[0]=a[0],dpb[0]=b[0],dpc[0]=c[0];
    rep2(i,1,n){
        dpa[i]=a[i]+max(dpb[i-1],dpc[i-1]);
        dpb[i]=b[i]+max(dpa[i-1],dpc[i-1]);
        dpc[i]=c[i]+max(dpa[i-1],dpb[i-1]);
    }
    cout<<max(max(dpa[n-1],dpb[n-1]),dpc[n-1]);

    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
#define pb push_back
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define MOD 998244353
typedef double ld;
#define PI 3.14159265


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

    int a , b , c;
    cin >> a >> b >> c;
    if((a + b) >= c) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
import bisect

n = int(input())
S = list(map(int,input().split(" ")))
q = int(input())
T = list(map(int, input().split(" ")))

count = 0
for t in T:
    l = bisect.bisect_left(S, t)
    if l < n and S[l] == t:
        count += 1
print(count)


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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

int32 N;
vector<int64> A;
vector<vector<int32>> cnt;

int main(void){
	cin >> N;
	A.resize(N);
	cnt.resize(N+1, vector<int32>(21, 0));
	REP(i, N) cin >> A[i];
	REP(i, N){
		REP(j, 20){
			cnt[i+1][j] = cnt[i][j]+(A[i] >> j & 1);
		}
	}
	int32 r = 0;
	int64 res = 0;
	REP(l, N){
		while(r < N){
			bool ok = 1;
			REP(i, 20) if(cnt[r+1][i]-cnt[l][i] > 1) ok = 0;
			if(!ok) break;
			r++;
		}
		res += r-l;
	}
	cout << res << endl;
}

Measured memory_bytes: 42936
#include <bits/stdc++.h>
using namespace std;
using ll = long long; 
using vpii = vector<pair<int, int>>;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define rep1(i, n) for (int i = 1; i < (int)n; i++)
ll mod = 1e9+7;
ll inf = 1e10;

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

ll lcm(ll a, ll b){
  return (a/gcd(a,b))*b;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<int> d(k);
  rep(i, k) cin >> d[i];
  auto keta = [](int n){
    int cnt = 0;
    while(n >= 1){n /= 10; ++cnt;}
    return cnt;
  };
  auto f = [&](int n){
    int nketa = keta(n);
    for(int i = nketa-1; i >= 0; --i){
      int a = n / static_cast<int>(pow(10, i));
      rep(j, k) if(a == d[j]) return false;
      n %= static_cast<int>(pow(10, i));
    }
    return true;
  };
  for(int i = n; ; ++i){
    if(f(i)){ cout << i << "\n"; return 0; }
  } 
 
  return 0;
}  

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll read(){
	ll a=0,b=getchar(),c=1;
	while(!isdigit(b))c=b=='-'?-1:1,b=getchar();
	while(isdigit(b))a=a*10+b-'0',b=getchar();
	return a*c;
}
ll n,ans,a[200005];
int main(){
	n=read();
	for(int i=0;i<n;i++)
		a[i]=read(),ans^=a[i];
	for(int i=0;i<n;i++)
		printf("%lld ",ans^a[i]);
	return 0;
}

Measured memory_bytes: 5252
while True:
  a,op,b=map(str,raw_input().split())
  a=int(a)
  b=int(b)
  
  if op=='+':
    print a+b
  elif op=='?':
    break
  elif op=='-':
    print a-b
  elif op=='/':
    print a/b
  elif op=='*':
    print a*b
    

Measured memory_bytes: 6436
#include<bits/stdc++.h>
using namespace std;
void roll(char x,int a[7]){
    int b[7];
    for(int i=1;i<7;i++){
        b[i]=a[i];
    }
    if(x=='N'){
        a[1]=b[2];
        a[2]=b[6];
        a[6]=b[5];
        a[5]=b[1];
    }
    else if(x=='W'){
        a[1]=b[3];
        a[3]=b[6];
        a[6]=b[4];
        a[4]=b[1];
    }
    else if(x=='S'){
        a[1]=b[5];
        a[5]=b[6];
        a[6]=b[2];
        a[2]=b[1];
    }
    else if(x=='E'){
        a[1]=b[4];
        a[4]=b[6];
        a[6]=b[3];
        a[3]=b[1];
    }
}
int check(int a[7],int c[7]){
    int cnt=0;
    for(int i=0;i<4;i++){
        if(a[1]==c[1]) break;
        roll('N',a);
    }
    for(int i=0;i<4;i++){
        if(a[1]==c[1]) break;
        roll('W',a);
    }
    if(a[1]!=c[1]) cnt++;
    for(int i=0;i<4;i++){
        if(a[1]==c[1]&&a[2]==c[2]) break;
        roll('N',a);
        roll('W',a);
        roll('S',a);
    }
    if(a[2]!=c[2]) cnt++;
    for(int i=1;i<7;i++){
        if(a[i]!=c[i]) cnt++;
    }
    return cnt;
}

int main(){
    int a[7];
    for(int i=1;i<7;i++){
        cin>>a[i];
    }
    int c[7];
    for(int i=1;i<7;i++){
        cin>>c[i];
    }
    int mcnt=0;
    for(int i=0;i<4;i++){
        if(check(a,c)==0) mcnt++;
        roll('N',a);
    }
    for(int i=0;i<4;i++){
        if(check(a,c)==0) mcnt++;
        roll('E',a);
    }
    if(mcnt==0) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}
    
    


Measured memory_bytes: 3120
import math

a, b, h, m = map(int, input().split())
ang_a = (360 * h / 12) + (0.5 * m)
ang_b = 360 * m / 60
ang = abs(ang_a - ang_b)

ans = math.sqrt((a ** 2 + b ** 2) - (2*a*b*math.cos(math.radians(ang))))
print(ans)


Measured memory_bytes: 9420
#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;
const static ll INF = 1e15;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
// __uint128_t
const ll MOD = 998244353;


int main(){
    ll K; cin >> K;
    string S = "ACL";
    string ANS = "";
    for(int i = 0; i < K; i++) ANS += S;
    cout << ANS << endl;
}


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

int main(){
	int n;
	cin >> n;
	int a[1010];
	for(int i=0; i<n; i++) cin >> a[i];
	
	double sum=0;
	for(int i=0; i<n; i++){
		sum += (double)1/a[i];
	}
	cout.precision(10);
	cout << (double)1/sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
#define rep(i, n) for (int i = 0; i < n; i++)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
    int n, m;
    cin >> n >> m;
    int a[m], b[m];
    Graph g (n);
    rep (i, m) {
        cin >> a[i] >> b[i];
        g[--a[i]].push_back (--b[i]);
        g[b[i]].push_back (a[i]);
    }

    queue<int> q;
    q.push (0);
    vector<int> dist (n, -1);
    dist[0] = 0;
    while (!q.empty()) {
        int now = q.front();
        q.pop();
        for (int next : g[now]) {
            if (dist[next] != -1) continue;
            dist[next] = now;
            q.push (next);
        }
    }
    rep (i, n) {
        if (i == 0) continue;
        if (dist[i] == -1) {
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
    rep (i, n) {
        if (i == 0) continue;
        cout << dist[i] + 1 << "\n";
    }
}

Measured memory_bytes: 11768
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}

char c[1000010];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	int K;
	scanf("%d ", &K);

	fread(c, 1, 1000010, stdin);
	int L = 0, R = 1000000;
	while (L + 1 < R) {
		int M = (L + R) / 2;
		if (c[M] >= 'a') L = M;
		else R = M;
	}
	int M = R;

	int inv[1000010];
	inv[0] = 1;
	inv[1] = 1;
	rep1(i, K - 1) inv[i + 1] = ll(inv[i]) * i % mod;
	ll tmp = modpow(ll(inv[K]) * K % mod, mod - 2);
	for (int i = K; i > 0; i--) {
		inv[i] = inv[i] * tmp % mod;
		tmp = tmp * i % mod;
	}

	const ll are = 423076927;
	tmp = modpow(26, K);
	ll kotae = 0;
	rep(i, K + 1) {
		tmp = tmp * inv[i] % mod;
		kotae += tmp;
		tmp = tmp * (M + i) % mod;
		tmp = tmp * are % mod;
	}

	printf("%lld\n", kotae % mod);

	Would you please return 0;
}

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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;

//status unsolved
long long prime_factorize(long long n) {
    if(n<=1)return 1;

    long long ret=1;
    //vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        ret*=(num+1);
        //res.push_back(make_pair(p, num));
    }
    if (n != 1)ret*=2;
    //res.push_back(make_pair(n, 1));
    return ret;
}
int main(){
    long long n;
    cin>>n;
    long long ans=0;
    for(int i=1;i<n;i++){
    long long tmp=n-i;
    long long now=prime_factorize(tmp);
    ans+=now;
    //cout<<ans<<endl;
    }
    cout<<ans<<endl;

    return 0;

}
/*


*/


Measured memory_bytes: 3636
from math import *


def read(): return list(map(int, input().split()))


n, m = read()
per = []
for i in range(n):
    per.append(read())

point = []
for i in range(m):
    point.append(read())

for p in per:
    mi = 1145141919
    ans = 0
    for i in range(m - 1, -1, -1):
        d = abs(p[0] - point[i][0]) + abs(p[1] - point[i][1])
        if d <= mi:
            mi = d
            ans = i
    print(ans + 1)


Measured memory_bytes: 3064
using System;
using System.Text;
using System.Linq;
class p
{
  static void Main()
  {
    string[] input = Console.ReadLine().Split(' ');
    int A = int.Parse(input[0]);
    int B = int.Parse(input[1]);
    int C = int.Parse(input[2]);
    int K = int.Parse(Console.ReadLine());
    
    int[] arr = new int[] { A, B, C };
    for (int i = 0; i < K; i++) {
      int index = Array.IndexOf(arr, arr.Max());
      arr[index] *= 2;
    }
    Console.WriteLine(arr.Sum());
  }
}


Measured memory_bytes: 11220
n,a,b=map(int,input().split())

if n>=(a+b):

    k=int(n/(a+b))

    l=int(n%(a+b))

    if l>=a:

        print(a*k+a)

    else:
        print(a*k+l)

else:

    if n>=a:

        print(a)

    else:
        print(n)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n;i>=0;i--)
#define Pool(i, m, n) for(ll i=n;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
#define gcd(x,y) __gcd(x,y)
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
ll lcm(ll x,ll y){
  ll z=gcd(x,y);
  return x*y/z;
}
int main() {
cout << fixed << setprecision(30);
  ll n;
  cin>>n;
  ll amari=n%11;
  ll syou=n/11;
  if(amari==0)putout(syou*2);
  if(amari>0&&amari<=6)putout(syou*2+1);
  if(amari>6)putout(syou*2+2);
}


Measured memory_bytes: 256
function main(input) {
    const numberArray = input.split('');
 	let result = 0;
  	numberArray.forEach(one => {
      result += Number(one)
    })
  	if(result % 9 ==0) console.log('Yes');
  	else console.log('No');
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 34352
/*
    -ensure correct output format
    -ensure printing required output
    -reread the problem statement
  */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pll;
typedef pair<ll,pair<ll,ll>>plll;
#define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
#define vll(v) v.begin(),v.end()
#define all(x) x.rbegin(),x.rend()
#define min3(a, b, c)   min(a, min(b, c))
#define max3(a, b, c)   max(a, max(b, c))
#define F first
#define S second
#define in  freopen("input.txt", "r", stdin)
#define out  freopen("output.txt", "w", stdout)
#define minheap int,vector<int>,greater<int>
#define pb push_back
#define eb emplace_back
#define ischar(x)  (('a' <= x && x <= 'z') || ('A' <= x && x <= 'Z'))
#define isvowel(ch) ((ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u')||(ch=='A'|| ch=='E' || ch=='I'|| ch=='O'|| ch=='U'))
#define bug cout<<"BUG"<<endl;
const int Max = 2e6 + 10;
const int Mod = 1e9 + 7;
const double PI  =3.141592653589793238463;
bool compare(const pair<ll,ll> &a, const pair<ll,ll> &b)
{
       return (a.first > b.first);
}
ll lcm(ll a,ll b)
{
    if(a==0 || b==0)return 0;

    return a/__gcd(a,b)*b;
}

void input(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)cin>>ara[i];
}
void print(ll ara[],ll n)
{
    for(ll i=0; i<n; i++)
        cout<<ara[i]<<" ";
    cout<<endl;
}

vector<ll>v[Max+10];

int main()
{

   fastread();

   ll i,j,n,m,p,a,sum=0,k,t,b,c,d,cnt=0,q,l,r,ans=0;

      bool flag=false;

      string str;

    cin>>n>>d;



    for(i=0; i<n; i++)
    {
       for(j=0; j<d; j++)
       {
           cin>>a;

           v[i].eb(a);
       }
    }

    for(i=0; i<n; i++)
    {
        for(j=i+1; j<n; j++)
        {
            sum=0;


            for(k=0; k<d; k++)
            {

            a=abs(v[i][k]-v[j][k]);

            sum+=(a*a);
            }


            a=sum;


            double aa=sqrt(a),bb;

            a=aa;

            bb=a;

            if(aa==bb)ans++;


        }
    }

    cout<<ans<<endl;













}



Measured memory_bytes: 50524
import java.io.*;

public class Main {

	public static void main(String[] args)throws IOException{
		
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		
		String str = br.readLine();
		
		char[] strc = str.toCharArray();
		for(int i = 0; i < str.length()/2; i++){
			char m = strc[i];
			strc[i] = strc[str.length()-i-1];
			strc[str.length()-i-1] = m;
		}
		for(int i = 0; i < str.length(); i++){
			System.out.print(strc[i]);
		}
		System.out.println();
	}

}

Measured memory_bytes: 9356
//****** @mdazmat9 **********
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define UB upper_bound
#define LB lower_bound
#define BS binary_search
#define EB emplace_back
#define PB push_back
#define endl "\n"
#define MOD 1000000007
#define F first
#define S second
#define ALL(a) (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
int fast_pow(int x, int y, int p);


void solve() {
    int n;
    cin>>n;
    int ans=n/2;
    if(n%2)ans++;
    cout<<ans;
}

int32_t main() {
    IOS;
    int test = 1;
    //cin >> test;
    while (test--) {
        solve();
    }
    return 0;
}
int fast_pow(int x, int y, int p) {
    int res = 1;
    x = x % p;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#define vll vector<ll>
#define vvv vector<vvl>
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvvl(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
//typedef __int128_t lll;
using namespace std;

int main(int argc, char const *argv[]) {
  ll h, w, K;std::cin >> h >> w >> K;
  vector<string> s(h);re(i, h) std::cin >> s[i];

  ll ans = 10000000000;
  for(int i=0;i<(1<<(h-1));i++){

    ll num = 0;
    vll block(h, 0);
    vll white(h, 0);
    vll current_white(h, 0);

    for(int j=0;j<(h-1);j++){
      if(i&(1<<j)){
        num ++;
        block[j+1] = block[j] + 1;
      }else{
        block[j+1] = block[j];
      }
    }

    for(int j=0;j<w;j++){
      for(int k=0;k<h;k++) current_white[k] = 0;
      for(int k=0;k<h;k++) {
        if(s[k][j]=='1') current_white[block[k]]++;
        if(current_white[block[k]]>K) num = 9999999999;
      }
      for(int k=0;k<h;k++){
        if(current_white[k] + white[k] > K){
          num++;
          for(int l=0;l<h;l++) white[l] = 0;
          break;
        }
      }
      for(int k=0;k<h;k++) white[k] += current_white[k];
    }
    //bitset<10> b(i);
    //std::cout << b << " " << num << '\n';
    ans = min(ans, num);
  }
  std::cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 888