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 124/Table Strength
PrevNext
CodeChefCodeChef
3 Star
Starters 124

Table Strength

ArrayMathSortingGreedy
Loading...
Solve on CodeChef

Problem Statement

Official algorithmic problem description and constraints.

Open on CodeChef

You have N table legs, of different strengths. Pillar i can bear a weight of W i ​ , and will break if it has to bear a larger weight. You'd like to construct a table using some non-empty subset of these table legs. When you place a weight on a table, its load is equally distributed to each of its legs. For example, if you build a table with 4 4 legs, and place a weight of 18 18 on it, each leg will need to bear a weight of 18 4 = 4.5 4 18 ​ =4.5. So for instance, a table whose legs have strengths [ 4 , 4 , 5 , 6 ] [4,4,5,6] will not be able to bear this weight (the two legs with strength 4 4 will break), whereas a table with leg strengths [ 5 , 6 , 6 , 8 ] [5,6,6,8] will be able to bear it. Find the maximum possible weight that a table built out of some of these N legs can bear, without any of the legs breaking. It can be proved that this maximum weight is always an integer. Note: Subsets need not be contiguous: for example, [ 1 , 3 ] [1,3] is a subset of [ 1 , 4 , 3 , 2 ] [1,4,3,2].

Solutions & Walkthrough

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

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