If the friends take m photos, there are exactly m(n−1) appearances in total. Everyone needs at least k appearances, so m(n−1)≥nk. Therefore, at least ⌈nk/(n−1)⌉ photos are necessary.
Taking turns
Let m=⌈nk/(n−1)⌉, and let friends take turns being the photographer in the order 1,2,…,n,1,2,….
Each friend takes at most ⌈m/n⌉ photos. From m(n−1)≥nk, we obtain m/n≤m−k. Since m−k is an integer, ⌈m/n⌉≤m−k. Thus, every friend appears in at least m−⌈m/n⌉≥k photos.
The lower bound is achievable, so answer=⌈nk/(n−1)⌉. Using integer division, compute it as (nk+n−2)/(n−1).
The time complexity is O(1), and the extra space complexity is O(1).