diff --git a/CourseApp.Tests/Module2/BubbleSortTest.cs b/CourseApp.Tests/Module2/BubbleSortTest.cs index 8a9b192..80d75bb 100644 --- a/CourseApp.Tests/Module2/BubbleSortTest.cs +++ b/CourseApp.Tests/Module2/BubbleSortTest.cs @@ -1,18 +1,22 @@ -using System; -using System.IO; -using Xunit; -using CourseApp.Module2; - -namespace CourseApp.Tests.Module2 +namespace CourseApp.Tests.Module2 { + using System; + using System.IO; + using CourseApp.Module2; + using Xunit; + [Collection("Sequential")] public class BubbleSortTest : IDisposable { - private const string Inp1 = @"7 -5 1 7 3 9 4 1"; + private const string Inp1 = @"4 +4 3 2 1"; - private const string Inp2 = @"3 --10 7 2"; + private const string Out1 = @"3 4 2 1 +3 2 4 1 +3 2 1 4 +2 3 1 4 +2 1 3 4 +1 2 3 4"; public void Dispose() { @@ -24,8 +28,7 @@ public void Dispose() } [Theory] - [InlineData(Inp1, "1 1 3 4 5 7 9")] - [InlineData(Inp2, "-10 2 7")] + [InlineData(Inp1, Out1)] public void Test1(string input, string expected) { var stringWriter = new StringWriter(); @@ -35,11 +38,13 @@ public void Test1(string input, string expected) Console.SetIn(stringReader); // act - BubbleSort.BubbleSortMethod(); + BubbleSort.SortOff(); // assert var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); - Assert.Equal($"{expected}", output[0]); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); } } -} +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/DifferentCountTest.cs b/CourseApp.Tests/Module2/DifferentCountTest.cs new file mode 100644 index 0000000..b06582e --- /dev/null +++ b/CourseApp.Tests/Module2/DifferentCountTest.cs @@ -0,0 +1,45 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class DifferentCountTest : IDisposable + { + private const string Inp1 = @"5 +1 0 1 2 0"; + + private const string Out1 = @"3"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp1, Out1)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + DifferentCount.CountDifferent(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/InversionCountTest.cs b/CourseApp.Tests/Module2/InversionCountTest.cs new file mode 100644 index 0000000..82a3ea4 --- /dev/null +++ b/CourseApp.Tests/Module2/InversionCountTest.cs @@ -0,0 +1,56 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.Collections.Generic; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class InversionCountTest : IDisposable + { + private const string Inp1 = @"1 +1"; + + private const string Out1 = @"0"; + + private const string Inp2 = @"2 +3 1"; + + private const string Out2 = @"1"; + + private const string Inp3 = @"5 +5 4 3 2 1"; + + private const string Out3 = @"10"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp2, Out2)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + InversionCount.CountInversion(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/MergeSortTest.cs b/CourseApp.Tests/Module2/MergeSortTest.cs new file mode 100644 index 0000000..07489af --- /dev/null +++ b/CourseApp.Tests/Module2/MergeSortTest.cs @@ -0,0 +1,63 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.Collections.Generic; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class MergeSortTest : IDisposable + { + private const string Inp1 = @"5 +5 4 3 2 1"; + + private const string Out1 = @"1 2 4 5 +4 5 1 2 +3 5 1 3 +1 5 1 5 +1 2 3 4 5"; + + private const string Inp2 = @"1 +1"; + + private const string Out2 = @"1"; + + private const string Inp3 = @"2 +3 1"; + + private const string Out3 = @"1 2 1 3 +1 3"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp1, Out1)] + [InlineData(Inp2, Out2)] + [InlineData(Inp3, Out3)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + MergeSort.MergeSortMethod(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/PairSortTest.cs b/CourseApp.Tests/Module2/PairSortTest.cs new file mode 100644 index 0000000..09a9e04 --- /dev/null +++ b/CourseApp.Tests/Module2/PairSortTest.cs @@ -0,0 +1,60 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.Collections.Generic; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class PairSortTest : IDisposable + { + private const string Inp1 = @"3 +20 80 +30 90 +25 90"; + + private const string Out1 = @"25 90 +30 90 +20 80"; + + private const string Inp2 = @"3 +101 80 +305 90 +200 14"; + + private const string Out2 = @"305 90 +101 80 +200 14"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp1, Out1)] + [InlineData(Inp2, Out2)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + PairSort.PairSortMetod(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/RadixSortTest.cs b/CourseApp.Tests/Module2/RadixSortTest.cs new file mode 100644 index 0000000..2fe9118 --- /dev/null +++ b/CourseApp.Tests/Module2/RadixSortTest.cs @@ -0,0 +1,82 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.Collections.Generic; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class RadixSortTest : IDisposable + { + private const string Inp1 = @"9 +12 +32 +45 +67 +98 +29 +61 +35 +09"; + + private const string Out1 = @"Initial array: +12, 32, 45, 67, 98, 29, 61, 35, 09 +********** +Phase 1 +Bucket 0: empty +Bucket 1: 61 +Bucket 2: 12, 32 +Bucket 3: empty +Bucket 4: empty +Bucket 5: 45, 35 +Bucket 6: empty +Bucket 7: 67 +Bucket 8: 98 +Bucket 9: 29, 09 +********** +Phase 2 +Bucket 0: 09 +Bucket 1: 12 +Bucket 2: 29 +Bucket 3: 32, 35 +Bucket 4: 45 +Bucket 5: empty +Bucket 6: 61, 67 +Bucket 7: empty +Bucket 8: empty +Bucket 9: 98 +********** +Sorted array: +09, 12, 29, 32, 35, 45, 61, 67, 98"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp1, Out1)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + RadixSort.Try(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp.Tests/Module2/WareHouseTest.cs b/CourseApp.Tests/Module2/WareHouseTest.cs new file mode 100644 index 0000000..9a4d771 --- /dev/null +++ b/CourseApp.Tests/Module2/WareHouseTest.cs @@ -0,0 +1,51 @@ +namespace CourseApp.Tests.Module2 +{ + using System; + using System.IO; + using CourseApp.Module2; + using Xunit; + + [Collection("Sequential")] + public class WareHouseTest : IDisposable + { + private const string Inp1 = @"5 +1 50 3 4 3 +16 +1 2 3 4 5 1 3 3 4 5 5 5 5 5 4 5"; + + private const string Out1 = @"yes +no +no +no +yes"; + + public void Dispose() + { + var standardOut = new StreamWriter(Console.OpenStandardOutput()); + standardOut.AutoFlush = true; + var standardIn = new StreamReader(Console.OpenStandardInput()); + Console.SetOut(standardOut); + Console.SetIn(standardIn); + } + + [Theory] + [InlineData(Inp1, Out1)] + public void Test1(string input, string expected) + { + var stringWriter = new StringWriter(); + Console.SetOut(stringWriter); + + var stringReader = new StringReader(input); + Console.SetIn(stringReader); + + // act + CourseApp.Module2.WareHouse.CountInversion(); + + // assert + var output = stringWriter.ToString().Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries); + var result = string.Join(Environment.NewLine, output); + + Assert.Equal($"{expected}", result); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module2/BubbleSort.cs b/CourseApp/Module2/BubbleSort.cs index cc49214..915154b 100644 --- a/CourseApp/Module2/BubbleSort.cs +++ b/CourseApp/Module2/BubbleSort.cs @@ -1,38 +1,47 @@ using System; -using System.Collections.Generic; -using System.Text; namespace CourseApp.Module2 { - public class BubbleSort + public static class BubbleSort { - public static void BubbleSortMethod() + private static bool swapped = false; + + public static void SortOff() { - int n = int.Parse(Console.ReadLine()); + int x = int.Parse(Console.ReadLine()); string s = Console.ReadLine(); string[] sValues = s.Split(' '); - int[] arr = new int[n]; - for (int i = 0; i < n; i++) + int[] arr = new int[x]; + for (int d = 0; d < x; d++) { - arr[i] = int.Parse(sValues[i]); + arr[d] = int.Parse(sValues[d]); } - for (int i = 0; i < arr.Length - 1; i++) + for (int r = 0; r < arr.Length; r++) { - for (int j = 0; j < arr.Length - i - 1; j++) + for (int j = 0; j < arr.Length - r - 1; j++) { if (arr[j] > arr[j + 1]) { - // int temp = arr[j]; - // arr[j] = arr[j + 1]; - // arr[j+1] = temp; - (arr[j], arr[j + 1]) = (arr[j + 1], arr[j]); + Swap(ref arr[j], ref arr[j + 1]); + string result = string.Join(" ", arr); + Console.WriteLine(result); + swapped = true; } } } - string result = string.Join(" ", arr); - Console.WriteLine(result); + if (swapped == false) + { + Console.WriteLine(0); + } + } + + private static void Swap(ref int left, ref int r) + { + int t = r; + r = left; + left = t; } } -} +} \ No newline at end of file diff --git a/CourseApp/Module2/DifferentCount.cs b/CourseApp/Module2/DifferentCount.cs new file mode 100644 index 0000000..ed0f7fe --- /dev/null +++ b/CourseApp/Module2/DifferentCount.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; + +namespace CourseApp.Module2 +{ + public class DifferentCount + { + public static void CountDifferent() + { + int[] arr = InputParse(); + HashSet set = new HashSet(); + for (int i = 0; i < arr.Length; i++) + { + set.Add(arr[i]); + } + + Console.WriteLine(set.Count); + } + + private static int[] InputParse() + { + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + string s = Console.ReadLine(); + string[] sValues = s.Split(' '); + for (int i = 0; i < n; i++) + { + arr[i] = int.Parse(sValues[i]); + } + + return arr; + } + } +} diff --git a/CourseApp/Module2/InversionCount.cs b/CourseApp/Module2/InversionCount.cs new file mode 100644 index 0000000..6af8641 --- /dev/null +++ b/CourseApp/Module2/InversionCount.cs @@ -0,0 +1,81 @@ +using System; + +namespace CourseApp.Module2 +{ + public class InversionCount + { + private static long count = 0; + + public static void CountInversion() + { + int[] arr = InputParse(); + ArrSort(ref arr); + + Console.WriteLine(count); + } + + private static int[] Merge(ref int[] left, ref int[] right) + { + int i = 0; + int j = 0; + int[] add = new int[left.Length + right.Length]; + for (int k = 0; k < add.Length; k++) + { + if (j == right.Length || (i < left.Length && left[i] <= right[j])) + { + add[k] = left[i]; + i++; + } + else + { + count += left.Length - i; + add[k] = right[j]; + j++; + } + } + + return add; + } + + private static int[] ArrSort(ref int[] arr) + { + if (arr.Length < 2) + { + return arr; + } + + int mid = arr.Length / 2; + + int[] left = new int[mid]; + int[] right = new int[arr.Length - mid]; + + for (int i = 0; i < left.Length; i++) + { + left[i] = arr[i]; + } + + for (int i = 0; i < right.Length; i++) + { + right[i] = arr[mid + i]; + } + + left = ArrSort(ref left); + right = ArrSort(ref right); + return Merge(ref left, ref right); + } + + private static int[] InputParse() + { + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + string s = Console.ReadLine(); + string[] sValues = s.Split(' '); + for (int i = 0; i < n; i++) + { + arr[i] = int.Parse(sValues[i]); + } + + return arr; + } + } +} diff --git a/CourseApp/Module2/MergeSort.cs b/CourseApp/Module2/MergeSort.cs new file mode 100644 index 0000000..84db635 --- /dev/null +++ b/CourseApp/Module2/MergeSort.cs @@ -0,0 +1,78 @@ +using System; + +namespace CourseApp.Module2 +{ + public class MergeSort + { + public static void MergeSortMethod() + { + int[] arr = InputParse(); + + int[] sortedArr = ArrSort(ref arr, 0, arr.Length); + + Console.WriteLine("{0}", string.Join(" ", sortedArr)); + } + + private static int[] Merge(ref int[] left, ref int[] right) + { + int i = 0; + int j = 0; + int[] add = new int[left.Length + right.Length]; + for (int k = 0; k < add.Length; k++) + { + if (i == left.Length) + { + add[k] = right[j]; + j++; + } + else if (j == right.Length || left[i] <= right[j]) + { + add[k] = left[i]; + i++; + } + else + { + add[k] = right[j]; + j++; + } + } + + return add; + } + + private static int[] ArrSort(ref int[] arr, int begin, int end) + { + if (end - begin == 1) + { + int[] res = new int[1]; + res[0] = arr[begin]; + return res; + } + + int mid = (begin + end) / 2; + + int[] left = ArrSort(ref arr, begin, mid); + int[] right = ArrSort(ref arr, mid, end); + + int[] sort = Merge(ref left, ref right); + + Console.WriteLine("{0} {1} {2} {3}", begin + 1, end, sort[0], sort[^1]); + + return Merge(ref left, ref right); + } + + private static int[] InputParse() + { + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + string s = Console.ReadLine(); + string[] sValues = s.Split(' '); + for (int i = 0; i < n; i++) + { + arr[i] = int.Parse(sValues[i]); + } + + return arr; + } + } +} \ No newline at end of file diff --git a/CourseApp/Module2/PairSort.cs b/CourseApp/Module2/PairSort.cs new file mode 100644 index 0000000..5dae52d --- /dev/null +++ b/CourseApp/Module2/PairSort.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace CourseApp.Module2 +{ + public class PairSort + { + public static void PairSortMetod() + { + int n = int.Parse(Console.ReadLine()); + int[] number = new int[n]; + int[] price = new int[n]; + for (int i = 0; i < n; i++) + { + string s = Console.ReadLine(); + string[] sValues = s.Split(' '); + number[i] = int.Parse(sValues[0]); + price[i] = int.Parse(sValues[1]); + } + + for (int i = 0; i < price.Length - 1; i++) + { + for (int j = 0; j < price.Length - i - 1; j++) + { + if (price[j] < price[j + 1]) + { + (price[j], price[j + 1]) = (price[j + 1], price[j]); + (number[j], number[j + 1]) = (number[j + 1], number[j]); + } + else if (price[j] == price[j + 1]) + { + if (number[j] > number[j + 1]) + { + (number[j], number[j + 1]) = (number[j + 1], number[j]); + (price[j], price[j + 1]) = (price[j + 1], price[j]); + } + } + } + } + + for (int i = 0; i < n; i++) + { + Console.WriteLine("{0} {1}", number[i], price[i]); + } + } + } +} \ No newline at end of file diff --git a/CourseApp/Module2/RadixSort.cs b/CourseApp/Module2/RadixSort.cs new file mode 100644 index 0000000..5db3b2e --- /dev/null +++ b/CourseApp/Module2/RadixSort.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace CourseApp.Module2 +{ + public class RadixSort + { + public static string[] CountSort(string[] arr_string, int phase, int len) + { + ulong i; + List[] arrayList = new List[10]; + for (int g = 0; g < 10; g++) + { + arrayList[g] = new List(); + } + + for (int j = 0; j < arr_string.Length; j++) + { + int k = int.Parse(arr_string[j].Substring(len - phase, 1)); + arrayList[k].Add(arr_string[j]); + } + + for (i = 0; i < 10; i++) + { + if (arrayList[i].Count == 0) + { + Console.WriteLine("Bucket " + i + ": empty"); + } + else + { + Console.WriteLine("Bucket " + i + ": {0}", string.Join(", ", arrayList[i])); + } + } + + int l = 0; + + for (i = 0; i < 10; i++) + { + for (int j = 0; j < arrayList[i].Count; j++) + { + arr_string[l] = arrayList[i][j]; + l++; + } + } + + return arr_string; + } + + public static void Radixsort(string[] arr_string, ulong n) + { + int numb_phaze = 1; + int rank = arr_string[0].Length; + + Console.WriteLine("Initial array:"); + Console.WriteLine("{0}", string.Join(", ", arr_string)); + + foreach (var i in Enumerable.Range(0, Convert.ToInt32(Math.Ceiling(Convert.ToDouble(-1 - (rank - 1)) / -1))).Select(x_1 => rank - 1 + (x_1 * -1))) + { + Console.WriteLine("**********"); + Console.WriteLine("Phase {0}", numb_phaze); + arr_string = CountSort(arr_string, numb_phaze, rank); + numb_phaze++; + } + + Console.WriteLine("**********"); + Console.WriteLine("Sorted array:"); + Console.Write("{0}", string.Join(", ", arr_string)); + } + + public static void Try() + { + ulong n = ulong.Parse(Console.ReadLine()); + string[] arr_string = new string[n]; + for (ulong i = 0; i < n; i++) + { + arr_string[i] = Console.ReadLine(); + } + + Radixsort(arr_string, n); + } + } +} \ No newline at end of file diff --git a/CourseApp/Module2/WareHouse.cs b/CourseApp/Module2/WareHouse.cs new file mode 100644 index 0000000..8300711 --- /dev/null +++ b/CourseApp/Module2/WareHouse.cs @@ -0,0 +1,71 @@ +using System; + +namespace CourseApp.Module2 +{ + public class WareHouse + { + public static void CountInversion() + { + int[] goods = InputParse(); + int[] orders = InputParse(); + + int min = int.MaxValue; + int max = int.MinValue; + + FindBounds(ref orders, ref min, ref max); + int[] counted = CountElements(ref orders, min, max); + Compare(ref goods, ref counted); + } + + private static int[] InputParse() + { + int n = int.Parse(Console.ReadLine()); + int[] arr = new int[n]; + string s = Console.ReadLine(); + string[] sValues = s.Split(' '); + for (int i = 0; i < n; i++) + { + arr[i] = int.Parse(sValues[i]); + } + + return arr; + } + + private static void FindBounds(ref int[] arr, ref int min, ref int max) + { + for (int i = 0; i < arr.Length; i++) + { + min = Math.Min(min, arr[i]); + max = Math.Max(max, arr[i]); + } + } + + private static int[] CountElements(ref int[] arr, int min, int max) + { + int length = (max - min) + 1; + int[] add = new int[length]; + + for (int i = 0; i < arr.Length; i++) + { + add[arr[i] - min]++; + } + + return add; + } + + private static void Compare(ref int[] arr, ref int[] add) + { + for (int i = 0; i < arr.Length; i++) + { + if (arr[i] < add[i]) + { + Console.WriteLine("yes"); + } + else + { + Console.WriteLine("no"); + } + } + } + } +} \ No newline at end of file diff --git a/CourseApp/Program.cs b/CourseApp/Program.cs index cafa825..c577275 100644 --- a/CourseApp/Program.cs +++ b/CourseApp/Program.cs @@ -7,9 +7,17 @@ public class Program { public static void Main(string[] args) { - BubbleSort.BubbleSortMethod(); + RadixSort.Try(); - Console.WriteLine("Hello World"); + /*WareHouse.CountInversion();*/ + + /* DifferentCount.CountDifferent();*/ + + /*InversionCount.CountInversion();*/ + + // MergeSort.MergeSortMethod(); + // BubbleSort.SortOff(); + /*PairSort.PairSortMetod();*/ } } -} +} \ No newline at end of file diff --git a/README.md b/README.md index e58af8a..0c2555a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Tprogramming_42_2020 - -Master branch :) \ No newline at end of file +Katrovsev I.A. +Master branch :)