# Toilet Paper Mysteries

## Pyth, ~~27~~ 23 bytes

```
+fg0=-QJc*.n0+18T50)cQJ
```

Try it online. Test suite.

### Explanation

```
Q = input number (implicit)
f ) increment T from 1, for each T:
+18T add 18 to T, get radius
*.n0 multiply by pi to, get half the circumference
c 50 divide by 50, get circumference in sheets
J save it to J
=-Q decrement Q by it
g0 use this T if Q is now <= 0
+ add
Q Q (now <= 0)
c J divided by J (the last circumference)
and print (implicit)
```

## Haskell, ~~59~~ ~~46~~ 44 bytes

A scale factor of 5/pi is applied, so that a paper cylinder has a circumference of 19,20,21... cm and a sheet is 50/pi cm.

Saved 2 bytes thanks to xnor, by using an unnamed function.

```
x!s|s>x=1+(x+1)!(s-x)|1>0=s/x
(19!).(50/pi*)
```

## Jelly, ~~29~~ ~~27~~ 26 bytes

```
R+18×3.6°µ0;+\³_÷µḞi0©ị+®’
```

Try it online!