Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Kolbi
- {
- class Kolbi
- {
- static void Main(string[] args)
- {
- double[] input = Console.ReadLine().Split(new char[] { ' ' },StringSplitOptions.RemoveEmptyEntries).Select(double.Parse).ToArray();
- double numOfColbes = input[0];
- double volume = input[1];
- double[] volumes = new double[(int)numOfColbes + 1];
- volumes[0] = 0;
- volumes[1] = 1;
- if (volume > 1)
- {
- for (int i = 2; i <= numOfColbes; i++)
- {
- volumes[i] = i - 1 + volumes[i - 1];
- if (volume <= volumes[i])
- {
- if (i % 2 != 0)
- {
- Console.WriteLine(i);
- break;
- }
- }
- }
- }
- else if (volume > 0 && volume <=1)
- {
- Console.WriteLine("3");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement