This page is still under construction.

Parts of this page are still being built. What you see may change.

Jaw-Dropping Set

Time limit1sMemory limit256 MB

Summary
For each n up to 1e9, find the maximum size of a subset of {1..n} with no element dividing another, then the minimum possible sum among such maximum-size subsets.
Level

Medium6 of 10

Topics
Math, Number theory, Greedy, Combinatorics
Solved
No attempts yet

Problem

A subset AA of the set {1,2,3,…,n}\{1, 2, 3, \ldots, n\} is called interesting if for any pair of different integers x,y∈Ax, y \in A, neither xx divides yy nor yy divides xx.

An interesting subset AA is called amazing if it has the maximum cardinality among all interesting subsets.

Finally, an amazing subset AA is called jaw-dropping if it has the minimum sum of elements among all amazing subsets.

Given nn, find the sum of elements in a jaw-dropping subset of {1,2,3,…,n}\{1, 2, 3, \ldots, n\}.

Input

The first line contains the integer tt (1≤t≤1051 \le t \le 10^5), the number of test cases.

Each of the next TT lines contains an integer nin_i (1≤ni≤1091 \le n_i \le 10^9).

Output

Print TT lines with the answer for each test case.

Examples1

  1. Example 1

    Input
    7
    1
    2
    3
    4
    5
    6
    7
    
    Expected output
    1
    1
    5
    5
    10
    10
    17