Skip to content

Commit 6ddadb3

Browse files
authored
Add problem statement for blogger selection challenge
Added problem description for selecting bloggers based on followers, including input/output formats and constraints.
1 parent 4ac2870 commit 6ddadb3

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
## Problem Description
2+
3+
Masha works in an advertising agency. In order to promote a new brand, she wants to conclude contracts with some bloggers.
4+
5+
Masha has connections with `n` different bloggers. Blogger numbered `i` has `ai` followers.
6+
7+
Due to a limited budget, Masha can only sign contracts with `k` different bloggers. She wants the advertisement to be seen by as many people as possible, so she must choose bloggers such that the **total number of followers is maximized**.
8+
9+
Your task is to find the **number of ways** to select `k` bloggers so that the total number of their followers is maximum possible.
10+
11+
Two ways are considered different if there is at least one blogger selected in one way but not in the other.
12+
13+
---
14+
15+
## Input Format
16+
17+
- The first line contains an integer `t` — the number of test cases.
18+
- For each test case:
19+
- The first line contains two integers `n` and `k`
20+
- The second line contains `n` integers `a1, a2, ..., an`, where `ai` is the number of followers of the `i`-th blogger
21+
22+
---
23+
24+
## Output Format
25+
26+
- For each test case, print a single integer — the number of ways to select `k` bloggers such that the total number of followers is maximum possible.
27+
- Since the answer can be large, print it modulo `10^9 + 7`.
28+
29+
---
30+
31+
32+
33+
## Constraints
34+
35+
- `1 ≤ t ≤ 1000`
36+
- `1 ≤ k ≤ n ≤ 1000`
37+
- `1 ≤ ai ≤ n`
38+
- The sum of `n` over all test cases does not exceed `1000`
39+
40+
---
41+
42+
## Sample Input
43+
44+
```
45+
3
46+
4 3
47+
1 3 1 2
48+
4 2
49+
1 1 1 1
50+
2 1
51+
1 2
52+
```
53+
---
54+
55+
## Output
56+
57+
```
58+
2
59+
6
60+
1
61+
```
62+
63+
---
64+
65+
### Additional Resource
66+
67+
For understanding **modular arithmetic and modular inverses**, which are useful for solving problems with answers modulo `10^9+7`, you can check this video:
68+
https://youtu.be/RCq5TYMZEwg
69+
70+
---
71+
72+
73+
[PROBLEM LINK](http://codeforces.com/contest/1475/problem/E)

0 commit comments

Comments
 (0)