select deptno,min(sal) from emp group by deptno having avg(sal) = (select max(avg(sal)) from emp group by deptno);