Friends pairing doubt

giving wrong answer

@rohit_1906
Use long long int , final ans can’t be stored in int . Here is the updated code https://ide.codingblocks.com/s/242828