问题 B: Haitang and Uma Musume

内存限制:256 MB 时间限制:1 S
题面:传统 评测方式:Special Judge 上传者:
提交:1 通过:1

题目描述

In this problem, you need to simulate the simplified calculation of training attributes in the game **Uma Musume Pretty Derby**.

**Note that the rules in this problem are different from the original game.**

Specifically, you will receive the information of an **Uma Musume** and 6 **Support Cards**, as well as several **trainings**, and you need to output the values of each attribute of the **Uma Musume**.

All **Uma Musume** have 6 abilities, which are **speed** $\textstyle speed$, **stamina** $\textstyle sta$, **power** $\textstyle power$, **guts** $\textstyle guts$, **wisdom** $\textstyle wis$, and **skill points** $\textstyle skill$.

An **Uma Musume** has 10 attributes, which are the initial values $\textstyle speed_0,sta_0,power_0,guts_0,wis_0$ of the first 5 abilities and their training bonuses $\textstyle speed_\times,sta_\times,power_\times,guts_\times,wis_\times$.

A **Support Card** has 13 attributes, including the friendship bonus $\textstyle friend$, the motivation effect enhancement $\textstyle drive_+$, the training effect enhancement $\textstyle train$, the initial value bonus of the first 5 attributes $\textstyle speed_0',sta_0',power_0',guts_0',wis_0'$, and the training bonus of the first 5 attributes $\textstyle speed_+,sta_+,power_+,guts_+,wis_+$.

In a single game, you will choose an **Uma Musume** and 6 **Support Cards**. Then, you will let your **Uma Musume** do several **training**.

Each training consists of 6 attributes, including the training camp status $\textstyle summer$, the overweight status $\textstyle weight$, the current motivation $\textstyle drive$, the type of training $\textstyle type$, the level of training $\textstyle lv$, and the set of support cards present (including whether each support card is in a friendship training state) $\textstyle S$. $\textstyle lv$ will not be given directly, but the calculation method is as follows:

-   During the training camp, $\textstyle lv$ is fixed at $\textstyle 5$.
    
-   Outside the training camp, $\textstyle lv$ starts at $\textstyle 1$.
    
-   After completing 4 times of the same type of training **outside** the camp, the $\textstyle lv$ of the **specific type** of training will increase by $\textstyle 1$, but not exceeding $\textstyle 5$.
    

In the following text, $\textstyle \sum_{all}$ represents all carried support cards, $\textstyle \sum_{present}$ represents all support cards present in the current training, and $\textstyle \prod_{friends}$ represents all support cards present in the current training and in a friendship training state.

