akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<ll>>;
using P = pair<int,int>;

#define MOD 1000000007
#define INF 1000000
#define PI 3.14159265358979323846264338327950L
#define MAX 200010
#define lb lower_bound //[2,4)=lb(4)-lb(2);

int main()
{
  ll N;cin>>N;
  vector<ll> A(N);
  vector<ll> B(N);
  for (int i=0;i<N;i++)
  {
    cin>>A[i];
    B[i]=A[i];
  }
  
  sort(B.begin(),B.end(),greater<ll>());
  
  for (int i=0;i<N;i++)
  {
    if (A[i]!=B[0]) cout<<B[0]<<endl;
    else cout<<B[1]<<endl;
  }
}

Measured memory_bytes: 4736
n = int(input())
a = input().split()
for i in range(n):
    a[i] = int(a[i])

b = []
for i in range(n):
    b.append(a[n - 1 - i])

for i in range(n):
    if i < n - 1:
        print(b[i], end=' ')
    else:
        print(b[i])


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

#define REP(i,n) for(int i = 0;i < n;i++)
#define REPR(i,n) for(int i = n-1;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()
#define ll long long
#define GREATER greater<int>()

using namespace std;

string pop_back(string s){
    string t = s.substr(0,s.size()-1);
    return t;
}

int gcd(int max,int min){
    
    if(max<min){
        int tmp=max;
        max=min;
        min=tmp;
    }

    if(max%min==0)return min;
    else return gcd(min,max%min);

}

int main(void){

    int n;
    cin>>n;
    string s[n];
    for(int i=0;i<n;i++)cin>>s[i];
    for(int i=0;i<n-1;i++){
        if(s[i][s[i].size()-1]!=s[i+1][0]){
            cout<<"No"<<endl;
            return 0;
        }
        for(int j=0;j<=i;j++){
            if(s[j]==s[i+1]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }

    cout<<"Yes"<<endl;

    return 0;
}




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

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        
        String[] tmp = reader.readLine().split(" ");
        int triangleArea = Integer.parseInt(tmp[0]) * Integer.parseInt(tmp[1]) / 2;
        System.out.println(triangleArea);
    }
}


Measured memory_bytes: 23124
def cal(p,q):
    add=(l[p][0]-l[q][0])**2+(l[p][1]-l[q][1])**2
    return math.sqrt(add)

import itertools
import math
n=int(input())
l=[list(map(float,input().split())) for i in range(n)]


a=[]
ans=0
for i in range(n):
    a.append(i)
for x in itertools.permutations(a): 
    for i in range(n-1):
        ans+=cal(x[i],x[i+1])
for i in range(1,n+1):
    ans/=i
print(ans)


Measured memory_bytes: 3064
s = input()
L = len(s)

ans = 0
for plusbits in range(2 ** (L - 1)):
    subset = []
    left = 0
    for b in range(L - 1):
        if plusbits & (1 << b):
            right = b + 1
            subset.append(s[left:right])
            left = right
    subset.append(s[left:])
    ans += sum([int(i) for i in subset])

print(ans)


Measured memory_bytes: 3188
import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] a = new int[n];
      int x = 0;
      int y = 0;
      for(int i = 0;i < n;i++){
        a[i] = sc.nextInt();
        y += a[i];
      }
      Arrays.sort(a);
      for(int i = n-1;i>=0;i -= 2){
      	x += a[i];
      }
      System.out.println(x*2-y);
    }
}

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

using namespace std;
using ll = long long;

