about summary refs log tree commit diff
path: root/daily/286easy/problem.html
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2016-10-08 09:56:43 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2016-10-08 09:56:43 +0700
commit2a7bc10f6c011d19fb3b0e73068f7e1a9c30ace0 (patch)
tree95190a32ec1c7098494849eea5a5ba6b53289585 /daily/286easy/problem.html
parent207cc2ae9893b0cdecd20119b9ede37f73cd4a1e (diff)
downloadcp-2a7bc10f6c011d19fb3b0e73068f7e1a9c30ace0.tar.gz
Initial commit
Diffstat (limited to 'daily/286easy/problem.html')
-rw-r--r--daily/286easy/problem.html25
1 files changed, 25 insertions, 0 deletions
diff --git a/daily/286easy/problem.html b/daily/286easy/problem.html
new file mode 100644
index 0000000..362cc50
--- /dev/null
+++ b/daily/286easy/problem.html
@@ -0,0 +1,25 @@
+<h1 id="description">Description</h1>
+<p>Nearly everyone is familiar with the factorial operator in math. 5! yields 120 because factorial means &quot;multiply successive terms where each are one less than the previous&quot;:</p>
+<pre><code>5! -&gt; 5 * 4 * 3 * 2 * 1 -&gt; 120</code></pre>
+<p>Simple enough.</p>
+<p>Now let's reverse it. Could you write a function that tells us that &quot;120&quot; is &quot;5!&quot;?</p>
+<p>Hint: The strategy is pretty straightforward, just divide the term by successively larger terms until you get to &quot;1&quot; as the resultant:</p>
+<pre><code>120 -&gt; 120/2 -&gt; 60/3 -&gt; 20/4 -&gt; 5/5 -&gt; 1 =&gt; 5!</code></pre>
+<h1 id="sample-input">Sample Input</h1>
+<p>You'll be given a single integer, one per line. Examples:</p>
+<pre><code>120
+150</code></pre>
+<h1 id="sample-output">Sample Output</h1>
+<p>Your program should report what each number is as a factorial, or &quot;NONE&quot; if it's not legitimately a factorial. Examples:</p>
+<pre><code>120 = 5!
+150   NONE</code></pre>
+<h1 id="challenge-input">Challenge Input</h1>
+<pre><code>3628800
+479001600
+6
+18</code></pre>
+<h1 id="challenge-output">Challenge Output</h1>
+<pre><code>3628800 = 10!
+479001600 = 12!
+6 = 3!
+18  NONE</code></pre>