{"raw_statement":[{"iden":"problem overview","content":"This problem is to maximize utilization of available machinery and personnel (referred to as “workers” for simplicity) for an agricultural equipment sharing service, accepting agricultural work (referred to as “jobs”) while maximizing reward*. You will initially select the jobs to accept from among many that are distributed over a space, and then produce and update job performance schedules, outputting instructions to workers to process the jobs. Each job is composed of multiple “tasks” requiring a specified amount of processing and is considered complete when workers have processed these “tasks”. Basically all accepted jobs must be completed (otherwise penalties for unfinished jobs will be applied). Reward is obtained by completing jobs, but amount of reward depends on when tasks were completed, so the appropriate time-frame for handling each task must be considered. The number of tasks that can be handled at a particular time is also dependent on the capabilities of the workers and the weather. Weather forecasts are provided for set periods of time.\n*Reward: Assuming factors such as the harvest time for the crops and the rate of renewable energy supplied to agricultural equipment.\n![image](https://img.atcoder.jp/hokudai-hitachi2022/d1322d9e6b5804ee14b50150d0016990.png) ![image](https://img.atcoder.jp/hokudai-hitachi2022/751c572a574f7439e188671d0fadd90d.png) ![image](https://img.atcoder.jp/hokudai-hitachi2022/279b072d4bc44aac50b8e1b79bae7664.png)\nThe following data is given as the initial input.\n\n1.  Work time frame\n2.  Geographical data (graph)\n3.  Worker data\n4.  All job data\n5.  Weather related data\n6.  Schedule related data\n\nGiven this data, you shall output:\n\n1.  Which jobs you will accept.\n\nThen, at the start of each time point, the following data will be provided as input:\n\n1.  Data regarding the accepted jobs.\n2.  The current location of workers.\n3.  Weather forecasts (for set intervals).\n\nBased on this data, you must output:\n\n1.  A job performance schedule\n2.  Actions for each worker\n\nThis cycle is repeated until the specified work time frame ends.\nYour output will be scored based on:\n\n1.  The reward earned.\n2.  Penalties for not finishing jobs.\n3.  Degree to which the schedule was followed and changed.\n\nMore detailed description is given below."},{"iden":"input 1","content":"The initial input is:\n\n1.  Work time frame\n2.  Geographical data(graph)\n3.  Worker data\n4.  All job data\n5.  Weather related data\n6.  Schedule related data\n\nThis data is given on standard input in the following format:\n\n%mathstart%\nT_{\\rm{max}}\\\\\nN_V\\,\\,N_E\\\\\nu_1\\quad v_1\\quad d_1\\\\\n\\vdots\\\\\nu_{N_E}\\,\\, v_{N_E}\\,\\, d_{N_E}\\\\\nN_{\\rm{worker}}\\\\\nv^{\\rm{init}}_1\\,\\,L^\\text{max}_1\\,\\,N^{\\rm{JobType}}_1\\,\\,\\text{Type}^1_1\\,\\,\\text{Type}^1_2\\,\\,\\cdots \\text{Type}^1_{N^{\\rm{JobType}}_1}\\\\\n\\vdots\\\\\nv^{\\rm{init}}_{N_{\\rm{worker}}}\\,\\,L^\\text{max}_{N_{\\rm{worker}}}\\,\\,N^{\\rm{JobType}}_{N_{\\rm{worker}}}\\,\\,\\text{Type}^{N_{\\rm{worker}}}_1\\,\\,\\text{Type}^{N_{\\rm{worker}}}_2\\,\\,\\cdots \\text{Type}^{N_{\\rm{worker}}}_{N^{\\rm{JobType}}_1}\\\\\nN_{\\rm{job}}\\\\\n\\text{Job}_1\\\\\n\\vdots\\\\\n\\text{Job}_{N_{\\rm{job}}}\\\\\nT^{\\rm{weather}}\\,\\,N^{\\rm{weather}}\\\\\n\\begin{array}{llll}\np^{\\rm{weather}}_{1,1} & p^{\\rm{weather}}_{1,2} & \\cdots & p^{\\rm{weather}}_{1,N^{\\rm{weather}}}\\\\\np^{\\rm{weather}}_{2,1} & p^{\\rm{weather}}_{2,2} & \\cdots & p^{\\rm{weather}}_{2,N^{\\rm{weather}}}\\\\\n\\vdots & \\vdots & \\ddots & \\vdots\\\\\np^{\\rm{weather}}_{N^{\\rm{weather}},1} & p^{\\rm{weather}}_{N^{\\rm{weather}},2} & \\cdots & p^{\\rm{weather}}_{N^{\\rm{weather}},N^{\\rm{weather}}}\\\\\n\\end{array}\\\\\nc_1\\,\\,c_2\\,\\,\\cdots\\,\\,c_{N^{\\rm{weather}}}\\\\\nP_m\\,\\, R_m\\,\\, \\alpha\\\\\nt_1\\,\\, p^1_1\\,\\, p^1_2\\,\\, \\cdots \\,\\, p^1_{N^{\\rm{weather}}}\\\\\nt_2\\,\\, p^2_1\\,\\, p^2_2\\,\\, \\cdots \\,\\, p^2_{N^{\\rm{weather}}}\\\\\n\\vdots\\\\\nt_{N'}\\,\\, p^{N'}_1\\,\\, p^{N'}_2\\,\\, \\cdots \\,\\, p^{N'}_{N^{\\rm{weather}}}%mathend%\n\n(The structure for $\\text{Job}_i$ is described below)\n\n#### Work Time Frame\n\n*   **Input**\n    *   The length of the work time frame,$T_\\text{max}$, is given in the first line.\n\nFor this problem, time values, $t$, will be integer values from $1$ to $T_{\\text{max}}$.\nInput example The following is an example with $T_\\text{max}=300$\n\n300\n\n(the line ends with a line-feed character)\n\n*   Line1: Length of work time frame is `300` ($T_\\text{max}=300$).\n\n#### Geographical Data\n\n*   **Input**\n    *   The next line gives the number of vertices, $N_V$, and edges, $N_E$, for a graph representing geographical data for the problem (a connected, non-directed graph with positive weightings).\n        *   The $N_V$ individual vertices will be numbered from $1$ to $N_V$.\n    *   The following $N_E$ lines give data for each edge: vertices $u_i,v_i$, and weight $d_i$ (distance).Note that $1\\leq i \\leq N_E$.\n\nAs described below, [jobs](#job-en) are located on vertices and [workers](#worker-en) move along edges of this graph.\nInput example The following is an example with $N_V=14,N_E=19$:\n\n14 19\n1 7 1\n1 2 1\n2 9 1\n2 3 1\n3 5 1\n3 7 1\n3 6 1\n4 13 2\n4 10 2\n4 6 1\n4 5 1\n6 8 1\n7 8 1\n8 14 2\n9 11 2\n10 12 2\n10 11 2\n12 13 2\n13 14 2\n\n(The last line ends with a line-feed character)\n\n*   Line 1: The graph has `14` vertices and `19` edges($N_V=14,N_E=19$).\n    *   Vertex indices from $1$ to `14` are assigned to these `14` vertices.\n    *   Below, the vertex corresponding to vertex indices $i$ will be referred to simply as vertex $i$.\n*   Line 2: There is an edge of length `1` between vertices `1` and `7`($u_{1}=1,v_{1}=7,d_{1}=1$).\n*   Line 3: There is an edge of length `1` between vertices `1` and `2`($u_{2}=1,v_{2}=2,d_{2}=1$).\n*   Line 4: There is an edge of length `1` between vertices `2` and `9`($u_{3}=2,v_{3}=9,d_{3}=1$).\n*   Line 5: There is an edge of length `1` between vertices `2` and `3`($u_{4}=2,v_{4}=3,d_{4}=1$).\n*   Line 6: There is an edge of length `1` between vertices `3` and `5`($u_{5}=3,v_{5}=5,d_{5}=1$).\n*   Line 7: There is an edge of length `1` between vertices `3` and `7`($u_{6}=3,v_{6}=7,d_{6}=1$).\n*   Line 8: There is an edge of length `1` between vertices `3` and `6`($u_{7}=3,v_{7}=6,d_{7}=1$).\n*   Line 9: There is an edge of length `2` between vertices `4` and `13`($u_{8}=4,v_{8}=13,d_{8}=2$).\n*   Line 10: There is an edge of length `2` between vertices `4` and `10`($u_{9}=4,v_{9}=10,d_{9}=2$).\n*   Line 11: There is an edge of length `1` between vertices `4` and `6`($u_{10}=4,v_{10}=6,d_{10}=1$).\n*   Line 12: There is an edge of length `1` between vertices `4` and `5`($u_{11}=4,v_{11}=5,d_{11}=1$).\n*   Line 13: There is an edge of length `1` between vertices `6` and `8`($u_{12}=6,v_{12}=8,d_{12}=1$).\n*   Line 14: There is an edge of length `1` between vertices `7` and `8`($u_{13}=7,v_{13}=8,d_{13}=1$).\n*   Line 15: There is an edge of length `2` between vertices `8` and `14`($u_{14}=8,v_{14}=14,d_{14}=2$).\n*   Line 16: There is an edge of length `2` between vertices `9` and `11`($u_{15}=9,v_{15}=11,d_{15}=2$).\n*   Line 17: There is an edge of length `2` between vertices `10` and `12`($u_{16}=10,v_{16}=12,d_{16}=2$).\n*   Line 18: There is an edge of length `2` between vertices `10` and `11`($u_{17}=10,v_{17}=11,d_{17}=2$).\n*   Line 19: There is an edge of length `2` between vertices `12` and `13`($u_{18}=12,v_{18}=13,d_{18}=2$).\n*   Line 20($=1+N_E$): There is an edge of length `2` between vertices `13` and `14`($u_{19}=13,v_{19}=14,d_{19}=2$).\n\n#### Workers\n\nWorkers are entities that process jobs, and have capabilities to move and to perform tasks. They operate according to input from the contestant (See [Worker actions](#worker-action-en)).\n\n*   **Input**\n    *   The number of workers, $N_{\\text{worker}}$, is given on the next line.\n    *   This is followed by $N_{\\text{worker}}$ lines with worker configuration data:\n        \n        *   Initial position (vertex index): $v^{\\text{init}}_i$\n        *   The maximum tasks the worker can perform per unit time: $L^{\\text{max}}_i$\n        *   Number of job types the worker can perform, $N^{\\text{JobType}}_i$ , and a list of the job types: $\\text{Type}^i_1\\,\\,\\text{Type}^i_2\\,\\,\\cdots\\,\\,\\text{Type}^i_{N^{\\text{JobType}}_i}$\n        \n        ($1\\leq i \\leq N_{\\text{worker}}$)\n        \n\nThese inputs are given in order of worker ID.\nThe upper limit for number of tasks performable per unit time and the types of jobs that can be done are different for each worker. The number of tasks that can actually be completed per unit time is also dependent on the weather.\nInput example The following is an example for $N_{\\text{worker}}=5$:\n\n5\n6 100 3 1 2 3\n13 59 1 3\n10 55 2 2 3\n9 47 3 1 2 3\n9 89 1 2\n\n(The last line ends with a line-feed character)\n\n*   Line 1: There are `5` workers ($N_{\\text{worker}}=5$).\n*   Line 2: The descriptor for worker with ID=1.\n    *   The worker’s initial location is the vertex with vertex index `6` ($v^{\\text{init}}_1=6$).\n    *   The maximum number of tasks this worker can perform per unit of time is `100` ($L^{\\text{max}}_1=100$).\n    *   The worker can perform `3` types of job ($N^{\\text{JobType}}_1=3$), of types `1`, `2`, `3` ($\\text{Type}^1_1=1,\\text{Type}^1_2=2,\\text{Type}^1_3=3$).\n*   Line 3: The descriptor for worker with ID=2.\n    *   The worker’s initial location is the vertex with vertex index `13` ($v^{\\text{init}}_2=13$).\n    *   The maximum number of tasks this worker can perform per unit of time is `59` ($L^{\\text{max}}_2=59$).\n    *   The worker can perform `1` types of job ($N^{\\text{JobType}}_2=1$), of type `3` ($\\text{Type}^2_1=3$).\n*   Line 4: The descriptor for worker with ID=3.\n    *   The worker’s initial location is the vertex with vertex index `10` ($v^{\\text{init}}_3=10$).\n    *   The maximum number of tasks this worker can perform per unit of time is `55` ($L^{\\text{max}}_3=55$).\n    *   The worker can perform `2` types of job ($N^{\\text{JobType}}_3=2$), of types `2`, `3` ($\\text{Type}^3_1=2,\\text{Type}^3_2=3$).\n*   Line 5: The descriptor for worker with ID=4.\n    *   The worker’s initial location is the vertex with vertex index `9` ($v^{\\text{init}}_4=9$).\n    *   The maximum number of tasks this worker can perform per unit of time is `47` ($L^{\\text{max}}_4=47$).\n    *   The worker can perform `3` types of job ($N^{\\text{JobType}}_4=3$), of types `1`, `2`, `3` ($\\text{Type}^4_1=1,\\text{Type}^4_2=2,\\text{Type}^4_3=3$).\n*   Line 6($=1+N_{\\text{worker}}$): The descriptor for worker with ID=5.\n    *   The worker’s initial location is the vertex with vertex index `9` ($v^{\\text{init}}_5=9$).\n    *   The maximum number of tasks this worker can perform per unit of time is `89` ($L^{\\text{max}}_5=89$).\n    *   The worker can perform `1` types of job ($N^{\\text{JobType}}_5=1$), of type `2` ($\\text{Type}^5_1=2$).\n\n#### Jobs\n\nA job is work that workers perform at one of the vertices.\n\n*   **A job:**\n    *   Is a unit of work in the real world, such as harvesting a crop or applying agricultural chemicals.\n    *   Is composed of multiple smaller work tasks. For example, picking a single piece of fruit, harvesting a set area of rice plants, or spreading a chemical over a set area. These smaller amounts of work comprising a job will be called “tasks”.\n    *   A job is completed by completing the set number of tasks that comprise the job.\n    *   In reality, a job could consist of multiple types of task, but in this case, we focus on just the number of tasks. Thus, **a job is completed by just processing a set number of a task**.\n    *   The location of a job is different for each job. For this problem, **this is represented by locating each job on a vertex of the [geographical data](#geo-data-en) graph** given with the problem.\n*   **Task processing and reward**\n    *   The tasks for each job are processed by [workers](#worker-en).\n    *   The contestant shall output instructions for each worker to **move** and **perform work**, to move them to the vertex of a job and to perform the job’s tasks.\n    *   The contestant will receive reward by **completing jobs (processing the set number of tasks)**.\n    *   Each worker has an upper limit to the number of tasks they can process per unit time ([Limits on tasks performed](#task-limit-en)), so completion of a job will take a certain amount of time. Typically, a set number of tasks are processed during each set time interval from a set time.\n    *   **The amount of reward received when completing a job will depend on the time when tasks were processed**. More specifically, it is the sum for all time intervals ($t=1,2,\\cdots,T_\\text{max}$), ofthe product of the reward rate per task processed at that time point $r(t)$ $\\times$ the number of that task processed at that time point\n        \n    *   The reward rate, $r(t)$ for processing the task at each time point **is different for each job**.\n    *   The total reward collected by all workers will be the main constituent of the score for this problem ([Scoring method](#scoring-method-en)). Contestants need to decide worker actions to maximize this total reward, while also considering the other elements.\n*   **Dependencies between jobs**\n    *   Some jobs are dependent on other jobs. That is, if a job is dependent on another job, its tasks cannot be processed until the tasks of the other job have been completed.\n    *   If a job is not dependent on another job, there are no such constraints.\n*   **Accepting jobs**\n    *   The contestant must **select jobs to accept at the beginning of the problem** ([Output 1](#output1-en)).\n    *   **There are jobs that are mandatory**, so the selected jobs must include all mandatory jobs.\n    *   If all of the selected jobs are not completed by the end of the work time frame, an **unfinished-job penalty** specified per-job **will be incurred**.\n\nVarious constraints\n\n*   Tasks cannot be processed during time intervals when reward is not available (when the reward per unit task is zero).\n*   The number of tasks that a worker is able to perform per unit time is affected by the weather ([Constraints on tasks performed](#task-limit-en))\n*   Jobs that have not been accepted cannot be performed.\n\n  \n  \n\n*   **Input**\n    *   The next line gives $N_{\\text{job}}$, the number of jobs.\n    *   This is followed by lines indicating the composition of each job, $\\text{Job}_i$, for the $N_{\\text{job}}$ jobs($N_{\\text{job}}\\times 3$ lines).\n\nThe composition of $\\text{Job}_i$ is given in the following format:\n\n%mathstart%\n\\text{ID}^{\\rm{job}}_i\\,\\,\\text{Type}_i\\,\\,N^{\\rm{task}}_i\\,\\,v^{\\rm{job}}_i\\,\\, P^{\\rm{job}}_i\\,\\,d^\\text{weather}_i\\,\\, f^{\\rm{mandatory}}_i\\\\\nN^{\\rm{reward}}_i\\,\\, t^{\\rm{reward}}_{i,1}\\,\\, y^{\\rm{reward}}_{i,1}\\cdots t^{\\rm{reward}}_{i,N^{\\rm{reward}}_i}\\,\\, y^{\\rm{reward}}_{i,N^{\\rm{reward}}_i}\\\\\nN^{\\rm{depend}}_i\\,\\, {\\rm{id}}^{\\rm{depend}}_{i,1}\\,\\, \\cdots \\,\\,{\\rm{id}}^{\\rm{depend}}_{i,N^{\\rm{depend}}_i}%mathend%\n\n*   Line 1\n    *   Job ID: $\\text{ID}^{\\text{job}}_i$\n    *   Job type: $\\text{Type}_i$\n    *   No. of tasks to complete: $N^{\\text{task}}_i$\n    *   Job location (vertex index): $v^{\\text{job}}_i$\n    *   The penalty factor for jobs accepted but not finished: $P^{\\text{job}}_i$\n    *   Dependency on weather: $d^\\text{weather}_i$\n    *   Mandatory job flag: $f^{\\text{mandatory}}_i$ ($0$: optional, $1$: mandatory)\n*   Line 2 (definition of reward function, $r(t)$)\n    *   Number of control points in reward function:$N^{\\text{reward}}_i$\n    *   Control point list:$t^{\\rm{reward}}_{i,1}\\,\\,y^{\\rm{reward}}_{i,1}\\,\\,t^{\\rm{reward}}_{i,2}\\,\\,y^{\\rm{reward}}_{i,2}\\,\\,\\cdots\\,\\,t^{\\rm{reward}}_{i,N^{\\text{reward}}_i}\\,\\,y^{\\rm{reward}}_{i,N^{\\text{reward}}_i}$\n*   Line 3 (job dependencies)\n    *   Number of job dependencies: $N^{\\text{depend}}_i$\n    *   Dependency job IDs: ${\\rm{id}}^{\\rm{depend}}_{i,1}\\,\\,{\\rm{id}}^{\\rm{depend}}_{i,2}\\,\\, \\cdots \\,\\,{\\rm{id}}^{\\rm{depend}}_{i,N^{\\rm{depend}}_i}$\n\nReward function $r(t)$ details The per-task reward at time $t$ function $r(t)$ is defined by one or more control points (time and value pairs) and linear interpolation between those points.\n\nIn other words, given a list of control points, $p=((t_i,y_i))_{i=1,\\cdots,n}$ ($t_i,y_i\\in \\mathbb{Z},t_1 < t_2 < \\cdots < t_n,n\\geq 1$), the per-task reward at time $t$ function $r(t)$ (actually $r(t;p)$), is defined as:\n\n$r(t)=\\begin{cases} y_1, & \\text{if}\\,\\, t < t_1, \\\\ y_n, & \\text{if}\\,\\, t \\geq t_n, \\\\ (y_\\text{next}-y_\\text{prev})(t-t_\\text{prev})/(t_\\text{next}-t_\\text{prev})+y_\\text{prev}, & \\text{otherwise}. \\end{cases}$\n\nHere, $(t_\\text{prev},y_\\text{prev})$ is the pair with the largest time that does not exceed $t$, and $(t_\\text{next},y_\\text{next})$ is the pair with the smallest time that exceeds $t$.\n$r(t)$, integral multiples of $r(t)$ and their sum are computed in decimals.\n\nInput example The following is an example with $N_{\\text{job}}=6$ (Note that this is a very small number of jobs):\n\n6\n1 1 906 10 0.94469412898840599 0.07857326752336613 0\n13 11 0 12 1212810 37 1849941 63 2266874 88 1944271 113 1207029 139 768959 164 808665 189 992126 214 1137116 240 907954 265 903397 266 0\n0\n2 3 905 2 0.96478158647239831 0.056877102556647817 0\n7 92 0 93 1280499 121 1553205 149 1429506 176 1419189 204 1731967 205 0\n0\n3 1 1052 4 0.94436951517275258 0.071240847781028308 0\n7 191 0 192 1914094 218 1735762 244 1444725 270 1275768 296 975408 297 0\n0\n4 3 653 4 0.95274950239675604 0.14137003825803521 0\n10 70 0 71 1319303 94 1329844 118 1503315 141 1161131 165 1294526 188 849137 212 1953166 235 2087503 236 0\n1 2\n5 1 1452 12 0.95747093286627682 0.076042573628832266 0\n8 122 0 123 1667665 149 911519 174 1511934 200 1967913 225 1633211 251 1589845 252 0\n2 6 4\n6 2 737 6 0.95812926774107732 0.049371044631834608 1\n11 82 0 83 1431723 108 1475010 133 1032345 158 1012865 183 1593586 207 1923638 232 1956884 257 2797127 282 2877123 283 0\n0\n\n*   Line 1: The total number of jobs is `6`. ($N_{\\text{job}}=6$)\n    *   The actual problem given will consist of several hundreds of jobs.\n*   Line 2: Start of description for job with ID=1.\n    *   The job ID is `1` ($\\text{ID}^{\\text{job}}_1=1$).\n    *   The job type is `1` ($\\text{Type}_1=1$).\n    *   The number of tasks required to complete this job is `906` ($N^{\\text{task}}_1=906$).\n    *   The job is located at vertex `10` ($v^{\\text{job}}_1=10$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.94469412898840599` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_1=0.94469412898840599$).\n    *   Dependency of this job on weather is `0.07857326752336613` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_1=0.07857326752336613$).\n    *   This job is not mandatory ($f^{\\text{mandatory}}_1=0$).\n*   Line 3: Definition of reward function for the job with ID=1.\n    *   There are `13` control points ($N^{\\text{reward}}_1=13$).\n    *   The list of control points is: ((`11`,`0`), (`12`,`1212810`), (`37`,`1849941`), (`63`,`2266874`), (`88`,`1944271`), (`113`,`1207029`), (`139`,`768959`), (`164`,`808665`), (`189`,`992126`), (`214`,`1137116`), (`240`,`907954`), (`265`,`903397`), (`266`,`0`)).\n        *   The times for which reward can be obtained are $12,13,\\cdots,265$.\n*   Line 4: The jobs that the job with ID=1 depends on. This completes the description of the job with ID=1.\n    *   The number of jobs this job depends on is `0`($N^{\\text{depend}}_1=0$).\n    *   (Since the number of jobs it depends on is `0`, no job IDs are given.)\n*   Line 5: Start of description for job with ID=2.\n    *   The job ID is `2` ($\\text{ID}^{\\text{job}}_2=2$).\n    *   The job type is `3` ($\\text{Type}_2=3$).\n    *   The number of tasks required to complete this job is `905` ($N^{\\text{task}}_2=905$).\n    *   The job is located at vertex `2` ($v^{\\text{job}}_2=2$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.96478158647239831` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_2=0.96478158647239831$).\n    *   Dependency of this job on weather is `0.056877102556647817` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_2=0.056877102556647817$).\n    *   This job is not mandatory ($f^{\\text{mandatory}}_2=0$).\n*   Line 6: Definition of reward function for the job with ID=2.\n    *   There are `7` control points ($N^{\\text{reward}}_2=7$).\n    *   The list of control points is: ((`92`,`0`), (`93`,`1280499`), (`121`,`1553205`), (`149`,`1429506`), (`176`,`1419189`), (`204`,`1731967`), (`205`,`0`)).\n        *   The times for which reward can be obtained are $93,94,\\cdots,204$.\n*   Line 7: The jobs that the job with ID=2 depends on. This completes the description of the job with ID=2.\n    *   The number of jobs this job depends on is `0`($N^{\\text{depend}}_2=0$).\n    *   (Since the number of jobs it depends on is `0`, no job IDs are given.)\n*   Line 8: Start of description for job with ID=3.\n    *   The job ID is `3` ($\\text{ID}^{\\text{job}}_3=3$).\n    *   The job type is `1` ($\\text{Type}_3=1$).\n    *   The number of tasks required to complete this job is `1052` ($N^{\\text{task}}_3=1052$).\n    *   The job is located at vertex `4` ($v^{\\text{job}}_3=4$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.94436951517275258` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_3=0.94436951517275258$).\n    *   Dependency of this job on weather is `0.071240847781028308` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_3=0.071240847781028308$).\n    *   This job is not mandatory ($f^{\\text{mandatory}}_3=0$).\n*   Line 9: Definition of reward function for the job with ID=3.\n    *   There are `7` control points ($N^{\\text{reward}}_3=7$).\n    *   The list of control points is: ((`191`,`0`), (`192`,`1914094`), (`218`,`1735762`), (`244`,`1444725`), (`270`,`1275768`), (`296`,`975408`), (`297`,`0`)).\n        *   The times for which reward can be obtained are $192,193,\\cdots,296$.\n*   Line 10: The jobs that the job with ID=3 depends on. This completes the description of the job with ID=3.\n    *   The number of jobs this job depends on is `0`($N^{\\text{depend}}_3=0$).\n    *   (Since the number of jobs it depends on is `0`, no job IDs are given.)\n*   Line 11: Start of description for job with ID=4.\n    *   The job ID is `4` ($\\text{ID}^{\\text{job}}_4=4$).\n    *   The job type is `3` ($\\text{Type}_4=3$).\n    *   The number of tasks required to complete this job is `653` ($N^{\\text{task}}_4=653$).\n    *   The job is located at vertex `4` ($v^{\\text{job}}_4=4$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.95274950239675604` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_4=0.95274950239675604$).\n    *   Dependency of this job on weather is `0.14137003825803521` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_4=0.14137003825803521$).\n    *   This job is not mandatory ($f^{\\text{mandatory}}_4=0$).\n*   Line 12: Definition of reward function for the job with ID=4.\n    *   There are `10` control points ($N^{\\text{reward}}_4=10$).\n    *   The list of control points is: ((`70`,`0`), (`71`,`1319303`), (`94`,`1329844`), (`118`,`1503315`), (`141`,`1161131`), (`165`,`1294526`), (`188`,`849137`), (`212`,`1953166`), (`235`,`2087503`), (`236`,`0`)).\n        *   The times for which reward can be obtained are $71,72,\\cdots,235$.\n*   Line 13: The jobs that the job with ID=4 depends on. This completes the description of the job with ID=4.\n    *   The number of jobs this job depends on is `1`($N^{\\text{depend}}_4=1$).\n    *   This job depends on the job with ID=`2`($\\text{id}^\\text{depend}_{4,1}=2$).\n*   Line 14: Start of description for job with ID=5.\n    *   The job ID is `5` ($\\text{ID}^{\\text{job}}_5=5$).\n    *   The job type is `1` ($\\text{Type}_5=1$).\n    *   The number of tasks required to complete this job is `1452` ($N^{\\text{task}}_5=1452$).\n    *   The job is located at vertex `12` ($v^{\\text{job}}_5=12$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.95747093286627682` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_5=0.95747093286627682$).\n    *   Dependency of this job on weather is `0.076042573628832266` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_5=0.076042573628832266$).\n    *   This job is not mandatory ($f^{\\text{mandatory}}_5=0$).\n*   Line 15: Definition of reward function for the job with ID=5.\n    *   There are `8` control points ($N^{\\text{reward}}_5=8$).\n    *   The list of control points is: ((`122`,`0`), (`123`,`1667665`), (`149`,`911519`), (`174`,`1511934`), (`200`,`1967913`), (`225`,`1633211`), (`251`,`1589845`), (`252`,`0`)).\n        *   The times for which reward can be obtained are $123,124,\\cdots,251$.\n*   Line 16: The jobs that the job with ID=5 depends on. This completes the description of the job with ID=5.\n    *   The number of jobs this job depends on is `2`($N^{\\text{depend}}_5=2$).\n    *   This job depends on the jobs with ID=`6`,`4`($\\text{id}^\\text{depend}_{5,1}=6,\\text{id}^\\text{depend}_{5,2}=4$).\n*   Line 17: Start of description for job with ID=6.\n    *   The job ID is `6` ($\\text{ID}^{\\text{job}}_6=6$).\n    *   The job type is `2` ($\\text{Type}_6=2$).\n    *   The number of tasks required to complete this job is `737` ($N^{\\text{task}}_6=737$).\n    *   The job is located at vertex `6` ($v^{\\text{job}}_6=6$).\n    *   If this job is accepted, but not finished by the end of the work time frame ($T_\\text{max}$), an unfinished-job penalty of `0.95812926774107732` will be applied ([Scoring method](#scoring-method-en)) ($P^{\\text{job}}_6=0.95812926774107732$).\n    *   Dependency of this job on weather is `0.049371044631834608` ([Limits on tasks performed](#task-limit-en)) ($d^\\text{weather}_6=0.049371044631834608$).\n    *   **This job is mandatory** ($f^{\\text{mandatory}}_6=1$).\n*   Line 18: Definition of reward function for the job with ID=6.\n    *   There are `11` control points ($N^{\\text{reward}}_6=11$).\n    *   The list of control points is: ((`82`,`0`), (`83`,`1431723`), (`108`,`1475010`), (`133`,`1032345`), (`158`,`1012865`), (`183`,`1593586`), (`207`,`1923638`), (`232`,`1956884`), (`257`,`2797127`), (`282`,`2877123`), (`283`,`0`)).\n        *   The times for which reward can be obtained are $83,84,\\cdots,282$.\n*   Line 19($=1+3\\times N_{\\text{job}}$): The jobs that the job with ID=6 depends on. This completes the description of the job with ID=6.\n    *   The number of jobs this job depends on is `0`($N^{\\text{depend}}_6=0$).\n    *   (Since the number of jobs it depends on is `0`, no job IDs are given.)\n\n#### Weather\n\nWeather is a value that affects the number of tasks that can be performed, and this state changes probabilistically at each time point.\n\n*   **Input**\n    *   In the next line, the length of a fundamental weather segment, $T^\\text{weather}$, and the number of weather states, $N^\\text{weather}$, is given.\n    *   On each of the next $N^\\text{weather}$ lines, the probabilities for transitioning from state $i$to the other states, $p^{\\text{weather}}_{i,1} \\,\\, p^{\\text{weather}}_{i,2} \\,\\,\\cdots \\,\\, p^{\\text{weather}}_{i,N^{\\text{weather}}}$, are given (transition probability matrix).\n    *   The next line gives constants, $c_1\\,\\,c_2\\,\\,\\cdots\\,\\,c_{N_\\text{weather}}$, for calculating [limits on tasks performed](#task-limit) for each weather state.\n\n**For this problem the value is fixed to $N^\\text{weather}=7$ and the weather states are:Sunny (1), mostly sunny (2), lightly cloudy (3), cloudy (4), light rain (5), medium rain (6), and heavy rain (7)**\n\nWeather behavior and updating Fundamental weather and actual weather states are maintained internally, and the actual weather state is what directly affects the number of tasks that can be performed.\n\n#### Fundamental Weather\n\nThe total length of work time frame is divided equally into fundamental weather segments, $b_i (i=1,\\cdots,n(=T_\\text{max}/T^\\text{weather}))$, of length $T^\\text{weather}$.\nEach $b_i$ has an independent weather state, $w_i$, which is called the fundamental weather state.\nAt time point $t=1$, all $w_i$ are determined probabilistically and independently according to the stationary distribution of the transition probability matrix. Thereafter, every time $T^\\text{weather}$ time elapses, $w_i$ in each segment is updated independently according to the transition probability matrix.\n\n#### Actual Weather State\n\nHere we call the actual weather state $w$. $w$ is updated as follows:\nAt the beginning of time $t$,\n\n*   if $t$ equals the start time of weather segment $b_i$ :$w \\leftarrow w_i$ (set $w$ to $w_i$)\n*   In other cases:update $w$ according to the transition probability matrix.\n\nNote that updating of fundamental weather state is performed before updating the actual weather state.\nWhen weather (value or state) is mentioned in other sections, it refers to the actual weather state, $w$.\nThe seed value used to determine the weather is given a different value for each test case.\n\nIn [Input 2](#input2-en), the probabilities for each weather state in each $T^\\text{weather}$ interval in the future are given each time $T^\\text{weather}$ elapses, starting at time $t=1$ (including the probability data at time $t=1$).\n\nInput example The following is an example with $T^\\text{weather}=10$ and $N^\\text{weather}=7$.\n\n10 7\n0.65038945819291316 0.3456395688250497 0.0039709729820371371 0 0 0 0\n0.29367291714300126 0.57978625074387669 0.11253142456916906 0.014009407543952863 0 0 0\n1.4131189430426344e-09 0.18905960051799561 0.44909739165434842 0.32239542530231813 0.039447581112218938 0 0\n0 0.043752041690362654 0.079271361143687852 0.87011603340370036 0.0033077052290538069 0.0035528585331954204 0\n0 0 0.015190350742277408 0.044334491311077411 0.90080171493640016 0.039640375730251982 3.3067279992976463e-05\n0 0 0 2.9123680876183852e-09 0.21976983161374733 0.68711791872304939 0.093112246750835195\n0 0 0 0 0.018677162951541051 0.41030647336908055 0.57101636367937847\n0 1 2 3 10 14 20\n\n*   Line 1: The fundamental weather segment length is `10`, and there are `7` weather states in total($T^\\text{weather}=10,N^\\text{weather}=7$).\n*   Line 2: The (fundamental) transition probabilities from state $1$ to states $1,2,3,4,5,6,7$ are:`0.65038945819291316`,`0.3456395688250497`,`0.0039709729820371371`,`0`,`0`,`0`,`0`, respectively.\n*   Line 3: The (fundamental) transition probabilities from state $2$ to states $1,2,3,4,5,6,7$ are:`0.29367291714300126`,`0.57978625074387669`,`0.11253142456916906`,`0.014009407543952863`,`0`,`0`,`0`, respectively.\n*   Line 4: The (fundamental) transition probabilities from state $3$ to states $1,2,3,4,5,6,7$ are:`1.4131189430426344e-09`,`0.18905960051799561`,`0.44909739165434842`,`0.32239542530231813`,`0.039447581112218938`,`0`,`0`, respectively.\n*   Line 5: The (fundamental) transition probabilities from state $4$ to states $1,2,3,4,5,6,7$ are:`0`,`0.043752041690362654`,`0.079271361143687852`,`0.87011603340370036`,`0.0033077052290538069`,`0.0035528585331954204`,`0`, respectively.\n*   Line 6: The (fundamental) transition probabilities from state $5$ to states $1,2,3,4,5,6,7$ are:`0`,`0`,`0.015190350742277408`,`0.044334491311077411`,`0.90080171493640016`,`0.039640375730251982`,`3.3067279992976463e-05`, respectively.\n*   Line 7: The (fundamental) transition probabilities from state $6$ to states $1,2,3,4,5,6,7$ are:`0`,`0`,`0`,`2.9123680876183852e-09`,`0.21976983161374733`,`0.68711791872304939`,`0.093112246750835195`, respectively.\n*   Line 8: The (fundamental) transition probabilities from state $7$ to states $1,2,3,4,5,6,7$ are:`0`,`0`,`0`,`0`,`0.018677162951541051`,`0.41030647336908055`,`0.57101636367937847`, respectively.\n*   Line 9: The limit constants for states $1,2,3,4,5,6,7$ are:`0`,`1`,`2`,`3`,`10`,`14`,`20`, respectively.\n\n#### Schedule\n\nContestants must produce a schedule of jobs to perform for each worker (when, which job, how much), and will gain additional points for performance according to the schedule. The added points will be less for not performing on schedule. The schedule can be changed during execution, but the additional points awarded will decrease more for changes made close to the time. Conversely, changing the schedule farther in the future will reduce added points less.\nSee [Output 2](#output2-en) for detail regarding schedule evaluation.\nIf not intending to submit a schedule, any schedule can be submitted.\n\n*   **Input**\n    *   The next line provides the maximum schedule change penalty $P_m$, the schedule change penalty decay rate $R_m$, and the schedule additional point coefficient $\\alpha$.\n\nInput example\n\n0.029878077064496654 0.99054720249346828 0.87563809736779619\n\n*   Line 1: The maximum schedule change penalty is `0.029878077064496654`, the schedule change penalty decay rate is `0.99054720249346828`, and the schedule additional point coefficient is `0.87563809736779619`.($P_m=0.029878077064496654,R_m=0.99054720249346828,\\alpha=0.87563809736779619$)\n\n#### Weather Forecasts\n\nTo decide which jobs to accept, weather forecast data is provided as input at the start time ($t=1$). The structure is the same as [Weather forecast](#weather-forecast-en) for Input 2, so refer to that section for detail.\n\nFull Input 1 example\n\n300\n14 19\n1 7 1\n1 2 1\n2 9 1\n2 3 1\n3 5 1\n3 7 1\n3 6 1\n4 13 2\n4 10 2\n4 6 1\n4 5 1\n6 8 1\n7 8 1\n8 14 2\n9 11 2\n10 12 2\n10 11 2\n12 13 2\n13 14 2\n5\n6 100 3 1 2 3\n13 59 1 3\n10 55 2 2 3\n9 47 3 1 2 3\n9 89 1 2\n6\n1 1 906 10 0.94469412898840599 0.07857326752336613 0\n13 11 0 12 1212810 37 1849941 63 2266874 88 1944271 113 1207029 139 768959 164 808665 189 992126 214 1137116 240 907954 265 903397 266 0\n0\n2 3 905 2 0.96478158647239831 0.056877102556647817 0\n7 92 0 93 1280499 121 1553205 149 1429506 176 1419189 204 1731967 205 0\n0\n3 1 1052 4 0.94436951517275258 0.071240847781028308 0\n7 191 0 192 1914094 218 1735762 244 1444725 270 1275768 296 975408 297 0\n0\n4 3 653 4 0.95274950239675604 0.14137003825803521 0\n10 70 0 71 1319303 94 1329844 118 1503315 141 1161131 165 1294526 188 849137 212 1953166 235 2087503 236 0\n1 2\n5 1 1452 12 0.95747093286627682 0.076042573628832266 0\n8 122 0 123 1667665 149 911519 174 1511934 200 1967913 225 1633211 251 1589845 252 0\n2 6 4\n6 2 737 6 0.95812926774107732 0.049371044631834608 1\n11 82 0 83 1431723 108 1475010 133 1032345 158 1012865 183 1593586 207 1923638 232 1956884 257 2797127 282 2877123 283 0\n0\n10 7\n0.65038945819291316 0.3456395688250497 0.0039709729820371371 0 0 0 0\n0.29367291714300126 0.57978625074387669 0.11253142456916906 0.014009407543952863 0 0 0\n1.4131189430426344e-09 0.18905960051799561 0.44909739165434842 0.32239542530231813 0.039447581112218938 0 0\n0 0.043752041690362654 0.079271361143687852 0.87011603340370036 0.0033077052290538069 0.0035528585331954204 0\n0 0 0.015190350742277408 0.044334491311077411 0.90080171493640016 0.039640375730251982 3.3067279992976463e-05\n0 0 0 2.9123680876183852e-09 0.21976983161374733 0.68711791872304939 0.093112246750835195\n0 0 0 0 0.018677162951541051 0.41030647336908055 0.57101636367937847\n0 1 2 3 10 14 20\n0.029878077064496654 0.99054720249346828 0.87563809736779619\n1 0 0 0 0 1 0 0\n11 0.32997661987364896 0.35720093880279286 0.10144180605929307 0.18397452127884667 0.023582674286464638 0.0033945272798704107 0.00042891241908338078\n21 0.26146895868607978 0.29829553702903927 0.10367350846525671 0.27413103299772817 0.050432669277988201 0.010115966874572493 0.0018823266693354056\n31 0.20903275687358913 0.2506351074109075 0.10197621041600768 0.32306215864825039 0.090561788952494518 0.020385340563280511 0.0043466371354700514\n41 0.16453280991499084 0.20329129777873356 0.091390970778385427 0.30920472674724836 0.18000987309438846 0.041926491747270762 0.0096438299389825944\n51 0.21773018584216544 0.25781470723187322 0.10129611879665416 0.30911960619088807 0.089756375035668315 0.020014729744938529 0.0042682771578124723\n61 0.18695780159879197 0.22637031212950884 0.095692191594510659 0.30993166346993428 0.14119172380160475 0.032519854076175789 0.0073364533294737588\n71 0.19978365794228928 0.23953773160128791 0.098109392505800377 0.31008680745444389 0.11925953673379487 0.027193693951331609 0.0060291798110520588\n81 0.20381180897940113 0.24366400563862556 0.098856417213860404 0.3100620551039589 0.11244486750690874 0.02553797224640603 0.0056228733108393747\n91 0.21098420754865557 0.2510068631469719 0.10018090439250056 0.30998380940692433 0.10034511870194431 0.02259771906125015 0.0049013777417531382\n101 0.21017332149772244 0.25017760625955138 0.10003235653165234 0.30999988763169445 0.10170583135583394 0.022928465225827428 0.0049825314977181429\n111 0.21035975914577648 0.25036818399930888 0.10006639945926016 0.30999551883837906 0.10139365148795368 0.02285257565351554 0.0049639114158061791\n121 0.21006375850103443 0.25006523326156821 0.10001185087147714 0.3099994276865809 0.10189232028110375 0.022973761374232418 0.0049936480240032411\n131 0.21003860874539299 0.25003947404099974 0.1000071910191422 0.30999960764692047 0.10193484214518268 0.022984093048729243 0.0049961833536327927\n141 0.21002336947231043 0.25002386973415752 0.10000437307823702 0.30999975094869503 0.1019605735904045 0.022990345532450621 0.0049977176437451558\n151 0.21001036314333912 0.25001055377029446 0.10000197057271488 0.30999988860662192 0.1019825193444605 0.022995678324735189 0.0049990262378340521\n161 0.2098468891366603 0.24984320350327363 0.099971794472248382 0.31000174310451423 0.10225822676243579 0.023062676470061792 0.0050154665508059335\n171 0.21001766063059757 0.25001802405322704 0.10000331731605842 0.30999980388842874 0.10197021368851594 0.022992687970461667 0.0049982924527108988\n181 0.21000312608202204 0.25000314492830189 0.10000063442967058 0.30999996928440271 0.10199472644850339 0.022998644688091742 0.0049997541390076946\n191 0.21000646152716931 0.25000655944481537 0.10000125010448897 0.30999993130167014 0.10198910119136487 0.022997277723427214 0.0049994187070641306\n201 0.21000390597655963 0.25000394330415704 0.10000077837739391 0.30999996034571875 0.10199341120724155 0.022998325077383485 0.0049996757115455511\n211 0.21000068372351638 0.25000064465305499 0.10000018358284854 0.30999999695861213 0.10199884564588058 0.022999645671209767 0.004999999764877615\n221 0.21000123276535285 0.25000120671230119 0.10000028493014526 0.3099999907192631 0.10199791966912596 0.022999420654547454 0.0049999445492642201\n231 0.2100001748189628 0.25000012368230085 0.10000008964391316 0.31000000273847578 0.10199970393318095 0.022999854238977081 0.0050000509441893055\n241 0.21000051371752923 0.25000047061605735 0.10000015220117091 0.30999999888829144 0.10199913236874111 0.022999715346170929 0.0050000168620389848\n251 0.21000030618472809 0.25000025816270716 0.10000011389270266 0.31000000124600918 0.10199948238020001 0.022999800400576097 0.0050000377330769279\n261 0.2100000445095816 0.2499999902833088 0.1000000655900994 0.31000000421880708 0.10199992370466664 0.022999907644464797 0.0050000640490715734\n271 0.21000008909654816 0.25000003592742104 0.10000007382040528 0.31000000371226893 0.10199984850715899 0.022999889371122236 0.0050000595650754173\n281 0.21000000318197135 0.24999994797583083 0.10000005796143702 0.31000000468831079 0.10199999340515975 0.02299992458200726 0.005000068205283017\n291 0.21000003070352388 0.24999997614991259 0.10000006304163929 0.31000000437564929 0.10199994698907894 0.022999913302684732 0.0050000654375114001\n\n*   Line 1: See [Work time frame](#work-time-frame-en)\n*   Lines 2-21: See [Geographic data](#geo-data-en)\n*   Lines 22-27: See [Workers](#worker-en)\n*   Lines 28-46: See [Jobs](#job-en)\n*   Lines 47-55: See [Weather](#weather-en)\n*   Line 56: See [Schedule](#schedule-en)\n*   Lines 57-86: Weather forecast data at beginning ($t=1$) (See [Weather forecasts](#weather-forecast-en) in Input 2)."},{"iden":"output 1","content":"After receiving this data, the contestant must select the jobs they will accept and produce output in the following format:\n\n%mathstart%\nN^{\\text{selected}}\\,\\, \\text{id}_1\\,\\, \\text{id}_2\\,\\,\\cdots \\,\\,\\text{id}_{N^{\\text{selected}}}\n%mathend%\n\n(Insert a line-break after the last line)\n\n#### Accepting Jobs\n\n*   **Output**\n    *   On the first line, output the number of jobs accepted, $N^{\\text{selected}}$, and a list of IDs for the jobs accepted, $\\text{id}_1\\,\\, \\text{id}_2\\,\\,\\cdots \\,\\,\\text{id}_{N^{\\text{selected}}}$.\n\nNot meeting the following conditions will result in `WA` (Wrong Answer).\n\n*   $N^{\\text{selected}} \\geq 0$\n*   The length of the job ID list must be $N^{\\text{selected}}$.\n*   All job IDs specified must correspond to jobs that exist.\n*   There is no duplicate in the job IDs specified.\n*   All mandatory jobs (having $f^\\text{mandatory}=1$) must be included.\n*   For all selected jobs, if they are dependent on 1 or more jobs, those jobs must also be selected.\n\nOutput example\n\n4 6 2 3 4\n\n*   The contestant accepted `4` jobs. The IDs of the accepted jobs are `6`,`2`,`3`,`4`($N^{\\text{selected}}=4,\\text{id}_1=6,\\text{id}_2=2,\\text{id}_3=3,\\text{id}_4=4$)."},{"iden":"output 2 (for each time point)","content":"For the above, the contestant must produce the following on standard output:\n\n1.  A schedule for each worker\n2.  An action for each worker\n\nData must be output in the following format.\n\n%mathstart%\nN_\\text{schedule}\\\\\n\\text{id}_1\\,\\,\\text{id}_2\\,\\,\\cdots\\,\\,\\text{id}_{N_\\text{schedule}}\\\\\n\\text{job}^{\\text{id}_1}_t\\,\\,\\text{job}^{\\text{id}_1}_{t+1}\\,\\,\\cdots\\,\\,\\text{job}^{\\text{id}_1}_{T_\\text{max}}\\\\\n\\vdots\\\\\n\\text{job}^{\\text{id}_{N_\\text{schedule}}}_t\\,\\,\\text{job}^{\\text{id}_{N_\\text{schedule}}}_{t+1}\\,\\,\\cdots\\,\\,\\text{job}^{\\text{id}_{N_\\text{schedule}}}_{T_\\text{max}}\\\\\n{\\rm{action}}_1\\\\\n{\\rm{action}}_2\\\\\n\\vdots\\\\\n{\\rm{action}}_{N_{\\rm{worker}}}%mathend%\n\n(Insert a line-break after the last line)\n\n#### Schedule submission\n\nThe job performance schedule for each worker is maintained in the form of a job ID for each time point.\nThe contestant must submit schedules for all workers at time $t=1$. At any time after that, schedules for only the workers that require changes can be resubmitted.\n\n*   **Output**\n    *   On the first line, output the number of workers requiring schedule changes, $N_\\text{schedule}$.\n    *   On the next line, output the IDs of the workers, $\\text{id}_1\\,\\,\\text{id}_2\\,\\,\\cdots\\,\\,\\text{id}_{N_\\text{schedule}}$.\n    *   On the next $N_\\text{schedule}$ lines, output the schedule (the ID of the job to be performed on each time point) for the worker with ID=$\\text{id}_i$, from the current time $t$ till $T_\\text{max}$, $\\text{job}^{\\text{id}_i}_t\\,\\,\\text{job}^{\\text{id}_i}_{t+1}\\,\\,\\cdots\\,\\,\\text{job}^{\\text{id}_i}_{T_\\text{max}}$($1\\leq i \\leq N_\\text{schedule}$).\n*   Not meeting the following conditions will result in `WA` (Wrong Answer).\n    *   $N_\\text{schedule} \\geq 0$\n    *   The length of the worker ID list must be $N_\\text{schedule}$\n    *   There must be a corresponding worker for every worker ID specified.\n    *   Worker IDs must not be duplicated.\n    *   Suppose that the submission time is $t$, the number of job IDs specified in the schedules must be $T_\\text{max}-t+1$.\n    *   Only if time $t=1$: $N_\\text{schedule} = N_\\text{worker}$\n\nWhen a schedule is resubmitted, the amount of scheduling additional points will be reduced by an amount dependent on the degree of the change (See [Schedule added points](#schedule-added-point-en)).\n\n#### Worker Actions\n\nThe contestant must specify $\\text{action}$s for all workers at every time point. $\\text{action}$s are represented in the form of text strings, and there are three types.\n\n*   `stay`:Neither move, nor perform a job, staying at the current location.\n*   `move w`:Move a distance of $1$ along the shortest path from the current position to the vertex which corresponds to vertex index `w`. If the following constraints are not satisfied, it will result in `WA`(Wrong Answer).\n    *   A vertex corresponding to vertex index `w` must exist.\n    *   The current position must not be vertex `w`.\n*   `execute i a`:Perform the task for the job with ID=`i`, `a` times. If the following constraints are not satisfied, it will result in `WA`(Wrong Answer).\n    *   The job with ID=`i` must be among the jobs accepted.\n    *   The worker’s current position must be the same as the location of the job with ID=`i`.\n    *   The type of the job with ID=`i` must be included in the job types that the worker can perform.\n    *   `a` must be an integer greater than or equal to 1.\n    *   `a` must not exceed the amount of remaining tasks for the job with ID=`i`.\n    *   `a` must not exceed limits on the number of tasks performed (See [Limits on tasks performed](#task-limit-en) for details).\n    *   The jobs on which the job with ID=`i` depends must have been completed.\n    *   The reward value must be positive.\n\nFor `move w`, if there are 2 or more different shortest paths between the current location and vertex `w`, how to select one is not specified. In such cases, the contestant can choose the desired path by repeatedly selecting and moving to points along the path.\nSpecifying an $\\text{action}$ string that does not match any of the patterns above will result in `WA`(Wrong Answer).\nAlso, if there exist some jobs whose total task amount processed exceeds its No. of tasks to complete $N^{\\text{task}}_i$, it will result in `WA` or `RE`.\n\n*   **Output**\n    *   For the following $N_\\text{worker}$ lines, output the actions, $\\text{action}_i$, for each worker, where $1 \\leq i \\leq N_\\text{worker}$.\n\nOutput example The following is an example for $N_\\text{worker}=3,T_\\text{max}=10$\n\n#### Example 1:Actions + Initial schedule submission ($t=1$)\n\n3\n1 2 3\n85 85 85 85 431 431 431 431 431 431\n65 65 65 65 65 65 65 65 65 65\n730 730 639 639 639 639 4 4 4 4\nexecute 85 135\nmove 12\nmove 98\n\n*   Line 1: Contestant is submitting schedules for `3` workers.\n*   Line 2: The applicable workers have ID=`1`,`2`,`3`.\n*   Line 3: This is the schedule for the first worker specified on Line 2 (ID=`1`), as follows:\n    *   At time $1$ perform job with ID=`85`. Similarly at time $2$ ID=`85`, at time $3$ ID=`85`, at time $4$ ID=`85`, at time $5$ ID=`431`, at time $6$ ID=`431`, at time $7$ ID=`431`, at time $8$ ID=`431`, at time $9$ ID=`431`, and at time $10$ ID=`431`.\n*   Line 4: This is the schedule for the first worker specified on Line 2 (ID=`2`), as follows:\n    *   At time $1 $ perform job with ID=`65`. Similarly at time $2 $ ID=`65`, at time $3 $ ID=`65`, at time $4 $ ID=`65`, at time $5 $ ID=`65`, at time $6 $ ID=`65`, at time $7 $ ID=`65`, at time $8 $ ID=`65`, at time $9 $ ID=`65`, and at time $10 $ ID=`65`.\n*   Line 5: This is the schedule for the first worker specified on Line 2 (ID=`3`), as follows:\n    *   At time $1 $ perform job with ID=`730`. Similarly at time $2 $ ID=`730`, at time $3 $ ID=`639`, at time $4 $ ID=`639`, at time $5 $ ID=`639`, at time $6 $ ID=`639`, at time $7 $ ID=`4`, at time $8 $ ID=`4`, at time $9 $ ID=`4`, and at time $10 $ ID=`4`.\n*   Line 6: Specify the action for the worker with ID=1 for the current time: Perform `135` tasks of the job with ID=`85`.\n*   Line 7: Specify the action for the worker with ID=2 for the current time: Move toward vertex `12`.\n*   Line 8: Specify the action for the worker with ID=3 for the current time: Move toward vertex `98`.\n\n#### Example 2: Actions + no schedule changes\n\n0\n\nstay\nmove 87\nexecute 670 40\n\n*   Line 1: Contestant is submitting schedules for 0 workers (i.e., no schedule changes).\n*   Line 2: There are no applicable workers, so this line has 0 worker IDs (it is a blank line).\n*   (Missing lines: No worker schedules are output, so no lines are output.)\n*   Line 3: Specify the action for the worker with ID=1 for the current time: Do nothing.\n*   Line 4: Specify the action for the worker with ID=2 for the current time: Move toward vertex `87`.\n*   Line 5: Specify the action for the worker with ID=3 for the current time: Perform `40` tasks of the job with ID=`670`.\n\n#### Example 3: Actions + schedule changes ($t=6$)\n\n2\n2 3\n65 65 65 65 223\n639 4 4 91 91\nexecute 431 80\nexecute 65 40\nmove 9\n\n*   Line 1: Contestant is submitting schedule changes for `2` workers.\n*   Line 2: The applicable workers have ID=`2`,`3`.\n*   Line 3: This is the schedule for the first worker specified on Line 2 (ID=`2`), as follows:\n    *   At time $6 $ perform job with ID=`65`. Similarly at time $7 $ ID=`65`, at time $8 $ ID=`65`, at time $9 $ ID=`65`, and at time $10 $ ID=`431`.\n*   Line 4: This is the schedule for the second worker specified on Line 2 (ID=`3`), as follows:\n    *   At time $6 $ perform job with ID=`639`. Similarly at time $7 $ ID=`4`, at time $8 $ ID=`4`, at time $9 $ ID=`91`, and at time $10 $ ID=`91`.\n*   Line 5: Specify the action for the worker with ID=1 for the current time. Perform `80` tasks of the job with ID=`431`.\n*   Line 6: Specify the action for the worker with ID=2 for the current time. Perform `40` tasks of the job with ID=`65`.\n*   Line 7: Specify the action for the worker with ID=3 for the current time. Move toward vertex `9`."},{"iden":"input 3 (scoring)","content":"After completing [Output 2](#output2-en) at time $t=T_\\text{max}$, if the output is valid, the score $S$ is given on standard input in the following format.\n\n%mathstart%\nS\n%mathend%\n\nIf the contestant does not read this value from standard input, it may result in `TLE`.\nFor details on ranking method, see [Ranking method](#ranking-method-en)\n\n#### Scoring Method\n\nThe score $S$ is derived from the total reward $R$, the unfinished penalty $U$, and the scheduling added points $A$ according to the following formula.\n$S=\\left\\lfloor R \\times U \\times (1+\\alpha A) \\right\\rfloor$\n\nNote that $\\left\\lfloor x \\right\\rfloor$ represents the floor function, which returns the greatest integer less than or equal to $x$.\n$~$\nDefinitions of $R$, $U$ and $A$ are as follows.\n**Total reward amount**:\n$\\begin{aligned} R=\\sum_{j\\in J_\\text{finished}}\\sum_{w \\in W}\\sum_{t=1}^{T_\\text{max}}a^w_j(t)r_j(t) \\end{aligned}$\n\n*   Set of completed jobs:$J_\\text{finished}$\n*   Set of all workers:$W$\n*   Number of job $j$ tasks performed by worker $w$ at time $t$:$a^w_j(t)$\n*   The per-task reward for job $j$ at time $t$:$r_j(t)$\n\n**Penalty for not finishing jobs**:\n$\\begin{aligned} U=\\prod_{j \\in J_{\\text{unfinished}}} P^{\\text{job}}_j \\end{aligned}$\n\n*   The set of accepted but not finished jobs:$J_\\text{unfinished}$\n*   Unfinished penalty factor for Job $j$:$P_j^\\text{job}$\n\n**Schedule added points**:\nThe initial value of $A$ is $1.0$ and it is updated in each time interval according to the following rules:\n\n*   For each worker:\n    *   If the worker performs a job that differs from the schedule:$\\begin{aligned}A\\leftarrow 0\\end{aligned}$\n        \n    *   If the worker performs the same job as scheduled:$\\begin{aligned}A\\leftarrow A\\end{aligned}$\n        \n    *   If the worker does not perform a job:$\\begin{aligned}A\\leftarrow A\\end{aligned}$\n        \n*   If a worker’s schedule is resubmitted at time $t$:\n    *   For the job ID at time $s(\\geq t)$:\n        *   If it is changed,$\\begin{aligned}A\\leftarrow A\\times \\left(1.0-P_m \\times (R_m)^{s-t}\\right)\\end{aligned}$\n            \n        *   If it is not changed,$\\begin{aligned}A\\leftarrow A\\end{aligned}$\n            \n\nNote that $A$ is not updated when the initial schedule is submitted.\nFor an empty set a total sum $\\sum$ is $0$, and a total product $\\prod$ is $1$."},{"iden":"limits on tasks performed","content":"The number of tasks that a worker can perform on one time point is determined by the following, dependent on the **worker’s maximum performable number of tasks $L^\\text{max}$**, **the dependency of the job on the weather $d^\\text{weather}$**, and **the weather state $w \\in {1,\\cdots,N_\\text{weather}}$**.:\n$\\begin{aligned} L^\\text{max}\\times (1-d^\\text{weather})^{c_w}\\end{aligned}$\nHere, $c_w$ are the limit factors given in [Input 1](#input1-en). Note that $0^0=1$."},{"iden":"test case generation rules","content":"Geographical data (graph)\n\n*   Terminology\n    *   Here, we use the term **partition** for the operation of partitioning a rectangular area, $[x_0,x_1]\\times[y_0,y_1]\\,\\,(x_0<x_1,y_0<y_1)$, in half both vertically and horizontally, into four smaller rectangles.\n    *   Specifically, the operation divides the area $[x_0,x_1]\\times[y_0,y_1]$ into the following four pieces.\n        *   $[x_0,(x_1+x_0)/2]\\times[y_0,(y_0+y_1)/2]$\n        *   $[x_0,(x_1+x_0)/2]\\times[(y_0+y_1)/2,y_1]$\n        *   $[(x_1+x_0)/2,x_1]\\times[y_0,(y_0+y_1)/2]$\n        *   $[(x_1+x_0)/2,x_1]\\times[(y_0+y_1)/2,y_1]$\n    *   We also define a function, $\\text{Split}(R)$, which performs this operation (giving the above set of regions from a received rectangular region).\n*   Parameters\n    *   Rectangular region size:$L>0$\n    *   Maximum partition depth:$d_\\text{max} \\in \\mathbb{Z}_{\\geq 0}$\n    *   (Max) number of rectangles:$M$(integer $0$ or greater, $(4^{d_\\text{max}+1}-1)/3$ or less)\n    *   Distance minimum scale:$s>0$\n    *   Cut area ratio:$C\\in (0,1]$\n*   **Generation procedure 1** (generate graph)\n    1.  Prepare a set of rectangular regions, $U={}$.\n    2.  Add rectangular region $R=[0,L]\\times[0,L]$ to $U$.\n    3.  If $d_\\text{max}=0$, proceed to `8.`\n    4.  Select a rectangle from $U$ at random and call that rectangle $r$.\n    5.  If the area of $r$ is $L^2/4^{d_\\text{max}}$, return to `4.`\n    6.  Add all elements from $\\text{Split}(R)$ to $U$.\n        *   If these elements are already in $U$, $U$ does not change even if they are added.\n    7.  If $|U| > M$is satisfied, proceed to `8.` If not, return to `4.`\n    8.  Create a weighted, non-directional graph, $G=(V,E),W:E\\rightarrow \\mathbb{R}_{> 0}$, from set $A$, the union of edges of all rectangles in $U$.\n        *   The set $V$ of vertices in the graph consists of all points where line segments intersect in set $A$, the union of all edges.\n        *   The set of edges $E$ in the graph consists of all pairs of vertices ${a,b}$, where $a\\neq b$ and it is possible to reach $b$ from $a$ on set $A$, the union of all edges, without passing through any other vertex.\n        *   The weight $W$ is derived from the Euclidean distances between the points.\n    9.  This graph, $G=(V,E)$ (with weight $W$), is used to generate the geographical data.\n\n(Reference:Eisenstat, D., Random road networks: the quadtree model, Proceeding of the 8th Workshop on Analytic Algorithms and Combinatorics (ANALCO), pp.76-84, 2011 (DOI:[https://doi.org/10.1137/1.9781611973013.9](https://doi.org/10.1137/1.9781611973013.9)))\n\n*   **Generation procedure 2** (generate elevations)\n    1.  Prepare a square region, $R=[0,1024]\\times[0,1024]$.\n    2.  Divide $R$ by $128$ in both $x$ and $y$ directions (creating $128\\times128$ square regions of size $8\\times8$).\n    3.  Randomly select $20$ of these square regions from $R$ and call the union of them $A$.\n    4.  Again, randomly select $20$ of these square regions from $R$ and call the union of them $B$.\n    5.  Solve the following partial differential equation discretized by the above dividing operation `2` to time $t=100000$ (in other words, compute $u(100000,x,y)$):$\\displaystyle \\frac{\\partial u}{\\partial t}=\\Delta u-b(x,y)u+a(x,y)$\n        The initial value at time $t=0$ is $u(0,x,y)=u_0(x,y)\\equiv 0$, and we use Neumann boundary conditions. $a(x,y)$ and $b(x,y)$ are defined as follows:  \n        $a(x,y)=\\begin{cases} 1/8^2, & \\text{if}\\ (x,y) \\in A, \\\\ 0, & \\text{otherwise}, \\end{cases}$  \n        $b(x,y)=\\begin{cases} 1/8^2, & \\text{if}\\ (x,y) \\in B, \\\\ 0, & \\text{otherwise}. \\end{cases}$  \n        \n    6.  Normalize $u(100000,x,y)$ to the range $[0,1]$, and use it as the elevation, $e(x,y)$.\n*   **Generation procedure 3**(cut the graph, distance scaling)\n    1.  Match the elevation data $e(x,y)$ generated in procedure 2 to the size of the graph space, $[0,L]\\times[0,L]$. In other words, define space-scaled elevation $\\tilde e(x,y)$, as $\\tilde e(x,y)= e(L\\times x/1024,L\\times y/1024)$.\n        \n    2.  For function $H(z)={(x,y) \\in [0,L]\\times[0,L]|\\tilde e(x,y)>z}$, which returns the parts where $\\tilde e(x,y)$ is larger than real value $z$, call the largest value of $z$ for which the area of $H(z)$ is $C\\times L^2$ or greater, $h$.\n        \n    3.  For the set of graph edges $E$ generated in generation procedure 1, delete all edges from $E$ where the two vertices on the both ends are below $h$.\n    4.  Let the graph $G'=(V',E')$ be the largest connected component of graph $G=(V,E)$.\n    5.  Define weight $W':E' \\rightarrow \\mathbb{R}_{> 0}:$ as follows:$W'(e)= s\\times W(e)/\\min_{e' \\in E'}W(e')$\n    6.  Use the graph $G'=(V',E')$ (with weight $W'$) as the geographical data.\n\nWeather transition probability matrix Here we describe rules for generating the transition probability matrix with the size of $N^\\text{weather}\\times N^\\text{weather}$ used for weather transitions.\n\n*   Parameters\n    *   The desired stationary distribution for the transition probability matrix:$\\bm{s}^\\text{sta}=(s^\\text{sta}_1,s^\\text{sta}_2,\\cdots,s^\\text{sta}_{N^\\text{weather}})$\n    *   Bandwidth of the matrix (as a band matrix):$d \\geq 1$\n    *   Small value for convergence test:$\\epsilon > 0$\n    *   Maximum loop iterations:$M\\geq 1$\n    *   Intensity of diagonal component:$q > 0$\n\n$~$\n\n1.  The $N^\\text{weather}\\times N^\\text{weather}$ matrix $A$ is determined as follows:Set the element $a_{i,j}$ at row $i$ and column $j$, to $a_{i,j}=\\begin{cases} \\exp(-q|i-j|^2), & \\text{if}\\ |i-j|\\leq d,\\\\ 0, & \\text{otherwise.} \\end{cases}$\n    \n2.  Normalize each row of $A$ so that the sum is $1$.\n3.  Initialize the loop counter:$l=0$\n4.  $l\\leftarrow l + 1$\n5.  If $l>M$, use $A$ as the transition probability matrix and exit.\n6.  Compute the stationary distribution $\\bm{s}$ of $A$.\n7.  Set matrix $P$ as follows.:Set element $p_{i,j}$ at row $i$ and column $j$ to $p_{i,j}=\\begin{cases} N^\\text{weather}||\\bm{s}^\\text{sta}-\\bm{s}||_\\infty\\max{\\epsilon,a_{i,j}}\\text{rand}(-1,1), & \\text{if}\\ |i-j|\\leq d,\\\\ 0, & \\text{otherwise.} \\end{cases}$\n    Here, $||\\cdot||_\\infty$ is the maximum norm, representing the maximum absolute value of the elements. $\\text{rand}(a,b)$ represents a random number from the uniform distribution on $[a,b]$. Random numbers are generated when each element is computed.\n8.  Let the matrix $A'=A+P$\n9.  Perform the following update on all rows of $A'$. For the $i$\\-th row:\n    1.  Compute $m_i$, the value of the smallest element.\n    2.  If $m_i < 0$, add $-m_i$ to the value of all elements in columns $j$ which satisfy $|i-j|\\leq d$.\n    3.  Normalize the row so that the sum equals $1$.\n10.  For each row in $A'$, if the diagonal component is not the unique maximum component, return to `4.`\n11.  Compute $\\bm{s}'$, the stationary distribution of $A'$.\n12.  If $||\\bm{s}^\\text{sta}-\\bm{s}||_\\infty > ||\\bm{s}^\\text{sta}-\\bm{s'}||_\\infty$, update $A$ by substituting $A$ with $A'$.\n13.  If the both conditions, \"$||\\bm{s}^\\text{sta}-\\bm{s'}||_\\infty < \\epsilon N^\\text{weather}$\" and \"Every element $a_{i,j}$ of $A$ at row $i$ and column $j$ which satisfies $|i-j|\\leq d$, is positive.\", are satisified, use $A$ as the transition probability matrix and exit. If this is not the case, return to `4.`\n\nSegmented linear function representing reward For this problem, the function representing reward for each time (more accurately, the reward value per task) is expressed using linear interpolation between a finite number of points. We refer to these points as control points, and the rules for generating this finite number of control points are as follows.\n\n*   Parameters\n    *   Length of section with positive reward:$L\\geq 1$\n    *   Length for partitioning the interval:$l\\geq 1$\n    *   Reward standard value:$s > 0$\n    *   Standard deviation used when generating control point value:$\\sigma' > 0$\n    *   Reward upper limit:$M > 0$\n    *   Reward lower limit:$m > 0$\n\n$~$\n\n1.  Let the reward start time be $b=\\text{randint}(1,T_\\text{max}-L)$, the reward end time be $e=b+L$, and the number of segments be $d=\\text{round}(L/l)$. Here, $\\text{randint}(m,n)$ is a function that uniformly selects a random integer between m and n inclusive, and $\\text{round}(x)$ is a function that returns the value $x$ rounded to the nearest integer.\n2.  Generate $d+1$ independent random values which follow a log-normal distribution with $\\mu=0$ and $\\sigma=\\sigma'$, and let them be ${c_i}_{i=1}^{d+1}$.\n3.  Define ${v_i}_{i=1}^{d+1}$ by $v_i=\\prod_{j=1}^{i}c_j$.\n4.  Let $B=s\\sqrt{(d+1)/\\sum_{i=1}^{d+1}v_i^2}$, and define ${r_i}_{i=1}^{d+1}$ by $r_i=\\text{round}(Bv_i)$.\n5.  If there exists $i$ such that $r_i > M$ or $r_i < m$, return to `2.`\n6.  Let $t_i=\\text{round}(b+(i-1)L/d)$, and use the list of time and reward value pairs $((b-1,0),(t_1,r_1),(t_2,r_2),\\cdots,(t_{d+1},r_{d+1}),(e+1,0))$ as the list of control points.\n\nIf not otherwise specified, uniform random distributions are used."},{"iden":"ranking method","content":"#### Provisional test\n\nFor the provisional test, $50$ test cases are randomly selected from the ones used for the system test and executed. However, only one test case is selected for one parameter pattern.\nThe evaluation method is the same as for the system test. See the System test section below.\n.testpar{ margin:auto; border-collapse:unset; } .testpar td,.testpar th{ padding:5px; }\n\n#### System test\n\nFor the system test, some of the following characteristic parameters are given to satisfy the properties listed in the Remarks column:\n\nFactor\n\nCorresponding parameter\n\nNo. of types\n\nRemarks\n\nLength of work time frame\n\n$T_\\text{max}$\n\n3\n\nshort($300$), medium($700$), long($1000$)\n\nSpace(Geographical data) size\n\n$d_\\text{max}$ in the Test Case Generation Rules  \nfor Geographical data\n\n3\n\nsmall($5$), medium($6$), large($7$)\n\nNumber of workers\n\n$N_{\\text{worker}}$\n\n4\n\nsingle($1$), few($2$), moderate($5$), many($10$)\n\nNumber of all jobs\n\n$N_{\\text{job}}$\n\n3\n\nfew($250 \\leq N_{\\text{job}} \\leq 253 $ ), moderate($500 \\leq N_{\\text{job}} \\leq 503$), many($1000 \\leq N_{\\text{job}} \\leq 1003$)\n\nPenalties for not finishing accepted jobs\n\n$P^{\\text{job}}_i$\n\n2\n\nsmall($[0.98,1.0)$), large($[0.91,0.93)$)\n\nWeather volatility\n\n$q$ in the Test Case Generation Rules  \nfor Weather transition probability matrix\n\n3\n\nless($2.0$), moderately($1.5$), highly volatile($1.0$)\n\nTotal:648 patterns\n\n8 test cases are generated for each pattern\n\nFor each pattern of these, $8$ test cases with different seed values are generated, for a total of $3 \\times 3 \\times4\\times 3 \\times 2 \\times 3 \\times 8 = 5184$ test cases.\nThis is only pattern generation of the parameters in the above table. Apart from this process, data such as geographic information, jobs, etc. are generated for each test case.\nRelative evaluation system is used for rankings. For each test case, we compute the relative score $\\text{round}(10^{9} \\times \\frac{\\text{YOUR_SCORE}}{\\text{MAX_SCORE}})$, where $\\text{YOUR_SCORE}$ is your [Score](#input3-en) and $\\text{MAX_SCORE}$ is the highest score among all competitors obtained on that test case. The score of the submission is the sum of the relative scores.\nIf your submission produces invalid output or exceeds the time limit for some test cases, only the score for those test cases will be zero.\nThe system test will be performed only for **the last submission which received a result other than `CE`**. Be careful not to make a mistake in the final submission.\n\n#### About Relative Evaluation System\n\nIn both the provisional/system test, the standings will be calculated using only the last submission which received a result other than `CE` . Only the last submissions are used to calculate the highest score among all competitors for each test case in calculating the relative scores.\nThe scores shown in the standings are relative, and whenever a new submission arrives, all relative scores are recalculated. On the other hand, the score for each submission shown on the submissions page is an absolute score obtained by summing up the scores for each test case, and the relative scores are not shown. In order to know the relative score of submission other than the latest one in the current standings, you need to resubmit it. If your submission produces invalid output or exceeds the time limit for some test cases, the absolute score shown in the submissions page becomes 0, but the standings show the sum of the relative scores for the test cases that were answered correctly."},{"iden":"constraints","content":"*   Character encoding is UTF-8 (although only ASCII characters are used).\n*   End-of-line code is `LF`(`0x0A`).\n*   Delimiter is the half-width space (`0x20`)\n*   Trailing delimiter characters are permitted.\n\nFor decimal values, **\\[Decimal\\]** is appended.\n\n#### Input 1\n\n*   $300 \\leq T_\\text{max} \\leq 1000$ and $T_\\text{max}$ is a multiple of $100$\n*   $150\\leq N_V\\leq 2000$\n*   $4N_V/3\\leq N_E\\leq 2 N_V$\n*   $1\\leq u_i,v_i\\leq N_V, u_i \\neq v_i (1 \\leq i \\leq N_E)$\n*   $1\\leq d_i \\leq 128 (1 \\leq i \\leq N_E)$\n*   The graph given is guaranteed to be connected and not contain self-loops or multiple edges.\n*   $1 \\leq N_\\text{worker} \\leq 10$\n*   $1\\leq v^\\text{init}_i \\leq N_V (1 \\leq i \\leq N_\\text{worker})$\n*   $30\\leq L^\\text{max}_i\\leq 100 (1 \\leq i \\leq N_\\text{worker})$\n*   $1 \\leq N^\\text{JobType}_i \\leq 3 (1 \\leq i \\leq N_\\text{worker})$\n*   $1\\leq \\text{Type}^i_j\\leq 3 (1 \\leq i \\leq N_\\text{worker},1 \\leq j \\leq N^\\text{JobType}_i)$\n*   $250 \\leq N_\\text{job} \\leq 1003$\n*   $\\text{ID}^\\text{job}_i=i (1 \\leq i \\leq N_\\text{job})$\n*   $1\\leq \\text{Type}_i\\leq 3$ and $\\text{Type}_i$ is included in the processable job types of $1$ or more workers. $(1 \\leq i \\leq N_\\text{job})$\n*   $500 \\leq N^\\text{task}_i \\leq 1500(1 \\leq i \\leq N_\\text{job})$\n*   $1 \\leq v^\\text{job}_i \\leq N_V (1 \\leq i \\leq N_\\text{job})$\n*   $0.91\\leq P^\\text{job}_i<1.0 (1 \\leq i \\leq N_\\text{job})$ **\\[Decimal\\]**\n*   $f^\\text{mandatory}_i\\in{0,1}(1 \\leq i \\leq N_\\text{job})$\n*   $1 \\leq N^\\text{reward}_i \\leq 43 (1 \\leq i \\leq N_\\text{job})$\n*   $0\\leq t^\\text{reward}_{i,1}<t^\\text{reward}_{i,2}<\\cdots<t^\\text{reward}_{i,N^\\text{reward}_i}\\leq T_\\text{max}+1(1 \\leq i \\leq N_\\text{job})$\n*   $y^\\text{reward}_{i,1}=y^\\text{reward}_{i,N^\\text{reward}_i}=0,1 \\leq y^\\text{reward}_{i,j} \\leq 10^7 (1 \\leq i \\leq N_\\text{job},2 \\leq j \\leq N^\\text{reward}_i-1)$\n*   $0\\leq N^\\text{depend}_i\\leq 3(1 \\leq i \\leq N_\\text{job})$\n*   $1 \\leq \\text{id}^\\text{depend}_{i,j} \\leq N_\\text{job},\\text{id}^\\text{depend}_{i,j} \\neq \\text{id}^\\text{depend}_{i,k},\\text{id}^\\text{depend}_{i,j}\\neq i (1 \\leq i \\leq N_\\text{job},1\\leq j \\leq N^\\text{depend}_i,1\\leq k\\leq N^\\text{depend}_i,j\\neq k)$\n*   Job dependency relationships can be viewed as a directed acyclic graph (which will not necessarily be connected) with each job as a vertex and dependencies between jobs as directed edges, and each connected component having size of $4$ or less.\n*   $5 \\leq T^\\text{weather} \\leq 20$ and $T^\\text{weather}$ divides $T_\\text{max}$.\n*   $N^\\text{weather}=7$\n*   $0.0 \\leq p^\\text{weather}_{i,j} \\leq 1.0,\\displaystyle\\sum_{k=1}^{N^\\text{weather}}p^\\text{weather}_{i,k}=1.0(1\\leq i \\leq N^\\text{weather},1 \\leq j \\leq N^\\text{weather}) $ **\\[Decimal\\]**\n*   $(c_1,c_2,c_3,c_4,c_5,c_6,c_7) = (0,1,2,3,10,14,20)$\n*   $0.005 \\leq P_m< 0.025$ **\\[Decimal\\]**\n*   $0.97< R_m \\leq 0.999$ **\\[Decimal\\]** (Note that the distribution of $R_m$ is obtained by applying $f(x)=1.0-0.001 \\cdot 30^x$ to random variable $X$ that follows the uniform distribution on $[0,1)$.)\n*   $0.2 \\leq \\alpha < 5$ **\\[Decimal\\]** (Note that the distribution of $\\alpha$ is obtained by applying $f(x)=5^{-1+2x}$ to random variable $X$ that follows the uniform distribution on $[0,1)$.)\n*   $0.0 \\leq d^\\text{weather}_i < 0.15 (1 \\leq i \\leq N_\\text{job})$ **\\[Decimal\\]**\n\n#### Input 2\n\n*   $1 \\leq \\text{id}_i^\\text{job} \\leq N_\\text{job} (1\\leq i\\leq N^\\text{selected})$\n*   $0 \\leq n^\\text{rest}_i \\leq N^\\text{task}_i (1\\leq i\\leq N^\\text{selected})$\n*   $0.0 \\leq L^\\text{weather}_i \\leq 1.0(1\\leq i\\leq N^\\text{selected})$ **\\[Decimal\\]**\n*   $\\text{id}^\\text{worker}_i=i (1\\leq i\\leq N_\\text{worker})$\n*   $1\\leq u_i,v_i\\leq N_V (1\\leq i\\leq N_\\text{worker})$\n*   $0\\leq d^\\text{from_u}_i \\leq $ $\\text{Length of the corresponding edge}$ $(1\\leq i\\leq N_\\text{worker})$\n*   $u_i=v_i$ if and only if $d^\\text{from_u}_i=0$. $(1\\leq i\\leq N_\\text{worker})$\n*   Suppose that the time [Input 2](#input2-en) is given at is $t$:\n    *   $N'= (T_{\\text{max}}-(t-1))/T^{\\text{weather}}$\n    *   $t_i=t+(i-1)\\times T^{\\text{weather}} (1\\leq i \\leq N')$\n    *   $0.0 \\leq p^i_j \\leq 1.0,\\displaystyle\\sum_{k=1}^{N^\\text{weather}}p^i_k = 1.0 (1\\leq i \\leq N')$ **\\[Decimal\\]**\n\n#### Input 3 (Scoring)\n\n*   $0 \\leq S \\leq 2^{63}-1$\n\n#### Geographical data\n\n*   $L=2048$\n*   $d_\\text{max}\\in{5,6,7}$\n*   $s=1$\n*   $0.3 \\leq C < 0.4$ **\\[Decimal\\]**\n*   $M=\\text{round}(0.45(4^{d_\\text{max}+1}-1)/(3\\times 2^{d_\\text{max}-5}))$\n\n#### Transition probability matrix\n\n*   $\\bm{s}^\\text{sta}=(0.21,0.25,0.10,0.31,0.102,0.023,0.005)$ **\\[Decimal\\]**\n*   $d=2$\n*   $\\epsilon = 1.0 \\times 10^{-8}$ **\\[Decimal\\]**\n*   $M=10^6$\n*   $1 \\leq q \\leq 2$ **\\[Decimal\\]**\n\n#### Segmented linear reward function\n\n*   $100 \\leq L \\leq T_\\text{max}$\n*   $l = 25$\n*   $10^6 \\leq s \\leq 2\\times 10^6$\n*   $0.3 \\leq \\sigma' < 0.38 $ **\\[Decimal\\]**\n*   $M = 10^7$\n*   $m = 1$\n\n#### Others\n\n*   Seed value for weathers $\\in {0,1,\\cdots,2^{64}-1}$"},{"iden":"toolkit","content":"A toolkit for this problem can be downloaded from [here](https://img.atcoder.jp/hokudai-hitachi2022/f3c44ba9531996b.zip). It includes the following:\n\n*   Judge program (for both A, B)\n*   Test case generator (both A and B)\n*   Sample codes (In C++, one each for problems A and B)\n*   Visualizer"},{"iden":"visualizer","content":"Log files (in JSON format) generated from the judge program in the toolkit can be used to visualize the results.\nThe visualizer is included in the toolkit, but is also available [here](https://img.atcoder.jp/hokudai-hitachi2022/wVw8B4mE02x8rJNU.html?en) on the server.\nFor details, please read the README in the toolkit and the description at the bottom of the visualizer page."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}