C - Mandarin Orange

There are dishes arranged in a row in front of Takahashi. The -th dish from the left has oranges on it.

Takahashi will choose a triple of integers satisfying all of the following conditions:

• for every integer between and (inclusive), .

He will then pick up and eat oranges from each of the -th through -th dishes from the left.

At most how many oranges can he eat by choosing the triple to maximize this number?

Constraints

• All values in input are integers.

Sample Input 1

Sample Output 1

D - Logical Expression

Given are strings , each of which is AND or OR.

Find the number of tuples of variables , where each element is or , such that the following computation results in being :

• ;
• for , if is AND, and if is OR.

Here, a b and a b are logical operators.

Constraints

• is AND or OR.

Sample Input 1

Sample Output 1

解法一

：前 个元素使得 的个数（0 为 F，1 为 T）

E - Rotate and Flip

There are pieces on a two-dimensional plane. The coordinates of Piece are . There may be multiple pieces at the same coordinates.

We will do operations , one by one. There are four kinds of operations, described below along with their formats in input.

• 1：Rotate every piece degrees clockwise about the origin;
• 2：Rotate every piece degrees counterclockwise about the origin;
• 3 p：Move each piece to the point symmetric to it about the line ;
• 4 p：Move each piece to the point symmetric to it about the line .

You are given queries. In the -th query, given two integers and , print the coordinates of Piece just after the -th operation. Here, the moment just before the -st operation is considered to be the moment just after “the -th operation”.

Constraints

• All values in input are integers.
• is in the format of one of the four kinds of operations.
• In an operation with the form 3 p or 4 p, .

Sample Input 1

Sample Output 1

Initially, the only piece - Piece - is at . Each operation moves the piece as follows: .

TestCode