Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
354 B
2
Indexable
Never
if(i==n-1)
        {
            if(sum/n <diff)
            {
                ans=i;
            }
            
        }
        
        else if(abs(w1/(i+1)-w2/(n-i-1))  < diff)
        {
            diff=abs(w1/(i+1)-w2/(n-i-1));
            
            cout<<x;
            
            ans=i;
            
            
        }