logo AlgoBeat OnlineJudge
登录 注册

#214090. [VKOSHP 2024] Nightmare Sum

内存限制:512 MiB 时间限制:3000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Given an array of length , consisting of distinct positive integers. Compute

Here, denotes rounded down to the nearest integer.

Thus, it is necessary to compute the sum of the results of integer division of the maximum by the minimum over all subarrays of the array .

输入格式

The first line of input contains a single integer ~--- the length of the array .

The second line of input contains integers~--- the array .

It is guaranteed that all numbers in the array are distinct.

输出格式

Output a single number --- the desired sum.

样例

样例输入 1

6
1 3 6 4 2 5

样例输出 1

56

数据范围与提示

Let's consider the example in more detail:

:::align{center} :::