# [porcelain tiles and game theory] there square, brake game

Time：2021-8-15

The problems related to porcelain pieces seem to be similar to recursion. They have their own regular formulas. Please deduce more

#### Theatre Square

Theatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniversary, a decision was taken to pave the Square with square granite flagstones. Each flagstone is of the size a × a.

What is the least number of flagstones needed to pave the Square? It’s allowed to cover the surface larger than the Theatre Square, but the Square has to be covered. It’s not allowed to break the flagstones. The sides of flagstones should be parallel to the sides of the Square.

Input
The input contains three positive integer numbers in the first line: n,  m and a (1 ≤  n, m, a ≤ 109).

Output
Write the needed number of flagstones.

Examples
Input
6 6 4
Output
4

Note: the time limit is displayed after the operation. No problem has been found

``````//#include<iostream>
//#include<algorithm>
//#include<string>
//#include<string.h>
//#include<cstdio>
//#include<queue>
//#include<stack>
//#include<set>
//#include<vector>
//using namespace std;
//int main(){
//    int num1,num2,num3;
//    while(cin >> num1 >> num2 >> num3,num1||num2||num3){
//        int ans1,ans2;
//        ans1 = num1/num3;
//        ans2 = num2/num3;
//        if(num1%num3 != 0){
//            ans1++;
//        }
//        if(num2%num3 != 0){
//            ans2++;
//        }
//        cout << (long long)(ans1*ans2) << endl;
//    }
//    return 0;
//}``````

#### Brave Game

When I was in college ten years ago, China introduced some blockbusters from abroad every year. One of them is called the game of the brave (English Name: Zathura). Up to now, I am still deeply impressed by some computer stunts in the film.
Today, we choose to take the computer test, which is a brave choice; This short semester, we are talking about the topic of game; Therefore, we are also playing the “game of the brave”, which is the reason why I named this topic.
Of course, in addition to “courage”, I also hope to see “integrity”. No matter what the test results are, I hope to see a real result. I also believe you can do it~

What is the first game for the brave? Quite simply, it is defined as follows:
1. This game is a two person game;
2. There is a pile of stones, a total of N;
3. Two people take turns;
4. Each step can take 1… M stones;
5. The party who takes the light stone first wins;

If both sides of the game use the optimal strategy, please output who can win.
Input
The input data first contains a positive integer C (C < = 100), indicating that there is group C test data.
Each group of test data occupies one line and contains two integers n and m (1 < = n, m < = 1000). See the title description for the meaning of N and m.
Output
If the person who leaves first can win, please output “first”. Otherwise, please output “second”. The output of each instance occupies one line.
Sample Input
2
23 2
4 3
Sample Output
first
second

``````//#include<iostream>
//#include<algorithm>
//#include<string>
//#include<string.h>
//#include<cstdio>
//#include<queue>
//#include<stack>
//#include<set>
//#include<vector>
//using namespace std;
///*The optimal strategy mentioned in this topic that no one follows refers to the optimal strategy that the other party can't finish the next time. Not both people take the most M
//For example, in the group of 10 and 4, f takes 4 first. At this time, s does not take 4 (in this way, f will win after taking it next time, which is not the best), but 1 (in this way, there are only 5 left, and F will not win next time)
//S takes 1 for the first time and there are 5 left. No matter how much f takes the second time, the rest is < = 4 (for example, f takes 1 and there are 4 left). S can win the game the second time!
//N% (M + 1) = = 0 can be understood as: if you want to win the game, you should take the stones first. Be sure to ensure that the number of remaining stones is less than or equal to m when you take stones for the last time.
//So the penultimate time your friend takes stones, be sure to ensure that the number of remaining stones is m + 1, so that no matter how many stones he takes (1 to m), you can take them all at the last time!
//That is, once the remaining number of stones n when the first stone is taken meets n% (M + 1) = = 0, you, as the second stone taker, will win!
//*/
//int main(){
//    int t = 0;
//    cin >> t;
//    while(t--){
//        int n,m;
//        cin >> n >> m;
//        if(n%(m+1) == 0){
//            printf("second\n");// If you are satisfied, the second person will win
//        }else{
//            printf("first\n");
//        }
//    }
//    return 0;
//}``````

## Less sass SCSS stylus of CSS preprocessor

Let’s ask ourselves a question: why do we need a preprocessor?The answer is self-evident, that is, CSS itself has some disadvantages: The syntax is not strong enough to be written nested, resulting in unclear style logic in the project. There is no variable and logical reuse mechanism. When it is necessary to reuse code, you […]