Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace GiftboxCoverage
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- double sizeOfBoxSide = double.Parse(Console.ReadLine());
- int allSheetsOfPaper = int.Parse(Console.ReadLine());
- double areaCoveredBySingleNormalSheet = double.Parse(Console.ReadLine());
- double areaCoveredByEveryThirdSheet = 0.25 * areaCoveredBySingleNormalSheet;
- double numberOfEveryThirdSheet = Math.Truncate((double)allSheetsOfPaper / 3);
- double numberOfEveryNormalSheet = allSheetsOfPaper - numberOfEveryThirdSheet;
- double areaCoveredWithAllSheets = (numberOfEveryNormalSheet * areaCoveredBySingleNormalSheet) + (numberOfEveryThirdSheet * areaCoveredByEveryThirdSheet);
- double areaOfGiftBox = sizeOfBoxSide * sizeOfBoxSide*6;
- double percentageAllSheetsCovered = areaCoveredWithAllSheets / areaOfGiftBox * 100;
- Console.WriteLine($"You can cover {percentageAllSheetsCovered:F2}% of the box.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement