A graph G is (j, k)-colorable if its vertices can be partitioned into subsets V-1 and V-2 such that every vertex in G[V-1] has degree at most j and every vertex in G[V-2] has degree at most k. We prove that if k >= 2j + 2, then every graph with maximum average degree at most 2(2 - k+2/(j+2)(k+1)) is (j, k)-colorable. On the other hand, we construct graphs with the maximum average degree arbitrarily close to 2(2 - k+2/(j+2)(k+1)) (from above) that are not (j, k)-colorable. In fact, we prove a stronger result by establishing the best possible sufficient condition for the (j, k)-colorability of a graph G in terms of the minimum, phi(j,k)(G), of the difference phi(j,k)(W, G) = (2 - k+2/(j+2)(k+1))vertical bar W vertical bar - vertical bar E(G[W])vertical bar over all subsets W of V(G). Namely, every graph G with phi(j,k)(G) > -1/k+1 is (j, k)-colorable. On the other hand, we construct infinitely many non-(j, k)-colorable graphs G with phi(j,k)(G) = -1/k+1. (C) 2013 Elsevier Inc. All rights reserved.