#B4312. Weekly Expense Calculation for Fried Chicken and Milk Tea

    ID: 11968 Type: Default 1000ms 256MiB

Weekly Expense Calculation for Fried Chicken and Milk Tea

Weekly Expense Calculation for Fried Chicken and Milk Tea

In the vicinity of Little M's school, there is a fried chicken shop and a milk tea shop. The cost of one portion of fried chicken is \(f\) yuan, and one cup of milk tea costs \(m\) yuan.

Every Thursday, Little M buys 2 portions of fried chicken and 1 cup of milk tea. Today is Friday.

Your task is to calculate the total amount that Little M will spend on fried chicken and milk tea in the next \(n\) days (including today). Note that the purchase occurs only on Thursdays.

Hint: Since today is Friday, the first Thursday will occur 6 days later (if \(n \ge 7\)). After that, every subsequent Thursday is 7 days apart.

inputFormat

The input consists of a single line containing three space-separated integers \(f\), \(m\), and \(n\), where:

  • \(f\) is the cost of one portion of fried chicken.
  • \(m\) is the cost of one cup of milk tea.
  • \(n\) is the number of days (including today).

outputFormat

Output a single integer representing the total amount spent on the purchases that occur on Thursdays during the next \(n\) days.

sample

10 5 7
25