WeixiangYan/CodeTransOcean huggingface dataset:
Task: Yin and yang



C#:     public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Paint += Form1_Paint;
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            DrawTaijitu(g, new Point(50, 50), 200, true);
            DrawTaijitu(g, new Point(10, 10), 60, true);
        }

        private void DrawTaijitu(Graphics g, Point pt, int width, bool hasOutline)
        {
            g.FillPie(Brushes.Black, pt.X, pt.Y, width, width, 90, 180);
            g.FillPie(Brushes.White, pt.X, pt.Y, width, width, 270, 180);
            float headSize = Convert.ToSingle(width * 0.5);
            float headXPosition = Convert.ToSingle(pt.X + (width * 0.25));
            g.FillEllipse(Brushes.Black, headXPosition, Convert.ToSingle(pt.Y), headSize, headSize);
            g.FillEllipse(Brushes.White, headXPosition, Convert.ToSingle(pt.Y + (width * 0.5)), headSize, headSize);
            float headBlobSize = Convert.ToSingle(width * 0.125);
            float headBlobXPosition = Convert.ToSingle(pt.X + (width * 0.4375));
            g.FillEllipse(Brushes.White, headBlobXPosition, Convert.ToSingle(pt.Y + (width * 0.1875)), headBlobSize, headBlobSize);
            g.FillEllipse(Brushes.Black, headBlobXPosition, Convert.ToSingle(pt.Y + (width * 0.6875)), headBlobSize, headBlobSize);
            if (hasOutline) g.DrawEllipse(Pens.Black, pt.X, pt.Y, width, width);
        }
    }





Python: import math
def yinyang(n=3):
	radii   = [i * n for i in (1, 3, 6)]
	ranges  = [list(range(-r, r+1)) for r in radii]
	squares = [[ (x,y) for x in rnge for y in rnge]
		   for rnge in ranges]
	circles = [[ (x,y) for x,y in sqrpoints
		     if math.hypot(x,y) <= radius ]
		   for sqrpoints, radius in zip(squares, radii)]
	m = {(x,y):' ' for x,y in squares[-1]}
	for x,y in circles[-1]:
		m[x,y] = '*'
	for x,y in circles[-1]:
		if x>0: m[(x,y)] = '·'
	for x,y in circles[-2]:
		m[(x,y+3*n)] = '*'
		m[(x,y-3*n)] = '·'
	for x,y in circles[-3]:
		m[(x,y+3*n)] = '·'
		m[(x,y-3*n)] = '*'
	return '\n'.join(''.join(m[(x,y)] for x in reversed(ranges[-1])) for y in ranges[-1])
Task: Singly-linked list_Element definition

C: struct link {
  struct link *next;
  int data;
};



C#: class LinkedListNode
{
    public int Value { get; set; }
    public LinkedListNode Next { get; set; }

    
    public Link(int value, LinkedListNode next = null)
    {
        Item = value;
        Next = next;
    }
}
Task: Singly-linked list_Element definition

C: struct link {
  struct link *next;
  int data;
};




Go: type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) Append(data interface{}) *Ele {
    if e.Next == nil {
        e.Next = &Ele{data, nil}
    } else {
        tmp := &Ele{data, e.Next}
        e.Next = tmp
    }
    return e.Next
}

func (e *Ele) String() string {
    return fmt.Sprintf("Ele: %v", e.Data)
}
Task: Singly-linked list_Element definition


C++: struct link
{
  link* next;
  int data;
};


C#: class LinkedListNode
{
    public int Value { get; set; }
    public LinkedListNode Next { get; set; }

    
    public Link(int value, LinkedListNode next = null)
    {
        Item = value;
        Next = next;
    }
}
Task: Singly-linked list_Element definition


C++: struct link
{
  link* next;
  int data;
};






Python: class LinkedList(object):
     
	class Node(object):
		def __init__(self, item):
			self.value  = item
			self.next = None
	def __init__(self, item=None):
		if item is not None:
			self.head = Node(item); self.tail = self.head
		else:
			self.head = None; self.tail = None
	def append(self, item):
		if not self.head:
			self.head = Node(item)
			self.tail = self.head
		elif self.tail:
			self.tail.next = Node(item)
			self.tail = self.tail.next
		else:
			self.tail = Node(item)
	def __iter__(self):
		cursor = self.head
		while cursor:
			yield cursor.value
			cursor = cursor.next
Task: Singly-linked list_Element definition



C#: class LinkedListNode
{
    public int Value { get; set; }
    public LinkedListNode Next { get; set; }

    
    public Link(int value, LinkedListNode next = null)
    {
        Item = value;
        Next = next;
    }
}


Go: type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) Append(data interface{}) *Ele {
    if e.Next == nil {
        e.Next = &Ele{data, nil}
    } else {
        tmp := &Ele{data, e.Next}
        e.Next = tmp
    }
    return e.Next
}

func (e *Ele) String() string {
    return fmt.Sprintf("Ele: %v", e.Data)
}
Task: Singly-linked list_Element definition



C#: class LinkedListNode
{
    public int Value { get; set; }
    public LinkedListNode Next { get; set; }

    
    public Link(int value, LinkedListNode next = null)
    {
        Item = value;
        Next = next;
    }
}





Python: class LinkedList(object):
     
	class Node(object):
		def __init__(self, item):
			self.value  = item
			self.next = None
	def __init__(self, item=None):
		if item is not None:
			self.head = Node(item); self.tail = self.head
		else:
			self.head = None; self.tail = None
	def append(self, item):
		if not self.head:
			self.head = Node(item)
			self.tail = self.head
		elif self.tail:
			self.tail.next = Node(item)
			self.tail = self.tail.next
		else:
			self.tail = Node(item)
	def __iter__(self):
		cursor = self.head
		while cursor:
			yield cursor.value
			cursor = cursor.next
Task: Singly-linked list_Element definition




Go: type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) Append(data interface{}) *Ele {
    if e.Next == nil {
        e.Next = &Ele{data, nil}
    } else {
        tmp := &Ele{data, e.Next}
        e.Next = tmp
    }
    return e.Next
}

func (e *Ele) String() string {
    return fmt.Sprintf("Ele: %v", e.Data)
}


Java: class Link
{
    Link next;
    int data;
}
Task: Singly-linked list_Element definition





Java: class Link
{
    Link next;
    int data;
}



Python: class LinkedList(object):
     
	class Node(object):
		def __init__(self, item):
			self.value  = item
			self.next = None
	def __init__(self, item=None):
		if item is not None:
			self.head = Node(item); self.tail = self.head
		else:
			self.head = None; self.tail = None
	def append(self, item):
		if not self.head:
			self.head = Node(item)
			self.tail = self.head
		elif self.tail:
			self.tail.next = Node(item)
			self.tail = self.tail.next
		else:
			self.tail = Node(item)
	def __iter__(self):
		cursor = self.head
		while cursor:
			yield cursor.value
			cursor = cursor.next
Task: Singly-linked list_Element definition




Go: type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) Append(data interface{}) *Ele {
    if e.Next == nil {
        e.Next = &Ele{data, nil}
    } else {
        tmp := &Ele{data, e.Next}
        e.Next = tmp
    }
    return e.Next
}

func (e *Ele) String() string {
    return fmt.Sprintf("Ele: %v", e.Data)
}




Python: class LinkedList(object):
     
	class Node(object):
		def __init__(self, item):
			self.value  = item
			self.next = None
	def __init__(self, item=None):
		if item is not None:
			self.head = Node(item); self.tail = self.head
		else:
			self.head = None; self.tail = None
	def append(self, item):
		if not self.head:
			self.head = Node(item)
			self.tail = self.head
		elif self.tail:
			self.tail.next = Node(item)
			self.tail = self.tail.next
		else:
			self.tail = Node(item)
	def __iter__(self):
		cursor = self.head
		while cursor:
			yield cursor.value
			cursor = cursor.next
Task: Singly-linked list_Element definition

C: struct link {
  struct link *next;
  int data;
};







Python: class LinkedList(object):
     
	class Node(object):
		def __init__(self, item):
			self.value  = item
			self.next = None
	def __init__(self, item=None):
		if item is not None:
			self.head = Node(item); self.tail = self.head
		else:
			self.head = None; self.tail = None
	def append(self, item):
		if not self.head:
			self.head = Node(item)
			self.tail = self.head
		elif self.tail:
			self.tail.next = Node(item)
			self.tail = self.tail.next
		else:
			self.tail = Node(item)
	def __iter__(self):
		cursor = self.head
		while cursor:
			yield cursor.value
			cursor = cursor.next
