jiahuimbzuai/CoQuIR huggingface dataset:
//  [ruby]
#exec({'RUBY_THREAD_VM_STACK_SIZE'=>'100000000'},'/usr/bin/ruby', $0) if !ENV['RUBY_THREAD_VM_STACK_SIZE']
require 'prime'

def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def sum(a) a.inject(:+) end

def big(a,b) return (a>b)? a:b end

def small(a,b) return (a<b)? a:b end

k = inp[0]
a,b = inp
(a..b).each do |d|
  if(d%k == 0)
    puts "OK"
    exit
  end
end

puts "NG"
//  [swift]
let k = cin.n
var (a,b) = cin.pair

while(a <= b) {
  if a%k == 0 {
    print("OK")
    a = 9999
    break
  }
  a += 1
}

if a != 9999 {
  print("NG")
}

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var n: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var line: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { line.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { line.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in n } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [swift]
///Users/wantedly/Documents/git/atcoder-swift/Sources/atcoder-swift/main

let k = cin.n
var (a,b) = cin.pair

while(a <= b) {
  if a%k == 0 {
    print("OK")
    a = 9999
    break
  }
  a += 1
}

if a != 9999 {
  print("NG")
}

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var n: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var line: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { line.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { line.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in n } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const K = Number(input[0][0]);
  const [A, B] = input[1].map(Number);

  for (let i = A; i <= B; i++) {
    if (i % K === 0) {
      return "OK";
    }
  }

  return "NG";
};

console.log(main(read()));
//  [typescript]
const lines: string[] = [];
const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});
reader.on("line", function (line: string) {
  lines.push(line);
});

reader.on("close", function () {
  const input = Number(lines[0]);

  //数字の配列
  const inputs = lines[1].split(" ").map(Number);

  for (let i = inputs[0]; i <= inputs[1]; i++) {
    if (i % input === 0) {
      console.log("OK");
      return;
    }
  }

  console.log("NG");
});
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
INF = float('inf')
MOD = 10 ** 9 + 7
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rf(): return float(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]
def rf_(): return [float(_) for _ in rs().split()]
def divisors(n, sortedresult=True):
    div = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            div.append(i)
            if i != n // i:
                div.append(n//i)
    if sortedresult:
        div.sort()
    return div
# endregion
A, B = ri_()
print(A + B if A + B < 10 else 'error')
//  [python]
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**6)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
# endregion
s = sum(ri_())
print(s if s < 10 else 'error')
//  [python]
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

A,B = inputIL()

if A+B>9:
  print("error")
else:
  print(A+B)
//  [java]
import java.util.*;

public class Main{
        
	public static void main (String[] args) throws java.lang.Exception { 
             Scanner sc = new Scanner(System.in);
                          
             int A = sc.nextInt();
             
             int B = sc.nextInt();
             
            if(A+B < 10){             
               System.out.println(A+B);
            }else{
               System.out.println("error");
            }
               
            
                
        }        
}
//  [java]
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int a=stdIn.nextInt(),b=stdIn.nextInt();
		if(10>a+b) System.out.print(a+b);
		else System.out.print("error");
	}
}
//  [java]
import java.util.Scanner;

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

		@SuppressWarnings("resource")
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int y = scan.nextInt();
   
		if(x+y <10){
			System.out.println(x+y);
		} else if(x+y>=10){
			System.out.println("error");
		}
	}

}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
const int mod=1e9+7;
 
struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};
 
mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}
 
bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
 
    return true;
}
 
map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
 
void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}
 
int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int a,b;cin>>a>>b;
  int ans=a+b;
  
  if(ans>=10){
      cout("error");
  }
  else cout(ans);
  
  return 0;
}
//  [cpp]
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
   ll dp[2000000];
 int gcd(int a, int b)
{
  if (a%b == 0)
{
return(b);
}
else
{
return(gcd(b,a%b));
}
}
int main(){
  ll a,b,c;cin>>a>>b;
  c=a+b;
  if(c<10)cout<<c;
  else cout<<"error";
}
//  [cpp]
# include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <math.h>
# include <algorithm>
using namespace std;
# define pi acos(-1.0)
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
typedef long long LL;
typedef unsigned long long ULL;

