From 2a7bc10f6c011d19fb3b0e73068f7e1a9c30ace0 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sat, 8 Oct 2016 09:56:43 +0700 Subject: Initial commit --- daily/285easy/1dec.pas | 9 ++++ daily/285easy/1enc | Bin 0 -> 149572 bytes daily/285easy/1enc.inp | 1 + daily/285easy/1enc.o | Bin 0 -> 6372 bytes daily/285easy/1enc.out | 8 +++ daily/285easy/1enc.pas | 79 +++++++++++++++++++++++++++++ daily/285easy/part1.out | 8 +++ daily/285easy/part2.inp | 5 ++ daily/285easy/part2.out | 5 ++ daily/285easy/part2.pas | 22 ++++++++ daily/285easy/problem.html | 94 ++++++++++++++++++++++++++++++++++ daily/285easy/problem.md | 121 ++++++++++++++++++++++++++++++++++++++++++++ daily/285easy/problem1.html | 61 ++++++++++++++++++++++ daily/285easy/problem1.md | 107 +++++++++++++++++++++++++++++++++++++++ daily/286easy/lairotcaf | Bin 0 -> 148836 bytes daily/286easy/lairotcaf.inp | 6 +++ daily/286easy/lairotcaf.o | Bin 0 -> 4976 bytes daily/286easy/lairotcaf.out | 6 +++ daily/286easy/lairotcaf.pas | 31 ++++++++++++ daily/286easy/problem.html | 25 +++++++++ daily/286easy/problem.md | 41 +++++++++++++++ 21 files changed, 629 insertions(+) create mode 100644 daily/285easy/1dec.pas create mode 100755 daily/285easy/1enc create mode 100644 daily/285easy/1enc.inp create mode 100644 daily/285easy/1enc.o create mode 100644 daily/285easy/1enc.out create mode 100644 daily/285easy/1enc.pas create mode 100644 daily/285easy/part1.out create mode 100644 daily/285easy/part2.inp create mode 100644 daily/285easy/part2.out create mode 100644 daily/285easy/part2.pas create mode 100644 daily/285easy/problem.html create mode 100644 daily/285easy/problem.md create mode 100644 daily/285easy/problem1.html create mode 100644 daily/285easy/problem1.md create mode 100755 daily/286easy/lairotcaf create mode 100644 daily/286easy/lairotcaf.inp create mode 100644 daily/286easy/lairotcaf.o create mode 100644 daily/286easy/lairotcaf.out create mode 100644 daily/286easy/lairotcaf.pas create mode 100644 daily/286easy/problem.html create mode 100644 daily/286easy/problem.md (limited to 'daily') diff --git a/daily/285easy/1dec.pas b/daily/285easy/1dec.pas new file mode 100644 index 0000000..734bd0f --- /dev/null +++ b/daily/285easy/1dec.pas @@ -0,0 +1,9 @@ +(* uudecoding *) + +var + fi, fo: text; + + +begin + repeat + read(f diff --git a/daily/285easy/1enc b/daily/285easy/1enc new file mode 100755 index 0000000..eecdec1 Binary files /dev/null and b/daily/285easy/1enc differ diff --git a/daily/285easy/1enc.inp b/daily/285easy/1enc.inp new file mode 100644 index 0000000..997b0c5 --- /dev/null +++ b/daily/285easy/1enc.inp @@ -0,0 +1 @@ +I feel very strongly about you doing duty. Would you give me a little more documentation about your reading in French? I am glad you are happy — but I never believe much in happiness. I never believe in misery either. Those are things you see on the stage or the screen or the printed pages, they never really happen to you in life. diff --git a/daily/285easy/1enc.o b/daily/285easy/1enc.o new file mode 100644 index 0000000..636d662 Binary files /dev/null and b/daily/285easy/1enc.o differ diff --git a/daily/285easy/1enc.out b/daily/285easy/1enc.out new file mode 100644 index 0000000..f1fd196 --- /dev/null +++ b/daily/285easy/1enc.out @@ -0,0 +1,8 @@ +M22!F965L('9E6]U(&1O:6YG(&1U='DN(%=O +M=6QD('EO=2!G:79E(&UE(&$@;&ET=&QE(&UO2!N979E 0 then + begin + write(fo, chr(n + 32)); + for i := 1 to n div 3 do + begin + read(fi, s); + write(fo, enc(s)) + end; + if n mod 3 > 0 then + begin + read(fi, s); + writeln(fo, enc(s)) + end + else + writeln(fo) + end; + + close(fi); + close(fo) +end. diff --git a/daily/285easy/part1.out b/daily/285easy/part1.out new file mode 100644 index 0000000..f1fd196 --- /dev/null +++ b/daily/285easy/part1.out @@ -0,0 +1,8 @@ +M22!F965L('9E6]U(&1O:6YG(&1U='DN(%=O +M=6QD('EO=2!G:79E(&UE(&$@;&ET=&QE(&UO2!N979EWe will make a binary byte oriented encoding of data that is self describing and extensible, and aims to solve the following problems:

+
    +
  • portability between 32 and 64 (and any other) bit systems, and languages, and endian-ness.
  • +
  • type system independent of underlying language.
    +
  • +
  • Allow heterogeneous arrays (differing types of array elements) where the underlying language has poor support for them.
  • +
  • leverage power of homogeneous arrays in a language.
  • +
  • support records regardless of underlying language (array of records is homogeneous, even though a record is a heterogeneous list of fields)
  • +
  • Allow ragged arrays (a table where each row is a list, but the rows do not have a uniform size (or shape))
  • +
  • Provide basic in memory compression. Allow deferred decoding of partial data.
  • +
+

1. base64 encoding (used in later challenges)

+

To read and write binary data on reddit, we will use base64 encoding.

+

2. Extendible byte base.

+

Any size integer can be coded into a variable byte array by using the maximum byte value as a marker to add the next byte value to decode the total.

+

This is useful for coding numbers that you think can be limited to around 255 or close to it, without being "hard constrained" by that limit. "256 possible op codes (or characters) ought to be enough for everyone forever thinking"

+

unsigned byte input
+12
+255
+256
+510
+512 44 1024

+

last input is a list of 3 integers to encode

+

sample outputs
+12
+255 0
+255 1
+255 255 0
+255 255 2 44 255 255 255 255 4

+

every element that is not 255 marks the end of "that integer" in a list. You should also write a decoder that transforms output into input.

+

3. multibyte and variable byte encodings

+

Instead of a single byte target encoding, 2,4,8 and variable defined byte sizes are also desirable to cover integers with larger ranges. An account balance might have a 40 bit practical limit, but you might not guarantee it forever. 64 bits might not be enough for Zimbabwe currency balances for example.

+

For compressing a list of numbers, often it is useful to set the whole list to one "byte size". Other choices include,

+
    +
  • setting an enum/table of possible byte size codings of 1 2 4 8 sizes, and then encoding, the number of elements, the table/enum size and definition, and then 2 lists (enum key, data items)
  • +
  • interleave bytesize, data
  • +
+

The latter will often be longer for long lists, but does not encode the table so is simpler to encode/decode.

+

Encoding format for table definition:

+
    +
  1. 4 bytes: first 30 bits - length of list. last 2 bits: key into 1 2 4 8. If first 30 bits are max value, then following 4 bytes are added to count until a non-max value is taken. Similar to challenge #2.
    +
  2. +
  3. list of byte lengths defined by key in 1. If last 2 bits of 1 are 3 (signifies up to 8 distinct integer sizes), then this list has 8 items. If there only 6 distinct integer size codings, then the last 2 items in this list would be ignored and set to 0. Values over 255 are encoded as in challenge 2.
  4. +
  5. list of ordered data encodings in boolean form, if there are more than 1. 1 bit for 2, 2 bits for 4, 3 bits for 8.
  6. +
  7. list of data elements.
  8. +
+

challenges
+encode list of integers from 0 to 1025 using 8 or 16 bit variable encoding. With the shortest encoding that will contain the number. Just print the sum of all the bytes as result for output brevity.

+

solution

+
    +
  1. first 4 bytes are (1025 * 4) + 1 (leading 0 bytes for smaller than "full size" numbers)
  2. +
  3. 2 byte list: 1 2
  4. +
  5. 0 for first 256 bits, 1 for remaining bits (total 1032 bits long with padding)
  6. +
  7. 256 + (769 * 2) bytes long encoding of the numbers.
  8. +
+

4. balanced signed numbers

+

Some numbers are negative. The common computer encoding for signed number ranges is to subtract half the max power of 2 from the value. A signed byte has range -128 to 127, where a 0 value corresponds to -128 (in our encoding).

+

For numbers outside this range encoded in a single byte, the process is to take the first byte to determine the sign, and then following bytes add or subtract up to 255 per byte until a non 255 value is reached.

+

5. unbalanced signed numbers

+

Instead of the midpoint marking 0, a byte can encode a value within any defined range. Another important application is to use "negative" numbers as codes of some sort. These include:

+
    +
  • An expectation that negative numbers are less frequent and smaller relative to 0
  • +
  • coding special values such as null, infinity, undeterminable (0/0)
  • +
  • Using codes to hint at extended byte encodings and sign of the number, or even data type
  • +
+

sample 0 index codes (for 16 reserved codes) (new paragraph for multiline explained codes)
+Null
+Infinity
+Negative Infinity
+Negative 1 byte
+Negative 2 bytes
+Negative 4 bytes
+Negative 8 bytes
+Negative custom byte length (value is encoded into 2 numbers. First is byte length (in 255 terminated bytes, followed by that number of bytes to represent the number)

+

Positive 1 byte (first number indicates range of 468 to 723). 467 could have been encoded as 255 254 without this special code.

+

Positive 2 byte
+Positive 4 byte
+Positive 8 byte
+Positive 16 byte
+Positive 64 byte
+Positive custom byte length (3 to 262 excluding other defined lengths) Positive custom 2 byte length (16 bit unsigned number defines byte length of number, followed by encoded number)

+

sample inputs
+10
+123123
+-55
+Null

+

sample output
+26
+9 123123
+3 54 (minimum range value is -1)
+0

+

challenge input

+

192387198237192837192837192387123817239182737 _44 981237123

+

array of 3 numbers (_44 is -44) to be encoded

diff --git a/daily/285easy/problem.md b/daily/285easy/problem.md new file mode 100644 index 0000000..c02832f --- /dev/null +++ b/daily/285easy/problem.md @@ -0,0 +1,121 @@ +We will make a binary byte oriented encoding of data that is self describing and extensible, and aims to solve the following problems: + +* portability between 32 and 64 (and any other) bit systems, and languages, and endian-ness. +* type system independent of underlying language. +* Allow heterogeneous arrays (differing types of array elements) where the underlying language has poor support for them. +* leverage power of homogeneous arrays in a language. +* support records regardless of underlying language (array of records is homogeneous, even though a record is a heterogeneous list of fields) +* Allow ragged arrays (a table where each row is a list, but the rows do not have a uniform size (or shape)) +* Provide basic in memory compression. Allow deferred decoding of partial data. + +# 1. base64 encoding (used in later challenges) + +To read and write binary data on reddit, we will use [base64 encoding](problem1.html). + +# 2. Extendible byte base. + +Any size integer can be coded into a variable byte array by using the maximum byte value as a marker to add the next byte value to decode the total. + +This is useful for coding numbers that you think can be limited to around 255 or close to it, without being "hard constrained" by that limit. "256 possible op codes (or characters) ought to be enough for everyone forever thinking" + +**unsigned byte input** +12 +255 +256 +510 +512 44 1024 + +last input is a list of 3 integers to encode + +**sample outputs** +12 +255 0 +255 1 +255 255 0 +255 255 2 44 255 255 255 255 4 + +every element that is not 255 marks the end of "that integer" in a list. You should also write a decoder that transforms output into input. + + +# 3. multibyte and variable byte encodings + +Instead of a single byte target encoding, 2,4,8 and variable defined byte sizes are also desirable to cover integers with larger ranges. An account balance might have a 40 bit practical limit, but you might not guarantee it forever. 64 bits might not be enough for Zimbabwe currency balances for example. + +For compressing a list of numbers, often it is useful to set the whole list to one "byte size". Other choices include, + +* setting an enum/table of possible byte size codings of 1 2 4 8 sizes, and then encoding, the number of elements, the table/enum size and definition, and then 2 lists (enum key, data items) +* interleave bytesize, data + +The latter will often be longer for long lists, but does not encode the table so is simpler to encode/decode. + +**Encoding format for table definition:** + +1. 4 bytes: first 30 bits - length of list. last 2 bits: key into 1 2 4 8. If first 30 bits are max value, then following 4 bytes are added to count until a non-max value is taken. Similar to challenge #2. +2. list of byte lengths defined by key in 1. If last 2 bits of 1 are 3 (signifies up to 8 distinct integer sizes), then this list has 8 items. If there only 6 distinct integer size codings, then the last 2 items in this list would be ignored and set to 0. Values over 255 are encoded as in challenge 2. +3. list of ordered data encodings in boolean form, if there are more than 1. 1 bit for 2, 2 bits for 4, 3 bits for 8. +4. list of data elements. + +**challenges** +encode list of integers from 0 to 1025 using 8 or 16 bit variable encoding. With the shortest encoding that will contain the number. Just print the sum of all the bytes as result for output brevity. + +**solution** + +1. first 4 bytes are (1025 * 4) + 1 (leading 0 bytes for smaller than "full size" numbers) +2. 2 byte list: 1 2 +3. 0 for first 256 bits, 1 for remaining bits (total 1032 bits long with padding) +4. 256 + (769 * 2) bytes long encoding of the numbers. + + +# 4. balanced signed numbers + +Some numbers are negative. The common computer encoding for signed number ranges is to subtract half the max power of 2 from the value. A signed byte has range -128 to 127, where a 0 value corresponds to -128 (in our encoding). + +For numbers outside this range encoded in a single byte, the process is to take the first byte to determine the sign, and then following bytes add or subtract up to 255 per byte until a non 255 value is reached. + +# 5. unbalanced signed numbers + +Instead of the midpoint marking 0, a byte can encode a value within any defined range. +Another important application is to use "negative" numbers as codes of some sort. These include: + +* An expectation that negative numbers are less frequent and smaller relative to 0 +* coding special values such as null, infinity, undeterminable (0/0) +* Using codes to hint at extended byte encodings and sign of the number, or even data type + + +**sample 0 index codes** (for 16 reserved codes) (new paragraph for multiline explained codes) +Null +Infinity +Negative Infinity +Negative 1 byte +Negative 2 bytes +Negative 4 bytes +Negative 8 bytes +Negative custom byte length (value is encoded into 2 numbers. First is byte length (in 255 terminated bytes, followed by that number of bytes to represent the number) + +Positive 1 byte (first number indicates range of 468 to 723). 467 could have been encoded as 255 254 without this special code. + +Positive 2 byte +Positive 4 byte +Positive 8 byte +Positive 16 byte +Positive 64 byte +Positive custom byte length (3 to 262 excluding other defined lengths) +Positive custom 2 byte length (16 bit unsigned number defines byte length of number, followed by encoded number) + +**sample inputs** +10 +123123 +-55 +Null + +**sample output** +26 +9 123123 +3 54 (minimum range value is -1) +0 + +**challenge input** + +192387198237192837192837192387123817239182737 _44 981237123 + +array of 3 numbers (_44 is -44) to be encoded diff --git a/daily/285easy/problem1.html b/daily/285easy/problem1.html new file mode 100644 index 0000000..bf843e7 --- /dev/null +++ b/daily/285easy/problem1.html @@ -0,0 +1,61 @@ +

You are trapped at uninhabited island only with your laptop. Still you don't want your significant other to worry about you, so you are going to send a message in a bottle with your picture or at least a couple of words from you (sure, you could just write down the words, but that would be less fun). You're going to use uuencoding for that.

+

Uuencoding is a form of binary-to-text encoding, which uses only symbols from 32-95 diapason, which means all symbols used in the encoding are printable.

+

Description of encoding

+

A uuencoded file starts with a header line of the form:

+
begin <mode> <file><newline>
+

is the file's Unix file permissions as three octal digits (e.g. 644, 744). For Windows 644 is always used.

+

is the file name to be used when recreating the binary data.

+

signifies a newline character, used to terminate each line.

+

Each data line uses the format:

+
<length character><formatted characters><newline>
+

is a character indicating the number of data bytes which have been encoded on that line. This is an ASCII character determined by adding 32 to the actual byte count, with the sole exception of a grave accent "`" (ASCII code 96) signifying zero bytes. All data lines except the last (if the data was not divisible by 45), have 45 bytes of encoded data (60 characters after encoding). Therefore, the vast majority of length values is 'M', (32 + 45 = ASCII code 77 or "M").

+

are encoded characters.

+

The mechanism of uuencoding repeats the following for every 3 bytes (if there are less than 3 bytes left, trailing 0 are added):

+
    +
  1. Start with 3 bytes from the source, 24 bits in total.

  2. +
  3. Split into 4 6-bit groupings, each representing a value in the range 0 to 63: bits (00-05), (06-11), (12-17) and (18-23).

  4. +
  5. Add 32 to each of the values. With the addition of 32 this means that the possible results can be between 32 (" " space) and 95 ("_" underline). 96 ("`" grave accent) as the "special character" is a logical extension of this range.

  6. +
  7. Output the ASCII equivalent of these numbers.

  8. +
+

For example, we want to encode a word "Cat". ASCII values for C,a,t are 67,97,116, or 010000110110000101110100 in binary. After dividing into four groups, we get 010000 110110 000101 110100, which is 16,54,5,52 in decimal. Adding 32 to this values and encoding back in ASCII, the final result is 0V%T.

+

The file ends with two lines:

+
`<newline>
+end<newline>
+

Formal Inputs & Outputs

+

Input

+

a byte array or string.

+

Output

+

a string containing uuencoded input.

+

Examples

+

Input: Cat

+

Output:

+
begin 644 cat.txt
+#0V%T
+`
+end
+

Input: I feel very strongly about you doing duty. Would you give me a little more documentation about your reading in French? I am glad you are happy — but I never believe much in happiness. I never believe in misery either. Those are things you see on the stage or the screen or the printed pages, they never really happen to you in life.

+

Output:

+
begin 644 file.txt
+M22!F965L('9E<GD@<W1R;VYG;'D@86)O=70@>6]U(&1O:6YG(&1U='DN(%=O
+M=6QD('EO=2!G:79E(&UE(&$@;&ET=&QE(&UO<F4@9&]C=6UE;G1A=&EO;B!A
+M8F]U="!Y;W5R(')E861I;F<@:6X@1G)E;F-H/R!)(&%M(&=L860@>6]U(&%R
+M92!H87!P>2#B@)0@8G5T($D@;F5V97(@8F5L:65V92!M=6-H(&EN(&AA<'!I
+M;F5S<RX@22!N979E<B!B96QI979E(&EN(&UI<V5R>2!E:71H97(N(%1H;W-E
+M(&%R92!T:&EN9W,@>6]U('-E92!O;B!T:&4@<W1A9V4@;W(@=&AE('-C<F5E
+M;B!O<B!T:&4@<')I;G1E9"!P86=E<RP@=&AE>2!N979E<B!R96%L;'D@:&%P
+3<&5N('1O('EO=2!I;B!L:69E+C P
+`
+end
+

Bonuses

+

Bonus 1

+

Write uudecoder, which decodes uuencoded input back to a byte array or string

+

Bonus 2

+

Write encoder for files as well.

+

Bonus 3

+

Make encoding parallel.

+

Further Reading

+

Binary-to-text encoding on Wikipedia.

+

Finally

+

This challenge is posted by /u/EvgeniyZh

+

Also have a good challenge idea?

+

Consider submitting it to /r/dailyprogrammer_ideas

diff --git a/daily/285easy/problem1.md b/daily/285easy/problem1.md new file mode 100644 index 0000000..2318628 --- /dev/null +++ b/daily/285easy/problem1.md @@ -0,0 +1,107 @@ +You are trapped at uninhabited island only with your laptop. Still you don't want your significant other to worry about you, so you are going to send a message in a bottle with your picture or at least a couple of words from you (sure, you could just write down the words, but that would be less fun). You're going to use uuencoding for that. + +Uuencoding is a form of binary-to-text encoding, which uses only symbols from 32-95 diapason, which means all symbols used in the encoding are printable. + +#Description of encoding + +A uuencoded file starts with a header line of the form: + + begin + + is the file's Unix file permissions as three octal digits (e.g. 644, 744). For Windows 644 is always used. + + is the file name to be used when recreating the binary data. + + signifies a newline character, used to terminate each line. + +Each data line uses the format: + + + + is a character indicating the number of data bytes which have been encoded on that line. This is an ASCII character determined by adding 32 to the actual byte count, with the sole exception of a grave accent "`" (ASCII code 96) signifying zero bytes. All data lines except the last (if the data was not divisible by 45), have 45 bytes of encoded data (60 characters after encoding). Therefore, the vast majority of length values is 'M', (32 + 45 = ASCII code 77 or "M"). + + + are encoded characters. + +The mechanism of uuencoding repeats the following for every 3 bytes (if there are less than 3 bytes left, trailing 0 are added): + +1. Start with 3 bytes from the source, 24 bits in total. + +2. Split into 4 6-bit groupings, each representing a value in the range 0 to 63: bits (00-05), (06-11), (12-17) and (18-23). + +3. Add 32 to each of the values. With the addition of 32 this means that the possible results can be between 32 (" " space) and 95 ("_" underline). 96 ("`" grave accent) as the "special character" is a logical extension of this range. + +4. Output the ASCII equivalent of these numbers. + + +For example, we want to encode a word "Cat". ASCII values for C,a,t are 67,97,116, or `010000110110000101110100` in binary. After dividing into four groups, we get 010000 110110 000101 110100, which is 16,54,5,52 in decimal. Adding 32 to this values and encoding back in ASCII, the final result is `0V%T`. + +The file ends with two lines: + + ` + end + +#Formal Inputs & Outputs + +##Input + +a byte array or string. + +##Output + +a string containing uuencoded input. + +#Examples + +Input: Cat + +Output: + + begin 644 cat.txt + #0V%T + ` + end + +Input: +I feel very strongly about you doing duty. Would you give me a little more documentation about your reading in French? I am glad you are happy — but I never believe much in happiness. I never believe in misery either. Those are things you see on the stage or the screen or the printed pages, they never really happen to you in life. + + +Output: + + begin 644 file.txt + M22!F965L('9E6]U(&1O:6YG(&1U='DN(%=O + M=6QD('EO=2!G:79E(&UE(&$@;&ET=&QE(&UO2!N979E 0 then + begin + i := 2; + while n mod i = 0 do + begin + n := n div i; + inc(i) + end; + if n = 1 then + begin + writeln(fo, ' = ', i - 1, '!'); + continue + end + end; + writeln(fo, ' NONE') + until eof(fi); + close(fi); + close(fo) +end. 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 @@ +

Description

+

Nearly everyone is familiar with the factorial operator in math. 5! yields 120 because factorial means "multiply successive terms where each are one less than the previous":

+
5! -> 5 * 4 * 3 * 2 * 1 -> 120
+

Simple enough.

+

Now let's reverse it. Could you write a function that tells us that "120" is "5!"?

+

Hint: The strategy is pretty straightforward, just divide the term by successively larger terms until you get to "1" as the resultant:

+
120 -> 120/2 -> 60/3 -> 20/4 -> 5/5 -> 1 => 5!
+

Sample Input

+

You'll be given a single integer, one per line. Examples:

+
120
+150
+

Sample Output

+

Your program should report what each number is as a factorial, or "NONE" if it's not legitimately a factorial. Examples:

+
120 = 5!
+150   NONE
+

Challenge Input

+
3628800
+479001600
+6
+18
+

Challenge Output

+
3628800 = 10!
+479001600 = 12!
+6 = 3!
+18  NONE
diff --git a/daily/286easy/problem.md b/daily/286easy/problem.md new file mode 100644 index 0000000..8715cbe --- /dev/null +++ b/daily/286easy/problem.md @@ -0,0 +1,41 @@ +# Description + +Nearly everyone is familiar with the factorial operator in math. 5! yields 120 because factorial means "multiply successive terms where each are one less than the previous": + + 5! -> 5 * 4 * 3 * 2 * 1 -> 120 + +Simple enough. + +Now let's reverse it. Could you write a function that tells us that "120" is "5!"? + +Hint: The strategy is pretty straightforward, just divide the term by successively larger terms until you get to "1" as the resultant: + + 120 -> 120/2 -> 60/3 -> 20/4 -> 5/5 -> 1 => 5! + +# Sample Input + +You'll be given a single integer, one per line. Examples: + + 120 + 150 + +# Sample Output + +Your program should report what each number is as a factorial, or "NONE" if it's not legitimately a factorial. Examples: + + 120 = 5! + 150 NONE + +# Challenge Input + + 3628800 + 479001600 + 6 + 18 + +# Challenge Output + + 3628800 = 10! + 479001600 = 12! + 6 = 3! + 18 NONE -- cgit 1.4.1