Unable to find the problem in code

According I have considered all possible diverse cases for the problem “Winning CB Scholarship” but still 3 testcases are wrong. please help me out!
Code : https://ide.codingblocks.com/s/65671

Hi SansKAR,
Check the constraint 1 ≤ N,M,X,Y ≤ 10^9
you are using int and int is less than 10^9.
Just use long long int everywhere in place of int, your code will work fine.
Hit Like if u get it :slight_smile: