akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FASTIO
using namespace std;

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

template <typename T1, typename T2>
bool chmin(T1& a, const T2& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <typename T1, typename T2>
bool chmax(T1& a, const T2& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

class Prints {
private:
    class __Prints {
    public:
        __Prints(const char* sep, const char* term) : sep(sep), term(term) {}
        template <class... Args>
        void operator()(const Args&... args) const { print(args...); }

    private:
        const char *sep, *term;
        void print() const { std::cout << term; }
        void print_rest() const { std::cout << term; }
        template <class T, class... Tail>
        void print(const T& head, const Tail&... tail) const { std::cout << head, print_rest(tail...); }
        template <class T, class... Tail>
        void print_rest(const T& head, const Tail&... tail) const { std::cout << sep << head, print_rest(tail...); }
    };

public:
    Prints() {}
    __Prints operator()(const char* sep = " ", const char* term = "\n") const { return __Prints(sep, term); }
};

Prints prints;

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll X, t;
    cin >> X >> t;
    prints()(max(X - t, 0ll));
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(nullptr), cout.tie(nullptr);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    cout << setprecision(18) << fixed;
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
	
using namespace std;
	
#define endl "\n"
#define ll unsigned long long
#define int long long
#define vi vector <int >
#define vii vector < pii >
#define vll vector <ll >
#define pii pair <int, int>
#define pdd pair< double, double>
#define piii pair < pii, int > 
#define pll pair<ll, ll >
#define umap unordered_map
#define pb push_back
#define pq priority_queue
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define rep(i,b,c) for(int i = (int)b; i < (int)c; i++)
#define a first
#define b second

int32_t main() {
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

	int n, k;
	cin >> n >> k;
	vi dp(k + 2);
	vi arr(n);
	for(int i = 0; i < n; i++){
		cin >> arr[i];
	}
	dp[0] = 0;
	int x = k + 1;
	for(int i = 1; i <  n; i++){
		dp[i%x] = INT_MAX;
		for(int j = i - 1; j >= 0 && i - j <= k; j--){
			dp[i%x] = min(dp[i%x], dp[j%x] + abs(arr[i] - arr[j]));
		}
	}
	cout << dp[(n - 1)%x] << endl;

	return 0;
}

Measured memory_bytes: 1024
a,b = (int(x) for x in input().split())
s = input()
num = 0

for i in s:
    if i == '-':
        continue
    elif int(i)>= 0 and int(i)<= 9:
        num += 1
    
    

if a + b == num and s[a] == '-':
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;

int bitCount[1024];
void setup(){
	for(int i=0;i<1024;i++){
		int c=0;
		int v=i;
		while(v){
			c+=v&1;
			v>>=1;
		}
		bitCount[i]=c;
	}
}
int table[10000];
int Count[1024];
int R,C;
void exec(){
	cin >> R >> C;
	if(R==0&&C==0){
		exit(0);
	}
	for(int j=0;j<C;j++){
		table[j]=0;
	}
	for(int k=0;k<(1<<R);k++){
		Count[k]=0;
	}
	for(int i=0;i<R;i++){
		for(int j=0;j<C;j++){
			char c;
			cin >> c;
			table[j]<<=1;
			if(c=='1'){
				table[j]+=1;
			}
		}
	}
	for(int j=0;j<C;j++){
		Count[table[j]]++;
	}
	int m=0;
	for(int i=0;i<(1<<(R-1));i++){
		int t=0;
		for(int j=0;j<(1<<R);j++){
			int c=bitCount[i^j];
			t+=Count[j]*max(c,R-c);
		}
		m=max(t,m);
	}
	cout << m << endl;
}
int main() {
	setup();
	while(1){
		exec();
	}
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  // ll n;
  // cin >> n;
  ll n, m;
  cin >> n >> m;

  ans = abs(abs(n) - abs(m));
  // sign is the same 
  if((n >= 0) == (m >= 0)) {
    if(n > m) {
      ans += 2;
      if(min(abs(n), abs(m)) == 0)
        ans--;
    }
  }
  else {
    if(m != 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long W = sc.nextLong();
    long[] w = new long[n];
    int[] v = new int[n];
    for(int i = 0; i < n; i++) {
      w[i] = sc.nextLong();
      v[i] = sc.nextInt();
    }
    long[][] dp = new long[n][100001];
    for(int i = 0; i < n; i++) {
      for(int j = 1; j < 100001; j++) {
        dp[i][j] = (long)Math.pow(10, 12); 
      }
    }
    dp[0][v[0]] = w[0];
    for(int i = 1; i < n; i++) {
      for(int j = 0; j < 100001; j++) {
        if((j - v[i]) >= 0) {
          if((j - v[i]) == 0) {
            dp[i][j] = Math.min(w[i], dp[i - 1][j]);
          } else {
            dp[i][j] = Math.min(w[i] + dp[i - 1][j - v[i]], dp[i - 1][j]);
          }
        } else {
          dp[i][j] = dp[i - 1][j];
        }
      }
    }
    int ans = 0;
    for(int i = 100000; i > 0; i--) {
      if(dp[n - 1][i] <= W) {
        ans = i;
        break;
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 127628
#include <bits/stdc++.h>
#include <math.h>//pow(x,y)=x^y
#include <algorithm>//sort(a.begin(), a.end());reverse(a.begin(), a.end());
#define rep(i,n) for (int i=0; i <(n);i++)
#define ll long long
using namespace std;

int main() {
double B;
ll A;
int C;
cin>>A>>B;
C = B*100+0.5;

ll R;
R = A*C/100;
if(A==0 || B==0){
cout << 0 << endl;
}else{
  cout << R << endl;
}

}


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

int n, ans;
string s;

int main() {
    cin >> n >> s;
    int l = 0, r = n-1;
    while (l < r){
        while (l < n && s[l] != 'W') l++;
        while (r >= 0 && s[r] != 'R') r--;
        if (l < r){
            ans++;
            l++;
            r--;
        }
    }
    cout << ans << "\n";
}



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

int main(void){
	int N;
	cin >> N;
	vector<int> A(N);
	for(int i=0;i<N;i++){
		cin >> A[i];
	}

	long long cnt = 0;
	for(int i=0;i<N;i++){
		cnt += A[i] / 2;
		A[i] %= 2;
		if(A[i] == 1 && i != N-1 && A[i+1] > 0){
			cnt++;
			A[i+1]--;
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    String a = sc.next();

    if( Character.isUpperCase( a.charAt( 0 ) ) ) {
        System.out.println("A");
    }
    else {
        System.out.println("a");
    }

    
    

    


    
    


    


    
    


    
	}
}

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

int main()
{
    string S ;
    getline (cin, S);
    if (S[0] != S[1]) {
        if (S[1] != S[2]){
            if (S[2] != S[3]) {
                cout<< "Good";
            }
            else {
                cout<< "Bad";
            }
        }
        else {
            cout<< "Bad";
        }
    }
    else {
        cout<< "Bad";
    }

    return 0;
}


Measured memory_bytes: 3604
import Control.Applicative
import Data.List

main :: IO()
main = do
  n <- readLn :: IO Int
  as <- map read . lines <$> getContents :: IO [Integer]

  print $ (sum . map ((`div` 2) . sum) . filter (notElem 0) . groupBy (\a b -> a /= 0 && b /= 0)) as


Measured memory_bytes: 12668
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <math.h>
#include <algorithm>
#include <deque>
#include <climits>
using namespace std;
#define rep(i,l,r) for(int (i)=(int)(l);(i)<(int)(r);(i)++)
#define ll long long
#define ve vector
#define umap unordered_map
#define iter iterator


int main() {
    int n;
    string s;
    cin>>n>>s;
    int x=0, m=0;
    rep(i,0,n) {
        if(s[i]=='I')x++;
        else if(s[i]=='D')x--;
        m=max(m,x);
    }
    cout<<m<<endl;
    return 0;
}

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

#define max(a,b) ((a) < (b) ? (b) : (a))
#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
	int N, M, L, R, max_L = 0, min_R = 100001;
	
	scanf("%d %d", &N, &M);
	for (int i = 0; i < M; i++) {
		scanf("%d %d", &L, &R);
		max_L = max(max_L, L);
		min_R = min(min_R, R);
	}
	
	if (min_R - max_L >= 0)
		printf("%d\n", min_R - max_L + 1);
	else
		printf("0\n");
	
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int red,green,blue;
	int ways=0;
	int N;
	cin>>red>>green>>blue>>N;
	for(int i=0;i<=N;i+=red)
	{
		for(int j=0;j<=N;j+=green)
		{
			if((N-i-j)%blue==0&&(N-i-j)/blue>=0)
			{
				ways++;
			}
		}
	}
	cout<<ways;
	return 0;
}

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

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0)

#define MOD 1000000007 

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

    int* A;
    NEW(A,1e5+2);
    for(int i=0;i<1e5+2;i++) A[i]=0;

    for(int i=0;i<N;i++){
        int a;
        scanf("%d",&a);
        A[a]++;
    }

    int ans=0;
    for(int i=1;i<=1e5;i++){
        ans=MAX(ans,A[i-1]+A[i]+A[i+1]);
    }
    printf("%d\n",ans);

    return 0;
}

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

using namespace std;

using ll = long  long;

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

    ll n,m;

    cin >> n >> m;

    for(ll i=0; i<m; i++){
        ll a;
        cin >> a;
        n -= a;
    }

    if(n<0)
        n = -1;

    cout << n << endl;

    return 0;
}

Measured memory_bytes: 3652
package main

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

func main() {
        var a, b, c, d, e, f float64
        sc := bufio.NewScanner(os.Stdin)
        for sc.Scan() {
                fmt.Sscanf(sc.Text(), "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f)

                det := a*e - b*d
                x := (e*c - b*f) / det
                y := (a*f - c*d) / det
                if x == 0.0 {
                        x = math.Abs(x)
                }
                if y == 0.0 {
                        y = math.Abs(y)
                }
                fmt.Printf("%.3f %.3f\n", x, y)
        }
}



Measured memory_bytes: 1132
import java.util.*;
public class Main {
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int a[] = new int[4], b[] = new int[4];
            for(int i=0; i<4; i++) a[i] = in.nextInt();
            for(int i=0; i<4; i++) b[i] = in.nextInt();
            System.out.println(countHit(a,b) + " " + countBlow(a,b));
        }
    }
    static int countHit(int[] a,int[] b){
        int cnt=0;
        for(int i=0;i<4;i++)if(a[i]==b[i])cnt++;
        return cnt;
    }
    static int countBlow(int[] a,int[] b){
        int cnt=0;
        for(int i=0;i<4;i++)if(a[i]!=b[i])
            for(int j=0;j<4;j++)if(i!=j&&a[i]==b[j]){
                cnt++;
                break;
            }
        return cnt;
    }
}
//by Tuvshee 12.05.2012

Measured memory_bytes: 12000
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int all = (int)Math.pow(3,n);
    
    int count = 0;

    for(int i = 0 ; i < n ; ++i){
      int a = sc.nextInt();
      
      if(a%2==0){
        count++;
      }
         
    }
    int num = (int)Math.pow(2,count);
    
    System.out.println(all-num);
    
  }
}

Measured memory_bytes: 35712
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = []
ans = 0
for _ in range(N):
    A.append(list(map(int, input().split())))
for i in range(N):
    tmp = 0
    for j in range(M):
        tmp += A[i][j]*B[j]
    else:
        tmp += C
        if tmp > 0:
            ans += 1
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
 
#define mod 1000000007
#define inf 1000000000
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

int main(){
  ll r;
  cin >> r;
  cout << r * r << endl;
  return 0;
}

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

using namespace std;

#define MAX_CARD_NUM  13
#define MARK_TYPE_NUM 4

// Structure for card
typedef struct card{
	char mark;							// 'S', 'H', 'C', 'D'
	int  num;							// 1 to 13
	int  existFlg = 0;					// 1: Exist,  0: Not exist
}t_card;

// Prototype define
void SetExistFlg(t_card *cardList, char *markList, char inMark, int inNum);

int main()
{
	int    existCardNum;				// 1 to 52
	char   markList[] = "SHCD";
	t_card cardList[MAX_CARD_NUM * MARK_TYPE_NUM];
	char   inMark;						// Inputed mark
	int    inNum;						// Inputed number
	
	// Initialize structure.
	for(int i = 0; i < MARK_TYPE_NUM; i++)
	{
		for(int j = 0; j < MAX_CARD_NUM; j++)
		{
			cardList[i * MAX_CARD_NUM + j].mark = markList[i];
			cardList[i * MAX_CARD_NUM + j].num  = j + 1;
		}
	}
	
	// Get exist card num.
	cin >> existCardNum;
	
	// Get mark and num.
	for(int i = 0; i < existCardNum; i++)
	{
		cin >> inMark;
		cin >> inNum;
		SetExistFlg(&cardList[0], markList, inMark, inNum);
	}
	
	// Disp not exist card list.
	for(int i = 0; i < MARK_TYPE_NUM * MAX_CARD_NUM; i++)
	{
		if(0 == cardList[i].existFlg)
		{
			cout << cardList[i].mark << " " << cardList[i].num << endl;
		}
	}
	
	return 0;
}

// SetExistFlg()
// Function  : t_card構造体のexistFlgを1にする関数
// Param[out]: cardList (マーク、番号、existFlgで構成された構造体)
// Param[in] : markList ("SHCD"の文字列)
// Param[in] : inMark   (入力されたマーク)
// Param[in] : inNum    (入力された番号)
// Return    : Nothing
void SetExistFlg(t_card *cardList, char *markList, char inMark, int inNum)
{
	int markLen = strlen(markList);
	
	for(int i = 0; i < markLen; i++)
	{
		if(inMark == markList[i])
		{
			cardList[i * MAX_CARD_NUM + inNum - 1].existFlg = 1;
			break;
		}
	}
}


Measured memory_bytes: 3072
//PLUS ULTRA

#include<bits/stdc++.h>
using namespace std;
     
     
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back 
#define mp make_pair
#define forn(i,st,n) for(int i = st; i < n ; i++)
#define nfor(i,st,n) for(int i = st; i >= n ; i--)
#define ss second
#define ff first

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

const int N = 1e5 + 10 , mod =  1000000007;

void solve(){

	int n; cin >> n;

	int arr[n+1] , inp;
	memset(arr, 0 , sizeof(arr));

	forn(i,1,n){
		cin >> inp;
		arr[inp]++;
	}
    
    forn(i, 1 , n+1){
    	cout << arr[i] << endl;

    }



}

int main(){
    SPEED;

   solve();

    return 0;
}
      
       


Measured memory_bytes: 4436
#include <bits/stdc++.h>
 
#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll  = long long;
using pll = pair<ll, ll>;

const ll MOD  = 1e9 + 7;
const ll LINF = 1LL << 62;
const int INF = 1e9 + 7;

int main(){
    ll l, r;
    cin >> l >> r;

    ll ans = 2019;
    for(ll i = l; i < r; ++i){
        for(ll j = i+1; j <= r; ++j){
            ans = min(ans, (i*j)%2019);
            if(ans == 0){
                cout << 0 << endl;
                return 0;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3628
#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<int,int> PP;

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

ll check(string s) {
    if (s.size() > 5000) return -1;
    ll DP[8];
    memset(DP, 0, sizeof(DP));
    for (int i = 0;i < s.size();i++) {
        if (s[i] == 'F') DP[0]++;
        if (s[i] == 'E') DP[1] += DP[0];
        if (s[i] == 'S') DP[2] += DP[1];
        if (s[i] == 'T') DP[3] += DP[2];
        if (s[i] == 'I') DP[4] += DP[3];
        if (s[i] == 'V') DP[5] += DP[4];
        if (s[i] == 'A') DP[6] += DP[5];
        if (s[i] == 'L') DP[7] += DP[6];
    }
    return DP[7];
}

int main() {
    ios::sync_with_stdio(false);
    ll K;
    cin >> K;
    ll DP[8];
    ll Q[8]; // Rem
    ll P[8]; // Number of Operation in second round.
    memset(DP, 0, sizeof(DP));
    memset(Q, 0, sizeof(Q));
    memset(P, 0, sizeof(P));
    DP[7] = K;
    Q[0] = 1;
    for (int i = 7;i > 0;i--) {
        if (DP[i] <= 2) {
            DP[i - 1] = DP[i];
            Q[i] = DP[i];
        }
        else {
            ll T = min(400LL, DP[i] - 1);
            bool ok = 0;
            for (int j = T;j > 0 && ok == 0;j--) {
                if (DP[i] % j != 0) {
                    Q[i] = DP[i] % j;
                    DP[i - 1] = DP[i] / j;
                    P[i] = j;
                    ok = 1;
                }
            }
        }
    }
    string s = "FESTIVAL";
    string sol = s;
    for (int i = 7;i > 0;i--) {
        for (int j = Q[i];j > 1;j--) sol.push_back(s[i]);
    }
    for (int i = 1;i < 8;i++) {
        for (int j = 0;j < P[i];j++) {
            sol.push_back(s[i]);
        }
    }
    //ll ans = check(sol);
    //if (ans != K) cerr << "WRONG" << endl;
    cout << sol << endl;
    return 0;
}


Measured memory_bytes: 384
n = int(input())
h_list = list(map(lambda x: int(x), input().split()))

max_move = 0
current_move = 0
s = 0
t = 1
continue_flag = True

if n == 1:
    print(0)
else:
    while continue_flag:
        if h_list[s] >= h_list[t]:
            current_move += 1
            s += 1
            t += 1
        else:
            max_move = max([max_move, current_move])
            current_move = 0
            s += 1
            t += 1

        if t == n:
            max_move = max([max_move, current_move])
            continue_flag = False

    print(max_move)

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

int n;
long long f[1003][1003], s[2][1003][1003];
long long qry0(int i, int j) { return s[0][n][i] - s[0][j][i]; }
long long qry1(int i, int j, int k) {
    return s[1][n][j] - s[1][n][k] - s[1][i][j] + s[1][i][k];
}
int main() {
    n = read();
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j)
            if (i < j)
                s[0][i][j] = read();
            else if (i > j)
                s[1][i][j] = read();

    n += 2;
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j) {
            s[0][i][j] += s[0][i][j - 1] + s[0][i - 1][j] - s[0][i - 1][j - 1];
            s[1][i][j] += s[1][i][j - 1] + s[1][i - 1][j] - s[1][i - 1][j - 1];
        }

    for (int i = 0; i <= n; ++i) f[i][0] = qry0(i, 0);
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j < i; ++j) {
            f[i][j] = 10000000000000000ll;
            for (int k = 0; k < j; ++k)
                f[i][j] = min(f[i][j], f[j][k] + qry1(i, j, k));
            f[i][j] += qry0(i, j);
        }

    printf("%lld\n", f[n][n - 1]);
    return 0;
}
const int _SIZE = 1 << 22;
char ibuf[_SIZE], *iS = ibuf, *iT = ibuf;
#define gc                                                         \
    (iS == iT ? iT = ((iS = ibuf) + fread(ibuf, 1, _SIZE, stdin)), \
     (iS == iT ? EOF : *iS++) : *iS++)
int read() {
    int x = 0, f = 1;
    char c = gc;
    while (!isdigit(c)) f = (c == '-') ? -1 : f, c = gc;
    while (isdigit(c)) x = x * 10 + c - '0', c = gc;
    return x * f;
}

Measured memory_bytes: 20736
#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

using namespace std;

typedef int64_t ll;
typedef pair<int, int> pii;

const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INTMAX = 2147483647;
const ll LLMAX = 9223372036854775807;

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; }
void SWAP(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
void SWAP(int& a, int& b) { a ^= b; b ^= a; a ^= b; }


class A {
	int n, a, b;
public:
	A()
	{
		cin >> n >> a >> b;
	}
	void solve()
	{
		int ans{ min(n * a, b) };
		cout << ans << endl;
	}
};


int main()
{
	A solution;
	solution.solve();

	return 0;
}

Measured memory_bytes: 256
// B - Kleene Inversion
#include <bits/stdc++.h>

using namespace std;

#define	MOD	1000000007

int main(int argc, char *argv[])
{
	long long n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];

	vector<long long> c(n), d(n);
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) if (a[i] > a[j]) c[i]++;
		for (int j = i + 1; j < n; j++) if (a[i] > a[j]) d[i]++;
	}

	long long ans = 0;
	for (int i = 0; i < n; i++) {
		ans = (ans + d[i] * k % MOD) % MOD;
		ans = (ans + c[i] * ((k * (k - 1) / 2) % MOD) % MOD) % MOD;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
int main() 
{ 
   long long int h,w,x,y;
   cin>>h>>w>>x>>y;
   cout<<fixed<<setprecision(9)<<((h*w)/2.00000)<<" ";
   if((h%2==0)&&(h/2==x)&&(w%2==0)&&(w/2==y))
   cout<<1;
   else
   cout<<0;
} 


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

#define mp       make_pair
#define mt	  make_tuple
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

const int INF=1<<29;
const double EPS=1e-9;
const ll MOD = 1000000007;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
// T have +-*/ and 0
template<class T> class bit {
public:
  vector<T> dat;
  int N;

  bit(){}
  bit(int N) : N(N) { dat.assign(N,0); }
  // sum [0,i)
  T sum(int i){
    int ret = 0;
    for(--i; i>=0; i=(i&(i+1))-1) ret += dat[i];
    return ret;
  }
  // sum [i,j)
  T sum(int i, int j) { return sum(j) - sum(i); }
  // add x to i
  void add(int i, T x) { for(; i < N; i|=i+1) dat[i] += x; }
};

int N;
const int T = 86400;
const int four = 14400;
const int seven = 25200;
const int diff = 10800;
int wake[T];
int main(){
  cin >> N;
  int now = 0;
  bit<ll> bit_tree(T + 10);
  for (int i = 0; i < N; i++){
    int a,b;
    cin >> a >> b;
    now += a;
    now %= T;
    wake[now]++;
    bit_tree.add(now, 1);
    now += b;
    now %= T;
  }
  ll result = 0;
  for (int i = 0; i <= T; i++){
    int rest = 0;
    if (i + diff > T){
      rest = (i + diff) - T;
      ll cnt1 = bit_tree.sum(i, T + 1);
      ll cnt2 = bit_tree.sum(0, rest + 1);
      result = max(result, cnt1 + cnt2);
    }else{//i + diff <= T
      ll cnt = bit_tree.sum(i, i + diff + 1);
      result = max(result, cnt);
    }

  }
  cout << result << endl;
  
  
  return 0;
}


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

#define INF (1 << 10)

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

  int ans = INF;
  for (int i = 0; i < N; ++i) {
    int c, t;
    cin >> c >> t;
    if (t <= T) {
      ans = min(ans, c);
    }
  }

  if (ans == INF) {
    cout << "TLE" << endl;
  } else {
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
int a;
int a_n[100001];
int N;
int main() {
  cin >> N;
  
  int MIN = 1000000;
  int MAX = 0;
  
  for(int i = 0; i < N; i++) {
    int a;
    cin >> a;
    a_n[a]++;
    MIN = min(MIN,a);
    MAX = max(MAX,a);
  }
 
  if(MAX - MIN > 1) {
    cout <<"No" <<endl; return 0;
  }
 
  if(MAX == MIN) {
    if(MAX == N - 1 || MAX <= N / 2) {
      cout << "Yes" <<endl;
      return 0;
    }
  }
 
   if(MAX - MIN == 1) {
     if(a_n[MIN] > MIN) {
       cout << "No" <<endl;
       return 0;
     }
     if(a_n[MAX] >= 2 * (MAX - a_n[MIN])) {
      cout << "Yes" <<endl;
      return 0;
    }
   }
   cout << "No" <<endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
struct team{
	int num,p,cnt;
	int w[11];
	void init(int n)
	{
		num=n;
		p=0;
		cnt=0;
		for(int i=0;i++<10;)w[i]=0;
	}
	void submit(int m,int i,int j)
	{
		if(j)w[i]++;
		else p+=m+w[i]*20,cnt++;
	}
	bool operator<(team a)
	{
		if(cnt!=a.cnt)return cnt>a.cnt;
		else if(p!=a.p)return p<a.p;
		else return num>a.num;
	}
	bool operator==(team a)
	{
		return cnt==a.cnt&&p==a.p;
	}
};
int M,T,P,R;
main()
{
	while(cin>>M>>T>>P>>R,M)
	{
		team a[55];
		for(int i=0;i++<T;)a[i].init(i);
		for(int i=0;i<R;i++)
		{
			int b,c,d,e;cin>>b>>c>>d>>e;
			a[c].submit(b,d,e);
		}
		sort(a+1,a+T+1);
		for(int i=0;i++<T;)
		{
			if(i==1)cout<<a[i].num;
			else
			{
				cout<<(a[i-1]==a[i]?"=":",")<<a[i].num;
			}
		}
		cout<<endl;
	}
}



Measured memory_bytes: 3152
#include <iostream>
#include <utility>
#include <vector>
#include <set>
#define int long long
using namespace std;

signed main() {
  int H, W, N;
  cin >> H >> W >> N;
  vector<int> a(N), b(N);
  for (int i = 0; i < N; ++i) cin >> a[i] >> b[i];
  
  vector<int> ans(10, 0);
  ans[0] = (H - 2) * (W - 2);
  set<pair<int, int>> S;
  vector<int> dx = {-1, -1, -1, 0, 0, 0, 1, 1, 1};
  vector<int> dy = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 9; ++j) {
      int x = a[i] + dx[j];
      int y = b[i] + dy[j];
      if (!(1 < x && x < H && 1 < y && y < W)) continue;
      int cnt = 0;
      for (int k = 0; k < 9; ++k) {
        if (S.count(make_pair(x + dx[k], y + dy[k]))) ++cnt;
      }
      --ans[cnt];
      ++ans[cnt + 1];
    }
    S.insert(make_pair(a[i], b[i]));
  }
  
  for (int i = 0; i < 10; ++i) cout << ans[i] << endl;
  return 0;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
#ifdef DEBUG
  #include "debug.hpp"
#else
  #define DUMP(var)
#endif

using namespace std;
template< class T1, class T2 > inline istream &
operator>>( istream & fin, pair< T1, T2 > & pr )
{ fin >> pr.first >> pr.second; return fin; }
template< class T0, class T1, class T2 > inline istream &
operator>>( istream & fin, tuple< T0, T1, T2 > & t )
{ fin >> get<0>(t) >> get<1>(t) >> get<2>(t); return fin; }
template< class T > inline istream &
operator>>( istream & fin, vector< T > & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class T, size_t n> inline istream &
operator>>( istream & fin, array<T, n> & a ) {
for(auto & u: a) fin >> u; return fin; }
template<class FwdIter> inline auto
dump(FwdIter first, FwdIter last, const char * dlm = " ") -> void {
using value_type = typename iterator_traits<FwdIter>::value_type;
copy(first, last, ostream_iterator<value_type>(cout, dlm)); }
template<typename T> vector<T> & operator--(vector<T> & a)
{ for(auto & i: a) --i; return a; }
/* @@@ ----------------------------------- */


int main(const int /*argc*/, char ** /*argv*/) {
  ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

  string s, t;
  cin >> s >> t;
  size_t out = 0;
  for (size_t i = 0; i < s.size(); ++i) {
    out += s[i] == t[i];
  }
  cout << out;

  return EXIT_SUCCESS;
}


Measured memory_bytes: 256
while 1:
  n=int(input())
  if not n:break
  f=1
  L={}
  for a,b,c in [input().split() for i in range(n)]:
    d=int(b)*int(c)
    if a in L:
      if L[a]>=1e6:continue
      L[a]+=d
    else:L[a]=d
    if L[a]>=1e6:print(a);f=0
  if f:print('NA')

Measured memory_bytes: 8260
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb push_back
#define ld long double
#define f first
#define s second
#define in insert
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e18 + 5;
const int mod = 1e9 + 7;
const int  N = 2e5 + 314;
const long double pi = 3.1415926535897932384626433832795;
void solve(){
    int n;
    string s;
    cin>>n>>s;
    stack<char>st;
    int cntl = 0, cntr = 0;
    for(int i = 0; i < n; i++){
        if(sz(st)){
            if(st.top()=='('&&s[i]==')')st.pop();
            else st.push(s[i]);
        }
        else st.push(s[i]);
    }
    while(!st.empty()){
        if(st.top()==')')s='('+s;
        else s+=')';
        st.pop();
    }
    cout<<s;
}
signed main(){
    speed;
    int t=1;
    //cin>>t;
    while(t--)solve();
}

Measured memory_bytes: 3628
n,m = map(int,input().split())
h = list(map(int,input().split()))
ab = [list(map(int,input().split())) for i in range(m)]
gp = []
hill = [i for i in range(1,n+1)]
for i in range(len(ab)):
    a,b = ab[i][0],ab[i][1]
    if h[a-1] > h[b-1]:
        hill[b-1] = 0
    elif h[a-1] < h[b-1]:
        hill[a-1] = 0
    elif h[a-1] == h[b-1]:
        hill[a-1] = 0
        hill[b-1] = 0

print(n-hill.count(0))


Measured memory_bytes: 35052
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int n;
    scanf("%d",&n);
    ll a[n] = {};
    ll b[n] = {};
    rep(i,n){
        scanf("%lld%lld",&a[i],&b[i]);
    }


    ll ans = 0;

    drep(i,n){
        a[i] += ans;
        if(a[i]%b[i]==0){
            if(a[i]==0){
                //ans+=b[i];
            }
        }else{
            ans += b[i]-(a[i]%b[i]);
        }
    }
    
    cout << ans << endl;
    return 0;
}
 
 


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<int,ll> Pil;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<ll,ll> Pl;
typedef pair<Pil,ll> P2;
const ll INF=1000000000000000001;
const int inf=1000000000;
//struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int z=10000000001;
int main(){

	int n;
	int a[100001];

	cin>>n;
	rep(i,n){
		cin>>a[i];
		z=min(a[i],z);
	}
	int total=0;

	while(1){
		total=0;
		int z2=1000000001;
		rep(i,n){
			z2=a[i]%z;
			if(z2>0)z=z2;
		}
		rep(i,n){
			if(a[i]%z>0){
				total++;
			}
		}
		if(total==0){
			cout<<z<<endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(void){
  int A,B,C;
  cin>>A>>B>>C;
  int c=0;
  if(A==B&&B==C&&A%2==0&B%2==0&&C%2==0){
      cout<<-1<<endl;
      return 0;
  }
  for(;A%2==0&&B%2==0&&C%2==0;c++){
      int nA=(B+C)/2;
      int nB=(C+A)/2;
      int nC=(A+B)/2;
      A=nA,B=nB;C=nC;
  }
  cout<<c<<endl;
  return 0;
}


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

typedef vector< ll > 	vi;
typedef vector< vi > 	vvi;
typedef pair< ll,ll > 	ii;
#define pb 		push_back
#define all(c) 		(c).begin(),(c).end()
#define tr(c,i) 	for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) 	((c).find(x) != (c).end())

#define MOD 	1000000007
#define INF 	(int)1e9
#define MEM(a, b) memset(a, (b), sizeof(a))

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

	string s;
	cin>>s;
	bool flag= true;
	for(ll i=0; i<s.size(); i++)
	{
		if( (i+1)%2==0)
		{
			if(s[i]=='L' || s[i]=='U' || s[i]=='D')
				{ }
			else { flag= false; break;}
		}
		else{
			if(s[i]=='R' || s[i]=='U' || s[i]=='D')
			{

			}
			else { flag=false; break; }
		}

	}	
	if(flag)
		cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
N,W= map(int,input().split())
w=[]
v=[]
for  i in range(N):
    a,b=map(int,input().split())
    w.append(a)
    v.append(b)

V=sum(v)

dp =[ [float('inf')]*(V+1) for _ in range(N+1) ]
for  i in range(N):
    dp[i][0]=0
for i in range(N):
    for  j in range(V+1):
        dp[i+1][j]=dp[i][j]
        if j-v[i]>=0:
            dp[i+1][j]= min(dp[i][j] , dp[i][j-v[i]]+w[i])

ans=0
for i in range(N+1):
    for  j in range(V+1):
        if 0<dp[i][j]<=W:
            ans=max(ans,j)

print(ans)

Measured memory_bytes: 374344
#include<stdio.h>
int bubble(int A[100],int N)
  {
	int i,stock,j,c=0,flag=1;
	while(flag)
  {
		flag=0;
		for(i=N-1;i>0;i--)
  {
	if(A[i]<A[i-1])
  {
		stock=A[i];
		A[i]=A[i-1];
		A[i-1]=stock;
		flag=1;
		c++;
  }		
  }
  }
	return c;
  }
int main(void)
  {
	int i,n,x,a[100];
	scanf("%d",&n);
	for(i=0;i<n;i++){scanf("%d",&a[i]);}
	x=bubble(a,n);
	for(i=0;i<n;i++)
  {
		printf("%d",a[i]);
		if(i<n-1){printf(" ");}
		else{printf("\n");}
  }
	printf("%d\n",x);
	return 0;
  }

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

int D, N;

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

    int S = 1;
    for (int i = 0; i < D; i++) S *= 100;
	if (N <= 99) {
		cout << S * N << endl;
	}
	else {
		cout << S * 101 << endl;
	}

    return 0;
}


Measured memory_bytes: 256
h,w = list(map(int,input().split()))
l,m = 0,0
if h % 2 == 1:
    l = h // 2 + 1
else:
    l = h // 2
if w % 2 == 1:
    m = w // 2 + 1
else:
    m = w // 2
if h == 1 or w == 1:
    print(1)
else:
    print(w*h - l * (w // 2) - m * (h // 2))

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

int main(){
    int x, y, z;
    int a, b, c;
    cin >> x;
    cin >> y;
    cin >> z;
    a = z;
    b = x;
    c = y;
    cout << a << ' ' << b << ' ' << c << endl;
    return(0);
}

Measured memory_bytes: 256
N=int(input())
array=[]
array.append([int(i) for i in input().split()])
array.append([int(i) for i in input().split()])

MAX=0
for i in range(N):
    tmp=0
    for j in range(i+1):
        tmp+=array[0][j]
    for j in range(i, N):
        tmp+=array[1][j]
    if MAX < tmp:
        MAX=tmp

print(MAX)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
string A, B;

int main(void){
	//IO("test.in", "test.out");
	cin >> A >> B;
	if(A.length() > B.length()) printf("GREATER\n");
	else if(A.length() < B.length()) printf("LESS\n");
	else{
		string s = "EQUAL";
		for(int i = 0; i < A.length(); i++)
			if(A[i] > B[i]){
				s = "GREATER";
				break;
			}else if(A[i] < B[i]){
				s = "LESS";
				break;
			}
		cout << s << endl;
	}
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		String number = input.next();

		long sum = 0;

		for (int i = 0; i < number.length(); i++){
			sum += Character.getNumericValue(number.charAt(i));
		}
		System.out.println(sum % 9 == 0 ? "Yes" : "No");
	}
}

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

int main(){
    int n;
    scanf("%d",&n);
    for(int i = 0; i < n; i++){
        double xa,ya,ra,xb,yb,rb;
        scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
         
        double num;
		num = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
         
        if(num + ra < rb)puts("-2");
		else if(num > ra + rb)puts("0");
        else if(num + rb < ra)puts("2");
        else puts("1");
    }
	return 0;
}

Measured memory_bytes: 1048
#include <stdio.h>
#include <math.h>

int main(){
	long int h;
	long int cnt = 1;
	
	scanf("%lu", &h);
	
	while(h!=1){
		h/=2;
		++cnt;
	}
	printf("%lu", (long int)(pow(2, cnt)-1));
	
	return 0;
}

Measured memory_bytes: 128
K,A,B = map(int,input().split())
if A >= K:
    print(1)
elif A > B:
    #n = math.ceil((K-A) / (A-B))
    n = (K-A-1) // (A-B) + 1
    print(2*n + 1)
else:
    print(-1)


Measured memory_bytes: 2940
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
//const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#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++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int n;
vector<ll> d; 
int a[10000];
ll power(ll a, ll b){
    ll MOD=998244353;
    ll ans=1;
    for(int i=0;i<b;i++){
        ans*=a;
        ans%=MOD;
    }
    return ans;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    ll MOD=998244353;
    map<int,ll> m;
    ll ans=1;
    for(int i=0;i<n;i++){
        int temp;
        cin>>temp;
        if(i!=0&&temp==0){
            cout<<0<<"\n";
            return 0;
        }
        d.push_back(temp);
        m[temp]++;
    }
    if(d[0]!=0){
        cout<<0<<"\n";
        return 0;
    }
    bool c=false;
    for(int i=1;i<=n;i++){
        if(m[i]==0){
            c=true;
        }
        else{
            if(c==true){
                cout<<0<<"\n";
                return 0;
            }
        if(m[i]!=0)
        ans*=power(m[i-1],m[i]);
        ans%=MOD;
        //cout<<ans<<"\n";
        }
    }
    cout <<ans<< "\n";
}


Measured memory_bytes: 7320
/**
**	author : Raghav
**	codechef:raghav_456
**	codeforces:raghavramola7
**/
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define endl 			"\n"
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void Raghav()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(10);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int32_t main()
{
	Raghav();
	int k, n, a, sum = 0;
	cin >> k >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a;
		sum += a;
	}

	if (sum >= k)
		cout << "Yes";
	else
		cout << "No";
	return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>(b);i--)
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int MOD = 1000000007, INV = 500000004;
int N;
string s;
ull powMod(ull a, int n){
  ull ret = 1;
  while(n){
    if(n & 1)ret = ret * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return ret;
}

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

  cin >> N >> s;
  vector<ull> prev, DP;
  FOR(i, 0, N+1){DP.pb(0);prev.pb(0);}
  prev[0] = 1;
  prev[1] = 0;
  FOR(i, 1, N+1){
    DP[0] = (prev[0] + prev[1]) % MOD;
    DP[i] = (prev[i-1] << 1) % MOD;
    FOR(j, 1, i) DP[j] = (prev[j+1] + (prev[j-1] << 1)) % MOD;
    prev.swap(DP);
  }
  cout << prev[s.size()] * powMod(INV, s.size()) % MOD << "\n";
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;

int main(){
    double W, H, x, y; cin >> W >> H >> x >> y;

    if(W / 2 == x && H / 2 == y) {
        cout << W * H / 2 << " " << 1 << endl; // xyが中心であるとき
    } else {
        cout << W * H / 2 << " " << 0 << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const int NIL = -1;
const int INF = (1<<21);
const long long MOD = 1e9+7;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};

int gcd(int a, int b) {return b ? gcd(b, a%b) : a;}

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

  vector<int> left(N+1, 0), right(N+1,0);
  for (int i = 0; i < N; ++i) left[i+1] = gcd(left[i], a[i]);
  for (int i = N-1; i >= 0; --i) right[i] = gcd(right[i+1], a[i]);

  int res = 0;
  for (int i = 0; i < N; ++i) {
    int l = left[i];
    int r = right[i+1];
    chmax(res, gcd(l, r));
  }
  cout << res << endl;
}


Measured memory_bytes: 4516
#include<stdio.h>
#include<math.h>
int main()
{
	int n;
	scanf("%d",&n);
	int ans=0;
	int i,j;
	for(i=1;i<=n;i+=2)
	{
		int x=0;
		for(j=1;j<=(int)sqrt(i);j++)
		{
			if(i%j==0)
			  x++;
		}
		if(x==4)
		  ans++;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
def main():
    n, m = map(int, input().split())
    p = 2**n
    inf = 10**7
    dp = [inf]*p
    dp[0] = 0
    for _ in range(m):
        a, _ = map(int, input().split())
        c = sum([1<<(int(i)-1) for i in input().split()])
        def k(s):
            dp[s|c] = dp[s] + a
        [k(s) for s in range(p) if dp[s|c] > dp[s] + a]
    ans = dp[-1]
    if ans == inf:
        ans = -1
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3188