QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100
الإحصائيات

题目背景

小 E 在玩 Somzig 游戏的时候因为操作时间不够绷不住了,于是就有了这个题。

题目描述

小 E 有 $n$ 种颜色的球,其中第 $i$ 种有 $a_i$ 个。有两类工具,第一类可以把一个指定颜色的球变成一个任意颜色的球;第二类可以把一个指定颜色的球变成两个这种颜色的球。一个变化之后的球也可以通过工具产生新的变化。关于第 $i$ 种颜色的第一类工具有 $b_i$ 个,第二类工具有 $c_i$ 个。小 E 想知道,如果每一工具最多只能使用一次,那么对于每种颜色 $i$,第 $i$ 种颜色的球最后最多能有多少个。以及,小 E 最后最多能有多少个球。

输入格式

从标准输入读入数据。

第一行一个正整数 $n$。

第二行 $n$ 个整数,其中第 $i$ 个表示 $a_i$。

第三行 $n$ 个整数,其中第 $i$ 个表示 $b_i$。

第四行 $n$ 个整数,其中第 $i$ 个表示 $c_i$。

输出格式

输出到标准输出。

第一行 $n$ 个整数,其中第 $i$ 个表示如果每个工具最多使用一次,那么小 E 最后第 $i$ 种颜色的球最多有多少个。

第二行一个整数,表示如果每个工具最多使用一次,那么小 E 最后最多能有多少个球。

样例1输入

2
1 2
1 2
1 0

样例1输出

4 3
4

子任务

保证 $1\le n \le 351493$。

保证 $0\le a_i,b_i,c_i\le 10^9$。

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.