From 99218822ab48b1513bcb74c718e9646aa36dbdb4 Mon Sep 17 00:00:00 2001 From: ritwik1503 <35749253+ritwik1503@users.noreply.github.com> Date: Sat, 3 Oct 2020 18:55:46 +0530 Subject: [PATCH] Update Murthal Parantha.md --- Binary Search/Murthal Parantha.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Binary Search/Murthal Parantha.md b/Binary Search/Murthal Parantha.md index 55fd939..d118b16 100644 --- a/Binary Search/Murthal Parantha.md +++ b/Binary Search/Murthal Parantha.md @@ -82,10 +82,14 @@ int main() ll ans=1e18; while(lo<=hi){ + /* ll mid=lo+hi; mid>>=1; // if it is possible to cook the paranthas in "mid" units of time, then use it for computing the ans and // again start trying for smaller values by reducing hi to mid-1 + + */ + ll min = lo + (hi-lo)/2; //Avoids the overflow. if(isPossible(ran,mid,par)){ ans=min(ans,mid); hi=mid-1;