Task: Singly-linked list_Element definition



C#: class LinkedListNode
{
    public int Value { get; set; }
    public LinkedListNode Next { get; set; }

    
    public Link(int value, LinkedListNode next = null)
    {
        Item = value;
        Next = next;
    }
}



Java: class Link
{
    Link next;
    int data;
}
Task: Singly-linked list_Element definition


C++: struct link
{
  link* next;
  int data;
};



Go: type Ele struct {
    Data interface{}
    Next *Ele
}

func (e *Ele) Append(data interface{}) *Ele {
    if e.Next == nil {
        e.Next = &Ele{data, nil}
    } else {
        tmp := &Ele{data, e.Next}
        e.Next = tmp
    }
    return e.Next
}

func (e *Ele) String() string {
    return fmt.Sprintf("Ele: %v", e.Data)
}
Task: Map range

C: double inc = (nHasta - nDesde) / ( nTotal - 1);
lista[0] = nDesde;
lista[nTotal] = nHasta;
for( n=1; n<nTotal; n++){
    lista[n] = lista[n-1] + inc;
}




Go: package main

import "fmt"

type rangeBounds struct {
    b1, b2 float64
}

func mapRange(x, y rangeBounds, n float64) float64 {
    return y.b1 + (n - x.b1) * (y.b2 - y.b1) / (x.b2 - x.b1)
}

func main() {
    r1 := rangeBounds{0, 10}
    r2 := rangeBounds{-1, 0}
    for n := float64(0); n <= 10; n += 2 {
        fmt.Println(n, "maps to", mapRange(r1, r2, n))
    }
}
Task: Map range

C: double inc = (nHasta - nDesde) / ( nTotal - 1);
lista[0] = nDesde;
lista[nTotal] = nHasta;
for( n=1; n<nTotal; n++){
    lista[n] = lista[n-1] + inc;
}







Python: >>> def maprange( a, b, s):
	(a1, a2), (b1, b2) = a, b
	return  b1 + ((s - a1) * (b2 - b1) / (a2 - a1))

>>> for s in range(11):
	print("%2g maps to %g" % (s, maprange( (0, 10), (-1, 0), s)))

	
 0 maps to -1
 1 maps to -0.9
 2 maps to -0.8
 3 maps to -0.7
 4 maps to -0.6
 5 maps to -0.5
 6 maps to -0.4
 7 maps to -0.3
 8 maps to -0.2
 9 maps to -0.1
10 maps to 0
Task: Map range




Go: package main

import "fmt"

type rangeBounds struct {
    b1, b2 float64
}

func mapRange(x, y rangeBounds, n float64) float64 {
    return y.b1 + (n - x.b1) * (y.b2 - y.b1) / (x.b2 - x.b1)
}

func main() {
    r1 := rangeBounds{0, 10}
    r2 := rangeBounds{-1, 0}
    for n := float64(0); n <= 10; n += 2 {
        fmt.Println(n, "maps to", mapRange(r1, r2, n))
    }
}




Python: >>> def maprange( a, b, s):
	(a1, a2), (b1, b2) = a, b
	return  b1 + ((s - a1) * (b2 - b1) / (a2 - a1))

>>> for s in range(11):
	print("%2g maps to %g" % (s, maprange( (0, 10), (-1, 0), s)))

	
 0 maps to -1
 1 maps to -0.9
 2 maps to -0.8
 3 maps to -0.7
 4 maps to -0.6
 5 maps to -0.5
 6 maps to -0.4
 7 maps to -0.3
 8 maps to -0.2
 9 maps to -0.1
10 maps to 0
Task: Extra primes




Go: package main

import "fmt"

func isPrime(n int) bool {
    if n < 2 {
        return false
    }
    if n%2 == 0 {
        return n == 2
    }
    if n%3 == 0 {
        return n == 3
    }
    d := 5
    for d*d <= n {
        if n%d == 0 {
            return false
        }
        d += 2
        if n%d == 0 {
            return false
        }
        d += 4
    }
    return true
}