The initial number of skill points for the **Uma Musume** is $\textstyle 120$, and the initial values of the remaining abilities are $\textstyle \min(1200,X_0+\sum_{all} X_0')$, where $\textstyle X$ represents one among the 6 ability types.

The increase in an **Uma Musume**’s attribute after a training can be calculated according to the following formula, and we will provide a detailed explanation for each item:

$\textstyle \Delta X=\lfloor(base_{lv,type,X}+\sum_{present}X_+)\cdot(\prod_{friends}(1+0.01\cdot friend))\cdot(1+0.01\cdot \sum_{present}train)$  
$\textstyle \cdot(1+coef_{drive}\cdot(1+0.01\cdot\sum_{present} drive_+))\cdot(1+0.01\cdot X_\times)\cdot(1+\sum_{present}0.05)\rfloor$

-   base training value $\textstyle (base_{lv,type,X}+\sum_{present}X_+)$
    

The $\textstyle base_{lv,type,X}$ array will be provided in the appendix. Specifically, this represents the base value for the increase of each ability, for each type of training, at each level.

$\textstyle \sum_{present}X_+$ represents the sum of the attribute bonuses of all support cards present, and $\textstyle skill_+$ is always equal to zero.

-   Friendship bonus $\textstyle (\prod_{friends}(1+0.01\cdot friend))$
    

For each **Support Card** with a **friendship training**, we add one to its friendship bonus and then multiply them all together.

-   Training effect enhancement $\textstyle (1+0.01\cdot \sum_{present}train)$
    

We sum up the training bonuses of all **Support Cards** present and add one.

-   Motivation bonus $\textstyle (1+coef_{drive}\cdot(1+0.01\cdot\sum_{present} drive_+))$
    

The motivation ranges from $\textstyle [0,4]$, and $\textstyle coef_i$ are respectively $\textstyle -0.2,-0.1,0,0.1,0.2$.

For each **Support Card** present, we sum up their motivation bonuses and add one, then multiply by the motivation coefficient.

-   **Uma Musume** growth rate $\textstyle (1+0.01\cdot X_\times)$
    

This parameter is only related to the **Uma Musume**’s attributes, and $\textstyle skill_\times$ is always equal to zero.

-   Number of support cards present $\textstyle (1+\sum_{present}0.05)$
    

Each present **Support Card** will provide a $\textstyle 0.05$ bonus.

-   Other rules
    

In particular, if $\textstyle weight=1$, the $\textstyle \Delta speed$ will be forced to become $\textstyle 0$, i.e. the speed cannot be increased.

After training, if the first 5 abilities exceed $\textstyle 1200$, we will take the minimum of $\textstyle 1200$, note that this rule does not apply to skill points.

You need to print the 6 abilities of the **Uma Musume** after each training.

输入格式

The first line contains 10 integers $\textstyle speed_0,sta_0,power_0,guts_0,wis_0,speed_\times,sta_\times,power_\times,guts_\times,wis_\times$ ($\textstyle 50\le speed_0,sta_0,power_0,guts_0,wis_0\le 200$, $\textstyle 0\le speed_\times,sta_\times,power_\times,guts_\times,wis_\times\le 30$), representing the **Uma Musume**.

Each of the next 6 lines contains 13 integers  
$\textstyle friend,drive_+,train,speed_0',sta_0',power_0',guts_0',wis_0',speed_+,sta_+,power_+,guts_+,wis_+$ ($\textstyle 0\le friend,drive_+,train,speed_0',sta_0',power_0',guts_0',wis_0',speed_+,sta_+,power_+,guts_+,wis_+\le 30$), representing a **Support Card**.

The next line contains an integer $\textstyle n$ ($\textstyle 1\le n\le 72$) — the number of **trainings**.

Each of the next $\textstyle n$ lines begins with 5 integers $\textstyle summer,weight,drive,type,|S|$ ($\textstyle 0\le summer,weight\le 1$, $\textstyle 0\le drive,type\le 4$, $\textstyle 0\le |S|\le 5$), representing a **training**. Then $\textstyle |S|$ pairs of integers $\textstyle x_i,y_i$ ($\textstyle 1\le x\le 6$, $\textstyle 0\le y\le 1$) follow, representing the $\textstyle x_i$\-th **Support Card** is present in this training, and $\textstyle y=1$ means it has the **friendship training**.

It is guaranteed that in each training, $\textstyle x_i$ are pairwise different.

输出格式

After each training, print one line contains 6 integers — the abilities of the **Uma Musume**.

输入样例 复制

71 117 70 102 90 0 10 0 20 0
25 30 15 0 0 0 0 0 0 1 0 0 0
30 30 15 0 0 0 0 30 0 0 0 0 1
25 0 15 0 0 0 0 0 0 0 0 0 2
30 30 10 0 0 20 0 0 0 0 1 0 0
30 30 0 0 0 0 20 0 1 0 1 0 0
30 0 10 0 0 0 0 0 0 0 0 1 0
9
0 1 0 0 1 5 0
0 0 1 0 4 1 1 2 0 3 0 4 0
0 1 2 0 3 1 0 3 0 6 0
0 0 3 0 5 1 1 2 1 3 1 4 1 5 1
0 1 4 0 3 2 1 4 0 6 1
1 0 3 1 0
1 1 4 2 1 3 1
1 0 3 3 3 4 1 5 0 6 1
1 1 4 4 1 4 0

输出样例 复制

71 117 94 122 120 121
89 119 105 122 125 124
89 120 113 123 128 127
178 128 169 123 152 143
178 128 189 127 155 149
178 143 189 132 155 151
178 156 210 132 158 154
194 156 228 174 158 159
194 156 229 174 176 164

分类标签