The metric system is widely used around the world. But it wasn't always like that. Each country has their own metrification journey, with ups and downs, progress and resistance. The metric system started as a revolutionary idea that fit with the ideals of the French Revolution. Over time, it was adopted by a majority of countries.
Japan started metrication in 1885, during an era when Japan opened up to the outside world and had a lot of interest in foreign technologies. But adoption was not smooth and easy. Over decades, construction, agriculture, trade and education adjusted slowly to the new system.
For example, the land registry had to be converted to metric units.
Let's imagine a sample from Japan's land registry in those days (your test input). Each line has the widths x heights of a plot of land, expressed using Japanese numbers and traditional units:
二百四十二町 × 三百五十一丈
七十八寸 × 二十一万七千八百厘
七万二千三百五十八町 × 六百十二分
六寸 × 三十万七千九十八尺
九間 × 三万三千百五十四里
六百毛 × 七百四十四万千五百厘
七十八億二千八十三万五千毛 × 二十八万八千六百毛
三百七十四万二千五百三十厘 × 六百七十一万七千厘
How can we interpret this? Let's break it down.
First of all, you need to know how to count in Japanese. It goes like...
Larger numbers are formed like so:
Use these characters for powers of ten:
In our arabic numerals, we group digits by thousands (and write a comma to separate them). In Japanese, digits are grouped by ten thousands, also called myriads. In Japanese numerals, 100,000 is expressed as 10 times 10,000.
Finally, there is a character for 10,000 times 10,000, or 100 million:
Here are some examples of how you combine these numbers:
Note that 十 (10), 百 (100) and 千 (1,000) occur multiple times - their value is always relative to the following myriad character 万 (or 億). To illustrate, let's break down the last example:
九 | 億 | 八 千 | 七 百 | 六 十 | 五 | 万 | 四 千 | 三 百 | 二 十 | 一 | |||||||||||
(9) | * | 100,000,000 | + | (8,000 | + | 700 | + | 60 | + | 5) | * | 10,000 | + | (4,000 | + | 300 | + | 20 | + | 1) |
In the traditional system, the base unit of length is a shaku, or "ruler" using the Japanese character: 尺. The unit was originally derived from the distance between the index finger and the thumb when you spread them out (if you squint, you can see that depicted in the character 尺). This measure is not very precise and varied over time, and also from town to town. Later, it was standardized to exactly 10/33 m (about 30.3 cm). Even though reaching that far with your thumb and index finger is a real challenge!
The Japanese system also knows larger units:
As well as smaller units:
If we apply all this to our test input:
二百四十二町 × 三百五十一丈
= 242 Cho × 351 Jo = 28080000 m²七十八寸 × 二十一万七千八百厘
= 78 Sun × 217800 Rin = 156 m²七万二千三百五十八町 × 六百十二分
= 72358 Cho × 612 Bu = 14639040 m²六寸 × 三十万七千九十八尺
= 6 Sun × 307098 Shaku = 16920 m²九間 × 三万三千百五十四里
= 9 Ken × 33154 Ri = 2130624000 m²六百毛 × 七百四十四万千五百厘
= 600 Mo × 7441500 Rin = 41 m²七十八億二千八十三万五千毛 × 二十八万八千六百毛
= 7820835000 Mo × 288600 Mo = 2072629 m²三百七十四万二千五百三十厘 × 六百七十一万七千厘
= 3742530 Rin × 6717000 Rin = 2308409 m²In this example, the total area in square meter is: 2177741195
. Your answer will always be an integral number.
What is the total area in square meters for your puzzle input?
To play, please log in with one of these options:
GitHub Login |
Google Login