Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01ChristmasSpirit
- {
- class Program
- {
- static void Main(string[] args)
- {
- int quantity = int.Parse(Console.ReadLine());
- int days = int.Parse(Console.ReadLine());
- int spentMoney = 0;
- int christmasSpirit = 0;
- for (int currDay = 1; currDay <= days; currDay++)
- {
- if (currDay%11==0)
- {
- quantity += 2;
- }
- if (currDay%2==0)
- {
- spentMoney += 2 * quantity;
- christmasSpirit += 5;
- }
- if (currDay%3==0)
- {
- spentMoney += 5 * quantity;
- spentMoney += 3 * quantity;
- christmasSpirit += 13;
- }
- if (currDay%5==0)
- {
- spentMoney += 15 * quantity;
- christmasSpirit += 17;
- if (currDay%3==0)
- {
- christmasSpirit += 30;
- }
- }
- if (currDay%10==0)
- {
- christmasSpirit -= 20;
- spentMoney += 5 + 3 + 15;
- if(currDay%10==0 && currDay==days)
- {
- christmasSpirit -= 30;
- }
- }
- }
- Console.WriteLine("Total cost: {0}",spentMoney);
- Console.WriteLine("Total spirit: {0}",christmasSpirit);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement