English
Open in Telegram

Postimport java.util.*;

20 February 2025
D
Deloitte | COGNIZANT | IBM | CAPGEMINI
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] arr = new int[N]; for (int i = 0; i < N; i++) { arr[i] = sc.nextInt(); } double avg= 0; int sum = 0; for (int i = 0; i < K; i++) { sum += arr[i]; } avg = (double) sum / K; for (int i = K; i < N; i++) { sum = sum - arr[i - K] + arr[i]; double cur = (double) sum / K; if (cur > avg) { avg = cur; } } System.out.printf("%.2f\n", avg); sc.close(); } } #BIRLASOFT
930 ·

Nearby in the feed

DDeloitte | COGNIZANT | IBM | CAPGEMINIAmazon exam ✅✅ Contact: @MLCODER2DDeloitte | COGNIZANT | IBM | CAPGEMINIBIRLASOFT CODING ✅✅✅ CONTACT: @MLCODER2
this message
DDeloitte | COGNIZANT | IBM | CAPGEMINIpublic class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n= sc.nextInt(); int x=sc.nextInt(); int[] arr=new int[n];DDeloitte | COGNIZANT | IBM | CAPGEMINICOGNIZANT EXAM CLEARED ✅✅✅ CONTACT: @MLCODER2
DDeloitte | COGNIZANT | IBM | CAPGEMINIDeloitte | COGNIZANT | IBM | CAPGEMINI@python_java_Coding · channel · Tech
7 178subscribers406average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count