QOJ.ac

QOJ

Time Limit: 3.0 s Memory Limit: 512 MB Total points: 100

#12712. 辅助项目

Statistics

Anna 刚刚完成了她的课程项目。她剩下许多七段数码管,还有一个小型电源。每个数码管消耗的电量与点亮的段数成正比,例如,显示数字 ‘9’ 消耗的电量是显示 ‘7’ 的两倍。

Anna 想知道,如果她的电源能够点亮 $n$ 个段,且她希望恰好点亮 $n$ 个段,那么她所能达到的数字之和的最大值是多少。

输入包含一行,一个整数 $n$ —— 需要点亮的段数 ($2 \le n \le 10^6$)。

输出一个整数 —— 可以同时显示出的数字之和的最大值。

样例

输入格式 1

4

输出格式 1

4

说明

在第一个样例中,应该显示一个 ‘4’(‘7’ 的数值更大,但它只需要三个段)。

输入格式 2

7

输出格式 2

11

说明

在第二个样例中,应该显示 ‘4’ 和 ‘7’。

输入格式 3

6

输出格式 3

14

说明

在第三个样例中,应该显示两个 ‘7’。

Discussions

About Discussions

The discussion section is only for posting: 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.
  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.