ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1064. Binary Search

Anupam Ghosh,Bengal Engg and Science University,Shibpur,India i think sample test case in given problem is wrong [2] // Problem 1064. Binary Search 1 Jan 2008 16:27
take N=29
p=0   q=28  i=14  L=1
p=15  q=28  i=21  L=2
p=21  q=28  i=24  L=3
this is cancelled since i value is not 10
NOW the other way
p=0   q=28  i=14  L=1
p=0   q=13  i=6   L=2
p=0   q=5   i=2   L=3
this is cancelled since i value is not 10
can any body explain me this??
Anupam Ghosh,Bengal Engg and Science University,Shibpur,India Re: i think sample test case in given problem is wrong [1] // Problem 1064. Binary Search 3 Jan 2008 09:48
take N=29
p=0 q=28 i=14 L=1
p=15 q=28 i=21 L=2
p=22 q=28 i=25 L=3
this is cancelled since i value is not 10
NOW the other way
p=0 q=28 i=14 L=1
p=0 q=13 i=6 L=2
p=0 q=5 i=2 L=3
this is cancelled since i value is not 10
can any body explain me this??
Answer - is a POSSIBLE value of N. It means, that from this value you CAN get I for L steps.
P = 0  Q = 28  I = 14  L = 1
P = 0  Q = 13  I = 6   L = 2
P = 7  Q = 13  I = 10  L = 3