Prata spoj, need help

Please help, I have the written code but getting wrong answer

@sonumittal
Please send the code.

And send it using cb ide

@sonumittal

This is the updated code. There were two errors in your code:

  1. To find the value of the upper bound on e, its value must be equal to (arr[0]p(p + 1))/2, only after the array has been sorted in decreasing order. This would be the maximum value.
  2. I your check function, while((y)<=m) , you used this step. You must use this as the condition for the while loop. while((y + x)<=m). This is because using this, you will be able to check whether a given step is feasible or not and then only increase the count of the paranthas.

Suggestion: You roots of a quadratic equation to find the number of paranthas cooked by a chef in a certain time limit. The while loop is quite time consuming.

If my explanation was able to answer your query, please mark the doubt as resolved.