GlobeX Cup '19 J2 - Winnie Waifu Wars

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

Winnie is playing the latest hot mobile game, AliensXBattle 2. In this game, Winnie has 6 aliens on the field. Each alien starts at level 1, but can be upgraded by using coins and alien drinks. The maximum level of each alien is 10. Each alien has a power level. The power level of each alien changes based on level. Help Winnie determine the maximum sum of power levels she can achieve.

Input Specification

The first line of input contains two integers N and M. N is the amount of coins Winnie has, and M is the amount of alien drinks Winnie has.

The second line of input contains two integers A and B. A is the amount of coins to level up a alien, and B is the amount of energy drinks needed to level up a alien.

Each of the next 6 lines of input will contain 10 integers, X_{i,j}. X_{i,j} represents the power level of the i^\text{th} alien at level j. It is not guaranteed that a alien will have a power level increases as they level up.

Output Specification

Output the maximum power level Winnie can achieve by upgrading her aliens.

Constraints

1 \leq N,M,A,B \leq 10^9
1 \leq X_{ij} \leq 10^9

(Hint: What does these constraints tell you about the problem?)

Sample Input 1

1 1
1 1
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10

Sample Output 1

7

Comments


  • 1
    Serog1sPerog1s  commented on April 11, 2020, 2:47 p.m.

    I feel like there is something stupidly obvious that I'm missing, so I'm leaving this comment here for whenever I finally figure out what I'm doing wrong and come back to reconsider my choices in life