• + 0 comments

    int clique(int n, int m) { int i=2,c=0;

    long double r=0.0,e=0.0; e=(n*(n-1)/2); while(i<=m) {

    r=(long double)((i-1)*(n*n))/(long double)(2*i); 
    
    if(r>=m)
    {
    c=i;
    
    break;   
    }
    else 
    {
    if(r>e)
    {
    c=i;
    
    break;   
    }
    }
    i++;
    }  
    

    return c; } On submission the code fails for 9/11 test cases. But while giving custom input from the failed test cases, it works well. I am unable to find the exact reason. return c; }