public int Partition1 {get;set;}
public int Partition1 {get;set;}
private void SetPartitions(List<int> primeNumbers)
{
this.Partition1 = // get the product of the prime numbers closest to 10000
this.Partition2 = // get the product of the remaining prime numbers
}
Метод SetPartitions принимает массив простых чисел, таких как 2, 3, 5, 2851, 13.
В приведенном выше примере он должен назначить:
this.Partition1 = 2851 * 3; // which is 8553 and closest possible to 10000
this.Partition2 = 2 * 5 * 13;
Как реализовать логику?