using System.Collections.Generic;
public static void Main()
List<int> productIds = new() { 12345, 23456, 34567 };
Dictionary<int, Dictionary<int, int>> quantityByWarehouseByProductId = new()
IEnumerable<int> warehouseIdsWithAllProductsInStock = quantityByWarehouseByProductId
.IntersectBy(productIds, qbwForPid => qbwForPid.Key)
.SelectMany(qbwForPid => qbwForPid.Value)
.Where(qsbw => qsbw.All(qbw => qbw.Value >= 1))
.Select(qsbw => qsbw.Key);
Console.WriteLine(string.Join(", ", warehouseIdsWithAllProductsInStock));