X marks the spot! Arr! Did you think that just because we’re pirates, we wouldn’t ask the Coding Hero for help? That’s discrimination! I have a map here that leads to a lot of treasures and I need your help to get them. Every treasure is hidden underground but the surface is marked with an X. To dig up the treasure, I need N number of sailors to dig it up, and the bigger the X, the bigger the treasure, and the more sailors (N) I need to dig it up! I need to know how big of an X I can dig up if I bring N number of men with me so I can optimize the split of the treasure. By the way, N can only be greater than 3 and it can only be an odd integer. You better do it quickly or you’ll be sleeping with the fishes! Inputs 1. Number of sailors The value is >= 3 and is odd Sample Output Enter the number of sailors: 3 * * * * * * * * *
X marks the spot! Arr! Did you think that just because we’re pirates, we wouldn’t ask the Coding Hero for help? That’s discrimination! I have a map here that leads to a lot of treasures and I need your help to get them. Every treasure is hidden underground but the surface is marked with an X. To dig up the treasure, I need N number of sailors to dig it up, and the bigger the X, the bigger the treasure, and the more sailors (N) I need to dig it up! I need to know how big of an X I can dig up if I bring N number of men with me so I can optimize the split of the treasure. By the way, N can only be greater than 3 and it can only be an odd integer. You better do it quickly or you’ll be sleeping with the fishes!
Inputs
1. Number of sailors
The value is >= 3 and is odd
Sample Output
Step by step
Solved in 4 steps with 2 images