CF243A The Brand New Function
Description
Polycarpus has a sequence, consisting of $ n $ non-negative integers: $ a_{1},a_{2},...,a_{n} $ .
Let's define function $ f(l,r) $ ( $ l,r $ are integer, $ 1
Input Format
The first line contains integer $ n $ $ (1
Output Format
Print a single integer — the number of distinct values of function $ f(l,r) $ for the given sequence $ a $ .
Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use cin, cout streams or the %I64d specifier.
Explanation/Hint
In the first test case Polycarpus will have 6 numbers written on the paper: $ f(1,1)=1 $ , $ f(1,2)=3 $ , $ f(1,3)=3 $ , $ f(2,2)=2 $ , $ f(2,3)=2 $ , $ f(3,3)=0 $ . There are exactly $ 4 $ distinct numbers among them: $ 0,1,2,3 $ .