1796:假期

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:3 解决:2

题目描述

假期共有 lns="http://www.w3.org/1998/Math/MathML"> 天,每天可以在三件事中选择做一件事:

  • 如果在第 lns="http://www.w3.org/1998/Math/MathML"> 天选择玩耍,则可以获得 lns="http://www.w3.org/1998/Math/MathML"> 点分数
  • 如果在第 lns="http://www.w3.org/1998/Math/MathML"> 天选择刷题,则可以获得 lns="http://www.w3.org/1998/Math/MathML"> 点分数
  • 如果在第 lns="http://www.w3.org/1998/Math/MathML"> 天选择躺平,则可以获得 lns="http://www.w3.org/1998/Math/MathML"> 点分数

如果要求每天做的事情不能与前一天相同,则如何安排假期的活动,才能使得分数之和达到最大?

输入

  • 第一行:单个整数 lns="http://www.w3.org/1998/Math/MathML">
  • 第二行到第 lns="http://www.w3.org/1998/Math/MathML">+1 行:第 lns="http://www.w3.org/1998/Math/MathML">+1 行有三个整数 lns="http://www.w3.org/1998/Math/MathML">lns="http://www.w3.org/1998/Math/MathML"> 与 lns="http://www.w3.org/1998/Math/MathML">

  •  的分数,lns="http://www.w3.org/1998/Math/MathML">110
  • lns="http://www.w3.org/1998/Math/MathML">60% 的分数,lns="http://www.w3.org/1998/Math/MathML">1300
  • lns="http://www.w3.org/1998/Math/MathML">100% 的分数,lns="http://www.w3.org/1998/Math/MathML">1200,000
  • lns="http://www.w3.org/1998/Math/MathML">010,000
  • lns="http://www.w3.org/1998/Math/MathML">010,000
  • lns="http://www.w3.org/1998/Math/MathML">010,000

输出

  • 单个整数:表示最大分数

样例输入-1 复制

3
100 1 1
1 100 1
1 1 100

样例输出-1 复制

300