Solution of Codeforces Round #831 (Div. 1 + Div. 2) || Tutorial of Codeforces Round #831 (Div. 1 + Div. 2)
Solution of Codeforces Round #831 (Div. 1 + Div. 2) || Tutorial of Codeforces Round #831 (Div. 1 + Div. 2) Codeforces Round #831 (Div. 1 + Div. 2, based on COMPFEST 14 Final) Editorial 1740A. Factorise N+M Author: Pyqe Developer: Pyqe Tutorial 1740A - Factorise N+M There are multiple solutions for this problem. We will discuss two of them. One solution is to choose m = n m = n . This always guarantees that m m is prime, because n n is always prime. And we can see that n + m = n + n = 2 n n + m = n + n = 2 n , which is always not prime, because n > 1 n > 1 always holds. Another solution is to choose m = 7 m = 7 . If n n is odd, then n + m n + m will be an even number greater than 2 2 and therefore not prime. Otherwise n n is even. The only even number prime number is 2 2 and it can be verified that 2 + 7 = 9 2 + 7 = 9 is not a prime number. Time ...