Skip to content

Commit 94fba2d

Browse files
authored
Merge pull request #200 from arshadpatel/myfeature
Created new folders for each programming language and organised all the files in their respective folders.
2 parents bf568b4 + 4806283 commit 94fba2d

File tree

139 files changed

+283
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+283
-252
lines changed
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
#include <bits/stdc++.h>
2-
using namespace std;
3-
int main()
4-
{
5-
int t;
6-
cin >> t;
7-
while (t--)
8-
{
9-
int n, k, x, y;
10-
cin >> n >> k >> x >> y;
11-
int sum = k * x;
12-
if (n - k > 0)
13-
{
14-
15-
if ((n - k) * x > (n - k) * y)
16-
sum += (n - k) * y;
17-
else
18-
sum += (n - k) * x;
19-
}
20-
cout << sum << endl;
21-
}
22-
return 0;
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
cin >> t;
7+
while (t--)
8+
{
9+
int n, k, x, y;
10+
cin >> n >> k >> x >> y;
11+
int sum = k * x;
12+
if (n - k > 0)
13+
{
14+
15+
if ((n - k) * x > (n - k) * y)
16+
sum += (n - k) * y;
17+
else
18+
sum += (n - k) * x;
19+
}
20+
cout << sum << endl;
21+
}
22+
return 0;
2323
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)