Click here to Skip to main content
15,885,767 members
Home / Discussions / Python
   

Python

 
QuestionPython learning Pin
Nahid.hb25-Dec-22 1:01
Nahid.hb25-Dec-22 1:01 
AnswerRe: Python learning Pin
OriginalGriff25-Dec-22 1:06
mveOriginalGriff25-Dec-22 1:06 
AnswerRe: Python learning Pin
Kevin McFarlane10-Jan-23 0:05
Kevin McFarlane10-Jan-23 0:05 
QuestionTennis racket Pin
Member 1586879618-Dec-22 10:04
Member 1586879618-Dec-22 10:04 
QuestionRe: Tennis racket Pin
Richard MacCutchan18-Dec-22 21:46
mveRichard MacCutchan18-Dec-22 21:46 
QuestionMessage Closed Pin
6-Dec-22 21:28
Tangent Technologies6-Dec-22 21:28 
AnswerRe: Variables Pin
trønderen6-Dec-22 22:29
trønderen6-Dec-22 22:29 
QuestionDSA DOUBT Pin
Krishang Gupta1-Dec-22 11:03
Krishang Gupta1-Dec-22 11:03 
Room arrangements
This year politicians and economists have been invited to participate in Stanford Institute for Theoretical Economics (SITE 2021) conference as guests. You have to accommodate them in r rooms such that-
No room may remain empty.
A room may contain either only politicians or only economists, not both.
No economists are allowed to stay alone in a room.
Find the number of ways to place them. Note though, that all the rooms are identical. But each of the economists and politicians are unique.
Since the number of ways can be very large, print the answer modulo 998,244,353.
Input Format:
The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
The first and only line of each test case contains three space-separated integers p, q and r denoting the number of politicians, economists and rooms.
Output Format:
For each test case, output the number of ways to place them modulo 998,244,353.
Constraints
1≤T≤100
1≤p,q,r≤100
Sample Input:
4
2 1 4
2 4 4
2 5 4
2 8 4
Sample Output:
0
3
10
609
Explanation:
Test case 1: 4 rooms and 3 people. A room would remain empty.
Test case 2: There are 4 rooms and 6 people. There are 3 possible ways to distribute these 6 people in 3 rooms.

{Politician 1}, {Politician 2}, {Economist 1, Economist 2}, {Economist 3, Economist 4}
{Politician 1}, {Politician 2}, {Economist 1, Economist 3}, {Economist 2, Economist 4}
{Politician 1}, {Politician 2}, {Economist 1, Economist 4}, {Economist 2, Economist 3}
Please note that the rooms are identical.
AnswerRe: DSA DOUBT Pin
Richard Deeming1-Dec-22 22:08
mveRichard Deeming1-Dec-22 22:08 
QuestionHow to iterate within a list in python? Pin
ryandaniel1724-Nov-22 18:48
ryandaniel1724-Nov-22 18:48 
AnswerRe: How to iterate within a list in python? Pin
Richard MacCutchan24-Nov-22 22:13
mveRichard MacCutchan24-Nov-22 22:13 
AnswerRe: How to iterate within a list in python? Pin
Gulshan Negi15-Mar-23 23:28
professionalGulshan Negi15-Mar-23 23:28 
QuestionPlz Help Trying to make driving game more realistic and fun (pygame) Pin
s897422-Nov-22 20:41
s897422-Nov-22 20:41 
AnswerRe: Plz Help Trying to make driving game more realistic and fun (pygame) Pin
Gulshan Negi14-Feb-23 21:34
professionalGulshan Negi14-Feb-23 21:34 
QuestionPython Code Related Pin
Mr.Zeenore18-Nov-22 12:28
Mr.Zeenore18-Nov-22 12:28 
AnswerRe: Python Code Related Pin
Dave Kreskowiak18-Nov-22 17:55
mveDave Kreskowiak18-Nov-22 17:55 
GeneralRe: Python Project Question Pin
Mr.Zeenore18-Nov-22 21:36
Mr.Zeenore18-Nov-22 21:36 
AnswerRe: Python Project Question Pin
OriginalGriff18-Nov-22 21:36
mveOriginalGriff18-Nov-22 21:36 
GeneralRe: Python Project Question Pin
Craig Robbins7-Dec-22 1:06
Craig Robbins7-Dec-22 1:06 
GeneralRe: Python Project Question Pin
trønderen7-Dec-22 3:04
trønderen7-Dec-22 3:04 
GeneralRe: Python Code Related Pin
Mr.Zeenore18-Nov-22 20:09
Mr.Zeenore18-Nov-22 20:09 
GeneralRe: Python Code Related Pin
Dave Kreskowiak19-Nov-22 4:07
mveDave Kreskowiak19-Nov-22 4:07 
AnswerRe: Python Code Related Pin
Richard MacCutchan18-Nov-22 22:35
mveRichard MacCutchan18-Nov-22 22:35 
QuestionPython vs. PHP - Web Application Development Pin
vitaassure15-Nov-22 10:30
professionalvitaassure15-Nov-22 10:30 
AnswerRe: Python vs. PHP - Web Application Development Pin
Gerry Schmitz15-Nov-22 12:11
mveGerry Schmitz15-Nov-22 12:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.