# Your Task
The city of Darkishland has a strange hotel with infinite rooms. The groups that come to this hotel follow the following rules:

* At the same time only members of one group can rent the hotel.

* Each group comes in the morning of the check-in day and leaves the hotel in the evening of the check-out day.

* Another group comes in the very next morning after the previous group has left the hotel.

* A very important property of the incoming group is that it has one more member than its previous group unless it is the starting group. You will be given the number of members of the starting group.

* A group with n members stays for n days in the hotel. For example, if a group of four members comes on 1st August in the morning, it will leave the hotel on 4th August in the evening and the next group of five members will come on 5th August in the morning and stay for five days and so on.

Given the initial group size you will have to find the group size staying in the hotel on a specified day.
# Input
S denotes the initial size of the group and D denotes that you will have to find the group size staying in the hotel on D-th day (starting from 1). A group size S
means that on the first day a group of S members comes to the hotel and stays for S days. Then comes a group of S + 1 members according to the previously described rules and so on.

Difficulty: introductory

Starter code:

def group_size(S, D):
	

Solutions:
from math import floor
def group_size(S, D):
    return floor((2*D+S*(S-1))**.5+.5)

from math import sqrt, ceil

# 1st group spends in the hotel s days,
#  2nd group - s + 1 days,
#  3rd group - s + 2 days,
#  ...,
#  nth group - s + n - 1 days.
#
# The total number of days for n groups: n * (s + s + n - 1) / 2 
#  (by the formula of arithmetic series).
# Let d be the last day of the nth group. Then
#  n * (s + s + n - 1) / 2 = d, 
#  n**2 + (2*s-1)*n - 2*d = 0,  
#  The only possible root of this quadratic equation equals
#  1/2 * (-p + sqrt(p**2 - 4*q), where p = 2*s - 1, q = 2*d.  
#  Thus, n = (1 - 2*s + sqrt((2*s - 1)**2 + 8*d)) / 2.
# But if d is not the last day of the group n, then n will be fractional,
#   and we have to round it up (get the ceiling of n).

def group_size(s, d):
    n = ceil((1 - 2*s + sqrt((2*s - 1)**2 + 8*d)) / 2)
    return s + n - 1

from math import sqrt

def group_size(size, day):
    skip = size * (size - 1) // 2
    day += skip
    return round(sqrt(day * 2))

from math import floor,sqrt

def group_size(s,d):
    return floor(sqrt(2*d+s*(s-1))+0.5)

def group_size(S, D):
    a000217 = lambda n: (n + 1) * n // 2
    a002024 = lambda n: int((1 + (1 + 8 * n) ** .5) / 2)
    return a002024(D - 1 + a000217(S - 1))

from math import ceil

def group_size(S, D):
    return  ceil((0.25 + 2 * D + S * (S - 1))**0.5 - 0.5)

group_size=lambda S,D:((2*D+S*S-S)**.5+.5)//1

from math import ceil
def group_size(S,D):
    b=2*S-1
    return ceil((-b+(b**2+8*D)**0.5)/2)-1+S

from math import ceil
def group_size(S, D):
    return ceil(((1+4*(S**2-S+2*D))**.5-1)/2)

import math

def group_size(S, D):
    return math.ceil(((-1 +(1 - 4 * S + 4 * S ** 2 + 8 * D) ** 0.5) / 2))