int main() {
  int N;
  cin >> N;
  vector<ll> ls(N);
  rep(i, N) { cin >> ls[i]; }
  ll count = 0;
  for (int i = 0; i < N - 2; i++) {
    for (int j = i + 1; j < N - 1; j++) {
      for (int k = j + 1; k < N; k++) {
        ll a = ls[i];
        ll b = ls[j];
        ll c = ls[k];
        if (a != b && b != c && c != a) {
          ll d = a + b + c;
          if (max({a, b, c}) < d - max({a, b, c})) {
            count = count + 1;
          }
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 3600
from collections import deque


def main():
    K = int(input())
    que = deque(['1', '2', '3', '4', '5', '6', '7', '8', '9'])

    while K:
        if K == 1:
            ans = que.popleft()
            break
        K -= 1
        v = que.popleft()
        if v[-1] == '0':
            que.append(v + '0')
            que.append(v + '1')
        elif v[-1] == '9':
            que.append(v + '8')
            que.append(v + '9')
        else:
            que.append(v + str(int(v[-1]) - 1))
            que.append(v + str(int(v[-1])))
            que.append(v + str(int(v[-1]) + 1))

    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 17004
open Printf
open Scanf

let id x = x

let solve n =
  let ar = Array.init n @@ fun _ -> scanf "%d " id in
  let f (ct, mn) x = if mn > x then (ct + 1, x) else (ct, mn) in
  fst @@ Array.fold_left f (0, 300000) ar

let () =
  scanf "%d " solve |> printf "%d\n"


Measured memory_bytes: 6016
#include <bits/stdc++.h>
using intl = long long;
using itnl = long long;
using itn = int;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define rrep(i, n) for(intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define rrepi(i, a, b) for(intl i = (intl)(a); i >= (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define itn int
#define double ld
#define pb push_back
#define mp make_pair
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool f){cout << (f ? "Yes" : "No") << endl;}
void fp(bool f, string s, string t){cout << (f ? s : t) << endl;}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
intl lcm(intl a,intl b){
    return a / gcd(a, b) * b;
}
intl digit10(intl a){
    intl b = 0;
    do{
        a /= 10;
        b++;
    }while(a);
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    intl n,m;
    cin >> n >> m;
    string s;
    cin >> s;
    bool f = (s[n] == '-');
    rep(i,n)f = (f && (s[i] != '-'));
    repi(i,n+1,n + m + 2)f = (f && (s[i] != '-'));
    fp(f);
    return 0;
}

Measured memory_bytes: 256
/*
  mail: mleautomaton@foxmail.com
  author: MLEAutoMaton
  This Code is made by MLEAutoMaton
*/
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define ll long long
#define re register
#define file(a) freopen(a".in","r",stdin);freopen(a".out","w",stdout)
inline int gi(){
	int f=1,sum=0;char ch=getchar();
	while(ch>'9' || ch<'0'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9'){sum=(sum<<3)+(sum<<1)+ch-'0';ch=getchar();}
	return f*sum;
}
struct node{int x,y;}job[200010];
int n;
bool operator<(const node a,const node b){
	return a.y<b.y || (a.y==b.y && a.x<b.x);
}
int main(){
	n=gi();
	for(int i=1;i<=n;i++)job[i].x=gi(),job[i].y=gi();
	sort(&job[1],&job[n+1]);int now=0;
	for(int i=1;i<=n;i++){
		now+=job[i].x;
		if(now>job[i].y)return puts("No"),0;
	}
	puts("Yes");
	return 0;
}


Measured memory_bytes: 1792
import std.stdio, std.string, std.conv, std.algorithm;
void main() {
    int[] tmp = readln.split.to!(int[]);
    int n = tmp[0], k = tmp[1];
    int[] v = readln.split.to!(int[]);
    int maxv;
    foreach (i; 0 .. n+1) {
        foreach (j; 0 .. n+1) {
            if (i + j > min(n, k)) break;
            int[] s = v[0..i] ~ v[n-j..$];
            s.sort!"a < b";
            int cnt = s.count!"a < 0".to!int;
            if (cnt <= k - i - j) {
                maxv = max(maxv, s[cnt..$].sum);
            } else {
                maxv = max(maxv, s[k-i-j..$].sum);
            }
        }
    }
    maxv.writeln;
}

Measured memory_bytes: 508
// Aggressive Play

#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

const int N = 3e5 + 5;
ll a[N];
int main()
{
    ios_base ::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    ll n, m;
    cin >> n >> m;
    ll sum = 0;
    for(int i = 0; i < m; i++){
        ll x;
        cin >> x;
        sum += x;
    }
    sum = n - sum;
    if(sum < 0)
        sum = -1;
    cout << sum;
return 0;
}


Measured memory_bytes: 3620
#pragma region // {{{ by unolight
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-function"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

namespace { namespace unolight {
// Read Input
template<class T> void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( int64_t &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }
void R() {}
template<class T, class... U> void R( T& head, U&... tail ) { _R(head); R(tail...); }
// Write Output
template<class T> void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
void _W( const int64_t &x ) { printf("%" PRId64,x); }
void _W( const double &x ) { printf("%.16f\n",x); }
void _W( const char &x ) { putchar(x); }
void _W( const char *x ) { printf("%s",x); }
template<class T> void _W( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W( const T& head, const U&... tail ) { _W(head); putchar(sizeof...(tail)?' ':'\n'); W(tail...); }

#ifdef UNOLIGHT
#include "dump.hpp"
#else
#define dump(...)
#endif

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}
#pragma endregion // }}}

void main() {
    int n;
    R(n);
    VI a(n), b(n);
    REP(i,n) R(a[i]);
    REP(i,n) R(b[i]);
    VI c(n);
    REP(i,n) c[i]=a[i]-b[i];
    LL sum=0;
    sort(ALL(c));
    int cnt=0;
    REP(i,n) if ( c[i]<0 ) {
        cnt++; sum+=c[i];
    }
    reverse(ALL(c));
    REP(i,n) {
        if ( sum>=0 || c[i]<=0 ) {
            break;
        } else {
            sum+=c[i];
            cnt++;
        }
    }
    if ( sum<0 ) W(-1);
    else W(cnt);
}

}} // {{{ main
int main() { unolight::main(); return 0; }
// }}}

Measured memory_bytes: 4468
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long double ld;

int main(){
ll a,b,c,d,e,f;
cin >> a;
b=0;
vector<ll> v(a);
vector<ll> r(a);
for(ll i=0; i<a ; i++){
  cin >> v[i];
  r[v[i]-1]+=1;
}

for(ll i=0; i<a ; i++){
if(r[i]>=2){
  b+=(r[i])*(r[i]-1)/2;
}
}

for(ll i=0; i<a ; i++){
  cout << b - r[v[i]-1]+1 << endl;
}
}

Measured memory_bytes: 5760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=21,M=N*N,mod=1e9+7;
int n,m,up,f[N],e[1<<20],p[1<<19],bit[1<<20],x[M],y[M],mp[N];
int fa[1<<19][N],st[1<<19][N];
ll fc[M],invfc[M];
int getf(int x){return f[x]==x?x:f[x]=getf(f[x]);}
int Bit(int x)
{
    if(x==0||bit[x]) return bit[x];
    return bit[x]=__builtin_popcount(x);
}
ll dp[1<<19],si[1<<19],len[1<<19],num[1<<19];
ll Dp()
{
    dp[0]=0;si[0]=1;
    int all=up-1;
    for(int i=1;i<up;i++)
    {
        for(int j=1;j<n;j++)
            if(i>>j-1&1)
        {
            int xt=i^(1<<j-1);
            int tot=num[all^xt]-num[all^i];
            int ep=len[xt];
            len[i]=ep+tot+1;
            ll c=si[xt]*fc[ep+tot]%mod*invfc[ep]%mod;
            ll s=dp[xt]*fc[ep+tot+1]%mod*invfc[ep+1]%mod;
            s=(s+c*Bit(i))%mod;
            dp[i]=(dp[i]+s)%mod;
            si[i]=(si[i]+c)%mod;
        }
        //cout<<i<<' '<<dp[i]<<' '<<si[i]<<endl;
    }
    return dp[up-1];
}
int main()
{
    fc[0]=fc[1]=invfc[0]=invfc[1]=1;
    for(int i=2;i<M;i++) fc[i]=fc[i-1]*i%mod,invfc[i]=(mod-mod/i)*invfc[mod%i]%mod;
    for(int i=2;i<M;i++) invfc[i]=invfc[i-1]*invfc[i]%mod;
    scanf("%d%d",&n,&m);
    for(int i=1;i<=m;i++)
    {
        scanf("%d%d",&x[i],&y[i]);
        mp[x[i]]|=1<<y[i]-1;
        mp[y[i]]|=1<<x[i]-1;
    }
    up=1<<n-1;
    for(int i=1;i<1<<n;i++)
    {
        int s=i;
        for(int j=1;j<=n;j++)
            if(s>>j-1&1)
            {
                s^=1<<j-1;
                e[i]+=Bit(mp[j]&s);
            }
        e[i]-=Bit(i)-1;
    }
    for(int i=1;i<up;i++)
    {
        for(int j=1;j<=n;j++) f[j]=j;
        for(int j=1;j<n;j++)
            if(i>>j-1&1)
        {
            f[getf(x[j])]=getf(y[j]);
            p[i]|=1<<x[j]-1;
            p[i]|=1<<y[j]-1;
        }
        for(int j=1;j<=n;j++)
        {
            int fx=getf(j);
            fa[i][j]=fx;
            st[i][fx]|=1<<j-1;
        }
        for(int j=1;j<=n;j++)
            if(getf(j)==j)
            num[i]+=e[st[i][j]];
    }
    printf("%lld\n",Dp());
}


Measured memory_bytes: 112896
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
#define INF __INT32_MAX__
#define LINF __LONG_LONG_MAX__

int main() {
    int N;
    cin >> N;
    vl A(N);
    vl sum(N);
    rep(i, N) {
        cin >> A[i];
        sum[i] = A[i];
    }
    rep(i, N - 1) {
        sum[i + 1] += sum[i];
    }

    // +-+-+-....
    ll diff = 0;
    ll cnt = 0;
    for (int i = 0; i < N; i++) {
        ll x = sum[i] + diff;
        // +
        if (i % 2 == 0) {
            if (x < 0) {
                diff += abs(x) + 1;
                cnt += abs(x) + 1;
            } else if (x == 0) {
                diff += 1;
                cnt++;
            }
        }
        // -
        else {
            if (x > 0) {
                diff -= abs(x) + 1;
                cnt += abs(x) + 1;
            } else if (x == 0) {
                diff -= 1;
                cnt++;
            }
        }
    }

    // -+-+-+....
    ll diff2 = 0;
    ll cnt2 = 0;
    for (int i = 0; i < N; i++) {
        ll x = sum[i] + diff2;
        // +
        if (i % 2 == 1) {
            if (x < 0) {
                diff2 += abs(x) + 1;
                cnt2 += abs(x) + 1;
            } else if (x == 0) {
                diff2 += 1;
                cnt2++;
            }
        }
        // -
        else {
            if (x > 0) {
                diff2 -= abs(x) + 1;
                cnt2 += abs(x) + 1;
            } else if (x == 0) {
                diff2 -= 1;
                cnt2++;
            }
        }
    }

    cout << min(cnt, cnt2) << endl;
}

Measured memory_bytes: 4828
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cwchar>
#include <cwctype>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <codecvt>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize("Ofast")
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll INF=(1LL<<62);
const ld pi=acosl((ld)-1);
// const ll mod = 1000000007;
const ll mod = 1234567;
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
#define endn "\n"

bool solve(){
    ll n,l;cin>>n>>l;
    vector<ll>a(n);
    rep(i,n)cin>>a[i];
    rep(i,n-1){
        if(a[i]+a[i+1]>=l){
            cout<<"Possible"<<endl;
            for(int x=1;x<=i;x++)cout<<x<<endl;
            for(int x=n-1;x>i+1;x--)cout<<x<<endl;
            cout<<i+1<<endl;
            return false;
        }
    }
    cout<<"Impossible"<<endl;
    return false;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout<<fixed<<setprecision(30);
    solve();
}


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

using namespace std;

constexpr uint64_t lucas(int N) {
    uint64_t l1 = 2, l2 = 1;
    for (int i = 1; i < N; i++) {
        uint64_t tmp = l2;
        l2 += l1;
        l1 = tmp;
    }
    return l2;
}

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

    cout << lucas(N) << endl;

    return 0;
}


Measured memory_bytes: 256
import sys

n = int(input())
a = list(map(int, input().split()))

count = 0
while True:
    for val in a:
        if val%2 != 0:
            print(count)
            sys.exit()

    for i in range(n):
        a[i] /= 2

    count += 1

print(count)


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define pb push_back
#define f first
#define s second
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

signed main(){
	
	string s;
	cin >> s;

	string res = "";

	for (int i = 0; i < s.length(); ++i)
	{
		res += 'x';
	}

	cout << res << endl;
	return 0;
}



/*

*/

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


#define mx 1000007
#define pb push_back
vector<int>edge[mx];
int n,m;

int main()
{int u,v;
    cin>>n>>m;
    while(m--)
    {
        cin>>u>>v;
        edge[u].pb(v);
         edge[v].pb(u);
    }
    for(int i=1;i<=n;i++)
    {
        cout<<edge[i].size()<<endl;
}}


Measured memory_bytes: 23680
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		String s;
		
		s = sc.nextLine();

		s = s.replaceAll("apple", "tmpP");
		s = s.replaceAll("peach", "tmpA");
		s = s.replaceAll("tmpP", "peach");
		s = s.replaceAll("tmpA", "apple");
		
		System.out.println(s);
	}
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    vi primes;

    const int MAXV = 10000;
    vi sieve(MAXV);
    for (int p = 2; p < MAXV; p++) {
        if (sieve[p]) continue;
        primes.push_back(p);
        for (int q = p; q < MAXV; q += p) {
            sieve[q] = p;
        }
    }

    int tail = 0;
    map<int, ll> sdiag, ddiag;;
    auto get = [&primes, &tail](map<int, ll>& m, int i) {
        if (m.count(i)) return m[i];
        return m[i] = primes[tail++];
    };

    auto lcm = [](ll a, ll b) {
        return a / __gcd(a, b) * b;
    };

    int N;
    cin >> N;

    for (int s = 0; s < 2 * N; s += 2)
        get(sdiag, s);
    for (int d = -N+1; d < N; d++) {
        if (d % 2 == 0)
            get(ddiag, d);
    }

    vvll res(N, vll(N));
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if ((i+j)&1) continue;
            res[i][j] = get(sdiag, i+j) * get(ddiag, i-j);
        }
    }

    int dir[4][2] = { { -1, 0 }, { 1, 0 }, { 0, 1 }, { 0, -1 } };

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if (((i+j)&1) == 0) continue;
            res[i][j] = 1;

            for (int d = 0; d < 4; d++) {
                int dx = dir[d][0], dy = dir[d][1];
                res[i][j] = lcm(res[i][j], get(sdiag, i+j+dx+dy) * get(ddiag, i-j+dx-dy));
            }
            res[i][j]++;
        }
    }

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cout << res[i][j] << " ";
        }
        cout << "\n";
    }

    return 0;
}



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

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

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,b) FOR(i, 0, b)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("YES")
#define p_no() p("NO")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

void vprint(vector<ll> A){
    ll L = A.size();
    FOR(i, 0, L){
        if(i) cout << ' ';
        cout << A[i];
    }
    cout << endl;
}

VI topological_sort(VV& G){
    ll N = G.size();
    
    // 入次数
    VI IN(N, 0);
    REP(i, N){
        for(ll to : G[i]){
            IN[to]++;
        }
    }

    stack<ll> st; // 入次数0のものを入れる
    REP(i, N){
        if(IN[i]==0) st.push(i);
    }

    VI ret;
    while(!st.empty()){
        ll i = st.top();
        st.pop();
        ret.push_back(i);
        for(ll to : G[i]){
            IN[to]--;
            if(IN[to]==0){
                st.push(to);
            }
        }
    }

    // 成功したか確認
    for(ll in : IN){
        if(in!=0){
            // 失敗（DAGじゃなかった）
            VI empty_vector;
            return empty_vector;
        }
    }
    // 正常の戻り値
    return ret;
}

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

    // input
    ll V, E;
    cin >> V >> E;

    VV G;
    G.resize(V);

    REP(i, E){
        ll s, t;
        cin >> s >> t;
        G[s].push_back(t);
    }

    auto A = topological_sort(G);
    for(ll a : A){
        p(a);
    }
    
    return 0;
}


Measured memory_bytes: 3952
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main (String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] a = new int[n];
		String[] elements = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++){
			a[i] = Integer.parseInt(elements[i]);
		}
		
		int swap = 0;
		
		for (int i = 0; i < a.length - 1; i++){
			for(int j = a.length - 1; j >= i + 1; j--){
				if(a[j] < a[j-1]){
					int v = a[j-1];
					a[j-1] = a[j];
					a[j] = v;
					swap++;
				}
			}
		}
		
		String ans = String.valueOf(a[0]);
		
		if(n > 1){
			for (int i = 1; i < a.length; i++) {
				ans += (" " + a[i]);
			}
		}
		System.out.println(ans);
		System.out.println(swap);
	}
}

Measured memory_bytes: 17080
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds;
using namespace std;
#define F first
#define S second
#define pb push_back
#define powerof2 ()
using ll = long long;
const ll M = 1000000007;
const ll infi = 1000000000000000;
const ll md = 998244353;
using vl = vector<ll>;
using pll =  pair<ll,ll>;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> is;
ll power(ll x,ll y){
    if(y==0)
    return 1;
    ll res=power(x,y/2);
    res=(res*res)%M;
    if(y&(ll)1)
    res=(res*x)%M;
    return res;
}


/*int n,ma=0;
vector<vector<int>> gr;
vector<int> color;
void dfs(int c,int p)
{
    vector<int> v;
    int j;
    for(j=1;j<gr[c].size()+2;j++)
    {
        if(j==color[c]||j==color[p])
        continue;
        //cout<<j<<" ";
        v.pb(j);
    }
    //cout<<endl;
    j=0;
    for(int i=0;i<gr[c].size();i++)
    {
        if(gr[c][i]!=p)
        {
            color[gr[c][i]]=v[j];j++;
            dfs(gr[c][i],c);
        }
    }
}*/
void solve(){
    int mi1=(int)1e9,mi2=(int)1e9;
    int a,b,m;
    cin>>a>>b>>m;
    int a1[a],b1[b];
    for(int i=0;i<a;i++){cin>>a1[i];mi1=min(mi1,a1[i]);}
    for(int i=0;i<b;i++){cin>>b1[i];mi2=min(mi2,b1[i]);}
    int x,y,c;int mi3=(int)1e9;
    for(int i=0;i<m;i++)
    {
        cin>>x>>y>>c;
        mi3=min(mi3,max(a1[x-1]+b1[y-1]-c,0));
    }
    cout<<min(mi1+mi2,mi3)<<endl;
}
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    // int t;
    // cin>>t;
    // while(t--)
    solve();
    return 0;
}

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

