We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a00328c commit c5fbf04Copy full SHA for c5fbf04
1 file changed
January Long Challenge/Q1.java
@@ -0,0 +1,30 @@
1
+package jan_long;
2
+import java.util.*;
3
+public class Q1 {
4
+
5
+ public static void main(String[] args) {
6
+ Scanner sc=new Scanner(System.in);
7
+ int test=sc.nextInt();
8
+ while(test-->0) {
9
+ int n,k,d;
10
+ n=sc.nextInt();
11
+ k=sc.nextInt();
12
+ d=sc.nextInt();
13
+ int arr[]=new int[n];
14
+ for(int i=0;i<n;i++) {
15
+ arr[i]=sc.nextInt();
16
+ }
17
+ int sum=0;
18
19
+ sum+=arr[i];
20
21
+ int res=sum/k;
22
+ if(res>d) {
23
+ res=d;
24
25
+ System.out.println(res);
26
27
+ sc.close();
28
29
30
+}
0 commit comments