Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ThePyramidOfKingDjoser
- {
- class Program
- {
- static void Main(string[] args)
- {
- int basis = int.Parse(Console.ReadLine());
- double increment = double.Parse(Console.ReadLine());
- double step = 0;
- double stone = 0;
- double marble = 0;
- double lapis = 0;
- double gold = 0;
- for (int i = basis; i > 0; i -= 2)
- {
- int size = i * i;
- step++;
- if (i < 3)
- {
- gold = size * increment;
- }
- else
- {
- stone += (i - 2) * (i - 2) * increment;
- double decorate = (i * 4 - 4) * increment;
- if (step % 5 != 0)
- {
- marble += decorate;
- }
- else
- {
- lapis += decorate;
- }
- }
- }
- Console.WriteLine($"Stone required: { Math.Ceiling(stone)}");
- Console.WriteLine($"Marble required: { Math.Ceiling(marble)}");
- Console.WriteLine($"Lapis Lazuli required: { Math.Ceiling(lapis)}");
- Console.WriteLine($"Gold required: { Math.Ceiling(gold)}");
- Console.WriteLine($"Final pyramid height: { Math.Floor(step * increment)}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement