Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8824

Jo'natishlar soni: 714622

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1177


So'ngi izohlar

720. Odd Divisors
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

 Let f(x) be the greatest odd divisor of x, where x is a positive integer. You are given a positive integer n. Find f(1) + f(2) + ... + f(n).

   Input

   Each line contains one positive integer n (≤ 109).

   Output

   For each input n print in a separate line the value of f(1) + f(2) + ... + f(n).

Input

Output

1

7

21

2

1

1

3

777

201537

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (2) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(39) Barcha urinishlar(108)