akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
typedef long long ll;
#define pb push
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
int main()
{
	int a[10];
	for(int i=0;i<10;i++) cin >> a[i];
	int sum = 0;
	for(int i=0;i<10;i++) sum += a[i];
	cout << sum << endl;
}

Measured memory_bytes: 1164
#include <stdio.h>
#include <stdlib.h>

void quicksort(long long data[],int left,int right);

int main()
{
	int n,m,i,j;
	long long x,y,z,ans=0;
	long long a[8][1000]={0};
	//long b[8]={0};
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++)
	{
		scanf("%lld %lld %lld",&x,&y,&z);
		a[0][i]=x+y+z;
		a[1][i]=x+y-z;
		a[2][i]=x-y+z;
		a[3][i]=x-y-z;
		a[4][i]=-x+y+z;
		a[5][i]=-x+y-z;
		a[6][i]=-x-y+z;
		a[7][i]=-x-y-z;
	}
	for(i=0;i<8;i++)
	{
		quicksort(a[i],0,n-1);
		long long kari=0;
		for(j=0;j<m;j++)kari+=a[i][j];
		if(kari>ans)ans=kari;
	}
	printf("%lld",ans);
}

void quicksort(long long data[],int left,int right)
{
	int i,j;
	long long std,work;
	if(left<right)
	{
		i=left,j=right;
		std=data[(i+j)/2];//基準
		do
		{
			while(data[i] > std)i++;
			while(data[j] < std)j--;
			if(i<=j)
			{
				if(i<j)
				{
					work=data[i];
					data[i]=data[j];
					data[j]=work;
				}
				i++; j--;
			}
		}while(i<=j);
		if(left<j)quicksort(data,left,j);
		if(i<right)quicksort(data,i,right);
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define ss second
#define ff first
#define Mem(x,val) memset(x,val,sizeof x)
#define pb push_back
#define all(v) v.begin(),v.end()
#define unik(v)  v.erase(unique(v.begin(),v.end()),v.end())
#define cerr(x) cerr << __LINE__ << " th Line : " << #x << " = " << x << "\n"
#define endl '\n'
#define SZ(a) ((int)a.size())
using namespace std;
typedef pair<int, int> pi32;
typedef pair<ll, ll> pi64;
typedef vector<int> vi32;
typedef vector<ll> vi64;
typedef vector<pi32> vp32;
typedef vector<pi64> vp64;
const ll mod = 1e9 + 7;
const ll MX = 100, inf = 1e9 + 7;
int vis[105];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int n, k; cin >> n >> k;
	for (int i = 0; i < k; i++) {
		int d;
		cin >> d;
		for (int j = 0; j < d; j++) {
			int x; cin >> x; vis[x] = 1;
		}
	}
	int cnt = 0;
	for (int i = 1; i <= n; i++)if (!vis[i])cnt++;
	cout << cnt << endl;


	return 0;
}

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

int main(){
	int n,p;
	while(cin>>n>>p,n,p){
		int is[60]={};
		int ap=p;
		int turn=0;
		int win;
		
		while(1){
			if(p!=0){
				is[turn%n]++;
				p--;
				}
			else{
				p=is[turn%n];
				is[turn%n]=0;
				}	
				
				int flg=0;
				for(int i=0;i<n;i++){
					if(is[i]==ap){
						flg=1;
						win=i;
						}
					}
					
					if(flg==1)break;
					turn++;
			}
			cout<<win<<endl;
		}
	return 0;
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
typedef long long ll;
const int INT_INF = 1e9;
const ll INF = 1LL << 30;
const ll MOD = 1e9 + 7;

bool is_prime(int N) {
    if (N == 1) return false;
    for (int i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}

int main() {
    int q; cin >> q;
    V<P<int, int> > p(q);
    for(int i = 0; i < q; i++){
        int l, r; cin >> l >> r;
        p[i] = make_pair(l, r);
    }

    V<int> memo(100010, 0);
    memo[0] = 0;
    memo[1] = 1;
    for(int i = 3; i < 100000; i+=2){
        if(is_prime(i) && is_prime((i + 1) / 2)){
            memo[i] = memo[i - 2] + 1;
        }else{
            memo[i] = memo[i - 2];
        }
    }

    for(int i = 0; i < q; i++){
        if(1 < p[i].first && 1 < p[i].second){
            cout << memo[p[i].second] - memo[p[i].first - 2] << endl;
        }else{
            cout << memo[p[i].second] - 1 << endl;
        }
    }

}


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

int main() {
  string N; cin >> N;
  if(N[0] == N[1] && N[1] == N[2]) cout << "Yes" << endl;
  else if(N[2] == N[3] && N[1] == N[2]) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3556
use std::io::*;
use std::str::FromStr;
use std::collections::HashMap;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let k: usize = read();
    let mut seq = vec![0; n];
    let mut cnts = HashMap::<usize, usize>::new();
    for i in 0..n {
        seq[i] = read();
        let mut counter = cnts.entry(seq[i]).or_insert(0);
        *counter += 1;
    }
    let mut cnts = cnts.values().cloned().collect::<Vec<usize>>();
    cnts.sort();
    cnts.reverse();
    let ans: usize = cnts.iter().skip(k).sum();
    println!("{}", ans);
}

Measured memory_bytes: 15256
import sys
sys.setrecursionlimit(10000000)
from collections import defaultdict

N, M = map(int, input().split())
h = list(map(int, input().split()))
flg = [1]*N
for i in range(M):
    a, b = map(lambda x : int(x)-1, input().split())
    if h[a] <= h[b]:
        flg[a] = 0
    if h[b] <= h[a]:
        flg[b] = 0
print(sum(flg))

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


struct tree{
	tree* left;
	tree* right;
	tree* parent;
	int val;
};

void printInorder(tree* root){
	if(root== NULL)return;
	cout << " " << root->val;
	printInorder(root->left);
	printInorder(root->right);
	return;
}
void printPreorder(tree* root){
	if(root== NULL)return;
	printPreorder(root->left);
	cout << " " << root->val;
	printPreorder(root->right);
	return;
}

void insert(int val, tree* root){
	tree* next;
	bool flag = val < root->val;
	if(flag)next = root->left;
	else next = root->right;

	if(next == NULL){
		tree* newNode = (tree*)malloc(sizeof(tree));
		newNode->val = val;
		newNode->left = NULL;
		newNode->right = NULL;
		newNode->parent = root;
		if(flag)root->left = newNode;
		else root->right = newNode;
	}else{
		insert(val,next);
	}
}

int main(){
	ios_base::sync_with_stdio(false);

	tree* root = (tree*)malloc(sizeof(tree));

	char order[10];
	int val;
	int numOfOrder;

	cin >> numOfOrder;
	cin >> order;
	cin >> val;

	root->val = val;
	root->left = NULL;
	root->right = NULL;
	root->parent = NULL;
	

	for(int i = 0; i <  numOfOrder - 1; i++){
		cin >> order;
		if(order[0] == 'i'){
			cin >> val;
			insert(val, root);
		}else{
			printPreorder(root);
			cout << endl;
			printInorder(root);
			cout << endl;
		}
	}


	return 0;

}

Measured memory_bytes: 24644
#include<stdio.h>

int main()
{

    long long int a,b;
    char c;

    scanf("%lld %c %lld",&a,&c,&b);

    if(c=='+')
    {
        printf("%lld\n",a+b);
    }
    else
    {
        printf("%lld\n",a-b);

    }
    return 0;
}


Measured memory_bytes: 128
#include<cstdio>
#include<cmath>
typedef long long ll;
ll a,b,sum,ans=1;
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
int main()
{
	scanf("%lld%lld",&a,&b);
	sum=gcd(a,b);
	for(int i=2;i<=sqrt(sum);i++)
		if(sum%i==0)
		{
			ans++;
			while(sum%i==0)sum/=i;
		}
	if(sum>1)ans++;
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 128
#!/usr/bin/env python3
import sys, itertools, math


def solve(N: int, x: "List[int]", y: "List[int]"):
    f = 1
    for i in range(2, N+1):
        f *= i
    sm = 0
    for (s, t) in itertools.combinations(range(N), 2):
        sm += math.sqrt((x[s] - x[t])**2 + (y[s] - y[t])**2) * f / N * 2
    print(sm / f)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    x = [int()] * (N)  # type: "List[int]"
    y = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        x[i] = int(next(tokens))
        y[i] = int(next(tokens))
    solve(N, x, y)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M = mapint()
mod = 10**9+7
Xs = list(mapint())
Ys = list(mapint())

xsum = 0
for i in range(N):
    x = Xs[i]
    xsum += (i*x-(N-i-1)*x)
    xsum %= mod
ysum = 0
for i in range(M):
    y = Ys[i]
    ysum += (i*y-(M-i-1)*y)
    ysum %= mod

print(xsum*ysum%mod)

Measured memory_bytes: 91204
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
while (x->left != NIL){
x = x->left;
return x;
}
}

Node treeMaximum(Node x){
while (x->right != NIL){
x = x->right;
return x;
}
}

Node treeSearch(Node x, int k){
if(x == NIL||k == x->key) return x;
if(k < x->key) return treeSearch(x->left, k);
else return treeSearch(x->right, k);
}





void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key) x = x->left;
    else x = x->right;
  }
  z->parent = y;
  if(y == NIL) root = z;
  else{
    if(z->key < y->key) y->left = z;
    else y->right = z;
  }
}

void inorder(Node u){
  if(u == NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}
void preorder(Node u){
  if(u == NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}

int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
  }

  return 0;
}



Measured memory_bytes: 25136
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = 1e9;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/

int main() {
    ll N;
    cin>>N;
    vi s(N);
    ll total=0;
    REP(i,N){
        cin>>s[i];
        total+=s[i];
    }
    vector<bool> dp(total+1,false);
    dp[0]=true;
    REP(i,N){
        RREP(j,total+1){
            if(dp[j]&&j+s[i]<=total)dp[j+s[i]]=true;
        }
    }
    REP(i,total+1){
        if(dp[i]&&i%10!=0)ans=i;
    }
    cout<<ans<<endl;
    return 0;
}


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

int main() {

    int N, M;
    cin >> N >> M;
    vector<ll> X(M, 0);

    for (int i = 0; i < M; i++) {
        cin >> X[i];
    }
    if ( M <= N ) {
        cout << "0\n";
        return 0;
    }

    sort(X.begin(), X.end());

    vector<int> d(M - 1, 0);
    for (int i = 1; i < M; i++) {
        d[i - 1] = X[i] - X[i - 1];
    }
    sort(d.begin(), d.end());
    reverse(d.begin(), d.end());

    ll ans = X[M - 1] - X[0];
    for (int i = 0; i < N - 1; i++) {
        ans -= d[i];
    }

    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 1408
/*input
2
ip cc
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define eb emplace_back
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define EL cout<<'\n'
#define BS(a,x) binary_search(ALL(a),x)
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
template<typename T>
ostream& operator<<(ostream& out,vector<T> V){
	REP(i,SZ(V)) out<<V[i]<<((i!=SZ(V)-1)?" ":"");
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=20;
const ll INF64=1e18;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}


int main(){
	IOS;
	int n;
	cin>>n;
  cout<<n*n;
	return 0;
}


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

using namespace std;

int main() {

	int n, m;
	scanf("%d %d", &n, &m);

	if(n % 2 == 1) {
		for(int i = 1; i <= m; i++) {
			printf("%d %d\n", i, n - i + 1);
		}
		return 0;
	}
	int M = 1;
	while(2*(M+1) + 1 <= n) M++;
	assert(m <= M);
	for(int i = 1; i <= m; i++) {
		if(i > (M + 1) / 2) {
			printf("%d %d\n", i, n - i);
		}
		else printf("%d %d\n", i, n - i + 1);
	}
}


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

int main(){
	int a,b,Num,i ;
	while(cin>>a>>b){
		Num= a + b ;
		for( i = 0 ;Num> 0;i++){
			Num/= 10;
		}
	
		cout << i << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
import collections

N = int(input())
S = list(input() for i in range(N))
dict = {}

for l in S:
        if l in dict:
            dict[l] += 1;
        else:
            dict[l] = 1;
            
max = max(dict.values())

max_k_list = [kv[0] for kv in dict.items() if kv[1] == max]

max_k_list.sort()

for i in max_k_list:
    print(i)


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

int main(){
	int N;
	cin>>N;
	double tmp;
	vector<double>arr;
	for(int i=0;i<N;++i){
		cin>>tmp;
		arr.push_back(tmp);
	}
	sort(arr.begin(),arr.end());
	double ans = 0;
	for(int i=0;i<N-1;++i){
		if(i==0)ans=(arr[0]+arr[1])/2;
		else{
			ans = (ans + arr[i+1])/2;
		}
	}
	cout<<ans<<endl;
}


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

struct _data {
	int x, y;
}xy[101];

int n, k;
int f(int step){
	if (step<1) return 0;
	return  min(xy[step].x*2, (k-xy[step].x)*2) + f(step-1);
}
int main(){
	int n, a;
	scanf("%d%d",&n,&k);
	for(int i=1; i<=n; i++){
		scanf("%d", &xy[i].x);
		xy[i].y = i;
	}
		
	printf("%d", f(n));
	return 0;
	
}

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

using namespace std;

int main()
{
   ll n,k;
   cin>>n>>k;
   vector<ll> v(n);
   for(ll i=0;i<n;i++)
     cin>>v[i];
   ll start=0;
   ll sum=0;
   for(ll i=0;i<k;i++)
    sum=sum+v[i];
    ll max=sum;
  for(ll i=1;i<=n-k;i++)
   {
       
       sum=sum-v[i-1]+v[i-1+k];
       if(sum>max)
       {
           max=sum;
           start=i;
       }
       
       
   }
   long double rt=0;
   for(ll i=start;i<start+k;i++)
      {
       ll temp=v[i]+1;
       rt=rt+(long double)temp/2;
         
      }
      cout<<fixed<<setprecision(20)<<rt<<endl;
   
   return 0;
}

Measured memory_bytes: 1792
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            String S = in.next();
            char[] cs = S.toCharArray();

            for (int i = 1; i < 4; i++) {
                if (cs[i - 1] == cs[i]) {
                    out.println("Bad");
                    return;
                }
            }
            out.println("Good");
        }

    }
}



Measured memory_bytes: 21844
r1,c1,r2,c2 = map(int, input().split())

def nCr_mod_p(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
N = 2*10 ** 6 + 10  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p), 0! = 1! = 1
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p), 0! = 1! = 1
inv = [0, 1]  # inv[n] = n^(-1) mod p, 0! = 1　だけど便宜上inv[0]=0にしてる

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

sum22 = nCr_mod_p(r2+1+c2+1,r2+1,p) - 1
sum21 = nCr_mod_p(r2+1+c1,r2+1,p) - 1
sum12 = nCr_mod_p(r1+c2+1,c2+1,p) - 1
sum11 = nCr_mod_p(r1+c1,c1,p) - 1

ans = sum22 - sum21 - sum12 + sum11
ans %= p

print(ans)


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

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

	if (a[0] == 'A') {
		int count = 0;

		for (int i = 2; i < a.length() - 1 ; i++) {
			if (a[i] == 'C') {
				++count;
			}
		}
		if (count == 1) {
			int cap = 0;
			for (int i = 0; i < a.length(); i++) {
				if (a[i] >= 'A' && a[i] <= 'Z') {
					++cap;
				}
			}
			if (cap == 2) {
				cout << "AC" << endl;
				return 0;
			}
				
		}
	}

	cout << "WA" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#define FILE_NAME "a"

const int MAXN = 2e5 + 10;

int n, m;
vi g[MAXN];

bool read() {
	if  (scanf("%d%d", &n, &m) < 2) {
		return 0;
	}
	forn(i, n) {
		g[i].clear();
	}
	forn(i, m) {
		int a, b;
		scanf("%d%d", &a, &b);
		--a;
		--b;
		g[a].pb(b);
		g[b].pb(a);
	}
	return 1;
}

bool was[MAXN];

void dfs(int v, vi& vs) {
	assert(!was[v]);
	was[v] = 1;
	vs.pb(v);
	for (int to : g[v]) {
		if  (!was[to]) {
			dfs(to, vs);
			return;
		}
	}
}

void solve() {
	memset (was, 0, sizeof was);
	vi ans1;
	dfs(0, ans1);
	vi ans2;
	for (int to : g[0]) {
		if  (!was[to]) {
			dfs(to, ans2);
			reverse(all(ans2));
			break;
		}
	}

	vi ans = ans2;
	ans.insert(ans.end(), all(ans1));

	printf("%d\n", sz(ans));
	for (int x : ans) {
		printf("%d ", x + 1);
	}
	puts("");
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		solve();
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


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

int main() {
    int n,q;
    cin >> n >> q;
    string s;
    cin >> s;

    vector<int> count(n);
    for(int i=0;i<n-1;i++){
        if(s[i]=='A' && s[i+1]=='C'){
            count[i]++; //ACとなった時のi文字目を記憶
        }
    }
    //累積和
    vector<int> sum(n+1,0);//sum[0]とsum[1]を0にする
    for(int i=0;i<n;i++){
        sum[i+2] = sum[i+1] + count[i];
    }

    for(int i=0;i<q;i++){
        int l,r;
        cin >> l >> r;
        cout << sum[r] - sum[l] << endl;
    }
    return 0;
}



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

int v[21], c[21];

signed main() {

    int x = 0, y = 0;
    int n;
    cin >> n;
    for ( int i = 0; i < n; i++ ) {
        cin >> v[i];
    }
    for ( int i = 0; i < n; i++ ) {
        cin >> c[i];
    }
    for ( int i = 0; i < n; i++ ) {
        if ( c[i] < v[i] ) {
            x += v[i];
            y += c[i];
        }
    }
    cout << x-y << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#ifdef _DEBUG_
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl
#else
#define dump(val)
#endif

using namespace std;

typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a, T b) {
    return vector<T>(a, b);
}
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int x, a;
    cin >> x >> a;
    cout << (x < a ? 0 : 10) << endl;
    return 0;
}


Measured memory_bytes: 384
// G++ MACro.cpp -std=c++14
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
 
#define dump(x)  cout << #x << " = " << (x) << endl;
#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 Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
 
#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
 
#define FOREACH(x,a) for(auto& (x) : (a) )
 
#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])
 
#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl
 
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl
 
#define ALL(obj) (obj).begin(),(obj).end()
 
#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
 
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision; // cpp_int
 
#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>
 
#define pb(a) push_back(a)
#define mp make_pair

int main(){
  CIN(n);SCIN(s,t);
  REP(i,n){//i個ずらす
    bool flag=true;
    FOR(j,i,n){//j文字目
      if(s[j]!=t[j-i]){flag=false;break;}
    }
    if(flag){COUT(i+n);return 0;}
  }
  COUT(n*2);
  return 0;
}


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

static const int N = 1000;

int main(){
  int n,p[N+1],m[N+1][N+1];
  cin >> n;

  for(int i=1;i<=n;i++){
    cin >> p[i-1] >> p[i];
  }

  for(int i=1;i<=n;i++){
    m[i][i] = 0;
  }

  for(int l=2;l<=n;l++){
    for(int i=1;i<=n-1;i++){
      int j= i+l-1;
      m[i][j] = (1 << 21);
      for(int k=i;k<=j-1;k++){
	m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }

  cout << m[1][n] << endl;

  return 0;
}



Measured memory_bytes: 3468
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
A, B, N = map(int,input().split())



#N = min(N,A)

def test():
    mx = 0
    for x in range(1,B):
        v = (A*x)//B - A * (x//B)
        print (v)
        mx = max(mx,v)

x = min(B-1,N)
v = (A*x)//B - A * (x//B)
print (v)

Measured memory_bytes: 9204
int main()
{
	int x,y;
	char c;
	for(;scanf("%d %c %d",&x,&c,&y),c!='?';)
	{
		switch(c)
		{
		case '+':
		printf("%d\n",x+y);
		break;
		case '-':
		printf("%d\n",x-y);
		break;
		case '*':
		printf("%d\n",x*y);
		break;
		case '/':
		printf("%d\n",x/y);
		break;
		}
	}
	return 0;
}



Measured memory_bytes: 2108
#include <stdio.h>

int main(void){
  char S[3];

  scanf("%s",S);
  int ans = 700;

  for(int i = 0;i < 3;i++){
    if(S[i] == 'o')
      ans += 100;
  }

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

Measured memory_bytes: 128
from collections import defaultdict

def solve():
    N, M = map(int, input().split())
    d = defaultdict(int)
    e = set()
    for _ in range(M):
        a, b = input().split()
        a = int(a)
        if b == 'AC':
            e.add(a)
        if b == 'WA' and a not in e:
            d[a] += 1
    s = 0
    for a in e:
        s += d[a]
    ans = [len(e), s]
    print(*ans)

# print(solve())

# def solve()が@return voidのとき
solve()

Measured memory_bytes: 22888
(n, x) = map(int, input().split())
x_n = list(map(int, input().split()))


def gcd(a, b):
    r = a % b
    return b if 0 == r else gcd(b, r)


x_n.sort()
min_start = abs(x_n[0] - x)
for i in range(1, len(x_n)):
    tmp = abs(x_n[i] - x)
    if min_start > tmp:
        min_start = tmp

ans = min_start
for i in range(1, len(x_n)):
    ans = gcd(ans, abs(x_n[i] - x_n[i-1]))
print(ans)


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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
int inf = 1e9;
Int mod = 1e9+7;

typedef struct {
    bool L, R;
} p_t;

int main() {
    Int n, l;
    cin >> n >> l;
    vector<string> v(n);
    for (Int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(all(v));
    for (Int i = 0; i < n; i++) {
        cout << v[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#define ll long long
#define INF 1e+18
#define MOD 1000000007
using namespace std;



int main(){
    ll K,A,B;
    cin >> K >> A >> B;
    if(B-A<=1){
        cout<<K+1<<endl;
    }else{
        ll ans=1;
        if(K>=A-1){
            K-= A-1;
            ans=A;
            
            ans += K%2;
            ans += (B-A)*(K/2);
            
        }else{
            ans=1+K;
        }
        
        cout<<ans<<endl;
        
    }
    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()

const int N = (int)3e5;

ll mpow(ll a, ll b){
	if(b==0) return 1;
	else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%MOD;}
	else return mpow(a,b-1) * a % MOD;
}
ll gcd(ll a, ll b){
	if(b==0) return a;
	else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
	if(kaijo_memo.size() > n) return kaijo_memo[n];
	if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
	while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % MOD);
	return kaijo_memo[n];
}
ll nCr(ll n, ll r){
	if(n < r || r < 0) return 0;
	ll ret = 1;
	ret *= kaijo(n); ret %= MOD;
	ret *= mpow(kaijo(r), MOD-2); ret %= MOD;
	ret *= mpow(kaijo(n-r), MOD-2); ret %= MOD;
	return ret;
}

vector<int> G[N];
ll brack,white;
bool check[N];

int main(void){
	int n;cin>>n;
	rep(i,n){
		check[i] = false;
	}
	rep(i,n-1){
		int a,b;cin>>a>>b;a--;b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	brack=0; white=0;
	queue<int> bq,wq;
	bq.push(0);wq.push(n-1);
	while(bq.size() > 0 || wq.size() > 0){
		queue<int> bq2,wq2;
		while(bq.size() > 0){
			int now = bq.front(); bq.pop();
			if(check[now]) continue;
			check[now] = true;
			brack++;
			rep(i,G[now].size()){
				int next = G[now][i];
				bq2.push(next);
			}
		}
		while(wq.size() > 0){
			int now = wq.front();wq.pop();
			if(check[now]) continue;
			check[now] = true;
			white++;
			rep(i,G[now].size()){
				int next = G[now][i];
				wq2.push(next);
			}
		}
		bq = bq2;
		wq = wq2;
	}
	cerr<<brack<<" "<<white<<endl;
	cout<<(brack > white ? "Fennec" : "Snuke")<<endl;
	return 0;
}


Measured memory_bytes: 10880
fun main(arr:Array<String>) {
    val (x1,y1,x2,y2) = readLine()!!.split(" ").map { it.toInt() }
    val diffX = x2-x1
    val diffY = y2 - y1
    val x3 = x2 - diffY
    val y3 = y2 + diffX
    val x4 = x1 - diffY
    val y4 = y1 + diffX
    println("%s %s %s %s".format(x3, y3, x4, y4))
}

Measured memory_bytes: 37992
#include <cstdio>

#include <vector>

int main() {
  int n;
  scanf("%d", &n);

  int a, b;
  scanf("%d %d", &a, &b);

  std::vector<int> p(n);
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &p[i]);
    if (p[i] <= a) {
      c1 += 1;
    } else if (p[i] <= b) {
      c2 += 1;
    } else {
      c3 += 1;
    }
  }

  printf("%d\n", std::min(c1, std::min(c2, c3)));

  return 0;
}

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		new Main().run();
	}

	private void run() {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			w = scanner.nextInt();
			h = scanner.nextInt();
			if ((w | h) == 0)
				break;
			ice = new int[h * w];
			hit = new int[h * w];
			dist = new int[h][w];
			m = new char[h][w];
			v = new boolean[h][w];
			for (int i = 0; i < h; i++)
				for (int j = 0; j < w; j++) {
					dist[i][j] = -1;
					m[i][j] = '#';
				}
			for (int i = 0; i < h; i++) {
				char[] c = scanner.next().toCharArray();
				for (int j = 0; j < w; j++) {
					m[i][j] = c[j];
					if (m[i][j] == 'S') {
						m[i][j] = '.';
						si = i;
						sj = j;
					} else if (m[i][j] == 'G') {
						m[i][j] = '.';
						gi = i;
						gj = j;
					}
				}

			}
			ice[0] = INF;
			id = new int[h][w];
			int ID = 1;
			for (int i = 0; i < h; i++)
				for (int j = 0; j < w; j++) {
					if (m[i][j] != 'X' || id[i][j] > 0)
						continue;
					mark(i, j, ID);
					if (ice[ID] == 1)
						m[i][j] = '#';
					ID++;
				}
			dist[gi][gj] = 0;
			Deque<int[]> deque = new ArrayDeque<int[]>();
			deque.offer(new int[] { gi, gj });
			while (!deque.isEmpty()) {
				int[] V = deque.poll();
				int pi = V[0];
				int pj = V[1];
				for (int[] mo : d) {
					int ni = pi + mo[0];
					int nj = pj + mo[1];
					if (!isOK(ni, nj))
						continue;
					if (m[ni][nj] != '#' && dist[ni][nj] == -1) {
						dist[ni][nj] = dist[pi][pj] + 1;
						deque.offer(new int[] { ni, nj });
					}
				}
			}
			res = 0;
			v[si][sj] = true;
			while (!f(si, sj, 0, -1, -1)) {
				Arrays.fill(hit, 0);
				for (int i = 0; i < h; i++)
					for (int j = 0; j < w; j++)
						v[i][j] = false;
				v[si][sj] = true;
				res++;
			}
			System.out.println(res);
		}
	}

	private boolean f(int i, int j, int depth, int pi, int pj) {
		if (res < depth + dist[i][j])
			return false;
		if (gi == i && gj == j)
			return true;
		for (int[] mo : d) {
			int ni = i + mo[0];
			int nj = j + mo[1];
			if (!isOK(ni, nj))
				continue;
			if (ni != pi && nj != pj && v[ni][nj])
				return false;
		}
		for (int[] mo : d) {
			int ni = i + mo[0];
			int nj = j + mo[1];
			if (!isOK(ni, nj))
				continue;
			if (!v[ni][nj] && m[ni][nj] != '#') {
				if (ice[id[ni][nj]] /2 > hit[id[ni][nj]] ) {
					hit[id[ni][nj]]++;
					v[ni][nj] = true;
					if (f(ni, nj, depth + 1, i, j))
						return true;
					v[ni][nj] = false;
					hit[id[ni][nj]]--;
				}
			}
		}
		return false;
	}

	private void mark(int i, int j, int x) {
		id[i][j] = x;
		ice[x]++;
		for (int[] mo : d) {
			int ni = i + mo[0];
			int nj = j + mo[1];
			if (!isOK(ni, nj))
				continue;
			if (m[ni][nj] == 'X' && id[ni][nj] == 0)
				mark(ni, nj, x);
		}
	}

	private boolean isOK(int i, int j) {
		if (0 <= i && i < h && 0 <= j && j < w)
			return true;
		return false;
	}

	int w, h, si, sj, gi, gj, INF = 1 << 29, res;
	int[][] d = { { -1, 0 }, { 0, 1 }, { 1, 0 }, { 0, -1 } };
	int[] ice, hit;
	int[][] id, dist;
	char[][] m;
	boolean[][] v;
}

Measured memory_bytes: 25236
l, r = map(int, input().split())
def doit(l, r):
  if r - l > 2019:
    return 0
  l = l % 2019
  r = r % 2019
  if l == 0:
    return 0
  if r == 0:
    return 0
  if r <= l:
    r += 2019
  res = 2019
  for x in range(l, r):
    for y in range(x + 1, r + 1):
      #print(x, y, file=sys.stderr)
      res = min(res, (x * y) % 2019)
      if res == 0:
        return 0
  return res % 2019

print(doit(l, r))


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

#define rep(ver,n) rep2(ver,0,n)
#define rep2(ver,m,n) for(int ver=m;i<(n);i++)
#define vecadd emplace_back

typedef pair<int,int> P;

int main(){
  char tenki[2][4];
  
  cin>>tenki[0];
  cin>>tenki[1];
  
  int a=0;
  
  rep(i,3){
    if(tenki[0][i]==tenki[1][i]){
      a++;
    }
  }
  
  cout<<a;
  
  return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;


public class Main {
    static HashMap<Integer,Integer>[] g; //<toRoom, keyNecessary>
    static int n,m;
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //String[] buf = reader.readLine().split(" ");
        //n = Integer.parseInt(buf[0]); m = Integer.parseInt(buf[1]);
        int n = sc.nextInt();
        int ans = 180+(n-3)*180;
        PrintWriter out = new PrintWriter(System.out);
        out.println(ans);
        out.flush();
    }
}



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

using namespace std;

const int N = 2e5+5;

const int mod = 1e9+7;


int n;
int k;
bool hate[10];

bool yes(int x){
    while(x){
        if(hate[x % 10])
            return 0;
        x /= 10;
    }
    return 1;
}

int main(){
    cin >> n >> k;
    for(int i = 1; i <= k; i++){
        int x;
        cin >> x;
        hate[x] = 1;
    }
    for(int i = n; i <= 1e8; i++){
        if(yes(i)){
            cout << i << "\n";
            return 0;
        }
    }
    assert(0);
    return 0;
}


Measured memory_bytes: 3556
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <limits>
#include <stack>
#include <queue>
#include <map> 
using namespace std;

#define LL long long
#define MOD (1000000007)


//127
struct IntPair {
	LL B, C;
};

int main() {
	LL N, M;

	scanf("%lld %lld", &N, &M);

	vector<LL> A;

	for (int i = 0; i < N; i++) {
		LL val;
		scanf("%lld", &val);
		A.push_back(val);
	}
	
	vector<IntPair> P;

	for (int i = 0; i < M; i++) {
		LL val1, val2;
		scanf("%lld %lld", &val1, &val2);
		IntPair pair;
		pair.B = val1;
		pair.C = val2;
		P.push_back(pair);
	}

	std::sort(A.begin(), A.end());

	std::sort(P.begin(), P.end(), [](const IntPair &a, const IntPair &b) {
		return a.C > b.C;
	});

	LL indexA = 0;
	bool finish = false;
	for (auto item : P) {
		for (int i = 0; i < item.B; i++) {
			if (item.C > A[indexA]) {
				A[indexA] = item.C;
			}
			else {
				finish = true;
				break;
			}

			indexA++;

			if (indexA >= N) {
				finish = true;
				break;
			}
		}

		if (finish) {
			break;
		}
	}

	LL result = 0;
	for (auto item : A) {
		result += item;
	}

	printf("%lld\n", result);

	return 0;
}


//126
/*
struct Node {
	unsigned int connect;
	unsigned int weight;
};

int main() {
	LL N;

	scanf("%lld", &N);

	static vector<Node> node[100010];
	static char color[100010];

	for (int i = 0; i < N - 1; i++) {
		unsigned int u, v, w;

		scanf("%d %d %d", &u, &v, &w);

		Node n1;
		n1.connect = v;
		n1.weight = w;
		node[u].push_back(n1);

		Node n2;
		n2.connect = u;
		n2.weight = w;
		node[v].push_back(n2);
	}

	for (int i = 0; i <= N; i++) {
		color[i] = -1;
	}

	std::queue<unsigned int> q;

	color[1] = 0;
	q.push(1);

	//���D��T��
	while (q.size() > 0) {
		unsigned int index = q.front();
		q.pop();

		char c = color[index];

		for (auto item : node[index]) {
			if (color[item.connect] < 0) {
				//�܂��ʂ��Ă��Ȃ��m�[�h
				color[item.connect] = item.weight % 2 == 0 ? c : 1 - c;
				q.push(item.connect);
			}
		}
	}

	for (int i = 1; i <= N; i++) {
		printf("%d\n", color[i]);
	}

	return 0;
}
*/

Measured memory_bytes: 3188
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2147483647
#define int long long
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
//typedef long long int ll;

vector<int> prime;
unordered_map<int,int> prco;
void prfac(int n){
	int a=2;
	while(n>=a*a){
		if(n%a==0){
			prco[a]++;
			n/=a;
		}
		else{
			a++;
		}
	}
	prco[n]++;
}

signed main(){
	
	int n;
	cin>>n;
	for(int i=2;i<=n;i++){
		prfac(i);
	}
	int ans=1;
	for(auto x:prco){
		if(x.first!=1){
			ans*=x.second+1;
			ans%=1000000007;
		}
	}
	cout<<ans<<endl;
	
	
	
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int n;
	scanf("%d",&n);

	n %= 10;
	if(n == 2 || n == 4 || n== 5 || n==7 || n==9){
		printf("hon");
	}
	else if(n == 0 || n == 1 || n == 6 || n==8){
		printf("pon");
	}
	else{
		printf("bon");
	}
	
	return 0;
}


Measured memory_bytes: 1728
#include<iostream>
#include<bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define vi vector<int>
#define lvi vector<long long>
#define pi pair<int,int>
#define lpi pair<long long ,long long>
#define mp make_pair
#define pb push_back
#define ll long long 
#define faltu ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod 1000000007
#define mod1 1000000000000000007
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>multiordered_set;
ll int pw(ll int a, ll int b,ll md) {
    if (b == 0) return 1;
    ll int t = pw(a, b / 2,md);
    if (b % 2 == 0) return (t * t)%mod;
    else return ((t * t)%mod * a)%mod;
}
vector<int> pm;
void prm(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
              prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p]) pm.push_back(p);
}
bool cmp(const pair<ll int,ll int> &a,const pair<ll int,ll int> &b)
{
    if(a.first==b.first)return a.second<b.second;
    return a.first>b.first;
}
ll int gcd(ll int a,ll int b)
{
    if(!a)return b;
    return gcd(b%a,a);
}
bool isPrime(int n) 
{ 
    if (n <= 1) 
        return false; 
    for (int i = 2; i < n; i++) 
        if (n % i == 0) 
            return false; 
    return true; 
} 
map<int,int>pa;
int find(int i){
    if(pa[i]==i)return i;
    return pa[i]=find(pa[i]);
}     
void join(int i,int j){
    int a=find(i);
    int b=find(j);
    if(b>=a)pa[b]=a;
    else pa[a]=b;
}               
int ddx[]={-1,-1,-1,0,1,1,1,0};
int ddy[]={-1,0,1,1,1,0,-1,-1};
int dx[]={-1,0,1,0};
int dy[]={0,-1,0,1};
int main()
{
    faltu;
    int t=1;
   // cin>>t;
    while(t--)
    {
       int a,b,c;
        cin>>a>>b>>c;
        int ans=max(a,max(b,c))-min(a,min(b,c));
        cout<<ans;
    }
}

Measured memory_bytes: 3644
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<set>

using namespace std;

const int maxn = 2e5;

typedef long long ll;

const ll INF = 1e18;

int n;
ll x[maxn + 5], y[maxn + 5];
set<ll> s1, s2;
ll res = -INF;

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf("%lld %lld", &x[i], &y[i]);
		ll p1 = x[i] + y[i], p2 = x[i] - y[i];
		x[i] = p1, y[i] = p2;
	}
	for (int i = 1; i <= n; ++i) {
		if (s1.empty() && s2.empty()) {
			s1.insert(x[i]);
			s2.insert(y[i]);
			continue;
		}
		ll maxx = *s1.rbegin(), minx = *s1.begin();
		ll maxy = *s2.rbegin(), miny = *s2.begin();
		res = max(res, max(max(abs(maxx - x[i]), abs(minx - x[i])), max(abs(maxy - y[i]), abs(miny - y[i]))));
		s1.insert(x[i]);
		s2.insert(y[i]);
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 25532
#include <string>
#include <vector> 
#include <list> 
#include <map> 
#include <set> 
#include <queue>
#include <stack> 
#include <bitset> 
#include <algorithm> 
#include <numeric> 
#include <utility> 
#include <sstream> 
#include <iostream> 
#include <iomanip> 
#include <cstdio> 
#include <cmath> 
#include <cstdlib> 
#include <ctime> 
#include <cstring> 
#include <tuple>

using namespace std;

int n, invs, m, k;
const int mod = 1000000007;

int fac[110000];
int sumfac[110000];
int x[110000];

template <typename T>
T extGcd(T a, T b, T& x, T& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	else {
		int g = extGcd(b, a % b, y, x);
		y -= a / b * x;
		return g;
	}
}

template <typename T>
T modInv(T a, T m) {
	T x, y;
	extGcd(a, m, x, y);
	return (x % m + m) % m;
}

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

    cin >> n;

    fac[0] = 1;

    for (int i = 1; i <= n-1; i++) {
        fac[i] = (fac[i-1] * 1ll * (n-i)) % mod;
    }

    sumfac[0] = 1;
    for (int i = 1; i < n-1; i++) {
        sumfac[i] = (sumfac[i-1] + modInv(i+1,mod)) % mod;
    }

    int ans = 0;
    for (int i = 0; i < n; i++) cin >> x[i];
    for (int i = 0; i < n-1; i++) {
        int t = sumfac[i];
        ans = (ans + t * 1ll * (x[i+1]-x[i])) % mod;
        ans = (ans + mod) % mod;
    }

    ans = (ans * 1ll * fac[n-1]) % mod;
    cout << ans << endl;
}




Measured memory_bytes: 1408
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define vec vector<long long int>
#define fi first
#define se second
#define pb push_back
int main()
{
    int n;
    cin >> n;
    vector<int> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        x.pb(t);
    }
    ll ans = 0;
    ll sum = x[0];
    for (int i = 1; i < n; i++)
    {
        ans = (ans % mod + (sum % mod * x[i] % mod) % mod) % mod;
        sum = sum + x[i];
    }
    cout << ans;
}

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

int main()
{
  int N ;
  cin>>N ;
  vector<string>S(N) ;
  for(int i=0;i<N;i++) cin>>S.at(i) ;
  
  sort(S.begin(),S.end()) ;
  int ans=1 ;
  for(int i=0;i<N-1;i++)  if(S.at(i)!=S.at(i+1)) ans++ ;
  
  cout<<ans<<endl ;
  
  return 0 ;
}


Measured memory_bytes: 9600
//幅優先探索　最短でいったぬる
//https://qiita.com/drken/items/996d80bcae64649a6580
import java.util.ArrayList;
import java.util.Scanner;

import java.util.*;
public class Main {
	static int N ;
	static int M;
	static int ans = 0;
	static boolean map[][];
	static int flag[];
	public static void main(String args[]) { 
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		M = sc.nextInt();
		flag = new int[N+1];
		map = new boolean[N+1][N+1];
		for(int i=0; i<M;i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			map[a][b] = map[b][a] = true;
		}
		flag[1] = 1;
		solve(1);
		System.out.println(ans);
	}
	static  void solve(int x){
		if(TRUE()) {
			ans++;
			return;
		}else {
			for(int i = 1; i<=N;i++) {
				if(map[x][i] && flag[i]==0) {
					flag[i] = 1;
					solve(i);
					flag[i] = 0;
				}
			
			}
		}
		return ;
	}
	static boolean TRUE() {
		int count = 0;
		for(int i = 1; i<= N; i++) {
			if(flag[i] == 1)count++;
		}
		if(count == N) {
			return true;
		}
		return false;
		
	}
	
}
	


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

#define REP(i, x, n) for (int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x.size())
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define uniq(x) x.erase(unique(x.begin(), x.end()), x.end())
#define F first
#define S second
#define mp make_pair
#define eb emplace_back
#define pii pair<int, int>
#define pll pair<ll, ll>

using namespace std;

typedef long long ll;

/* --- INFやMODの値が適切か確認する --- */
// const int INF = 1 << 30;
// const ll INF = 1LL << 60;
// const ll MOD = 1000000007;

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

  int ans = 0;

  REP(len, 1, n + 1) {
    vector<int> dp(n + 1, 0);
    rep(i, n) {
      if (i + len >= n) break;
      if (s[i] == s[i + len])
        dp[i + 1] = min(dp[i] + 1, len);
      else
        dp[i + 1] = 0;
      ans = max(ans, dp[i + 1]);
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
n, k = map(int, input().split())

ans = [i for i in range(1, n + 1)]
ans_list = []
for i in ans:
    key = i
    cnt = 0
    while key < k:
        key *= 2
        cnt += 1
    ans_list.append(cnt)
Ans = 0
for i in range(len(ans_list)):
    Ans += ((1 / n) * pow(1 / 2, ans_list[i]))

print(Ans)

Measured memory_bytes: 46900