Check if X and Y can be made zero by using given operation any number of times | C ++ implementation of the approach ; Function to check if X and Y can be made equal to zero by using given operation any number of times ; Check for the two conditions ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void ifPossible ( int X , int Y ) { if ( X > Y ) swap ( X , Y ) ; if ( ( X + Y ) % 5 == 0 and 3 * X >= 2 * Y ) cout << " Yes " ; else cout << " No " ; } int main ( ) { int X = 33 , Y = 27 ; ifPossible ( X , Y ) ; return 0 ; }