
86  ZOJ Monthly, January 2010  G
Recently, watashi finds a simple sequence S = {s_{i}} _{i >= 1} in a book. This sequence is determined by the following rules:
So the sequence S = {2, 4, 4, 6, 8, 8, 8, 10, ...}. Now watashi wants to know the sum of s_{i} (n <= i <= m). As a kindhearted person, please help him to find out the answer. Input There are multiple test cases (about 80000). For each case, there's exactly one line which contains two integer n and m (1 <= n <= m <= 10^9) respectively. Process to the end of the file. Output For each case, output the answer in a single line. Sample Input 1 3 4 4 5 8 Sample Output 10 6 34 Author: MO, Luyi Source: ZOJ Monthly, January 2010 