my with is failing in some test cases .can’t find why
use long long int instead of int
Modified Code