Company: Flipkart Grid 8.0 round 3_26july
Difficulty: medium
A marketing team wants to group customers into segments based on two numerical behavior-related features. No category labels are available, so the groups must be discovered with clustering. Generate a synthetic dataset and use K-Means clustering to form the required number of customer segments. Dataset Generation Generate the dataset with make_blobs from sklearn.datasets , using exactly these fixed parameters: n_samples = 360 centers = 3 n_features = 2 cluster_std = 1.2 random_state = 11 These five values are constant for every test case — they never depend on the input. Task Write a Python program that performs the following steps: 1. Generate the synthetic dataset using the specified parameters. 2. Read two integers from standard input: n_clusters and random_state . 3. Initialize a KMeans model using exactly: - n_clusters equal to the first input value - random_state equal to the second input value - n_init = 10 4. Train the K-Means model on the generated dataset. 5. Count the number