Given a positive integer n, the segment tree on [1,n] can be built by a recursive process: Starting with [1,n], suppose the current interval is [l,r], the process recursively builds subtrees for [l,⌊l+r2⌋],[⌊l+r2⌋+1,r] until l=r.
For example, when n=5, there are 9 intervals on the segment tree: [1,1],[2,2],[3,3],[4,4],[5,5],[1,2],[4,5],[1,3],[1,5].
To explore the structure of segment trees, Rikka defines a magic function f(i,n) which represents the depth of node [i,i] on a segment tree on [1,n] (the depth of the root is defined as 1). For example, f(1,5)=f(2,5)=4,f(3,5)=f(4,5)=f(5,5)=3.
Now Rikka gives you two positive integers L,R(L≤R), and she wants you to calculate:
∑n=LR∑i=1n(f(i,n)×i)