Skip to content

Commit

Permalink
Added new problem
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalmishraa committed Jul 26, 2024
1 parent c52ffb3 commit df810c0
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 0 deletions.
48 changes: 48 additions & 0 deletions apps/problems/Software-Dev/Problem.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## Problem: Project Decorations

### Description
You are managing a software development team, and you need to assign developers to projects. You have `f` frontend engineers, `b` backend engineers, and `d` devops engineers. To fully staff a single project, you need exactly three engineers, there can be 2 engineers of the same type but all 3 should not be the same.

What is the maximum number of projects that can be fully staffed given the number of developers of each specialization?

### Input
The input consists of a single line containing three integers `f`, `b`, and `d` (0 ≤ `f`, `b`, `d` ≤ 2·10^9) — the number of frontend, backend, and database engineers respectively. The numbers are separated by exactly one space.

### Output
Print a single integer — the maximum number of projects that can be fully staffed in the required manner.

### Example

#### Input
```
5 4 3
```

#### Output
```
4
```

#### Input
```
1 1 1
```

#### Output
```
1
```

#### Input
```
2 3 3
```

#### Output
```
2
```

### Note

In the first example, you can fully staff the projects with the following sets of developers: "frontend-backend-backend", "backend-devops-devops", "devops-frontend-frontend", "frontend-frontend-backend", where "frontend", "backend", and "devops" represent the specializations of the developers, respectively.
8 changes: 8 additions & 0 deletions apps/problems/Software-Dev/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Problem Name: "Software-Dev"
Function Name: solve
Input Structure:
Input Field: int F
Input Field: int B
Input Field: int D
Output Structure:
Output Field: int F
3 changes: 3 additions & 0 deletions apps/problems/Software-Dev/tests/inputs/0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
5
4
3
3 changes: 3 additions & 0 deletions apps/problems/Software-Dev/tests/inputs/1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1
1
1
3 changes: 3 additions & 0 deletions apps/problems/Software-Dev/tests/inputs/2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2
3
3
3 changes: 3 additions & 0 deletions apps/problems/Software-Dev/tests/inputs/3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0
1
0
3 changes: 3 additions & 0 deletions apps/problems/Software-Dev/tests/inputs/4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1000
1000
1002
1 change: 1 addition & 0 deletions apps/problems/Software-Dev/tests/outputs/0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
1 change: 1 addition & 0 deletions apps/problems/Software-Dev/tests/outputs/1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 1 addition & 0 deletions apps/problems/Software-Dev/tests/outputs/2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
1 change: 1 addition & 0 deletions apps/problems/Software-Dev/tests/outputs/3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions apps/problems/Software-Dev/tests/outputs/4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1000

0 comments on commit df810c0

Please sign in to comment.