Baby Step, Giant Step

  • + 1 comment

    My analysis:-
    given a < b

    Condition # Step(s) Comment
    d == 0 0 no steps
    a == d 1 straight line
    b == d 1 straight line
    a > d 2 Isosceles triangle 2 legs of length a or b
    over base d
    b > d 2 ditto
    a + b > d 2 triangle:- long side of length b
    , other of length a for other side
    over other side d
    r == 0 n n = d/b , r = d % b and straight line if r == 0
    r != 0 n + 1 Triangle of 1 side n*b the other a or b
    = n+1 steps