Kumite (ko͞omiˌtā) is the practice of taking techniques learned from Kata and applying them through the act of freestyle sparring.
You can create a new kumite by providing some initial code and optionally some test cases. From there other warriors can spar with you, by enhancing, refactoring and translating your code. There is no limit to how many warriors you can spar with.
A great use for kumite is to begin an idea for a kata as one. You can collaborate with other code warriors until you have it right, then you can convert it to a kata.
added a bigger prime number to test and fixed the bug that one was a prime, since it is not.
public class Primes { public static boolean isAPrime(int number) { if(number > 1 && number == 2) return true; //1 is not a prime number by definition else { for(int i = 3; i*i < number; i +=2) { if (number % i == 0) return false; } } return true; } }
- public class Primes {
- public static boolean isAPrime(int number) {
if(number == 1 || number == 2) return true;- if(number > 1 && number == 2) return true; //1 is not a prime number by definition
- else {
- for(int i = 3; i*i < number; i +=2) {
- if (number % i == 0) return false;
- }
- }
- return true;
- }
- }
import org.junit.Test; import static org.junit.Assert.assertEquals; import org.junit.runners.JUnit4; public class SolutionTest { @Test public void twoShouldBeAPrime() { int numberToCheck = 2; boolean expected = true; boolean actual = Primes.isAPrime(numberToCheck); assertEquals(expected, actual); } @Test public void fortySevenShouldBeAPrime() { int numberToCheck = 47; boolean expected = true; boolean actual = Primes.isAPrime(numberToCheck); assertEquals(expected, actual); } }
- import org.junit.Test;
- import static org.junit.Assert.assertEquals;
- import org.junit.runners.JUnit4;
- public class SolutionTest {
- @Test
- public void twoShouldBeAPrime() {
- int numberToCheck = 2;
- boolean expected = true;
- boolean actual = Primes.isAPrime(numberToCheck);
- assertEquals(expected, actual);
- }
- @Test
- public void fortySevenShouldBeAPrime() {
- int numberToCheck = 47;
- boolean expected = true;
- boolean actual = Primes.isAPrime(numberToCheck);
- assertEquals(expected, actual);
- }
- }
Changing "if n % i == 0" on line 6 to "if not(n % i)" made the time drop from 4126ms to 3810ms (as the longest time).
from math import sqrt, floor def divisors(n): fact = []; for i in range(1, int(floor(sqrt(n))) + 1): if not(n % i): fact.append(i) if n / i != i: fact.append(n / i) fact.sort() return fact
- from math import sqrt, floor
- def divisors(n):
- fact = [];
- for i in range(1, int(floor(sqrt(n))) + 1):
if n % i == 0:- if not(n % i):
- fact.append(i)
- if n / i != i:
- fact.append(n / i)
- fact.sort()
- return fact
from math import sqrt, floor def divisors_check(n): fact = []; for i in range(1, int(floor(sqrt(n))) + 1): if not(n % i): fact.append(i) if n / i != i: fact.append(n / i) fact.sort() return fact test.describe( "Static Cases" ) test.it( "n = 200" ) test.assert_equals(divisors(200), [1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 200]) test.it( "n = 560") test.assert_equals(divisors(560), [1, 2, 4, 5, 7, 8, 10, 14, 16, 20, 28, 35, 40, 56, 70, 80, 112, 140, 280, 560]) test.it("n = 755") test.assert_equals(divisors(755), [1, 5, 151, 755]) from random import randint test.describe( "Random Tests") test.it ("More than 1000 Random Tests with challenging values up to 1000000000(10e9)") for h in range(0,1000): n = randint(1000, 1000000000) result = divisors_check(n) res = divisors(n) test.it("Testing for = " + str(n)) test.assert_equals(res, result)
- from math import sqrt, floor
- def divisors_check(n):
- fact = [];
- for i in range(1, int(floor(sqrt(n))) + 1):
if n % i == 0:- if not(n % i):
- fact.append(i)
- if n / i != i:
- fact.append(n / i)
- fact.sort()
- return fact
- test.describe( "Static Cases" )
- test.it( "n = 200" )
- test.assert_equals(divisors(200), [1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 200])
- test.it( "n = 560")
- test.assert_equals(divisors(560), [1, 2, 4, 5, 7, 8, 10, 14, 16, 20, 28, 35, 40, 56, 70, 80, 112, 140, 280, 560])
- test.it("n = 755")
- test.assert_equals(divisors(755), [1, 5, 151, 755])
- from random import randint
- test.describe( "Random Tests")
- test.it ("More than 1000 Random Tests with challenging values up to 1000000000(10e9)")
- for h in range(0,1000):
- n = randint(1000, 1000000000)
- result = divisors_check(n)
- res = divisors(n)
- test.it("Testing for = " + str(n))
- test.assert_equals(res, result)
Translation of henninglive's unrolled divison loop for calculating amount of digits to C#
public class Kumite { // Unrolled div loop public static int Digits(ulong n) { var l = 1; while(true) { if (n < 10) return l; if (n < 100) return l + 1; if (n < 1000) return l + 2; if (n < 10000) return l + 3; n /= 10000; l += 4; } } }
- public class Kumite
- {
- // Unrolled div loop
fn digits(mut n: u64) -> usize {let mut l = 1;loop {if n < 10 {return l;- public static int Digits(ulong n)
- {
- var l = 1;
- while(true)
- {
- if (n < 10) return l;
- if (n < 100) return l + 1;
- if (n < 1000) return l + 2;
- if (n < 10000) return l + 3;
- n /= 10000;
- l += 4;
- }
if n < 100 {return l + 1;}if n < 1000 {return l + 2;}if n < 10000 {return l + 3;}n /= 10000;l += 4;- }
- }
using NUnit.Framework; using System; public class NumberOfDigits { [Test] public void RandomTests() { var rand = new Random(); // 10 digits, is there any way to generate random ulongs without implementing lots of logic? for(var i = 1; i < 10; ++i) { // 10 numbers for(var j = 0; i < 10; ++i) { var num = rand.Next((int)Math.Pow(10, i-1), (int)Math.Pow(10, i)); Assert.That(Kumite.Digits((ulong)num), Is.EqualTo(i)); } } } [Test] public void Pow10() { Assert.That(Kumite.Digits(0), Is.EqualTo(1)); ulong n = 1; Assert.That(Kumite.Digits(1), Is.EqualTo(1)); for(var i = n; i < 20; ++i) { n *= 10; Assert.That(Kumite.Digits(n), Is.EqualTo(i + 1)); } Assert.That(Kumite.Digits(ulong.MaxValue), Is.EqualTo(20)); } [Test] public void Pow10_Minus_1() { ulong n = 1; for(var i = 1; i < 20; ++i) { n *= 10; Assert.That(Kumite.Digits(n - 1), Is.EqualTo(i)); } } [Test] public void Pow10_Half() { ulong n = 1; for(var i = n; i < 20; ++i) { n *= 10; Assert.That(Kumite.Digits(n / 2), Is.EqualTo(i)); } } }
#[test]fn pow10() {assert_eq!(digits(0), 1);let mut n = 1;assert_eq!(digits(1), 1);for i in 1..20 {n*=10;assert_eq!(digits(n), i+1);}assert_eq!(digits(std::u64::MAX), 20);}- using NUnit.Framework;
- using System;
#[test]fn pow10_minus_1() {let mut n = 1;for i in 1..20 {n*=10;assert_eq!(digits(n - 1), i);- public class NumberOfDigits
- {
- [Test]
- public void RandomTests()
- {
- var rand = new Random();
- // 10 digits, is there any way to generate random ulongs without implementing lots of logic?
- for(var i = 1; i < 10; ++i)
- {
- // 10 numbers
- for(var j = 0; i < 10; ++i)
- {
- var num = rand.Next((int)Math.Pow(10, i-1), (int)Math.Pow(10, i));
- Assert.That(Kumite.Digits((ulong)num), Is.EqualTo(i));
- }
- }
- }
}#[test]fn pow10_half() {let mut n = 1;for i in 1..20 {n*=10;assert_eq!(digits(n / 2), i);- [Test]
- public void Pow10()
- {
- Assert.That(Kumite.Digits(0), Is.EqualTo(1));
- ulong n = 1;
- Assert.That(Kumite.Digits(1), Is.EqualTo(1));
- for(var i = n; i < 20; ++i)
- {
- n *= 10;
- Assert.That(Kumite.Digits(n), Is.EqualTo(i + 1));
- }
- Assert.That(Kumite.Digits(ulong.MaxValue), Is.EqualTo(20));
- }
- [Test]
- public void Pow10_Minus_1()
- {
- ulong n = 1;
- for(var i = 1; i < 20; ++i)
- {
- n *= 10;
- Assert.That(Kumite.Digits(n - 1), Is.EqualTo(i));
- }
- }
- [Test]
- public void Pow10_Half()
- {
- ulong n = 1;
- for(var i = n; i < 20; ++i)
- {
- n *= 10;
- Assert.That(Kumite.Digits(n / 2), Is.EqualTo(i));
- }
- }
- }
Quick implementation of splitter algorithm with use of regular expressions.
Probably could be done better if offset characters would be cut off & added to result array rather than adding some random chars to _str and removing them right before returning result.
Also instead of using regexp straightforward for-loop can make it better - because of lack of positive lookbehind in js rexegp implementations results are not always OK (problem with strings which length is not divisible by _n).
function splitter (_str, _n) { _n = parseInt(_n); var offset = _n - _str.length % _n; if (offset !== _n) { _str += Math.pow(10, offset - 1); } var result = _str.split(new RegExp('(?=(?:.{' + _n + '})+$)', 'g')); if (offset !== _n) { var len = result.length, lastGroup = result[len - 1]; result[len - 1] = lastGroup.substring(0, lastGroup.length - offset); } return result; }
console.log('123456'.split(''));- function splitter (_str, _n) {
- _n = parseInt(_n);
- var offset = _n - _str.length % _n;
- if (offset !== _n) {
- _str += Math.pow(10, offset - 1);
- }
- var result = _str.split(new RegExp('(?=(?:.{' + _n + '})+$)', 'g'));
- if (offset !== _n) {
- var len = result.length,
- lastGroup = result[len - 1];
- result[len - 1] = lastGroup.substring(0, lastGroup.length - offset);
- }
- return result;
- }
var testString = '1234567890'; describe("Solution", function(){ it("should take number as second argument", function(){ Test.assertSimilar(splitter(testString, 2), ['12', '34', '56', '78', '90'], 'Split into 2-character group with use of numeric argument.'); Test.assertSimilar(splitter(testString, 3), ['123', '456', '789', '0'], 'Split into 3-character group with use of numeric argument.'); Test.assertSimilar(splitter(testString, 4), ['1234', '5678', '90'], 'Split into 4-character group with use of numeric argument.'); }); it("should take string as second argument", function(){ Test.assertSimilar(splitter(testString, '2'), ['12', '34', '56', '78', '90'], 'Split into 2-character group with use of string argument.'); Test.assertSimilar(splitter(testString, '3'), ['123', '456', '789', '0'], 'Split into 3-character group with use of string argument.'); Test.assertSimilar(splitter(testString, '4'), ['1234', '5678', '90'], 'Split into 4-character group with use of string argument.'); }); });
// TODO: Replace examples and use TDD development by writing your own tests// These are some CW specific test methods available:// Test.expect(boolean, [optional] message)// Test.assertEquals(actual, expected, [optional] message)// Test.assertSimilar(actual, expected, [optional] message)// Test.assertNotEquals(actual, expected, [optional] message)// NodeJS assert is also automatically required for you.// assert(true)// assert.strictEqual({a: 1}, {a: 1})// assert.deepEqual({a: [{b: 1}]}, {a: [{b: 1}]})// You can also use Chai (http://chaijs.com/) by requiring it yourself// var expect = require("chai").expect;// var assert = require("chai").assert;// require("chai").should();- var testString = '1234567890';
- describe("Solution", function(){
it("should test for something", function(){Test.assertEquals("actual", "actual", "This is just an example of how you can write your own TDD tests");- it("should take number as second argument", function(){
- Test.assertSimilar(splitter(testString, 2), ['12', '34', '56', '78', '90'], 'Split into 2-character group with use of numeric argument.');
- Test.assertSimilar(splitter(testString, 3), ['123', '456', '789', '0'], 'Split into 3-character group with use of numeric argument.');
- Test.assertSimilar(splitter(testString, 4), ['1234', '5678', '90'], 'Split into 4-character group with use of numeric argument.');
- });
- it("should take string as second argument", function(){
- Test.assertSimilar(splitter(testString, '2'), ['12', '34', '56', '78', '90'], 'Split into 2-character group with use of string argument.');
- Test.assertSimilar(splitter(testString, '3'), ['123', '456', '789', '0'], 'Split into 3-character group with use of string argument.');
- Test.assertSimilar(splitter(testString, '4'), ['1234', '5678', '90'], 'Split into 4-character group with use of string argument.');
- });
- });
require 'rubygems' #gems are stored in a hash with the key set to the name of the gem and the value is the version. #the trick is to get the hash to an array and join the version number to the gem name. #Feedback appreciated. def local_gems Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }.group_by{ |g| g.name } end puts local_gems.map{ |name, specs| [ name, specs.map{ |spec| spec.version.to_s }.join(',') ].join(' ') }
puts `gem list`- require 'rubygems'
- #gems are stored in a hash with the key set to the name of the gem and the value is the version.
- #the trick is to get the hash to an array and join the version number to the gem name.
- #Feedback appreciated.
- def local_gems
- Gem::Specification.sort_by{ |g| [g.name.downcase, g.version] }.group_by{ |g| g.name }
- end
- puts local_gems.map{ |name, specs|
- [
- name,
- specs.map{ |spec| spec.version.to_s }.join(',')
- ].join(' ')
- }
# TODO: Replace examples and use TDD development by writing your own tests # These are some of the methods available: # Test.expect(boolean, [optional] message) # Test.assert_equals(actual, expected, [optional] message) # Test.assert_not_equals(actual, expected, [optional] message) describe "Solution" do it "should test for something" do Test.assert_equals("actual", "expected", "This is just an example of how you can write your own TDD tests") end end
- # TODO: Replace examples and use TDD development by writing your own tests
- # These are some of the methods available:
- # Test.expect(boolean, [optional] message)
- # Test.assert_equals(actual, expected, [optional] message)
- # Test.assert_not_equals(actual, expected, [optional] message)
- describe "Solution" do
- it "should test for something" do
- Test.assert_equals("actual", "expected", "This is just an example of how you can write your own TDD tests")
- end
- end
Joeun's implementation of the pick function in the 'underscore' library. I have extended the library with a new function with a clever name. :) Called 'flick' which is the inverse of 'pick'. Some object/booger picking operations. lol
var _ = {}; // Joeun's Pick implementation (GREAT JOB!) _.pick = (target, ...keys) => { if (typeof keys[0] == 'function') { var predicate = keys[0]; keys = Object.keys(target); return keys.reduce((obj, key) => { return predicate(target[key], key, target) ? (obj[key] = target[key], obj) : obj; }, {}) } return keys.reduce((obj, key) => { return obj[key] = target[key], obj; }, {}); }; // Robert.Cutright's implementation of the inverse of pick (called flick); // In other words, you supply the keys you want to throw away. _.flick = (target, ...keys) => { if (typeof keys[0] == 'function') { var predicate = keys[0]; keys = Object.keys(target); return keys.reduce((obj, key) => { return predicate(target[key], key, target) ? obj : (obj[key] = target[key], obj); }, {}) } var obj = Object.assign({}, target); Object.keys(obj).filter(key => keys.includes(key) ? delete obj[key] : obj[key]); return obj; };
- var _ = {};
- // Joeun's Pick implementation (GREAT JOB!)
- _.pick = (target, ...keys) => {
- if (typeof keys[0] == 'function') {
- var predicate = keys[0];
- keys = Object.keys(target);
- return keys.reduce((obj, key) => {
- return predicate(target[key], key, target) ? (obj[key] = target[key], obj) : obj;
- }, {})
- }
- return keys.reduce((obj, key) => {
- return obj[key] = target[key], obj;
- }, {});
};- };
- // Robert.Cutright's implementation of the inverse of pick (called flick);
- // In other words, you supply the keys you want to throw away.
- _.flick = (target, ...keys) => {
- if (typeof keys[0] == 'function') {
- var predicate = keys[0];
- keys = Object.keys(target);
- return keys.reduce((obj, key) => {
- return predicate(target[key], key, target) ? obj : (obj[key] = target[key], obj);
- }, {})
- }
- var obj = Object.assign({}, target);
- Object.keys(obj).filter(key => keys.includes(key) ? delete obj[key] : obj[key]);
- return obj;
- };
var result; var testObj = {name: 'moe', age: 50, userid: 'moe1'}; // _.pick Tests result = _.pick(testObj, 'name', 'age'); Test.assertSimilar(result, {name: 'moe', age: 50}); result = _.pick(testObj, function(value, key, object) { return typeof value == 'number'; }); Test.assertSimilar(result, {age: 50}); // _.flick Tests result = _.flick(testObj, 'name', 'age'); Test.assertSimilar(result, {userid: 'moe1'}); result = _.flick(testObj, function(value, key, object) { return typeof value == 'number'; }); Test.assertSimilar(result, {name: 'moe', userid: 'moe1'});
- var result;
result = _.pick({name: 'moe', age: 50, userid: 'moe1'}, 'name', 'age');- var testObj = {name: 'moe', age: 50, userid: 'moe1'};
- // _.pick Tests
- result = _.pick(testObj, 'name', 'age');
- Test.assertSimilar(result, {name: 'moe', age: 50});
result = _.pick({name: 'moe', age: 50, userid: 'moe1'}, function(value, key, object) {- result = _.pick(testObj, function(value, key, object) {
- return typeof value == 'number';
- });
- Test.assertSimilar(result, {age: 50});
- // _.flick Tests
- result = _.flick(testObj, 'name', 'age');
- Test.assertSimilar(result, {userid: 'moe1'});
- result = _.flick(testObj, function(value, key, object) {
- return typeof value == 'number';
- });
Test.assertSimilar(result, {age: 50});- Test.assertSimilar(result, {name: 'moe', userid: 'moe1'});
using System; class Kata { public static string Main(string greeting, string language) { Console.WriteLine(Greeting(greeting, language)); return Greeting(greeting, language); } public static string Greeting(string greeting, string language) => $"{greeting} {language}!"; }
- using System;
- class Kata {
- public static string Main(string greeting, string language) {
- Console.WriteLine(Greeting(greeting, language));
- return Greeting(greeting, language);
- }
public static string Greeting(string greeting, string language) => $"{greeting}, {language}!";- public static string Greeting(string greeting, string language) => $"{greeting} {language}!";
- }
using NUnit.Framework; using System; using System.IO; [TestFixture] public class KataTests { [Test] public void Prints_expected_output() { string language = "C#"; string greeting = "Hello"; var originalConsoleOut = Console.Out; // preserve the original stream var writer = new StringWriter(); Console.SetOut(writer); //ready to listen to console Kata.Main(greeting, language); writer.Flush(); // when you're done, make sure everything is written out var myString = writer.GetStringBuilder().ToString(); Console.SetOut(originalConsoleOut); // restore Console output Assert.AreEqual(greeting + " " + language + "!\n" , myString); } }
- using NUnit.Framework;
- using System;
- using System.IO;
- [TestFixture]
- public class KataTests
- {
- [Test]
- public void Prints_expected_output()
- {
- string language = "C#";
- string greeting = "Hello";
- var originalConsoleOut = Console.Out; // preserve the original stream
- var writer = new StringWriter();
- Console.SetOut(writer);
- //ready to listen to console
- Kata.Main(greeting, language);
- writer.Flush(); // when you're done, make sure everything is written out
- var myString = writer.GetStringBuilder().ToString();
- Console.SetOut(originalConsoleOut); // restore Console output
Assert.AreEqual(greeting + ", " + language + "!" , myString);- Assert.AreEqual(greeting + " " + language + "!
- " , myString);
- }
- }
For greater efficiency, I give you a lookup table that cuts down execution time by up to 40%!
6035ms from 10958ms
def factorial(x): result = 1 if len(factorial.lookup) <= x: factorial.lookup = [1] * (x + 1) for i in range(2, x + 1): result *= i factorial.lookup[i] = result return result return factorial.lookup[x] factorial.lookup = []
- def factorial(x):
- result = 1
for i in range(2, x + 1):result *= ireturn result- if len(factorial.lookup) <= x:
- factorial.lookup = [1] * (x + 1)
- for i in range(2, x + 1):
- result *= i
- factorial.lookup[i] = result
- return result
- return factorial.lookup[x]
- factorial.lookup = []
test.assert_equals(factorial(0), 1, "Wrong calculation!") test.assert_equals(factorial(6), 720, "Wrong calculation!") test.assert_equals(factorial(10), 3628800, "Wrong calculation!") test.assert_equals(factorial(575), 7390441777119141443401630031209136886962206496218349477250383820672630038291650027199276041379604977613822300356137582483671094754462433862060420213421726875538872643113190344171733528305637229616079272474914553779262327068944082289063739293899147664296334411304178909628922640478036480043123897889808217914505951696824443963735666011997300563726162488291847603301888156744760938159790313291832262355081128621083112904233051689362142319752603260694085989673295856537174842402003481382867705729452057147119996957618169629160344929741174366305002153417530459036888195944818660236990764932793659814680008188556982327000036545187924637634043397381072990487999060488419647054718909159182929734848951186267933465552241358089972644314912779875596613356687641502422935454290075104768112364758258035567841598815922483405788774534926446224281594855206880491390490360997335630051293435175879442130205423487684712608957346067905111895580651990754324329721972918043847654333624842456491357161085321228947774542348951852384127552202491794571382429220625253786820865579682842442921219893791367295048327627070500582137100660494127735634830649073758502862713646164779092559240920618025632380925462715374385034690560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!") for _ in range(1000): test.assert_equals(factorial(1500), 48119977967797748601669900935813797818348080406726138081308559411630575189001095591292230585206733851868464009619343585194052091124618166270271481881393331431627962810299844149333789044689395510487167879769325303699470467829234399263326545652860748605075746366928323606645492277541120083438086727369377887676000211405318480244354207419604864176969950581435222198851194568984095705945549589054568321792338919149442985919957734792959402499096845643020401869381175603964424333222114125974374817804242633309769804293952870034619354125014210045647664063240162007560108665290568646128342557147350985358724154623253371867470765120422073867963935775258692109753041762094343569050497470353531764481503174750911858230906998361066084787758316110585736013365377431860738572261325738233656835271947352695180865573043834027955539012765489372645042504406597752357481931532872356635411224578334040522294746402829585458478708778346379431862368824819009177091444034885941394319343910223168655869761799669075059527608502465593181398566214786801211651657222004123456498258513120359126022843038535083709796101565934859483203933443308601475813108363074118562404412420191947127585482919172173045961122122701434297870691932154082986945954748251105782181586397275820342101470457300633590139512919549474113721711616912519714191760699935509810254849967087635936181176363954224186031346682928878492872249485456690138831610135377916327940503701400290125509132140782614640495733518048670983360134097860364762638658894873174499870133559364805443430831459505987809215393353387232078177562975021460595422358573128085417162336030235138652735438053034531962620811566019896879275257163988352090874930346115518331202927263708446729394381879888839549731876978682249320628599631628662375508826209854754631984276392670919216923002770077734756077549035942976209159416211581439461484509549370357486770276807687544580164314647595031368948490282897173328013518435758700056425922638411889496527975846052717958044813737086806600171993703579485864029383208714528950303253881360812631162134750100307772634337467012820470715650810714689905121432259528505483053930402217400686061612471659630192434864094539828085677465383026128353771071152304197549798870706139893609140045659756285435787771636258253666592102151236142132724425850991205720020493660580896600891888594659612927724357866265934517615841298789154462249169688860092640284756382431746120357767933119589280468687348061788072986362788582227019465263474828590646048451070702923434422714349595857654843699542321849363652767771978314681013589442955219879702008068934096624650625769705233333462826013860098698155180331145365652453482955497979915586438474687345677874451117702250441711504844638414485210092261397271970571029038581873069951161330495772310508760528249706514238384269808639507080418298318311361373628512041716415196868334254119137139589149597210032153545941114666530498906529240798164804007394775927836045668573993316428972539932745757171947402454257142633700815922407278403640595355142075599446056337986717212316223257763412164180899532722039383244462511410346646148863397237096276822656157561194665545757017429842404840309758925618650507921043007241637877939825811059339138925526124514467627126548126795078784022672860886251974581362141782786407402896309678008909663263987018538107050886193489012497405005820727271232733728141775132722013860591169620692789290456794698409808557447756701311883266010859016027592252397754508251628808293537776536569608111330584797160694847898923196743970244451842702266403326317319092117151143971679500042590269255093130215984418097418435474300467281949798227102529873732749027992079700287275900856241172902880909546551703263202853584498085358955307673717177961902081098618729046348849060249600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!") for _ in range(1000): test.assert_equals(factorial(4000), 18288019515140650133147431755739190442173777107304392197064526954208959797973177364850370286870484107336443041569285571754672461861543557333942615617956996716745284831597317498818760937482804980419576512948720610558928129788097800620593429537705326740624453884285091743951756746144447362378722469436194575929579900114212973360658998073977714697261205048663725936337490404066097966637170254021348800944280342285355946649681316260163459743803577175903394733170076841764779082166891184529324230033414145497801832598218518406552257097392530024582738982919104406782168708871495603501905867399966298798534877747923179195791416504408054878974770308650707120878837624986576073340449414854578367383301715706358194127400849855604080473305196833482408079420964275187538889115296655522397723924887154624810659788321005620558369604778657904771918388054319251513981954296741688447246185021250402225010116433016818588036690180177691461779713104301640395708274734701186772756966064611023656528765138735704190876200697145804692125236821066805337175220605745377557452592208653939853278523841448314026548802309860391087939783218946129582647928430739985554883806198749831633640196211202756086016039171607744078776876219661603702759454887945247605749205543464095883664514960293873244842409803801480566600124415293789831496309554117113888561569494314926134470477513516416560102984058751906208865570183683850791317395702861350821464653600469443279077733978568711404244774089509216727922510660941411716412467443445414001188915966547283773988670739792818897314762082568914041952211779194055311405259158538932388745292324386826830135904886472292289993848482289254307628467614523292519222687689180219788377184005246290896703260524910362136627321135976515358528150143796798116836263053229733971612275184896139539613129329008449214723196703789119820971205922195513915546814704778682373487718946560822811623038853887054357316290622378472322045316639418491798517077275839637525427601452961835674484434498885698840692468550825765131610925966585339561854456154229048295742274725126218799745448031391826295221114381890600683208441558088271228618006589059444108806652992787854634497487158675770983422610936590600627170500972481399444145398522756870626097250230229195799277299921844954715690883242553569256657132515663544931830393317518828986443942138971609142621397646808351809694603734872977984148002699965137870448199866167162949256435040416146886823942144459105175033488395869910405207521329016842673168563837531518918339627724066152933627236730561155418227888673513937454508103826102827706121560330906016404162420051373313654570111102003319577878502216919170112074608722852376799943191590480651623958062982829452035227119036502426583752512199824089725611711059153935434418985109241404135069047109527514730648502064630431371185922523036941621026392783813435540195800531988645430344745298845640017082732623248838473771603478336326662579219137601422632057648758807935233915527562817942378675243919886800056209434731407685691942327092464101136254795499159351103542747723434544436366313104996373661654989465498180892716462805042227038222104784062626027480151567377841821316292095295686368619300417863327530764301323081902435971165925163513225511176258919471673437553320934916910573999020966087207663133871516530391787535755420348174519954013015999193335205032571176460105005716115305748669364682675265014310223271762807620242805617435594927890676408953057384890719681225840400396698155624793888816156585043604782961704971397764959404751358445856914581957186533573207690355894150776647727994156425641953755517727965486096675384222232344185537279888780570854092084221993660761154788359777439798490851148031275123759286793224660188593768897291749180357297185650430735063126035278321749629995702200115722386600046772883018963166273463715186812543356173550341233310175600817771447170656517505385258772069067139665478506263898380526394388218036388768999161538645432932116471146392562992204259450889291928261780531925618148311151259088519869787637913607866079920830781433275298468534248595471485354420794089854693167644320115900404444471266030942746376074187982809857292874382829734306879420308783010740784767155894363033186129183748698373599293267795620690003900348542140553208244771165593739117369452474295075445169488356550100854423929030967163401348223503674045821834526710830392520955478859202303175309815706259592416130388770535449570146586161954289529234209342432075461261173246383180702862172009624828852517861214008242944903162464816939278645210656431141653019224783906038062818006434258491952705341708781231767324026544165240012431457995565227331912056216396141277926932316783631899833106810492890045890947294731794016389385348294079360921757589715698098491612254898203787546124091057862387229987442131738499764391062422228395736099751277880661280909246369674792326056952220508861243875642482808175793303703933394191224832165950388337931626643339913192088808753619030386928808349931733881036690498513779587801764477865791351420222949860738228995728065763459283625096944678593378349990211317403358327367677358882377095918185840441346045760435580063918587956888086127034558064154832456098224664532422114583653763989534559801683261113731162039500068729224661509382267286483841867542303955164213391663536072749966590737898408144092699675796793165775891429992491955485860639629542416955757565163223827874193321274119938618709482020627749094917473754346320653165690129809741806883246764053966717253521140010801409998318494470531219051920354752556183478378238398583402765337923843167749738355049636714529840534145950376598809459294819192486096200503652538835417613002983933634477053826438814791235363934440952835213240806543802505241445900981152753843778634021300832293332432473400040109754281828950625464331409151961292319287863535740382445771128522343533054993071872524564127962306298218521662304206610010638488461150361786151832595182055013210238035059473479841417644445066550217093994746959565730463201996845756999575031950401331385688683576883429289274419202816101239071817771853612534620088858074904095239406471009098851796038360101243053736361346640211872570375441319261567131238168652234864182359667285536913841122976956009892970909409178865928472056691904571596961458646895132972589012090613887584436018692038947475932753085268106507554394567201654757930957224629573401948677157237825005540282635839895509019254240256916422227590032685003087320017232658420681209681389364174854034319152111706246564733896551636271748411627920466475472421243033805492052542237647091252577811952376244836844025673570936216945539206875730684120187779664758451508678786539887154966732995692212544207529457534936853900663520665102592278581210192104846016594846265525000394264201946315492667174670489454576610993722063668720936949698308641684437046485292906040368218708947194882991333823400676584552108673913669306118549159369734833071319506680872661886898225398171896329288732499509337836463164384614967690283284184136334006184670970038275153458133098776493171693249836721707632973537518273692928527497068121779606865163943692606596848941143683627629169873171114739189794632775706536177409526869936538136348369630762610163490694986911903178859927739423796596582439105912599204583810744740479342404550513976713360591833475711496976836332005885151231030818986389033126325119226309584818058301429763149472903925739659774337307109687940297813700796873400566095281249251559137923743113469044584820584542770746490047535898370961450995287930441328833542933636539386097851378739174078158132593877463567524868470795313740375647059352650583871001646082364842709333314532933141725314262510333047099681128329792983694287727106008519184538377065089964546579000542260452715147077137452076302879112802094308224402060706282308208678850263037733351444756065285721900833083634023860920356321356382318484421995141074387149942542550133039926139155010190614633196727199469768170121209097613598302048321148497175007150184555423280152476407230065108963493864309805262458731715886593175689747530567359088332598961192319881186961400055356294945140450806114214490420494488195417136403967132286869444062615622815233336396279517485469862880809956041938378161336156979526713793454354319018535526139196959277008828634440008764782171726908279132449346924807112458895951881542382952497102061566169481361027449429416228859029591798532192088531772405831332410104172391828682208239266557146168642210154401086974397003647170356217905465594944933170065175291981240572835024374361017977695084363373226470846255498368067535698751768103817520605779489720985090002595078926475029239124403277040719184010486962844211160986922952144938430963756963408787147933184107904312838985994963982784496688190643908936394858404598837762653245968848299901455260080572627872653099337092686312650606546084656202210845053932679131706841390889951865628810708670194485207654079244417321332232196041180225814997707988397637369268804955010409293139079608620689856756139863786355461818276369292665568749282154818479663283704713663666842236273009790537968973379093662517795316051746410279831975339791651704861188979834156418998505732384020730350075052669695594594753081616632885311572351609352631187129393729557398993321794518158269658073683417584260274184235030846683698193879109933863561435059993549597333514217973995915742796206889856584584493875193805504685107321011420502217815128118404137521250590361329385146997427292035829509205811367395885622247504950811752188165627552137681095618860955664505372763469788466067973748736658759105548049054658237200096293754479296344115915560231138432518248450383276234795400180535655551222536669390799317067896797756236783441752907948891802488298281245615590113512482344591092230909649423933991714557108941323849548468680509335203770970493785006636718394242326057416155509029270066096293813080877339787718442773014833232754755736783313789547145535129557193581885962158684756484475219230828423777756012721234731368785218564362953263092286535139160440838713013861328416662947756104857391740722209360021068158824717926850831589591367302143596625426553706038593255843919505223140871543995210720444637571268651195165483531243799087083070940544241515809139594158704843980567202482856647644447362604252961907705738740354460336586792214638225365973993001974668174157206242597452556046629209551599663117912609702944345176608757619561247872050409609062772362769045711709729061066411540898769707847042980034982033351136308779676287974627667703893888026848748953201438481632037717854462054861859986684636917120883602793194058658599425778515519713798214407689849211487929150179918547200558584524139792439377469676039518101451697712860634235352474290575260172151562129240720796835619967878383018961055921622371480562682714603085506932806187937976625431071742833007749235636990700120567425836156233607547500827789537909071263596294926763891075439575973972560478399510790078797663071024149826759934524980569432847819403219226207098701759952415628476519584752248050578584198211799092030838909208236225141975964892778944163008811179723219354847713753084628828883321692575327835658786892010648865205021985527642612795652759365359359048052205587306960853879351302215329380382709288672566169552660197788055450054177652374955319992805345989662399494012874012278677451052584166987084866267245492968785684175508510910492913793478551456991152291522750377308973310200505007906906671435839262115546753934391579860133029544403932422271218975046896384482252108820546415274174791693426071019927278518520520164621127271231748277979659289204850823018535192067323372368224831050642902153626845618478009622824733150764188329304815843651352730897836727021023023627320228373645802602496000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!")
- test.assert_equals(factorial(0), 1, "Wrong calculation!")
- test.assert_equals(factorial(6), 720, "Wrong calculation!")
- test.assert_equals(factorial(10), 3628800, "Wrong calculation!")
- test.assert_equals(factorial(575), 7390441777119141443401630031209136886962206496218349477250383820672630038291650027199276041379604977613822300356137582483671094754462433862060420213421726875538872643113190344171733528305637229616079272474914553779262327068944082289063739293899147664296334411304178909628922640478036480043123897889808217914505951696824443963735666011997300563726162488291847603301888156744760938159790313291832262355081128621083112904233051689362142319752603260694085989673295856537174842402003481382867705729452057147119996957618169629160344929741174366305002153417530459036888195944818660236990764932793659814680008188556982327000036545187924637634043397381072990487999060488419647054718909159182929734848951186267933465552241358089972644314912779875596613356687641502422935454290075104768112364758258035567841598815922483405788774534926446224281594855206880491390490360997335630051293435175879442130205423487684712608957346067905111895580651990754324329721972918043847654333624842456491357161085321228947774542348951852384127552202491794571382429220625253786820865579682842442921219893791367295048327627070500582137100660494127735634830649073758502862713646164779092559240920618025632380925462715374385034690560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!")
test.assert_equals(factorial(1500), 48119977967797748601669900935813797818348080406726138081308559411630575189001095591292230585206733851868464009619343585194052091124618166270271481881393331431627962810299844149333789044689395510487167879769325303699470467829234399263326545652860748605075746366928323606645492277541120083438086727369377887676000211405318480244354207419604864176969950581435222198851194568984095705945549589054568321792338919149442985919957734792959402499096845643020401869381175603964424333222114125974374817804242633309769804293952870034619354125014210045647664063240162007560108665290568646128342557147350985358724154623253371867470765120422073867963935775258692109753041762094343569050497470353531764481503174750911858230906998361066084787758316110585736013365377431860738572261325738233656835271947352695180865573043834027955539012765489372645042504406597752357481931532872356635411224578334040522294746402829585458478708778346379431862368824819009177091444034885941394319343910223168655869761799669075059527608502465593181398566214786801211651657222004123456498258513120359126022843038535083709796101565934859483203933443308601475813108363074118562404412420191947127585482919172173045961122122701434297870691932154082986945954748251105782181586397275820342101470457300633590139512919549474113721711616912519714191760699935509810254849967087635936181176363954224186031346682928878492872249485456690138831610135377916327940503701400290125509132140782614640495733518048670983360134097860364762638658894873174499870133559364805443430831459505987809215393353387232078177562975021460595422358573128085417162336030235138652735438053034531962620811566019896879275257163988352090874930346115518331202927263708446729394381879888839549731876978682249320628599631628662375508826209854754631984276392670919216923002770077734756077549035942976209159416211581439461484509549370357486770276807687544580164314647595031368948490282897173328013518435758700056425922638411889496527975846052717958044813737086806600171993703579485864029383208714528950303253881360812631162134750100307772634337467012820470715650810714689905121432259528505483053930402217400686061612471659630192434864094539828085677465383026128353771071152304197549798870706139893609140045659756285435787771636258253666592102151236142132724425850991205720020493660580896600891888594659612927724357866265934517615841298789154462249169688860092640284756382431746120357767933119589280468687348061788072986362788582227019465263474828590646048451070702923434422714349595857654843699542321849363652767771978314681013589442955219879702008068934096624650625769705233333462826013860098698155180331145365652453482955497979915586438474687345677874451117702250441711504844638414485210092261397271970571029038581873069951161330495772310508760528249706514238384269808639507080418298318311361373628512041716415196868334254119137139589149597210032153545941114666530498906529240798164804007394775927836045668573993316428972539932745757171947402454257142633700815922407278403640595355142075599446056337986717212316223257763412164180899532722039383244462511410346646148863397237096276822656157561194665545757017429842404840309758925618650507921043007241637877939825811059339138925526124514467627126548126795078784022672860886251974581362141782786407402896309678008909663263987018538107050886193489012497405005820727271232733728141775132722013860591169620692789290456794698409808557447756701311883266010859016027592252397754508251628808293537776536569608111330584797160694847898923196743970244451842702266403326317319092117151143971679500042590269255093130215984418097418435474300467281949798227102529873732749027992079700287275900856241172902880909546551703263202853584498085358955307673717177961902081098618729046348849060249600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!")- for _ in range(1000): test.assert_equals(factorial(1500), 48119977967797748601669900935813797818348080406726138081308559411630575189001095591292230585206733851868464009619343585194052091124618166270271481881393331431627962810299844149333789044689395510487167879769325303699470467829234399263326545652860748605075746366928323606645492277541120083438086727369377887676000211405318480244354207419604864176969950581435222198851194568984095705945549589054568321792338919149442985919957734792959402499096845643020401869381175603964424333222114125974374817804242633309769804293952870034619354125014210045647664063240162007560108665290568646128342557147350985358724154623253371867470765120422073867963935775258692109753041762094343569050497470353531764481503174750911858230906998361066084787758316110585736013365377431860738572261325738233656835271947352695180865573043834027955539012765489372645042504406597752357481931532872356635411224578334040522294746402829585458478708778346379431862368824819009177091444034885941394319343910223168655869761799669075059527608502465593181398566214786801211651657222004123456498258513120359126022843038535083709796101565934859483203933443308601475813108363074118562404412420191947127585482919172173045961122122701434297870691932154082986945954748251105782181586397275820342101470457300633590139512919549474113721711616912519714191760699935509810254849967087635936181176363954224186031346682928878492872249485456690138831610135377916327940503701400290125509132140782614640495733518048670983360134097860364762638658894873174499870133559364805443430831459505987809215393353387232078177562975021460595422358573128085417162336030235138652735438053034531962620811566019896879275257163988352090874930346115518331202927263708446729394381879888839549731876978682249320628599631628662375508826209854754631984276392670919216923002770077734756077549035942976209159416211581439461484509549370357486770276807687544580164314647595031368948490282897173328013518435758700056425922638411889496527975846052717958044813737086806600171993703579485864029383208714528950303253881360812631162134750100307772634337467012820470715650810714689905121432259528505483053930402217400686061612471659630192434864094539828085677465383026128353771071152304197549798870706139893609140045659756285435787771636258253666592102151236142132724425850991205720020493660580896600891888594659612927724357866265934517615841298789154462249169688860092640284756382431746120357767933119589280468687348061788072986362788582227019465263474828590646048451070702923434422714349595857654843699542321849363652767771978314681013589442955219879702008068934096624650625769705233333462826013860098698155180331145365652453482955497979915586438474687345677874451117702250441711504844638414485210092261397271970571029038581873069951161330495772310508760528249706514238384269808639507080418298318311361373628512041716415196868334254119137139589149597210032153545941114666530498906529240798164804007394775927836045668573993316428972539932745757171947402454257142633700815922407278403640595355142075599446056337986717212316223257763412164180899532722039383244462511410346646148863397237096276822656157561194665545757017429842404840309758925618650507921043007241637877939825811059339138925526124514467627126548126795078784022672860886251974581362141782786407402896309678008909663263987018538107050886193489012497405005820727271232733728141775132722013860591169620692789290456794698409808557447756701311883266010859016027592252397754508251628808293537776536569608111330584797160694847898923196743970244451842702266403326317319092117151143971679500042590269255093130215984418097418435474300467281949798227102529873732749027992079700287275900856241172902880909546551703263202853584498085358955307673717177961902081098618729046348849060249600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!")
- for _ in range(1000): test.assert_equals(factorial(4000), 18288019515140650133147431755739190442173777107304392197064526954208959797973177364850370286870484107336443041569285571754672461861543557333942615617956996716745284831597317498818760937482804980419576512948720610558928129788097800620593429537705326740624453884285091743951756746144447362378722469436194575929579900114212973360658998073977714697261205048663725936337490404066097966637170254021348800944280342285355946649681316260163459743803577175903394733170076841764779082166891184529324230033414145497801832598218518406552257097392530024582738982919104406782168708871495603501905867399966298798534877747923179195791416504408054878974770308650707120878837624986576073340449414854578367383301715706358194127400849855604080473305196833482408079420964275187538889115296655522397723924887154624810659788321005620558369604778657904771918388054319251513981954296741688447246185021250402225010116433016818588036690180177691461779713104301640395708274734701186772756966064611023656528765138735704190876200697145804692125236821066805337175220605745377557452592208653939853278523841448314026548802309860391087939783218946129582647928430739985554883806198749831633640196211202756086016039171607744078776876219661603702759454887945247605749205543464095883664514960293873244842409803801480566600124415293789831496309554117113888561569494314926134470477513516416560102984058751906208865570183683850791317395702861350821464653600469443279077733978568711404244774089509216727922510660941411716412467443445414001188915966547283773988670739792818897314762082568914041952211779194055311405259158538932388745292324386826830135904886472292289993848482289254307628467614523292519222687689180219788377184005246290896703260524910362136627321135976515358528150143796798116836263053229733971612275184896139539613129329008449214723196703789119820971205922195513915546814704778682373487718946560822811623038853887054357316290622378472322045316639418491798517077275839637525427601452961835674484434498885698840692468550825765131610925966585339561854456154229048295742274725126218799745448031391826295221114381890600683208441558088271228618006589059444108806652992787854634497487158675770983422610936590600627170500972481399444145398522756870626097250230229195799277299921844954715690883242553569256657132515663544931830393317518828986443942138971609142621397646808351809694603734872977984148002699965137870448199866167162949256435040416146886823942144459105175033488395869910405207521329016842673168563837531518918339627724066152933627236730561155418227888673513937454508103826102827706121560330906016404162420051373313654570111102003319577878502216919170112074608722852376799943191590480651623958062982829452035227119036502426583752512199824089725611711059153935434418985109241404135069047109527514730648502064630431371185922523036941621026392783813435540195800531988645430344745298845640017082732623248838473771603478336326662579219137601422632057648758807935233915527562817942378675243919886800056209434731407685691942327092464101136254795499159351103542747723434544436366313104996373661654989465498180892716462805042227038222104784062626027480151567377841821316292095295686368619300417863327530764301323081902435971165925163513225511176258919471673437553320934916910573999020966087207663133871516530391787535755420348174519954013015999193335205032571176460105005716115305748669364682675265014310223271762807620242805617435594927890676408953057384890719681225840400396698155624793888816156585043604782961704971397764959404751358445856914581957186533573207690355894150776647727994156425641953755517727965486096675384222232344185537279888780570854092084221993660761154788359777439798490851148031275123759286793224660188593768897291749180357297185650430735063126035278321749629995702200115722386600046772883018963166273463715186812543356173550341233310175600817771447170656517505385258772069067139665478506263898380526394388218036388768999161538645432932116471146392562992204259450889291928261780531925618148311151259088519869787637913607866079920830781433275298468534248595471485354420794089854693167644320115900404444471266030942746376074187982809857292874382829734306879420308783010740784767155894363033186129183748698373599293267795620690003900348542140553208244771165593739117369452474295075445169488356550100854423929030967163401348223503674045821834526710830392520955478859202303175309815706259592416130388770535449570146586161954289529234209342432075461261173246383180702862172009624828852517861214008242944903162464816939278645210656431141653019224783906038062818006434258491952705341708781231767324026544165240012431457995565227331912056216396141277926932316783631899833106810492890045890947294731794016389385348294079360921757589715698098491612254898203787546124091057862387229987442131738499764391062422228395736099751277880661280909246369674792326056952220508861243875642482808175793303703933394191224832165950388337931626643339913192088808753619030386928808349931733881036690498513779587801764477865791351420222949860738228995728065763459283625096944678593378349990211317403358327367677358882377095918185840441346045760435580063918587956888086127034558064154832456098224664532422114583653763989534559801683261113731162039500068729224661509382267286483841867542303955164213391663536072749966590737898408144092699675796793165775891429992491955485860639629542416955757565163223827874193321274119938618709482020627749094917473754346320653165690129809741806883246764053966717253521140010801409998318494470531219051920354752556183478378238398583402765337923843167749738355049636714529840534145950376598809459294819192486096200503652538835417613002983933634477053826438814791235363934440952835213240806543802505241445900981152753843778634021300832293332432473400040109754281828950625464331409151961292319287863535740382445771128522343533054993071872524564127962306298218521662304206610010638488461150361786151832595182055013210238035059473479841417644445066550217093994746959565730463201996845756999575031950401331385688683576883429289274419202816101239071817771853612534620088858074904095239406471009098851796038360101243053736361346640211872570375441319261567131238168652234864182359667285536913841122976956009892970909409178865928472056691904571596961458646895132972589012090613887584436018692038947475932753085268106507554394567201654757930957224629573401948677157237825005540282635839895509019254240256916422227590032685003087320017232658420681209681389364174854034319152111706246564733896551636271748411627920466475472421243033805492052542237647091252577811952376244836844025673570936216945539206875730684120187779664758451508678786539887154966732995692212544207529457534936853900663520665102592278581210192104846016594846265525000394264201946315492667174670489454576610993722063668720936949698308641684437046485292906040368218708947194882991333823400676584552108673913669306118549159369734833071319506680872661886898225398171896329288732499509337836463164384614967690283284184136334006184670970038275153458133098776493171693249836721707632973537518273692928527497068121779606865163943692606596848941143683627629169873171114739189794632775706536177409526869936538136348369630762610163490694986911903178859927739423796596582439105912599204583810744740479342404550513976713360591833475711496976836332005885151231030818986389033126325119226309584818058301429763149472903925739659774337307109687940297813700796873400566095281249251559137923743113469044584820584542770746490047535898370961450995287930441328833542933636539386097851378739174078158132593877463567524868470795313740375647059352650583871001646082364842709333314532933141725314262510333047099681128329792983694287727106008519184538377065089964546579000542260452715147077137452076302879112802094308224402060706282308208678850263037733351444756065285721900833083634023860920356321356382318484421995141074387149942542550133039926139155010190614633196727199469768170121209097613598302048321148497175007150184555423280152476407230065108963493864309805262458731715886593175689747530567359088332598961192319881186961400055356294945140450806114214490420494488195417136403967132286869444062615622815233336396279517485469862880809956041938378161336156979526713793454354319018535526139196959277008828634440008764782171726908279132449346924807112458895951881542382952497102061566169481361027449429416228859029591798532192088531772405831332410104172391828682208239266557146168642210154401086974397003647170356217905465594944933170065175291981240572835024374361017977695084363373226470846255498368067535698751768103817520605779489720985090002595078926475029239124403277040719184010486962844211160986922952144938430963756963408787147933184107904312838985994963982784496688190643908936394858404598837762653245968848299901455260080572627872653099337092686312650606546084656202210845053932679131706841390889951865628810708670194485207654079244417321332232196041180225814997707988397637369268804955010409293139079608620689856756139863786355461818276369292665568749282154818479663283704713663666842236273009790537968973379093662517795316051746410279831975339791651704861188979834156418998505732384020730350075052669695594594753081616632885311572351609352631187129393729557398993321794518158269658073683417584260274184235030846683698193879109933863561435059993549597333514217973995915742796206889856584584493875193805504685107321011420502217815128118404137521250590361329385146997427292035829509205811367395885622247504950811752188165627552137681095618860955664505372763469788466067973748736658759105548049054658237200096293754479296344115915560231138432518248450383276234795400180535655551222536669390799317067896797756236783441752907948891802488298281245615590113512482344591092230909649423933991714557108941323849548468680509335203770970493785006636718394242326057416155509029270066096293813080877339787718442773014833232754755736783313789547145535129557193581885962158684756484475219230828423777756012721234731368785218564362953263092286535139160440838713013861328416662947756104857391740722209360021068158824717926850831589591367302143596625426553706038593255843919505223140871543995210720444637571268651195165483531243799087083070940544241515809139594158704843980567202482856647644447362604252961907705738740354460336586792214638225365973993001974668174157206242597452556046629209551599663117912609702944345176608757619561247872050409609062772362769045711709729061066411540898769707847042980034982033351136308779676287974627667703893888026848748953201438481632037717854462054861859986684636917120883602793194058658599425778515519713798214407689849211487929150179918547200558584524139792439377469676039518101451697712860634235352474290575260172151562129240720796835619967878383018961055921622371480562682714603085506932806187937976625431071742833007749235636990700120567425836156233607547500827789537909071263596294926763891075439575973972560478399510790078797663071024149826759934524980569432847819403219226207098701759952415628476519584752248050578584198211799092030838909208236225141975964892778944163008811179723219354847713753084628828883321692575327835658786892010648865205021985527642612795652759365359359048052205587306960853879351302215329380382709288672566169552660197788055450054177652374955319992805345989662399494012874012278677451052584166987084866267245492968785684175508510910492913793478551456991152291522750377308973310200505007906906671435839262115546753934391579860133029544403932422271218975046896384482252108820546415274174791693426071019927278518520520164621127271231748277979659289204850823018535192067323372368224831050642902153626845618478009622824733150764188329304815843651352730897836727021023023627320228373645802602496000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, "Wrong calculation!")