int main()
{
    int a,b;
    cin>>a>>b;
    if(a+b<10)
        cout<<a+b<<endl;
    else
        cout<<"error"<<endl;
    return 0;
}
//  [c]
#include<stdio.h>
int cal(int *a);
int main(){
int a,b;
scanf("%d%d",&a,&b);
if((a>=1&&a<=9)&&(b>=1&&b<=9)){
a+=b;
cal(&a);
}
return 0;
}
int cal(int *a)
{
    if(*a<10){
        printf("%d\n",*a);
    }
    else{
        printf("error\n");
    }
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int A, B;

    scanf("%d%d", &A, &B);

    if(A + B >= 10){
        printf("error\n");
    }else{
        printf("%d\n", A + B);
    }

    return 0;
}
//  [c]
#include<stdio.h>
int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  if(a+b<10)
    printf("%d\n",a+b);
  else
    puts("error");
  return 0;
}
//  [javascript]
function Main( input ){
	input = input.split( '\n' )
  num = input[0].split( ' ' )
  var a = Number( num[0] )
  var b = Number( num[1] )
  if( a + b >= 10 ) console.log( 'error' )
  else console.log( a + b )
}

Main( require( 'fs' ).readFileSync( '/dev/stdin', 'utf8' ) )
//  [javascript]
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Here your code !
process.stdin.on('data', function (chunk) {
    var lines = chunk.toString().split(' ');
    var A = parseInt(lines[0]);
    var B = parseInt(lines[1]);
    
    if(A+B >=10){
        console.log("error");
    }else{
        console.log(A+B);
    }
});
//  [javascript]
inp = require('fs').readFileSync('/dev/stdin', 'utf8').split('\n')[0].split(' ')
A = inp.shift() * 1
B = inp.shift() * 1
console.log(A + B > 9 ? 'error' : A + B)
//  [go]
package main

import "fmt"

func main() {
	var (
		a, b int
	)

	fmt.Scan(&a)
	fmt.Scan(&b)

	if a+b >= 10 {
		fmt.Print("error")
	} else {
		fmt.Print(a + b)
	}
}
//  [go]
package main

import "fmt"

func main() {
	// Code for A - Restricted
	var A, B int
	fmt.Scanf("%d %d", &A, &B)

	if A+B < 10 {
		fmt.Println(A + B)
	} else {
		fmt.Println("error")
	}
}
//  [go]
package main

import (
  "fmt"
)

func main() {
  var a, b int
  
  fmt.Scanf("%d %d", &a, &b)
  
  sum := a + b
  if sum < 10{
    fmt.Printf("%d", sum)
  }else{
    fmt.Printf("error")
  }
}
//  [ruby]
require 'prime'
require 'set'
require 'tsort'
include Math
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end

n = gi

if n[0]+n[1] >=10
puts "error"
else
  puts (n[0]+n[1])
end
//  [ruby]
a, b = gets().chomp.split("\s").map{|x| x.to_i}

puts (a + b) >= 10 ? 'error' : (a + b)
//  [ruby]
a = gets.chomp.split(" ").map(&:to_i).inject(:+)
puts a >= 10 ? "error" : a
//  [rust]
fn main() {
	proconio::input!{
		a: usize,
		b: usize,
	}

	let sum = a+b;
	if sum >= 10 {
		println!("error");
	}
	else {
		println!("{}", sum);
	}
}
//  [rust]
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        a: usize,
        b: usize,
    }
    if a+b >= 10 {
        println!("error");
    } else {
        println!("{}", a+b);
    }
}
//  [typescript]
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const [A, B] = input[0].map(Number);

  const sum = A + B;

  return sum >= 10 ? "error" : sum;
};

console.log(main(read()));
//  [typescript]
import * as fs from 'fs';

const [a, b]: number[] = fs.readFileSync('/dev/stdin', 'utf8').trim().split(' ').map(Number);
console.log((a+b>9)?'error':(a+b).toString());
//  [typescript]
var input: string = require('fs').readFileSync('/dev/stdin', 'utf8');
var inputLines: string[] = input.trim().split("\n");
var parts = inputLines[0].split(" ");

var A = parseInt(parts[0]);
var B = parseInt(parts[1]);
console.log(A + B > 9 ? "error" : String(A + B));
//  [python]
# -*- coding: utf-8 -*-

import os
import sys
import math
import numpy as np


def main():
    a, b, c, k = list(map(int, input().split()))

    ans = a - b

    if k % 2 == 1:
        ans *= -1

    if abs(ans) > 10**18:
        print('Unfair')
    else:
        print(ans)

    

if __name__ == '__main__':
    main()
//  [python]
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
a,b,c,k = map(int, input().split())

if k % 2 == 0:
    print(a-b)
else :
    print(b-a)
//  [python]
import numpy as np

a, b, c, k = map(int, input().strip().split())


def mono(a, b, c):
    return b + c, c + a, a + b


# ダブリング
def doubling(a, b, c, coeff):
    vec = np.array([a, b, c])
    result = np.dot(coeff, vec)
    return result


def doubling_n_times(a, b, c, n):
    coeff = np.array([
        [0, 1, 1],
        [1, 0, 1],
        [1, 1, 0],
    ], dtype=np.int)
    for i in range(n - 1):
        coeff = np.dot(coeff, coeff)

    a, b, c = doubling(a, b, c, coeff)

    return a, b, c


def solve(a, b, c, k):
    pow = 0
    while k > 0:
        bit = k % 2
        k //= 2
        pow += 1
        if bit == 0:
            continue

        a, b, c = doubling_n_times(a, b, c, pow)

    return a, b, c


def solve_naively(a, b, c, k):
    for i in range(k):
        a, b, c = mono(a, b, c)
        if i + 1 in (1, 2, 4, 8, 16, 32):
            print("a, b, c, i + 1 = ", a, b, c, i + 1)

    return a, b, c


a, b, c = solve(a, b, c, k)

ans = a - b
if abs(ans) > 1e18:
    print('Unfair')
else:
    print(ans)
