Learn DSADSAContests
coding75 logo
LeetCode POTDPOTDSheets
coding75 Pro
coding75 logo
Dashboard
Learn DSA
Course RoadmapFlow
DSA Topic TreeNew 🚀
Contest SolutionsPractice
Practice Sheets
MasterclassesLive 👨🏻‍💻

coding75 ProPRO

Live Classes & Placement Guidance

coding75 logo

The premier developer platform for mastering Data Structures & Algorithms, exploring contest editorials, building ATS-ready resumes, and accelerating your tech career.

Connect & Community

DSA & Contests

  • Learn DSA
  • Contest Solutions
  • LeetCode POTDDaily
  • Practice Sheets
  • MasterclassesSoon

Interview Prep

  • Portfolio Projects
  • CS Fundamentals
  • System DesignSoon
  • Interview ExperiencesSoon
  • Mock InterviewsSoon

Career & Pro

  • Jobs & Internships
  • Resume BuilderATS
  • coding75 Pro
  • Submit Feedback
© 2026coding75•crackDSA™•Maa Lalita Edtech Private Limited. All Rights Reserved.
Privacy PolicyTerms & ConditionsContact Support
Registered Office: Kanpur 208021•Regional Office: Indiranagar, Bangalore, 560008
Maa Lalita Edtech Private Limited
Contests/CodeChef/Starters 131/Gotta Catch Em All
PrevNext
CodeChefCodeChef
2 Star
Starters 131

Gotta Catch Em All

MathArray
Loading...
Solve on CodeChef

Problem Statement

Official algorithmic problem description and constraints.

Open on CodeChef

You're playing your favorite video game: Pekómon!

The objective of the game is, of course, to "Catch Them All".

There are 𝑁 different Pekómon in the game. The 𝑖th of them has a catching difficulty of 𝐴𝑖

To catch these Pekómon, you must use Pekóballs. There are two types of Pekóballs available to you:

  • Normal Pekóballs, which cost 𝑋 coins each. You need to throw exactly 𝐴iNormal Pekóballs to catch a Pekómon whose catching difficulty is 𝐴𝑖
  • Master Pekóballs, which cost 𝑌 coins each. You need to throw only 1 Master Pekóball to catch any Pekómon, no matter what its catching difficulty is.

Find the minimum number of coins you need to spend on buying Pekóballs, so that you can catch all 𝑁 Pekómon.

Solutions & Walkthrough

Detailed video explanations, mathematical intuition, and clean C++ implementation code.

Connecting secure classroom stream...
Back to Starters 131
Previous ProblemNext Problem