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/Dice Deception
PrevNext
CodeChefCodeChef
3 Star
Starters 131

Dice Deception

SortingArrayMath
Loading...
Solve on CodeChef

Problem Statement

Official algorithmic problem description and constraints.

Open on CodeChef

Alice and Bob are playing a board game.

On their turn, a player must roll 𝑁 standard 6-sided dice, and their action will be determined by the sum of values on the top faces of the 𝑁 dice.

On a certain turn of Alice, she rolls the dice and obtains the sequence of values 𝐴1,𝐴2,…,𝐴𝑁 on the top faces.

However, Bob isn't paying attention, allowing Alice to cheat a little!

Alice can choose a die, and flip it - so the opposite face is upward.

  • Note that these are standard 6-sided dice, so the sum of values on opposite faces is 7.

So as to not make Bob suspicious, Alice can perform this flipping operation at most 𝐾 times.

What's the maximum score (i.e, sum of values of top faces of the dice) she can obtain?

Solutions & Walkthrough

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

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