#Lutece1397. A Hard-working Girl LRZ
A Hard-working Girl LRZ
Migrated from Lutece 1397 A Hard-working Girl LRZ
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As we all know, LRZ is a very cute and hard-working girl. Every morning, LRZ will review her work finished in the previous days and she will only consider the last two days.
We define as the workload of the day. LRZ will be pleased with the work she finished at the day and she will finish times workload of the day at the day.
Besides she will be dissatisfied of the work she finished at the day just because LRZ improves herself day by day.Therefore LRZ will finished the workload of the day less at the nth day.
In other words, the workload LRZ will finish at the nth day is . And we can define .
LRZ will get happy point from her workload, we define as her happy point at the day, and we know
Now, you need to calculate the total happy points from the first day to the day.
Input
Two integers ,,
Output
You should output the , the answer may be very large, so you should output
Samples
3 1
8
3 2
30
Resources
IEEEXTREME Programming Competition