func main() {
    digits := [4]int{2, 3, 5, 7}                      
    digits2 := [2]int{3, 7}                           
    cands := [][2]int{{2, 2}, {3, 3}, {5, 5}, {7, 7}} 

    for _, a := range digits {
        for _, b := range digits2 {
            cands = append(cands, [2]int{10*a + b, a + b})
        }
    }

    for _, a := range digits {
        for _, b := range digits {
            for _, c := range digits2 {
                cands = append(cands, [2]int{100*a + 10*b + c, a + b + c})
            }
        }
    }

    for _, a := range digits {
        for _, b := range digits {
            for _, c := range digits {
                for _, d := range digits2 {
                    cands = append(cands, [2]int{1000*a + 100*b + 10*c + d, a + b + c + d})
                }
            }
        }
    }

    fmt.Println("The extra primes under 10,000 are:")
    count := 0
    for _, cand := range cands {
        if isPrime(cand[0]) && isPrime(cand[1]) {
            count++
            fmt.Printf("%2d: %4d\n", count, cand[0])
        }
    }
}


Java: public class ExtraPrimes {
    private static int nextPrimeDigitNumber(int n) {
        if (n == 0) {
            return 2;
        }
        switch (n % 10) {
            case 2:
                return n + 1;
            case 3:
            case 5:
                return n + 2;
            default:
                return 2 + nextPrimeDigitNumber(n / 10) * 10;
        }
    }

    private static boolean isPrime(int n) {
        if (n < 2) {
            return false;
        }
        if ((n & 1) == 0) {
            return n == 2;
        }
        if (n % 3 == 0) {
            return n == 3;
        }
        if (n % 5 == 0) {
            return n == 5;
        }

        int[] wheel = new int[]{4, 2, 4, 2, 4, 6, 2, 6};
        int p = 7;
        while (true) {
            for (int w : wheel) {
                if (p * p > n) {
                    return true;
                }
                if (n % p == 0) {
                    return false;
                }
                p += w;
            }
        }
    }

    private static int digitSum(int n) {
        int sum = 0;
        for (; n > 0; n /= 10) {
            sum += n % 10;
        }
        return sum;
    }

    public static void main(String[] args) {
        final int limit = 10_000;
        int p = 0, n = 0;

        System.out.printf("Extra primes under %d:\n", limit);
        while (p < limit) {
            p = nextPrimeDigitNumber(p);
            if (isPrime(p) && isPrime(digitSum(p))) {
                n++;
                System.out.printf("%2d: %d\n", n, p);
            }
        }
        System.out.println();
    }
}
Task: Extra primes





Java: public class ExtraPrimes {
    private static int nextPrimeDigitNumber(int n) {
        if (n == 0) {
            return 2;
        }
        switch (n % 10) {
            case 2:
                return n + 1;
            case 3:
            case 5:
                return n + 2;
            default:
                return 2 + nextPrimeDigitNumber(n / 10) * 10;
        }
    }

    private static boolean isPrime(int n) {
        if (n < 2) {
            return false;
        }
        if ((n & 1) == 0) {
            return n == 2;
        }
        if (n % 3 == 0) {
            return n == 3;
        }
        if (n % 5 == 0) {
            return n == 5;
        }

        int[] wheel = new int[]{4, 2, 4, 2, 4, 6, 2, 6};
        int p = 7;
        while (true) {
            for (int w : wheel) {
                if (p * p > n) {
                    return true;
                }
                if (n % p == 0) {
                    return false;
                }
                p += w;
            }
        }
    }

    private static int digitSum(int n) {
        int sum = 0;
        for (; n > 0; n /= 10) {
            sum += n % 10;
        }
        return sum;
    }

    public static void main(String[] args) {
        final int limit = 10_000;
        int p = 0, n = 0;

        System.out.printf("Extra primes under %d:\n", limit);
        while (p < limit) {
            p = nextPrimeDigitNumber(p);
            if (isPrime(p) && isPrime(digitSum(p))) {
                n++;
                System.out.printf("%2d: %d\n", n, p);
            }
        }
        System.out.println();
    }
}



Python: from itertools import *
from functools import reduce

class Sieve(object):
    
    def __init__(self):
        self._primes = []
        self._comps = {}
        self._max = 2;
    
    def isprime(self, n):
        
        if n >= self._max: self._genprimes(n)
        return n >= 2 and n in self._primes
    
    def _genprimes(self, max):
        while self._max <= max:
            if self._max not in self._comps:
                self._primes.append(self._max)
                self._comps[self._max*self._max] = [self._max]
            else:
                for p in self._comps[self._max]:
                    ps = self._comps.setdefault(self._max+p, [])
                    ps.append(p)
                del self._comps[self._max]
            self._max += 1
                
def extra_primes():
    
    d = [2,3,5,7]
    s = Sieve()
    for cand in chain.from_iterable(product(d, repeat=r) for r in count(1)):
        num = reduce(lambda x, y: x*10+y, cand)
        if s.isprime(num) and s.isprime(sum(cand)): yield num
        
for n in takewhile(lambda n: n < 10000, extra_primes()):
    print(n)
Task: Extra primes




Go: package main

import "fmt"

func isPrime(n int) bool {
    if n < 2 {
        return false
    }
    if n%2 == 0 {
        return n == 2
    }
    if n%3 == 0 {
        return n == 3
    }
    d := 5
    for d*d <= n {
        if n%d == 0 {
            return false
        }
        d += 2
        if n%d == 0 {
            return false
        }
        d += 4
    }
    return true
}

func main() {
    digits := [4]int{2, 3, 5, 7}                      
    digits2 := [2]int{3, 7}                           
    cands := [][2]int{{2, 2}, {3, 3}, {5, 5}, {7, 7}} 

    for _, a := range digits {
        for _, b := range digits2 {
            cands = append(cands, [2]int{10*a + b, a + b})
        }
    }

    for _, a := range digits {
        for _, b := range digits {
            for _, c := range digits2 {
                cands = append(cands, [2]int{100*a + 10*b + c, a + b + c})
            }
        }
    }

    for _, a := range digits {
        for _, b := range digits {
            for _, c := range digits {
                for _, d := range digits2 {
                    cands = append(cands, [2]int{1000*a + 100*b + 10*c + d, a + b + c + d})
                }
            }
        }
    }

    fmt.Println("The extra primes under 10,000 are:")
    count := 0
    for _, cand := range cands {
        if isPrime(cand[0]) && isPrime(cand[1]) {
            count++
            fmt.Printf("%2d: %4d\n", count, cand[0])
        }
    }
}




Python: from itertools import *
from functools import reduce

class Sieve(object):
    
    def __init__(self):
        self._primes = []
        self._comps = {}
        self._max = 2;
    
    def isprime(self, n):
        
        if n >= self._max: self._genprimes(n)
        return n >= 2 and n in self._primes
    
    def _genprimes(self, max):
        while self._max <= max:
            if self._max not in self._comps:
                self._primes.append(self._max)
                self._comps[self._max*self._max] = [self._max]
            else:
                for p in self._comps[self._max]:
                    ps = self._comps.setdefault(self._max+p, [])
                    ps.append(p)
                del self._comps[self._max]
            self._max += 1
                
def extra_primes():
    
    d = [2,3,5,7]
    s = Sieve()
    for cand in chain.from_iterable(product(d, repeat=r) for r in count(1)):
        num = reduce(lambda x, y: x*10+y, cand)
        if s.isprime(num) and s.isprime(sum(cand)): yield num
        
for n in takewhile(lambda n: n < 10000, extra_primes()):
    print(n)
Task: Diversity prediction theorem

C: #include<string.h>
#include<stdlib.h>
#include<stdio.h>

float mean(float* arr,int size){
	int i = 0;
	float sum = 0;
	
	while(i != size)
		sum += arr[i++];
	
	return sum/size;
}

float variance(float reference,float* arr, int size){
	int i=0;
	float* newArr = (float*)malloc(size*sizeof(float));
	
	for(;i<size;i++)
		newArr[i] = (reference - arr[i])*(reference - arr[i]);
	
	return mean(newArr,size);
}

