#K46597. Total Attractions
Total Attractions
Total Attractions
During the annual festival, new attractions open every day. On the (d)-th day, exactly (d) new attractions are introduced, and the total number of attractions up to that day is given by the sum: [ S = \sum_{i=1}^d i = \frac{d(d+1)}{2} ] Given an integer (d) (where (1 \le d \le 10^5)), compute the total number of attractions available by the (d)-th day.
inputFormat
A single integer (d) representing the day of the festival.
outputFormat
A single integer representing the total number of attractions available up to and including day (d).## sample
1
1