Skip to content

Instantly share code, notes, and snippets.

@igorLisovitskiy
Created February 4, 2019 22:15
Show Gist options
  • Save igorLisovitskiy/d47af660d2b20dc5d96e2c2ada43204a to your computer and use it in GitHub Desktop.
Save igorLisovitskiy/d47af660d2b20dc5d96e2c2ada43204a to your computer and use it in GitHub Desktop.
int RoomLength = 6;
int RoomWidth = 2;
int RoomHeigth = 3;
double WallpaperWidth = .5;
int WallpaperLength = 10;
// wallpaper pieces
double numberOfDrops = (6 * 2 + 2 * 2) / 0.5; // two walls by their width = 32
// wallpaper length
double requiredWallpaperLength = numberOfDrops * RoomHeigth; // 96
// calculating the number of rolls
double numberOfrolls = requiredWallpaperLength / WallpaperLength; // 9.6 ~ 10
Console.WriteLine($"Number of rolls required: {Math.Ceiling(numberOfrolls)}")
@igorLisovitskiy
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment