Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace help
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int X_loze_area = int.Parse(Console.ReadLine());
  14. double Y_grapes_for_one_sq = double.Parse(Console.ReadLine());
  15. int Z_needed_litres = int.Parse(Console.ReadLine());
  16. int number_of_workers = int.Parse(Console.ReadLine());
  17.  
  18. //judge sumbit link: https://judge.softuni.bg/Contests/Practice/Index/507#3
  19.  
  20. double kg_grapes = (X_loze_area * Y_grapes_for_one_sq) * 0.4;
  21. double vino = kg_grapes / 2.5;
  22.  
  23. if (vino >= Z_needed_litres)
  24. {
  25. Console.WriteLine("Good harvest this year! Total wine: {0} liters.", Math.Floor(vino));
  26. Console.WriteLine("{0} liters left -> {1} liters per person.", Math.Ceiling(vino - Z_needed_litres), Math.Ceiling((vino -Z_needed_litres) / number_of_workers));
  27.  
  28. }
  29.  
  30. else
  31.  
  32. {
  33. Console.WriteLine("It will be a tough winter! More {0} liters wine needed.", Math.Floor(Z_needed_litres - vino));
  34. }
  35.  
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement