A few years ago, Aaron left his old school and registered at another due to security reasons. Now he wishes to find Jane, one of his schoolmates and good friends.
There are `n` schools numbered from 1 to `n`. One can travel between each pair of schools by buying a ticket. The ticket between schools `i` and `j` costs `(i + j) modulo (n + 1)` and can be used multiple times. Help Aaron find the minimum total cost to visit all schools. He can start and finish at any school.
Range : 1 ≤ n ≤ 10^(6)
def find_jane(n):
    return (n-1) // 2
    
"""
1,2,3,...,n
cost = (a+b) % (n+1)

best association is:
    b = n+1-a  ->  cost=0
    
    1 2 3 4 5     -> 1 <-> 5
                     2 <-> 4

to link ("L") those two, the best remaining way is:
    b = n+1-a+1  -> cost=1

    1 2 3 4 5     -> 1 <-> 5: 0
                  L: 5 <-> 2: 1
                     2 <-> 4: 0
                  L: 4 <-> 3: 1
                 --------------
                 total cost = 2


    1 2 3 4       -> 1 <-> 4: 0
                  L: 4 <-> 2: 1
                     2 <-> 3: 0
                 --------------
                 total cost = 1

And so on...
"""
def find_jane(n):
    return (n-1) // 2
    
"""
1,2,3,...,n
cost = (a+b) % (n+1)

best association is:
    b = n+1-a  ->  cost=0
    
    1 2 3 4 5     -> 1 <-> 5
                     2 <-> 4

to link ("L") those two, the best remaining way is:
    b = n+1-a+1  -> cost=1

    1 2 3 4 5     -> 1 <-> 5: 0
                  L: 5 <-> 2: 1
                     2 <-> 4: 0
                  L: 4 <-> 3: 1
                 --------------
                 total cost = 2


    1 2 3 4       -> 1 <-> 4: 0
                  L: 4 <-> 2: 1
                     2 <-> 3: 0
                 --------------
                 total cost = 1

And so on...
"""