//  [java]
// package agc.agc024;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        if (in.nextLong() % 2 == 0) {
            out.println(a - b);
        } else {
            out.println(b - a);
        }
        out.flush();
    }

    public static void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 12;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int next() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            return (char) skipWhileSpace();
        }

        public String nextToken() {
            int c = skipWhileSpace();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public long nextLong() {
            int c = skipWhileSpace();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        int skipWhileSpace() {
            int c = next();
            while (isSpaceChar(c)) {
                c = next();
            }
            return c;
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}
//  [cpp]
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,k1,k2;
  int64_t k,ans=0;
  cin >> a >> b >> c >> k;
  for(int i=0;i<k;i++){
    k1=a;
    k2=b;
    a=b+c;
    b=k1+c;
    c=k1+k2;
    if(abs(a-b)>=1000000000000000000){
      cout << "Unfair" << endl;
      return 0;
    }
  }
  ans=a-b;
  cout << ans << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
#define MAX pow(10,18)
typedef long long ll;

void Calc(ll *A,ll *B,ll *C){
    
    ll a,b,c;
    a = *B + *C;
    b = *A + *C;
    c = *A + *B;
    
    *A = a;
    *B = b;
    *C = c;
}
int main(){
  
  ll A,B,C,K;
  cin >> A >> B >> C >> K;
  
  for(int i=0;i<K;i++){
      Calc(&A,&B,&C);
  }
  if(abs(A - B) > MAX) cout << "Unfair" << endl;
  else cout << A - B << endl;
}
//  [cpp]
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,B,C,K;
  cin>>A>>B>>C>>K;
  for(int X=0;X<K;X++){
    long long AA=B+C;
    long long BB=A+C;
    long long CC=A+B;
    A=AA;
    B=BB;
    C=CC;
  }
  if(A-B<1000000000000000000){
    cout<<A-B<<endl;
  }
  else{
    cout<<"Unfair"<<endl;
  }
}
//  [c]
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define rep(i,n) for(int i=0;i<n;i++)
int gcd(int a, int b){
    int r=1;
    while(r!=0){
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}
typedef long long ll;
void revStr(char* str){
    int size = strlen(str);
    int i,j;
    char tmp = {0};
    for(i = 0, j = size - 1; i < size / 2; i++, j--){
        tmp = str[i];
        str[i] = str[j];
        str[j] = tmp;
    }return;
}
typedef struct{
    int a,b;
}data;

//昇順
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
//構造体降順
int comp( const void *c1, const void *c2 )
{
  data test1 = *(data *)c1;
  data test2 = *(data *)c2;
  int tmp1 = test1.b;   /* b を基準とする */
  int tmp2 = test2.b;
  return tmp2 - tmp1;
}


int kai(int n){
    if(n==0){
        return 1;
    }
    int sum=1;
    for(int i=1;i<=n;i++){
        sum*=i;
    }
    return sum;
}

int main(){
    ll A,B,C,K;
    scanf("%lld%lld%lld%lld",&A,&B,&C,&K);
    if(A==B && B==C){
        printf("0");
        return 0;
    }
    rep(i,K){
        ll temp1=0,temp2=0;
        temp1=A+B;
        temp2=A+C;
        A=B+C;
        B=temp2;
        C=temp1;
    }
    if(A-B>1000000000000000000||A-B<-1000000000000000000){
        printf("Unfair");
        return 0;
    }else{
        printf("%lld",A-B);
    }
    
}
//  [c]
#include <stdio.h>
int main(void)
{
  int a,b,c,x,y,z,i,t,n;
  long k;
  scanf("%d %d %d %ld",&a,&b,&c,&k);
  
  y=1;
  
  if(k%2==1)
  {
    for(i=0;i<(k-1)/2;i++)
      y=y*4-1;
    x=y-1;
    z=y;
  }
  
  else if(k%2==0)
  {
    for(i=0;i<(k-2)/2;i++)
      y=y*4+1;
    x=y+1;
    z=y;
  }
  
  t=x*a+y*b+z*c;
  n=z*a+x*b+y*c;
  
  if(t-n<-1000000000000000000)
    printf("Unfair");
  
  else if(t-n>1000000000000000000)
    printf("Unfair");
  
  else 
    printf("%d",t-n);
}
//  [c]
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

typedef long long ll;
typedef char keytype;

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

/* a[0], ..., a[n-1] の数の最大公約数 */
int ngcd(int n, int a[])
{
    int i, d;

    d = a[0];
    for (i = 1; i < n && d != 1; i++)
        d = gcd(a[i], d);
    return d;
}

void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int is_prime(int x){
    if(x <= 1) return 0;
    for(int i = 2; i * i <= x; i++){
        if(x % i == 0) return 0;
    }
    return 1;
}

int is_substr(char s[], char t[], int i){
    int flag = 1;

    if(s[i] == '\0') flag = 0;

    for(int j = 0; j < strlen(t); ++j, ++i){
        if(s[i] != t[j]){
            flag = 0;
            break;
        }
    }
    return flag;
}

// factor list, number of factors, natural number
void factorize(int ftr[], int *num, int n){
    int a = 2, cnt = 0;

    while(n >= a){
        if(n % a == 0){
            n = n / a;
            ftr[cnt++] = a;
        }else{
            a++;
        }
    }
    *num = cnt;
}

//#define N 5
//int p[N + 1];
int nextperm(int p[], int N)  /* 辞書式順序で次の順列 */
{
    int i, j, t;

    i = N - 1;
    p[0] = 0;  /* 番人 */
    while (p[i] >= p[i + 1]) i--;
    if (i == 0) return 0;  /* 完了 */
    j = N;
    while (p[i] >= p[j]) j--;
    t = p[i];  p[i] = p[j];  p[j] = t;
    i++;  j = N;
    while (i < j) {
        t = p[i];  p[i] = p[j];  p[j] = t;  i++;  j--;
    }
    return 1;  /* 未了 */
}

void comb(int size1, int size2, int v[size1][size2]){
  for(int i = 0; i < size1; i++){
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for(int k = 1; k < size1; k++){
    for(int j = 1; j < k; j++){
      v[k][j] = (v[k-1][j-1] + v[k-1][j]);
    }
  }
}

int abs_val(int a, int b){
    if(a > b) return a - b;
    else return b - a;
}

const int inf = 1012345678;
int main(){
    int a, b, c;
    ll k;

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

    int ans = a - b;
    if((k % 2) == 1) ans = -ans;

    printf("%d\n", ans);

    return 0;
}
//  [javascript]
function Main(s){
  s = s.split(" ");
  var k = s[3];
  var a = +s[0];
  var b = +s[1];
  k = k[k.length-1];
  console.log(k % 2 === 0 ? a - b: b - a);
}

Main(require("fs").readFileSync("/dev/stdin","utf8").trim());
//  [javascript]
"use strict";

const A_INDEX = 0;
const B_INDEX = 1;
const K_INDEX = 3;
const LIMIT = Math.pow(10, 18);

const main = arg => {
    const indexArr = arg.trim().split("\n")[0].split(" ");
    const ans = parseInt(indexArr[A_INDEX]) - parseInt(indexArr[B_INDEX]);
    const KString = indexArr[K_INDEX];
    const K = parseInt(KString.charAt(KString.length-1));

    if (Math.abs(ans) > LIMIT) {
        console.log("Unfair")
    } else {
        console.log(K % 2 === 0 || ans === 0 ? ans : -ans);
    }
}

main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
//  [go]
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	scanInit()

	a := nextInt()
	b := nextInt()
	_ = nextInt()
	k := nextInt()

	ans := a - b
	if k%2 == 1 {
		ans = b - a
	}

	fmt.Println(ans)

}

// ---- readfunc
func scanInit() {
	const cap = 200 * 1024 // Default=64
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}
//  [go]
package main

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

func main() {
	A, B, _, K := ReadInt(), ReadInt(), ReadInt(), ReadInt()
	if K%2 == 1 {
		fmt.Println(B - A)
	} else {
		fmt.Println(A - B)
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b, _ := getInt(), getInt(), getInt()
	k := getInt()

	if k%2 == 1 {
		a, b = b, a
	}

	if abs(a-b) > 1e18 {
		out("Unfair")
		return
	}
	out(a - b)
}
//  [ruby]
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end

a, b, c, k = gets_i_list

if k.even?
  puts a - b
else
  puts b - a
end
//  [ruby]
a,b,c,k=gets.split.map(&:to_i)

if k%2==0
    ans=a-b
else
    ans=b-a
end

if ans.abs>10**18
    puts "Unfair"
else
    puts ans
end
//  [ruby]
A,B,C,K = gets.split(" ").map(&:to_i)

if K % 2 == 0
    puts A - B
else
    puts B - A
end
//  [rust]
#[allow(unused_imports)]
use std::{cmp::Reverse, collections::*};

#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Chars, Usize1},
};

#[allow(unused_imports)]
use itertools::Itertools;

#[allow(unused_imports)]
use num::Integer;

#[fastout]
pub fn main() {
    input! {
        a: i64, b: i64, _c: i64, k: i64,
    }
    if k % 2 == 0 {
        println!("{}", a - b);
    } else {
        println!("{}", b - a);
    }
}
//  [rust]
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<i64>();
    let (a, b, c, k) = (v[0], v[1], v[2], v[3]);
    if k % 2 == 1
         {
        println!("{}", b - a);
    } else {
        println!("{}", a - b);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
//  [rust]
use proconio::input;


fn solve(a: i128, b: i128, _: i128, k: i128) {
    if k % 2 == 0 {
        println!("{}", a-b);
    }
    else {
        println!("{}", b-a);
    }
}


fn main() {
    input! {
        a: i128,
        b: i128,
        c: i128,
        k: i128,
    }

    solve(a, b, c, k);
}
//  [python]
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)

n,m = map(int,input().split())
a = list(map(int,input().split()))
toku = sum(a)
flag = toku*(1/(4*m))
cnt = 0
for i in range(len(a)):
    if a[i]>=flag:
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")
//  [python]
import numpy as np
from sys import stdin


def get_result(data):
    N, M = data[0]
    A = np.array(data[1])
    total = sum(A)
    pop_goods = A[A >= total/(4*M)]
    if len(pop_goods) >= M:
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    raw_data = [val.rstrip() for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)
//  [python]
import numpy as np
N,M=map(int,input().split())
A=np.array(list(map(int,input().split())))
ninki_array = A>=1/(4*M)*np.sum(A)
ninki_num = np.sum(ninki_array)
if ninki_num>=M:
    print('Yes')
else:
    print('No')
//  [java]


import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);
		int n, m;
		int totalTokuhyo = 0;

		n = scan.nextInt();
		m = scan.nextInt();

		int[] a = new int[n + 1];

		for (int i = 1; i <= n; i++) {
			a[i] = scan.nextInt();
			totalTokuhyo += a[i];
		}

		final int f_total = totalTokuhyo;

		long count = Arrays.stream(a).filter(item -> item >= f_total * (1 / ((double) 4 * m))).count();

		if (count >= m) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}

	/**
	 * 文字列を反転して返す
	 * @param pStr 文字列
	 * @return 反転した文字列
	 */
	public static String myReverse(String pStr) {
		if (pStr.length() < 1) {
			return "";
		}

		StringBuffer sb = new StringBuffer(pStr);
		return sb.reverse().toString();
	}

	/**
	 * 余りを求める。
	 * @param a
	 * @param b
	 * @return 余り。余りがマイナスの時はプラスで返す。
	 */
	public static long myMod(long a, long b) {
		long ret = 0;

		ret = a % b;

		if (ret < 0) {
			ret += b;
		}

		return ret;
	}

	/**
	 * 乗数を求める ※mod対応
	 * @param kisu 基数
	 * @param josu 乗数
	 * @param primeNumMod_0 法 mod値 使わない場合は「0」
	 * @return
	 */
	public static long myPowWithMod(long kisu, long josu, long primeNumMod_0) {

		long ans = 1;

		//乗数が0の場合→1
		if (josu == 0)
			return 1;

		if (primeNumMod_0 == 0) {
			//modを使わないとき

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= kisu;
					josu = josu / 2;
				} else {
					//累乗が奇数の時
					ans *= kisu;
					josu--;
				}
			}

			return ans;

		} else {
			//modを使うとき

			//初めに桁を落とす
			kisu = myMod(kisu, primeNumMod_0);

			while (josu > 0) {

				if (josu % 2 == 0) {
					//累乗が偶数の時

					kisu *= myMod(kisu, primeNumMod_0);
					josu = josu / 2;

				} else {
					//累乗が奇数の時
					ans *= myMod(kisu, primeNumMod_0);
					josu--;

				}
			}

			return myMod(ans, primeNumMod_0);

		}

	}

}
//  [java]
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int items[] = new int[N];
        for (int i = 0; i < N; i ++) {
            items[i] = sc.nextInt();
        }
        int total = Arrays.stream(items).sum();
        double min = 1.0 * total / (4 * M);
        int cnt = Arrays.stream(items).filter(i -> i >= min).map(i -> 1).sum();
        if (cnt >= M) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}