float* extractData(char* str, int *len){
	float* arr;
	int i=0,count = 1;
	char* token;
	
	while(str[i]!=00){
		if(str[i++]==',')
			count++;
	}
	
	arr = (float*)malloc(count*sizeof(float));
	*len = count;
	
	token = strtok(str,",");
	
	i = 0;
	
	while(token!=NULL){
		arr[i++] = atof(token);
		token = strtok(NULL,",");
	}
	
	return arr;
}

int main(int argC,char* argV[])
{
	float* arr,reference,meanVal;
	int len;
	if(argC!=3)
		printf("Usage : %s <reference value> <observations separated by commas>");
	else{
		arr = extractData(argV[2],&len);
		
		reference = atof(argV[1]);
		
		meanVal = mean(arr,len);

		printf("Average Error : %.9f\n",variance(reference,arr,len));
		printf("Crowd Error : %.9f\n",(reference - meanVal)*(reference - meanVal));
		printf("Diversity : %.9f",variance(meanVal,arr,len));
	}
	
	return 0;
}



C#: using System;
using System.Linq;
using System.Collections.Generic;

public class MainClass {
    static double Square(double x) => x * x;

    static double AverageSquareDiff(double a, IEnumerable<double> predictions)
        => predictions.Select(x => Square(x - a)).Average();

    static void DiversityTheorem(double truth, IEnumerable<double> predictions)
    {
        var average = predictions.Average();
        Console.WriteLine($@"average-error: {AverageSquareDiff(truth, predictions)}
crowd-error: {Square(truth - average)}
diversity: {AverageSquareDiff(average, predictions)}");
    }
	
    public static void Main() {
	DiversityTheorem(49, new []{48d,47,51});
    	DiversityTheorem(49, new []{48d,47,51,42});
    }
}
Task: Diversity prediction theorem

C: #include<string.h>
#include<stdlib.h>
#include<stdio.h>

float mean(float* arr,int size){
	int i = 0;
	float sum = 0;
	
	while(i != size)
		sum += arr[i++];
	
	return sum/size;
}

float variance(float reference,float* arr, int size){
	int i=0;
	float* newArr = (float*)malloc(size*sizeof(float));
	
	for(;i<size;i++)
		newArr[i] = (reference - arr[i])*(reference - arr[i]);
	
	return mean(newArr,size);
}

float* extractData(char* str, int *len){
	float* arr;
	int i=0,count = 1;
	char* token;
	
	while(str[i]!=00){
		if(str[i++]==',')
			count++;
	}
	
	arr = (float*)malloc(count*sizeof(float));
	*len = count;
	
	token = strtok(str,",");
	
	i = 0;
	
	while(token!=NULL){
		arr[i++] = atof(token);
		token = strtok(NULL,",");
	}
	
	return arr;
}

int main(int argC,char* argV[])
{
	float* arr,reference,meanVal;
	int len;
	if(argC!=3)
		printf("Usage : %s <reference value> <observations separated by commas>");
	else{
		arr = extractData(argV[2],&len);
		
		reference = atof(argV[1]);
		
		meanVal = mean(arr,len);

		printf("Average Error : %.9f\n",variance(reference,arr,len));
		printf("Crowd Error : %.9f\n",(reference - meanVal)*(reference - meanVal));
		printf("Diversity : %.9f",variance(meanVal,arr,len));
	}
	
	return 0;
}


C++: #include <iostream>
#include <vector>
#include <numeric>

float sum(const std::vector<float> &array)
{
    return std::accumulate(array.begin(), array.end(), 0.0);
}

float square(float x)
{
    return x * x;
}

float mean(const std::vector<float> &array)
{
    return sum(array) / array.size();
}

float averageSquareDiff(float a, const std::vector<float> &predictions)
{
    std::vector<float> results;
    for (float x : predictions)
        results.push_back(square(x - a));
    return mean(results);
}

void diversityTheorem(float truth, const std::vector<float> &predictions)
{
    float average = mean(predictions);
    std::cout
        << "average-error: " << averageSquareDiff(truth, predictions) << "\n"
        << "crowd-error: " << square(truth - average) << "\n"
        << "diversity: " << averageSquareDiff(average, predictions) << std::endl;
}

int main() {
    diversityTheorem(49, {48,47,51});
    diversityTheorem(49, {48,47,51,42});
    return 0;
}