Company: amdocs_1april
Difficulty: medium
You are given two integers x and y (it is guaranteed that x > y). You may choose any prime integer p and subtract it any number of times from x. Is it possible to make x equal to y? return 1 if yes, 0 otherwise. Recall that a prime number is a positive integer that has exactly two positive divisors: 1 and this integer itself. The sequence of prime numbers starts with 2, 3, 5, 7, 11. Examples: x = 42 y = 32 You may choose p = 5 and subtract it twice. Note that you cannot choose p = 7, subtract it, then choose p = 3 and subtract it again. x = 1000 y = 1 You may choose p = 3 and subtract it 333 times. #include <iostream> #include <string> #include <vector> #include "student.h" using namespace std; int subtract(int x,int y){ }