Divide and Conquer

Divide and Conquer

Naruto is a Genin (beginner Ninja) in the Hidden Leaf village. He dreams of one day becoming the Hokage of the village (highest ranked Ninja). For that to happen, he has to train day and night. Most importantly, he has to practice various Ninja techniques. Ninja techniques can be divided into four elemental types: – Fire-based (Katon) techniques – Water-based (Suiton) techniques – Wind-based (Futon) techniques – Light-based (Raiton) techniques However, Naruto can only perform the first three types only (he cannot do Light-based techniques). Whenever Naruto performs a technique, his Chakra (inner energy) is consumed a little. Naruto’s Mentor (Jiraya-Sama �) is taking Naruto for a training camp. The camp will last for N days. On each training day i (where i ranges from 1 to N), Naruto is allowed to perform one Ninja technique only. Each technique consumes a different amount of chakra on different days. For example, a Fire-based technique might consume 10 chakra points on day 1 but could consume 15 chakra points on day 3 or 8 chakra points on day 4 and so on. Naruto is allowed to perform any technique he likes in any training day, however, JirayaSama doesn’t allow him to perform two techniques of the same type in two successive days. For example, If on day 1 Naruto performs a Wind-based technique, then on day 2 he is allowed to perform Water-based technique or Fire-based technique but not a Wind-based technique, because that would mean he performed two Wind-based techniques in a row which will make Jiraya-Sama angry. Find the minimum amount of Chakra needed by Naruto to finish the training camp.(SOLVE IT IN C++ OR JAVA)


Are you overwhelmed by your class schedule and need help completing this assignment? You deserve the best professional and plagiarism-free writing services. Allow us to take the weight off your shoulders by clicking this button.

Get help

Who Will Write your Paper

Writer avatar
Tutor_Charles

Rating: 4.9/5    Reviews 377

Success rate 100%

Completed projects: 545

I am an experienced writer offering professional services across diverse fields. I provide quality work with strict adherence to the deadline.

Writer avatar
Tutor_Dr. Edith

Rating: 4.8/5    Reviews 381

Success rate 100%

Completed projects: 490

I am an experienced writer with great research and analytical skills. Original quality paper and on-time delivery are guaranteed. Let's do this!

Writer avatar
Tutor_Dr.Judy

Rating: 4.7/5    Reviews 316

Success rate 98%

Completed projects: 398

I am a professional writer with more than 8 years of experience. My mission is to provide you with high-quality paper in a timely fashion.

Writer avatar
Tutor_Ian

Rating: 4.8/5    Reviews 371

Success rate 97%

Completed projects: 432

Hi, I deliver quality papers on time following all the instructions provided. Client's satisfaction is my priority. Welcome for plagiarism-free papers.

Writer avatar
Tutor_Prof. Allan

Rating: 4.8/5    Reviews 400

Success rate 97%

Completed projects: 487

With over half a decade of academic experience, I'm committed both to efficiency and punctuality. If it's quality you're looking for, then I'm here to provide!

Writer avatar
Tutor_Prof. Gabie

Rating: 4.9/5    Reviews 447

Success rate 98%

Completed projects: 546

A quality-driven, skilled writer with over 5 years of experience in various disciplines. I deliver plagiarism-free papers and content of impeccable quality, always original and always before the deadline!

Writer avatar
Tutor_Sarah

Rating: 4.9/5    Reviews 427

Success rate 96%

Completed projects: 567

I have been a full-time freelance researcher and writer for a period of over 6 years. I have successfully completed over 1000 projects and assignments. I have had a good professional relationship with my clients. Try me today!

Writer avatar
Tutor_Stella

Rating: 4.9/5    Reviews 305

Success rate 100%

Completed projects: 404

I am a proficient writer with knowledge across a wide range of academic disciplines. I guarantee quality, timely and original content.

Writer avatar
Tutor_SylviaYoung

Rating: /5    Reviews 419

Success rate 96%

Completed projects: 506

Hi, count on me to deliver quality and exemplary papers. I will pay attention to all your instructions, and meet all your expectations.