Special Technology
Time limit1sMemory limit1024 MB
Given student heights, find the greatest final height reachable when each student is hit at most once, printed modulo 10^9+7.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
NLCS has the best technology in the world.
NLCS Jeju, whose technology is outstanding, developed a growth tool called "magic hammer" for students who want to grow taller.
NLCS Jeju ran an experiment that used the magic hammer on students who joined its clinical trial of the tool. When the hammer is used on a student, every other student grows taller by that student's height. The hammer is still a prototype, so each student can be hit at most once.
To show how powerful the magic hammer is, NLCS Jeju wants to make the tallest student as tall as possible after using the hammer. Find the greatest height that can be reached by using the hammer on the students.
Input
The first line contains the number of students .
The second line contains the height of each student, separated by spaces.
Output
Print the greatest height of a student that can be obtained by using the magic hammer appropriately. Heights can become very large, so print the remainder when the answer is divided by .