Company: Hsbc

Difficulty: hard

Problem Statement

Mighty Area There is a conference room having n chairs arranged in a circular fashion. A total of p people are to be seated in the conference room along with the Manager. But due to COVID, there should be at least c chairs between two people to maintain social distancing. The Manager can sit wherever he likes. Find the total number of seating arrangements that satisfy the above criterion. All the people are considered identical; therefore, two arrangements are considered different if either the Manager is seated at a different place or the set of seats occupied is different. Since the output can be too large, return the output modulo 10^9 + 7 . Input Format The input consists of a single line: The line contains three space-separated numbers n , p and c respectively. The input will be read from the STDIN by the candidate. Output Format Print the total number of seating arrangements that satisfy the above criterion. Since the output can be too large, return the output modulo 10^9 + 7 . T

More Hsbc OA questionsInterview experiences