Output subdivisions of international standard paper sizes ISO Paper Sizes Defined:

The A series paper sizes are defined by the following requirements:

The length divided by the width is the square root of 2.
The A0 size has an area of 1 unit.
Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides.




Task:

given an input f[n] output A0 divided into n subdivisions.

Test cases:

f[1] to f[12]:



Here, A0 is given by f[1], but this indexing isn't essential.

Winning criteria:

The shortest code in bytes wins.
JavaScript (ES6) + HTML, 96 94 + 34 = 130 128 bytes


f=(n,w=297,h=210)=&gt;n--&amp;&amp;f(n,h&lt;w?w/2:w,h&lt;w?h:h/2,(C=c.getContext`2d`).rect(0,0,w,h),C.stroke())

f(8)
&lt;canvas id=c width=300 height=300&gt;