public Participant(int id, int price)
public int GetId() { return id; }
public int GetPrice() { return price; }
public class VickeryAuction
private Participant[] arr = new Participant[100];
public VickeryAuction(int product, int realPrice)
this.realPrice = realPrice;
public bool AddParticipant(Participant par)
if (size < arr.Length && par.GetPrice() > realPrice / 2)
public Winner GetWinner()
int first = 0, second = 0;
for (int i = 1; i < size; i++)
if (arr[i].GetPrice() > arr[first].GetPrice())
else if (arr[i].GetPrice() > arr[second].GetPrice())
return new Winner(arr[first].GetId(), arr[second].GetPrice());
public int[] GetStatistics(int max)
int[] stat = new int[max / 100 + 1];
for (int i = 0; i < stat.Length; i++)
for (int i = 0; i < size; i++)
if (arr[i].GetPrice() <= max)
stat[arr[i].GetPrice() / 100]++;
public Winner(int id, int lastPrice)
this.lastPrice = lastPrice;
public static void Main()
Console.WriteLine("Hello World");