Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- long pageCount = long.Parse(Console.ReadLine());
- int campingDays = int.Parse(Console.ReadLine());
- int normalDay = int.Parse(Console.ReadLine());
- double months1 = 0;
- int years = 0;
- double months = 0;
- long divider = (30 - campingDays) * normalDay;
- if (divider <= 0 || campingDays >= 30)
- {
- Console.WriteLine("never");
- }
- else
- {
- months = Math.Ceiling(pageCount / (double)divider);
- years = (int) (months / 12);
- months = months % 12;
- Console.WriteLine("{0} years {1} months", years, (int)months);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment