akhauriyash/Code-Regression huggingface dataset:
N = int(input())
a = []
a = list(map(int,input().split()))
 
b = [0]*N
for i in reversed(range(N)):
    j = i + 1
    buf = b[i::j]
    if (sum(buf) % 2) != a[i]:
        b[i] = 1
print(sum(b))
bb = [i+1 for i in range(N) if b[i] == 1]
if sum(b) != 0:
    print(' '.join(map(str, bb)))

Measured memory_bytes: 22068
import java.io.PrintWriter
import java.util.*
import java.math.*
import java.lang.*
import kotlin.comparisons.*

val pw = PrintWriter(System.out)
val MOD: Long = (1e+9 + 7).toLong()

fun main(args: Array<String>) {
    val (x, y) = readListOfInt() 

    println(x + y / 2)
    pw.flush()
}

/****** Declared Functions and Data Structures ******/
// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }

fun Double.format(digits: Int) = String.format("%.${digits}f", this)
fun Float.format(digits: Int) = String.format("%.${digits}f", this)

fun print(value: Any) { pw.print(value) }
fun println(value : Any) { pw.println(value) }


// Extensions
fun<T> List<T>.toBuckets(bucketKeys: List<T>): Map<T, Int> {
    val buckets = bucketKeys.associate { t -> Pair(t, 0) }.toMutableMap()
    this.forEach { t ->
        buckets[t] = buckets[t]!! + 1
    }
    return buckets
}

fun <K, V> Map<K, V>.toMutableMap(): MutableMap<K, V> = HashMap(this)

// Util Functions
fun<T> permutations(src: List<T>): List<List<T>> {
    if(src.size == 1) return listOf(src)
    val perms = mutableListOf<List<T>>()
    val insertElement = src[0]
    permutations(src.drop(1)).forEach { perm ->
        for(i in 0..perm.size) {
            val newPerm = perm.toMutableList()
            newPerm.add(i, insertElement)
            perms.add(newPerm.toList())
        }
    }
    return perms
}

// return nCr, if you want nCr, please access v[n][r]
fun combinations(n: Long): List<List<Long>> {
    val v = (0..n).map { (0..n).map{0L}.toMutableList() }.toMutableList()
    for(i in 0 until v.size) {
        v[i][0] = 1L
        v[i][i] = 1L
    }
    for(i in 0 until v.size) {
        for(j in 1 until i) {
            v[i][j] = (v[i-1][j-1] + v[i-1][j]) % MOD
        }
    }
    return v.map { it.toList() }.toList()
}

// should be a >= b
fun gcd(a: Long, b: Long): Long = 
    if(b == 0L) a else gcd(b, a % b)

// shoud be a >= b
fun lcm(a: Long, b: Long): Long = 
    a / gcd(a, b) * b

fun sumDigits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

fun isDecimal(v: Double): Boolean = ((v - Math.floor(v)) != 0.0)

// Data Structures
class Stack<T>(private var st: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = st.isEmpty()
    fun top(): T = st.last()
    fun push(e: T) { st.add(e) }
    fun pop() { st = st.dropLast(1).toMutableList() }
}

class Queue<T>(private var que: MutableList<T> = mutableListOf<T>()) {
    fun isEmpty() = que.isEmpty()
    fun top(): T = que.first()
    fun push(e: T) { que.add(e) }
    fun pop() { que = que.drop(1).toMutableList() }
}


Measured memory_bytes: 37596
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repA(a,i,n) for(int i=a;i<n;i++)
#define trav(a,x)for(auto &a: x)
#define fll(a) memset(a,0,sizeof(a));
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define fst first
#define sec second
#define itr(it,x) for(auto it=x.begin();it!=x.end();it++)
typedef long long ll;
typedef long double ld;
typedef pair<int,int>pii;
typedef vector<int>vi;
typedef map<int,int>ma;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
void fopen()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);	
}
ll min(ll a,ll b)
{
	if(a<b){return a;}
	return b;
}
int main() {
	//fopen();
	fastio;
	ll n,a,b;
	cin>>n>>a>>b;
	if(!((b-a)%2))
	{
		cout<<(b-a)/2;
	}
	else{
		cout<<1+min(a-1,n-b)+(b-a-1)/2;
	}

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <bitset>
#include <iomanip>
#include <deque>
#include <tuple>
#include <algorithm>

using namespace std;

int main()
{
    int a, b, c;

    cin >> a >> b >> c;

    if (a+b < c) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 256
S = input()
rec = {"N": 0, "W": 0, "S": 0, "E": 0}
for i in S:
    rec[i] += 1

if rec["N"] > 0 and rec["S"] == 0:
    print("No")
elif rec["N"] == 0 and rec["S"] > 0:
    print("No")
elif rec["W"] > 0 and rec["E"] == 0:
    print("No")
elif rec["W"] == 0 and rec["E"] > 0:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 3060
process.stdin.resume()
process.stdin.setEncoding('utf8')
process.stdin.on('data', function (chunk) {
  const hour = Math.floor(chunk / 3600)
  const minute = Math.floor((chunk % 3600) / 60)
  const second = chunk % 60
  const output = [ hour, minute, second ].join(':')
  console.log(output)
})

Measured memory_bytes: 15528
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000


int main(){
	int a[N];
	f(i, N)a[i] = 0;
	int n, k;
	int x, y, z;
	bool v = true;
	x = 0;
	y = 0;
	scanf("%d", &n);
	f(i, n){
		scanf("%d", &z);
		x = max(x, z);
		y += z;
	}
	if(x*2<y)printf("Yes\n");
	else printf("No\n");
	return 0;
}


Measured memory_bytes: 128
import sys
# input = sys.stdin.readline
sys.setrecursionlimit(10 ** 9)
MOD = 10 ** 9 + 7

ABCD = list(input())

for i in range(2 ** 3):
    tmp = int(ABCD[0])
    for j in range(3):
        if (i >> j) & 1:
            tmp += int(ABCD[j + 1])
        else:
            tmp -= int(ABCD[j + 1])
    if tmp == 7:
        print (ABCD[0], end = '')
        print ('+' if (i >> 0) & 1 else '-', end = '')
        print (ABCD[1], end = '')
        print ('+' if (i >> 1) & 1 else '-', end = '')
        print (ABCD[2], end = '')
        print ('+' if (i >> 2) & 1 else '-', end = '')
        print (ABCD[3], end = '=7\n')
        exit()
        

Measured memory_bytes: 3064
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
using namespace std;

int main () { 
// Baca bilangan
    /*double x; cin >> x;
    int fl = floor(x); // Masih Double
    int cl = ceil(x); // Masih Double
   
    cout << fl << " " << cl << "\n";*/
   
    // Looping FOR
   
   
    /*int n; cin >> n;
   
    for(int j = 1; j <= n; j++){
        // -------------------------
        // Print 1 baris N buah bintang
        for(int i = 1; i <= n; i++){
            cout << "*";
        }
        cout << "\n";
        // -------------------------
    }*/
//  int n,sum = 0, j;
//  cin >> n;
//  for(int k = 1; k <= n; k++ ){
//      cin >> j;
//  sum = sum + j
 
    //int x;
    //cin >> x;
    //for(int n = x ; n >= 1; n--){
    //if (x % n == 0){
    //cout << n << "\n";
    //}
//  }
 
////    int x,y,a;
////    cin >> a;
////    for(int i=0; i < a; i++){
//  //  cin >> x >> y;
////    if(x > y)
//  //  cout << ">"<< "\n";
////    if(x < y)
//  //  cout << "<" << "\n";
//  //if(x == y)
//  //  cout << "=" << "\n";
//}
////
//string x,y,a;
//x = "Hajj";
//y = "Umrah";
//int NoKasus = 1;
//while(cin >> a){
//  if (a==x)
//      cout << "Case" << " " << NoKasus << ":" << " " << "Hajj-e-Akbar"<< "\n";
//  if (a==y)
//      cout << "Case" << " " << NoKasus << ":" << " " << "Hajj-e-Asghar"<< "\n";
//  if(a== "*")
//      break;
//      NoKasus++;
//}
//string s;
//int NoKasus = 1;
//while(cin>>s){
//  if(s=="HELLO")
//      cout << "Case "<< NoKasus << ": " << "ENGLISH" << "\n";
//  else if(s=="HOLA")
//      cout << "Case "<< NoKasus << ": " << "SPANISH" << "\n";
//  else if(s=="HALLO")
//      cout << "Case "<< NoKasus << ": " << "GERMAN" << "\n";
//  else if(s=="BONJOUR")
//      cout << "Case "<< NoKasus << ": " << "FRENCH" << "\n";
//  else if(s=="CIAO")
//      cout << "Case "<< NoKasus << ": " << "ITALIAN" << "\n";
//  else if(s== "ZDRAVSTVUJTE")
//      cout << "Case "<< NoKasus << ": " << "RUSSIAN" << "\n";
//  else if(s== "#")
//      break;
//  else
//      cout << "Case "<< NoKasus << ": " << "UNKNOWN" << "\n";
//  NoKasus++;
//}

//	int n,k; cin>> n >>k;
//	for(int i = 1; i <= n; i++){
//	if (i % k == 0){
//	}
//	cout << "i\n";
//	cout << "*";
//	cout << "\n";
//	}

//int x;
//cin >> x;
//if (x == 2)
//	cout << "NO" << "\n";
//else if (x % 2 == 0)
//	cout << "YES" << "\n";
//else if (x % 2 == 1)
//	cout << "NO" << "\n";
	
//int a,b,c; cin >> a >> b >> c;
//for (int i = 1; i<=a; i++)
//if ()x

//string s;
//getline(cin, s);
//cout << s << endl;
	
int x;
cin >> x;
if (x == 25){
	cout << "Christmas" << endl;
}else if (x == 24){
	cout << "Christmas Eve" << endl;
}else if(x==23){
	cout << "Christmas Eve Eve"<< endl;
}else if(x==22){
	cout << "Christmas Eve Eve Eve"<< endl;
}	
}





Measured memory_bytes: 256
s = input()
q = int(input())

is_reverse = False
front_queue = []
back_queue = []
for i in range(q):
    t = input()
    if t == "1":
        is_reverse = not is_reverse
    else:
        t2, f, c = t.split()
        if (f == "1" and not is_reverse) or (f == "2" and is_reverse):
            front_queue.append(c)
        else:
            back_queue.append(c)

result = ""
if is_reverse:
    result = "".join(reversed(back_queue)) + s[::-1] + "".join(front_queue)
else:
    result = "".join(reversed(front_queue)) + s + "".join(back_queue)
print(result)


Measured memory_bytes: 6264
#include<stdio.h>

typedef unsigned long long ULL;

ULL gcd(ULL m,ULL n){
	
	return n==0?m:gcd(n,m%n);	
}
ULL lcm(ULL m,ULL n){
	
	return m/gcd(m,n)*n;
}

int main(){
	ULL a,b;
	while(scanf("%lld%lld",&a,&b)!=EOF){
		printf("%lld %lld\n",gcd(a,b),lcm(a,b));
	}
	return 0;
} 


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

# define x first
# define y second
# define mp make_pair
// everything goes according to my plan
# define pb push_back
# define sz(a) (int)(a.size())
# define vec vector
// shimkenttin kyzdary, dzyn, dzyn, dzyn...
# define y1    Y_U_NO_y1
# define left  Y_U_NO_left
# define right Y_U_NO_right

//put debug temp

using namespace std;

typedef pair <int, int> pii;
typedef long long ll;
typedef long double ld;

const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const ll MXLL = 4e18;
const int Sz = 1110111;
// a pinch of soul
inline void Read_rap () {
  ios_base :: sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}
inline void randomizer3000 () {
  unsigned int seed;
  asm ("rdtsc" : "=A"(seed));
  srand (seed);
}
void files (string problem) {
  if (fopen ((problem + ".in").c_str(),"r")) {
    freopen ((problem + ".in").c_str(),"r",stdin);
    freopen ((problem + ".out").c_str(),"w",stdout);
  }
}
void localInput(const char in[] = "s") {
  if (fopen (in, "r")) {
    freopen (in, "r", stdin);
  }
  else
    cerr << "Warning: Input file not found" << endl;
}


int main()
{
  # ifdef Local
    //localInput();
  # endif
  Read_rap();
  int n;
  cin >> n;
  int sum = 0;
  int x = MX;
  for (int i = 1; i <= n; i++) {
  	int s; cin >> s;
  	sum += s;
  	x = min (x, (s%10 == 0 ? MX : s));
  }
  if (sum%10 == 0) {
  	if (x != MX)
  		sum -= x;
    else
      sum = 0;
  	cout << sum;
  }
  else {
  	cout << sum;
  }

  return 0;
}





// Coded by Z..

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	var txt string
	var s = bufio.NewScanner(os.Stdin)
	if s.Scan() {
		txt = s.Text()
	}

	if txt == "ABC" {
		fmt.Println("ARC")
	} else {
		fmt.Println("ABC")
	}

}


Measured memory_bytes: 1756
n,k=map(int,input().split())
x=list(map(int,input().split()))
ans=10**25
for i in range(n-k+1):
    if x[i+k-1]<=0:
        num=x[i]*-1
    elif x[i]>=0:
        num=x[i+k-1]
    else:
        num1=abs(x[i])
        num=min(num1,x[i+k-1])*2+max(num1,x[i+k-1])
    ans=min(ans,num)
print(ans)


Measured memory_bytes: 20192
#include<cstdio>
#define For(i,A,B) for(i=(A);i<=(B);++i)
const int N=1000050;
int a[N],b[N],cnt;
inline int Abs(int x){return x<0?-x:x;}
inline void work(int x,int k){
    if(x)for(;!(x&1);x>>=1)cnt+=k;
}
inline bool check(int *a,int n){
    int i;
    bool f=0;
    cnt=0;
    For(i,1,n){
        if(!cnt&&(a[i]&1))f^=1;
        work(n-i,1);
        work(i,-1);
    }
    return f;
}
int main(){
    int n,i;
    bool f=0,g=0;
    scanf("%d",&n);
    For(i,1,n)scanf("%1d",a+i);
    if(check(a,n)){
        puts("1");
        return 0;
    }
    For(i,2,n){
        if(Abs(a[i]-a[i-1])==1){
            puts("0");
            return 0;
        }
        b[i-1]=Abs(a[i]-a[i-1])>>1;
    }
    puts(check(b,n-1)?"2":"0");
    return 0;
}

Measured memory_bytes: 7936
#include<stdio.h>
#define MAX 1000000
int main(){
  char a[MAX]={1,1};
  int i,j,n,x;
 
  for(i=2;i<MAX;i++){
    for(j=2;i*j<MAX;j++)if(!a[i])a[i*j]=1;
  }
  while(scanf("%d",&n)!=EOF){
    x=0;
    for(i=0;i<=n;i++)if(!a[i])x++;
    printf("%d\n",x);
  }
  return 0;
}

Measured memory_bytes: 1580
import java.util.Scanner;

public class Main {
	public static void main(String[] args){



		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		for(int i =0;i<n;i++) {
			a[i]=sc.nextLong();
		}
		
		int[][] bits = new int[n][60];
		
		long[] pows = new long[60];
		for(int i=0;i<60;i++) {
			pows[i] = (long)Math.pow(2, i);
		}
		
		for(int i=0;i<n;i++) {
			for(int j=59;j>=0;j--) {
				
				if(a[i]>=pows[j]) {
					a[i]-=pows[j];
					bits[i][j]=1;
				}else {
					bits[i][j]=0;
				}
			}
		}
		int[][] sums = new int[n][60];
		for(int i=0;i<60;i++) {
			sums[0][i]=0;
		}
		for(int i=0;i<n-1;i++) {
			for(int j=0;j<60;j++) {
				sums[i+1][j]= sums[i][j]+bits[i][j];
			}
		}
		long sum = 0;
		for(int i=0;i<60;i++) {
			long subsum =0;
			for(int j=1;j<n;j++) {
				if(bits[j][i]==0) {
					subsum+=sums[j][i];
				}else {
					subsum+=j-sums[j][i];
				}
			}
			subsum = subsum%1000000007;
			subsum = (long) (subsum*Math.pow(2,i)%1000000007);
			sum = (sum +subsum)%1000000007; 
		}
		
		System.out.println(sum);
	}
	public static long calc(int n,int c) {
		long ans = 1;
		for(int i =1;i<n+1;i++) {
			ans = (ans * i)%1000000007;
		}
		ans = ans * reverse(c)%1000000007;

		return ans*reverse(n-c)%1000000007;
	}
	public static long reverse(int c) {
		long divider =1;
		for(int i =1;i<c+1;i++) {
			divider = (divider * i)%1000000007;
		}
		long dividerholder=divider;
		for(int i=1;i<10000;i++) {
			divider = divider*dividerholder%1000000007;
		}
		long dividerholder2 = divider;
		for(int i=1;i<100000;i++) {
			divider = divider*dividerholder2%1000000007;
		}
		for(int i=0;i<5;i++) {
			divider = divider*dividerholder%1000000007;
		}
		return divider;
	}
}
/*
class City{
	int order;
	int prefecture;
	int year;
	int number;
	City(int order,int prefecture, int year){
		this.order = order;
		this.prefecture = prefecture;
		this.year = year;
	}
}
*/


Measured memory_bytes: 299164
import sys
sys.setrecursionlimit(10 ** 6)
N,K=map(int,input().split())
tree=[[]for _ in range(N+1)]
MOD=10**9+7
ans=K
enuk=[1]*(N)
for i in range(N-1):
    a,b=map(int,input().split())
    tree[a].append(b)
    tree[b].append(a)
    enuk[i+1]=(enuk[i]*(K-2-i))%MOD
def dfs(a,b):
    if a==1:
        node=len(tree[a])
        ret=1
        for i in range(node):
            ret*=K-1-i
            ret%=MOD
    else:
        node=len(tree[a])-1
        ret=enuk[node]%MOD
    for i in tree[a]:
        if i==b:
            continue
        ret=ret*dfs(i,a)%MOD
    return ret
ans*=dfs(1,0)
print(ans%MOD)

Measured memory_bytes: 88144
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
typedef long long ll;

ll dp[51][51][2510];
ll a[51];

int main() {
  int n, x;
  ll ans = 0;
  cin>>n>>x;
  REP(i, n) cin>>a[i];
  dp[0][0][0] = 1;

  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= 2500; k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (j > 0 && k >= a[i - 1])
          dp[i][j][k] += dp[i - 1][j - 1][k - a[i - 1]];
      }
    }
  }
  for (int j = 1; j <= n; j++) if (x * j < 2510) ans += dp[n][j][x * j];
  cout << ans << endl;
}

Measured memory_bytes: 49280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;

int main() {
    cout << setprecision(15) << fixed;
    double a, b, h, m; cin >> a >> b >> h >> m;
    double pi = 3.14159265358979323846;
    double min = 2 * pi * m / 60.;
    double hour = 2 * pi * h / 12.;
    hour += min / 12.;
    double arg = abs(min - hour);
    chmin(arg, 2*pi - arg);
    cout << sqrt(a*a + b*b - (double)2*a*b*cos(arg)) << endl;
}


Measured memory_bytes: 4164
#include<bits/stdc++.h> //Ithea Myse Valgulious
namespace chtholly{
typedef long long ll;
#define re0 register int
#define rec register char
#define rel register ll
#define gc getchar
#define pc putchar
#define p32 pc(' ')
#define pl puts("")
/*By Citrus*/
inline int read(){
  int x=0,f=1;char c=gc();
  for (;!isdigit(c);c=gc()) f^=c=='-';
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return f?x:-x;
  }
template <typename mitsuha>
inline bool read(mitsuha &x){
  x=0;int f=1;char c=gc();
  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';
  if (!~c) return 0;
  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');
  return x=f?x:-x,1;
  }
template <typename mitsuha>
inline int write(mitsuha x){
  if (!x) return 0&pc(48);
  if (x<0) x=-x,pc('-');
  int bit[20],i,p=0;
  for (;x;x/=10) bit[++p]=x%10;
  for (i=p;i;--i) pc(bit[i]+48);
  return 0;
  }
inline char fuhao(){
  char c=gc();
  for (;isspace(c);c=gc());
  return c;
  }
}using namespace chtholly;
using namespace std;
const int sanae=2e3;
typedef int fuko[sanae|15];
vector<int> lj[sanae|15];
fuko d[sanae|15];
struct edge{int u,v;}e[sanae|13];
void dfs(int p,int u,int fa){
d[p][u]=d[p][fa]+1;
for (int i:lj[u]) if (i^fa) dfs(p,i,u);
}

int main(){
int i,j,n=read(),k=read();
for (i=1;i<n;++i){
  int u=read(),v=read();
  lj[u].push_back(v);
  lj[v].push_back(u);
  e[i]=edge{u,v};
  }
for (i=1;i<=n;++i) dfs(i,i,0); 
int llx=9999;
if (k&1){
  for (i=1;i<n;++i){
    int tmp=0;
    for (j=1;j<=n;++j){
      if (min(d[e[i].u][j],d[e[i].v][j])>k/2+1) tmp++;
	  }
	llx=min(llx,tmp);
    }return write(llx);
  }
for (i=1;i<=n;++i){
  int tmp=0;
  for (j=1;j<=n;++j) if (d[i][j]>k/2+1) tmp++;
  llx=min(tmp,llx); 
  }write(llx);
} 

Measured memory_bytes: 16256
#include <iostream>
#include <string>
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) FOR(i,0,n)
 

int main(){
	
	int n;cin>>n;
	int ans =0;
	rep(i,n)
	{
		int l,r;cin>>l>>r;
		ans += r-l+1;
	}
	cout << ans<<endl;
}

//cout << ans << endl;

Measured memory_bytes: 256
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,k = f()
    s = set()
    for i in range(a, min(a+k, b)):
        s.add(i)
    

    for i in range(max(a,b+1-k), b+1):
        s.add(i)
    
    s = sorted(list(s))
    for i in s:
        print(i)

solve()


Measured memory_bytes: 3064
function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	//input = input.trim().split("\n");
	input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));
  	console.log(Math.max(input[0]*input[1],input[2]*input[3]));
}

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


Measured memory_bytes: 7372
#include <stdio.h>

char judge(int year, int month, int day);


int main (void)
{
	int year,month,day;
	char era;
	while (scanf("%d %d %d", &year, &month, &day) != EOF) {
		era = judge(year, month, day);
		if (era == 'p') {
			printf("pre-meiji\n");
		}else if (era == 'm') {
			printf("meiji %d %d %d\n", year - 1867, month, day);
		}else if (era == 't') {
			printf("taisho %d %d %d\n", year - 1911, month, day);
		}else if (era == 's') {
			printf("showa %d %d %d\n", year - 1925, month, day);
		}else if (era == 'h') {
			printf("heisei %d %d %d\n", year - 1988, month, day);
		}
	}
	return 0;
}

char judge(int year, int month, int day)
{
	//pre-meiji or meiji
	if (year < 1868) {
		return 'p';
	}else if (year == 1868) {
		if (month < 9) {
			return 'p';
		}else if (month == 9) {
			if (day < 8) {
				return 'p';
			}else{
				return 'm';
			}
		}else{
			return 'm';
		}
	}else if (year < 1912) {
	//meiji or taisho
		return 'm';
	}else if (year == 1912) {
		if (month < 7) {
			return 'm';
		}else if (month == 7) {
			if (day < 30) {
				return 'm';
			}else{
				return 't';
			}
		}else{
			return 't';
		}
	}else if (year < 1926) {
	//taisho or showa
		return 't';
	}else if (year == 1926) {
		if (month < 12) {
			return 't';
		}else if (month == 12) {
			if (day < 25) {
				return 't';
			}else{
				return 's';
			}
		}else{
			return 's';
		}
	}else if (year < 1989) {
		return 's';
	}else if (year == 1989) {
		if (month == 1) {
			if (day < 8) {
				return 's';
			}else{
				return 'h';
			}
		}
		return 'h';
	}else{
		return 'h';
	}
}

Measured memory_bytes: 1036
S = str(input())  # ?が入っている文字列
T = str(input())  # 部分文字列

# 2重ループで大丈夫

index = None
for i in range(len(S)):
    if S[i] == T[0] or S[i] == '?':
        # ループを始める
        start = i
        cnt = 0
        for j in range(i, min(len(T)+i, len(S))):
            if S[j] == T[j-i] or S[j] == '?':
                cnt += 1
            else:
                break

        if cnt == len(T):
            index = start  # 保存しておく

if index != None:
    i = 0
    ans = ""
    while len(S) > i:
        if i != index:
            if S[i] == '?':
                ans += 'a'
            else:
                ans += S[i]
            i += 1
        elif i == index:
            ans += T
            i += len(T)

    print(ans)
else:
    print("UNRESTORABLE")


Measured memory_bytes: 3064
#include<stdio.h>
int main(void){
	int width, height, x, y, r;

	scanf("%d %d %d %d %d", &width, &height, &x, &y, &r);

	if (x - r < 0 || x + r > width){
		printf("No\n");
	}
	else if(y - r < 0 || y + r > height){
		printf("No\n");
	}
	else{
		printf("Yes\n");
	}

	return 0;
}

Measured memory_bytes: 584
import numpy as np


# ユークリッドの互除法
def ea(x, y):
    if x < y:
        x, y = y, x
    while x % y != 0:
        x = x % y
        x, y = y, x
    return y


# 素因数分解
def pf(x, p):
    for i in range(2, int(np.sqrt(x)) + 1):
        cnt = 0
        while x % i == 0:
            x /= i
            cnt += 1
        if cnt != 0:
            p.append([i, cnt])
    if x != 1:
        p.append([int(x), 1])


A, B = map(int, (input().split()))
p = []

gcd = ea(A, B)
pf(gcd, p)

ans = 0

p.insert(0, [1, 1])

for i in range(len(p)):
    ans += 1

# print(p)
print(ans)


Measured memory_bytes: 21628
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    long long int a,b;
    cin >> a >> b;
    long long int g = __gcd(a,b);
      long long int x = b/g;
      long long int y = a/g;
      long long int d = a*x;
      cout << d << endl;
    return 0;
}


Measured memory_bytes: 256
/*
 * Author : Sadi
 * Wed 01/07/2020
 * 19:17:30.14
 */
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <cassert>

using namespace std;

#define    watch(x); cout << "\n" <<  #x << " is: " << x << "\n";
#define    all(a) (a).begin(), (a).end()
#define    fi first
#define    se second

template<class A, class B>
ostream& operator << (ostream& output, const pair<A, B>& p) {
    output << "(" << p.first << ", " << p.second << ")";
    return output;
}

template<class A>
ostream& operator << (ostream& output, const vector<A>& a) {
    output << "[";
    for(auto it = a.begin(); it != a.end(); ++it) {
        if(it != a.begin()) {
            output << ", ";
        }
        output << *it;
    }
    output << "]";
    return output;
}

using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;

//const int inf = 1e9;
//const int mod = 1e9 + 7;
//const double PI = acos(-1.0);
//const int mx = 1e5 + 5;



int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE

    string s, t;
    cin >> s;
    cin >> t;
    vector<int> a(30), b(30);
    for(int i = 0; i < (int) s.size(); ++i) {
        int idxa = s[i] - 'a';
        int idxb = t[i] - 'a';
        a[idxa]++;
        b[idxb]++;
    }
    sort(all(a));
    sort(all(b));
    if(a == b) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3732
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int,int,int> T;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
#define mp make_pair
const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

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

using Graph = vector<vector<pair<int, int>>>;
using Ki = vector<vector<int>>;
using vec = vector<int>;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);
    //---------------------------------------------
    
    int n;
    cin>>n;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    ll sum=0;
    rep(i,60){
        ll x=0;
        rep(k,n){
            if(a[k]>>i & 1){
                x++;
            }
        }
        ll m=x*(n-x)%MOD;
        rep(j,i){
            m=m*2%MOD;
        }
        sum+=m%MOD;
        sum%=MOD;
    }
    cout<<sum<<endl;

    
}

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

int main() {
  int N;
  string S;
  bool b = false;
  cin >> N;
  
  for (int i=0; i<N; i++){
    cin >> S;
    if (S == "Y") {
      b = true;
    }
  }
  if(b) cout << "Four" << endl;
  else cout << "Three" << endl;
}

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

namespace ABC_C
{
    class C071
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            Dictionary<int, int> dic = new Dictionary<int, int>();
            foreach(string a in s)
            {
                int i = int.Parse(a);
                if (!dic.ContainsKey(i)) dic.Add(i, 0);
                dic[i]++;
            }

            var v = dic.Where(x => x.Value >= 2).OrderByDescending(x => x.Key).ToList();
            long Srec=0;
            if (v.Count == 0)
            {
                Srec = 0;
            }
            else if (v[0].Value >= 4)
            {
                Srec = (long)v[0].Key * v[0].Key;
            }
            else if(v.Count==1)
            {
                Srec = 0;
            }
            else
            {
                Srec = (long)v[0].Key * v[1].Key;
            }
            Console.WriteLine(Srec);
        }
    }
}


Measured memory_bytes: 22496
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.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; }

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

int main() {
  int n,d;
  cin>>n>>d;
  
  vector<vector<int>> vec(n,vector<int>(d));
  rep(i,n){
    rep(j,d){
      cin>>vec[i][j];
    }
  }
  
  int cnt=0;
  
  rep(i,n){
    rep(j,n){
      double sum =0;
      rep(k,d){
        double x = pow((vec[i][k]-vec[j][k]),2);
        sum +=x;
      }
      sum = sqrt(sum);
      if(ceil(sum)==floor(sum)) cnt++;
    }
  }
  
  cout << (cnt-n)/2 <<endl;
  
  return 0;
}

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

public class Test
{
	public static void Main()
	{
		// your code goes here
		
		var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
		
		int r = a[0];
		int d = a[1];
		int[] xx = new int[11];
		xx[0] = a[2];
		
		for(int b=0; b!=10; b++){
			
			xx[b+1] = r*xx[b]-d ;
			
		}
		
		Console.WriteLine(xx[1] + "\n" + xx[2] + "\n" + xx[3] + "\n" + xx[4] + "\n" + xx[5] + "\n" + xx[6] + "\n" + xx[7] + "\n" + xx[8] + "\n" + xx[9] + "\n" + xx[10]);
		
	}
}

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

using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	int count = 1;
	vector<int> a(n);
	for (auto&& ai : a) cin >> ai;
	
	vector<bool> check(n, false);
	for (int i = 0; a[i] != 2; i = a[i]-1)
	{
		if (check[i])
		{
			count = -1;
			break;
		}
		count++;
		check[i] = true;
	}

	cout << count << endl;
	return 0;
}


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

#define rep(i,n) for(signed i=0;i<(n);++i)
//#define int long long
#define str string
#define debg(a) cout<<#a<<":"<<a<<endl;
#define print(a) cout<<a<<endl;
#define end cout<<endl;
#define elif else if


int a,b,c,i,j,k,n,m,x,y,z;
str s,t;
vector<signed> v;

signed main(){
  int n;
  cin>>n;
  int x[n],y[n],h[n];
  rep(i,n)cin>>x[i]>>y[i]>>h[i];
  int p=0;
  rep(i,n)if(!p&&h[i])p=i;
  int cx,cy,H;
  bool ans=true;
  // h=max(H-abs(x-cx)-abs(y-cy),0);

  for(cx=0;cx<101;++cx){
    for(cy=0;cy<101;++cy){
      H=abs(cx-x[p])+abs(cy-y[p])+h[p];
      ans=true;
      rep(i,n){
        if(h[i]!=max(H-abs(x[i]-cx)-abs(y[i]-cy),0))ans=false;
      }
      if(ans){
        printf("%d %d %d\n",cx,cy,H);
        return 0;
      }
    }
  }

  
  return 0;
}

Measured memory_bytes: 256
import static java.util.Arrays.deepToString;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}

	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc = new Scanner(System.in);

	public void run() {
		for (; sc.hasNext();) {
			int q1 = sc.nextInt();
			if (q1 == 0)
				break;
			int b = sc.nextInt();
			int c1 = sc.nextInt();
			int c2 = sc.nextInt();
			int q2 = sc.nextInt();
			
			int BUY1U = Math.min(b / c1, q2);
			int ansBuy1 = -1;
			for (int buy1 = 1; buy1 <= BUY1U; buy1++) {
				int buy2 = (b - c1 * buy1) / c2;
				if (buy1 > 0 && buy1 + buy2 >= q1) {
					ansBuy1 = buy1;
				}
			}
			
			if (ansBuy1 == -1) System.out.println("NA");
			else {
				int buy2 = (b - c1 * ansBuy1) / c2;
				System.out.println(ansBuy1 + " " + buy2);
			}
		}
	}
}

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;


// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, x, m, y, k, z, N;
string s, t, d, c;


// <------------- Implement Functions Here ----------> //

vector<string> transpose(vector<string> a) {
	vector<string> b;
	for(ll i=0;i<m;i++) {
		c="";
		for(ll j=0;j<a.size();j++) {
			c+=a[j][i];
		}
		if(c != t) b.pb(c);
	}
	return b;
}

// <------------- Start of main() -------------------> //

void MAIN() {
	cin >> n >> m ;
	s = string(m,'.');

	vector<string> a,b;
	for(ll i=0;i<n;i++) {
		cin >> d;
		if(d != s) a.pb(d);
	}
	t = string(a.size(),'.');
	b = transpose(a);

	for(ll i=0;i<b[0].size();i++) {
		for(ll j=0;j<b.size();j++) {
			cout<<b[j][i];
		}
		newl;
	}
}

int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {
		MAIN();
	}
	return 0;
}


Measured memory_bytes: 3616
using namespace std;
#include <bits/stdc++.h>
#define fdto(i, r, l) for(int i = r; i >= l; --i)
#define fto(i, l, r) for(int i = l; i <= r; ++i)
#define forit(it, type, var) for(type::iterator it = var.begin(); it != var.end(); it++)
#define ii pair<int, int>
#define iii pair<int, ii>
#define MEMS(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define m_p make_pair
#define pb push_back
#define ll long long
#define ld long double
typedef pair<ll, ll> iPair; 
priority_queue< ll, vector <ll> , greater<ll>>pq1,pq2;
#define maxN 1000000000000000000
ll power(ll a,ll b){ll res=1;while(b>0){res*=a;b--;}return res;}
int main()
{
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,i,ans,arr[200005],cnt=0;
    queue<ll>q;
    cin>>n;
    for(i=0;i<n;i++)
    cin>>arr[i];

    sort(arr,arr+n);

    ans=arr[n-1];
    q.push(arr[n-2]);

    for(i=n-3;i>=0;i--)
    {
        if(cnt==2)
        {
            q.pop();
            cnt=0;
        }
        
            ll a=q.front();
            ans+=a;
            cnt++;
        
        q.push(arr[i]);
    }
    cout<<ans<<endl;
    return 0;
}


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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i < (ll)(n); i++)
#define INF 1000000000000
#define MOD 1000000007
using ll = long long;

int main(){
  string s;
  int k;
  cin >> s >> k;
  int len = s.size();

  
  set<string> jisho;
  for(int l = 1; l <= min(k,len); l++){//長さ
    for(int i = 0; i < len-l+1; i++){
      string tmp = "";
      for(int j = 0; j < l; j++){
        tmp = tmp + s.at(i+j);
      }
      jisho.insert(tmp);
    }
  }
  int cnt = 0;
  for(auto str: jisho){
    cnt++;
    if(cnt==k){
      cout<<str<<endl;
      return 0;
    }
  }
  
  return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define INF 1e9
using namespace std;
int memo[52][52][52][52][2][3],n,m,a[51],b[51],sa[51],sb[51],used[52][52][52][52][2][3];
 
int dfs(int x,int y,int sx,int sy,bool turn,int pass,int suma,int sumb){
  int dif=suma-sumb;
  if(pass==3) return dif;
  int p,q;
  if(used[x][y][sx][sy][turn][pass])return memo[x][y][sx][sy][turn][pass]+dif;
  used[x][y][sx][sy][turn][pass]=1;
  q=dfs(x,y,x,y,!turn,pass+1,suma+sa[x-1]-sa[sx-1],sumb+sb[y-1]-sb[sy-1])-dif;
  if(turn){
    p=-INF;
    if(x<=n){
      if(a[x]) p=dfs(x+1,y,sx,sy,0,0,suma,sumb)-dif;
      else p=dfs(x+1,y,sx,y,0,0,suma,sumb)-dif;
    }
    memo[x][y][sx][sy][turn][pass]=max(p,q);
    return dif+max(p,q);
  }
  else {
    p=INF;
    if(y<=m){
      if(b[y]) p=dfs(x,y+1,sx,sy,1,0,suma,sumb)-dif;
      else p=dfs(x,y+1,x,sy,1,0,suma,sumb)-dif;
    }
    memo[x][y][sx][sy][turn][pass]=min(p,q);
    return dif+min(p,q);
  }
}
 
int main(){
  cin>>n>>m; 
  for(int i=1;i<=n;i++){
    cin>>a[i];
    if(a[i]<0)a[i]=0;
    sa[i]=sa[i-1]+a[i];
  }
  for(int i=1;i<=m;i++){
    cin>>b[i];
    if(b[i]<0)b[i]=0;
    sb[i]=sb[i-1]+b[i];
  }
  cout<<dfs(1,1,1,1,1,1,0,0)<<endl;
  return 0;
}

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

int main(){
    int n,k;
    cin >> n >>k;
    vector <ll> h(n);
    rep(i,n){
        cin >> h[i];
    }

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

    ll ans;
    ans=0;
    rep(i,n-k){
        ans+=h[i];
    }



    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include <cmath>
#include<vector>
#define rep(i, n) for (int i=0;i<n;i++)
#include <map> 
#include<algorithm>
using namespace std;

int main(void){
    int n;
    cin>>n;
    int array[n];
    rep(i, n){
        cin>>array[i];
    }
    
    int ans[n];
    int a=0;
    rep(i, n){
        int tmp=array[i];
        if(i%2==1){
            tmp*=-1;
        }
        a+=tmp;
    }
    ans[0]=a;
    
    for(int i=1;i<n;i++){
        ans[i]=2*(array[i-1]-ans[i-1]/2);
    }
    rep(i, n){
        cout<<ans[i]<<endl;
    }
}

Measured memory_bytes: 2048
class UnionFindVerSize:
    def __init__(self, n):
        # 親要素のノード番号を格納　par[x]==xのときそのノードは根 1からn
        self.par = [i for i in range(n + 1)]
        # 木のサイズを格納
        self.size = [1] * (n + 1)

    def find(self, x):
        # 根ならその番号を返す
        if self.par[x] == x:
            return x
        else:
            # 親の親は親
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def is_same(self, x, y):
        # 根が同じならTrue
        return self.find(x) == self.find(y)

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y: return

        # 木のサイズを比較し、小さいほうから大きいほうへつなぐ
        if self.size[x] < self.size[y]:
            self.par[x] = y
            self.size[x] += self.size[y]
        else:
            self.par[y] = x
            self.size[y] += self.size[x]

    def get_size(self, x):
        return self.size(self.find(x))

    def get_group_num(self):
        ans = 0
        for i in range(1, len(self.par)):
            if self.find(i) == i:
                ans += 1
        return ans

N, M = map(int, input().split())
query = []
for i in range(M):
    query.append(list(map(int, input().split())))

ans = 0
for ignore in range(0, M):
    union = UnionFindVerSize(N)
    for i, q in enumerate(query):
        if i == ignore:
            continue
        union.unite(q[0], q[1])

    if union.get_group_num() >= 2:
        ans += 1

print(ans)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int pat(int a, int b, int c) {
    return a*10+b+c;
}

int main(int argc, char const *argv[])
{
    int a,b,c; cin >> a >> b >> c;
    int z = 0;
    z = max(z, pat(a,b,c));
    z = max(z, pat(a,c,b));
    z = max(z, pat(b,a,c));
    z = max(z, pat(b,c,a));
    z = max(z, pat(c,a,b));
    z = max(z, pat(c,b,a));
    cout << z << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000009
#define ll long long
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define set0(a) memset ((a), 0 , sizeof(a))
#define set1(a) memset((a),-1,sizeof (a))
#define pi pair<int, int>
#define ps pair<string, string>
#define pl pair<long, long>
#define pll pair<long long, long long>
#define vll vector<long long>
#define vl vector<long>
#define vi vector<int>
#define vs vector<string>
#define vps vector< ps >
#define vpi vector< pi >
#define vpl vector< pl >
#define vpll vector< pll >
#define flash  ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tc(t,T) for(long long t=0;t<T;t++)
#define rep(i,s,n,d) for(long long i=s;i<n;i=i+d)

bool sortbysec(const pll &a,
              const pll &b)
{
    return (a.second < b.second);
}
/*bool cxp pair<ll, pll> &a,
              const pair<ll, pll> &b)
{
    return (a.ff < b.ff);
}*/

void func(void)
{
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    else return gcd(b,a%b);
}
void printStack(stack<string> s){
    if(s.empty())return;

    string x=s.top();
    s.pop();
    printStack(s);
    cout<<x;
    s.push(x);

}


ll binaryexp(ll n,ll p){

    if(p==0) return 1;
    if(p%2==0) return binaryexp((n%mod)*(n%mod),p/2);
    else return ((n%mod)*binaryexp(((n%mod)*(n%mod))%mod,(p-1)/2)%mod);

}

#define meax 10000001
vll spf(meax,0);
void siv(){
    spf[1]=1;

   for(ll i=2;i<meax;i++)spf[i]=i;

   for(ll i=4;i<meax;i+=2){
        spf[i]=2;
    }
    for(ll i=3;i*i<meax;i++){
        if(spf[i]==i){
            for(ll j=i*i;j<meax;j+=i){
                if(spf[j]==j){
                    spf[j]=i;
                }
            }
        }
    }
}


int main(){
    ll k,n;
    cin>>k>>n;
    ll flag=1;
    for(int i=0;i<=k;i++){
        ll rest=n-i*10000;
        if(rest>=0)
            for(int j=0;j<=k-i;j++){
                ll rest2=rest-j*5000;
                if(rest2>=0){
                    if(rest2%1000==0){
                        if(rest2/1000<=k-j-i){
                            if(i+j+rest2/1000==k){
                            cout<<i<<" "<<j<<" "<<rest2/1000<<endl;
                            flag=0;
                            break;
                            }
                        }
                    }
                }

            }
            if(flag==0)break;
        }
        if(flag==1){
            cout<<"-1 -1 -1\n";
        }
    }




Measured memory_bytes: 81172
#include <bits/stdc++.h>
#include <math.h>
#include <chrono>
using namespace std;
#pragma GCC optimize("-O3")
#define endl "\n"
#define mp make_pair
#define st first
#define nd second
#define pii pair<int, int>
#define pb push_back
#define _upgrade ios_base::sync_with_stdio(0), cout.setf(ios::fixed), cout.precision(10) //cin.tie(0); cout.tie(0);
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FWD(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define fwd(i, a, b) for (int i = (a); i < (b); ++i)
#define all(c) (c).begin(), (c).end()
#define what(x) cerr << #x << " is " << x << endl;
main()
{
    _upgrade;
    int n;
    cin >> n;
    string S;
    cin >> S;
    int wynik = 0;
    for (int i = 1; i < n; i++)
        if (S[i] == 'E')
            wynik++;
    int mini = wynik;
    for (int i = 1; i < n; i++)
    {
        if (S[i] == 'E')
            wynik--;
        if (S[i - 1] == 'W')
            wynik++;
        mini = min(wynik, mini);
    }
    cout << mini << endl;
}

Measured memory_bytes: 720
#include <stdio.h>

int main(void) {
	int x, y;
	
 while(1){
		scanf("%d %d", &x, &y);
		
		if(x==0 && y==0) break;
		
		if(x>y){
			printf("%d %d\n", y, x);
		}
		else printf("%d %d\n", x, y);
		}
	
	
		
	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */

signed main(){
   IOS;
   int n; cin >> n;
   vector<int> a(n);
   for(auto &it : a) cin >> it;
   sort(a.rbegin(), a.rend());
   int ans = 0;
   vector<int> v;
   for(int i = 0; i < (n+1)/2; i++) {
      if(i != 0) ans += v[i-1];
      v.push_back(a[i]);
   }  
   for(int i = (n+1)/2; i < n; i++) {
      int j = i - (n+1)/2;
      ans += min(v[j], v[(j+1)%v.size()]);
      // cout << v[j] << " " << v[(j+1)%v.size()] << "\n";
   }
   cout << ans << "\n";
}

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

int main() {
	int N, H, cnt, max, pre;
	cin >> N;
	cnt = 0;
	max = 0;
	pre = 0;
	for (int i = 1; i <= N; i++){
		cin >> H;
		if(pre >= H){
			cnt++;
			if(max < cnt){
				max = cnt;
			}
		}else{
			cnt = 0;
		}
		pre = H;
	}
	cout << max << endl;
}


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

using namespace std;

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

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

    int A;
    int ans = 0;
    REP(0, i, N) {
        cin >> A;
        ans += A;
    }

    cout << ans - N << endl;

    return 0;
}


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

int main() {

  int a,b; cin >> a >> b;
  if (a==b){
    for(int i=0; i<a; i++){
      cout << b;
    } 
  }else if(a>b){
    for(int i=0; i<a; i++){
      cout << b;
    }
  } else if (b>a){
    for(int i=0; i<b; i++){
      cout << a;
    }
  }
  
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
  val K = readLine()!!.toInt()
  var m = 0
  var ans = -1
  for (i in 1..K) {
      m = (10 * m + 7) % K
      if (m == 0) {
          ans = i
          break
      }
  }
  println(ans)
}


Measured memory_bytes: 34636
s = gets.chomp

def y(f)
  puts f ? "Yes" : "No"
end

class String
  # 文字列が回文であればtrueを返す
  def palindrome?
    self == self.reverse
  end
end
 
n = s.size
# 1つ目、2つ目の条件を満たせば、3つ目も満たす
y(s.palindrome? && s[0,(n-1)/2].palindrome?)

Measured memory_bytes: 1788
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        while(true){
            int n = scan.nextInt();
            if(n == 0 )break;
            int sum = 0, min = 1000, max = 0;
            for(int i = 0;i < n;i++){
                int x = scan.nextInt();
                sum += x;
                if(min > x)min = x;
                if(max < x)max = x;
            }
            sum = sum - min - max;
            System.out.println(sum/(n-2));
        }
        
        scan.close();
    }

    

}


Measured memory_bytes: 28840
n = int(input())
PriceList = list(map(int, input().split()))
poss = 1000
stock = 0
basis = PriceList[0]
for price in PriceList:
    if basis > price:
        basis = price
    if basis < price:
        # 株の購入
        stock = stock + poss // basis
        poss = poss % basis
        basis = price
        # 株の売却
        poss = poss + stock * price
        stock = 0
print(poss)

Measured memory_bytes: 9000
#include <iostream>

using namespace std;

int ssort(int a[],int n){
    int minj,i,j,sw=0;
    for(i=0;i<n-1;i++){
        minj=i;
        for(j=i;j<n;j++){
            if(a[j]<a[minj])minj=j;
        }
        swap(a[i],a[minj]);
        if(i!=minj)sw++;
    }
    return sw;
}
int main()
{
    int n;
    cin >>n;
    int a[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    int co=ssort(a,n);
    for(int i=0;i<n;i++){
        if(i!=0)cout<<" ";
        cout <<a[i];
    }
    cout << endl;
    cout << co<< endl;
    return 0;
}



Measured memory_bytes: 3124
import std.stdio;

void main() {
  auto a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51];
  uint k;
  
  readf(" %s", &k);
  
  writeln(a[k - 1]);
}


Measured memory_bytes: 256
n = int(input())
p = 0
ans = 0
for i in range(n):
    a,b = map(int,input().split())
    if a == b:
        p += 1
    else:
        ans = max(p,ans)
        p = 0
if max(p,ans) >= 3:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 62516
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
  int h,w;
  while(1){
    cin >> h >> w;
    if(h == 0 && w == 0) break;
    for(int i = 0; i < h; i++){
      if(i % 2 == 0){
        for(int j = 0; j < w; j++){
          if(j % 2 == 0){
            cout << "#";
          }else{
            cout << ".";
          }
        }
      }else{
        for(int j = 0; j < w; j++){
          if(j % 2 == 0){
            cout << ".";
          }else{
            cout << "#";
          }
        }
      }
    cout << endl;

    }
    cout << endl;
  }
  return 0;
}



Measured memory_bytes: 3080