예제 #1
0
 public string Solve(SingleLimitProblemArgs arguments)
 {
     return(Factorization.Of(arguments.Limit).Factors.Last().Prime.ToString());
 }
 public void Of_ShouldReturnEmpty_ForOne()
 {
     Assert.That(Factorization.Of(1), Is.EqualTo(Factorization.Empty));
 }
 public void Binomial_ShouldReturnCorrectValue(int n, int k, long expected)
 {
     Assert.That(Combinatorics.Binomial(n, k), Is.EqualTo(Factorization.Of(expected)));
 }
 public void Of_ShouldThrowArgumentOutOfRangeException_WhenLessThanOne(long number)
 {
     Assert.That(() => Factorization.Of(number), Throws.Exception.TypeOf <ArgumentOutOfRangeException>());
 }
 public void GCD_ShouldReturnCorrectValue(long[] numbers, long expected)
 {
     Assert.That(Combinatorics.GCD(numbers), Is.EqualTo(Factorization.Of(expected)));
 }