//  [java]
import java.util.Arrays;
import java.util.Scanner;

final class Solver {
	static final Solver INSTANCE = new Solver();

	void solve(Scanner sc) {
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int[] A = new int[N];
		Arrays.setAll(A, $ -> Integer.parseInt(sc.next()));
		int sum = Arrays.stream(A).sum();
		long count = Arrays.stream(A).filter(i -> 4 * i * M >= sum).count();
		System.out.println(count < M ? "No" : "Yes");
	}
}

class Main {
	public static void main(String... args) {
		Scanner in = new Scanner(System.in);

		Solver.INSTANCE.solve(in);

		in.close();
	}
}
//  [cpp]
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int inf = 1001001001;

int main(){
  int n,m;
  double total = 0;;
  vector<double> a(n);
  cin >> n >> m;
  rep(i,n) {
    cin >> a.at(i);
    total += a.at(i);
  }
  
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  
  if(a.at(m-1) < total/(4*m)) cout << "No" << endl;
  else cout << "Yes" << endl;  
}
//  [cpp]
    #include <bits/stdc++.h>
    using namespace std;
                
      int main() {
        int N, M;
        vector<int> A(N);
        int soutoku=0;
        int hantei=0;

        cin >> N >> M;
          for(int i=0; i<N; i++){
            cin >> A.at(i);
        //    soutoku += A[i];
          }
                
        sort(A.begin(), A.end());
        reverse(A.begin(), A.end());

        //sort(A.begin(),A.end(),std::greater<int>);
         
        for(int i=0; i<N; i++){
          soutoku=soutoku+A.at(i);
        }

        
 
        for(int i=0; i<M; i++){
          if(A.at(i)>=(double)soutoku/(4*M)){
            hantei++;
          }
        }

        if(hantei<M){
          cout << "No" << endl;
        }
        else{
          cout << "Yes" << endl;
          }
        return 0;
        }
//  [cpp]
    #include <bits/stdc++.h>
    using namespace std;
                
      int main() {
        int N, M;
        vector<int> A(N);
        int soutoku=0;
        int hantei=0;

        cin >> N >> M;
          for(int i=0; i<N; i++){
            cin >> A.at(i);
            soutoku += A[i];
          }
                
        sort(A.begin(),A.end(),std::greater<int>());

        if(A.at(M-1)>=(double)soutoku/(4*M)){
          cout << "Yes" << endl;
        }
        else{
          cout << "No" << endl;
        }
        return 0;
        }
//  [c]
#include<stdio.h>

int main() {
	int n = 0;
	int m = 0;
	int c = 0;
	int t = 0;
	int v[101];
	scanf("%d %d", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%d", &v[i]);
	}
	for (int i = 0; i < n; i++) {
		t = t + v[i];
	}
	for (int i = 0; i < n; i++) {
		if (v[i] >= (float)t / (4 * m)) {
			c = c + 1;
		}
	}
	if (c >= m) {
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}
//  [c]
#include <stdio.h>

int main(void) {  
  int N=0, M=0;
  int vote[100];
  scanf("%d%d",&N,&M);
  int count = 0;
  int sum = 0;
  for (int i = 0; i < N; ++i) { 
    scanf("%d",&vote[i]);
    sum += vote[i];
  }
  
  for (int i = 0; i < N; ++i){
    if (vote[i] >= (double)sum/(4*M)) count++;
  }
  
  if (count >= M) printf("Yes");
  else printf("No");
  
  return 0;
}
//  [c]
#include <stdio.h>
int main(void){
  int i, n, m, a[100], sum, counter;
  
  if( scanf("%d %d",&n ,&m)==1 );
  for(i=0;i<n;i++) if( scanf("%d",&a[i])==1 );
  
  sum = 0;
  for(i=0;i<n;i++) sum += a[i];
  
  counter = 0;
  for(i=0;i<n;i++)
    if(a[i] * 4 * m  >= sum)
      counter++;
  
  if(counter >= m)
    printf("Yes");
  else
    printf("No");
  
  return 0;
}
//  [javascript]
'use strict';
const p = s => console.log(s);

// inputに入力データ全体が入る
function Main(input) {
  // 1行目がinput[0], 2行目がinput[1], …に入る
  input = input.split("\n");
  let N = input[0].split(" ")[0];
  let M = input[0].split(" ")[1];
  let tmp = input[1].split(" ");
  let sum =0;
  let cnt=0;
  let result = 'No';

  let A = [];
  for (let i= 0; i < N; i++) {
    A.push(parseInt(tmp[i],10));
    sum += parseInt(tmp[i],10);
  }

  for (let i=0; i < N; i++) {
    if( A[i] >= (sum/(4*M))) cnt++;
    if( cnt > M -1) {
        result = "Yes";
        break;
    }
  }
  p(result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//  [javascript]
function Main(input) {
    var N = parseInt(input[0], 10);
    var M = parseInt(input[1], 10);
    var A = input.slice(2).map(i => parseInt(i, 10));

    var sum = 0;

    for (var i = 0; i < N; i++) {
        sum += A[i];
    }
    
    var min = sum / (4 * M);
    var result = 0;

    for (var i = 0; i < N; i++) {
        if (A[i] >= min) {
            result++;
        }
    }

    console.log(result >= M ? 'Yes' : 'No');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));
//  [javascript]
"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const M = parseInt(arg[0].split(" ")[1]);
    const A = arg[1].split(" ").map(Number);
    
    let sum = A.reduce((m,n)=>m+n);
    let popular = 0;
    
    for(let i in A) {
        const limit = sum * (1 / (4 * M));
        
        if(A[i] >= limit) {
            popular++;
        }
    }

    console.log(popular >= M ? "Yes" : "No");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
//  [go]
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

const (
	maxBufsize = 1000000
)

func inputs(lines int) []string {
	var strSlice []string

	rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)

	for i := 0; i < lines; i++ {

		line := ReadLine(rdr)
		strSlice = append(strSlice, line)

	}

	return strSlice
}

// ReadLine is to read long line
func ReadLine(rdr *bufio.Reader) string {
	buf := make([]byte, 0, maxBufsize)
	for {
		l, p, e := rdr.ReadLine()

		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}

	return string(buf)
}

func main() {
	line := inputs(2)

	line1 := strings.Split(line[0], " ")

	n, _ := strconv.Atoi(line1[0])
	m, _ := strconv.Atoi(line1[1])

	line2 := strings.Split(line[1], " ")
	a := make([]int, n+1)

	allVotes := 0
	for i := 1; i < (n + 1); i++ {
		a[i], _ = strconv.Atoi(line2[i-1])
		allVotes += a[i]
	}

	limit := float64(allVotes) / float64(4*m)

	count := 0

	for i := 1; i < (n + 1); i++ {
		if float64(a[i]) >= limit {
			count++
		}
	}

	if count >= m {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}