Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- int tankPrice = int.Parse(Console.ReadLine());
- int parties = int.Parse(Console.ReadLine());
- int monthCash = 60 - (parties * 2);
- int cashForParties = parties * 5;
- double months =(double)tankPrice / (monthCash - cashForParties);
- int monthsInt =(int)Math.Ceiling(months);
- if (parties > 8)
- {
- Console.WriteLine("never");
- }
- else
- {
- int years = monthsInt / 12;
- months = monthsInt % 12;
- Console.WriteLine("{0} years, {1} months", years, months);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement