SP32079 ADAGF - Ada and Greenflies

Description

As you might already know, Ada the Ladybug is a farmer. Beside of growing vegetable she also breeds greenflies. There are many kinds of greenflies and it is not trivial to breed them since they behave very strangely. Each kind of greenfly is known under a number. As you have multiple greenflies in a single coop, they produce as much juice as the greatest common divisor of their numbers. Ada owns a row of greenflies (of several kinds) and she can split them by a fence, so that always a continuous segment of greenflies will be in a same coop Ada wants to find out the sum of procution of greenflies over all possible continuous segments (of size at least one), can you help her?

Input Format

N/A

Output Format

N/A

Explanation/Hint

对于全部数据,保证 $1\le N\le 3\times 10^5$,$0\le a_i\le 10^6$。