Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01PartyProfit
- {
- class Program
- {
- static void Main(string[] args)
- {
- long partySize = long.Parse(Console.ReadLine());
- long days = long.Parse(Console.ReadLine());
- double coins = 0;
- for (int currDay = 1; currDay <= days; currDay++)
- {
- if (currDay % 10 == 0)
- {
- partySize -= 2;
- }
- if (currDay % 15 == 0)
- {
- partySize += 5;
- }
- coins += 50;
- coins -= (partySize * 2);
- if (currDay%3==0)
- {
- coins -= partySize * 3;
- }
- if (currDay%5==0)
- {
- coins += partySize * 20;
- if (currDay%3==0)
- {
- coins -= partySize * 2;
- }
- }
- }
- double coinsPerPerson =Math.Floor( coins / partySize);
- Console.WriteLine($"{partySize} companions received {coinsPerPerson} coins each.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment