Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Christmas_Spirit
- {
- class Program
- {
- static void Main()
- {
- var decorPrices = new Decorations(2, 5, 3, 15);
- int quantity = int.Parse(Console.ReadLine());
- int days = int.Parse(Console.ReadLine());
- int christmasSpirit = 0;
- int cost = 0;
- for (int i = 1; i <= days; i++)
- {
- if (i % 11 == 0)
- {
- quantity += 2;
- }
- if (i % 2 == 0)
- {
- cost += quantity * decorPrices.OrnamentSet;
- christmasSpirit += 5;
- }
- if (i % 3 == 0)
- {
- cost += quantity * (decorPrices.TreeSkirt + decorPrices.TreeGarlands);
- christmasSpirit += 13;
- }
- if (i % 5 == 0)
- {
- cost += quantity * decorPrices.TreeLights;
- christmasSpirit += 17;
- if (i % 3 == 0)
- {
- christmasSpirit += 30;
- }
- }
- if (i % 10 == 0)
- {
- christmasSpirit -= 20;
- cost += decorPrices.TreeSkirt + decorPrices.TreeGarlands + decorPrices.TreeLights;
- if (i == days)
- {
- christmasSpirit -= 30;
- }
- }
- }
- Console.WriteLine($"Total cost: {cost}");
- Console.WriteLine($"Total spirit: {christmasSpirit}");
- }
- }
- class Decorations
- {
- public Decorations(int ornamentSet, int treeSkirt, int treeGarlands, int treeLights)
- {
- OrnamentSet = ornamentSet;
- TreeSkirt = treeSkirt;
- TreeGarlands = treeGarlands;
- TreeLights = treeLights;
- }
- public int OrnamentSet { get; set; }
- public int TreeSkirt { get; set; }
- public int TreeGarlands { get; set; }
- public int TreeLights { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement