Vacuum-Bot#3828

Vacuum-Bot

1 second
64 megabytes
Very easy

A large room with dusty floor is represented as a -D plane. You have a disc-shaped robot (the vacuum-bot) that traverses the floor while vacuuming the dust underneath. Given the trajectory of the vacuum-bot from the instant it is powered-on to the instant it is powered-off, your task is to calculate the total area of dust-free floor at the end of vacuum-bot operation.

The vacuum-bot is represented as a circle with diameter . Initially the entire floor is dusty and the vacuum-bot faces east. The trajectory of the vacuum-bot is encoded as a string whose characters sequentially describe one of four actions:

For example, the string

ssrslsx

encodes the following vacuum-bot trajectory:

Dust-free floor is shown in blue. Its total area is 3.5 + 0.375\pi \approx 4.6781. You may assume that the vacuum-bot never encounters any obstacle (walls, humans, giant dust bunnies), and no new dust will appear. Note that there are multiple, independent test cases.

Input

The first input line contains the number of test cases , 1 \le N \le 100.

Each test case consists of a string on a single line, representing the trajectory of the vacuum-bot.

  • 1 \le \text{length}(s) \le 100.

  • consists of characters 's', 'r', 'l', until the last character, which is always 'x'.

Output

For each test case, print the total area of dust-free floor after vacuum-bot operation, to decimal places, on a single line.

Examples

Example 1

Loading
Loading