Wrong answer in birthday paradox

my code - https://ide.codingblocks.com/s/40093
problem - https://hack.codingblocks.com/contests/c/255/827

hey, one of my test case shows wrong answer please help me to identify where did i go wrong?

Hello @kushal1998 !
First thing is your if loop is before the step where you are taking input n . And second thing is your code will not work when n=1 . So take this case separately and solve the issue with if loop also , that’s it .
For understanding the code , go through this code -->
https://ide.codingblocks.com/s/40095