Test case 1


time:0.05 sec

Test case 2


time:0.05 sec

Test case 3


time:0.26 sec

※ All the test cases will be run from the first one in order. If your program does not pass one test case, no further test cases will be carried out (knockout format).


100 points Out of 100 points

I was promoted to CTO!

Mr. 7thwheel, this is amazing code!! I could never write such efficient code!

Language PHP
Execution speed 0.05 sec
*Tast case 1
PHPfastest record 0.01 sec
*Test case 1
PHPsubmitted count 3258
(2014/01/09 updated)

Your skills match the S paiza rank. You are extremely highly skilled. With paiza, you will be able to have interviews with an incredibly large number of companies straight away without having to go through an application screening process.

What is paiza online hackathon?

paiza online hackathon is Free Join. In this event, all participants will solve the problem of programming one. And compete for execution speed, and each other to share the excellent code.

The new lady programmer, Ms. Noda, has been assigned to your team. Improve her code so that it's better than what she's written already. Write more efficient code to show your skills as a programmer and fora chance to be promoted.

Use your favorite language (Java, C, C++, C#, PHP, Ruby, Python, Perl) to implement an efficient program.

Your submitted code will be run through multiple tests cases, and the number of correct answers and your code’s execution speed will be recorded to assign you a score.

  • This is a problem open to everyone so it does not have a time limit.
  • The same person can try solving this problem multiple times.
  • You are also welcome to write solutions on blogs, etc.
Get a high score and tell your friends!

paiza online hackathon is Free Join.
Let's aim for the fastest code!

View problem details

Top of page