int ph[5] = {5, 7, 5, 7, 7};

bool check(vector<int> &wl, int l, int r) {
    int cnt = 0, k = 0;
    for (int i=l; i<r; ++i) {
        cnt += wl[i];
        if (cnt == ph[k]) {
            cnt = 0;
            k ++;
        }
    }
    return k == 5;
}

int main() {
    int n;
    while (cin >> n) {
        if (!n) break;
        vector<int> wl(n);
        for (int i=0; i<n; ++i) {
            string w;
            cin >> w;
            wl[i] = w.size();
        }
        
        int ans = -1;
        int i=0, len = 0;
        for (int j=1; j<=n; ++j) {
            len += wl[j-1];
            while (31 < len) {
                len -= wl[i];
                i++;
            }
            if (len == 31 && check(wl, i, j)) {
                ans = i+1;
                break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

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

    map<int, int> mp[2];
    for(int i=0;i<n;i++){
        int a;
        cin >> a;
        mp[i % 2][a]++;
    }

    vector<P> cnt[2];
    for(auto p : mp[0]){
        cnt[0].emplace_back(p.second, p.first);
    }
    cnt[0].emplace_back(0, -1);
    for(auto p : mp[1]){
        cnt[1].emplace_back(p.second, p.first);
    }
    cnt[1].emplace_back(0, -2);

    sort(cnt[0].begin(), cnt[0].end());
    sort(cnt[1].begin(), cnt[1].end());

    if(cnt[0].back().second == cnt[1].back().second){
        if(cnt[0].back().first + cnt[1][cnt[1].size() - 2].first < cnt[1].back().first + cnt[0][cnt[0].size() - 2].first){
            cnt[0].pop_back();
        }else{
            cnt[1].pop_back();
        }
    }
    assert(cnt[0].back().second != cnt[1].back().second);
    cout << n - cnt[0].back().first - cnt[1].back().first << endl;

    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1000111;

const ll MOD = 1000000007LL;

void solve() {

}

bool comp(PILL p1, PILL p2) {
    return p1.second < p2.second;
}

struct Order
{
    bool operator()(PILL const& a, PILL const& b) const
    {
        return a.first < b.first;
    }
};

int n, m;
vector<PILL> arr;
priority_queue<PILL, vector<PILL>, Order> pq;

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

    cin >> n >> m;
    for (int i=0; i<n; i++) {
        int t; ll r;
        cin >> t >> r;
        if (t > m) continue;
        arr.push_back({r,t});
    }
    sort(arr.begin(), arr.end(), comp);

    /*for (auto x: arr) {
        cout << x.second << "\n";
    }*/

    ll ans = 0LL;
    int i = 0;
    int day = m-1;

    while (i < arr.size() && day >= 0) {
        while (i < arr.size() && day+arr[i].second <= m) {
            pq.push(arr[i]);
            i++;
        }
        //cout << "D1:  " << pq.size() << "\n";
        if (!pq.empty()) {
            ans += pq.top().first;
            pq.pop();
        }
        //cout << "D2:  " << ans << "\n";
        day--;
    }

    while (!pq.empty() && day >= 0) {
        if (day+pq.top().second <= m) {
            ans += pq.top().first;
            pq.pop();
        }
        day--;
    }

    cout << ans;


    return 0;
}


Measured memory_bytes: 4848
# https://atcoder.jp/contests/abc100/tasks/abc100_d
# https://www.hamayanhamayan.com/entry/2018/06/17/113721

from itertools import product

N, M = map(int, input().split())
X, Y, Z = [], [], []

for _ in range(N):
    xi, yi, zi = map(int, input().split())
    X.append(xi)
    Y.append(yi)
    Z.append(zi)

# +1/-1で全探索
ans = -1
for a, b, c in product([-1, 1], [-1, 1], [-1, 1]):
    v = [a * X[i] + b * Y[i] + c * Z[i] for i in range(N)]
    v.sort(reverse=True)
    ans = max(ans, sum(v[:M]))
print(ans)

Measured memory_bytes: 73880
from collections import Counter
N, M = map(int, input().split())
A = list(map(int, input().split()))
cumsum = [0]
for a in A:
    cumsum.append((cumsum[-1] + a) % M)

ans = 0
for v in Counter(cumsum).values():
    ans += v * (v - 1) // 2

print(ans)

Measured memory_bytes: 16552
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float("inf")] * n
dp[0] = 0

for i in range(n):
    for j in range(0, min(i, k)+1):
        dp[i] = min(dp[i], dp[i - j] + abs(h[i] - h[i - j]))

print(dp[-1])


Measured memory_bytes: 55392
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int x;
  cin >> x;
  if(x == 3 || x == 5 || x == 7) 
    cout << "YES";
  else 
    cout << "NO";
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
char a[10010]; 
bool c, f;
int main() 
{
    scanf("%s", a);
    for(int i=0; i<strlen(a); i++) 
	{
        if(a[i]=='C') c=true;
        if(a[i]=='F'&&c==true) f=true;
    }
    if(f==true) printf("Yes");
    else printf("No");
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, a, n) for (int i = a; i <= (n); ++i)

using namespace std;
using ll = long long;
using ull = unsigned long long;

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

    bool exists = false;
    if (s[0] == '7') exists = true;
    if (s[1] == '7') exists = true;
    if (s[2] == '7') exists = true;

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


Measured memory_bytes: 3596
n,q = map(int,input().split())
s = str(input())
a = [0]
for i in range(1,n):
    if s[i-1] == "A" and s[i] == "C":
        a.append(a[-1]+1)
    else:
        a.append(a[-1])
for j in range(q):
    u,t = map(int,input().split())
    print(a[t-1]-a[u-1])

Measured memory_bytes: 6100
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int n;
set<int> s;

int main()
{
  cin>>n;
  rep(i,n)
  {
    int x;
    cin>>x;
    s.insert(x);
  }

  cout<<s.size();

}

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

const int N = 100000;
const int MOD = 1e9 + 7;

void update(int& x, int a)
{
    x += a;
    if (x >= MOD) {
        x -= MOD;
    }
}


int n, m, a[N], b[N + 1], cnt[N];

int main()
{
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; ++ i) {
        scanf("%d", a + i);
    }
    b[0] = 0;
    for (int i = 1; i <= m; ++ i) {
        scanf("%d", b + i);
    }
    std::vector<std::pair<int, int>> points;
    for (int i = 0; i < n; ++ i) {
        auto j = static_cast<int>(std::lower_bound(b, b + (m + 1), a[i]) - b) - 1;
        if (1 <= j && j < m) {
            points.emplace_back(a[i] - b[j], a[i] - b[j + 1]);
        }
    }
    std::sort(points.begin(), points.end());
    points.erase(std::unique(points.begin(), points.end()), points.end());
    int n = points.size();
    std::vector<int> values;
    for (int i = 0; i < n; ++ i) {
        values.push_back(-points[i].second);
    }
    std::sort(values.begin(), values.end());
    values.erase(std::unique(values.begin(), values.end()), values.end());
    int res = 1;
    for (int i = 0; i < n; ++ i) {
        int y = std::lower_bound(values.begin(), values.end(), -points[i].second) - values.begin();
        int dp = 1;
        for (int j = y - 1; j >= 0; j -= ~j & j + 1) {
            update(dp, cnt[j]);
        }
        for (int j = y; j < n; j += ~j & j + 1) {
            update(cnt[j], dp);
        }
        update(res, dp);
    }
    printf("%d\n", res);
}

Measured memory_bytes: 2804
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

template<class T>
vector<pair<T, T>> PrimeFactorization(T n) {
    vector<pair<T, T>> f;
    for (T i = 2; i * i <= n; i++) {
        T cnt = 0;
        while (n % i == 0) {
            n /= i;
            cnt++;
        }
        if (cnt > 0) f.push_back(make_pair(i, cnt));
    }
    if (n != 1) f.push_back(make_pair(n, 1));
    return f;
}

ll power(ll n, ll p, ll mod) {
    ll ans = 1;
    while (p > 0) {
        if (p & 1) ans = ans * n % mod;
        n = n * n % mod;
        p >>= 1;
    }
    return ans;
}

ll modinv(ll n, ll mod) {
    return power(n, mod - 2, mod);
}

int main() {
    int N; cin >> N;
    vector<int> A(N);
    REP(i, 0, N) cin >> A[i];

    int factors[(int)pow(10, 6)] = {};
    REP(i, 0, N) {
        auto f = PrimeFactorization(A[i]);
        for (auto elm : f) factors[elm.first] = max(factors[elm.first], elm.second);
    }

    ll lcm = 1;
    REP(i, 1, pow(10, 6)) {
        if (factors[i] == 0) continue;
        lcm = (lcm * power(i, factors[i], MOD)) % MOD;
    }

    ll ans = 0;
    REP(i, 0, N) {
        ans = (ans + (lcm * modinv(A[i], MOD)) % MOD) % MOD;
    }
    cout << ans << endl; 
    
    return 0;
}

Measured memory_bytes: 4224
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;

void main()
{
	auto n = readln.chomp.to!int;
	while (n--) {
		auto pat = readln.chomp;
		auto str = readln.chomp;
		foreach_reverse (e; pat) {
			if (e == 'C') {
				str = str[1..$] ~ str[0];
			} else if (e == 'J') {
				str = str[$-1] ~ str[0..$-1];
			} else if (e == 'E') {
				if (str.length % 2) {
					str = str[str.length/2+1..$] ~ str[str.length/2] ~ str[0..str.length/2];
				} else {
					str = str[str.length/2..$] ~ str[0..str.length/2];
				}
			} else if (e == 'A') {
				str = str.array.reverse.to!string;
			} else if (e == 'M') {
				foreach (i; 0..str.length) {
					if (str[i] >= '0' && str[i] < '9') {
						str = str[0..i] ~ (str[i] + 1).to!char ~ str[i+1..$];
					} else if (str[i] == '9') {
						str = str[0..i] ~ '0' ~ str[i+1..$];
					}
				}
			} else {
				foreach (i; 0..str.length) {
					if (str[i] > '0' && str[i] <= '9') {
						str = str[0..i] ~ (str[i] - 1).to!char ~ str[i+1..$];
					} else if (str[i] == '0') {
						str = str[0..i] ~ '9' ~ str[i+1..$];
					}
				}
			}
		}
		str.writeln;
	}
}

Measured memory_bytes: 1104
#[allow(dead_code)]
fn main() {
    let mut nn = i::i();

    let mut sum:i64=1;
    let mut first = false;
    for x1 in 1..(nn+1) {
        sum = sum * x1;
        sum = sum % (1000000000+7);
    }
    println!("{}",sum);
}


#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }

    pub fn str() -> String {
        read()
    }

    pub fn s() -> Vec<char> {
        str().chars().collect()
    }

    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }
    pub fn strv(n: usize) -> Vec<String> {
        (0..n).map(|_| str()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


Measured memory_bytes: 2156
#include <stdio.h>
#include <string>
#include <iostream>

using namespace std;

int main(){
	int ano = 0,bno = 0;
	string inputt;
	cin>>inputt;

	for(int i =0;i<3;i++){
		if(inputt[i] == 'A'){
			ano +=1;
		}
		else{
			bno +=1;
		}
	}

	if(ano == 3 || bno ==3){
		cout<<"No"<<endl;
	}
	else{
		cout<<"Yes"<<endl;
	}

	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

N = int(sys.stdin.readline())
A = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))

A.insert(0, 0)
A.append(0)

totalCost = 0
for i in range(1, N + 2):
	totalCost += abs(A[i] - A[i - 1])

for i in range(1, N + 1):
	currentCost = totalCost
	currentCost -= abs(A[i] - A[i -1]) + abs(A[i + 1] - A[i]) - abs(A[i + 1] - A[i - 1])
	print (str(currentCost))


Measured memory_bytes: 13924
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
a,b,c = map(int,input().split())

checklis = []
i = a
while not i in checklis:
    num = i % b
    if num == c:
        ans = "YES"
        break
    else:
        checklis.append(num)
        if num==0:
            checklis.append(i)
        i = num + a
else:
    ans = "NO"

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する



Measured memory_bytes: 2940
N, W = map(int, input().split())
dp = [-1]*(W+1)
dp[0] = 0
for _ in range(N):
    w, v = map(int, input().split())
    for i in range(W-w, -1, -1):
        if dp[i] == -1:
            continue
        if dp[i+w] < dp[i] + v:
            dp[i+w] = dp[i] + v
print(max(dp))

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

const long double PI = 3.141592653589793;

long double calcAngle(int h, int m) {
	h %= 12;
	m %= 60;

	long double hour_angle = 0.5 * (h * 60 + m);
	long double minute_angle = 6 * m;

	long double angle = abs(hour_angle - minute_angle);
	angle = min(360 - angle, angle);

	return angle;
}

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

	long double a, b, h, m;
	cin >> a >> b >> h >> m;

	long double angle = calcAngle(h, m);
	// cout << angle << endl;

	long double c = sqrt(a*a + b*b - (2*a*b*cos(angle * PI / 180.0)));
	cout << std::setprecision(16) << c << endl;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n, k;
li a[200200];
li sum[200200];

int main() {

    cin >> n >> k;
    sum[0] = 0;
    rin{
        cin >> a[i];
        sum[i + 1] = sum[i] + a[i];
    }
    li res = 0;
    rep(i, n - k + 1) {
        res = max(res, sum[i + k] - sum[i]);
    }

    printf("%f\n", (res + k) / 2.0);

    return 0;
}

Measured memory_bytes: 3328
N = int(input())

A = list(map(int,input().split()))

Ans = 0

but = 0

while (True):
	for i in range(N):
		if A[i] % 2 == 1:
			but = 1
		else:
			A[i] /= 2
	if but == 1:
		break
		
	Ans += 1
	
print(Ans)
	
	
	
	 
	


Measured memory_bytes: 2940
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<vector>

int main() {
   
   int A, B, X;
   std::cin >> A >> B >> X;
   
   if (A <= X && X <= A + B) std::cout << "YES" << std::endl;
   else std::cout << "NO" << std::endl;
   return 0;
}


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

int main(){
        int n, q;
        long long k;
        scanf("%d %lld %d",&n,&k,&q);

        int *a=(int *)malloc(sizeof(int)*n);
        int a2[100000]={0};
        int t=0;
        for(int i=0;i<q;i++){
                scanf("%d",&t);
                t--;
                a2[t]++;
        }
        for(int i=0;i<n;i++){
                if(a[i]+k-(q-a2[i])>0)puts("Yes");
                else puts("No");
        }
}

Measured memory_bytes: 896
open System

let n = stdin.ReadLine() |> int64

let halfN = float n |> Math.Sqrt |> int64
 
let rec inf i =
    seq{
        yield i
        yield! inf (i-1L)
    }

inf halfN |> Seq.find (fun x -> n % x = 0L) |> fun x -> (x, n / x)
||> (+) |> fun x -> x - 2L |> stdout.WriteLine

Measured memory_bytes: 19520
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
#include<unordered_map>
#include <queue>
 
using namespace std;
using ll=long long;
#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()
 
int main(){
    ll k, t;
    cin >> k >> t;
    vector<ll> a(t);
    ll sum = 0;
    rep(i, t){
        cin >> a[i];
        sum += a[i];
    }
    sort(ALL(a), greater<ll>());
    sum-=a.front();
    ll ans = a.front()-sum;
    if(ans <= 1)cout << 0;
    else cout << ans-1 << endl;
}

Measured memory_bytes: 256
import math
s = str(input())
state = True
n =len(s)
s += "R"
lr = 0
ll = 0
ans = [0 for _ in range(n)]
for i in range(n+1):
  if state:
    if s[i] == "L":
      ll = i
      ans[i-1] += math.ceil((i-lr)/2)
      ans[i] += math.floor((i-lr)/2)
      state = False
  else:
    if s[i] == "R":
      lr = i
      ans[ll] += math.ceil((i-ll)/2)
      ans[ll-1] +=  math.floor((i-ll)/2)
      state = True
for i in range(n):
  print(ans[i],end=" ")

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

#define int long long

using namespace std;
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007,INF=1e18;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

int n,z,w,a[100010];

signed main(){
    cin>>n>>z>>w;
    rep(i,0,n){
        cin>>a[i];
    }
    if(n==1){
        cout<<abs(w-a[0])<<endl;
        return 0;
    }
    int x=a[n-2],y=a[n-1];
    int ans1=abs(x-y);
    int ans2=abs(y-w);
    cout<<max(ans1,ans2)<<endl;
    
    
    
    
    return 0;
}

Measured memory_bytes: 256