using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _8_HeWhoFoldsHoldsTheMoon {
	internal static class Calculations {
		public static int CalculateFoldage(double thickness, int distance) {
			var count = 0;
			var intThickness = 0;
			while (intThickness + thickness < distance) {
				intThickness *= 2;
				thickness *= 2;

				while (thickness >= 1) {
					thickness -= 1;
					intThickness += 1;
				}

				count++;
			}

			return count;
		}

		public static (double x, double y) CalculateSize(int count, (double x, double y) size) {
			var divider = Math.Pow(2, -count);

			return (size.x * divider, size.y * divider);
		}
	}
}
